登录修改,增加登录协议等,修复拼团客服等

This commit is contained in:
hupeng
2023-10-18 11:47:09 +08:00
parent f76e2c7519
commit 829fb79e21
13 changed files with 178 additions and 129 deletions

View File

@ -5,30 +5,27 @@
v-if="!token"
class="force-login-wrap"
>
<!-- <image class="logo-bg" :src="`${$VUE_APP_RESOURCES_URL}/images/logo_bg.png`" mode="aspectFill"></image> -->
<view class="force-login__content y-f">
<open-data
class="user-avatar"
type="userAvatarUrl"
></open-data>
<open-data
class="user-name"
type="userNickName"
></open-data>
<view class="login-notice">为了提供更优质的服务请先登录</view>
<view class="force-login__content y-f">
<image src="@/static/120x120.png" style="width: 100rpx; height: 100rpx;border-radius: 100rpx;"></image>
<view class="login-notice">YSHOP电商系统</view>
<button
class="cu-btn author-btn"
open-type="getPhoneNumber"
@getphonenumber="phoneLogin"
>手机号快捷登录</button>
<!-- <button class="cu-btn author-btn" v-if="canIUseGetUserProfile" @tap="getUserInfoProfile">授权并查看</button>
<button class="cu-btn author-btn" v-else @getuserinfo="getUserInfoBtn" open-type="getUserInfo">授权并查看</button> -->
<button
class="cu-btn close-btn"
@tap="back"
>暂不登录</button>
@tap="toLogin"
>其他手机登录</button>
</view>
</view>
</view>
<view class="hint">
<radio :checked="isChecked" @tap.stop="onChange" />
我已经阅读并遵守
<text class="link" @tap="goNewsDetail(50,'用户协议')">用户协议</text>
<text class="link" @tap="goNewsDetail(49,'隐私政策')">隐私政策</text>
<!--上面协议是固定的 请添加相应id文章-->
</view>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<view class="force-login-wrap">
@ -61,7 +58,8 @@ export default {
return {
authorize: false,
canIUseGetUserProfile: false,
code: ''
code: '',
isChecked: false
}
},
computed: {
@ -88,7 +86,17 @@ export default {
},
methods: {
...mapActions(['changeAuthorization', 'setUserInfo']),
...mapMutations(['updateAuthorizationPage']),
...mapMutations(['updateAuthorizationPage']),
onChange() {
console.log('isChecked;',this.isChecked)
this.isChecked = !this.isChecked
},
goNewsDetail(id,name) {
this.$yrouter.push({
path: "/pages/shop/news/NewsDetail/index",
query: { id: id,name:name }
});
},
toLogin() {
this.$yrouter.push({
path: '/pages/user/Login/index',
@ -169,14 +177,26 @@ export default {
uni.login({
provider: provider,
success: async loginRes => {
console.log("🚀 ~ file: index.vue:171 ~ getLoginCode ~ loginRes:", loginRes)
this.code = loginRes.code
console.log("🚀 ~ file: index.vue:171 ~ getLoginCode ~ loginRes:", loginRes)
this.code = loginRes.code
//console.log('code11:',this.code)
}
})
})
},
// 微信用户手机号登录
phoneLogin(e) {
phoneLogin(e) {
console.log('code22:',e)
if(!this.isChecked) {
uni.showToast({
title: '请勾选下面协议',
icon: 'none',
duration: 2000,
})
return
}
console.log('用户微信手机号登录')
if (e.mp.detail.errMsg == 'getPhoneNumber:ok') {
console.log('wxLoginCode', this.code)
@ -229,7 +249,19 @@ export default {
}
</script>
<style lang="less">
<style lang="less">
.hint {
display: flex;
align-items: center;
justify-content: center;
padding: 20rpx 40rpx;
font-size: 25rpx;
color: #000;
.link {
color: #ff8e3c;
}
}
.container {
flex: 1;
display: flex;