"use strict"; const common_vendor = require("../../common/vendor.js"); const common_assets = require("../../common/assets.js"); const api_api = require("../../api/api.js"); if (!Array) { const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon"); const _easycom_statusBar2 = common_vendor.resolveComponent("statusBar"); const _easycom_up_input2 = common_vendor.resolveComponent("up-input"); const _easycom_up_code2 = common_vendor.resolveComponent("up-code"); const _easycom_up_checkbox2 = common_vendor.resolveComponent("up-checkbox"); (_easycom_up_icon2 + _easycom_statusBar2 + _easycom_up_input2 + _easycom_up_code2 + _easycom_up_checkbox2)(); } const _easycom_up_icon = () => "../../uni_modules/uview-plus/components/u-icon/u-icon.js"; const _easycom_statusBar = () => "../../components/statusBar/statusBar.js"; 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_checkbox = () => "../../uni_modules/uview-plus/components/u-checkbox/u-checkbox.js"; if (!Math) { (_easycom_up_icon + _easycom_statusBar + _easycom_up_input + _easycom_up_code + _easycom_up_checkbox)(); } const _sfc_main = { __name: "register", setup(__props) { const statusBarHeight = common_vendor.index.getSystemInfoSync().statusBarHeight + "px"; let tips = common_vendor.ref(""); let uCode = common_vendor.ref(null); common_vendor.ref(""); let dataFrom = common_vendor.reactive({ userName: "", passwd: "", shareCode: "", phone: "", platform: 1, smsCode: "", confirmPasswd: "" }); let xieyi = common_vendor.ref(false); common_vendor.onLoad(() => { const invite_code = common_vendor.index.getStorageSync("invite_code"); if (invite_code) { dataFrom.shareCode = invite_code; } }); let changeChex = (e) => { xieyi.value = e; }; let toLogin = () => { common_vendor.index.navigateBack(); }; let codeChange2 = (text) => { tips.value = text; }; let getCode2 = () => { if (!dataFrom.phone) return common_vendor.index.showToast({ title: "请输入手机号", icon: "none" }); if (uCode.value.canGetCode) { common_vendor.index.showLoading({ title: "正在获取验证码" }); api_api.smsCode({ phone: dataFrom.phone }).then((res) => { common_vendor.index.hideLoading(); common_vendor.index.$u.toast("验证码已发送"); uCode.value.start(); }); } else { common_vendor.index.$u.toast("倒计时结束后再发送"); } }; let submit = async () => { if (!xieyi.value) return common_vendor.index.showToast({ title: "请先阅读并勾选隐私政策和用户注册服务协议", icon: "none" }); if (!dataFrom.userName) return common_vendor.index.showToast({ title: "请输入用户名", icon: "none" }); if (!dataFrom.phone) return common_vendor.index.showToast({ title: "请输入手机号", icon: "none" }); if (dataFrom.phone.length != 11) return common_vendor.index.showToast({ title: "请输入正确的手机号", icon: "none" }); if (!dataFrom.smsCode) return common_vendor.index.showToast({ title: "请输入验证码", icon: "none" }); if (!dataFrom.shareCode) return common_vendor.index.showToast({ title: "请输入邀请码", icon: "none" }); if (!dataFrom.passwd) return common_vendor.index.showToast({ title: "请输入密码", icon: "none" }); if (!dataFrom.confirmPasswd) return common_vendor.index.showToast({ title: "请再次输入密码", icon: "none" }); if (dataFrom.passwd != dataFrom.confirmPasswd) return common_vendor.index.showToast({ title: "两次密码输入不一致", icon: "none" }); await api_api.registerApi(dataFrom); common_vendor.index.showToast({ title: "注册成功", icon: "none" }); setTimeout(() => { common_vendor.index.navigateBack(); }, 200); }; let back = () => { common_vendor.index.navigateBack(); }; return (_ctx, _cache) => { return { a: statusBarHeight, b: common_vendor.o(common_vendor.unref(back)), c: common_vendor.p({ name: "arrow-left", bold: true, color: "#000" }), d: common_assets._imports_0$2, e: common_assets._imports_1$1, f: common_vendor.o(($event) => common_vendor.unref(dataFrom).userName = $event), g: common_vendor.p({ fontSize: "30rpx", placeholder: "请输入您的用户名", border: "bottom", clearable: true, modelValue: common_vendor.unref(dataFrom).userName }), h: common_vendor.o(($event) => common_vendor.unref(dataFrom).phone = $event), i: common_vendor.p({ fontSize: "30rpx", placeholder: "请输入您的手机号", border: "bottom", clearable: true, modelValue: common_vendor.unref(dataFrom).phone }), j: common_vendor.o(($event) => common_vendor.unref(dataFrom).smsCode = $event), k: common_vendor.p({ fontSize: "30rpx", placeholder: "请输入验证码", border: "bottom", clearable: true, modelValue: common_vendor.unref(dataFrom).smsCode }), l: () => ({ r: uCode, k: "uCode" }), m: common_vendor.o(common_vendor.unref(codeChange2)), n: common_vendor.p({ ["keep-running"]: true, ["start-text"]: "点我获取验证码" }), o: common_vendor.t(common_vendor.unref(tips)), p: common_vendor.o((...args) => common_vendor.unref(getCode2) && common_vendor.unref(getCode2)(...args)), q: common_vendor.unref(tips), r: common_vendor.o(($event) => common_vendor.unref(dataFrom).shareCode = $event), s: common_vendor.p({ fontSize: "30rpx", placeholder: "请输入您的邀请码", border: "bottom", clearable: true, modelValue: common_vendor.unref(dataFrom).shareCode }), t: common_vendor.o(($event) => common_vendor.unref(dataFrom).passwd = $event), v: common_vendor.p({ fontSize: "30rpx", type: "password", placeholder: "请输入您的密码", border: "bottom", clearable: true, modelValue: common_vendor.unref(dataFrom).passwd }), w: common_vendor.o(($event) => common_vendor.unref(dataFrom).confirmPasswd = $event), x: common_vendor.p({ fontSize: "30rpx", type: "password", placeholder: "请再次输入您的密码", border: "bottom", clearable: true, modelValue: common_vendor.unref(dataFrom).confirmPasswd }), y: common_vendor.o((...args) => common_vendor.unref(toLogin) && common_vendor.unref(toLogin)(...args)), z: common_vendor.o((...args) => common_vendor.unref(submit) && common_vendor.unref(submit)(...args)), A: common_vendor.o(common_vendor.unref(changeChex)), B: common_vendor.p({ customStyle: { marginRight: "15rpx", marginBotton: 0 } }) }; }; } }; const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-838b72c9"]]); my.createPage(MiniProgramPage);