lilei 9 maanden geleden
bovenliggende
commit
7fc8a75051
4 gewijzigde bestanden met toevoegingen van 21 en 18 verwijderingen
  1. 1 1
      App.vue
  2. 5 3
      pages/index/index.vue
  3. 10 9
      pagesB/cart/index.vue
  4. 5 5
      pagesB/cart/productitem.vue

+ 1 - 1
App.vue

@@ -1,7 +1,7 @@
 <script>
 	export default {
 		globalData: {
-			baseUrl: 'http://192.168.2.113:9110/saas/clz/', // 本地
+			baseUrl: 'http://192.168.2.103:9110/saas/clz/', // 本地
 			// baseUrl: 'https://md.test.zyucgj.com/saas/clz/', // 预发布
 			// baseUrl: 'https://car.zyucgj.com/saas/clz/' // 生产
 		},

+ 5 - 3
pages/index/index.vue

@@ -435,8 +435,6 @@
 							if(flag==0){
 								// 更新用户信息
 								this.getCurrUserInfo()
-								// 显示促销模块
-								this.showPromoTab()
 								// 保证金查询
 								this.getShelfBWPayRecord()
 								// 获取订单信息
@@ -486,6 +484,8 @@
 			},
 			// 显示开通商城的页面
 			showShopPage(flag){
+				// 显示促销模块
+				this.showPromoTab()
 				// 隐藏tab 视频,显示tab购物车
 				if(this.hasLogin && this.userInfo && this.userInfo.sysUserFlag == '1'){
 					this.cartCount()
@@ -502,6 +502,8 @@
 			showNoShopPage(){
 				this.productTypeList = []
 				this.productList = []
+				// 隐藏促销模块
+				this.hidePromoTab()
 				// 隐藏tab 购物车,显示tab视频
 				this.showVideoTab()
 				// 滚动扫描记录
@@ -921,7 +923,7 @@
 			},
 			// 单击banner
 			clickBanner(index){
-				clickBannerList(this.imgList[index],this.hasLogin,this.userInfo.sysUserFlag == '1')
+				clickBannerList(this.imgList[index],this.hasLogin,this.userInfo&&this.userInfo.sysUserFlag == '1')
 			},
 			// 查看扫描VIN记录
 			toAllRecord(){

+ 10 - 9
pagesB/cart/index.vue

@@ -139,7 +139,7 @@
 				let ret = false
 				if(!this.editFlag){
 					this.list.forEach(key => {
-						ret = key.every(item => item.status==0||item.dealerScopeFlag==0)
+						ret = key.every(item => !item.status || item.status==0 || item.dealerScopeFlag==0)
 					})
 				}
 				return ret
@@ -180,9 +180,9 @@
 							  key.discountType = a.discountType
 							  key.promoProductSn = a.promoProductSn
 							  key.promoSn = a.promoSn
+							  key.orginPrice = key.price
 							  // 特价
 							  if(key.promoType=='PROMO_PROD'){
-								  key.orginPrice = key.price
 								  // 直降
 								  if(key.discountType == 'STRAIGHT_DOWN'){
 									  key.price = key.price - key.resultValue
@@ -192,7 +192,6 @@
 									 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 {
@@ -217,7 +216,7 @@
 								promoType: key.promoType,
 								promoProductSn: key.promoProductSn,
 								promoSn: key.promoSn,
-								giftQty: key.giftQty
+								giftQty: 0
 							}
 					  }))
 				  }
@@ -310,7 +309,7 @@
 				this.list.forEach(key => {
 					key.forEach(item => {
 						item.edit = this.editFlag
-						if(item.status==0||item.dealerScopeFlag==0){
+						if(!item.status||item.status==0||item.dealerScopeFlag==0){
 							item.checked = false
 						}
 					})
@@ -458,7 +457,7 @@
 						 	productSn:item.productSn,
 						 	productCode:item.productCode,
 						 	qty: item.qty,
-						 	price:item.price,
+						 	price:item.orginPrice,
 						 })
 						 cartSn.push({
 							 cartSn: item.cartSn,
@@ -550,19 +549,21 @@
 						this.totalSel += 1 // 已选数量
 						// 如果是返券类型
 						if(item.promoType=='BUY_PROD_GIVE_VALID'){
-							this.totalCoupon += item.resultValue
+							this.totalCoupon += item.resultValue * item.qty
 						}
 						// 特价
 						if(item.promoType=='PROMO_PROD'){
 							  // 直降
 							  if(item.discountType == 'STRAIGHT_DOWN'){
-								  this.totalDiscount += item.resultValue
+								  this.totalDiscount += item.resultValue * item.qty
 							  }
 							  // 折扣
 							  if(item.discountType == 'DISCOUNT'){
-								 this.totalDiscount += Number(item.price * (1-item.resultValue))
+								 this.totalDiscount += Number(item.price * (1-item.resultValue)) * item.qty
 							  }
 						}
+						// 满赠
+						item.giftQty = item.promoType=='BUY_PROD_GIVE_PROD' ? Math.floor(item.qty / item.conditionValue)*item.resultValue : 0
 					})
 				})
 			},

+ 5 - 5
pagesB/cart/productitem.vue

@@ -5,14 +5,14 @@
 		:key="item.id" 
 		>
 			<view class="choose-product-item-check" @click="checkItem(item)">
-				<uni-icons v-if="!item.edit && (!item.status||item.dealerScopeFlag==0)" type="circle-filled" size="24" color="#ccc"></uni-icons>
+				<uni-icons v-if="!item.edit && (!item.status||item.status==0||item.dealerScopeFlag==0)" type="circle-filled" size="24" color="#ccc"></uni-icons>
 				<uni-icons v-else :type="item.checked?'checkbox-filled':'circle'" size="24" :color="item.checked?'#dd0000':'#666'"></uni-icons>
 			</view>
 			 <view>
 				 <view>
 					 <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>
+						<view class="back-price xiajia" v-if="!item.status||item.status==0">下架</view>
 						<view class="back-price xiajia" v-else-if="item.dealerScopeFlag==0">售罄</view>
 					 </view>
 					 <view class="choose-product-item-info">
@@ -44,7 +44,7 @@
 										<view class="qty-btn" @click="changeQty(item.qty+1,item,1)" :class="(item.qty >= 999)?'qty-disabled':''">+</view>
 									</view>
 								</view>
-								<view v-if="!item.edit && (!item.status||item.dealerScopeFlag==0)" class="edit-qty">
+								<view v-if="!item.edit && (!item.status||item.status==0||item.dealerScopeFlag==0)" class="edit-qty">
 									X <text>{{item.qty}}</text>
 								</view>
 								<view v-if="item.edit" class="edit-qty">
@@ -59,7 +59,7 @@
 				 <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>
+						<view class="back-price xiajia" v-if="!item.status||item.status==0">下架</view>
 						<view class="back-price xiajia" v-else-if="item.dealerScopeFlag==0">售罄</view>
 					 </view>
 					 <view class="choose-product-item-info">
@@ -75,7 +75,7 @@
 							<view></view>
 							<view>
 								<view class="edit-qty">
-									X <text>{{item.qty}}</text>
+									X <text>{{item.giftQty}}</text>
 								</view>
 							</view>
 						</view>