Commit 0a6f5abe by 李伟康

Merge branch 'develop' of http://192.168.3.233:8090/saas_plus/business-assistant into develop

2 parents d065a67c fe159e51
// components/Tab/Tab.js
// behaviors: [LocationBehavior],
import { imgUrlMixin } from '~/mixins/index'
Component({
behaviors: [imgUrlMixin],
/**
* 组件的属性列表
*/
......
import { IMG_URL } from '~/utils/constantData'
module.exports = Behavior({
data: {
IMGURL: IMG_URL
}
})
import imgUrlMixin from './imgUrl'
module.exports = {
}
\ No newline at end of file
imgUrlMixin
}
......@@ -7,6 +7,7 @@ Page({
*/
data: {
navStyle,
// IMG_URL
},
/**
......
import { IMG_URL } from '~/utils/constantData'
/**
* 执行路由前的准备工作
*/
/**处理前置钩子逻辑 */
const routerBefore = (next) => {
const routerBefore = next => {
// console.log("处理前置钩子逻辑");
next();
};
// 配置图片全局路径
let page = wx.$router.getPageInstance()
page && (page.data.IMG_URL = IMG_URL)
// page && page.setData({ IMG_URL })
// console.log()
// console.log(next)
next()
}
/**处理后置钩子逻辑 */
const routerAfter = (next) => {
const routerAfter = next => {
// console.log("处理后置钩子逻辑");
next();
};
next()
}
// 重写Page方法
const OldPage = Page;
const OldPage = Page
Page = function (options) {
const oldShow = options.onShow;
const oldHide = options.onHide;
const oldShow = options.onShow
const oldHide = options.onHide
options.onShow = function () {
routerBefore(() => {
oldShow.apply(this, arguments);
});
};
oldShow.apply(this, arguments)
})
}
options.onHide = function () {
routerAfter(() => {
oldHide.apply(this, arguments);
});
};
OldPage(options);
};
oldHide.apply(this, arguments)
})
}
OldPage(options)
}
export default routerBefore;
\ No newline at end of file
export default routerBefore
import util from '../utils/util.js'
import {
getUserInfo
} from '~/utils/cache/userInfo'
import {
IMG_URL
} from '~/utils/constantData'
// import util from '../utils/util.js'
// import {
// getUserInfo
// } from '~/utils/cache/userInfo'
/**
* wx.onAppRoute钩子方法,
......@@ -34,9 +31,7 @@ export const generateRoutList = routerList => {
if (item.parent != '__plugin__') {
obj = {
...item,
isTab: __wxConfig.tabBar.list.some(({
pagePath
}) => item.url.includes(pagePath.replace('.html', '')))
isTab: __wxConfig.tabBar.list.some(({ pagePath }) => item.url.includes(pagePath.replace('.html', '')))
}
if (item.parent !== 'pages') {
let parentList = item.url.split(`/`)
......@@ -50,4 +45,4 @@ export const generateRoutList = routerList => {
}))
} catch (err) {}
return _routerList
}
\ No newline at end of file
}
export const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/miniprogram-test/cgacar/'
export const IMG_URL = 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/'
// 缓存get方法为空的默认指定值
export const DEFAULT_GET_STORAGEKEY = ['sessionId', 'merchantId', 'userInfo']
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!