This commit is contained in:
““shijing 2021-08-25 17:03:59 +08:00
parent 0f2f038dc3
commit 415aee3070
45 changed files with 130 additions and 59 deletions

View File

@ -44,6 +44,8 @@ const install = (Vue, vm) => {
let tjfk = (params={})=>vm.$u.post('index.php/api/order/payment_voucher', params);//提交付款凭证 let tjfk = (params={})=>vm.$u.post('index.php/api/order/payment_voucher', params);//提交付款凭证
let getCode = (id)=>vm.$u.get(`/index.php/api/login/getnum/type/mobphone/to/${id}`);//获取注册码 let getCode = (id)=>vm.$u.get(`/index.php/api/login/getnum/type/mobphone/to/${id}`);//获取注册码
let register = (params={})=>vm.$u.post('/index.php/api/login/reg', params);//注册 let register = (params={})=>vm.$u.post('/index.php/api/login/reg', params);//注册
let getCodeRepass = (id)=>vm.$u.get(`/index.php/api/login/getpwdnum/type/mobphone/to/${id}`);//获取验证码
let changepwd = ( params)=>vm.$u.post(`/index.php/api/login/changepwd`, params);//修改密码
vm.$u.api = { vm.$u.api = {
getSearch, getSearch,
@ -78,6 +80,8 @@ const install = (Vue, vm) => {
upFile, upFile,
tjfk, tjfk,
getCode, getCode,
getCodeRepass,
changepwd,
register}; register};
} }

View File

@ -64,7 +64,7 @@
/* */ /* */
"appid" : "wxe27470b2f09a2508", "appid" : "wxe27470b2f09a2508",
"setting" : { "setting" : {
"urlCheck" : true "urlCheck" : false
}, },
"permission" : {} "permission" : {}
} }

View File

@ -17,9 +17,10 @@
placeholder-style="color: rgba(255,255,255,0.8);" /> placeholder-style="color: rgba(255,255,255,0.8);" />
</view> </view>
<view class="btn" @tap="doLogin"> </view> <view class="btn" @tap="doLogin"> </view>
<view class="res"> <view class="res">
<!-- <view @tap="toPage('register')">用户注册</view> --> <view class="textBtn" @tap="toPage('register')">用户注册</view>
<!-- <view @tap="toPage('resetpassword')">忘记密码</view> --> <view class="textBtn" @tap="toPage('resetpasswd')">找回密码</view>
</view> </view>
</view> </view>
<!-- 第三方登录 --> <!-- 第三方登录 -->
@ -200,7 +201,12 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
height: 100upx; height: 100upx;
padding:0 10px;
color: rgba($color: #ffffff, $alpha: 0.8); color: rgba($color: #ffffff, $alpha: 0.8);
.textBtn{
text-decoration: underline;
}
} }
} }

View File

