lilei 8 月之前
父节点
当前提交
74f625e9b1

+ 1 - 1
api/user.js

@@ -49,7 +49,7 @@ export const ticketQueryList = params => {
 // 促销活动优惠券-总数
 export const ticketQueryCount = params => {
   return request({
-    url: `ticket/getAllTicketPrice`,
+    url: `ticket/getAllTicketInfo`,
     method: 'post',
     data: params
   })

+ 11 - 16
pages/index/index.vue

@@ -110,7 +110,7 @@
 					</view>
 					<!-- 产品列表 -->
 					<view class="product-box" v-if="hasShopiing && totalhotPage>0">
-						<u-divider bg-color="" color="#666" use-slot :fontSize="28">
+						<u-divider bg-color="" half-width="0" color="#666" use-slot :fontSize="28">
 							<image style="width: 16px;height:16px;" src="../../static/hot.png"></image> 
 							<text style="margin: 0 5px;font-weight: bold;">热门推荐</text>
 							<image style="width: 16px;height:16px;" src="../../static/hot.png"></image>
@@ -250,15 +250,16 @@
 						activeType: ''
 					}
 				]
+				const newList = []
 				// 红包
 				if(this.hasRedPacket&&this.hasShelf){
-					list.push(
+					newList.push(
 					{
 						image: '/static/banner2.jpg',
 						activeType: 'redPacket'
 					})
 				}
-				return list.concat(this.carouselList) 
+				return this.carouselList.length>0 ? newList.concat(this.carouselList) : list.concat(newList)
 			},
 			// 快捷导航
 			navList(){
@@ -473,10 +474,10 @@
 					this.hasShopiing = res.data && res.data.paramValue == 1
 					// 有商城
 					if(this.hasShopiing){
-						this.showShopPage()
+						this.showShopPage(flag)
 					}else{
 						// 没有商城
-						this.showNoShopPage()
+						this.showNoShopPage(flag)
 					}
 					// 查询红包活动
 					this.getRedPacketRule()
@@ -499,7 +500,7 @@
 				this.getHotProductList(flag)
 			},
 			// 显示未没有开通商城的界面
-			showNoShopPage(){
+			showNoShopPage(flag){
 				this.productTypeList = []
 				this.productList = []
 				// 隐藏促销模块
@@ -551,6 +552,7 @@
 			},
 			// 商品列表查询
 			getHotProductList(flag){
+				console.log(flag)
 				this.hotProductPageNo = 1
 				// 不是show 刷新列表
 				if(flag!=1){
@@ -582,17 +584,10 @@
 								  item.discountType = a.discountType
 								  item.promoProductSn = a.promoProductSn
 								  item.promoSn = a.promoSn
+								  item.orginPrice = item.price
 								  // 特价
 								  if(item.promoType=='PROMO_PROD'){
-									  item.orginPrice = item.price
-									  // 直降
-									  if(item.discountType == 'STRAIGHT_DOWN'){
-										  item.price = item.price - item.resultValue
-									  }
-									  // 折扣
-									  if(item.discountType == 'DISCOUNT'){
-									  	 item.price = Number(item.price * item.resultValue).toFixed(2)
-									  }
+									  item.price = item.conditionValue
 								  }
 							  }
 							  item.priceStr = Number(item.price).toFixed(2).toString().split('.')
@@ -1048,7 +1043,7 @@
 				border-radius: 6px;
 				margin: 10px 0;
 				padding: 10px 0;
-				box-shadow: 1px 1px 2px #eee;
+				border: 1px solid #eee;
 			}
 			.product-box{
 				margin: 10px 0;

+ 2 - 16
pagesB/cart/index.vue

@@ -215,14 +215,7 @@
 							  key.promoSn = a.promoSn
 							  // 特价
 							  if(key.promoType=='PROMO_PROD'){
-								  // 直降
-								  if(key.discountType == 'STRAIGHT_DOWN'){
-									  key.price = key.price - key.resultValue
-								  }
-								  // 折扣
-								  if(key.discountType == 'DISCOUNT'){
-									 key.price = Number(key.price * key.resultValue).toFixed(2)
-								  }
+								  key.price = key.conditionValue
 							  }
 						  }
 						  key.priceStr = Number(key.price).toFixed(2).toString().split('.')
@@ -595,14 +588,7 @@
 						}
 						// 特价
 						if(item.promoType=='PROMO_PROD'){
-							  // 直降
-							  if(item.discountType == 'STRAIGHT_DOWN'){
-								  this.totalDiscount += item.resultValue * item.qty
-							  }
-							  // 折扣
-							  if(item.discountType == 'DISCOUNT'){
-								 this.totalDiscount += Number(item.orginPrice*(1-item.resultValue)) * item.qty
-							  }
+							this.totalDiscount += item.conditionValue
 						}
 						// 满赠
 						item.giftQty = item.promoType=='BUY_PROD_GIVE_PROD' ? Math.floor(item.qty / item.conditionValue)*item.resultValue : 0

