|
|
|
|
@ -31,7 +31,10 @@
|
|
|
|
|
<view class="modal">
|
|
|
|
|
<u-popup v-model="showRegister" mode="bottom" :mask-close-able='false'>
|
|
|
|
|
<view>
|
|
|
|
|
<view class="modal-tip">提示</view>
|
|
|
|
|
<view class="modal-tip-wrap">
|
|
|
|
|
<view class="modal-tip">提示</view>
|
|
|
|
|
<view class="modal-close" @click="showRegister = false">关闭</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="modal-content">
|
|
|
|
|
<view>如您已是我方校友,请先绑定账号</view>
|
|
|
|
|
<view @click="goBind" class="modal-bind">
|
|
|
|
|
@ -157,49 +160,49 @@
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
async getToken() {
|
|
|
|
|
let that = this
|
|
|
|
|
const loginResult = await new Promise((resolve, reject) => {
|
|
|
|
|
uni.login({
|
|
|
|
|
provider: 'weixin',
|
|
|
|
|
success: (res) => {
|
|
|
|
|
resolve(res.code);
|
|
|
|
|
},
|
|
|
|
|
fail: (err) => {
|
|
|
|
|
console.error('uni.login失败:', err);
|
|
|
|
|
reject(err);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
const tokenResult = await new Promise((resolve, reject) => {
|
|
|
|
|
this.$u.api.login({
|
|
|
|
|
code: loginResult
|
|
|
|
|
}).then(res1 => {
|
|
|
|
|
console.log("res1", res1)
|
|
|
|
|
uni.setStorageSync("stbc1_lifeData", {
|
|
|
|
|
'vuex_token': res1.token
|
|
|
|
|
})
|
|
|
|
|
resolve(res1.token);
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
reject(err)
|
|
|
|
|
console.log('login-error:', JSON.stringify(err))
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
await this.$u.api.user().then(res => {
|
|
|
|
|
uni.setStorageSync("stbc1_lifeData", {
|
|
|
|
|
'vuex_token': tokenResult,
|
|
|
|
|
"vuex_user": res.user
|
|
|
|
|
})
|
|
|
|
|
this.form.username = res.user.username
|
|
|
|
|
this.form.mobile = res.user.mobile
|
|
|
|
|
this.form.company_position = res.user.company_position
|
|
|
|
|
this.form.company_name = res.user.company_name
|
|
|
|
|
if (that.base.isNull(res.user.mobile)) {
|
|
|
|
|
that.showRegister = true
|
|
|
|
|
that.hasMobile = false
|
|
|
|
|
} else {
|
|
|
|
|
that.showRegister = false
|
|
|
|
|
that.hasMobile = true
|
|
|
|
|
}
|
|
|
|
|
let that = this
|
|
|
|
|
const loginResult = await new Promise((resolve, reject) => {
|
|
|
|
|
uni.login({
|
|
|
|
|
provider: 'weixin',
|
|
|
|
|
success: (res) => {
|
|
|
|
|
resolve(res.code);
|
|
|
|
|
},
|
|
|
|
|
fail: (err) => {
|
|
|
|
|
console.error('uni.login失败:', err);
|
|
|
|
|
reject(err);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
const tokenResult = await new Promise((resolve, reject) => {
|
|
|
|
|
this.$u.api.login({
|
|
|
|
|
code: loginResult
|
|
|
|
|
}).then(res1 => {
|
|
|
|
|
console.log("res1", res1)
|
|
|
|
|
uni.setStorageSync("stbc1_lifeData", {
|
|
|
|
|
'vuex_token': res1.token
|
|
|
|
|
})
|
|
|
|
|
resolve(res1.token);
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
reject(err)
|
|
|
|
|
console.log('login-error:', JSON.stringify(err))
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
await this.$u.api.user().then(res => {
|
|
|
|
|
uni.setStorageSync("stbc1_lifeData", {
|
|
|
|
|
'vuex_token': tokenResult,
|
|
|
|
|
"vuex_user": res.user
|
|
|
|
|
})
|
|
|
|
|
this.form.username = res.user.username
|
|
|
|
|
this.form.mobile = res.user.mobile
|
|
|
|
|
this.form.company_position = res.user.company_position
|
|
|
|
|
this.form.company_name = res.user.company_name
|
|
|
|
|
if (that.base.isNull(res.user.mobile)) {
|
|
|
|
|
that.showRegister = true
|
|
|
|
|
that.hasMobile = false
|
|
|
|
|
} else {
|
|
|
|
|
that.showRegister = false
|
|
|
|
|
that.hasMobile = true
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getUserInfo() {
|
|
|
|
|
@ -218,20 +221,20 @@
|
|
|
|
|
that.hasMobile = true
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 去绑定登录
|
|
|
|
|
goBind() {
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/packages/register/login?isDonate=isDonate'
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 去注册
|
|
|
|
|
toRegister() {
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/packages/register/index?isDonate=isDonate'
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 去绑定登录
|
|
|
|
|
goBind() {
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/packages/register/login?isDonate=isDonate'
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 去注册
|
|
|
|
|
toRegister() {
|
|
|
|
|
uni.redirectTo({
|
|
|
|
|
url: '/packages/register/index?isDonate=isDonate'
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -273,48 +276,58 @@
|
|
|
|
|
border-radius: 30rpx;
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.modal {
|
|
|
|
|
::v-deep .u-drawer-bottom {
|
|
|
|
|
border-radius: 40rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-tip {
|
|
|
|
|
text-align: center;
|
|
|
|
|
padding: 30rpx;
|
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-content {
|
|
|
|
|
height: 450rpx;
|
|
|
|
|
padding: 0 30rpx;
|
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
|
|
&>view {
|
|
|
|
|
margin: 30rpx auto;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-bind {
|
|
|
|
|
width: 45%;
|
|
|
|
|
text-align: center;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
color: #fff;
|
|
|
|
|
border-radius: 30rpx;
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
background: linear-gradient(to right, #e4cdb4, #c69c6d);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-register {
|
|
|
|
|
width: 45%;
|
|
|
|
|
text-align: center;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
color: #fff;
|
|
|
|
|
border-radius: 30rpx;
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
background: linear-gradient(to right, #5e5fbc, #0d0398);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.modal {
|
|
|
|
|
::v-deep .u-drawer-bottom {
|
|
|
|
|
border-radius: 40rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-tip-wrap {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding: 30rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-tip {
|
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-close {
|
|
|
|
|
color: #409eff;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-content {
|
|
|
|
|
height: 450rpx;
|
|
|
|
|
padding: 0 30rpx;
|
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
|
|
&>view {
|
|
|
|
|
margin: 30rpx auto;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-bind {
|
|
|
|
|
width: 45%;
|
|
|
|
|
text-align: center;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
color: #fff;
|
|
|
|
|
border-radius: 30rpx;
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
background: linear-gradient(to right, #e4cdb4, #c69c6d);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-register {
|
|
|
|
|
width: 45%;
|
|
|
|
|
text-align: center;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
color: #fff;
|
|
|
|
|
border-radius: 30rpx;
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
background: linear-gradient(to right, #5e5fbc, #0d0398);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|