jiangping
2024-05-16 a4945c89ee72aa8b6f2c0a75653a3256a2b30b4f
wx/pages/login/login.vue
@@ -25,6 +25,16 @@
            <u-button text="立即登录" shape="circle" color="#437CB3" size="large" @click="login"></u-button>
         </view>
      </view>
      <view class="a">
         <view style=" display: inline-flex;align-items: center;">
            <checkbox-group  @change="onCheckboxChange" >
               <checkbox    > </checkbox>
            </checkbox-group>
          我已阅读和同意《
          <view class="c" @click="goAgreement(0)" style="color: dodgerblue;cursor: pointer">服务协议</view>》和《
          <view class="c"   @click="goAgreement(1)" style="color: dodgerblue;cursor: pointer">隐私协议</view>》
          </view>
      </view>
   </view>
</template>
@@ -35,11 +45,26 @@
            backgroundImg: require('@/static/background/login_bg@2x.png'),
            from: {
               username: '',
               password: ''
               password: '',
               readed:false
            }
         };
      },
      methods: {
         onCheckboxChange(e){
             let val = e.detail.value
                if(val.length>0){
                  this.from.readed =true
                }else{
                  this.from.readed =false
                }
            console.log(this.from.readed)
         },
         goAgreement(type){
            uni.navigateTo({
               url: `/pages/login/agreement?type=${type}`
            })
         },
         login() {
            var that = this;
            if (!that.from.username) return uni.showToast({
@@ -48,6 +73,10 @@
            })
            if (!that.from.password) return uni.showToast({
               title: '请输入密码',
               icon: 'none'
            })
            if (!that.from.readed  ) return uni.showToast({
               title: '请先阅读和同意用户服务隐私协议',
               icon: 'none'
            })
            uni.login({
@@ -76,6 +105,35 @@
</script>
<style lang="scss" scoped>
   .a{
      font-size:12px;
      bottom: 10px;
      position: absolute;
      width: 100%;
      display: block;
      text-align: center;
   }
    .b{width: 12px;height: 12px;display: inline; }
    /* #ifdef MP-WEIXIN */
    checkbox {
       transform: scale(0.67);
       border-radius: 50rpx;
    }
    checkbox .wx-checkbox-input {
       border-radius: 50%;
       border-color: #AAAAAA !important;
    }
    checkbox .wx-checkbox-input.wx-checkbox-input-checked {
       background: #f50;
       border-color: #f50 !important;
       color: #fff;
    }
    /* #endif */
   .c{font-size: 12px;color:darkblue; display: inline;}
   .login {
      width: 100vw;
      height: 100vh;