瀏覽代碼

upload

newCard
HolyKnightIX 2 年之前
父節點
當前提交
3180d5dd8a
共有 2 個文件被更改,包括 20 次插入17 次删除
  1. +18
    -15
      pages/exchangeCard/exchangeCard.js
  2. +2
    -2
      pages/exchangeCard/exchangeCard.wxml

+ 18
- 15
pages/exchangeCard/exchangeCard.js 查看文件

@@ -123,7 +123,7 @@ Page({
},

/** 根据卡id查询卡详情*/
getCardDetail(cardId) {
getCardDetail(cardId, goGive) {
const that = this
Http.get({
url: config.api.getCardDetail,
@@ -134,13 +134,27 @@ Page({
// 取不到时清空参数
that.setData({
title: res.data.title || "",
phone: res.data.ownerPhone.slice(0, 3) + `****` + res.data.ownerPhone.slice(7) || "",
phone: res.data.ownerPhone || "",
hidePhone: res.data.ownerPhone ? (res.data.ownerPhone.slice(0, 3) + `****` + res.data.ownerPhone.slice(7)) : '',
ownerUserId: res.data.ownerUserId || "",
eCardId: res.data.eCardId || "",
owned: res.data.owned || "",
remainAmount: res.data.remainAmount / 100 || "",
isSHowInfoCard: true // 显示卡详情
})
if (goGive) {
if ((this.data.ownerUserId && this.data.eCardId) || e.detail.value.code) {
if ((this.data.owned && this.data.owned == 1) || e.detail.value.code) {
wx.navigateTo({
url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${this.data.eCardId}`,
})
} else {
this.Toast('当前用户不是该卡的持有者,无法转赠!', 'none')
}
} else {
this.Toast('该卡未绑定', 'none')
}
}
})
.catch(err => {
console.log(err);
@@ -194,26 +208,15 @@ Page({
},

submit() {
const data = this.data
const e = {
detail: { value: { code: this.data.code } }
}
this.searchCard(e)
this.getCouponOrderByPassword(data.code)
this.getCouponOrderByPassword(this.data.code)
},

goGive() {
if (this.data.ownerUserId && this.data.eCardId) {
if (this.data.owned && this.data.owned == 1) {
wx.navigateTo({
url: `/pages/ConsumeDetail/ConsumeDetail?cardId=${this.data.eCardId}`,
})
} else {
this.Toast('当前用户不是该卡的持有者,无法转赠!', 'none')
}
} else {
this.Toast('该卡未绑定', 'none')
}
this.getCardDetail(this.data.code, true)
},

// 检查用户登录状态


+ 2
- 2
pages/exchangeCard/exchangeCard.wxml 查看文件

@@ -30,8 +30,8 @@
<view class="name">卡名称:{{title}}</view>
<view wx:if="{{remainAmount}}" class="name">卡余额:{{remainAmount}}</view>
<!-- <view class="name">持卡人姓名:{{name}}</view> -->
<view wx:if="{{!isChangePhone && phone}}" class="phone">
持卡人手机号:{{phone}}
<view wx:if="{{!isChangePhone && hidePhone}}" class="phone">
持卡人手机号:{{hidePhone}}
<!-- <text class="changePhone" bindtap="changePhone">更改</text> -->
</view>



Loading…
取消
儲存