完善功能
This commit is contained in:
@ -56,8 +56,7 @@
|
||||
<view class="title1 d-b-c">
|
||||
<view>折扣优惠</view>
|
||||
<view>
|
||||
<text style="margin-right: 6rpx;color: #FA2B21;"> - </text>
|
||||
<price-format color="#FA2B21" :subscript-size="30" :first-size="30" :second-size="30" :price="bill.dis"></price-format>
|
||||
<price-format color="#FA2B21" :subscript-size="30" :first-size="30" :second-size="30" :price="bill.dis" :showSubscript="false"></price-format>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -77,7 +76,7 @@
|
||||
<view class="d-f d-c j-c-b">
|
||||
<view>
|
||||
合计: <price-format color="#FF5951" :subscript-size="26" :first-size="40" :second-size="40" :price="bill.total"></price-format>
|
||||
<text style="margin-left: 10rpx;color: #FA2B21;font-size: 26rpx;">8折</text>
|
||||
<text style="margin-left: 10rpx;color: #FA2B21;font-size: 26rpx;">{{ userDiscount }}折</text>
|
||||
</view>
|
||||
<view class="d-f j-c-c a-i-c" style="margin-top: 10rpx;" @click="closeBillPopup">
|
||||
<view class="price-detail">费用明细</view>
|
||||
@ -99,24 +98,91 @@
|
||||
<text class="f34 fb">会员卡选择</text>
|
||||
</view>
|
||||
|
||||
<view class="bg-white card" @click="selectCard">
|
||||
<view class="card-item">
|
||||
<view class="bg-white card">
|
||||
<view class="card-item" :class="currentType == 1 ? 'active' : ''" @click="currentType = 1">
|
||||
<view class="d-f a-i-c">
|
||||
<view class="card-title">白金会员卡</view>
|
||||
<view class="card-title">白银会员卡</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="discount">享</view>
|
||||
<view class="sale">
|
||||
<text>9.5</text>
|
||||
<text>{{ balance.discount1 }}</text>
|
||||
<text>折</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="card-balance">¥212.00</view>
|
||||
<view class="card-balance">¥{{ userBalance.balance1 }}</view>
|
||||
<view class="icon-box d-c-c card-checkout"><span class="icon iconfont icon-xuanze"></span></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-item" :class="currentType == 2 ? 'active' : ''" @click="currentType = 2">
|
||||
<view class="d-f a-i-c">
|
||||
<view class="card-title">黄金会员卡</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="discount">享</view>
|
||||
<view class="sale">
|
||||
<text>{{ balance.discount2 }}</text>
|
||||
<text>折</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="card-balance">¥{{ userBalance.balance2 }}</view>
|
||||
<view class="icon-box d-c-c card-checkout"><span class="icon iconfont icon-xuanze"></span></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-item" :class="currentType == 3 ? 'active' : ''" @click="currentType = 3">
|
||||
<view class="d-f a-i-c">
|
||||
<view class="card-title">铂金会员卡</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="discount">享</view>
|
||||
<view class="sale">
|
||||
<text>{{ balance.discount3 }}</text>
|
||||
<text>折</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="card-balance">¥{{ userBalance.balance3 }}</view>
|
||||
<view class="icon-box d-c-c card-checkout"><span class="icon iconfont icon-xuanze"></span></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-item" :class="currentType == 4 ? 'active' : ''" @click="currentType = 4">
|
||||
<view class="d-f a-i-c">
|
||||
<view class="card-title">钻石会员卡</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="discount">享</view>
|
||||
<view class="sale">
|
||||
<text>{{ balance.discount4 }}</text>
|
||||
<text>折</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="card-balance">¥{{ userBalance.balance4 }}</view>
|
||||
<view class="icon-box d-c-c card-checkout"><span class="icon iconfont icon-xuanze"></span></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-item" :class="currentType == 5 ? 'active' : ''" @click="currentType = 5">
|
||||
<view class="d-f a-i-c">
|
||||
<view class="card-title">至尊会员卡</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="discount">享</view>
|
||||
<view class="sale">
|
||||
<text>{{ balance.discount5 }}</text>
|
||||
<text>折</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="card-balance">¥{{ userBalance.balance5 }}</view>
|
||||
<view class="icon-box d-c-c card-checkout"><span class="icon iconfont icon-xuanze"></span></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-btn" @click="confirmCard">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -208,15 +274,15 @@
|
||||
</view>
|
||||
<view class="icon-box d-c-c"><span class="icon iconfont icon-xuanze"></span></view>
|
||||
</view>
|
||||
<view :class="payType == 'balance' ? 'item active' : 'item'" @tap="payTypeFunc('balance')">
|
||||
<view :class="payType >= 1 ? 'item active' : 'item'" @tap="payTypeFunc('balance')">
|
||||
<view class="d-s-c">
|
||||
<view class="icon-box d-c-c mr10"><span class="icon iconfont icon-yue"></span></view>
|
||||
<text class="key">平台余额</text>
|
||||
</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="mr10 dis" v-if="balance > 0">
|
||||
<view class="mr10 dis" v-if="userAccount > 0">
|
||||
<!-- <text class="key">余额支付:(剩余:{{balance}})</text> -->
|
||||
铂金会员卡 <text style="color: #FF5951;">9.3</text>折
|
||||
{{ cardType() }} <text style="color: #FF5951;">{{ userDiscount }}</text>折
|
||||
</view>
|
||||
<view class="icon-box d-c-c"><span class="icon iconfont icon-xuanze"></span></view>
|
||||
</view>
|
||||
@ -280,13 +346,16 @@
|
||||
total: 0 // 总价
|
||||
},
|
||||
payType: 'wxpay', // 支付方式 wxpay\balance
|
||||
balance: 0,
|
||||
order: {},
|
||||
result: '',
|
||||
loadding: true,
|
||||
_submitting: false,
|
||||
balancePopup: false,
|
||||
balance: 0
|
||||
balance: {},
|
||||
userBalance: {},
|
||||
currentType: '', // 选择的会员卡类型
|
||||
userAccount: 0,
|
||||
userDiscount: 0
|
||||
};
|
||||
},
|
||||
|
||||
@ -298,6 +367,7 @@
|
||||
this.basketballDate = args.date || null; // 篮球场预约时间
|
||||
console.log("🚀 ~ this.date:", this.date)
|
||||
this.getData();
|
||||
this.getRecharge()
|
||||
},
|
||||
|
||||
onUnload() {
|
||||
@ -312,6 +382,10 @@
|
||||
|
||||
|
||||
methods: {
|
||||
// 判断 payType 是否为整数
|
||||
isPayTypeInt() {
|
||||
return Number.isInteger(Number(this.payType));
|
||||
},
|
||||
getData() {
|
||||
let self = this;
|
||||
uni.showLoading({
|
||||
@ -394,6 +468,7 @@
|
||||
|
||||
},
|
||||
|
||||
// 计算费用明细
|
||||
countPrice() {
|
||||
let self = this;
|
||||
uni.showLoading({
|
||||
@ -476,7 +551,7 @@
|
||||
};
|
||||
oldWxPay.call(this);
|
||||
setTimeout(finish, 3000); // 兜底3秒自动解锁
|
||||
} else if (this.payType == 'balance') {
|
||||
} else if (this.payType >= 1) {
|
||||
const oldBalancePay = this.balancePay;
|
||||
this.balancePay = (...args) => {
|
||||
oldBalancePay.apply(this, args);
|
||||
@ -571,7 +646,8 @@
|
||||
'ground.ground/yuePay',
|
||||
{
|
||||
app_id: self.getAppId(),
|
||||
order_id: this.orderId
|
||||
order_id: this.orderId,
|
||||
pay_type: this.currentType
|
||||
},
|
||||
function(res) {
|
||||
if (res.code == 1) {
|
||||
@ -613,6 +689,47 @@
|
||||
}
|
||||
},
|
||||
|
||||
getRecharge() {
|
||||
let self = this;
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
// 获取充值
|
||||
self._post(
|
||||
'ground.ground/groundSetting',
|
||||
{
|
||||
app_id: self.getAppId(),
|
||||
},
|
||||
function(res) {
|
||||
self.balance = res.data.lists.balance;
|
||||
}
|
||||
)
|
||||
|
||||
// 获取充值
|
||||
self._post('user.index/detail', {
|
||||
source: self.getPlatform()
|
||||
}, function(res) {
|
||||
console.log("🚀 ~ res:", res)
|
||||
self.userBalance = res.data.userInfo;
|
||||
self.loadding = false;
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
|
||||
cardType() {
|
||||
if (this.currentType == 1) {
|
||||
return '白银会员卡'
|
||||
} else if (this.currentType == 2) {
|
||||
return '黄金会员卡'
|
||||
} else if (this.currentType == 3) {
|
||||
return '铂金会员卡'
|
||||
} else if (this.currentType == 4) {
|
||||
return '钻石会员卡'
|
||||
} else if (this.currentType == 5) {
|
||||
return '至尊会员卡'
|
||||
}
|
||||
},
|
||||
|
||||
// 选择会员卡
|
||||
selectCard() {
|
||||
this.balance = 200; // 模拟选择会员卡后的余额
|
||||
@ -620,6 +737,18 @@
|
||||
|
||||
// 确认选择
|
||||
confirmCard() {
|
||||
if (this.userBalance['balance' + this.currentType] <= 0) {
|
||||
uni.showToast({
|
||||
title: '余额不足,请选择其他会员卡',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.userAccount = this.userBalance['balance' + this.currentType];
|
||||
this.userDiscount = this.balance['discount' + this.currentType];
|
||||
this.payType = this.currentType;
|
||||
this.countPrice();
|
||||
this.balancePopup = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user