finishregister.vue
2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<template>
<view class="content">
<view class="loginbox loginboxmima">
<view class="bangdingmima">设置密码之后你就可以使用账号密码登录了</view>
<view class="setpassword flexone">
<view class="setpasswordleft">密码</view>
<view class="setpasswordright">
<input placeholder="6-16个字符以内,区分大小写" @input="enterfirst" type="password">
</view>
</view>
<view class="setpassword flexone">
<view class="setpasswordleft">确认密码</view>
<view class="setpasswordright">
<input placeholder="请再次输入" @input="entersecond" type="password">
</view>
</view>
</view>
<view class="loginbtn finish" @click="finish">确认注册</view>
</view>
</template>
<script>
import app from "../../App.vue";
export default {
data() {
return {
firscode:'',
secondcode:'',
phone:''
}
},
onLoad(options) {
this.phone=options.phone
},
methods: {
// 输入密码
enterfirst(e){
this.firscode=e.detail.value
},
//
entersecond(e){
this.secondcode=e.detail.value
},
// 完成注册
finish(){
let that = this;
if(that.firscode==''){
uni.showToast({
title:'请输入密码',
icon:"none"
})
return false
}
if(that.secondcode==''){
uni.showToast({
title:"请输入确认密码",
icon:"none"
})
return false
}
if(that.firscode!=that.secondcode){
uni.showToast({
title:'两次输入密码不一致',
icon:"none"
})
return false
}
let url = "user/register2";
let param = {
mobile: that.phone,
password:that.firscode,
affirm_password:that.secondcode,
third_id: uni.getStorageSync("third_id")==undefined?''
: uni.getStorageSync("third_id") ,
};
console.log('8888', param)
app.post(url, param, 'get').then(r => {
console.log(r)
uni.showToast({
title:'注册成功',
icon:'none'
})
setTimeout(function(){
uni.reLaunch({
url:'/pages/login/loginindex'
})
},1500)
}).catch(err => {
console.log(err)
uni.showToast({
title:err.msg,
icon:'none'
})
})
}
}
}
</script>
<style>
@import url('../../base/login');
page{
overflow-y: hidden;
}
</style>