+ 2 - 9
pagesB/promoProduct.vue

@@ -151,17 +151,10 @@
 								  k.discountType = a.discountType
 								  k.promoProductSn = a.promoProductSn
 								  k.promoSn = a.promoSn
+								  k.orginPrice = k.price
 								  // 特价
 								  if(k.promoType=='PROMO_PROD'){
-									  k.orginPrice = k.price
-									  // 直降
-									  if(k.discountType == 'STRAIGHT_DOWN'){
-										  k.price = k.price - k.resultValue
-									  }
-									  // 折扣
-									  if(k.discountType == 'DISCOUNT'){
-										 k.price = Number(k.price * k.resultValue).toFixed(2)
-									  }
+									k.price = k.conditionValue
 								  }
 								}
 							  // 如果筛选或分页后,更新页面列表产品数量

+ 2 - 9
pagesB/shopiing/productDetail.vue

@@ -272,17 +272,10 @@
 							  res.data.discountType = a.discountType
 							  res.data.promoProductSn = a.promoProductSn
 							  res.data.promoSn = a.promoSn
+							  res.data.orginPrice = res.data.price
 							  // 特价
 							  if(res.data.promoType=='PROMO_PROD'){
-								  res.data.orginPrice = res.data.price
-								  // 直降
-								  if(res.data.discountType == 'STRAIGHT_DOWN'){
-									  bprice = res.data.price - res.data.resultValue
-								  }
-								  // 折扣
-								  if(res.data.discountType == 'DISCOUNT'){
-									 bprice = Number(res.data.price * res.data.resultValue).toFixed(2)
-								  }
+								  bprice =res.data.conditionValue
 							  }
 							}
 							res.data.priceStr = Number(bprice).toFixed(2).toString().split('.')

+ 2 - 9
pagesB/shopiing/searchProduct.vue

@@ -223,17 +223,10 @@
 								  k.discountType = a.discountType
 								  k.promoProductSn = a.promoProductSn
 								  k.promoSn = a.promoSn
+								  k.orginPrice = k.price
 								  // 特价
 								  if(k.promoType=='PROMO_PROD'){
-									  k.orginPrice = k.price
-									  // 直降
-									  if(k.discountType == 'STRAIGHT_DOWN'){
-										  k.price = k.price - k.resultValue
-									  }
-									  // 折扣
-									  if(k.discountType == 'DISCOUNT'){
-										 k.price = Number(k.price * k.resultValue).toFixed(2)
-									  }
+									 k.price = k.conditionValue
 								  }
 								}
 								return {

+ 2 - 9
pagesB/shopiing/shopProduct.vue

@@ -262,17 +262,10 @@
 								  k.discountType = a.discountType
 								  k.promoProductSn = a.promoProductSn
 								  k.promoSn = a.promoSn
+								  k.orginPrice = k.price
 								  // 特价
 								  if(k.promoType=='PROMO_PROD'){
-									  k.orginPrice = k.price
-									  // 直降
-									  if(k.discountType == 'STRAIGHT_DOWN'){
-										  k.price = k.price - k.resultValue
-									  }
-									  // 折扣
-									  if(k.discountType == 'DISCOUNT'){
-										 k.price = Number(k.price * k.resultValue).toFixed(2)
-									  }
+									  k.price = k.conditionValue
 								  }
 								}
 								return {