|
|
@@ -3,18 +3,27 @@ |
|
|
|
<view class="item" v-for="(item, index) in exchangeCodes" :key="index" @click.stop="click(item)"> |
|
|
|
<view class="top"> |
|
|
|
<view> |
|
|
|
<view style="display: flex;align-items: center;line-height: 58rpx;" v-if="item.vehiclePlate"> |
|
|
|
<image class="car" :src="`${$imgUrl}equity-car.png`" mode=""></image> |
|
|
|
<text class="car-num">{{item.vehiclePlate}}</text> |
|
|
|
<view style="display: flex;align-items: center;line-height: 58rpx;"> |
|
|
|
<image class="car" :src="`${$imgUrl}myImage/etcOrder.png`" mode=""></image> |
|
|
|
<text class="car-num">{{item.orderNo}}</text> |
|
|
|
</view> |
|
|
|
<view class="youxiao">有效期:{{ item.periodOfValidity }}</view> |
|
|
|
<view class="youxiao">有效期:{{ item.validEndTime }}</view> |
|
|
|
</view> |
|
|
|
<view class="activate" :style="{'--bgimg':`url(${$imgUrl}equity-bg3.png)`}">{{item.getStatus}}</view> |
|
|
|
<view class="activate" :style="{'--bgimg':`url(${$imgUrl}equity-bg3.png)`}">{{functBackName(item.status) == 'WAIT_ACTIVATED' ? '已领取' : functBackName(item.status) == 'WAIT_GET' ? '待领取' : functBackName(item.status) == 'EXPIRED' ? '已失效' : ''}}</view> |
|
|
|
</view> |
|
|
|
<view v-for="(list, index) in item.equityInfoItems"> |
|
|
|
<view class="go"> |
|
|
|
<view> |
|
|
|
<view class="title">权益名称:{{item.equityName}}</view> |
|
|
|
<view class="title"><text style="color: #01243A;">卡卷状态:{{functBackName(item.status) == 'WAIT_ACTIVATED' ? '已领取' : functBackName(item.status) == 'WAIT_GET' ? '待领取' : functBackName(item.status) == 'EXPIRED' ? '已失效' : ''}}</text></view> |
|
|
|
</view> |
|
|
|
<view class="btn" data-code="{{item}}" |
|
|
|
@click.stop="copyCode(item)">{{functBackName(item.status) == 'WAIT_ACTIVATED' ? '复制' : functBackName(item.status) == 'WAIT_GET' ? '立即领取' : |
|
|
|
functBackName(item.status) == 'EXPIRED' ? '已失效' : ''}}</view> |
|
|
|
</view> |
|
|
|
<!-- <view v-for="(list, index) in item.equityInfoItems"> |
|
|
|
<view class="go" v-if="list.equityType == 'COUPONS'"> |
|
|
|
<view> |
|
|
|
<view class="title">权益名称:{{list.productName}}</view> |
|
|
|
<view class="title">权益名称:{{list.equityName}}</view> |
|
|
|
<view class="title"><text style="color: #01243A;">卡卷状态:{{functBackName(list) == 'WAIT_ACTIVATED' ? '待激活' : functBackName(list) == 'WAIT_USE' ? '待领取' : functBackName(list) == 'USED' ? '已领取' : '已失效'}}</text></view> |
|
|
|
</view> |
|
|
|
<view class="btn" data-code="{{item}}" |
|
|
@@ -28,12 +37,12 @@ |
|
|
|
</view> |
|
|
|
<view class="btn" data-code="{{item}}" @click.stop="copyCode(list,'EXPIRED',null)">去使用</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="item" v-for="(item, index) in alonePurchaseData" :key="index" @click.stop="click(item)"> |
|
|
|
<!-- <view class="item" v-for="(item, index) in alonePurchaseData" :key="index" @click.stop="click(item)"> |
|
|
|
<view class="top"> |
|
|
|
<view> |
|
|
|
<view style="display: flex;align-items: center;line-height: 58rpx;" v-if="item.vehiclePlate"> |
|
|
@@ -60,7 +69,7 @@ |
|
|
|
</view> |
|
|
|
<view class="btn" data-code="{{item}}" @click.stop="copyCode(item,'EXPIRED',item['couponInfoItem'])">去使用</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> --> |
|
|
|
|
|
|
|
</view> |
|
|
|
</template> |
|
|
@@ -98,101 +107,101 @@ |
|
|
|
requestNew(couponQuery, { |
|
|
|
type: 2, |
|
|
|
data: { |
|
|
|
mobile: getItem('mobile') + "", |
|
|
|
// mobile: getItem('mobile') + "", |
|
|
|
loginSource: getItem("loginSource"), |
|
|
|
singleEquityId: singleEquityId.value, |
|
|
|
// singleEquityId: singleEquityId.value, |
|
|
|
equityId: singleEquityId.value, |
|
|
|
couponAgencyType: couponAgencyType.value, |
|
|
|
couponId: couponId.value, |
|
|
|
purchasedEquityId:purchasedEquityId.value |
|
|
|
// couponAgencyType: couponAgencyType.value, |
|
|
|
// couponId: couponId.value, |
|
|
|
// purchasedEquityId:purchasedEquityId.value |
|
|
|
}, |
|
|
|
method: "POST", |
|
|
|
showLoading: true, |
|
|
|
}).then((item) => { |
|
|
|
let res = item |
|
|
|
console.log("res===", res) |
|
|
|
let newCodes = res.data.orderItems; |
|
|
|
let alonePurchase = res.data.alonePurchase; |
|
|
|
let newCodes = res.result; |
|
|
|
// let alonePurchase = res.data.alonePurchase; |
|
|
|
if (newCodes) { |
|
|
|
console.log(res, '111=========', newCodes); |
|
|
|
let newCodesNew = [] |
|
|
|
newCodes.forEach(item => { |
|
|
|
//1 不能领取 0 可以领取 1(不能领取原因 notUseCase) |
|
|
|
// item.equityInfoItems[0].equityType |
|
|
|
// 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); |
|
|
|
// functBackName(list) = item.equityInfoItems[0].couponStatus == 'WAIT_GET' ? 'WAIT_ACTIVATED' : item.equityInfoItems[0].couponStatus |
|
|
|
item.getStatus = getStatusValue(item.status) |
|
|
|
console.log("item.getStatus===",item.getStatus) |
|
|
|
item.redeemCodeStr = item.equityInfoItems[0].couponInfoItem && 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] |
|
|
|
console.log("item", item.equityInfoItems) |
|
|
|
// 不展示付宝数据 |
|
|
|
for (var k = 0; k < item.equityInfoItems.length; k++) { |
|
|
|
if (item.equityInfoItems[k]['equityType'] != "ZFB") { |
|
|
|
console.log("alonePurchase1111", alonePurchase) |
|
|
|
newCodesNew.push(item) |
|
|
|
} |
|
|
|
} |
|
|
|
exchangeCodes.value = newCodes |
|
|
|
// let newCodesNew = [] |
|
|
|
// newCodes.forEach(item => { |
|
|
|
// //1 不能领取 0 可以领取 1(不能领取原因 notUseCase) |
|
|
|
// // item.equityInfoItems[0].equityType |
|
|
|
// // 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); |
|
|
|
// // functBackName(list) = item.equityInfoItems[0].couponStatus == 'WAIT_GET' ? 'WAIT_ACTIVATED' : item.equityInfoItems[0].couponStatus |
|
|
|
// item.getStatus = getStatusValue(item.status) |
|
|
|
// console.log("item.getStatus===",item.getStatus) |
|
|
|
// item.redeemCodeStr = item.equityInfoItems[0].couponInfoItem && 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] |
|
|
|
// console.log("item", item.equityInfoItems) |
|
|
|
// // 不展示付宝数据 |
|
|
|
// for (var k = 0; k < item.equityInfoItems.length; k++) { |
|
|
|
// if (item.equityInfoItems[k]['equityType'] != "ZFB") { |
|
|
|
// console.log("alonePurchase1111", alonePurchase) |
|
|
|
// newCodesNew.push(item) |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
}); |
|
|
|
exchangeCodes.value = newCodesNew |
|
|
|
// }); |
|
|
|
// exchangeCodes.value = newCodesNew |
|
|
|
|
|
|
|
// 购买的权益产品展示 |
|
|
|
console.log("exchangeCodes.value", exchangeCodes.value); |
|
|
|
// console.log("exchangeCodes.value", exchangeCodes.value); |
|
|
|
} |
|
|
|
let newAlonePurchase = [] |
|
|
|
if (alonePurchase) { |
|
|
|
console.log("alonePurchase", alonePurchase) |
|
|
|
alonePurchase.forEach(item => { |
|
|
|
console.log("index", item.equityType == "ZFB") |
|
|
|
//1 不能领取 0 可以领取 1(不能领取原因 notUseCase) |
|
|
|
// item.equityInfoItems[0].equityType |
|
|
|
// WAIT_GET |
|
|
|
item.status =item.isUse == 0 && item.couponStatus == |
|
|
|
'WAIT_GET' ? 'WAIT_USE' : |
|
|
|
item.isUse == 1 && item.couponStatus == |
|
|
|
'WAIT_GET' ? 'WAIT_ACTIVATED' : item.couponStatus == 'USED' ? |
|
|
|
'USED' : ''; |
|
|
|
//WAIT_ACTIVATED(待激活) WAIT_USE(待领取使用) USED(已使用) EXPIRED(已过期) OUINGSYNREE |
|
|
|
console.log(item.periodOfValidity, |
|
|
|
item.isUse, item.notUseCase, |
|
|
|
item.status, item.couponStatus, '=================', |
|
|
|
item.vehiclePlate); |
|
|
|
item.getStatus = getStatusValue(item.status) |
|
|
|
item.redeemCodeStr = item.couponInfoItem && desensitize(item |
|
|
|
.couponInfoItem.redeemCode) |
|
|
|
item.periodOfValidity = item.periodOfValidity ? item |
|
|
|
.periodOfValidity.split('T')[0] : '激活领取后展示' |
|
|
|
item.redeemCode = item.couponInfoItem && item |
|
|
|
.couponInfoItem.redeemCode |
|
|
|
item.drawTime = item.drawTime && item |
|
|
|
.drawTime.split('T')[0] |
|
|
|
// 不展示付宝数据 |
|
|
|
if (item.equityType != "ZFB") { |
|
|
|
console.log("alonePurchase1111", alonePurchase) |
|
|
|
newAlonePurchase.push(item) |
|
|
|
} |
|
|
|
}); |
|
|
|
// let newAlonePurchase = [] |
|
|
|
// if (alonePurchase) { |
|
|
|
// console.log("alonePurchase", alonePurchase) |
|
|
|
// alonePurchase.forEach(item => { |
|
|
|
// console.log("index", item.equityType == "ZFB") |
|
|
|
// //1 不能领取 0 可以领取 1(不能领取原因 notUseCase) |
|
|
|
// // item.equityInfoItems[0].equityType |
|
|
|
// // WAIT_GET |
|
|
|
// item.status =item.isUse == 0 && item.couponStatus == |
|
|
|
// 'WAIT_GET' ? 'WAIT_USE' : |
|
|
|
// item.isUse == 1 && item.couponStatus == |
|
|
|
// 'WAIT_GET' ? 'WAIT_ACTIVATED' : item.couponStatus == 'USED' ? |
|
|
|
// 'USED' : ''; |
|
|
|
// //WAIT_ACTIVATED(待激活) WAIT_USE(待领取使用) USED(已使用) EXPIRED(已过期) OUINGSYNREE |
|
|
|
// console.log(item.periodOfValidity, |
|
|
|
// item.isUse, item.notUseCase, |
|
|
|
// item.status, item.couponStatus, '=================', |
|
|
|
// item.vehiclePlate); |
|
|
|
// item.getStatus = getStatusValue(item.status) |
|
|
|
// item.redeemCodeStr = item.couponInfoItem && desensitize(item |
|
|
|
// .couponInfoItem.redeemCode) |
|
|
|
// item.periodOfValidity = item.periodOfValidity ? item |
|
|
|
// .periodOfValidity.split('T')[0] : '激活领取后展示' |
|
|
|
// item.redeemCode = item.couponInfoItem && item |
|
|
|
// .couponInfoItem.redeemCode |
|
|
|
// item.drawTime = item.drawTime && item |
|
|
|
// .drawTime.split('T')[0] |
|
|
|
// // 不展示付宝数据 |
|
|
|
// if (item.equityType != "ZFB") { |
|
|
|
// console.log("alonePurchase1111", alonePurchase) |
|
|
|
// newAlonePurchase.push(item) |
|
|
|
// } |
|
|
|
// }); |
|
|
|
|
|
|
|
alonePurchaseData.value = newAlonePurchase |
|
|
|
} |
|
|
|
// alonePurchaseData.value = newAlonePurchase |
|
|
|
// } |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
@@ -209,48 +218,48 @@ |
|
|
|
// url: '/subpackage/service/equityInfo/equityInfo?singleEquityId=' + singleEquityId.value + |
|
|
|
// "&couponAgencyType=" + couponAgencyType.value + "&couponId=" + couponId.value, |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// } |
|
|
|
console.log("item",item) |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/subpackage/service/equityInfo/equityInfo?singleEquityId=' + item.singleEquityId + |
|
|
|
"&couponAgencyType=" + couponAgencyType.value + "&couponId=" + item.couponId, |
|
|
|
url: '/subpackage/service/equityInfo/equityInfo?validEndTime=' + item.validEndTime + |
|
|
|
"&fee=" + item.fee+"&equityName=" + item.equityName, |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
function functBackName(item) { |
|
|
|
return item.isUse == '0' && item.couponStatus == 'WAIT_GET' ? 'WAIT_USE' : |
|
|
|
item.isUse == '1' && item.couponStatus == 'WAIT_GET' ? 'WAIT_ACTIVATED' : item.couponStatus == 'USED' ? |
|
|
|
'USED' : ''; |
|
|
|
// return item.isUse == '0' && item.couponStatus == 'WAIT_GET' ? 'WAIT_USE' : |
|
|
|
// item.isUse == '1' && item.couponStatus == 'WAIT_GET' ? 'WAIT_ACTIVATED' : item.couponStatus == 'USED' ? |
|
|
|
// 'USED' : ''; |
|
|
|
return item |
|
|
|
} |
|
|
|
|
|
|
|
function copyCode(e, start, items) { |
|
|
|
console.log("e====",e,start,items) |
|
|
|
let item = e; |
|
|
|
function copyCode(item) { |
|
|
|
// let item = e; |
|
|
|
// // 复制兑换码到剪贴板 |
|
|
|
if (item.equityType == 'ZFB') { |
|
|
|
uni.navigateTo({ |
|
|
|
url: `/subpackage/service/zfbqy/zfbqy` |
|
|
|
}) |
|
|
|
return |
|
|
|
}else{ |
|
|
|
let code = e.redeemCode ? e.redeemCode : items.redeemCode; |
|
|
|
console.log(item, "===e===", e.equityType, items, start); |
|
|
|
if (start == 'WAIT_ACTIVATED') { //待激活 |
|
|
|
uni.showModal({ |
|
|
|
title: '温馨提示', |
|
|
|
content: "激活后,可领取卡卷", |
|
|
|
confirmText: "去激活", |
|
|
|
success: function(res) { |
|
|
|
if (res.confirm) { |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/subpackage/personal-center/install-activation-order', |
|
|
|
}) |
|
|
|
} else if (res.cancel) { |
|
|
|
console.log('用户点击取消'); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} else if (start == 'WAIT_USE') { //待领取使用 |
|
|
|
// if (item.equityType == 'ZFB') { |
|
|
|
// uni.navigateTo({ |
|
|
|
// url: `/subpackage/service/zfbqy/zfbqy` |
|
|
|
// }) |
|
|
|
// return |
|
|
|
// }else{ |
|
|
|
let code = item.redeemCode; |
|
|
|
// if (start == 'WAIT_ACTIVATED') { //待激活 |
|
|
|
// uni.showModal({ |
|
|
|
// title: '温馨提示', |
|
|
|
// content: "激活后,可领取卡卷", |
|
|
|
// confirmText: "去激活", |
|
|
|
// success: function(res) { |
|
|
|
// if (res.confirm) { |
|
|
|
// uni.navigateTo({ |
|
|
|
// url: '/subpackage/personal-center/install-activation-order', |
|
|
|
// }) |
|
|
|
// } else if (res.cancel) { |
|
|
|
// console.log('用户点击取消'); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// } else |
|
|
|
if (item.status == 'WAIT_GET') { //待领取使用 |
|
|
|
uni.showModal({ |
|
|
|
title: '温馨提示', |
|
|
|
content: "请在领取后120天内使用,超期失效", |
|
|
@@ -259,31 +268,22 @@ |
|
|
|
requestNew(couponActivate, { |
|
|
|
type: 2, |
|
|
|
data: { |
|
|
|
mobile: getItem('mobile') + "", |
|
|
|
notificationType: 'USE', |
|
|
|
cardIds: [items.id], |
|
|
|
couponId: couponId.value, |
|
|
|
equityId: item.singleEquityId, |
|
|
|
orderId: items.orderId ? items.orderId : items.purchasedEquityId |
|
|
|
id:item.id, |
|
|
|
// mobile: getItem('mobile') + "", |
|
|
|
// notificationType: 'USE', |
|
|
|
// cardIds: [items.id], |
|
|
|
// couponId: couponId.value, |
|
|
|
// equityId: item.singleEquityId, |
|
|
|
// orderId: items.orderId ? items.orderId : items.purchasedEquityId |
|
|
|
}, |
|
|
|
method: "POST", |
|
|
|
showLoading: true, |
|
|
|
}).then((item) => { |
|
|
|
// uni.setClipboardData({ |
|
|
|
// data: code, |
|
|
|
// success: function() { |
|
|
|
// uni.showToast({ |
|
|
|
// title: '已复制兑换码', |
|
|
|
// icon: 'success', |
|
|
|
// }); |
|
|
|
// }, |
|
|
|
// }); |
|
|
|
loadExchangeCodes(); |
|
|
|
uni.showToast({ |
|
|
|
title: '领取成功', |
|
|
|
icon: 'success', |
|
|
|
}); |
|
|
|
// uni.navigateBack(); |
|
|
|
loadExchangeCodes(); |
|
|
|
}) |
|
|
|
} else if (res.cancel) { |
|
|
|
console.log('用户点击取消'); |
|
|
@@ -292,7 +292,7 @@ |
|
|
|
}); |
|
|
|
// 已使用 USED |
|
|
|
// 已过期 EXPIRED |
|
|
|
} else if (start == 'USED') { //已使用 |
|
|
|
} else if (item.status == 'WAIT_ACTIVATED') { //已领取 |
|
|
|
console.log("已复制兑换码1111", code) |
|
|
|
uni.setClipboardData({ |
|
|
|
data: code, |
|
|
@@ -304,10 +304,10 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
}); |
|
|
|
} else if (start == 'EXPIRED') { //已过期 |
|
|
|
} else if (item.status == 'EXPIRED') { //已过期 |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
// } |
|
|
|
|
|
|
|
} |
|
|
|
|