扫码下单

This commit is contained in:
魏啾
2024-05-15 16:55:38 +08:00
parent da87e38df0
commit 618daced35
6 changed files with 211 additions and 54 deletions

View File

@@ -6,7 +6,8 @@
<view>可使用红包</view>
<text>{{totalnumber}}</text>
</view>
<view class="containertopboxitem flex-start" v-for="(item,index) in list" :key="index">
<view class="containertopboxitem flex-start" v-for="(item,index) in list" :key="index"
@click="clickiconone(item)">
<view class="containertopboxitemleft flex-colum"
:class="item.status == 0?'':'containertopboxitemlefts'">
<view class="containertopboxitemleft_one"
@@ -57,7 +58,7 @@
{{item.name}}
</view>
<view class="containerbottombox_bottombox flex-start" v-for="(item1,index1) in item.listdata"
:key="index1">
:key="index1" @click="clickicon(item1)">
<view class="containerbottombox_bottomthere">
<view class="containerbottombox_bottomthere_topitem">
<view class="onecontainerbottombox_bottomthere_topitem">
@@ -81,7 +82,7 @@
</view>
</view>
<view class="therecontainerbottombox_bottomthere_topitem flex-around" @click="clickicon(item1)">
<view class="therecontainerbottombox_bottomthere_topitem flex-around">
<u-icon v-if="item1.id == item1id" name="checkmark-circle" color="#F1CB66"
size="45"></u-icon>
<text v-else class="theretext"></text>
@@ -113,16 +114,53 @@
size: 10, //页容量
status: 'loadmore'
},
orderfood: '', //等于0扫码点餐下单
amount: '' //下单金额传来的值
};
},
onLoad(e) {
try {
this.orderfood = e.orderfood //等于0扫码点餐下单
this.amount = e.amount
} catch (e) {
//TODO handle the exception
}
},
onShow() {
this.ordermineCouponsthis()
this.ordergetYhqParass()
},
methods: {
clickicon(e){
clickicon(e) { //团购优惠卷
this.item1id = e.id
e.clickiconone = 1
let data = e
if (this.orderfood == 0) { //等于0扫码点餐下单
if (this.amount > e.couponsAmount) {
uni.$emit('emitclickorderfood', e)
uni.navigateBack()
} else {
uni.showToast({
title: '此优惠卷不能用于目前订单',
icon: "none",
})
}
}
},
clickiconone(e) { //自己优惠劵处理
e.clickiconone = 0
let data = e
if (this.orderfood == 0) { //等于0扫码点餐下单
if (this.amount > e.couponsAmount) {
uni.$emit('emitclickorderfood', data)
uni.navigateBack()
} else {
uni.showToast({
title: '此优惠卷不能用于目前订单',
icon: "none",
})
}
}
},
async ordergetYhqParass() { //类型列表
let res = await this.api.ordergetYhqPara()