341 lines
11 KiB
JavaScript
341 lines
11 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
const common_assets = require("../../common/assets.js");
|
|
const _sfc_main = {
|
|
data() {
|
|
return {
|
|
navbarBgColor: "transparent",
|
|
scrollTop: 0,
|
|
showWithdrawModal: false,
|
|
showApplyModal: false,
|
|
applyStep: 1,
|
|
withdrawAmount: "",
|
|
paymentMethod: "wechat",
|
|
qrcodeImage: "",
|
|
bankCardNumber: "",
|
|
cardholderName: "",
|
|
bankName: "",
|
|
swiftCode: "",
|
|
withdrawRecords: [],
|
|
withdrawDetailList: [],
|
|
inviteRecords: [
|
|
{
|
|
username: "aabbcc",
|
|
uid: "123123",
|
|
time: "2025/1/23",
|
|
paid: true,
|
|
amount: 12
|
|
},
|
|
{
|
|
username: "aabbcc",
|
|
uid: "123123",
|
|
time: "2025/1/23",
|
|
paid: true,
|
|
amount: 4
|
|
},
|
|
{
|
|
username: "aabbcc",
|
|
uid: "123123",
|
|
time: "2025/1/23",
|
|
paid: false
|
|
},
|
|
{
|
|
username: "aabbcc",
|
|
uid: "123123",
|
|
time: "2025/1/23",
|
|
paid: true,
|
|
amount: 19
|
|
}
|
|
]
|
|
};
|
|
},
|
|
onLoad() {
|
|
this.withdrawRecords = [
|
|
{
|
|
amount: "99",
|
|
status: this.$t("invite.statusWaiting")
|
|
},
|
|
{
|
|
amount: "99",
|
|
status: this.$t("invite.statusProcessing")
|
|
},
|
|
{
|
|
amount: "99",
|
|
status: this.$t("invite.statusCompleted")
|
|
}
|
|
];
|
|
},
|
|
methods: {
|
|
goBack() {
|
|
common_vendor.index.navigateBack();
|
|
},
|
|
showDetail() {
|
|
common_vendor.index.showModal({
|
|
title: this.$t("invite.ruleTitle"),
|
|
content: this.$t("invite.ruleContent"),
|
|
showCancel: false
|
|
});
|
|
},
|
|
generateQRCode() {
|
|
common_vendor.index.showToast({
|
|
title: this.$t("invite.qrcodeGenerated"),
|
|
icon: "success"
|
|
});
|
|
},
|
|
shareToFriend() {
|
|
common_vendor.index.share({
|
|
provider: "weixin",
|
|
scene: "WXSceneSession",
|
|
type: 0,
|
|
title: this.$t("invite.shareTitle"),
|
|
success: () => {
|
|
common_vendor.index.showToast({
|
|
title: this.$t("invite.shareSuccess"),
|
|
icon: "success"
|
|
});
|
|
}
|
|
});
|
|
},
|
|
goToWithdrawDetail() {
|
|
this.withdrawDetailList = [
|
|
{
|
|
time: "2025/1/23",
|
|
amount: "12",
|
|
status: this.$t("invite.statusCompleted")
|
|
},
|
|
{
|
|
time: "2025/1/23",
|
|
amount: "4",
|
|
status: this.$t("invite.statusProcessing")
|
|
},
|
|
{
|
|
time: "2025/1/23",
|
|
amount: "10",
|
|
status: this.$t("invite.statusCompleted")
|
|
}
|
|
];
|
|
this.showWithdrawModal = true;
|
|
},
|
|
closeWithdrawModal() {
|
|
this.showWithdrawModal = false;
|
|
},
|
|
applyWithdraw() {
|
|
this.applyStep = 1;
|
|
this.withdrawAmount = "";
|
|
this.paymentMethod = "wechat";
|
|
this.qrcodeImage = "";
|
|
this.bankCardNumber = "";
|
|
this.cardholderName = "";
|
|
this.bankName = "";
|
|
this.swiftCode = "";
|
|
this.showApplyModal = true;
|
|
},
|
|
closeApplyModal() {
|
|
this.showApplyModal = false;
|
|
},
|
|
nextStep() {
|
|
if (!this.withdrawAmount || this.withdrawAmount < 1) {
|
|
common_vendor.index.showToast({
|
|
title: this.$t("invite.enterAmountError"),
|
|
icon: "none"
|
|
});
|
|
return;
|
|
}
|
|
this.applyStep = 2;
|
|
},
|
|
selectPaymentMethod(method) {
|
|
this.paymentMethod = method;
|
|
},
|
|
uploadQRCode() {
|
|
common_vendor.index.chooseImage({
|
|
count: 1,
|
|
success: (res) => {
|
|
this.qrcodeImage = res.tempFilePaths[0];
|
|
}
|
|
});
|
|
},
|
|
submitWithdraw() {
|
|
if (this.paymentMethod !== "bank" && !this.qrcodeImage) {
|
|
common_vendor.index.showToast({
|
|
title: this.$t("invite.uploadQRCodeError"),
|
|
icon: "none"
|
|
});
|
|
return;
|
|
}
|
|
if (this.paymentMethod === "bank") {
|
|
if (!this.bankCardNumber || !this.cardholderName || !this.bankName) {
|
|
common_vendor.index.showToast({
|
|
title: this.$t("invite.bankInfoError"),
|
|
icon: "none"
|
|
});
|
|
return;
|
|
}
|
|
}
|
|
common_vendor.index.showToast({
|
|
title: this.$t("invite.applySuccess"),
|
|
icon: "success"
|
|
});
|
|
this.closeApplyModal();
|
|
},
|
|
handleScroll(e) {
|
|
}
|
|
},
|
|
onPageScroll(e) {
|
|
const scrollTop = e.scrollTop;
|
|
if (scrollTop > 100) {
|
|
this.navbarBgColor = "linear-gradient(135deg, #FF3B4E 0%, #FF6B7A 100%)";
|
|
} else {
|
|
const opacity = scrollTop / 100;
|
|
this.navbarBgColor = `rgba(255, 59, 78, ${opacity})`;
|
|
}
|
|
}
|
|
};
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
return common_vendor.e({
|
|
a: common_assets._imports_0,
|
|
b: common_vendor.o((...args) => $options.goBack && $options.goBack(...args)),
|
|
c: common_vendor.t(_ctx.$t("invite.title")),
|
|
d: $data.navbarBgColor,
|
|
e: common_assets._imports_1$4,
|
|
f: common_vendor.t(_ctx.$t("invite.rewardTitle")),
|
|
g: common_vendor.t(_ctx.$t("invite.rewardDesc")),
|
|
h: common_vendor.t(_ctx.$t("invite.stepsTitle")),
|
|
i: common_assets._imports_2$2,
|
|
j: common_vendor.t(_ctx.$t("invite.step1")),
|
|
k: common_assets._imports_3,
|
|
l: common_vendor.t(_ctx.$t("invite.step2")),
|
|
m: common_assets._imports_4,
|
|
n: common_vendor.t(_ctx.$t("invite.step3")),
|
|
o: common_vendor.t(_ctx.$t("invite.viewDetail")),
|
|
p: common_vendor.o((...args) => $options.showDetail && $options.showDetail(...args)),
|
|
q: common_vendor.t(_ctx.$t("invite.generateQRCode")),
|
|
r: common_vendor.o((...args) => $options.generateQRCode && $options.generateQRCode(...args)),
|
|
s: common_vendor.t(_ctx.$t("invite.shareToFriend")),
|
|
t: common_vendor.o((...args) => $options.shareToFriend && $options.shareToFriend(...args)),
|
|
v: common_vendor.t(_ctx.$t("invite.withdrawRecord")),
|
|
w: common_vendor.t(_ctx.$t("invite.withdrawPeriod")),
|
|
x: common_assets._imports_5$1,
|
|
y: common_vendor.o((...args) => $options.goToWithdrawDetail && $options.goToWithdrawDetail(...args)),
|
|
z: common_assets._imports_6$1,
|
|
A: common_vendor.f($data.withdrawRecords, (item, index, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.amount),
|
|
b: common_vendor.t(item.status),
|
|
c: index
|
|
};
|
|
}),
|
|
B: common_vendor.t(_ctx.$t("common.currency")),
|
|
C: common_vendor.t(_ctx.$t("invite.applyWithdraw")),
|
|
D: common_vendor.o((...args) => $options.applyWithdraw && $options.applyWithdraw(...args)),
|
|
E: common_vendor.t(_ctx.$t("invite.inviteRecord")),
|
|
F: common_assets._imports_7$1,
|
|
G: common_vendor.t(_ctx.$t("invite.username")),
|
|
H: common_vendor.t(_ctx.$t("invite.uid")),
|
|
I: common_vendor.t(_ctx.$t("invite.inviteTime")),
|
|
J: common_vendor.t(_ctx.$t("invite.paid")),
|
|
K: common_vendor.f($data.inviteRecords, (item, index, i0) => {
|
|
return common_vendor.e({
|
|
a: common_vendor.t(item.username),
|
|
b: common_vendor.t(item.uid),
|
|
c: common_vendor.t(item.time),
|
|
d: item.paid && item.amount
|
|
}, item.paid && item.amount ? {
|
|
e: common_vendor.t(item.amount)
|
|
} : {}, {
|
|
f: index
|
|
});
|
|
}),
|
|
L: $data.inviteRecords.length === 0
|
|
}, $data.inviteRecords.length === 0 ? {
|
|
M: common_vendor.t(_ctx.$t("common.noData"))
|
|
} : {}, {
|
|
N: $data.showWithdrawModal
|
|
}, $data.showWithdrawModal ? {
|
|
O: common_vendor.t(_ctx.$t("invite.withdrawDetail")),
|
|
P: common_assets._imports_8$1,
|
|
Q: common_vendor.o((...args) => $options.closeWithdrawModal && $options.closeWithdrawModal(...args)),
|
|
R: common_vendor.t(_ctx.$t("invite.time")),
|
|
S: common_vendor.t(_ctx.$t("invite.amount")),
|
|
T: common_vendor.t(_ctx.$t("invite.status")),
|
|
U: common_vendor.f($data.withdrawDetailList, (item, index, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.time),
|
|
b: common_vendor.t(item.amount),
|
|
c: common_vendor.t(item.status),
|
|
d: index
|
|
};
|
|
}),
|
|
V: common_vendor.o(() => {
|
|
}),
|
|
W: common_vendor.o((...args) => $options.closeWithdrawModal && $options.closeWithdrawModal(...args))
|
|
} : {}, {
|
|
X: $data.showApplyModal
|
|
}, $data.showApplyModal ? common_vendor.e({
|
|
Y: common_vendor.t(_ctx.$t("invite.withdrawApplication")),
|
|
Z: common_vendor.t($data.applyStep),
|
|
aa: $data.applyStep === 1
|
|
}, $data.applyStep === 1 ? {
|
|
ab: common_vendor.t(_ctx.$t("invite.enterAmount")),
|
|
ac: _ctx.$t("invite.enterPlaceholder"),
|
|
ad: $data.withdrawAmount,
|
|
ae: common_vendor.o(($event) => $data.withdrawAmount = $event.detail.value),
|
|
af: common_vendor.t(_ctx.$t("common.currency")),
|
|
ag: common_vendor.t(_ctx.$t("invite.amountHint")),
|
|
ah: common_vendor.t(_ctx.$t("invite.nextStep")),
|
|
ai: common_vendor.o((...args) => $options.nextStep && $options.nextStep(...args))
|
|
} : {}, {
|
|
aj: $data.applyStep === 2
|
|
}, $data.applyStep === 2 ? common_vendor.e({
|
|
ak: common_vendor.t(_ctx.$t("invite.selectPaymentMethod")),
|
|
al: common_vendor.t(_ctx.$t("invite.wechat")),
|
|
am: $data.paymentMethod === "wechat" ? 1 : "",
|
|
an: common_vendor.o(($event) => $options.selectPaymentMethod("wechat")),
|
|
ao: common_vendor.t(_ctx.$t("invite.alipay")),
|
|
ap: $data.paymentMethod === "alipay" ? 1 : "",
|
|
aq: common_vendor.o(($event) => $options.selectPaymentMethod("alipay")),
|
|
ar: common_vendor.t(_ctx.$t("invite.bankCard")),
|
|
as: $data.paymentMethod === "bank" ? 1 : "",
|
|
at: common_vendor.o(($event) => $options.selectPaymentMethod("bank")),
|
|
av: $data.paymentMethod !== "bank"
|
|
}, $data.paymentMethod !== "bank" ? common_vendor.e({
|
|
aw: common_vendor.t(_ctx.$t("invite.uploadQRCode")),
|
|
ax: $data.qrcodeImage
|
|
}, $data.qrcodeImage ? {
|
|
ay: $data.qrcodeImage
|
|
} : {}, {
|
|
az: common_vendor.o((...args) => $options.uploadQRCode && $options.uploadQRCode(...args))
|
|
}) : {}, {
|
|
aA: $data.paymentMethod === "bank"
|
|
}, $data.paymentMethod === "bank" ? {
|
|
aB: common_vendor.t(_ctx.$t("invite.enterBankInfo")),
|
|
aC: common_vendor.t(_ctx.$t("invite.bankCardNumber")),
|
|
aD: _ctx.$t("invite.enterBankCardNumber"),
|
|
aE: $data.bankCardNumber,
|
|
aF: common_vendor.o(($event) => $data.bankCardNumber = $event.detail.value),
|
|
aG: common_vendor.t(_ctx.$t("invite.cardholderName")),
|
|
aH: _ctx.$t("invite.enterCardholderName"),
|
|
aI: $data.cardholderName,
|
|
aJ: common_vendor.o(($event) => $data.cardholderName = $event.detail.value),
|
|
aK: common_vendor.t(_ctx.$t("invite.bankName")),
|
|
aL: _ctx.$t("invite.enterBankName"),
|
|
aM: $data.bankName,
|
|
aN: common_vendor.o(($event) => $data.bankName = $event.detail.value),
|
|
aO: common_vendor.t(_ctx.$t("invite.swiftCode")),
|
|
aP: common_vendor.t(_ctx.$t("invite.optional")),
|
|
aQ: _ctx.$t("invite.enterSwiftCode"),
|
|
aR: $data.swiftCode,
|
|
aS: common_vendor.o(($event) => $data.swiftCode = $event.detail.value)
|
|
} : {}, {
|
|
aT: common_vendor.t(_ctx.$t("invite.applyWithdraw")),
|
|
aU: common_vendor.o((...args) => $options.submitWithdraw && $options.submitWithdraw(...args))
|
|
}) : {}, {
|
|
aV: common_vendor.o(() => {
|
|
}),
|
|
aW: common_vendor.o((...args) => $options.closeApplyModal && $options.closeApplyModal(...args))
|
|
}) : {});
|
|
}
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-54a6e18d"]]);
|
|
_sfc_main.__runtimeHooks = 1;
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/me/invite-reward-page.js.map
|