From b250d05adf301bb9669d72ac33895cbbe5782d1c Mon Sep 17 00:00:00 2001
From: ghusermoon <2673031505@qq.com>
Date: Thu, 16 Jul 2020 17:39:06 +0800
Subject: [PATCH 1/2] 7.16
---
 common/api/shop.js                            | 26 ++++-
 common/store/index.js                         | 14 ++-
 .../mine/address-block/address-item.vue       | 27 +++--
 components/shop/list/index.vue                | 43 +++++++-
 components/shop/seckill/index.vue             | 32 ++++--
 components/shop/seckill/item.vue              | 25 +++--
 components/shop/special-shop/index.vue        | 91 +++++++++++++++++
 pageC/cart/ConfirmOrder.vue                   | 99 ++++++++++++++-----
 pageC/cart/index.vue                          |  6 +-
 pageC/groupBuy/index.vue                      | 63 ++++++++++++
 pageC/spike/index.vue                         | 85 ++++++++++++++++
 pageE/more/Address.vue                        |  8 +-
 pages.json                                    | 28 +++++-
 pages/shop/index.vue                          | 22 ++++-
 14 files changed, 497 insertions(+), 72 deletions(-)
 create mode 100644 components/shop/special-shop/index.vue
 create mode 100644 pageC/groupBuy/index.vue
 create mode 100644 pageC/spike/index.vue
diff --git a/common/api/shop.js b/common/api/shop.js
index 789413f..98611b8 100644
--- a/common/api/shop.js
+++ b/common/api/shop.js
@@ -135,11 +135,12 @@ export default {
 				});
 			},
 			// 选择地区计算运费 
-			getFreight({ freight_hash, city_id, area_id }) {
+			getFreight({ freight_hash, city_id, area_id, delivery }) {
 				return vm.$u.post('Buy/change_addr', {
 					freight_hash: freight_hash,
 					city_id: city_id,
 					area_id: area_id,
+					delivery: delivery,
 				});
 			},
 			// 商品详情
@@ -186,6 +187,29 @@ export default {
 					page: page
 				});
 			},
+			// 拼团列表
+			getPinTuanList() {
+				return vm.$u.post('Specialci/pintuanList');
+			},
+			// 拼团商品详情
+			getPinTuanDetails({ pintuan_id }) {
+				return vm.$u.post('Specialci/pintuanInfo', { pintuan_id: pintuan_id });
+			},
+			// 优惠券列表
+			getCouponList({ page, store_id, type, gc_id }) {
+				return vm.$u.post('Coupon/CouponList', { 
+					page: page,
+					store_id: store_id,
+					type: type,
+					gc_id: gc_id, 
+				});
+			},
+			// 领取优惠券
+			getCoupon({ vouchertemplate_id }) {
+				return vm.$u.post('Coupon/getCoupon', { 
+					vouchertemplate_id: vouchertemplate_id, 
+				});
+			}
         }
     }
     
