添加新文件
This commit is contained in:
+230
@@ -0,0 +1,230 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const api_finance = require("../../api/finance.js");
|
||||
const api_bank = require("../../api/bank.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
category: null,
|
||||
//账户类型
|
||||
amount: null,
|
||||
// 提现金额
|
||||
dzAmount: 0,
|
||||
// 到账金额
|
||||
rateAmount: 0,
|
||||
// 手续费
|
||||
bankId: null,
|
||||
// 提现银行卡
|
||||
bankName: null
|
||||
// 提现银行卡名称
|
||||
},
|
||||
withdrawAmount: 0,
|
||||
ruleObj: {},
|
||||
// 规则
|
||||
bankOption: [],
|
||||
bankShow: false,
|
||||
bankLoading: false
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
const amount = option.amount || 0;
|
||||
if (amount && amount !== "null") {
|
||||
this.withdrawAmount = amount || 0;
|
||||
}
|
||||
const category = option.category;
|
||||
if (category && category !== "null") {
|
||||
this.form.category = category;
|
||||
this.getWithdrawalRule();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
jumpPurse() {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/mine_purse/mine_purse"
|
||||
});
|
||||
},
|
||||
allFun() {
|
||||
const amount = this.withdrawAmount;
|
||||
this.form.amount = amount;
|
||||
this.amountChange(amount);
|
||||
},
|
||||
jumpLog() {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/mine_purse_bonus_withdraw_log/mine_purse_bonus_withdraw_log?category=" + this.form.category
|
||||
});
|
||||
},
|
||||
async withdrawFun() {
|
||||
const params = {
|
||||
...this.form
|
||||
};
|
||||
if (!params.bankId) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: "error",
|
||||
message: "请选择提现银行卡"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!params.amount) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: "error",
|
||||
message: "请输入需要提现余额"
|
||||
});
|
||||
return;
|
||||
}
|
||||
delete params.bankName;
|
||||
const resp = await api_finance.withdrawal(params);
|
||||
if (resp && resp.bizcode === 100) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: "success",
|
||||
message: "已成功申请提现"
|
||||
});
|
||||
setTimeout(() => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/mine_purse/mine_purse"
|
||||
});
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 查询规则
|
||||
*/
|
||||
async getWithdrawalRule() {
|
||||
const params = {
|
||||
category: this.form.category
|
||||
};
|
||||
const resp = await api_finance.getWithdrawalRule(params);
|
||||
if (resp && resp.bizcode === 100) {
|
||||
this.ruleObj = resp.data;
|
||||
}
|
||||
},
|
||||
// 选择银行的弹框
|
||||
async bankShowCheck(status) {
|
||||
if (status) {
|
||||
this.bankLoading = true;
|
||||
const resp = await api_bank.getBankList();
|
||||
if (resp && resp.bizcode === 100) {
|
||||
if (!resp.data) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: "warring",
|
||||
message: "请先去银行卡管理绑定银行卡"
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.bankOption = [resp.data || []];
|
||||
}
|
||||
this.bankLoading = false;
|
||||
} else {
|
||||
this.bankOption = [[]];
|
||||
}
|
||||
this.bankShow = status;
|
||||
},
|
||||
// 提交地址
|
||||
bankConfirm(e) {
|
||||
const {
|
||||
columnIndex,
|
||||
value,
|
||||
values,
|
||||
index
|
||||
} = e;
|
||||
const data = value[0];
|
||||
this.form.bankId = data.id;
|
||||
this.form.bankName = data.bankName;
|
||||
this.bankShowCheck(false);
|
||||
},
|
||||
amountChange(amount) {
|
||||
const rate = this.ruleObj.rate;
|
||||
if (rate && amount) {
|
||||
const rateAmount = amount * (rate / 100);
|
||||
this.form.rateAmount = rateAmount.toFixed(2);
|
||||
this.form.dzAmount = (amount - rateAmount).toFixed(2);
|
||||
} else {
|
||||
this.form.rateAmount = 0;
|
||||
this.form.dzAmount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _easycom_up_image2 = common_vendor.resolveComponent("up-image");
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_picker2 = common_vendor.resolveComponent("up-picker");
|
||||
const _easycom_up_toast2 = common_vendor.resolveComponent("up-toast");
|
||||
(_easycom_up_image2 + _easycom_up_input2 + _easycom_up_picker2 + _easycom_up_toast2)();
|
||||
}
|
||||
const _easycom_up_image = () => "../../uni_modules/uview-plus/components/u-image/u-image.js";
|
||||
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
||||
const _easycom_up_picker = () => "../../uni_modules/uview-plus/components/u-picker/u-picker.js";
|
||||
const _easycom_up_toast = () => "../../uni_modules/uview-plus/components/u-toast/u-toast.js";
|
||||
if (!Math) {
|
||||
(_easycom_up_image + _easycom_up_input + _easycom_up_picker + _easycom_up_toast)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
a: common_vendor.p({
|
||||
src: "/static/common/left.png",
|
||||
width: "18",
|
||||
height: "18",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
b: common_vendor.o((...args) => $options.jumpPurse && $options.jumpPurse(...args)),
|
||||
c: common_vendor.o((...args) => $options.jumpLog && $options.jumpLog(...args)),
|
||||
d: common_vendor.t($data.form.bankName || "请选择"),
|
||||
e: common_vendor.p({
|
||||
src: "/static/common/right.png",
|
||||
width: "16",
|
||||
height: "16",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
f: common_vendor.o(($event) => $options.bankShowCheck(true)),
|
||||
g: common_vendor.o((...args) => $options.allFun && $options.allFun(...args)),
|
||||
h: common_vendor.o($options.amountChange),
|
||||
i: common_vendor.o(($event) => $data.form.amount = $event),
|
||||
j: common_vendor.p({
|
||||
placeholder: "请输入提现金额",
|
||||
border: "none",
|
||||
customStyle: {
|
||||
"height": "110rpx",
|
||||
"background-color": "#F8F8F8",
|
||||
"margin": "10rpx 0",
|
||||
"padding": "0 20rpx"
|
||||
},
|
||||
type: "number",
|
||||
modelValue: $data.form.amount
|
||||
}),
|
||||
k: common_vendor.o(($event) => $data.form.dzAmount = $event),
|
||||
l: common_vendor.p({
|
||||
placeholder: "请输入需要提现金额",
|
||||
border: "none",
|
||||
customStyle: {
|
||||
"height": "110rpx",
|
||||
"background-color": "#F8F8F8",
|
||||
"margin": "10rpx 0",
|
||||
"padding": "0 20rpx"
|
||||
},
|
||||
disabled: true,
|
||||
modelValue: $data.form.dzAmount
|
||||
}),
|
||||
m: common_vendor.t($data.withdrawAmount),
|
||||
n: common_vendor.t($data.form.rateAmount),
|
||||
o: common_vendor.t($data.ruleObj && $data.ruleObj.rate || 0),
|
||||
p: common_vendor.o((...args) => $options.withdrawFun && $options.withdrawFun(...args)),
|
||||
q: common_vendor.t($data.ruleObj && $data.ruleObj.minAmount || 0),
|
||||
r: common_vendor.t($data.ruleObj && $data.ruleObj.dayAmount || 0),
|
||||
s: common_vendor.t($data.ruleObj && $data.ruleObj.dayTimes || 0),
|
||||
t: common_vendor.o($options.bankConfirm),
|
||||
v: common_vendor.o(($event) => $data.bankShow = false),
|
||||
w: common_vendor.o(($event) => $data.bankShow = false),
|
||||
x: common_vendor.p({
|
||||
show: $data.bankShow,
|
||||
columns: $data.bankOption,
|
||||
keyName: "bankName",
|
||||
itemHeight: "34",
|
||||
loading: $data.bankLoading
|
||||
}),
|
||||
y: common_vendor.sr("uToastRef", "9f7e0d0e-5")
|
||||
};
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/mine_purse_bonus_withdraw/mine_purse_bonus_withdraw.js.map
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"navigationStyle": "custom",
|
||||
"usingComponents": {
|
||||
"up-image": "../../uni_modules/uview-plus/components/u-image/u-image",
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-picker": "../../uni_modules/uview-plus/components/u-picker/u-picker",
|
||||
"up-toast": "../../uni_modules/uview-plus/components/u-toast/u-toast"
|
||||
}
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
<view class="mine_purse_bonus_waithdraw"><view class="waithdraw_header_"><view style="margin-top:10rpx" bindtap="{{b}}"><up-image wx:if="{{a}}" u-i="9f7e0d0e-0" bind:__l="__l" u-p="{{a}}"></up-image></view><view>提现</view><view bindtap="{{c}}">提现记录</view></view><view class="waithdraw_content_"><view class="content_bank_item"><view class="title_comm">提现账户</view><view class="bank_" bindtap="{{f}}"><view>{{d}}</view><up-image wx:if="{{e}}" u-i="9f7e0d0e-1" bind:__l="__l" u-p="{{e}}"></up-image></view></view><view class="content_amout_item"><view class="title_comm">提现金额</view><up-input wx:if="{{j}}" u-s="{{['suffix']}}" bindchange="{{h}}" u-i="9f7e0d0e-2" bind:__l="__l" bindupdateModelValue="{{i}}" u-p="{{j}}"><view slot="suffix"><text>元</text><text class="all_" bindtap="{{g}}">全部</text></view></up-input></view><view class="content_amout_item" style="margin-top:20rpx"><view class="title_comm">实际到账</view><up-input wx:if="{{l}}" u-s="{{['suffix']}}" u-i="9f7e0d0e-3" bind:__l="__l" bindupdateModelValue="{{k}}" u-p="{{l}}"><text slot="suffix">元</text></up-input><view class="amount_"><view>可提现金额:¥{{m}}</view><view>手续费:{{n}}({{o}}%)</view></view></view></view><view class="withdraw_but" bindtap="{{p}}">提现</view><view class="warm_reminder"><view>温馨提示</view><view><view>单笔最小提现金额:{{q}}</view><view>单日最大提现金额:{{r}}</view><view>单日最大提现次数:{{s}}</view></view></view><up-picker wx:if="{{x}}" bindconfirm="{{t}}" bindcancel="{{v}}" bindclose="{{w}}" u-i="9f7e0d0e-4" bind:__l="__l" u-p="{{x}}"></up-picker><up-toast class="r" u-r="uToastRef" u-i="9f7e0d0e-5" bind:__l="__l"></up-toast></view>
|
||||
Vendored
+88
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
* 这里是uni-app内置的常用样式变量
|
||||
*
|
||||
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
|
||||
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
|
||||
*
|
||||
*/
|
||||
/* uni.scss */
|
||||
/**
|
||||
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
|
||||
*
|
||||
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
|
||||
*/
|
||||
/* 颜色变量 */
|
||||
/* 行为相关颜色 */
|
||||
/* 文字基本颜色 */
|
||||
/* 背景颜色 */
|
||||
/* 边框颜色 */
|
||||
/* 尺寸变量 */
|
||||
/* 文字尺寸 */
|
||||
/* 图片尺寸 */
|
||||
/* Border Radius */
|
||||
/* 水平间距 */
|
||||
/* 垂直间距 */
|
||||
.mine_purse_bonus_waithdraw {
|
||||
background-color: #F5F5F5;
|
||||
height: calc(100vh - 130rpx);
|
||||
padding: 100rpx 30rpx 30rpx;
|
||||
overflow: auto;
|
||||
}
|
||||
.mine_purse_bonus_waithdraw .waithdraw_header_ {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.mine_purse_bonus_waithdraw .waithdraw_content_ {
|
||||
margin-top: 40rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 24rpx;
|
||||
padding: 30rpx;
|
||||
}
|
||||
.mine_purse_bonus_waithdraw .waithdraw_content_ .content_bank_item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
border-bottom: 1rpx solid #EEEEEE;
|
||||
padding-bottom: 30rpx;
|
||||
}
|
||||
.mine_purse_bonus_waithdraw .waithdraw_content_ .content_bank_item .bank_ {
|
||||
display: flex;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
color: #999999;
|
||||
}
|
||||
.mine_purse_bonus_waithdraw .waithdraw_content_ .content_bank_item .title_comm {
|
||||
font-weight: bold;
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.mine_purse_bonus_waithdraw .waithdraw_content_ .content_amout_item {
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
.mine_purse_bonus_waithdraw .waithdraw_content_ .content_amout_item .amount_ {
|
||||
font-weight: 500;
|
||||
font-size: 24rpx;
|
||||
color: #808080;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.mine_purse_bonus_waithdraw .waithdraw_content_ .content_amout_item .all_ {
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #FF7C41;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
.mine_purse_bonus_waithdraw .withdraw_but {
|
||||
width: 100%;
|
||||
padding: 20rpx 0;
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
background-color: #FF7C41;
|
||||
margin-top: 100rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.mine_purse_bonus_waithdraw .warm_reminder {
|
||||
margin: 60rpx 0;
|
||||
}
|
||||
Reference in New Issue
Block a user