zhangwei
2024-09-03 376ac09a54e8c95190d06bf39f295c890829c103
src/pages/login/index.vue
@@ -7,21 +7,21 @@
         </view>
         <view class="login_btn">
            <!-- #ifdef MP-WEIXIN || MP-QQ || MP-BAIDU -->
            <button v-if="canIUseGetPhoneNumber" type="primary" class="uni-tip-button"
            <button v-if="canIUseGetPhoneNumber" class="uni-tip-button" style="backgroundColor:#fece01;borderColor:#fece01"
               @click="mobileAuthLogin">授权并登录</button>
            <button type="primary" v-else open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"
            <button style="backgroundColor:#fece01;borderColor:#fece01" v-else open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"
               class="uni-tip-button">授权并登录</button>
            <view class="no_login" @click="back">
            <view class="no_login" @click="back" style="color:#fece01;borderColor:#fece01">
               暂不授权
            </view>
            <!-- #endif  -->
            <checkbox-group @change="changeAgree">
               <view class="regisiter-agreement">
                  <label>
                     <checkbox value="1" :checked="isChecked" color="#35A6FF" style="transform:scale(0.7)" />
                     <checkbox value="1" :checked="isChecked" color="#fece01" style="transform:scale(0.7)" />
                     已阅读并同意以下协议
                     <text class="color-base-text" @click.stop="openPopup(1)">《用户服务协议》</text>和 <text
                        class="color-base-text" @click.stop="openPopup(2)">《隐私政策》</text>
                     <text class="color-base-text" @click.stop="toArticle(1)">《用户服务协议》</text>
                     <!-- 和 <text class="color-base-text" @click.stop="toArticle(2)">《隐私政策》</text> -->
                  </label>
               </view>
            </checkbox-group>
@@ -88,6 +88,7 @@
                           title: "登录成功",
                           icon: "success"
                        })
                        uni.setStorage({
                           key: 'uid',
                           data: res.data.id,
@@ -143,10 +144,17 @@
         }
      },
      methods: {
         openPopup(type) {
            this.$util.redirectTo('/otherPages/member/webView/webView', {
               link: type
            })
         toArticle(type) {
            if(type==1){
               uni.navigateTo({
                  url:'/pages/article/article'
               })
            }else{
               uni.navigateTo({
                  url:'/pages/article/privacy'
               })
            }
         },
         changeAgree(e) {
            console.log(e)
@@ -184,6 +192,9 @@
                     this.$api.CreateUser(obj).then(result => {
                        if (result.code == 1) {
                           this.$db.set('userToken', result.data.accessToken);
                           this.$api.getUser().then(res => {
                              this.$db.set('userInfo', JSON.stringify(res.data))
                           })
                           this.$util.redirectTo(
                              '/pages/index/index', {},
                              'tabbar')
@@ -213,6 +224,9 @@
               success: res => {
                  this.$api.temLogin(res.code).then((result) => {
                     if (result.code == 1) {
                        this.$api.getUser().then(res => {
                           this.$db.set('userInfo', JSON.stringify(res.data))
                        })
                        this.$db.set('userToken', result.data.accessToken);
                        this.$util.redirectTo(
                           '/pages/index/index', {},
@@ -272,7 +286,7 @@
<style lang="scss" scoped>
   .wrap {
      background: linear-gradient(to bottom, #B4DEFF, #ffffff);
      background: linear-gradient(to bottom, #fbec99, #ffffff);
      display: flex;
      align-items: center;
      flex-direction: column;
@@ -303,7 +317,7 @@
            line-height: 60rpx;
            .color-base-text {
               color: #35A6FF;
               color: #fece01;
            }
         }