提交 c8db9821 作者: 王定

feat: 完成可信农资

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