master
lion 2 months ago
parent 494dd12e16
commit b1f696e750

@ -43,7 +43,10 @@
<view class="modal"> <view class="modal">
<u-popup v-model="showRegister" mode="bottom"> <u-popup v-model="showRegister" mode="bottom">
<view> <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 class="modal-content">
<view>如您已是我方校友请先绑定账号</view> <view>如您已是我方校友请先绑定账号</view>
<view @click="goBind" class="modal-bind"> <view @click="goBind" class="modal-bind">
@ -406,12 +409,22 @@
border-radius: 40rpx; border-radius: 40rpx;
} }
&-tip { &-tip-wrap {
text-align: center; display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx; padding: 30rpx;
}
&-tip {
font-size: 32rpx; font-size: 32rpx;
} }
&-close {
color: #409eff;
font-size: 28rpx;
}
&-content { &-content {
height: 450rpx; height: 450rpx;
padding: 0 30rpx; padding: 0 30rpx;

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

@ -164,7 +164,10 @@
<view class="modal"> <view class="modal">
<u-popup v-model="showRegister" mode="bottom"> <u-popup v-model="showRegister" mode="bottom">
<view> <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 class="modal-content">
<view>如您已是我方校友请先绑定账号</view> <view>如您已是我方校友请先绑定账号</view>
<view @click="goBind" class="modal-bind"> <view @click="goBind" class="modal-bind">
@ -239,7 +242,7 @@
} }
}, },
onLoad() { onLoad() {
}, },
onUnload() { onUnload() {
if (this.timer) { if (this.timer) {
@ -272,7 +275,7 @@
}) })
}, },
toUrl(type) { toUrl(type) {
if (type === 1 || type === 2 || type === 3) { if (type === 1 || type === 2 || type === 3|| type === 5) {
if (!this.hasMobile) { if (!this.hasMobile) {
this.base.toast("请先绑定或注册") this.base.toast("请先绑定或注册")
this.showRegister = true this.showRegister = true
@ -314,7 +317,7 @@
this.myQrcode = res.course_signs ? res.course_signs.qrcode : 'STBC' this.myQrcode = res.course_signs ? res.course_signs.qrcode : 'STBC'
this.userAvatar = res.user.headimgurl?res.user.headimgurl:'' this.userAvatar = res.user.headimgurl?res.user.headimgurl:''
if (this.base.isNull(res.user.mobile)) { if (this.base.isNull(res.user.mobile)) {
this.showRegister = true // this.showRegister = true
this.hasMobile = false this.hasMobile = false
} else { } else {
this.showRegister = false this.showRegister = false
@ -474,12 +477,22 @@
border-radius: 40rpx; border-radius: 40rpx;
} }
&-tip { &-tip-wrap {
text-align: center; display: flex;
align-items: center;
justify-content: space-between;
padding: 30rpx; padding: 30rpx;
}
&-tip {
font-size: 32rpx; font-size: 32rpx;
} }
&-close {
color: #409eff;
font-size: 28rpx;
}
&-content { &-content {
height: 450rpx; height: 450rpx;
padding: 0 30rpx; padding: 0 30rpx;

Loading…
Cancel
Save