增加新功能

This commit is contained in:
hejiangming
2025-03-23 20:36:06 +08:00
parent 2ae62b59ed
commit 78270eeda0
184 changed files with 2690 additions and 1496 deletions
+80 -60
View File
@@ -1,11 +1,15 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const utils_enumUtils = require("../../utils/enumUtils.js");
const api_common = require("../../api/common.js");
const api_auth = require("../../api/auth.js");
const utils_auth = require("../../utils/auth.js");
const _sfc_main = {
data() {
return {
form: {
mobile: null,
code: null,
smsCode: null,
// 验证码
loginPassword: null,
loginPassword2: null,
@@ -27,51 +31,49 @@ const _sfc_main = {
loginPassword2IsShow: false,
transactionCodeIsShow: false,
// 交易密码
isPolicy: false
isPolicy: false,
butLoading: false
};
},
methods: {
registerFun() {
const params = {
...this.form
};
common_vendor.index.__f__("log", "at pages/register/register.vue:139", "params", params);
if (!params.mobile) {
async registerFun() {
const form = this.form;
if (!form.mobile) {
this.$refs.uToastRef.show({
type: "error",
message: "请输入手机号"
});
return;
}
if (!params.code) {
if (!form.smsCode) {
this.$refs.uToastRef.show({
type: "error",
message: "请输入验证码"
});
return;
}
if (!params.loginPassword) {
if (!form.loginPassword) {
this.$refs.uToastRef.show({
type: "error",
message: "请输入登录密码"
});
return;
}
if (!params.loginPassword2) {
if (!form.loginPassword2) {
this.$refs.uToastRef.show({
type: "error",
message: "请输入二次确认密码"
});
return;
}
if (params.loginPassword !== params.loginPassword2) {
if (form.loginPassword !== form.loginPassword2) {
this.$refs.uToastRef.show({
type: "error",
message: "两次输入的登录密码不一致"
});
return;
}
if (!params.referralCode) {
if (!form.referralCode) {
this.$refs.uToastRef.show({
type: "error",
message: "请输入推荐码"
@@ -85,19 +87,66 @@ const _sfc_main = {
});
return;
}
common_vendor.index.__f__("log", "at pages/register/register.vue:189", "params", params);
common_vendor.index.switchTab({
url: "/pages/home/home"
});
this.butLoading = true;
const params = {
mobile: form.mobile,
smsCode: form.smsCode,
password: form.loginPassword,
inviteCode: form.referralCode
};
const resp = await api_auth.register(params);
if (resp && resp.bizcode === 100) {
const data = resp.data;
utils_auth.setStorageFun(utils_auth.TOKEN_NAME, data.token);
utils_auth.setStorageFun(utils_auth.USER_KEY, "");
const userInfo = {
avatar: data.avatarUrl,
name: data.name,
userId: data.userId,
grade: data.grade,
inviteCode: data.inviteCode
};
utils_auth.setStorageFun(utils_auth.USER_DATA, userInfo);
let currentTimeStamp = (/* @__PURE__ */ new Date()).getTime();
utils_auth.setStorageFun(utils_auth.USER_LOGIN_TIME, currentTimeStamp);
this.$refs.uToastRef.show({
type: "success",
message: resp.msg
});
setTimeout(() => {
common_vendor.index.switchTab({
url: "/pages/home/home"
});
}, 2e3);
}
this.butLoading = false;
},
/**
* 获取手机验证码
*/
getMobileCode() {
async getMobileCode() {
const form = this.form;
if (!form.mobile) {
this.$refs.uToastRef.show({
type: "error",
message: "请输入手机号码"
});
return;
}
this.countdown = true;
},
getCode(val) {
this.countdown = false;
const params = {
mobile: form.mobile,
type: utils_enumUtils.SMS_TYPE.REGISTER
};
const response = await api_common.getUserList(params);
if (response && response.bizcode === 100) {
this.$refs.uToastRef.show({
type: "success",
message: response.msg
});
} else {
this.countdown = false;
}
}
}
};
@@ -128,7 +177,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
}),
c: $data.countdown
}, $data.countdown ? {
d: common_vendor.o(($event) => $options.getCode(false)),
d: common_vendor.o(($event) => $data.countdown = false),
e: common_vendor.p({
time: 60 * 1e3,
format: "ss"
@@ -136,12 +185,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
} : {
f: common_vendor.o((...args) => $options.getMobileCode && $options.getMobileCode(...args))
}, {
g: common_vendor.o(($event) => $data.form.code = $event),
g: common_vendor.o(($event) => $data.form.smsCode = $event),
h: common_vendor.p({
placeholder: "请输入验证码",
border: "surround",
customStyle: $data.inputCss,
modelValue: $data.form.code
modelValue: $data.form.smsCode
}),
i: $data.loginPasswordIsShow
}, $data.loginPasswordIsShow ? {
@@ -203,46 +252,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
type: $data.loginPassword2IsShow ? "text" : "password",
modelValue: $data.form.loginPassword2
}),
x: $data.transactionCodeIsShow
}, $data.transactionCodeIsShow ? {
y: common_vendor.o(($event) => {
$data.transactionCodeIsShow = false;
}),
z: common_vendor.p({
src: "/static/login/show.png",
width: "20",
height: "20",
bgColor: "#f1f6ff00"
})
} : {
A: common_vendor.o(($event) => {
$data.transactionCodeIsShow = true;
}),
B: common_vendor.p({
src: "/static/login/hidden.png",
width: "20",
height: "20",
bgColor: "#f1f6ff00"
})
}, {
C: common_vendor.o(($event) => $data.form.transactionCode = $event),
D: common_vendor.p({
placeholder: "请输入交易密码",
border: "surround",
customStyle: $data.inputCss,
type: $data.transactionCodeIsShow ? "text" : "password",
modelValue: $data.form.transactionCode
}),
E: common_vendor.o(($event) => $data.form.referralCode = $event),
F: common_vendor.p({
x: common_vendor.o(($event) => $data.form.referralCode = $event),
y: common_vendor.p({
placeholder: "推荐码",
border: "surround",
customStyle: $data.inputCss,
modelValue: $data.form.referralCode
}),
G: common_vendor.o((...args) => $options.registerFun && $options.registerFun(...args)),
H: common_vendor.o(($event) => $data.isPolicy = $event),
I: common_vendor.p({
z: common_vendor.o((...args) => $options.registerFun && $options.registerFun(...args)),
A: $data.butLoading,
B: common_vendor.o(($event) => $data.isPolicy = $event),
C: common_vendor.p({
name: "isCheck",
usedAlone: true,
shape: "circle",
@@ -251,7 +271,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
iconSize: "18",
checked: $data.isPolicy
}),
J: common_vendor.sr("uToastRef", "60fa605e-14")
D: common_vendor.sr("uToastRef", "6cfc9b6b-11")
});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);