优化购物车页面
This commit is contained in:
parent
9a92cdf1f0
commit
68f0622384
|
@ -84,38 +84,44 @@ export default {
|
||||||
cart: (state) => state.cart.cart,
|
cart: (state) => state.cart.cart,
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
onLoad() {},
|
onLoad() {
|
||||||
async onShow() {
|
this.initPage();
|
||||||
await this.$store.dispatch("cart/update");
|
|
||||||
this.list = [];
|
|
||||||
this.cart.list.forEach((item) => {
|
|
||||||
let goods = [];
|
|
||||||
item.good.forEach((v) => {
|
|
||||||
goods.push({
|
|
||||||
id: v.gid,
|
|
||||||
name: v.title,
|
|
||||||
times: v.post_hits,
|
|
||||||
cover: v.thumbnail,
|
|
||||||
price: v.money,
|
|
||||||
number: v.number,
|
|
||||||
checked: false,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
this.list.push({
|
|
||||||
name: item.cate,
|
|
||||||
total: 0,
|
|
||||||
list: goods,
|
|
||||||
checked: false,
|
|
||||||
canUse: false,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
onShow() {},
|
||||||
onReady() {},
|
onReady() {},
|
||||||
onReachBottom() {},
|
onReachBottom() {},
|
||||||
onPullDownRefresh() {},
|
onPullDownRefresh() {},
|
||||||
onShareTimeline() {},
|
onShareTimeline() {},
|
||||||
onShareAppMessage() {},
|
onShareAppMessage() {},
|
||||||
methods: {
|
methods: {
|
||||||
|
/**
|
||||||
|
* 初始化页面
|
||||||
|
*/
|
||||||
|
async initPage() {
|
||||||
|
await this.$store.dispatch("cart/update");
|
||||||
|
this.list = [];
|
||||||
|
this.cart.list.forEach((item) => {
|
||||||
|
let goods = [];
|
||||||
|
item.good.forEach((v) => {
|
||||||
|
goods.push({
|
||||||
|
id: v.gid,
|
||||||
|
name: v.title,
|
||||||
|
times: v.post_hits,
|
||||||
|
cover: v.thumbnail,
|
||||||
|
price: v.money,
|
||||||
|
number: v.number,
|
||||||
|
checked: false,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.list.push({
|
||||||
|
name: item.cate,
|
||||||
|
total: 0,
|
||||||
|
list: goods,
|
||||||
|
checked: false,
|
||||||
|
canUse: false,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 选中组
|
* 选中组
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue