|
|
|
@ -4,78 +4,78 @@
@@ -4,78 +4,78 @@
|
|
|
|
|
* 2、app.js onLaunch 的时候 Page = page |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
const originalPage = Page |
|
|
|
|
const originalPage = Page; |
|
|
|
|
|
|
|
|
|
function page(config: WechatMiniprogram.Page.Instance<WechatMiniprogram.IAnyObject, WechatMiniprogram.IAnyObject>) { |
|
|
|
|
const originalOnLoad = config.onLoad |
|
|
|
|
const originalOnLoad = config.onLoad; |
|
|
|
|
config.onLoad = function (options) { |
|
|
|
|
setImageParams(this) |
|
|
|
|
setNavBar(this) |
|
|
|
|
setImageParams(this); |
|
|
|
|
setNavBar(this); |
|
|
|
|
|
|
|
|
|
if (originalOnLoad) { |
|
|
|
|
originalOnLoad.call(this, options) |
|
|
|
|
originalOnLoad.call(this, options); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const originalOnPageScroll = config.onPageScroll |
|
|
|
|
const originalOnPageScroll = config.onPageScroll; |
|
|
|
|
config.onPageScroll = function (options): void { |
|
|
|
|
const scrollTop = options?.scrollTop |
|
|
|
|
let background = 'transparent' |
|
|
|
|
const scrollTop = options?.scrollTop; |
|
|
|
|
let background = 'transparent'; |
|
|
|
|
if (Number(scrollTop) > 20) { |
|
|
|
|
background = '#ffffff' |
|
|
|
|
background = '#ffffff'; |
|
|
|
|
} |
|
|
|
|
this.setData({ |
|
|
|
|
background, |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
if (originalOnPageScroll) { |
|
|
|
|
originalOnPageScroll.call(this, options) |
|
|
|
|
originalOnPageScroll.call(this, options); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const originalOnShareAppMessage = config.onShareAppMessage |
|
|
|
|
const originalOnShareAppMessage = config.onShareAppMessage; |
|
|
|
|
config.onShareAppMessage = function (options) { |
|
|
|
|
if (originalOnShareAppMessage) { |
|
|
|
|
return originalOnShareAppMessage.call(this, options) |
|
|
|
|
return originalOnShareAppMessage.call(this, options); |
|
|
|
|
} else { |
|
|
|
|
const date = new Date() |
|
|
|
|
const Timestamp = date.getTime() |
|
|
|
|
const date = new Date(); |
|
|
|
|
const Timestamp = date.getTime(); |
|
|
|
|
|
|
|
|
|
const pages = getCurrentPages() |
|
|
|
|
const currentPage = pages[pages.length - 1] |
|
|
|
|
const url = currentPage.route |
|
|
|
|
const options = currentPage.options |
|
|
|
|
let urlWithArgs = `${url}?` |
|
|
|
|
const pages = getCurrentPages(); |
|
|
|
|
const currentPage = pages[pages.length - 1]; |
|
|
|
|
const url = currentPage.route; |
|
|
|
|
const options = currentPage.options; |
|
|
|
|
let urlWithArgs = `${url}?`; |
|
|
|
|
for (const key in options) { |
|
|
|
|
const value = options[key] |
|
|
|
|
urlWithArgs += `${key}=${value}&` |
|
|
|
|
const value = options[key]; |
|
|
|
|
urlWithArgs += `${key}=${value}&`; |
|
|
|
|
} |
|
|
|
|
urlWithArgs = urlWithArgs.substring(0, urlWithArgs.length - 1) |
|
|
|
|
urlWithArgs = urlWithArgs.substring(0, urlWithArgs.length - 1); |
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
title: '信达', |
|
|
|
|
title: '甲状腺眼病TED规范化诊治中心', |
|
|
|
|
path: url, |
|
|
|
|
// imageUrl: `${getApp().globalData.imageUrl}1/1.png?t=${Timestamp}`,
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
config.handleMakePhoneCall = function () { |
|
|
|
|
wx.makePhoneCall({ |
|
|
|
|
phoneNumber: '4008102299', |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
return originalPage(config) |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
return originalPage(config); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function setImageParams( |
|
|
|
|
currPage: WechatMiniprogram.Page.Instance<WechatMiniprogram.IAnyObject, WechatMiniprogram.IAnyObject>, |
|
|
|
|
) { |
|
|
|
|
const date = new Date() |
|
|
|
|
const Timestamp = date.getTime() |
|
|
|
|
const date = new Date(); |
|
|
|
|
const Timestamp = date.getTime(); |
|
|
|
|
currPage.setData({ |
|
|
|
|
imageUrl: getApp().globalData.imageUrl, |
|
|
|
|
Timestamp, |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function setNavBar( |
|
|
|
@ -84,7 +84,7 @@ function setNavBar(
@@ -84,7 +84,7 @@ function setNavBar(
|
|
|
|
|
currPage.setData({ |
|
|
|
|
background: 'transparent', |
|
|
|
|
pageTop: wx.getMenuButtonBoundingClientRect().bottom, |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export default page |
|
|
|
|
export default page; |
|
|
|
|