@ -6,6 +6,9 @@
</view> </view>
</view> </view>
<view class="form re"> <view class="form re">
<view class="username">
<input placeholder="请输入用户账号" v-model="userName" placeholder-style="color: rgba(255,255,255,0.8);"/>
</view>
<view class="username"> <view class="username">
<view class="get-code" :style="{'color':getCodeBtnColor}" @click.stop="getCode()">{{getCodeText}}</view> <view class="get-code" :style="{'color':getCodeBtnColor}" @click.stop="getCode()">{{getCodeText}}</view>
<input placeholder="请输入手机号" v-model="phoneNumber" placeholder-style="color: rgba(255,255,255,0.8);"/> <input placeholder="请输入手机号" v-model="phoneNumber" placeholder-style="color: rgba(255,255,255,0.8);"/>
@ -31,6 +34,7 @@
data() { data() {
return { return {
phoneNumber:"", phoneNumber:"",
userName:"",
code:'', code:'',
passwd:"", passwd:"",
getCodeText:'获取验证码', getCodeText:'获取验证码',
@ -43,6 +47,7 @@
}, },
methods: { methods: {
Timer(){}, Timer(){},
//
getCode(){ getCode(){
uni.hideKeyboard() uni.hideKeyboard()
if(this.getCodeisWaiting){ if(this.getCodeisWaiting){
@ -59,10 +64,15 @@
setTimeout(()=>{ setTimeout(()=>{
uni.showToast({title: '验证码已发送',icon:"none"}); uni.showToast({title: '验证码已发送',icon:"none"});
//1234 //1234
this.code=1234; // this.code=1234;
this.$u.api.getCode(this.phoneNumber).then(res=>{
debugger;
if(res.code===0){}else{}
})
this.setTimer(); this.setTimer();
},1000) },1000)
}, },
//
setTimer(){ setTimer(){
let holdTime = 60; let holdTime = 60;
this.getCodeText = "重新获取(60)" this.getCodeText = "重新获取(60)"
@ -79,61 +89,86 @@
},1000) },1000)
}, },
//
doReg(){ doReg(){
let that = this;
uni.hideKeyboard() uni.hideKeyboard()
// //
if(!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))){ if(!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(that.phoneNumber))){
uni.showToast({title: '请填写正确手机号码',icon:"none"}); uni.showToast({title: '请填写正确手机号码',icon:"none"});
return false; return false;
} }
//使
if(this.code!=1234){
uni.showToast({title: '验证码不正确',icon:"none"});
return false;
}
uni.showLoading({ uni.showLoading({
title: '提交中...' title: '提交中...'
}) })
uni.login({
provider: 'weixin',
success: function (loginRes) {
let params = {username:that.userName,mobphone:that.phoneNumber,code:loginRes.code,phone_code:that.code};
that.$u.api.register(params).then(res=>{
uni.hideLoading();
debugger;
if(res.code===0){
uni.reLaunch({
url:'/pages/tabBar/home/home'
})
that.$u.vuex('vuex_token', res.data.token)
that.$u.api.getInfo().then(res => {
that.$u.vuex('vuex_user', res.data)
if(res.data.icon===""){
that.$u.vuex('vuex_user.icon', '/static/img/face.jpg')
}else{
that.$u.vuex('vuex_user.icon', that.vuex_host + 'public/' + res.data.icon)
}
})
}else{}
console.log(res)
})
},
})
//使 //使
setTimeout(()=>{ // setTimeout(()=>{
uni.getStorage({ // uni.getStorage({
key: 'UserList', // key: 'UserList',
success:(res)=>{ // success:(res)=>{
//md5 // //md5
res.data.push({username:this.phoneNumber,passwd:md5(this.passwd)}) // res.data.push({username:this.phoneNumber,passwd:md5(this.passwd)})
uni.setStorage({ // uni.setStorage({
key: 'UserList', // key: 'UserList',
data: res.data, // data: res.data,
success: function () { // success: function () {
uni.hideLoading() // uni.hideLoading()
uni.showToast({title: '注册成功',icon:"success"}); // uni.showToast({title: '',icon:"success"});
setTimeout(function(){ // setTimeout(function(){
uni.navigateBack(); // uni.navigateBack();
},1000) // },1000)
} // }
}); // });
}, // },
fail:(e)=>{ // fail:(e)=>{
uni.hideLoading() // uni.hideLoading()
console.log('error'); // console.log('error');
//UserList // //UserList
uni.setStorage({ // uni.setStorage({
key: 'UserList', // key: 'UserList',
data: [{username:this.phoneNumber,passwd:md5(this.passwd)}], // data: [{username:this.phoneNumber,passwd:md5(this.passwd)}],
success: function () { // success: function () {
uni.hideLoading() // uni.hideLoading()
uni.showToast({title: '注册成功',icon:"success"}); // uni.showToast({title: '',icon:"success"});
setTimeout(function(){ // setTimeout(function(){
uni.navigateBack(); // uni.navigateBack();
},1000) // },1000)
}, // },
fail:function(e){ // fail:function(e){
console.log('set error:'+JSON.stringify(e)); // console.log('set error:'+JSON.stringify(e));
} // }
}); // });
} // }
}); // });
},1000) // },1000)
//
}, },
toLogin(){ toLogin(){
uni.hideKeyboard() uni.hideKeyboard()

View File

@ -14,7 +14,7 @@
<input placeholder="请输入验证码" v-model="code" placeholder-style="color: rgba(255,255,255,0.8);"/> <input placeholder="请输入验证码" v-model="code" placeholder-style="color: rgba(255,255,255,0.8);"/>
</view> </view>
<view class="password"> <view class="password">
<input placeholder="请输入密码" v-model="passwd" password=true placeholder-style="color: rgba(255,255,255,0.8);"/> <input placeholder="请输入密码" v-model="password" password=true placeholder-style="color: rgba(255,255,255,0.8);"/>
</view> </view>
<view class="btn" @tap="doReset">重置密码</view> <view class="btn" @tap="doReset">重置密码</view>
@ -30,7 +30,7 @@
return { return {
phoneNumber:"", phoneNumber:"",
code:'', code:'',
passwd:"", password:"",
getCodeText:'获取验证码', getCodeText:'获取验证码',
getCodeBtnColor:"#ffffff", getCodeBtnColor:"#ffffff",
getCodeisWaiting:false getCodeisWaiting:false
@ -55,8 +55,10 @@
// //
setTimeout(()=>{ setTimeout(()=>{
uni.showToast({title: '验证码已发送',icon:"none"}); uni.showToast({title: '验证码已发送',icon:"none"});
//1234 this.$u.api.getCodeRepass(this.phoneNumber).then(res=>{
this.code=1234; debugger;
if(res.code===0){}else{}
})
this.setTimer(); this.setTimer();
},1000) },1000)
@ -79,21 +81,38 @@
},1000) },1000)
}, },
doReset(){ doReset(){
let that = this;
uni.hideKeyboard() uni.hideKeyboard()
// //
if(!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))){ if(!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(this.phoneNumber))){
uni.showToast({title: '请填写正确手机号码',icon:"none"}); uni.showToast({title: '请填写正确手机号码',icon:"none"});
return false; return false;
} }
//使
if(this.code!=1234){
uni.showToast({title: '验证码不正确',icon:"none"});
return false;
}
uni.showLoading({ uni.showLoading({
title: '提交中...' title: '提交中...'
}) })
let params = {mobphone:that.phoneNumber,password:that.password,phone_code:that.code};
that.$u.api.changepwd(params).then(res=>{
uni.hideLoading();
debugger;
if(res.code===0){
uni.reLaunch({
url:'/pages/tabBar/home/home'
})
that.$u.vuex('vuex_token', res.data.token)
that.$u.api.getInfo().then(res => {
that.$u.vuex('vuex_user', res.data)
if(res.data.icon===""){
that.$u.vuex('vuex_user.icon', '/static/img/face.jpg')
}else{
that.$u.vuex('vuex_user.icon', that.vuex_host + 'public/' + res.data.icon)
}
})
}else{}
console.log(res)
})
//使 //使
setTimeout(()=>{ setTimeout(()=>{
uni.getStorage({ uni.getStorage({

View File

@ -84,6 +84,7 @@
</view> </view>
<view class="text">{{row.text}}</view> <view class="text">{{row.text}}</view>
</view> </view>
<view @click="changePwd">修改密码</view>
</view> </view>
</view> </view>
<!-- 占位 --> <!-- 占位 -->
@ -205,6 +206,11 @@
} }
}, },
changePwd(){
uni.navigateTo({
url:'/pages/login/login'
})
},
toMyQR(){ toMyQR(){
uni.navigateTo({ uni.navigateTo({
url:'../../user/myQR/myQR' url:'../../user/myQR/myQR'

View File

@ -54,6 +54,7 @@ page {
border-radius: 45upx; border-radius: 45upx;
background-color: #fff; background-color: #fff;
font-size: 40upx; font-size: 40upx;
margin-bottom: 20upx!important;
} }
} }
.re { .re {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.