新增虚拟商品充值账户验证

This commit is contained in:
gyq
2025-05-07 17:47:44 +08:00
parent 6ac44f6a63
commit 078c7c8e55
3 changed files with 163 additions and 6 deletions

View File

@@ -217,6 +217,13 @@
</block>
</view>
<!-- 充值账户 -->
<view class="content-textarea-container padding-main border-radius-main bg-white spacing-mb" v-if="is_account">
<view class="content">
<input type="text" class="input" placeholder="请输入充值账户" placeholder-class="input_placeholder" v-model="account" />
</view>
</view>
<!-- 留言 -->
<view class="content-textarea-container padding-main border-radius-main bg-white spacing-mb">
<view class="content">
@@ -467,6 +474,8 @@
// 现金--跳转指定页面
to_appoint_page: '/pages/user-order/user-order',
wx_appid: '',
is_account: 0,
account: '',
};
},
@@ -534,6 +543,28 @@
},
methods: {
// 是否显示充值账户
getShowAccount() {
uni.request({
url: app.globalData.get_request_url('searchgoodsaccount', 'goods'),
method: 'POST',
data: {
goods_data: this.params.goods_data,
},
dataType: 'json',
success: (res) => {
console.log('getShowAccount===', res);
if (res.data.code == 0) {
this.is_account = res.data.data.is_account;
} else {
this.setData({
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg,
});
}
},
});
},
// 初始化微信 JS-SDK
initWechatSdk(config) {
uni.request({
@@ -897,6 +928,11 @@
app.globalData.showToast(res.data.msg);
}
}
// 获取是否显示充值账户
if (this.buy_site_model_value == 3) {
this.getShowAccount();
}
},
fail: () => {
uni.stopPullDownRefresh();
@@ -1007,6 +1043,7 @@
data['payment_type'] = this.payment_type;
data['user_note'] = this.user_note_value;
data['site_model'] = this.buy_site_model_value;
data['account'] = this.account;
// 数据验证
var validation = [];
@@ -1067,6 +1104,12 @@
}
}
// 如果是虚拟商品
if (data.site_model == 3 && !this.account) {
app.globalData.showToast('请输入您要充值的账户');
return false;
}
// 加载loding
uni.showLoading({
title: this.$t('buy.buy.r79t77'),
@@ -1421,6 +1464,12 @@
</style>
<style scoped lang="scss">
.input {
font-size: 14px;
}
.input_placeholder {
color: #999;
}
$color: #ff723b;
.address-wrap {
background-color: $color;