mobile/components/diy/product/product.vue
@@ -28,11 +28,14 @@
                           <!-- 商品价格 -->
                           <view class="price d-s-c mt10">
                              <view v-if="itemData.style.show.productPrice" class="theme-price">
                                 <text>¥</text>
                                 <text class="">{{ product.product_price }}</text>
                                 <text v-if="product.is_price_negotiable">价格面议</text>
                                 <template v-else>
                                    <text>¥</text>
                                    <text class="">{{ product.product_price }}</text>
                                 </template>
                              </view>
                              <view class="ml10 gray9 text-d-line f28"
                                 v-if="itemData.style.show.linePrice && product.line_price > 0">
                                 v-if="itemData.style.show.linePrice && product.line_price > 0 && !product.is_price_negotiable">
                                 <text>¥</text>
                                 <text>{{ product.line_price }}</text>
                              </view>
@@ -51,7 +54,7 @@
                        <!-- 单规格商品显示购物车操作 -->
                        <template v-else>
                           <view class="cart-btn-add" v-if="!item.cart.total_num || item.cart.total_num <= 0"
                              @click.stop="addToCart(item,index)">
                              @click.stop="handleCartItemAction(item,index)">
                              <text class="icon iconfont icon-jia"></text>
                           </view>
                           <view class="cart-number-controller" v-else>
@@ -59,7 +62,7 @@
                                 <text class="icon iconfont icon-jian"></text>
                              </view>
                              <view class="cart-number">{{ item.cart.total_num }}</view>
                              <view class="cart-btn-add" @click.stop="increaseCart(item,index)">
                              <view class="cart-btn-add" @click.stop="handleCartItemAction(item,index)">
                                 <text class="icon iconfont icon-jia"></text>
                              </view>
                           </view>
@@ -79,11 +82,14 @@
                           {{ product.product_name }}</view>
                        <view class="price d-s-c">
                           <view v-if="itemData.style.show.productPrice == 1" class="theme-price">
                              <text class="f22">¥</text>
                              <text class="">{{ product.product_price }}</text>
                              <text v-if="product.is_price_negotiable">价格面议</text>
                              <template v-else>
                                 <text class="f22">¥</text>
                                 <text class="">{{ product.product_price }}</text>
                              </template>
                           </view>
                           <view class="ml20 gray9 text-d-line"
                              v-if="itemData.style.show.linePrice == 1 && product.line_price > 0"><text
                              v-if="itemData.style.show.linePrice == 1 && product.line_price > 0 && !product.is_price_negotiable"><text
                                 class="f22">¥</text>{{ product.line_price }}</view>
                        </view>
                     </view>
@@ -105,11 +111,14 @@
                              {{ product.product_name }}</view>
                           <view class="price d-s-c f12">
                              <view v-if="itemData.style.show.productPrice == 1" class="theme-price">
                                 <text>¥</text>
                                 <text class="">{{ product.product_price }}</text>
                                 <text v-if="product.is_price_negotiable">价格面议</text>
                                 <template v-else>
                                    <text>¥</text>
                                    <text class="">{{ product.product_price }}</text>
                                 </template>
                              </view>
                              <view class="ml10 gray9 text-d-line"
                                 v-if="itemData.style.show.linePrice == 1 && product.line_price > 0">
                                 v-if="itemData.style.show.linePrice == 1 && product.line_price > 0 && !product.is_price_negotiable">
                                 ¥{{ product.line_price }}</view>
                           </view>
                        </view>
@@ -137,6 +146,39 @@
         gotoDetail(e) {
            let url = '/pages/product/detail/detail?product_id=' + e;
            this.gotoPage(url);
         },
         /*处理购物车操作 - 价格面议商品特殊处理*/
         handleCartItemAction(item, index) {
            // 如果是价格面议商品,提示联系客服
            if (item.is_price_negotiable) {
               uni.showModal({
                  title: '温馨提示',
                  content: '该商品为价格面议商品,请联系客服咨询具体价格',
                  confirmText: '联系客服',
                  cancelText: '取消',
                  success: (res) => {
                     if (res.confirm) {
                        // 跳转到商品详情页联系客服
                        this.gotoDetail(item.product_id);
                     }
                  }
               });
            } else {
               // 非价格面议商品,正常添加到购物车
               this.addToCart(item, index);
            }
         },
         /*添加到购物车*/
         addToCart(item, index) {
            // 这里实现具体的添加购物车逻辑
            console.log('添加到购物车:', item.product_id);
            // 示例实现
            uni.showToast({
               title: '已添加到购物车',
               icon: 'success'
            });
         }
      }
   };