fix: 澜品优选iosShopUnionLogin接口对接
| | |
| | | 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 = [ |
| | | '中国工商银行', |
| | | '中国建设银行', |
| | |
| | | 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, |
| | |
| | | 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.formData.phone == '' || !t.phoneReg.test(t.formData.phone)){ |
| | | return uni.showToast({ |
| | | title: '手机号错误!', |
| | | icon: 'error', |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | |
| | | if(t.formData.pass == '' && t.formData.loginType == 1){ |
| | | return uni.showToast({ |
| | | title: '请输入密码!', |
| | | icon: 'error', |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | |
| | | if(t.formData.code == '' && t.formData.loginType == 2){ |
| | | return uni.showToast({ |
| | | title: '请输入验证码!', |
| | | icon: 'error', |
| | | icon: 'error' |
| | | }) |
| | | } |
| | | t.$util.post('User/Login', this.formData).then(res => { |
| | | |
| | | 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) |
| | |
| | | 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 |
| | |
| | | {index: 6, text: '联系客服'}, |
| | | ], |
| | | errState: '', |
| | | isShop: false, |
| | | } |
| | | }, |
| | | onLoad() { |
| | |
| | | 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 |
| | |
| | | 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, |
| | |
| | | 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, |
| | |
| | | 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' |
| | |
| | | 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, |
| | |
| | | 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; |
| | |
| | | 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) |
| | |
| | | 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; |
| | |
| | | |
| | | }, |
| | | mounted(){ |
| | | this.$refs.codeUi.open() |
| | | // this.$refs.codeUi.open() |
| | | this.windowHeight = uni.getSystemInfoSync().windowHeight; |
| | | this.interval = setInterval(() => { |
| | | let newHeight = window.innerHeight; |
| | |
| | | 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) |
| | |
| | | <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> |
| | | |
| | |
| | | |
| | | <!-- <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> |
| | |
| | | } |
| | | 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({ |