|
|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
<template>
|
|
|
|
|
<view class="container">
|
|
|
|
|
<image class="cbg" :src="base.imgHost('login-top.png')"></image>
|
|
|
|
|
<image class="cbg" :src="base.imgHost('login-top.png')"></image>
|
|
|
|
|
<view class="login">
|
|
|
|
|
<image class="login-logo" :src="base.imgHost('login-logo.png')"></image>
|
|
|
|
|
<view class="login-form">
|
|
|
|
|
@ -17,7 +17,7 @@
|
|
|
|
|
</view>
|
|
|
|
|
<view class="login-btn">
|
|
|
|
|
<view @click="handleMsgLogin">登录</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="login-msg" @click="toRegister">注册账号</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
@ -27,7 +27,8 @@
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
hasSend: false,
|
|
|
|
|
hasSend: false,
|
|
|
|
|
isDonate:false,
|
|
|
|
|
count: 60,
|
|
|
|
|
inputStyle: {
|
|
|
|
|
'padding': '0rpx 30rpx',
|
|
|
|
|
@ -45,24 +46,25 @@
|
|
|
|
|
mobile: '',
|
|
|
|
|
code: '',
|
|
|
|
|
},
|
|
|
|
|
sendTimer: null,
|
|
|
|
|
type:'me'
|
|
|
|
|
sendTimer: null,
|
|
|
|
|
type: 'me'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoad(options) {
|
|
|
|
|
this.type=options.id?'course':'me'
|
|
|
|
|
},
|
|
|
|
|
onUnload() {
|
|
|
|
|
if(this.sendTimer){
|
|
|
|
|
clearInterval(this.sendTimer);
|
|
|
|
|
this.sendTimer = null
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onHide() {
|
|
|
|
|
if(this.sendTimer){
|
|
|
|
|
clearInterval(this.sendTimer);
|
|
|
|
|
this.sendTimer = null
|
|
|
|
|
}
|
|
|
|
|
this.type = options.id ? 'course' : 'me'
|
|
|
|
|
this.isDonate = options.isDonate?true:false
|
|
|
|
|
},
|
|
|
|
|
onUnload() {
|
|
|
|
|
if (this.sendTimer) {
|
|
|
|
|
clearInterval(this.sendTimer);
|
|
|
|
|
this.sendTimer = null
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onHide() {
|
|
|
|
|
if (this.sendTimer) {
|
|
|
|
|
clearInterval(this.sendTimer);
|
|
|
|
|
this.sendTimer = null
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getSmsCode() {
|
|
|
|
|
@ -76,7 +78,7 @@
|
|
|
|
|
if (!this.base.isMobile(this.form.mobile)) {
|
|
|
|
|
this.base.toast('手机号码错误')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let that = this
|
|
|
|
|
this.$u.api.sendSms({
|
|
|
|
|
mobile: this.form.mobile
|
|
|
|
|
@ -87,8 +89,8 @@
|
|
|
|
|
if (that.count > 1) {
|
|
|
|
|
that.count--
|
|
|
|
|
} else {
|
|
|
|
|
clearInterval(that.sendTimer);
|
|
|
|
|
that.sendTimer = null
|
|
|
|
|
clearInterval(that.sendTimer);
|
|
|
|
|
that.sendTimer = null
|
|
|
|
|
that.count = 60
|
|
|
|
|
that.hasSend = false;
|
|
|
|
|
}
|
|
|
|
|
@ -103,9 +105,9 @@
|
|
|
|
|
if (this.base.isNull(this.form.code)) {
|
|
|
|
|
this.base.toast('请输入验证码')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
let that = this
|
|
|
|
|
console.log("this.type",this.type)
|
|
|
|
|
}
|
|
|
|
|
let that = this
|
|
|
|
|
console.log("this.type", this.type)
|
|
|
|
|
this.$u.api.checkMobile({
|
|
|
|
|
mobile: this.form.mobile,
|
|
|
|
|
code: this.form.code
|
|
|
|
|
@ -114,31 +116,35 @@
|
|
|
|
|
if (that.sendTimer) {
|
|
|
|
|
clearInterval(that.sendTimer);
|
|
|
|
|
that.hasSend = false;
|
|
|
|
|
}
|
|
|
|
|
uni.removeStorageSync("stbc1_lifeData")
|
|
|
|
|
uni.setStorageSync("stbc1_lifeData", {
|
|
|
|
|
'vuex_token': res.token
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if(that.type=='course'){
|
|
|
|
|
uni.switchTab({
|
|
|
|
|
url: '/pages/course/index'
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
uni.switchTab({
|
|
|
|
|
url: '/pages/me/index'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// this.$u.api.user().then(res => {
|
|
|
|
|
// this.$u.vuex('vuex_user', res.user)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
uni.removeStorageSync("stbc1_lifeData")
|
|
|
|
|
uni.setStorageSync("stbc1_lifeData", {
|
|
|
|
|
'vuex_token': res.token
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
if (that.type == 'course') {
|
|
|
|
|
uni.switchTab({
|
|
|
|
|
url: '/pages/course/index'
|
|
|
|
|
})
|
|
|
|
|
} else if (that.isDonate) {
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/packages/donate/index'
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
uni.switchTab({
|
|
|
|
|
url: '/pages/me/index'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// this.$u.api.user().then(res => {
|
|
|
|
|
// this.$u.vuex('vuex_user', res.user)
|
|
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
toRegister(){
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url:'/packages/register/index'
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
toRegister() {
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/packages/register/index'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
@ -229,11 +235,12 @@
|
|
|
|
|
border-radius: 30rpx;
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
&-msg{
|
|
|
|
|
text-align: center;
|
|
|
|
|
padding:20rpx 0;
|
|
|
|
|
color:#0d0398;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-msg {
|
|
|
|
|
text-align: center;
|
|
|
|
|
padding: 20rpx 0;
|
|
|
|
|
color: #0d0398;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|