lin
2026-04-17 8eb6cb869fb69888abc8f99d3b1fad4fbddcdace
pages/login/login.vue
@@ -25,7 +25,7 @@
      </view>
      <view class="loginBtn">
         <view class="loginBtn-desc">
            <image @click="agreeClick" class="loginBtn-icon" :src="!loginAct ? '/static/imgs/check.png' : '/static/imgs/checked.png'" ></image>
            <image @click="agreeClick" class="loginBtn-icon" :src="!loginAct ? '/static/imgs/check.png' : '/static/imgs/checked.png'" mode=""></image>
            <text>我已阅读并同意</text>
            <text class="blue" @tap="agreeDialog1">《注册协议》</text>
            <text class="blue" @tap="agreeDialog2">《隐私政策》</text>
@@ -77,6 +77,62 @@
         agreeClick () {
            this.loginAct = !this.loginAct
         },
         // loginUser () {
         //    let t = this
         //    if(!t.loginAct) {
         //       return uni.showToast({
         //          title: '请阅读并同意协议政策',
         //          icon: 'error'
         //       })
         //    }
         //    if(t.formData.phone == '' || !t.phoneReg.test(t.formData.phone)){
         //       return uni.showToast({
         //          title: '手机号错误!',
         //          icon: 'error',
         //       })
         //    }
         //    if(t.formData.pass == '' && t.formData.loginType == 1){
         //       return uni.showToast({
         //          title: '请输入密码!',
         //          icon: 'error',
         //       })
         //    }
         //    if(t.formData.code == '' && t.formData.loginType == 2){
         //       return uni.showToast({
         //          title: '请输入验证码!',
         //          icon: 'error',
         //       })
         //    }
         //    t.$util.post('User/Login', this.formData).then(res => {
         //       if(res.code == 1) {
         //          uni.setStorageSync('pig-token', res.data.userToken)
         //          uni.setStorageSync('user-info', JSON.stringify(res.data))
         //          let isSwitch = 0
         //          let goUrl = ''
         //          if(this.backUrl == ''){
         //             isSwitch = 1
         //             goUrl = '/pages/index/index'
         //          } else {
         //             goUrl = this.backUrl
         //          }
         //          uni.showToast({
         //             title: res.msg || '登录成功'
         //          })
         //          setTimeout(() => {
         //             if(isSwitch == 1) {
         //                t.$util.goSwitch(goUrl)
         //             } else {
         //                t.$util.goPages(goUrl)
         //             }
         //          }, 1500)
         //       } else {
         //          uni.showToast({
         //             title: res.msg || '登录失败',
         //             icon: 'error'
         //          })
         //       }
         //    })
         // },
      async loginUser() {
        let t = this
@@ -115,29 +171,29 @@
          if (res.code == 1) {
            uni.setStorageSync('lzsc-token', res.data.userToken)
               uni.setStorageSync('pig-token', res.data.userToken)
            uni.setStorageSync('user-info', JSON.stringify(res.data))
            let isSwitch = 0
            let goUrl = ''
            // qxgLogin接口
            const ygxRes = await new Promise((resolve, reject) => {
              uni.request({
                url: t.$webHost + '/api/v2/auth/qxgIosUnionLogin?phone=' + t.$util.getUserInfo().phone,
                success: resolve,
                fail: reject
              })
            })
            console.log(ygxRes);
            if(!ygxRes.data.data.boughtEquity){
              goUrl = '/pages/quanyi/index'
              t.$util.goPages(goUrl)
              return
            }
               // const ygxRes = await new Promise((resolve, reject) => {
               //   uni.request({
               //    url: t.$webHost + '/api/v2/auth/qxgIosUnionLogin?phone=' + t.$util.getUserInfo().phone,
               //    success: resolve,
               //    fail: reject
               //   })
               // })
               // console.log(ygxRes);
               // if(!ygxRes.data.data.boughtEquity){
               //   goUrl = '/pages/quanyi/index'
               //   t.$util.goPages(goUrl)
               //   return
               // }
            t.qxgLogin = ygxRes.data.data
            uni.setStorageSync('qxgLogin', t.qxgLogin)
               // t.qxgLogin = ygxRes.data.data
               // uni.setStorageSync('qxgLogin', t.qxgLogin)
            if (this.backUrl == '') {
              isSwitch = 1