| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <template>
- <view>
- <!-- 头部 -->
- <headContent>
- <template #left>
- <view class="head-revers-back iconfont" @click.stop="reversBackBtn()"></view>
- </template>
- </headContent>
- <view class="page-content">
- <text class="login-title">设置密码</text>
- <setPswd @submitPswd="submitPswd" />
- </view>
- <load ref="loadRef" />
- </view>
- </template>
- <script>
- import setPswd from "./modules/set-pswd.vue"
- import {
- reverseBack
- } from "@/utils/common.js"
- import {
- Api_setPassword,
- Api_submitRegister
- } from "@/api/index.js"
- export default {
- name: 'submit-register',
- components: {
- setPswd
- },
- data() {
- return {
- type: '',
- account: '',
- accountCode: '',
- invitationCode: ''
- };
- },
- onLoad(opt) {
- // type=0&account=13133111133&invitationCode=1&accountCode=123456
- this.type = opt?.type;
- this.account = opt?.account;
- this.accountCode = opt?.accountCode;
- this.invitationCode = opt?.invitationCode;
- },
- mounted() {
- },
- methods: {
- reversBackBtn() {
- reverseBack()
- },
- submitPswd(e) {
- uni.showLoading({
- title: ''
- })
- const obj = {
- type: this.type == 1 ? 'email' : 'mogile',
- user_string: this.account,
- code: this.accountCode,
- password: e.newPassword,
- re_password: e.confirmPassword
- }
- if (this.invitationCode) {
- obj.extension_code = this.invitationCode
- }
- Api_submitRegister(obj).then(res => {
- uni.showToast({
- title: '注册成功',
- icon: 'none'
- })
- setTimeout(() => {
- reverseBack('pages/login/index')
- // setTimeout(() => {
- // uni.redirectTo({
- // url: ''
- // });
- // }, 300)
- }, 200)
- }).catch(err => {}).finally(() => {
- uni.hideLoading()
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- @import "~./common.scss";
- </style>
|