|
|
@@ -10,29 +10,30 @@ |
|
|
|
<view style="margin-bottom: 20px;font-size: 38rpx; text-align: center;font-family: Microsoft Yahei;"> |
|
|
|
我的权益</view> |
|
|
|
<!-- <view v-if="exchangeCodes.length > 0" style="text-align: center;">暂无权益内容</view> @scrolltolower="loadMore" --> |
|
|
|
<scroll-view scroll-y="true" > |
|
|
|
<scroll-view scroll-y="true"> |
|
|
|
<view v-for="(item, index) in exchangeCodes" :key="index" class="item" @click="click"> |
|
|
|
<view style="display: flex;flex-direction: row;flex: 1;"> |
|
|
|
<view style="display: flex;flex-direction: column;margin: 10px;"> |
|
|
|
<text>权益名称:{{item.couponName}}</text> |
|
|
|
<text style="margin-top: 10rpx;">状态:{{item.getStatus}}</text> |
|
|
|
<text>权益名称:{{item.equityInfoItems[0].productName}}</text> |
|
|
|
<text style="margin-top: 10rpx;">车牌号:{{item.vehiclePlate}}</text> |
|
|
|
<text v-if="{{item.drawTime}}" style="margin-top: 10rpx;">领取时间:{{item.drawTime}}</text> |
|
|
|
<text style="margin-top: 10rpx;">领取时间:{{item.getStatus}}</text> |
|
|
|
<text style="margin-top: 10rpx;">有效期:{{item.validEndTime}}</text> |
|
|
|
<text style="margin-top: 10rpx;">有效期:{{ item.periodOfValidity }}</text> |
|
|
|
<view |
|
|
|
style="display: flex;justify-content: flex-start;flex-direction: row;width: 100%;margin-top: 10rpx;"> |
|
|
|
<text class="code">券码:{{ item.redeemCodeStr}}</text> |
|
|
|
<text v-if="{{item.redeemCodeStr}}" class="code">券码:{{ item.redeemCodeStr}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view |
|
|
|
style="border-radius: 0 8px 8px 0 ;justify-content: center;text-align: center; display: flex;flex-direction: column;background: white;flex: 1;"> |
|
|
|
style="margin: 10px;border-radius: 0 8px 8px 0 ;justify-content: center;text-align: center; display: flex;flex-direction: column;background: white;flex: 1;"> |
|
|
|
<text class="text-w" |
|
|
|
:style="{color: item.status == 'WAIT_ACTIVATED' ? '#023F8F' : item.status == 'WAIT_USE' ? 'orange' : item.status == 'USED' ? 'green' : 'gray'}">{{item.status == 'WAIT_ACTIVATED' ? '待激活' : item.status == 'WAIT_USE' ? '待领取' : |
|
|
|
item.status == 'USED' ? '已领取' : '已失效'}}</text> |
|
|
|
<button v-if="item.status != 'EXPIRED'" |
|
|
|
:style="{backgroundColor: item.status == 'WAIT_ACTIVATED' ? '#023F8F' : item.status == 'WAIT_USE' ? 'orange' : item.status == 'USED' ? 'green' : 'gray'}" |
|
|
|
class="copy-btn" :data-code="item" @click="copyCode"> |
|
|
|
style="{{ item.status == 'WAIT_ACTIVATED' ? 'color: #023F8F;' : item.status == 'WAIT_USE' ? 'color: orange;' : item.status == 'USED' ? 'color: green;' : 'color: gray;'}}">{{item.status == 'WAIT_ACTIVATED' ? '待激活' : item.status == 'WAIT_USE' ? '待领取' : |
|
|
|
item.status == 'USED' ? '已领取' : '已失效'}}</text> |
|
|
|
<button wx:if="{{item.status != 'EXPIRED'}}" |
|
|
|
style="{{ item.status == 'WAIT_ACTIVATED' ? 'background-color: #023F8F;' : item.status == 'WAIT_USE' ? 'background-color: orange;' : item.status == 'USED' ? 'background-color: green;' : 'background-color: gray;'}}" |
|
|
|
class="copy-btn" data-code="{{item}}" @click="copyCode"> |
|
|
|
{{item.status == 'WAIT_ACTIVATED' ? '去激活' : item.status == 'WAIT_USE' ? '立即领取' : |
|
|
|
item.status == 'USED' ? '复制' : ''}}</button> |
|
|
|
item.status == 'USED' ? '复制' : ''}}</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@@ -61,19 +62,26 @@ |
|
|
|
let singleEquityId = ref('') |
|
|
|
let couponAgencyType = ref('') |
|
|
|
let couponId = ref('') |
|
|
|
let exchangeCodes: any = ref('') |
|
|
|
let exchangeCodes: any = ref([]) |
|
|
|
let page = ref('') |
|
|
|
|
|
|
|
onLoad((options) => { |
|
|
|
couponId.value = options.couponId |
|
|
|
singleEquityId.value = options.singleEquityId |
|
|
|
couponAgencyType.value = options.couponAgencyType |
|
|
|
loadExchangeCodes(); |
|
|
|
}) |
|
|
|
|
|
|
|
function loadExchangeCodes(){ |
|
|
|
//卡券渠道类型获取单项权益列表 |
|
|
|
request("bbce0fdfba9b41dabfcb2f19f9a35c97", { |
|
|
|
type: 2, |
|
|
|
data: { |
|
|
|
mobile: getItem('mobile'), |
|
|
|
loginSource: '69af303ba2eb4608a099163f0d2a5dbd', |
|
|
|
singleEquityId: options.singleEquityId, |
|
|
|
couponAgencyType: options.couponAgencyType, |
|
|
|
couponId: options.couponId |
|
|
|
singleEquityId:singleEquityId.value, |
|
|
|
couponAgencyType: couponAgencyType.value, |
|
|
|
couponId: couponId.value |
|
|
|
}, |
|
|
|
method: "POST", |
|
|
|
showLoading: true, |
|
|
@@ -83,15 +91,35 @@ |
|
|
|
let newCodes = res.data; |
|
|
|
if (newCodes) { |
|
|
|
newCodes.forEach(item => { |
|
|
|
item.getStatus = getStatusValue(item.status) |
|
|
|
item.redeemCodeStr = desensitize(item.redeemCode) |
|
|
|
item.validEndTime = item.validEndTime.replace(/T/g, " "); |
|
|
|
//1 不能领取 0 可以领取 1(不能领取原因 notUseCase) |
|
|
|
// WAIT_GET |
|
|
|
item.status = item.equityInfoItems[0].isUse == '0' && item.equityInfoItems[0] |
|
|
|
.couponStatus == 'WAIT_GET' ? 'WAIT_USE' : |
|
|
|
item.equityInfoItems[0].isUse == '1' && item.equityInfoItems[0] |
|
|
|
.couponStatus == 'WAIT_GET' ? 'WAIT_ACTIVATED' : item.equityInfoItems[0] |
|
|
|
.couponStatus == 'USED' ? 'USED' : ''; |
|
|
|
//WAIT_ACTIVATED(待激活) WAIT_USE(待领取使用) USED(已使用) EXPIRED(已过期) OUINGSYNREE |
|
|
|
console.log(item.equityInfoItems[0].periodOfValidity, |
|
|
|
item.equityInfoItems[0].isUse, item.equityInfoItems[0].notUseCase, |
|
|
|
item.status, item.equityInfoItems[0].couponStatus, '=================', |
|
|
|
item.vehiclePlate); |
|
|
|
// item.status = item.equityInfoItems[0].couponStatus == 'WAIT_GET' ? 'WAIT_ACTIVATED' : item.equityInfoItems[0].couponStatus |
|
|
|
item.getStatus = that.getStatusValue(item.status) |
|
|
|
item.redeemCodeStr = item.equityInfoItems[0].couponInfoItem && that |
|
|
|
.desensitize(item.equityInfoItems[0].couponInfoItem.redeemCode) |
|
|
|
item.periodOfValidity = item.equityInfoItems[0].periodOfValidity ? item |
|
|
|
.equityInfoItems[0].periodOfValidity.split('T')[0] : '激活领取后展示' |
|
|
|
item.redeemCode = item.equityInfoItems[0].couponInfoItem && item |
|
|
|
.equityInfoItems[0].couponInfoItem.redeemCode |
|
|
|
item.drawTime = item.equityInfoItems[0].drawTime && item.equityInfoItems[0] |
|
|
|
.drawTime.split('T')[0] |
|
|
|
// item.periodOfValidity = item.equityInfoItems[0].periodOfValidity.replace(/T/g, " "); |
|
|
|
// item.periodOfValidity = item.equityInfoItems[0].periodOfValidity.split('T')[0] |
|
|
|
}); |
|
|
|
exchangeCodes.value = exchangeCodes.value.concat(newCodes) |
|
|
|
page.value = page.value + 1 |
|
|
|
exchangeCodes.value = newCodes |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
function click() { |
|
|
|
let that = this |
|
|
@@ -124,27 +152,35 @@ |
|
|
|
} else if (item.status == 'WAIT_USE') { //待领取使用 |
|
|
|
wx.showModal({ |
|
|
|
title: '温馨提示', |
|
|
|
content: "自卡卷领取后,有效期截止一年后失效", |
|
|
|
content: "请在领取后120天内使用,超期失效", |
|
|
|
success: function(res) { |
|
|
|
if (res.confirm) { |
|
|
|
request("a6bd3d8c855548eb8015655ea8d9287b", { |
|
|
|
type: 2, |
|
|
|
data: { |
|
|
|
mobile: "18385442054", |
|
|
|
mobile: getItem('mobile') + "", |
|
|
|
notificationType: 'USE', |
|
|
|
cardIds: [item.id] |
|
|
|
cardIds: [item.id], |
|
|
|
couponId: couponId.value, |
|
|
|
equityId: item.equityId, |
|
|
|
orderId: item.orderId |
|
|
|
}, |
|
|
|
method: "POST", |
|
|
|
showLoading: true, |
|
|
|
}).then((item) => { |
|
|
|
uni.setClipboardData({ |
|
|
|
data: code, |
|
|
|
success: function() { |
|
|
|
uni.showToast({ |
|
|
|
title: '已复制兑换码', |
|
|
|
icon: 'success', |
|
|
|
}); |
|
|
|
}, |
|
|
|
// uni.setClipboardData({ |
|
|
|
// data: code, |
|
|
|
// success: function() { |
|
|
|
// uni.showToast({ |
|
|
|
// title: '已复制兑换码', |
|
|
|
// icon: 'success', |
|
|
|
// }); |
|
|
|
// }, |
|
|
|
// }); |
|
|
|
loadExchangeCodes(); |
|
|
|
uni.showToast({ |
|
|
|
title: '领取成功', |
|
|
|
icon: 'success', |
|
|
|
}); |
|
|
|
}) |
|
|
|
} else if (res.cancel) { |