master
lion 2 months ago
parent 494dd12e16
commit b1f696e750

@ -43,7 +43,10 @@
<view class="modal">
<u-popup v-model="showRegister" mode="bottom">
<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">
@ -406,12 +409,22 @@
border-radius: 40rpx;
}
&-tip {
text-align: center;
&-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;

@ -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);
}
}
}

@ -164,7 +164,10 @@
<view class="modal">
<u-popup v-model="showRegister" mode="bottom">
<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">
@ -239,7 +242,7 @@
}
},
onLoad() {
},
onUnload() {
if (this.timer) {
@ -272,7 +275,7 @@
})
},
toUrl(type) {
if (type === 1 || type === 2 || type === 3) {
if (type === 1 || type === 2 || type === 3|| type === 5) {
if (!this.hasMobile) {
this.base.toast("请先绑定或注册")
this.showRegister = true
@ -314,7 +317,7 @@
this.myQrcode = res.course_signs ? res.course_signs.qrcode : 'STBC'
this.userAvatar = res.user.headimgurl?res.user.headimgurl:''
if (this.base.isNull(res.user.mobile)) {
this.showRegister = true
// this.showRegister = true
this.hasMobile = false
} else {
this.showRegister = false
@ -474,12 +477,22 @@
border-radius: 40rpx;
}
&-tip {
text-align: center;
&-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;

Loading…
Cancel
Save