提交 3957a0d5 authored 作者: pengxiaohui's avatar pengxiaohui

订单页登录失效处理

上级 f4946e4d
......@@ -50,6 +50,7 @@
<van-button plain round type="primary" size="mini" color="#C01540" @click.stop="handlePay(item)">付款</van-button>
</div>
</div>
<template slot="finished">{{list.length > 0 ? '没有更多了': ''}}</template>
</van-list>
</van-pull-refresh>
<ul class="order-list" v-if="false">
......@@ -77,7 +78,7 @@
</div>
</li>
</ul>
<van-empty description="暂无订单" v-if="list.length === 0"/>
<van-empty description="暂无订单" v-if="list.length === 0 && finished"/>
<van-dialog v-model="dialogVisiable" title="请选择支付方式" show-cancel-button @confirm="handleDialogConfirm">
<van-radio-group v-model="payType">
<van-radio name="12">支付宝支付</van-radio>
......@@ -137,6 +138,7 @@ export default {
else this.getCode()
}
// this.fetchOrderList()
console.log(this.list.length === 0 && this.finished)
},
methods: {
handlePay(item) {
......@@ -234,14 +236,18 @@ export default {
}
if (res.code === 0 && res.msg === '成功') {
this.list = this.list.concat(res.data)
this.total = parseInt(res.page_info.total_number)
if (((parseInt(this.page) + 1) * parseInt(this.page_size)) > this.total) {
this.finished = true
} else {
this.page = parseInt(this.page) + 1 + ''
}
} else if ([1000, 1001, 1002].includes(res.code)) {
Toast.fail('请重新登录')
this.finished = true
} else {
this.list = []
}
this.total = parseInt(res.page_info.total_number)
if (((parseInt(this.page) + 1) * parseInt(this.page_size)) > this.total) {
this.finished = true
} else {
this.page = parseInt(this.page) + 1 + ''
}
this.loading = false
})
......
......@@ -150,6 +150,8 @@ export default {
this.timer && clearInterval(this.timer)
}
}
} else if ([1000, 1001, 1002].includes(res.code)) {
Toast.fail('请重新登录')
}
})
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论