diff --git a/common/store/index.js b/common/store/index.js
index 5dd2d35..2db9847 100644
--- a/common/store/index.js
+++ b/common/store/index.js
@@ -4,16 +4,20 @@ Vue.use(Vuex)
 
 const store = new Vuex.Store({
 	state: {
-		count: 0
+		cartInfo: {}, // 购物车数据
+		orderAddress: {}, // 下单时选择的地址
 	},
 	getters: {
-		doubleCount (state) {
-			return state.count * 2
+		getOrderAddress(state) {
+			return state.orderAddress;
 		}
 	},
 	mutations: {
-		increment (state) {
-			state.count++
+		updateCart(state, cart) {
+			state.cartInfo = cart;
+		},
+		updateAddress(state, address) {
+			state.orderAddress = address;
 		}
 	}
 })
diff --git a/components/mine/address-block/address-item.vue b/components/mine/address-block/address-item.vue
index 39dccc4..62ea0c1 100644
--- a/components/mine/address-block/address-item.vue
+++ b/components/mine/address-block/address-item.vue
@@ -1,6 +1,6 @@
 
 	
-		
+		
 			
 				{{ item.address_realname }}
 				{{ item.address_mob_phone | phoneFormat }}
@@ -35,17 +35,15 @@
 	
 
 
diff --git a/components/shop/seckill/index.vue b/components/shop/seckill/index.vue
index fdf87ac..f7b933f 100644
--- a/components/shop/seckill/index.vue
+++ b/components/shop/seckill/index.vue
@@ -4,21 +4,25 @@
             
                 全部秒杀
                 
-                    12
+                    {{ time.littleHour }}
                     :
-                    12
+                    00
                     :
-                    12
+                    00
+					-
+					{{ time.bigHour }}
+                    :
+                    00
+                    :
+                    00
                 
             
-            
+            
                 查看更多>
             
         
         
-            
-            
-            
+            
         
     
 
@@ -28,7 +32,15 @@ export default {
     name:"seckill",
     components:{
         sitem
-    }
+	},
+	props: ['list', 'time'],
+	methods: {
+		viewMore() {
+			this.$u.route({
+				url: '/pageC/spike/index',
+			})
+		}
+	}
 }
 
 
\ No newline at end of file
diff --git a/pageC/cart/ConfirmOrder.vue b/pageC/cart/ConfirmOrder.vue
index 46bda90..74f1514 100644
--- a/pageC/cart/ConfirmOrder.vue
+++ b/pageC/cart/ConfirmOrder.vue
@@ -37,17 +37,17 @@
 					
 						优惠券折扣
 						
-							-¥10.00
+							{{ index }}
 							
 						
 					
-					
 						
-					 -->
+					
 				
 			
 		
@@ -59,10 +59,10 @@
 					
 				
 			
-			
+			
 				配送方式
 				
-					快递
+					{{ delivery.text }}
 					
 				
 			
@@ -70,36 +70,40 @@
 		
 			
 				合计:
-				¥{{ orderInfo.store_goods_total | showTotalPrice }}
+				¥{{ totalPrice }}
 			
 			
 				共件{{ orderInfo.store_cart_list | setTotalNumber }}商品
 				结算
 			
 		
+		
 	
 
 
+
\ No newline at end of file
diff --git a/pageC/spike/index.vue b/pageC/spike/index.vue
new file mode 100644
index 0000000..b2ff2da
--- /dev/null
+++ b/pageC/spike/index.vue
@@ -0,0 +1,85 @@
+
+	
+		
+            全部秒杀
+			
+				{{ seckillTime.littleHour }}
+				:
+				00
+				:
+				00
+				-
+				{{ seckillTime.bigHour }}
+				:
+				00
+				:
+				00
+			
+		
+		
+			
+		
+	
+
+
+
\ No newline at end of file
diff --git a/pageE/more/Address.vue b/pageE/more/Address.vue
index bc4bb0a..48fe2eb 100644
--- a/pageE/more/Address.vue
+++ b/pageE/more/Address.vue
@@ -3,7 +3,7 @@
 		
 			
 			
-				
+				
 			
 		
 		添加地址
@@ -16,12 +16,16 @@ export default {
 	data() {
 		return {
 			current: -1, // radio 标记
-			addressList: []
+			addressList: [],
+			state: '', // 页面状态 是否进页面选择地址
 		}
 	},
 	components: {
 		AddressItem
 	},
+	onLoad(option) {
+		if(option.type) this.state = option.type;
+	},
 	onShow() {
 		this.getAddressList();
 	},
diff --git a/pages.json b/pages.json
index afd4882..0ac3fe7 100644
--- a/pages.json
+++ b/pages.json
@@ -249,7 +249,6 @@
 							}
 						}
 					}
-				
 				},
 				{
 					"path": "cart/ConfirmOrder",
@@ -263,7 +262,32 @@
 							}
 						}
 					}
-				
+				},
+				{
+					"path": "spike/index",
+					"style": {
+						"navigationBarTitleText": "全部秒杀",
+						"app-plus": {
+							"titleSize": "36px",
+							"titleNView": {
+								"titleColor": "#333333",
+								"backgroundColor": "#FFFFFF"
+							}
+						}
+					}
+				},
+				{
+					"path": "groupBuy/index",
+					"style": {
+						"navigationBarTitleText": "全部拼团",
+						"app-plus": {
+							"titleSize": "36px",
+							"titleNView": {
+								"titleColor": "#333333",
+								"backgroundColor": "#FFFFFF"
+							}
+						}
+					}
 				}
 			]
 		},
