提交 a0df5f1c authored 作者: flex's avatar flex

订单

上级 a17525de
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<div class="tab-box"> <div class="tab-box">
<div <div
@click="tabIndex = item.value" @click="changeTab(item.value)"
v-for="item in tabs" v-for="item in tabs"
:key="item.value" :key="item.value"
:class="tabIndex == item.value ? 'active' : ''" :class="tabIndex == item.value ? 'active' : ''"
...@@ -65,10 +65,11 @@ ...@@ -65,10 +65,11 @@
<van-button <van-button
class="border-none" class="border-none"
:hairline="false" :hairline="false"
v-if="item.status==0"
color="#2a2a2a" color="#2a2a2a"
type="success" type="success"
loading-text="Pay" loading-text="Pay"
:Loading="btnLoading" :loading="btnLoading"
@click="onPay(item.orderNo)" @click="onPay(item.orderNo)"
>Pay</van-button >Pay</van-button
> >
...@@ -106,6 +107,13 @@ ...@@ -106,6 +107,13 @@
<span>{{ item.goods_lr }}</span> <span>{{ item.goods_lr }}</span>
</div> </div>
</div> </div>
<van-empty v-if="!orderData.length" >
<template #description>
<span style="font-size: 1.2rem;">No Data</span>
</template>
</van-empty>
</div> </div>
</div> </div>
</div> </div>
...@@ -134,6 +142,11 @@ export default { ...@@ -134,6 +142,11 @@ export default {
}; };
}, },
methods: { methods: {
changeTab(index){
this.orderData=[];
this.tabIndex=index;
this.getOrderList(index);
},
onPay(orderId) { onPay(orderId) {
Dialog.confirm({ Dialog.confirm({
title: "pay", title: "pay",
...@@ -148,6 +161,7 @@ export default { ...@@ -148,6 +161,7 @@ export default {
}).then((res) => { }).then((res) => {
if(res.code==200){ if(res.code==200){
Toast('Payment successful'); Toast('Payment successful');
this.getOrderList();
}else{ }else{
Toast(res.msg); Toast(res.msg);
} }
...@@ -174,15 +188,22 @@ export default { ...@@ -174,15 +188,22 @@ export default {
} }
console.log("酒店轮播图:", res.data); console.log("酒店轮播图:", res.data);
}, },
getOrderList() { getOrderList(index) {
Toast.loading({
message: 'loading...',
duration:0
});
orderList({ orderList({
status: 0, status:index || 0,
page: 1, page: 1,
size: 999, size: 999,
}).then((res) => { }).then((res) => {
this.orderData = res.data; this.orderData = res.data;
}).finally(()=>{
Toast.clear();
}); });
}, }
}, },
mounted() { mounted() {
this.getLunBoHotel(); this.getLunBoHotel();
...@@ -212,7 +233,8 @@ export default { ...@@ -212,7 +233,8 @@ export default {
.content { .content {
padding: 0 20px; padding: 0 20px;
.list { .list {
border-bottom: 1px solid #fafafa; border-bottom: 1px solid #eee;
margin-bottom: 2rem;
.header { .header {
flex: 1; flex: 1;
display: flex; display: flex;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论