Эх сурвалжийг харах

商城(花惠宝)进行聊天页时,必要参数修改

shizhongqi 11 сар өмнө
parent
commit
c368acb852

+ 5 - 5
mallApp/src/pages/goods/components/buy-foot.vue

@@ -1,21 +1,21 @@
 <template>
 	<view class="app-footer">
-        <view class="btn-left" v-if="priceType == 1">
+        <view class="btn-left">
             <view class="btn-wrap">
                 <i class="iconfont icondianpu"></i>
                 <view class="btn-text">店铺</view>
             </view>
-            <view class="btn-wrap">
+            <view class="btn-wrap" @click="goChat">
                 <i class="iconfont iconxiaoxi"></i>
-                <view class="btn-text" @click="goChat">咨询</view>
+                <view class="btn-text">咨询</view>
             </view>
         </view>
-        <view class="btn-text" v-else-if="priceType == 0">
+        <!-- <view class="btn-right">
             <view class="btn-wrap">
                 <i class="iconfont iconxiaoxi"></i>
                 <view class="btn-text" @click="goChat">咨询</view>
             </view>
-        </view>
+        </view> -->
         <div class="btn-right">
             <button v-if="priceType == 1" class="button-com red" @click="buy">购买</button>
             <button v-else class="button-com red" @click.stop="goChat">询价</button>

+ 13 - 12
mallApp/src/pages/goods/detail.vue

@@ -13,7 +13,7 @@
       <view class="app-price app-bold" v-if="data.priceType == 1">
         <text>¥</text>
         <text class="app-size-34">{{
-          data.price ? parseFloat(data.price) : 0
+          data.price ? parseFloat(data.price).toFixed(2) : 0
         }}</text>
       </view>
       <view class="tui-pro-titbox">
@@ -212,25 +212,26 @@ export default {
       // #endif
     },
     goChat(){
-      if(parseInt(this.loginInfo.id) <= 0){
-        this.$msg("数据异常,请稍后再试");
+      if(isNaN(parseInt(this.loginInfo.id))){
+        this.$msg("登录用户数据异常,请稍后再试");
         return;
       }
-      if(parseInt(this.customId) <= 0){
-        this.$msg("数据异常,请稍后再试");
+      if(isNaN(parseInt(this.customId))){
+        this.$msg("客户数据异常,请稍后再试");
         return;
       }
-      if(parseInt(this.shopInfo.shopAdminId) <= 0){
-        this.$msg("数据异常,请稍后再试");
-        return;
-      }
-      if(parseInt(this.shopInfo.shopId) <= 0){
-        this.$msg("数据异常,请稍后再试");
+      // if(isNaN(parseInt(this.shopInfo.shopAdminId))){ // 无需 staffId
+      //   this.$msg("门店员工数据异常,请稍后再试");
+      //   return;
+      // }
+      if(isNaN(parseInt(this.shopInfo.shopId))){
+        this.$msg("门店数据异常,请稍后再试");
         return;
       }
+
       this.$util.pageTo({
         url: "/pages/chat/chatPage",
-        query: { userId: this.loginInfo.id, customId: this.customId, staffId: this.shopInfo.shopAdminId, shopId: this.shopInfo.shopId, name: this.loginInfo.name, avatar: this.loginInfo.avatar }
+        query: { userId: this.loginInfo.id, customId: this.customId, staffId: 0, shopId: this.shopInfo.shopId, name: this.loginInfo.name, avatar: this.loginInfo.avatar }
       });
     }
   },

+ 4 - 1
mallApp/src/pages/home/category.vue

@@ -176,7 +176,10 @@ export default {
   methods: {
     toBuy(item){
       let account = this.option.account?this.option.account:0
-      this.$util.pageTo({url:"/pages/goods/detail?id="+item.id+'&hdId='+this.hdId+'&categoryId='+this.form.categoryId+'&account='+account})
+      this.$util.pageTo({
+        url:"/pages/goods/detail",
+        query: { id: item.id, hdId: this.hdId, shopId: account, shopAdminId: 0, categoryId: this.form.categoryId, account: account }
+      })
     },
     buyProduct(){
       let account = this.option.account?this.option.account:0