|
|
@@ -26,20 +26,24 @@
|
|
|
<div class="text1">已售 238</div>
|
|
|
<div class="text1">赞 60</div>
|
|
|
</div>
|
|
|
- <div class="buttom">
|
|
|
+ <div class="buttom" v-for="(item, index) in merchantorLists" :key="index">
|
|
|
<div class="text">
|
|
|
<img
|
|
|
src="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-09-02-16-03-40cShzZQEk.png"
|
|
|
alt=""
|
|
|
/>
|
|
|
- <div class="text1">20</div>
|
|
|
+ <div class="text1">{{ item.price }}</div>
|
|
|
<div class="text3">.00</div>
|
|
|
<div class="text2">另外配送费2元</div>
|
|
|
</div>
|
|
|
<div class="calculationCon">
|
|
|
- <div class="calculation" @click="calculation">-</div>
|
|
|
- <div class="num">{{ count }}</div>
|
|
|
- <div class="add" @click="count++">+</div>
|
|
|
+ <van-stepper
|
|
|
+ :min="0"
|
|
|
+ disable-input
|
|
|
+ @minus="minus(item.price)"
|
|
|
+ @plus="add(item.price)"
|
|
|
+ @change="onChange"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -108,7 +112,11 @@
|
|
|
<div class="box-total">
|
|
|
<div class="ImgBox">
|
|
|
<img
|
|
|
- src="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-09-06-16-47-32IOmXLZXX.png"
|
|
|
+ :src="
|
|
|
+ `https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/${
|
|
|
+ tal ? '2021-09-01-16-30-24QYDxYMzU.png' : '2021-09-01-16-30-03wvZqsAeX.png'
|
|
|
+ }`
|
|
|
+ "
|
|
|
alt=""
|
|
|
/>
|
|
|
<div>
|
|
|
@@ -117,13 +125,13 @@
|
|
|
src="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-09-02-16-03-40cShzZQEk.png"
|
|
|
alt=""
|
|
|
/>
|
|
|
- <p>22</p>
|
|
|
+ <p>{{ tal }}</p>
|
|
|
<div class="text1">.00</div>
|
|
|
</div>
|
|
|
<div class="text1">另外配送费2元</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <van-button type="warning" @click="order">结算</van-button>
|
|
|
+ <van-button :disabled="!canSubmit" type="warning" @click="order">结算</van-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -136,6 +144,7 @@ export default {
|
|
|
return {
|
|
|
swiperCurrent: 0,
|
|
|
count: 1,
|
|
|
+ tal: 0,
|
|
|
banners: [
|
|
|
{
|
|
|
image: 'https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-08-13-15-54-36URxMKUXs.jpg'
|
|
|
@@ -144,6 +153,15 @@ export default {
|
|
|
image: 'https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-08-13-15-56-45UCHrCoTS.gif'
|
|
|
}
|
|
|
],
|
|
|
+ merchantorLists: [
|
|
|
+ {
|
|
|
+ name: '寿司',
|
|
|
+ image: 'https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/image/2021-08-13-15-54-36URxMKUXs.jpg',
|
|
|
+ num: '226',
|
|
|
+ fabulous: '40',
|
|
|
+ price: 20.0
|
|
|
+ }
|
|
|
+ ],
|
|
|
lists: [
|
|
|
{
|
|
|
price: '11',
|
|
|
@@ -163,22 +181,46 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState(['userInfo'])
|
|
|
+ ...mapState(['userInfo']),
|
|
|
+ canSubmit() {
|
|
|
+ if (this.tal) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
change(e) {
|
|
|
this.active = e;
|
|
|
},
|
|
|
order() {
|
|
|
- this.navigateTo('/pages/confirmorder');
|
|
|
- },
|
|
|
- calculation() {
|
|
|
- if (this.count != 0) {
|
|
|
- this.count--;
|
|
|
+ if (!this.tal) {
|
|
|
+ wx.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '请选择商品'
|
|
|
+ });
|
|
|
+ return;
|
|
|
}
|
|
|
+ this.navigateTo('/pages/confirmorder');
|
|
|
},
|
|
|
swiperChange(e) {
|
|
|
this.swiperCurrent = e.detail.current;
|
|
|
+ },
|
|
|
+ falgs(price) {
|
|
|
+ this.tal = price * 1;
|
|
|
+ this.count = 1;
|
|
|
+ this.min = 1;
|
|
|
+ },
|
|
|
+ add(price) {
|
|
|
+ this.tal = this.tal + price + this.count;
|
|
|
+ },
|
|
|
+ onChange(e) {
|
|
|
+ this.count = e.detail;
|
|
|
+ },
|
|
|
+ minus(price) {
|
|
|
+ this.min = 0;
|
|
|
+ this.tal = price * this.count;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -190,6 +232,25 @@ export default {
|
|
|
/deep/ .van-button {
|
|
|
.button();
|
|
|
}
|
|
|
+ /deep/ .van-stepper__minus {
|
|
|
+ width: 28px;
|
|
|
+ height: 24px;
|
|
|
+ background: @prim;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ /deep/ .van-stepper__plus {
|
|
|
+ width: 28px;
|
|
|
+ height: 24px;
|
|
|
+ background: @prim;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ /deep/ .van-stepper__input {
|
|
|
+ width: 28px;
|
|
|
+ height: 24px;
|
|
|
+ background: #f5f7fa;
|
|
|
+ border-radius: 2px;
|
|
|
+ margin: 0 2px;
|
|
|
+ }
|
|
|
.swiper {
|
|
|
height: 375px;
|
|
|
img {
|
|
|
@@ -290,22 +351,6 @@ export default {
|
|
|
font-weight: bold;
|
|
|
color: #fff;
|
|
|
}
|
|
|
- .num {
|
|
|
- width: 28px;
|
|
|
- height: 24px;
|
|
|
- line-height: 24px;
|
|
|
- background: #f5f7fa;
|
|
|
- border-radius: 2px;
|
|
|
- margin: 0 4px;
|
|
|
- }
|
|
|
- .add {
|
|
|
- width: 24px;
|
|
|
- height: 24px;
|
|
|
- background: @prim;
|
|
|
- line-height: 24px;
|
|
|
- font-weight: bold;
|
|
|
- color: #fff;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
}
|