133 lines
5.1 KiB
JavaScript
133 lines
5.1 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const api_api = require("../../api/api.js");
|
|
if (!Array) {
|
|
const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
|
|
const _easycom_up_code2 = common_vendor.resolveComponent("up-code");
|
|
const _easycom_up_button2 = common_vendor.resolveComponent("up-button");
|
|
(_easycom_up_input2 + _easycom_up_code2 + _easycom_up_button2)();
|
|
}
|
|
const _easycom_up_input = () => "../../uni_modules/uview-plus/components/u-input/u-input.js";
|
|
const _easycom_up_code = () => "../../uni_modules/uview-plus/components/u-code/u-code.js";
|
|
const _easycom_up_button = () => "../../uni_modules/uview-plus/components/u-button/u-button.js";
|
|
if (!Math) {
|
|
(_easycom_up_input + _easycom_up_code + _easycom_up_button)();
|
|
}
|
|
const _sfc_main = {
|
|
__name: "toUser",
|
|
setup(__props) {
|
|
common_vendor.ref();
|
|
let getInfo = common_vendor.ref({});
|
|
let appConfig = common_vendor.ref([]);
|
|
let tips = common_vendor.ref("");
|
|
let uCode = common_vendor.ref(null);
|
|
let dataFrom = common_vendor.reactive({
|
|
rechargeMoney: "",
|
|
smsCode: "",
|
|
toUserName: "",
|
|
toPhone: ""
|
|
});
|
|
common_vendor.ref();
|
|
common_vendor.onLoad(async () => {
|
|
let _res = await api_api.userInfo();
|
|
getInfo.value = _res;
|
|
const { configValue } = await api_api.getAppConfig({ configKey: "DEPOSIT" });
|
|
appConfig.value = JSON.parse(configValue);
|
|
});
|
|
let codeChange2 = (text) => {
|
|
tips.value = text;
|
|
};
|
|
let getCode = () => {
|
|
if (!getInfo.value.phone)
|
|
return common_vendor.index.showToast({ title: "请输入手机号", icon: "none" });
|
|
if (uCode.value.canGetCode) {
|
|
common_vendor.index.showLoading({
|
|
title: "正在获取验证码"
|
|
});
|
|
api_api.smsCode({
|
|
phone: getInfo.value.phone
|
|
}).then((res) => {
|
|
common_vendor.index.hideLoading();
|
|
common_vendor.index.$u.toast("验证码已发送");
|
|
uCode.value.start();
|
|
});
|
|
} else {
|
|
common_vendor.index.$u.toast("倒计时结束后再发送");
|
|
}
|
|
};
|
|
let payOrder = async () => {
|
|
if (!dataFrom.rechargeMoney)
|
|
return common_vendor.index.showToast({ title: "请输入金额", icon: "none" });
|
|
if (!dataFrom.smsCode)
|
|
return common_vendor.index.showToast({ title: "请输入验证码", icon: "none" });
|
|
if (!dataFrom.toUserName)
|
|
return common_vendor.index.showToast({ title: "请输入转赠用户名", icon: "none" });
|
|
if (!dataFrom.toPhone)
|
|
return common_vendor.index.showToast({ title: "请输入转赠手机号", icon: "none" });
|
|
await api_api.giveWallet(dataFrom);
|
|
common_vendor.index.showModal({
|
|
title: "提示",
|
|
content: "转赠成功",
|
|
showCancel: false,
|
|
success() {
|
|
common_vendor.index.navigateBack();
|
|
}
|
|
});
|
|
};
|
|
return (_ctx, _cache) => {
|
|
return {
|
|
a: common_vendor.t(common_vendor.unref(getInfo).points1),
|
|
b: common_vendor.o(($event) => common_vendor.unref(dataFrom).rechargeMoney = $event),
|
|
c: common_vendor.p({
|
|
fontSize: "36rpx",
|
|
placeholder: "请输入转赠金额",
|
|
border: false,
|
|
modelValue: common_vendor.unref(dataFrom).rechargeMoney
|
|
}),
|
|
d: common_vendor.o(($event) => common_vendor.unref(dataFrom).rechargeMoney = common_vendor.unref(getInfo).points1),
|
|
e: common_vendor.o(($event) => common_vendor.unref(getInfo).phone = $event),
|
|
f: common_vendor.p({
|
|
border: false,
|
|
disabled: true,
|
|
modelValue: common_vendor.unref(getInfo).phone
|
|
}),
|
|
g: common_vendor.o(($event) => common_vendor.unref(dataFrom).smsCode = $event),
|
|
h: common_vendor.p({
|
|
placeholder: "请输入验证码",
|
|
border: false,
|
|
modelValue: common_vendor.unref(dataFrom).smsCode
|
|
}),
|
|
i: () => ({
|
|
r: uCode,
|
|
k: "uCode"
|
|
}),
|
|
j: common_vendor.o(common_vendor.unref(codeChange2)),
|
|
k: common_vendor.p({
|
|
["keep-running"]: true,
|
|
["start-text"]: "点我获取验证码"
|
|
}),
|
|
l: common_vendor.t(common_vendor.unref(tips)),
|
|
m: common_vendor.o(common_vendor.unref(getCode)),
|
|
n: common_vendor.p({
|
|
color: "#4874e5"
|
|
}),
|
|
o: common_vendor.o(($event) => common_vendor.unref(dataFrom).toUserName = $event),
|
|
p: common_vendor.p({
|
|
placeholder: "转赠用户名",
|
|
border: false,
|
|
modelValue: common_vendor.unref(dataFrom).toUserName
|
|
}),
|
|
q: common_vendor.o(($event) => common_vendor.unref(dataFrom).toPhone = $event),
|
|
r: common_vendor.p({
|
|
placeholder: "转赠手机号",
|
|
border: false,
|
|
modelValue: common_vendor.unref(dataFrom).toPhone
|
|
}),
|
|
s: common_vendor.o((...args) => common_vendor.unref(payOrder) && common_vendor.unref(payOrder)(...args))
|
|
};
|
|
};
|
|
}
|
|
};
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-24a13c27"]]);
|
|
my.createPage(MiniProgramPage);
|