修改:兑换码和邀请码扫码后的处理方式

This commit is contained in:
wuhui_zzw 2024-07-11 18:14:08 +08:00
parent f5d9288bf5
commit 99f678e3f4
2 changed files with 108 additions and 92 deletions

View File

@ -468,9 +468,12 @@
identityCurrent:{}, identityCurrent:{},
identityCurrentName: '', identityCurrentName: '',
integral_surplus: '', integral_surplus: '',
//
options: {},
} }
}, },
onLoad(options) { onLoad(options) {
this.options = options || {};
this.$nextTick(() => { this.$nextTick(() => {
this.setSwiperHeight(); // swiper this.setSwiperHeight(); // swiper
}); });
@ -490,14 +493,8 @@
this.activeRouter = '/' + curRoute this.activeRouter = '/' + curRoute
this.getNav(); this.getNav();
if (that.isLogin) { if (that.isLogin) {
this.getUserInfo(); this.init();
this.orderNum();
this.getIdentityList();
this.shareholdersIntegralInfo();
} else { } else {
// this.userInfo = {
// is_svip: 0
// }
this.orderMenu.forEach(v=>{ this.orderMenu.forEach(v=>{
v.num = 0 v.num = 0
}) })
@ -508,6 +505,19 @@
}, 500) }, 500)
}, },
methods: { methods: {
init(){
this.getUserInfo();
this.orderNum();
this.getIdentityList();
this.shareholdersIntegralInfo();
this.getMyMenus();
//
let q = this.options.q || '';
if (q) {
let params = this.$util.getUrlParams(decodeURIComponent(q));
this.scanCodeResultHandle(params);
}
},
authTo(url){ authTo(url){
if(this.isLogin){ if(this.isLogin){
uni.navigateTo({ uni.navigateTo({
@ -634,11 +644,7 @@
}, },
// //
onLoadFun(data) { onLoadFun(data) {
this.getUserInfo(); this.init();
this.getMyMenus();
this.orderNum();
this.getIdentityList();
this.shareholdersIntegralInfo();
this.isShowAuth = false; this.isShowAuth = false;
}, },
Setting: function() { Setting: function() {
@ -855,8 +861,18 @@
success(res) { success(res) {
let result = res.result || ''; let result = res.result || '';
let params = result ? _this.$util.getUrlParams(result) : {}; let params = result ? _this.$util.getUrlParams(result) : {};
let type = params.type || ''; _this.scanCodeResultHandle(params);
},
fail(res) {
console.log(res);
},
})
},
// -
scanCodeResultHandle(params){
let _this = this;
// console.log("", {result: result, params: params}) // console.log("", {result: result, params: params})
let type = params.type || '';
// //
switch (type) { switch (type) {
// //
@ -932,13 +948,10 @@
} }
});*/ });*/
break; break;
default:
_this.$util.tips({ content: '无法识别!'});
} }
}, },
fail(res) {
console.log(res);
},
})
},
// - // -
shareholdersIntegralInfo(){ shareholdersIntegralInfo(){
let _this = this; let _this = this;
@ -950,7 +963,6 @@
}, },
}, },
onPullDownRefresh: function(){ onPullDownRefresh: function(){
this.getNav(); this.getNav();

View File

@ -751,6 +751,10 @@ export default {
*/ */
// #ifdef MP // #ifdef MP
getUrlParams: function(param, k, p) { getUrlParams: function(param, k, p) {
// 清除问号前的内容
const index = param.indexOf('?');
if (index >= 0) param = param.substring(index + 1);
if (typeof param != 'string') return {}; if (typeof param != 'string') return {};
k = k ? k : '&'; //整体参数分隔符 k = k ? k : '&'; //整体参数分隔符
p = p ? p : '='; //单个参数分隔符 p = p ? p : '='; //单个参数分隔符