| @@ -30,9 +30,22 @@ | |||||
| </view> | </view> | ||||
| <!-- #endif --> | <!-- #endif --> | ||||
| <!-- #ifdef MP-WEIXIN --> | |||||
| <view class="agree-row" @tap="agreed = !agreed"> | |||||
| <u-checkbox-group> | |||||
| <u-checkbox :checked="agreed" shape="circle" activeColor="#0F78E9" size="18" @change="agreed = !agreed" /> | |||||
| </u-checkbox-group> | |||||
| <text class="agree-text">请阅读并同意</text> | |||||
| <text class="link" @tap.stop="goService">《用户服务协议》</text> | |||||
| <text class="agree-text">和</text> | |||||
| <text class="link" @tap.stop="goPrivacy">《隐私政策》</text> | |||||
| </view> | |||||
| <!-- #endif --> | |||||
| <!-- #ifdef H5 --> | |||||
| <view class="tip">登录即表示同意 | <view class="tip">登录即表示同意 | ||||
| <text class="link" @tap="goPrivacy">《隐私协议》</text> | |||||
| <text class="link" @tap="goPrivacy">《隐私政策》</text> | |||||
| </view> | </view> | ||||
| <!-- #endif --> | |||||
| </view> | </view> | ||||
| </view> | </view> | ||||
| </template> | </template> | ||||
| @@ -46,6 +59,7 @@ const loading = ref(false) | |||||
| const phone = ref('') | const phone = ref('') | ||||
| const smsCode = ref('') | const smsCode = ref('') | ||||
| const countdown = ref(0) | const countdown = ref(0) | ||||
| const agreed = ref(false) | |||||
| let timer = null | let timer = null | ||||
| onUnmounted(() => { | onUnmounted(() => { | ||||
| @@ -69,6 +83,9 @@ const loginSuccess = (res) => { | |||||
| // #ifdef MP-WEIXIN | // #ifdef MP-WEIXIN | ||||
| const handleWxLogin = async () => { | const handleWxLogin = async () => { | ||||
| if (loading.value) return | if (loading.value) return | ||||
| if (!agreed.value) { | |||||
| return uni.showToast({ title: '请先阅读并同意相关协议', icon: 'none' }) | |||||
| } | |||||
| loading.value = true | loading.value = true | ||||
| try { | try { | ||||
| const code = await new Promise((resolve, reject) => { | const code = await new Promise((resolve, reject) => { | ||||
| @@ -139,6 +156,10 @@ const goPrivacy = () => { | |||||
| uni.navigateTo({ url: '/pages/content/content?key=privacy_policy' }) | uni.navigateTo({ url: '/pages/content/content?key=privacy_policy' }) | ||||
| // #endif | // #endif | ||||
| } | } | ||||
| const goService = () => { | |||||
| uni.navigateTo({ url: '/pages/content/content?key=service_policy' }) | |||||
| } | |||||
| </script> | </script> | ||||
| <style lang="scss" scoped> | <style lang="scss" scoped> | ||||
| @@ -215,6 +236,25 @@ const goPrivacy = () => { | |||||
| color: #0F78E9; | color: #0F78E9; | ||||
| } | } | ||||
| } | } | ||||
| .agree-row { | |||||
| display: flex; | |||||
| align-items: center; | |||||
| justify-content: center; | |||||
| flex-wrap: wrap; | |||||
| margin-top: 32rpx; | |||||
| .agree-text { | |||||
| font-size: 24rpx; | |||||
| color: #909399; | |||||
| margin-left: 8rpx; | |||||
| } | |||||
| .link { | |||||
| font-size: 24rpx; | |||||
| color: #0F78E9; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| .phone-form { | .phone-form { | ||||