Commit add05e5f by 高淑倩

add: 订单不同的状态

parent fab3a01b
......@@ -10,25 +10,31 @@ wxService.page({
* 页面的初始数据
*/
data: {
// 订单状态(C:取消;N:新建,P:已支付;D:已发货;R:已收货)
swiperItem: [
{
type: '1',
status: '',
name: '全部'
},
{
type: '2',
name: '待付款'
status: 'N',
name: '待付款' // 新建
},
{
type: '3',
status: 'P',
name: '待发货'
},
{
type: '4',
status: 'D',
name: '待收货'
},
{
type: '5',
status: 'RF',
name: '退款/售后'
}
],
......@@ -68,9 +74,6 @@ wxService.page({
this.initOrderList(this.data.pageNo, this.data.pageSize, this.data.trade)
},
initOrderList(pageNo, pageSize,trade) {
if (this.data.noMoreFlag) { // 没有更多数据了,不调用接口
return false
}
wx.showLoading({
title: '加载中',
mask: true
......@@ -91,8 +94,20 @@ wxService.page({
},
//点击切换tab
switchTab(e) {
const { type, status } = e.currentTarget.dataset
const {currentIndex} = this.data
if(currentIndex == type) return false
this.setData({
currentIndex: e.currentTarget.dataset.type
currentIndex: type,
pageNo: 1,
orderList: [],
trade: ''
},()=>{
if(type == 5 && status == 'RF'){
console.log("退款/售后")
} else {
this.initOrderList(this.data.pageNo, this.data.pageSize, status)
}
})
},
......
......@@ -7,6 +7,7 @@
wx:key="{{index}}"
bindtap="switchTab"
data-type="{{item.type}}"
data-status="{{item.status}}"
>
{{item.name}}
</view>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment