lilei 8 months ago
parent
commit
b362703025
4 changed files with 14 additions and 9 deletions
  1. 1 1
      pages/index/index.vue
  2. 2 0
      pagesB/cart/index.vue
  3. 2 4
      pagesB/cart/productitem.vue
  4. 9 4
      utils/index.js

+ 1 - 1
pages/index/index.vue

@@ -921,7 +921,7 @@
 			},
 			// 单击banner
 			clickBanner(index){
-				clickBannerList(this.imgList[index],this.hasLogin)
+				clickBannerList(this.imgList[index],this.hasLogin,this.userInfo.sysUserFlag == '1')
 			},
 			// 查看扫描VIN记录
 			toAllRecord(){

+ 2 - 0
pagesB/cart/index.vue

@@ -192,6 +192,7 @@
 									 key.price = Number(key.price * key.resultValue).toFixed(2)
 								  }
 							  }
+							  item.giftQty = key.promoType=='BUY_PROD_GIVE_PROD' ? Math.floor(key.qty / key.conditionValue)*key.resultValue : 0
 						  }
 						  delete key.shopPromoProduct
 						  return {
@@ -216,6 +217,7 @@
 								promoType: key.promoType,
 								promoProductSn: key.promoProductSn,
 								promoSn: key.promoSn,
+								giftQty: key.giftQty
 							}
 					  }))
 				  }

+ 2 - 4
pagesB/cart/productitem.vue

@@ -56,7 +56,7 @@
 					 </view>
 				 </view>
 				 <!-- 赠品 -->
-				 <view class="gift-box" v-if="dix==2">
+				 <view class="gift-box" v-if="item.giftQty">
 					 <view class="choose-product-item-img">
 						<image mode="aspectFit" :src="item.productImage?item.productImage+'?x-oss-process=image/resize,p_30':'/static/def_imgs.png'" style="width: 100%;height: 100%;"></image>
 						<view class="back-price xiajia" v-if="!item.status">下架</view>
@@ -72,9 +72,7 @@
 							<text :max-lines="1" overflow="ellipsis">{{item.productOrigCode}}</text>
 						</view>
 						<view class="choose-product-item-left-info-price">
-							<view>
-								<!-- <view class="price-txt" v-if="item.status==1">¥<text>0.00</text></view> -->
-							</view>
+							<view></view>
 							<view>
 								<view class="edit-qty">
 									X <text>{{item.qty}}</text>

+ 9 - 4
utils/index.js

@@ -162,7 +162,7 @@ export function clickTab(row,hasLogin,isNoAuth,isMax){
 	}
 }
 // 单击banner
-export function clickBannerList(row,hasLogin){
+export function clickBannerList(row,hasLogin,isAuth){
 	 // 红包
 	 if(row.activeType == 'redPacket'){
 	 	uni.navigateTo({url:"/pages/morePage/redPacket"})
@@ -182,9 +182,14 @@ export function clickBannerList(row,hasLogin){
 	 // 促销活动
 	 if(row.contentType == 'PROMO_LINK'){
 		 if(hasLogin){
-			 uni.navigateTo({
-			 	url: '/pagesB/promoProduct?promoSn='+row.bizSn+'&title='+row.bannerName
-			 })
+			 if(isAuth){
+				 uni.navigateTo({
+				 	url: '/pagesB/promoProduct?promoSn='+row.bizSn+'&title='+row.bannerName
+				 })
+			 }else{
+				 // 游客去认证
+				 toAuthStore()
+			 }
 		 }else{
 			 toLogin()
 		 }