添加新文件
This commit is contained in:
+167
@@ -0,0 +1,167 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const api_finance = require("../../api/finance.js");
|
||||
const utils_enumUtils = require("../../utils/enumUtils.js");
|
||||
const Header = () => "../../components/header.js";
|
||||
const _sfc_main = {
|
||||
computed: {
|
||||
ACCOUNT_CATEGORY() {
|
||||
return utils_enumUtils.ACCOUNT_CATEGORY;
|
||||
}
|
||||
},
|
||||
components: { Header },
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
amount: null,
|
||||
//充值金额
|
||||
fromCategory: null,
|
||||
toCategory: null
|
||||
},
|
||||
wayOption: [],
|
||||
proAmount: 0
|
||||
// 可兑换的金额
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
const category = option.category;
|
||||
if (category && category !== "null") {
|
||||
this.form.fromCategory = category;
|
||||
}
|
||||
const amount = option.amount;
|
||||
if (amount && amount !== "null") {
|
||||
this.proAmount = amount;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getWayOption();
|
||||
},
|
||||
methods: {
|
||||
getValue: utils_enumUtils.getValue,
|
||||
async getWayOption() {
|
||||
const params = {
|
||||
category: this.form.fromCategory
|
||||
};
|
||||
const result = await api_finance.getExchangeRule(params);
|
||||
if (result && result.bizcode === 100) {
|
||||
this.wayOption = result.data;
|
||||
}
|
||||
},
|
||||
// 立即提现
|
||||
async rechargeOk() {
|
||||
const params = this.form;
|
||||
if (!params.amount) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: "error",
|
||||
message: "请输入需要兑换金额"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!params.toCategory) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: "error",
|
||||
message: "请选择目标账户"
|
||||
});
|
||||
return;
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/mine_purse_exchange/mine_purse_exchange.vue:134", "params", params);
|
||||
const result = await api_finance.exchange(params);
|
||||
common_vendor.index.__f__("log", "at pages/mine_purse_exchange/mine_purse_exchange.vue:136", "result", result);
|
||||
if (result && result.bizcode === 100) {
|
||||
this.$refs.uToastRef.show({
|
||||
type: "success",
|
||||
message: "已成功申请兑换"
|
||||
});
|
||||
setTimeout(() => {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/mine_purse/mine_purse"
|
||||
});
|
||||
}, 1500);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!Array) {
|
||||
const _component_Header = common_vendor.resolveComponent("Header");
|
||||
const _easycom_up_image2 = common_vendor.resolveComponent("up-image");
|
||||
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
||||
const _easycom_up_radio2 = common_vendor.resolveComponent("up-radio");
|
||||
const _easycom_up_radio_group2 = common_vendor.resolveComponent("up-radio-group");
|
||||
const _easycom_up_toast2 = common_vendor.resolveComponent("up-toast");
|
||||
(_component_Header + _easycom_up_image2 + _easycom_up_input2 + _easycom_up_radio2 + _easycom_up_radio_group2 + _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_radio = () => "../../uni_modules/uview-plus/components/u-radio/u-radio.js";
|
||||
const _easycom_up_radio_group = () => "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group.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_radio + _easycom_up_radio_group + _easycom_up_toast)();
|
||||
}
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.p({
|
||||
leftTitle: $options.getValue($options.ACCOUNT_CATEGORY, $data.form.fromCategory) + "兑换",
|
||||
["left-path-type"]: "navigateTo",
|
||||
["left-path"]: "/pages/mine_purse/mine_purse"
|
||||
}),
|
||||
b: common_vendor.p({
|
||||
src: "/static/mine/exchange.png",
|
||||
width: "20",
|
||||
height: "20",
|
||||
bgColor: "#f1f6ff00"
|
||||
}),
|
||||
c: common_vendor.t($data.proAmount),
|
||||
d: common_vendor.o(($event) => $data.form.amount = $event),
|
||||
e: common_vendor.p({
|
||||
placeholder: "输入需要兑换的金额",
|
||||
border: "surround",
|
||||
clearable: true,
|
||||
customStyle: {
|
||||
"margin-top": "20rpx",
|
||||
"background": "#FFFFFF",
|
||||
"box-shadow": "0rpx 4rpx 8rpx 0rpx rgba(0,0,0,0.06)",
|
||||
"border-radius": "8rpx",
|
||||
"height": "80rpx"
|
||||
},
|
||||
type: "number",
|
||||
modelValue: $data.form.amount
|
||||
}),
|
||||
f: $data.wayOption && $data.wayOption.length !== 0
|
||||
}, $data.wayOption && $data.wayOption.length !== 0 ? {
|
||||
g: common_vendor.f($data.wayOption, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: common_vendor.t($options.getValue($options.ACCOUNT_CATEGORY, item.category)),
|
||||
b: item.rate
|
||||
}, item.rate ? {
|
||||
c: common_vendor.t(item.rate)
|
||||
} : {}, {
|
||||
d: "3627492b-4-" + i0 + ",3627492b-3",
|
||||
e: common_vendor.p({
|
||||
name: item.category,
|
||||
activeColor: "#03AD27"
|
||||
}),
|
||||
f: common_vendor.n(index + 1 < $data.wayOption.length ? "way_item way_item_but" : "way_item"),
|
||||
g: item.id
|
||||
});
|
||||
}),
|
||||
h: common_vendor.o(($event) => $data.form.toCategory = $event),
|
||||
i: common_vendor.p({
|
||||
placement: "column",
|
||||
modelValue: $data.form.toCategory
|
||||
})
|
||||
} : {
|
||||
j: common_vendor.p({
|
||||
src: "/static/common/not_order.png",
|
||||
width: "80",
|
||||
height: "80",
|
||||
bgColor: "#f1f6ff00"
|
||||
})
|
||||
}, {
|
||||
k: common_vendor.o((...args) => $options.rechargeOk && $options.rechargeOk(...args)),
|
||||
l: common_vendor.sr("uToastRef", "3627492b-6")
|
||||
});
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/mine_purse_exchange/mine_purse_exchange.js.map
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"navigationBarTitleText": "",
|
||||
"usingComponents": {
|
||||
"header": "../../components/header",
|
||||
"up-image": "../../uni_modules/uview-plus/components/u-image/u-image",
|
||||
"up-input": "../../uni_modules/uview-plus/components/u-input/u-input",
|
||||
"up-radio": "../../uni_modules/uview-plus/components/u-radio/u-radio",
|
||||
"up-radio-group": "../../uni_modules/uview-plus/components/u-radio-group/u-radio-group",
|
||||
"up-toast": "../../uni_modules/uview-plus/components/u-toast/u-toast"
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
<view class="purse_recharge_warp"><header wx:if="{{a}}" style="background-color:#FFFFFF" u-i="3627492b-0" bind:__l="__l" u-p="{{a}}"/><view class="purse_recharge_cntent"><view class="recharge_balance"><view class="recharge_balance_image"><view style="margin-top:6rpx"><up-image wx:if="{{b}}" u-i="3627492b-1" bind:__l="__l" u-p="{{b}}"/></view><view class="msg_">可兑换余额</view></view><view class="recharge_balance_">{{c}}</view></view><view class="form_item"><view class="form_item_title">兑换金额</view><up-input wx:if="{{e}}" u-i="3627492b-2" bind:__l="__l" bindupdateModelValue="{{d}}" u-p="{{e}}"></up-input></view><view class="form_item"><view class="form_item_title">目标账户</view><view class="recharge_way_warp"><up-radio-group wx:if="{{f}}" u-s="{{['d']}}" u-i="3627492b-3" bind:__l="__l" bindupdateModelValue="{{h}}" u-p="{{i}}"><view wx:for="{{g}}" wx:for-item="item" wx:key="g" class="{{item.f}}"><view class="way_item_"><view class="way_item_val">{{item.a}}<text wx:if="{{item.b}}"> (汇率 1:{{item.c}})</text></view></view><up-radio wx:if="{{item.e}}" u-i="{{item.d}}" bind:__l="__l" u-p="{{item.e}}"></up-radio></view></up-radio-group><view wx:else class="not_order_warp"><up-image wx:if="{{j}}" u-i="3627492b-5" bind:__l="__l" u-p="{{j}}"></up-image><view class="not_order_msg_warp">暂无兑换选项</view></view></view></view><view class="add_but_" bindtap="{{k}}"> 立即兑换 </view></view><up-toast class="r" u-r="uToastRef" u-i="3627492b-6" bind:__l="__l"></up-toast></view>
|
||||
Reference in New Issue
Block a user