|
@@ -35,7 +35,9 @@
|
|
|
<text class="name">{{ item.customName }}</text>
|
|
<text class="name">{{ item.customName }}</text>
|
|
|
<text class="amount">¥ {{ item.amount?parseFloat(item.amount):0 }}</text>
|
|
<text class="amount">¥ {{ item.amount?parseFloat(item.amount):0 }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="status" :class="item.statusClass">{{ item.status==0?'待使用':item.status==1?'已使用':item.status==-1?'已失效':'未知'}}</view>
|
|
|
|
|
|
|
+ <view class="status" :class="{ 'status-wait': item.status == 0, 'status-used': item.status == 1, 'status-expired': item.status == -1 }">
|
|
|
|
|
+ {{ item.status==0?'待使用':item.status==1?'已使用':item.status==-1?'已失效':'未知'}}
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="card-body">
|
|
<view class="card-body">
|
|
|
<view class="row">开始时间:{{ formatDateTime(item.beginTime) }}</view>
|
|
<view class="row">开始时间:{{ formatDateTime(item.beginTime) }}</view>
|
|
@@ -74,12 +76,11 @@ export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
tabIndex: 0,
|
|
tabIndex: 0,
|
|
|
- status: 0,
|
|
|
|
|
tabs: [
|
|
tabs: [
|
|
|
- {name: '全部', value: 0},
|
|
|
|
|
- {name: '待使用', value: 0},
|
|
|
|
|
- {name: '已使用', value: 0},
|
|
|
|
|
- {name: '已失效', value: 0}
|
|
|
|
|
|
|
+ {name: '全部', value: 0,status:''},
|
|
|
|
|
+ {name: '待使用', value: 0,status:'0'},
|
|
|
|
|
+ {name: '已使用', value: 0,status:'1'},
|
|
|
|
|
+ {name: '已失效', value: 0,status:'-1'}
|
|
|
],
|
|
],
|
|
|
searchText: '',
|
|
searchText: '',
|
|
|
showSearch: false,
|
|
showSearch: false,
|
|
@@ -118,41 +119,13 @@ export default {
|
|
|
this.getHbList()
|
|
this.getHbList()
|
|
|
},
|
|
},
|
|
|
getHbList() {
|
|
getHbList() {
|
|
|
- return hbList({
|
|
|
|
|
- status: this.status,
|
|
|
|
|
- page: this.list.page,
|
|
|
|
|
- limit: this.list.pageSize,
|
|
|
|
|
- customId: this.customId
|
|
|
|
|
- }).then((res) => {
|
|
|
|
|
- if (res.data && res.data.list) {
|
|
|
|
|
- res.data.list.forEach(item => {
|
|
|
|
|
- if (item.statusText === '待使用') item.statusClass = 'status-wait'
|
|
|
|
|
- else if (item.statusText === '已使用') item.statusClass = 'status-used'
|
|
|
|
|
- else if (item.statusText === '已失效') item.statusClass = 'status-expired'
|
|
|
|
|
- else item.statusClass = ''
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ let status = this.tabs[this.tabIndex].status||0
|
|
|
|
|
+ return hbList({ status: status, page: this.list.page, limit: this.list.pageSize, customId: this.customId }).then((res) => {
|
|
|
this.completes(res)
|
|
this.completes(res)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
change(e) {
|
|
change(e) {
|
|
|
this.tabIndex = e.index
|
|
this.tabIndex = e.index
|
|
|
- // 状态 -1作废 0未使用 1已使用。0时还要结合endTime来判断是否过期
|
|
|
|
|
- switch (e.index) {
|
|
|
|
|
- case 0:
|
|
|
|
|
- this.status = ''
|
|
|
|
|
- break
|
|
|
|
|
- case 1:
|
|
|
|
|
- this.status = 0
|
|
|
|
|
- break
|
|
|
|
|
- case 2:
|
|
|
|
|
- this.status = 1
|
|
|
|
|
- break
|
|
|
|
|
- case 3:
|
|
|
|
|
- this.status = -1
|
|
|
|
|
- break
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
this.loadData()
|
|
this.loadData()
|
|
|
},
|
|
},
|
|
|
searchFn(e) {
|
|
searchFn(e) {
|
|
@@ -335,7 +308,7 @@ export default {
|
|
|
color: #666;
|
|
color: #666;
|
|
|
}
|
|
}
|
|
|
&.status-expired {
|
|
&.status-expired {
|
|
|
- color: #999;
|
|
|
|
|
|
|
+ color: red;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|