优化服务列表页面
This commit is contained in:
parent
85284d0b1c
commit
ee7c3e9f19
|
@ -11,7 +11,7 @@
|
|||
/>
|
||||
</view>
|
||||
<view class="common-bottom-components" :style="{ paddingBottom: pageConfig.safeAreaInsets.bottom + 'px' }">
|
||||
<view class="cart" @click="utils.toPage('/pages/service/cart')">
|
||||
<view class="cart" @click="toCart">
|
||||
<view class="cart-icon">
|
||||
<text class="iconfont icon-gouwuche"></text>
|
||||
</view>
|
||||
|
@ -38,7 +38,6 @@ export default {
|
|||
pageConfig: {},
|
||||
data: [],
|
||||
canUseCartBtn: false,
|
||||
canChangeCartNumber: true,
|
||||
currentId: 0,
|
||||
};
|
||||
},
|
||||
|
@ -124,26 +123,20 @@ export default {
|
|||
* 数量改变
|
||||
*/
|
||||
changeNumber(e, id) {
|
||||
if (this.canChangeCartNumber) {
|
||||
this.canChangeCartNumber = false;
|
||||
if (e.value > 0) {
|
||||
if (e.type == "add" && e.value == 1) {
|
||||
this.$models.cart.toCart(id).then(async () => {
|
||||
await this.$store.dispatch("cart/update", true);
|
||||
this.canChangeCartNumber = true;
|
||||
});
|
||||
} else {
|
||||
this.$models.cart.change(id, e.type).then(async () => {
|
||||
await this.$store.dispatch("cart/update", true);
|
||||
this.canChangeCartNumber = true;
|
||||
});
|
||||
}
|
||||
if (e.value > 0) {
|
||||
if (e.type == "add" && e.value == 1) {
|
||||
this.$models.cart.toCart(id).then(() => {
|
||||
this.$store.dispatch("cart/update", true);
|
||||
});
|
||||
} else {
|
||||
this.$models.cart.delete(id).then(async () => {
|
||||
await this.$store.dispatch("cart/update", true);
|
||||
this.canChangeCartNumber = true;
|
||||
this.$models.cart.change(id, e.type).then(() => {
|
||||
this.$store.dispatch("cart/update", true);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$models.cart.delete(id).then(() => {
|
||||
this.$store.dispatch("cart/update", true);
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue