| @@ -30,9 +30,22 @@ | |||
| </view> | |||
| <!-- #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">登录即表示同意 | |||
| <text class="link" @tap="goPrivacy">《隐私协议》</text> | |||
| <text class="link" @tap="goPrivacy">《隐私政策》</text> | |||
| </view> | |||
| <!-- #endif --> | |||
| </view> | |||
| </view> | |||
| </template> | |||
| @@ -46,6 +59,7 @@ const loading = ref(false) | |||
| const phone = ref('') | |||
| const smsCode = ref('') | |||
| const countdown = ref(0) | |||
| const agreed = ref(false) | |||
| let timer = null | |||
| onUnmounted(() => { | |||
| @@ -69,6 +83,9 @@ const loginSuccess = (res) => { | |||
| // #ifdef MP-WEIXIN | |||
| const handleWxLogin = async () => { | |||
| if (loading.value) return | |||
| if (!agreed.value) { | |||
| return uni.showToast({ title: '请先阅读并同意相关协议', icon: 'none' }) | |||
| } | |||
| loading.value = true | |||
| try { | |||
| const code = await new Promise((resolve, reject) => { | |||
| @@ -139,6 +156,10 @@ const goPrivacy = () => { | |||
| uni.navigateTo({ url: '/pages/content/content?key=privacy_policy' }) | |||
| // #endif | |||
| } | |||
| const goService = () => { | |||
| uni.navigateTo({ url: '/pages/content/content?key=service_policy' }) | |||
| } | |||
| </script> | |||
| <style lang="scss" scoped> | |||
| @@ -215,6 +236,25 @@ const goPrivacy = () => { | |||
| 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 { | |||