Commit 78b14be0 authored by Facius's avatar Facius

feat: 用户协议和隐私政策

parent 0ec66805
...@@ -44,6 +44,26 @@ ...@@ -44,6 +44,26 @@
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"disableScroll": true "disableScroll": true
} }
},
{
"path": "user-agreement",
"name": "user-agreement",
"style": {
"navigationBarTitleText": "用户协议",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
}
},
{
"path": "privacy-policy",
"name": "privacy-policy",
"style": {
"navigationBarTitleText": "隐私政策",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
}
} }
] ]
}, },
......
...@@ -36,6 +36,12 @@ ...@@ -36,6 +36,12 @@
> >
绑定手机 绑定手机
</button> </button>
</view>
<view class="agreen u-flex">
<view class="check-view" @click="handleClickAgreen">
<view :class="['check-icon', {'checked': agreen}]"><u-icon v-if="agreen" name="checkmark-circle" size="30" color="#3878FF"></u-icon></view>
<view>我已阅读并同意 <text @click.stop="handleClick('user-agreement')" hover-class="u-hover-class" class="rule">《用户服务协议》</text>和<text @click.stop="handleClick('privacy-policy')" hover-class="u-hover-class" class="rule">《隐私政策》</text></view>
</view>
</view> </view>
</view> </view>
<view> <view>
...@@ -52,6 +58,7 @@ export default { ...@@ -52,6 +58,7 @@ export default {
host: '', //配置为自己的额服务器即可 host: '', //配置为自己的额服务器即可
returnUrl: '', //跳回页面 returnUrl: '', //跳回页面
needAuth: true, needAuth: true,
agreen: false
} }
}, },
computed: { computed: {
...@@ -74,6 +81,10 @@ export default { ...@@ -74,6 +81,10 @@ export default {
}, },
// 微信登录 // 微信登录
wxLogin() { wxLogin() {
if (!this.agreen) {
this.$u.toast('请阅读并同意《用户服务协议》和《隐私政策》');
return;
}
// 获取code 小程序专有,用户登录凭证。 // 获取code 小程序专有,用户登录凭证。
uni.getUserProfile({ uni.getUserProfile({
desc: '获取用户基本资料', desc: '获取用户基本资料',
...@@ -149,6 +160,10 @@ export default { ...@@ -149,6 +160,10 @@ export default {
}, },
// 绑定手机 // 绑定手机
getphonenumber(e) { getphonenumber(e) {
if (!this.agreen) {
this.$u.toast('请阅读并同意《用户服务协议》和《隐私政策》');
return;
}
if (e && e.detail) { if (e && e.detail) {
if (e.detail.errMsg.indexOf('user deny') > -1) { if (e.detail.errMsg.indexOf('user deny') > -1) {
uni.hideLoading() uni.hideLoading()
...@@ -236,11 +251,19 @@ export default { ...@@ -236,11 +251,19 @@ export default {
console.log(err) console.log(err)
}) })
}, },
handleClickAgreen() {
this.agreen = !this.agreen
},
handleClick(path) {
this.$u.route({
url: '/pages/login/' + path,
})
}
}, },
} }
</script> </script>
<style> <style scoped lang="scss">
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 0; width: 0;
height: 0; height: 0;
...@@ -266,11 +289,11 @@ export default { ...@@ -266,11 +289,11 @@ export default {
/* justify-content: center; */ /* justify-content: center; */
} }
.text-area { .text-area {
display: flex; // display: flex;
justify-content: center; // justify-content: center;
position: relative; // position: relative;
position: fixed; position: fixed;
bottom: 100rpx; bottom: 160rpx;
} }
.bottom { .bottom {
width: 600rpx; width: 600rpx;
...@@ -307,4 +330,36 @@ export default { ...@@ -307,4 +330,36 @@ export default {
.view-image { .view-image {
padding-top: 200rpx; padding-top: 200rpx;
} }
.agreen {
position: fixed;
bottom: 44rpx;
color: #8D8D8D;
font-size: 24rpx;
text-align: center;
margin-bottom: 36rpx;
justify-content: center;
margin-top: 24rpx;
.check-view {
display: flex;
justify-content: center;
align-items: center;
padding: 16rpx 20rpx;
.check-icon {
width: 28rpx;
height: 28rpx;
border: 2rpx solid #cccccc;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
margin-right: 16rpx;
&.checked {
border-width: 0;
}
}
.rule {
color: #3878FF;
}
}
}
</style> </style>
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment