提交 c8db9821 作者: 王定

feat: 完成可信农资

上级 f50ab356
...@@ -6,7 +6,7 @@ enum Api { ...@@ -6,7 +6,7 @@ enum Api {
postEnterpriseAdd = '/server/enterprise/add', // 入驻申请 postEnterpriseAdd = '/server/enterprise/add', // 入驻申请
getEnterpriseDetail= '/server/enterprise/detail', // 企业详情 getEnterpriseDetail= '/server/enterprise/detail', // 企业详情
postGoodsAdd = '/trade/goods/add', // 农资商品管理-添加 postGoodsAdd = '/trade/goods/add', // 农资商品管理-添加
getGoodsQueryById = '/trade/goods/queryById', // 农资商品管理-通过id查询 getGoodsQueryById = '/trade/goods/listByEnterpriseId', // 农资商品管理-通过id查询
} }
/** /**
* @param params 请求参数 * @param params 请求参数
......
...@@ -8,15 +8,17 @@ ...@@ -8,15 +8,17 @@
import * as LinghuoyonggongAPI from '@/api/model/linghuoyonggong' import * as LinghuoyonggongAPI from '@/api/model/linghuoyonggong'
const userStore = useUserStore() const userStore = useUserStore()
const globSetting = useGlobSetting() const globSetting = useGlobSetting()
let enterpriseId = null;
onLoad((options) => { onLoad((options) => {
let param = JSON.parse(decodeURIComponent(options.param)); let param = JSON.parse(decodeURIComponent(options.param));
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: param.name title: param.name
}); });
getDetailData(param.id); enterpriseId = param.id;
getDetailData(enterpriseId);
queryByCategoryAndCode(0,null); queryByCategoryAndCode(0,null);
queryByCategory(); queryByCategory();
getGoodsQueryById(param.id); getGoodsQueryById();
}) })
const toastRef = ref() const toastRef = ref()
const unitPopupRef = ref(null); const unitPopupRef = ref(null);
...@@ -38,6 +40,8 @@ ...@@ -38,6 +40,8 @@
categoryText:[], categoryText:[],
categoryVal:[], categoryVal:[],
enterpriseProduct:[],
rules: [ rules: [
{ {
name: 'name', name: 'name',
...@@ -84,10 +88,9 @@ ...@@ -84,10 +88,9 @@
enterpriseId:"", // 企业ID enterpriseId:"", // 企业ID
image:"" image:""
}) })
function getGoodsQueryById(id){ function getGoodsQueryById(){
NongzhiAPI.getEnterpriseList({id:id}).then((res) => { NongzhiAPI.getGoodsQueryById({enterpriseId:enterpriseId}).then((res) => {
console.log("查询到的产品"); pageData.enterpriseProduct = res;
console.log(res);
}) })
} }
// 文件上传 // 文件上传
...@@ -155,8 +158,6 @@ ...@@ -155,8 +158,6 @@
// 查询商品分类 // 查询商品分类
function queryByCategory(){ function queryByCategory(){
LinghuoyonggongAPI.gitListByCodeDict({ code : 'category'}).then(res=>{ LinghuoyonggongAPI.gitListByCodeDict({ code : 'category'}).then(res=>{
console.log("查询到的商品分类");
console.log(res);
pageData.categoryOptions = res; pageData.categoryOptions = res;
let textArr = []; let textArr = [];
for(let i = 0; i < res.length; i++){ for(let i = 0; i < res.length; i++){
...@@ -200,7 +201,7 @@ ...@@ -200,7 +201,7 @@
}) })
pageData.isPopupShow = false; pageData.isPopupShow = false;
setTimeout(()=>{ setTimeout(()=>{
getGoodsQueryById(productInfo.id); getGoodsQueryById();
},500) },500)
}) })
} }
...@@ -223,8 +224,21 @@ ...@@ -223,8 +224,21 @@
} }
} }
function handlePublish() { function handlePublish() {
productInfo.id = "";
productInfo.name = "";
productInfo.mobile = "";
productInfo.category = "";
productInfo.minSellPrice = "";
productInfo.maxSellPrice = "";
productInfo.unit = "";
productInfo.image = "";
pageData.isPopupShow = true; pageData.isPopupShow = true;
} }
function makePhoneCall(){
uni.makePhoneCall({
phoneNumber: pageData.data.createBy
});
}
</script> </script>
<template> <template>
<view class="w-full h-95vh bg-#E6F5E8 detail_page"> <view class="w-full h-95vh bg-#E6F5E8 detail_page">
...@@ -247,13 +261,18 @@ ...@@ -247,13 +261,18 @@
<view class="module_title">主营产品</view> <view class="module_title">主营产品</view>
<view class="module_separate"></view> <view class="module_separate"></view>
<view class="module_business"> <view class="module_business">
<view class="business_item" v-for="(item,index) in 5" :key="index"> <view class="business_item" v-for="item in pageData.enterpriseProduct" :key="item.id">
<image class="business_img" mode="heightFix" src="/static/images/test/product.png" /> <image class="business_img" mode="heightFix" :src="item.image" />
<view class="qualification_name ellipsis">有机砂糖橘</view> <view class="qualification_name ellipsis">{{item.name}}</view>
<view class="qualification_price ellipsis">¥3.2<text class="qualification_text">/斤</text></view> <view class="qualification_price ellipsis">¥{{item.minSellPrice}}<text> ~ </text> {{item.maxSellPrice}}<text class="qualification_text">/{{item.unit}}</text></view>
</view> </view>
</view> </view>
</view> </view>
<view class="make-phone-view">
<fui-button text="我要购买" bold radius="96rpx" @click="makePhoneCall()" height="80rpx"/>
</view>
</view> </view>
<fui-fab position="right" distance="10" bottom="240" width="120" @click="handlePublish"> <fui-fab position="right" distance="10" bottom="240" width="120" @click="handlePublish">
<view class="text-white text-center"> <view class="text-white text-center">
...@@ -491,4 +510,12 @@ ...@@ -491,4 +510,12 @@
top: 24rpx; top: 24rpx;
right: 24rpx; right: 24rpx;
} }
.make-phone-view{
width: 690rpx;
height: 80rpx;
position: fixed;
left: 30rpx;
bottom: 450rpx;
}
</style> </style>
...@@ -7,7 +7,6 @@ export {} ...@@ -7,7 +7,6 @@ export {}
/* prettier-ignore */ /* prettier-ignore */
declare module 'vue' { declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
'副本': typeof import('./../src/components/ConfirmDialog/index - 副本.vue')['default']
AffixFilter: typeof import('./../src/components/Map/Widgets/AffixFilter/src/AffixFilter.vue')['default'] AffixFilter: typeof import('./../src/components/Map/Widgets/AffixFilter/src/AffixFilter.vue')['default']
BottomBar: typeof import('./../src/components/Map/Widgets/BottomBar/src/BottomBar.vue')['default'] BottomBar: typeof import('./../src/components/Map/Widgets/BottomBar/src/BottomBar.vue')['default']
CacheImage: typeof import('./../src/components/CacheImage/index.vue')['default'] CacheImage: typeof import('./../src/components/CacheImage/index.vue')['default']
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论