ext.liuqiwen3 16 ore fa
parent
commit
0d7450a35a

+ 11 - 5
components/OrderListCard/index.vue

@@ -2,10 +2,11 @@
   <view class="item">
     <view @click="goOrderDetails(order.orderId)">
       <view class="title acea-row row-between-wrapper">
-        <view class="acea-row row-middle" @click.stop="toMerchant(order.sbMerchant.id)">
-          <image class="merchantImg" :src="order.sbMerchant.merchantLogo"></image>
-          <view style="margin-left: 10rpx;">{{order.sbMerchant.merchantName}}</view>
-          <uni-icons style="margin-left: 10rpx;" type="right" size="16" color="#999999"></uni-icons>
+        <view class="acea-row row-middle" @click.stop="toMerchant(order.sbMerchant?.id)">
+          <image class="merchantImg" v-if="order.sbMerchant?.merchantLogo" :src="order.sbMerchant.merchantLogo" ></image>
+          <image class="merchantImg" v-else src="@/static/avator.png" ></image>
+          <view style="margin-left: 10rpx;">{{order.sbMerchant?.merchantName||'自营'}}</view>
+          <uni-icons v-if="order.sbMerchant?.id" style="margin-left: 10rpx;" type="right" size="16" color="#999999"></uni-icons>
 <!--          <view>{{ order.createTime }}</view>-->
         </view>
         <view class="font-color">
@@ -101,7 +102,12 @@ function delOrder() {
   emit("delOrder", props.order.id, props.index);
 }
 const toMerchant = (merchantId) => {
-  uni.navigateTo({ url:"/pages/merchantCenters/merchant?merchantId="+merchantId });
+  if(merchantId){
+    uni.navigateTo({ url:"/pages/merchantCenters/merchant?merchantId="+merchantId });
+  }else{
+    return
+  }
+
 }
 </script>
 

+ 2 - 2
components/goodList/index.vue

@@ -13,9 +13,9 @@
 						<view class='line1'>{{item.storeName}}</view>
 						<view class='money font-color'>¥<text class='num'>{{item.totalPrice}}</text></view>
 						<view class='vip-money acea-row row-middle' v-if="item.vip_price && item.vip_price > 0">¥{{item.vip_price || 0}}
-							<image src='/static/images/vip.png'></image><text class='num'>已售{{Number(item.sales) + Number(item.ficti) || 0}}{{item.unitName}}</text>
+							<image src='/static/images/vip.png'></image><text class='num'>已售{{Number(item.sales) + Number(item.ficti) || 0}}</text>
 						</view>
-						<view class='vip-money acea-row row-middle' v-else><text class='num'>已售{{Number(item.sales) + Number(item.ficti) || 0}}{{item.unitName}}</text></view>
+						<view class='vip-money acea-row row-middle' v-else><text class='num'>已售{{Number(item.sales) + Number(item.ficti) || 0}}</text></view>
 					</view>
 				</view>
 <!--				<view class='iconfont icon-gouwuche cart-color acea-row row-center-wrapper'></view>-->

+ 10 - 5
pages/goods/goods_search/index.vue

@@ -39,6 +39,9 @@ import recommend from '@/components/recommend'
 import { HTTP_REQUEST_URL_IMG } from "@/config/app";
 // 获取实时金价
 import useRealGoldPrice from "@/hooks/useRealGoldPrice";
+import { useAppStore } from "@/stores/app";
+
+const appStore = useAppStore();
 
 // 响应式数据
 const hostProduct = ref([])
@@ -55,6 +58,7 @@ const hotPage = ref(1)
 const isScroll = ref(true)
 const isbastList = ref(false)
 const query = ref({})
+const merchantId =  ref('')
 // 实时价格处理
 const {
   realGoldprice, // 黄金实时销售价(基础)
@@ -76,10 +80,8 @@ const calculatedProducts = computed(() => {
 
     const totalLaborCost = Number(product.totalLaborCost);
     const additionalAmount = Number(product.additionalAmount);
-    console.log(totalLaborCost)
-    console.log(additionalAmount)
     const totalPrice = (totalLaborCost+additionalAmount).toFixed(2);
-    console.log('totalPrice',totalPrice)
+
     return {
       ...product,
       calculatedTotal: formattedTotal, // 新增计算结果字段
@@ -104,7 +106,8 @@ function getProductList() {
     ...query.value,
     keyword: searchValue.value,
     page: page.value,
-    limit: limit.value
+    limit: limit.value,
+    merchantId:merchantId.value,
   }).then(res => {
     const list = res.data.list
     const isLoadend = list.length < limit.value
@@ -164,10 +167,12 @@ function searchBut() {
 // 生命周期
 onShow(() => {
   getRoutineHotSearch()
-  getHostProduct()
+  getHostProduct();
+
 })
 onLoad((options)=>{
   query.value = options || {};
+  merchantId.value = appStore.merchantId||appStore.userInfo?.merchant?.id||'';
   if(options && options.cid){
     getProductList()
   }