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] 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() {