| | |
| | | class="Ttop flex flex-center flex-wrap" |
| | | style="flex-direction: column" |
| | | > |
| | | <view class=""></view> |
| | | <view class="" ref="Rtop"> |
| | | <view></view> |
| | | <view ref="Rtop"> |
| | | <text class="login"></text> |
| | | <text |
| | | style=" |
| | |
| | | font-family: cursive; |
| | | font-weight: bold; |
| | | " |
| | | >中国医学人物知识库</text |
| | | >中国历代医学人物知识库</text |
| | | > |
| | | </view> |
| | | <view></view> |
| | |
| | | align-items: center; |
| | | " |
| | | > |
| | | <!-- <view class="" style="color: #244A7B;padding-bottom: .47rem;font-size: .3rem;font-weight: bold;">用户注册</view> --> |
| | | <!-- <view style="color: #244A7B;padding-bottom: .47rem;font-size: .3rem;font-weight: bold;">用户注册</view> --> |
| | | <view class="LoginBg"></view> |
| | | <view |
| | | class="" |
| | | @click="BacktoLogin" |
| | | style=" |
| | | cursor: pointer; |
| | |
| | | placeholder="必须与密码一致" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="手机号" prop="cellphoneORmailbox"> |
| | | <el-form-item label="手机号/邮箱" prop="cellphoneORmailbox"> |
| | | <el-input |
| | | v-model="registerData.cellphoneORmailbox" |
| | | placeholder="请填写正确的手机" |
| | | placeholder="请填写手机号/邮箱" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="验证码" prop="verifyCode"> |
| | |
| | | margin-bottom: 0.19rem; |
| | | " |
| | | > |
| | | <el-checkbox v-model="checked" style="margin-right: 0.06rem;"></el-checkbox> |
| | | 用户注册即代表同意 |
| | | <span class="cursor" @click="termOfServiceClick(1)" |
| | | <span |
| | | class="cursor" |
| | | style="color: #244a7b" |
| | | @click="termOfServiceClick(1)" |
| | | >《服务条款》</span |
| | | > |
| | | 和<span class="cursor" @click="termOfServiceClick(2)" |
| | | 和<span |
| | | class="cursor" |
| | | style="color: #244a7b" |
| | | @click="termOfServiceClick(2)" |
| | | >《用户隐私保护和个人信息条款》</span |
| | | > |
| | | </view> |
| | |
| | | import Footer1 from "@/components/footer/footer.vue"; |
| | | export default { |
| | | components: { |
| | | Footer1, |
| | | Footer1 |
| | | }, |
| | | data() { |
| | | // 密码 |
| | |
| | | { |
| | | required: true, |
| | | message: "请输入登录账号", |
| | | trigger: "blur", |
| | | trigger: "blur" |
| | | }, |
| | | { |
| | | pattern: /^[a-zA-Z0-9]{3,15}$/, |
| | | message: "请输入3-15个字符的字母或数字", |
| | | trigger: "blur", |
| | | }, // 自定义校验规则,使用正则表达式 |
| | | trigger: "blur" |
| | | } // 自定义校验规则,使用正则表达式 |
| | | ], |
| | | pass: [ |
| | | { |
| | | required: true, |
| | | message: "请输入密码", |
| | | trigger: "blur", |
| | | trigger: "blur" |
| | | }, |
| | | { |
| | | min: 6, |
| | | max: 10, |
| | | message: "密码长度在 6 到 12 个字符", |
| | | trigger: "blur", |
| | | trigger: "blur" |
| | | }, |
| | | { |
| | | validator: validatePass, |
| | | trigger: "blur", |
| | | }, |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | checkPass: [ |
| | | { |
| | | validator: validatePass2, |
| | | trigger: "blur", |
| | | }, |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | cellphoneORmailbox: [ |
| | | { |
| | | required: true, |
| | | message: "请输入手机", |
| | | trigger: "blur", |
| | | message: "请输入手机号/邮箱", |
| | | trigger: "blur" |
| | | }, |
| | | { |
| | | validator: this.validateContact, |
| | | trigger: "blur", |
| | | }, |
| | | trigger: "blur" |
| | | } |
| | | ], |
| | | verifyCode: [ |
| | | { |
| | | required: true, |
| | | message: "请输入验证码", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | trigger: "blur" |
| | | } |
| | | ] |
| | | }, |
| | | // 登录注册框 |
| | | loginTrue: true, |
| | |
| | | pass: "", |
| | | checkPass: "", |
| | | cellphoneORmailbox: null, |
| | | verifyCode: "", |
| | | verifyCode: "" |
| | | }, |
| | | // 登录用户账号 |
| | | loginData: { |
| | | // 账号 |
| | | loginID: "", |
| | | pass: "", |
| | | pass: "" |
| | | }, |
| | | // 重置密码 |
| | | resetDataPass: { |
| | | cellphoneORmailbox: null, |
| | | verifyCode: "", |
| | | newPass: "", |
| | | checkPass: "", |
| | | checkPass: "" |
| | | }, |
| | | // 修改密码 |
| | | amendDataPass: { |
| | | loginID: "", |
| | | originalPass: "", |
| | | newPass: "", |
| | | checkPass: "", |
| | | checkPass: "" |
| | | }, |
| | | // 书籍数据 |
| | | listData: [ |
| | | { |
| | | name: "中医人物数据库", |
| | | id: 1, |
| | | name: "历代人物", |
| | | id: 1 |
| | | }, |
| | | { |
| | | name: "世医医家数据库", |
| | | id: 2, |
| | | name: "家学传承", |
| | | id: 2 |
| | | }, |
| | | { |
| | | name: "中医学术流派", |
| | | id: 3, |
| | | name: "学术图谱", |
| | | id: 6 |
| | | }, |
| | | { |
| | | name: "中医地域医谱", |
| | | id: 4, |
| | | name: "学术流派", |
| | | id: 3 |
| | | }, |
| | | { |
| | | name: "中医医事制度", |
| | | id: 5, |
| | | name: "地域图谱", |
| | | id: 4 |
| | | }, |
| | | // { |
| | | // name: "中医医事制度", |
| | | // id: 5 |
| | | // } |
| | | ], |
| | | checked: false |
| | | }; |
| | | }, |
| | | onLoad() { |
| | |
| | | success: function (info) { |
| | | // console.log('屏幕的宽度:' + info.windowWidth); |
| | | // console.log('屏幕的高度:' + info.windowHeight); |
| | | }, |
| | | } |
| | | }); |
| | | }, |
| | | mounted() { |
| | |
| | | methods: { |
| | | // 服务条款 |
| | | termOfServiceClick(number) { |
| | | // console.log(number); |
| | | if (number == 1) { |
| | | console.log("服务条款"); |
| | | window.open(`#/pages/userAgreement/userAgreement`); |
| | | // uni.navigateTo({ |
| | | // url: '/pages/userAgreement/userAgreement' |
| | | // }) |
| | | window.open(`#/pages/userAgreement/userAgreement?type=1`); |
| | | } else if (number == 2) { |
| | | window.open(`#/pages/userAgreement/userAgreement`); |
| | | console.log("用户隐私保护和个人信息条款"); |
| | | window.open(`#/pages/userAgreement/userAgreement?type=2`); |
| | | } |
| | | }, |
| | | // 已有账号?返回登录 |
| | | BacktoLogin() { |
| | | uni.redirectTo({ |
| | | url: "/pages/Login/Login", |
| | | url: "/pages/Login/Login" |
| | | }); |
| | | }, |
| | | // 获取验证码 |
| | |
| | | if (!this.registerData.cellphoneORmailbox) { |
| | | this.$message({ |
| | | message: "请输入手机!", |
| | | type: "warning", |
| | | type: "warning" |
| | | }); |
| | | |
| | | return false; |
| | |
| | | return; |
| | | } |
| | | let Obj = { |
| | | communicateParam: this.registerData.cellphoneORmailbox, |
| | | communicateParam: this.registerData.cellphoneORmailbox |
| | | }; |
| | | this.countdown = 60; |
| | | const intervalId = setInterval(() => { |
| | |
| | | } |
| | | }, 1000); |
| | | let code = await getverifyCode(Obj); |
| | | |
| | | }, |
| | | // 手机号/或者邮箱 |
| | | validateContact(rule, value, callback) { |
| | | const regPhone = /^1[0-9]{10}$/; |
| | | const regEmail = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/; |
| | | console.log(value, regPhone.test(value), regEmail.test(value)); |
| | | if (regPhone.test(value) || regEmail.test(value)) { |
| | | callback(); // 校验通过 |
| | | } else { |
| | |
| | | this.$nextTick(() => { |
| | | var width = this.$refs.Rtop.$el.clientWidth; |
| | | this.Rtop1 = width + 50; |
| | | console.log("Element width:", width); |
| | | }); |
| | | }, |
| | | // 用户注册 |
| | | async Login(formName) { |
| | | console.log(formName); |
| | | if(!this.checked) { |
| | | this.$message({ |
| | | message: '请勾选同意服务条款、用户隐私保护和个人信息条款', |
| | | type: 'warning' |
| | | }); |
| | | return false; |
| | | } |
| | | let Obj = { |
| | | username: this.registerData.loginID, |
| | | password: encryptAES(this.registerData.pass), |
| | | communicateParam: this.registerData.cellphoneORmailbox, |
| | | verifyCode: this.registerData.verifyCode, |
| | | verifyCode: this.registerData.verifyCode |
| | | }; |
| | | this.$refs[formName].validate(async (valid) => { |
| | | if (valid) { |
| | | // alert('submit!'); |
| | | console.log("sdfds"); |
| | | await getaddLogin(Obj).then((res) => { |
| | | console.log(res, "注册成功"); |
| | | if (res.success == true) { |
| | | uni.showToast({ |
| | | title: res.errorText, |
| | | icon: "success", |
| | | }); |
| | | this.$message.success("注册成功"); |
| | | uni.navigateTo({ |
| | | url: "/pages/Login/Login", |
| | | url: "/pages/Login/Login" |
| | | }); |
| | | } else { |
| | | uni.showToast({ |
| | | title: res.errorText, |
| | | icon: "error", |
| | | }); |
| | | this.$message.error(res.errorText); |
| | | } |
| | | }); |
| | | // encryptAES |
| | | // uni.navigateTo({ |
| | | // url: '/pages/Login/Login' |
| | | // }) |
| | | } else { |
| | | console.log("error submit!!"); |
| | | return false; |
| | | } |
| | | }); |
| | | |
| | | // console.log(Obj, '用户登录的登录按钮'); |
| | | |
| | | // let res = await getaddLogin(Obj) |
| | | // console.log('sdfdsfs', res); |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | |
| | | } |
| | | |
| | | ::v-deep .el-form-item__label { |
| | | min-width: 0.6rem; |
| | | min-width: 0.8rem; |
| | | padding: 0; |
| | | color: #244a7b; |
| | | font-size: 0.14rem; |
| | | font-weight: 500; |
| | | margin-right: 0.29rem; |
| | | margin-right: 0.1rem; |
| | | display: flex; |
| | | align-items: center; |
| | | text-align: right; |