优化代码

This commit is contained in:
java110 2021-11-30 19:54:57 +08:00
parent abf54b5a9a
commit 8863129d0e
4 changed files with 20 additions and 7 deletions

View File

@ -24,7 +24,7 @@
},
// upx180upx
height: {
default: 160
default: 140
}
},
data() {

View File

@ -25,7 +25,7 @@ import {getCurCommunity,recoveryCommunityInfo} from '../api/community/communityA
// 页面初始化相关
import {onLoad,getWAppId} from '../api/init/initApi.js'
import {navigateTo,navigateBack} from './vcRoute.js'
import {navigateTo,navigateBack,navigateToMall} from './vcRoute.js'
import {isEmpty} from '../utils/StringUtil.js'

View File

@ -66,13 +66,13 @@ export function navigateTo(_param, callback = () => {}) {
let noLoginFlag = false;
url.NEED_NOT_LOGIN_PAGE.forEach(item => {
if (item == _tempUrl) {
console.log('item=>',item,_tempUrl)
console.log('item=>', item, _tempUrl)
uni.navigateTo(_param);
noLoginFlag = true;
}
});
if(noLoginFlag){
return ;
if (noLoginFlag) {
return;
}
debug('vcRoute', 'navigateTo', _param);
//校验是否登录,如果没有登录跳转至温馨提示页面
@ -105,6 +105,19 @@ export function navigateTo(_param, callback = () => {}) {
});
};
/*
* 跳转功能封装
* @param {Object} _param 跳转入参
*/
export function navigateToMall(_param) {
//参数中刷入wAppId
let _url = _param.url;
uni.setStorageSync(mapping.HC_MALL_CUR_URL,_url)
uni.navigateTo({
url: '/pages/hcWebView/hcWebView?wAppId=' + getWAppId()
});
};
/**
* 返回上层页面
*/

View File

@ -93,9 +93,9 @@
selectType(index) {
let shopTypeId = this.navList[index].shopTypeId;
this.shopTypeId = shopTypeId;
this.vc.navigateTo({
this.vc.navigateToMall({
url: '/pages/market/market?typeId=' + shopTypeId
}, true)
})
},
_getCategoryList() {
let _that = this