Files
2025-12-09 20:22:03 +08:00

119 lines
4.1 KiB
JavaScript

(function (vc, vm) {
vc.extends({
data: {
withholdGoldInfo: {
goldId: '',
goldName: '',
communityId: '',
amount: '',
applyAmount:'',
applyUserName: '',
applyUserTel: '',
remark: '',
bankNum:'',
bankNumName:'',
bankName:'',
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('withholdGold', 'openWithholdGoldModal', function (_params) {
$that.refreshWithholdGoldInfo();
$('#withholdGoldModel').modal('show');
vc.copyObject(_params, $that.withholdGoldInfo);
$that.withholdGoldInfo.applyAmount = _params.amount;
$that.withholdGoldInfo.communityId = vc.getCurrentCommunity().communityId;
let userInfo = vc.getData('/nav/getUserInfo');
$that.withholdGoldInfo.applyUserName = userInfo.name;
$that.withholdGoldInfo.applyUserTel = userInfo.tel;
});
},
methods: {
withholdGoldValidate: function () {
return vc.validate.validate({
withholdGoldInfo: $that.withholdGoldInfo
}, {
'withholdGoldInfo.goldId': [
{
limit: "required",
param: "",
errInfo: "金币ID不能为空"
},
{
limit: "maxLength",
param: "30",
errInfo: "金币ID不能超过30"
},
],
'withholdGoldInfo.applyAmount': [
{
limit: "required",
param: "",
errInfo: "提现金额不能为空"
},
{
limit: "maxLength",
param: "10",
errInfo: "提现金额不能超过10"
},
],
});
},
withholdGold: function () {
if (!$that.withholdGoldValidate()) {
vc.toast(vc.validate.errInfo);
return;
}
let _data = $that.withholdGoldInfo;
_data.mallApiCode = 'applyGoldWithHoldBmoImpl';
vc.http.apiPost(
'/mall.postMallOpenApi',
JSON.stringify(_data),
{
emulateJSON: true
},
function (json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json);
if (_json.code == 0) {
//关闭model
$('#withholdGoldModel').modal('hide');
vc.emit('goldWithdrawal', 'listGoldWithdrawal', {});
return;
}
vc.toast(_json.msg);
},
function (errInfo, error) {
console.log('请求失败处理');
vc.toast(errInfo);
});
},
refreshWithholdGoldInfo: function () {
$that.withholdGoldInfo = {
goldId: '',
goldName: '',
communityId: '',
amount: '',
applyAmount:'',
applyUserName: '',
applyUserTel: '',
remark: '',
bankNum:'',
bankNumName:'',
bankName:'',
}
}
}
});
})(window.vc, window.$that);