|
@@ -11,7 +11,7 @@
|
|
|
<template v-slot:body>
|
|
|
<view class="slot-body titleBox" @click="btn(item)">
|
|
|
<view class="slot-box slot-title">{{ item['discountInfo.name'] }}</view>
|
|
|
- <!-- <view class="slot-box slot-text">领取时间:{{ item.endTime }}前</view> -->
|
|
|
+ <view class="slot-box slot-text">状态:{{ item.statusText }}</view>
|
|
|
<view class="slot-box slot-text">领取地点:{{ item['discountInfo.location'] }}</view>
|
|
|
|
|
|
</view>
|
|
@@ -37,9 +37,12 @@
|
|
|
page: 0,
|
|
|
size: 10,
|
|
|
more: 'more',
|
|
|
+ dicts: []
|
|
|
};
|
|
|
},
|
|
|
onLoad: async function() {
|
|
|
+ const dict = await voucher.getDict('voucher_status');
|
|
|
+ this.dicts = dict.data;
|
|
|
this.query();
|
|
|
},
|
|
|
methods: {
|
|
@@ -49,6 +52,8 @@
|
|
|
// 此处是查询函数
|
|
|
const res = await voucher.getMyList({ pageNum: this.page, pageSize: this.size });
|
|
|
this.list.push(...res.rows.map(e => {
|
|
|
+ const statusDict = this.dicts.find(j => j.dictValue == e.status)
|
|
|
+ if (statusDict) e.statusText = statusDict?.dictLabel;
|
|
|
for (const key in e.discountInfo) {
|
|
|
const itemKey = `discountInfo.${key}`;
|
|
|
e[itemKey] = e.discountInfo[key]
|
|
@@ -60,7 +65,7 @@
|
|
|
},
|
|
|
// 详情
|
|
|
btn(item) {
|
|
|
- uni.navigateTo({ url: `/pages/good/details?id=${item.voucherId}` });
|
|
|
+ uni.navigateTo({ url: `/pages/goods/details?id=${item.discountId}` });
|
|
|
}
|
|
|
},
|
|
|
// 页面生命周期中onReachBottom(页面滚动到底部的事件)
|