lin
2026-04-27 e649747b2c454f0d2cb18edc9c8e1b41363e0d65
fix: 澜品优选iosShopUnionLogin接口对接
10 files modified
233 ■■■■ changed files
main.js 4 ●●●● patch | view | raw | blame | history
pages/idcard/idcard.vue 2 ●●● patch | view | raw | blame | history
pages/login/login.vue 198 ●●●● patch | view | raw | blame | history
pages/my/my.vue 5 ●●●●● patch | view | raw | blame | history
pages/my/my_bak.vue 2 ●●● patch | view | raw | blame | history
pages/profile/profile.vue 4 ●●●● patch | view | raw | blame | history
pages/quanshou/index.vue 8 ●●●● patch | view | raw | blame | history
pages/quanyi/add.vue 2 ●●● patch | view | raw | blame | history
pages/quanyi/index.vue 6 ●●●● patch | view | raw | blame | history
pages/regist/regist.vue 2 ●●● patch | view | raw | blame | history
main.js
@@ -11,6 +11,10 @@
Vue.prototype.$webHost = 'https://rbb98765.zrgy-bbg.com'
Vue.prototype.$util = util
Vue.prototype.$baseUrl = 'https://lp1994.lpyx.top'
console.log('NODE_ENV',process.env.NODE_ENV)
if(process.env.NODE_ENV === 'development') {
    Vue.prototype.$webHost = 'https://test-skfq.zrgy-bbg.com'
}
Vue.prototype.$bank = [
    '中国工商银行',
    '中国建设银行',
pages/idcard/idcard.vue
@@ -228,7 +228,7 @@
                    success: (chooseImageRes) => {
                        t.is_choose = true
                        let tempFilePaths = chooseImageRes.tempFilePaths
                        let token = uni.getStorageSync('lzsc-token')
                        let token = uni.getStorageSync('pig-token')
                        let header = {
                            'Accept': 'application/json',
                            'authorization': token,
pages/login/login.vue
@@ -77,61 +77,161 @@
            agreeClick () {
                this.loginAct = !this.loginAct
            },
            loginUser () {
            // 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
                if(!t.loginAct) {
                    return uni.showToast({
                        title: '请阅读并同意协议政策',
                        icon: 'error'
                    })
                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.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.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',
                    })
                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'
                        })
                try {
                  // 登录接口
                  const res = await t.$util.post('User/Login', this.formData)
                  if (res.code == 1) {
                    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/iosShopUnionLogin?phone=' + t.$util.getUserInfo().phone+'&configureToDomain=10',
                        success: resolve,
                        fail: reject
                      })
                    })
                    console.log(ygxRes);
                    if(!ygxRes.data.data.boughtEquity){
                      goUrl = '/pages/quanyi/index'
                      // t.$util.goPages(goUrl)
                      uni.navigateTo({
                        url: '/pages/quanyi/index'
                      })
                      return
                    }
                })
                    t.ygxLogin = ygxRes.data.data
                    uni.setStorageSync('ygxLogin', t.ygxLogin)
                    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'
                    })
                  }
                } catch (err) {
                  console.error(err)
                  uni.showToast({
                    title: '请求失败',
                    icon: 'error'
                  })
                }
            },
            sendCode () {
                let t = this
pages/my/my.vue
@@ -158,6 +158,7 @@
                    {index: 6, text: '联系客服'},
                ],
                errState: '',
                isShop: false,
            }
        },
        onLoad() {
@@ -168,7 +169,7 @@
              const _this = this;
              if(_this.$util.getUserInfo()?.phone){
                uni.request({
                  url: _this.$webHost+'/api/v2/auth/qxgIosUnionLogin?phone='+_this.$util.getUserInfo().phone,
                  url: _this.$webHost+'/api/v2/auth/iosShopUnionLogin?phone='+_this.$util.getUserInfo().phone + '&configureToDomain=10',
                  data:{
                    customerId: uni.getStorageSync('ygxLogin').customerId,
                    appId: uni.getStorageSync('ygxLogin').appId
@@ -250,7 +251,7 @@
                    sizeType: ['original', 'compressed'],
                    success: (chooseImageRes) => {
                        let tempFilePaths = chooseImageRes.tempFilePaths
                        let token = uni.getStorageSync('lzsc-token')
                        let token = uni.getStorageSync('pig-token')
                        let header = {
                            'Accept': 'application/json',
                            'authorization': token,
pages/my/my_bak.vue
@@ -160,7 +160,7 @@
                    sizeType: ['original', 'compressed'],
                    success: (chooseImageRes) => {
                        let tempFilePaths = chooseImageRes.tempFilePaths
                        let token = uni.getStorageSync('lzsc-token')
                        let token = uni.getStorageSync('pig-token')
                        let header = {
                            'Accept': 'application/json',
                            'authorization': token,
pages/profile/profile.vue
@@ -137,7 +137,7 @@
                                        title: res.msg || ''
                                    })
                                    setTimeout(() => {
                                        uni.setStorageSync('lzsc-token', null)
                                        uni.setStorageSync('pig-token', null)
                                        uni.setStorageSync('user-info', null)
                                        uni.navigateTo({
                                            url: '/pages/login/login'
@@ -190,7 +190,7 @@
                    sizeType: ['original', 'compressed'],
                    success: (chooseImageRes) => {
                        let tempFilePaths = chooseImageRes.tempFilePaths
                        let token = uni.getStorageSync('lzsc-token')
                        let token = uni.getStorageSync('pig-token')
                        let header = {
                            'Accept': 'application/json',
                            'authorization': token,
pages/quanshou/index.vue
@@ -66,7 +66,7 @@
    const _this = this;
    this.isAgree = uni.getStorageSync('boughtEquity')
    uni.request({
      url: _this.$webHost+'/api/v2/customer/getRyxBenefitsRecordList?phone='+uni.getStorageSync('phone')+'&appId='+'47be9559-6b1b-42dd-84ed-25d028065013',
      url: _this.$webHost+'/api/v2/customer/getRyxBenefitsRecordList?phone='+_this.$util.getUserInfo().phone+'&appId='+'47be9559-6b1b-42dd-84ed-25d028065013',
      success: function (res) {
        if(res.data.code==200){
          _this.lst = res.data.data;
@@ -109,11 +109,11 @@
    toHuiyuan(){
      const _this = this;
      uni.request({
        url: _this.$webHost+'/api/v2/memberEquity/getUrlByShop/'+uni.getStorageSync('phone'),
        url: _this.$webHost+'/api/v2/memberEquity/getUrlByShop/'+_this.$util.getUserInfo().phone,
        success: function (res) {
          if(res.data.code==200){
            uni.request( {
              url: _this.$webHost+'/api/v2/memberEquity/clickUrlByShop/'+uni.getStorageSync('phone'),
              url: _this.$webHost+'/api/v2/memberEquity/clickUrlByShop/'+_this.$util.getUserInfo().phone,
            })
            uni.navigateTo( {
              url: '/pages/users/web_page/index?webUel=' + encodeURIComponent(res.data.data.url)
@@ -134,7 +134,7 @@
    getTips(){
      const _this = this;
      uni.request({
        url: _this.$webHost+'/api/v2/shop/findExpressNo?phone='+uni.getStorageSync('phone'),
        url: _this.$webHost+'/api/v2/shop/findExpressNo?phone='+_this.$util.getUserInfo().phone,
        success: function (res) {
          if(res.data.code==200){
            _this.tips = res.data.data;
pages/quanyi/add.vue
@@ -171,7 +171,7 @@
  },
  mounted(){
      this.$refs.codeUi.open()
      // this.$refs.codeUi.open()
    this.windowHeight = uni.getSystemInfoSync().windowHeight;
    this.interval = setInterval(() => {
      let newHeight = window.innerHeight;
pages/quanyi/index.vue
@@ -11,7 +11,7 @@
    const _this = this;
    await uni.request({
      // url: _this.$webHost+'/api/v2/auth/ygxLogin?phone='+_this.$util.getUserInfo().phone+'&appId='+'47be9559-6b1b-42dd-84ed-25d028065013',
        url: _this.$webHost + '/api/v2/auth/qxgIosUnionLogin?phone=' + _this.$util.getUserInfo().phone,
        url: _this.$webHost + '/api/v2/auth/iosShopUnionLogin?phone=' + _this.$util.getUserInfo().phone + '&configureToDomain=10',
      success: function (res) {
        _this.ygxLogin = res.data.data;
        uni.setStorageSync('ygxLogin',_this.ygxLogin)
@@ -182,7 +182,7 @@
              <text style="color: #20110E;">我已阅读并同意</text>
          </uv-checkbox>
        </uv-checkbox-group>
        <text style="display: inline;font-size: 24rpx;color: #4766FE" @click="link(`/pages/web/xieyi?code=${memberPeriodConfigInfo.protocolCode}&title=${memberPeriodConfigInfo.protocolName}`)">《会员权益服务协议-星享购》</text>
        <text style="display: inline;font-size: 24rpx;color: #4766FE" @click="link(`/pages/web/xieyi?code=${memberPeriodConfigInfo.protocolCode}&title=${memberPeriodConfigInfo.protocolName}`)">{{memberPeriodConfigInfo.protocolName}}</text>
      </view>
    </view>
@@ -303,7 +303,7 @@
      <!--      <view style="text-align: center;display: flex;flex-direction: row;justify-content: center"><text @click="submit(false)" style="color: #666666;margin-bottom: 20rpx;font-size: 28rpx">不同意</text></view>-->
    </view>
    <textBox v-if="showTextBox" ref="textBox" :code="memberPeriodConfigInfo.protocolCode" :title="memberPeriodConfigInfo.protocolName"></textBox>
    <!-- <textBox v-if="showTextBox" ref="textBox" :code="memberPeriodConfigInfo.protocolCode" :title="memberPeriodConfigInfo.protocolName"></textBox> -->
  </view>
  </view>
</template>
pages/regist/regist.vue
@@ -109,7 +109,7 @@
                }
                t.$util.post('User/register', this.formData).then(res => {
                    if(res.code == 1) {
                        uni.setStorageSync('user-token', res.data.userToken)
                        uni.setStorageSync('pig-token', res.data.userToken)
                        uni.setStorageSync('user-info', JSON.stringify(res.data))
                        uni.showToast({