diff --git a/pages/shop/index.vue b/pages/shop/index.vue
index 03e785d..2194c5b 100644
--- a/pages/shop/index.vue
+++ b/pages/shop/index.vue
@@ -38,8 +38,8 @@
         
         
         
-        
-        
+        
+        
         
         
         
@@ -88,6 +88,7 @@ export default {
 			goodsList: [],
 			recommendedSpike: {}, // 秒杀推荐
 			spikeList: [], // 全部秒杀列表
+			seckillTime: {}, // 秒杀时间
         }
 	},
 	onLoad() {
@@ -97,6 +98,7 @@ export default {
 	onShow() {
 		this.getRecommendedSpike();
 		this.getSpikeList();
+		this.getPinTuanList();
 	},
 	methods: {
         sousuo(){
@@ -124,13 +126,25 @@ export default {
 		getRecommendedSpike() {
 			this.$u.api.recommendedSpike().then(res => {
 				if(res.errCode == 0) this.recommendedSpike = res.data;
-				console.log(this.recommendedSpike);
+				// console.log(this.recommendedSpike);
 			})
 		},
 		// 全部秒杀
 		getSpikeList() {
 			this.$u.api.getSpikeList({ page: 0 }).then(res => {
-				if(res.errCode == 0) this.spikeList = res.data;
+				if(res.errCode == 0) {
+					this.spikeList = res.data.list;
+					this.seckillTime = {
+						bigHour: res.data.bigHour,
+						littleHour: res.data.littleHour,
+					}
+				}
+			})
+		},
+		// 拼团列表
+		getPinTuanList() {
+			this.$u.api.getPinTuanList().then(res => {
+
 			})
 		},
 		getGoodsRecommend() {
From 7b9479d56cc48801f6703cd4d4d95f3167c1a8fe Mon Sep 17 00:00:00 2001
From: ghusermoon <2673031505@qq.com>
Date: Fri, 17 Jul 2020 17:34:42 +0800
Subject: [PATCH 2/2] coupon
---
 common/api/shop.js                  |  35 ++++--
 components/mine/coupon/index.vue    |  35 +++---
 components/shop/list/index.vue      |  78 ++++++++-----
 components/shop/recommend/index.vue |   6 +-
 components/shop/youhq/index.vue     | 175 ++++++++++++++++++----------
 components/shop/youhq/item.vue      |  83 -------------
 pageE/mine/MemberServe.vue          |  15 ++-
 pageE/mine/MemberServeCoupon.vue    |  69 +++++------
 pageE/tool/MineCoupon.vue           |  49 ++++----
 pages/shop/index.vue                |  54 +++++----
 10 files changed, 308 insertions(+), 291 deletions(-)
 delete mode 100644 components/shop/youhq/item.vue
diff --git a/common/api/shop.js b/common/api/shop.js
index 98611b8..34f4a3a 100644
--- a/common/api/shop.js
+++ b/common/api/shop.js
@@ -78,9 +78,10 @@ export default {
 				return vm.$u.post('Goods/getGoodsClassifyList');
 			},
 			// 商品推荐
-            getGoodsRecommend({page}){
+            getGoodsRecommend({page, gc_id}){
                 return vm.$u.post('Goods/getGoodsRecommend', {
-					page: page
+					page: page,
+					gc_id: gc_id,
 				});
 			},
 			// 购物车商品列表
@@ -188,14 +189,25 @@ export default {
 				});
 			},
 			// 拼团列表
-			getPinTuanList() {
-				return vm.$u.post('Specialci/pintuanList');
+			getPinTuanList({ page, gc_id }) {
+				return vm.$u.post('Specialci/pintuanList', {
+					page: page,
+					gc_id: gc_id,
+				});
 			},
 			// 拼团商品详情
 			getPinTuanDetails({ pintuan_id }) {
 				return vm.$u.post('Specialci/pintuanInfo', { pintuan_id: pintuan_id });
 			},
-			// 优惠券列表
+			// pintuanPush
+			getPinTuanPush() {
+				return vm.$u.post('Specialci/pintuanPush');
+			},
+			// 商品分类(拼团分类)
+			getGoodsClass() {
+				return vm.$u.post('Specialci/goodsClass');
+			},
+			// 优惠券列表(要兑换的)
 			getCouponList({ page, store_id, type, gc_id }) {
 				return vm.$u.post('Coupon/CouponList', { 
 					page: page,
@@ -205,9 +217,18 @@ export default {
 				});
 			},
 			// 领取优惠券
-			getCoupon({ vouchertemplate_id }) {
+			getCoupon({ id }) {
 				return vm.$u.post('Coupon/getCoupon', { 
-					vouchertemplate_id: vouchertemplate_id, 
+					vouchertemplate_id: id, 
+				});
+			},
+			// 我的优惠券(已有的)
+			getMemberCouponList({ store_id, gc_id, type, status }) {
+				return vm.$u.post('Coupon/getMemberCouponList', {
+					store_id: store_id,
+					gc_id: gc_id,
+					type: type,
+					status: status,
 				});
 			}
         }
diff --git a/components/mine/coupon/index.vue b/components/mine/coupon/index.vue
index 3448072..01f2aa5 100644
--- a/components/mine/coupon/index.vue
+++ b/components/mine/coupon/index.vue
@@ -1,24 +1,24 @@
 
 	
-		
+		
 			
 				
-				{{ couponInfo.index&1 ? '店铺优惠券' : '平台优惠券' }}
+				{{ couponInfo.type == 2 ? '店铺优惠券' : '平台优惠券' }}
 			
 			
 				
-					¥10
-					满100使用
+					¥{{ couponInfo.vouchertemplate_price }}
+					满{{ couponInfo.vouchertemplate_limit }}使用
 				
-				仅限 nike官方旗舰店 鞋子商品使用
-				兑换积分:200积分
-				有效期2018.09.06-2018.10.06
+				仅限{{ couponInfo.vouchertemplate_storename }}鞋子商品使用
+				兑换积分:{{ couponInfo.vouchertemplate_points }}积分
+				有效期{{ couponInfo.vouchertemplate_startdate }}-{{ couponInfo.vouchertemplate_enddate }}
 			
 			
-				立即兑换
+				立即兑换
 				立即使用
-				
-				
+				
+				
 			
 		
 	
@@ -27,7 +27,7 @@
 /**
  * coupon 优惠券
  * @description 优惠券组件
- * @property {Number} type 优惠券操作方式(兑换优惠券: 0 / 使用优惠券: 1)
+ * @property {Number} type 优惠券操作方式(可兑换的优惠券: 0 / 自己的优惠券: 1)
  * @property {Object} coupon-info 优惠券信息
  * @event {Function} exchange 兑换优惠券
  * @event {Function} use 使用优惠券
@@ -41,12 +41,21 @@ export default {
 		type: Number,
 		couponInfo: Object,
 	},
+	created() {
+		console.log(this.couponInfo);
+	},
 	methods: {
 		exchange() {
-			this.$emit('exchange', this.couponInfo.index);
+			this.$emit('exchange', this.couponInfo.vouchertemplate_id);
+		},
+		exchangeCoupon() {
+			this.$u.api.getCoupon({ id: this.couponInfo.vouchertemplate_id }).then(res => {
+				this.$u.toast(res.message);
+				if(res.errCode == 0) {}
+			})
 		},
 		use() {
-			this.$emit('use', this.couponInfo.index);
+			this.$emit('use', this.couponInfo.vouchertemplate_id);
 		},
 	},
 };
diff --git a/components/shop/list/index.vue b/components/shop/list/index.vue
index 2e76629..843ba8c 100644
--- a/components/shop/list/index.vue
+++ b/components/shop/list/index.vue
@@ -3,25 +3,25 @@
         
             商品推荐
         
-        
+        
+		
+			
 		
 		
-			
-				
+			
+				
 					
 						-				
+					
+				
 			
-		 -->
+		
         
 
 
 
\ No newline at end of file
diff --git a/components/shop/youhq/item.vue b/components/shop/youhq/item.vue
deleted file mode 100644
index f9a6923..0000000
--- a/components/shop/youhq/item.vue
+++ /dev/null
@@ -1,83 +0,0 @@
-
-    
-        
-            
-                ¥
-                12
-            
-            
-                
-                
-            
-            
-                立即
领取
-            
-        
-        
-            使用时间:2020.01.24-2020.05.08
-        
-    
-
-
-
\ No newline at end of file
diff --git a/pageE/mine/MemberServe.vue b/pageE/mine/MemberServe.vue
index af082c6..39a3303 100644
--- a/pageE/mine/MemberServe.vue
+++ b/pageE/mine/MemberServe.vue
@@ -37,11 +37,11 @@
 				
 					
 						
-							{{ item.pl_desc }}
+							{{ item.pl_desc }}
 							{{ item.pl_addtime }}
 						
-						
-							{{ item.pl_addtime > 0 ? item.pl_addtime : '+' + 10.00 }}
+						
+							{{ Number(item.pl_points) > 0 ? '+' + item.pl_points : item.pl_points }}
 						
 					
 					
@@ -75,6 +75,14 @@ export default {
 	components: {
 		CouponView
 	},
+	onLoad(option) {
+		if(option.current) this.current = option.current;
+	},
+	watch: {
+		current(value) {
+			this.swiperCurrent = value;
+		}
+	},
 	onShow() {
 		this.getMemberPointsStat();
 		this.getPointslogList();
@@ -186,6 +194,7 @@ export default {
 				justify-content: space-between;
 				.item-left {
 					.item-title {
+						width: 450rpx;
 						font-size: 32rpx;
 						color: rgba(51,51,51,1);
 						margin-bottom: 23rpx;
diff --git a/pageE/mine/MemberServeCoupon.vue b/pageE/mine/MemberServeCoupon.vue
index 796aad4..4ca97f4 100644
--- a/pageE/mine/MemberServeCoupon.vue
+++ b/pageE/mine/MemberServeCoupon.vue
@@ -1,6 +1,6 @@
 
 	
-		
+		
 		
 			
 				
@@ -31,43 +31,9 @@ export default {
 			swiperHeight: '',
 			couponCurrent: 0,
 			swiperCouponCurrent: 0,
-			couponGroupList: [
-				{
-					name: '平台'
-				}, {
-					name: '分类名称'
-				}, {
-					name: '分类名称'
-				}, {
-					name: '分类名称'
-				}, {
-					name: '分类名称'
-				}, {
-					name: '分类名称'
-				}, {
-					name: '分类名称'
-				}, {
-					name: '分类名称'
-				}, {
-					name: '分类名称'
-				}, {
-					name: '分类名称'
-				}, {
-					name: '分类名称'
-				}, {
-					name: '分类名称'
-				}, {
-					name: '分类名称'
-				}
-			],
-			couponList: [
-				{
-					index: 0
-				},
-				{
-					index: 1
-				},
-			],
+			couponGroupList: [],
+			couponList: [],
+			page: 0,
 		}
 	},
 	components: {
@@ -75,8 +41,35 @@ export default {
 	},
 	created() {
 		this.setViewHeight();
+		this.getGoodsClass();
+	},
+	watch: {
+		couponCurrent(index) {
+			const id = this.couponGroupList[index].gc_id;
+			this.getCouponList({ gc_id: id });
+		}
 	},
 	methods: {
+		getGoodsClass() {
+			this.$u.api.getGoodsClass().then(res => {
+				if(res.errCode == 0) {
+					this.couponGroupList = res.data;
+					this.getCouponList(this.couponGroupList[0].gc_id);
+				}
+			})
+		},
+		getCouponList({ gc_id }) {
+			this.$u.api.getCouponList({
+				page: this.page,
+				gc_id: gc_id,
+			}).then(res => {
+				if(res.errCode == 0) {
+					this.couponList = res.data;
+				} else {
+					this.couponList = [];
+				}
+			})
+		},
 		exchangeCoupon(id) {
 			console.log(id);
 			
diff --git a/pageE/tool/MineCoupon.vue b/pageE/tool/MineCoupon.vue
index 724cd48..b98d078 100644
--- a/pageE/tool/MineCoupon.vue
+++ b/pageE/tool/MineCoupon.vue
@@ -4,7 +4,7 @@
 		
 			
 				
-					
+					
 						
 					
 				
@@ -24,35 +24,10 @@ export default {
 			}, {
 				name: '已过期'
 			}],
-			current: 0,
+			current: Number,
 			swiperCurrent: 0,
 			swiperHeight: '',
-			test: [
-				{
-					index: 0
-				},
-				{
-					index: 1
-				},
-				{
-					index: 2
-				},
-				{
-					index: 3
-				},
-				{
-					index: 4
-				},
-				{
-					index: 5
-				},
-				{
-					index: 6
-				},
-				{
-					index: 7
-				}
-			]
+			couponList: []
 		}
 	},
 	components: {
@@ -61,7 +36,25 @@ export default {
 	onLoad() {
 		this.setViewHeight();
 	},
+	onShow() {
+		this.current = 0;
+	},
+	watch: {
+		current(value) {
+			let status = value + 1;
+			this.getMemberCouponList(status);
+		}
+	},
 	methods: {
+		getMemberCouponList(current) {
+			this.$u.api.getMemberCouponList({
+				status: current
+			}).then(res => {
+				if(res.errCode == 0) {
+					this.couponList = res.data;
+				}
+			})
+		},
 		useCoupon(id) {
 			console.log(id);
 		},
diff --git a/pages/shop/index.vue b/pages/shop/index.vue
index 2194c5b..e9e6e06 100644
--- a/pages/shop/index.vue
+++ b/pages/shop/index.vue
@@ -38,16 +38,16 @@
         
         
         
-        
+        
         
         
-        
-        
+        
+        
         
         
         
         
-        
+
@@ -85,20 +85,22 @@ export default {
 			list:[],
 			goodsClassify: [], // 商品分类
 			classifyList: [],
-			goodsList: [],
 			recommendedSpike: {}, // 秒杀推荐
 			spikeList: [], // 全部秒杀列表
 			seckillTime: {}, // 秒杀时间
+			couponGroupList: [], // 优惠券拼团分类
+			pinTuanList: [], // 拼团商品
+			pinTuanPush: {}, // 拼团推荐
         }
 	},
 	onLoad() {
 		this.getShopTopList();
-		this.getGoodsRecommend();
 	},
 	onShow() {
 		this.getRecommendedSpike();
 		this.getSpikeList();
-		this.getPinTuanList();
+		this.getGoodsClass();
+		this.getPinTuanPush();
 	},
 	methods: {
         sousuo(){
@@ -129,6 +131,23 @@ export default {
 				// console.log(this.recommendedSpike);
 			})
 		},
+		// 拼团推荐
+		getPinTuanPush() {
+			this.$u.api.getPinTuanPush().then(res => {
+				if(res.errCode == 0) {
+					this.pinTuanPush = res.data;
+				}
+			})
+		},
+		// 获取优惠券拼团分类
+		getGoodsClass() {
+			this.$u.api.getGoodsClass().then(res => {
+				if(res.errCode == 0) {
+					this.couponGroupList = res.data;
+					this.getPinTuanList(this.couponGroupList[0].gc_id);
+				}
+			})
+		},
 		// 全部秒杀
 		getSpikeList() {
 			this.$u.api.getSpikeList({ page: 0 }).then(res => {
@@ -142,21 +161,12 @@ export default {
 			})
 		},
 		// 拼团列表
-		getPinTuanList() {
-			this.$u.api.getPinTuanList().then(res => {
-
-			})
-		},
-		getGoodsRecommend() {
-			this.$u.api.getGoodsRecommend({
-				page: 1,
-			}).then((res)=>{
-				if (res.errCode == 0) {
-					this.classifyList = res.data.classifyList;
-					this.goodsList = res.data.goodsList;
-					// console.log(this.classifyList);
-					
-				}
+		getPinTuanList(id) {
+			this.$u.api.getPinTuanList({
+				page: 0,
+				gc_id: id,
+			}).then(res => {
+				this.pinTuanList = res.data;
 			})
 		},
 		clickImage(index) {