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 // components/Tab/Tab.js
// behaviors: [LocationBehavior],
import { imgUrlMixin } from '~/mixins/index'
Component({ Component({
behaviors: [imgUrlMixin],
/** /**
* 组件的属性列表 * 组件的属性列表
*/ */
......
import { IMG_URL } from '~/utils/constantData'
module.exports = Behavior({
data: {
IMGURL: IMG_URL
}
})
import imgUrlMixin from './imgUrl'
module.exports = { module.exports = {
imgUrlMixin
} }
...@@ -7,6 +7,7 @@ Page({ ...@@ -7,6 +7,7 @@ Page({
*/ */
data: { data: {
navStyle, navStyle,
// IMG_URL
}, },
/** /**
......
import { IMG_URL } from '~/utils/constantData'
/** /**
* 执行路由前的准备工作 * 执行路由前的准备工作
*/ */
/**处理前置钩子逻辑 */ /**处理前置钩子逻辑 */
const routerBefore = (next) => { const routerBefore = next => {
// console.log("处理前置钩子逻辑"); // 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("处理后置钩子逻辑"); // console.log("处理后置钩子逻辑");
next(); next()
}; }
// 重写Page方法 // 重写Page方法
const OldPage = Page; const OldPage = Page
Page = function (options) { Page = function (options) {
const oldShow = options.onShow; const oldShow = options.onShow
const oldHide = options.onHide; const oldHide = options.onHide
options.onShow = function () { options.onShow = function () {
routerBefore(() => { routerBefore(() => {
oldShow.apply(this, arguments); oldShow.apply(this, arguments)
}); })
}; }
options.onHide = function () { options.onHide = function () {
routerAfter(() => { routerAfter(() => {
oldHide.apply(this, arguments); oldHide.apply(this, arguments)
}); })
}; }
OldPage(options); OldPage(options)
}; }
export default routerBefore;
\ No newline at end of file \ No newline at end of file
export default routerBefore
import util from '../utils/util.js' // import util from '../utils/util.js'
import { // import {
getUserInfo // getUserInfo
} from '~/utils/cache/userInfo' // } from '~/utils/cache/userInfo'
import {
IMG_URL
} from '~/utils/constantData'
/** /**
* wx.onAppRoute钩子方法, * wx.onAppRoute钩子方法,
...@@ -34,9 +31,7 @@ export const generateRoutList = routerList => { ...@@ -34,9 +31,7 @@ export const generateRoutList = routerList => {
if (item.parent != '__plugin__') { if (item.parent != '__plugin__') {
obj = { obj = {
...item, ...item,
isTab: __wxConfig.tabBar.list.some(({ isTab: __wxConfig.tabBar.list.some(({ pagePath }) => item.url.includes(pagePath.replace('.html', '')))
pagePath
}) => item.url.includes(pagePath.replace('.html', '')))
} }
if (item.parent !== 'pages') { if (item.parent !== 'pages') {
let parentList = item.url.split(`/`) let parentList = item.url.split(`/`)
......
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方法为空的默认指定值 // 缓存get方法为空的默认指定值
export const DEFAULT_GET_STORAGEKEY = ['sessionId', 'merchantId', 'userInfo'] 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!