Merge branch 'dev' of http://git.sinoecare.com/sinoecare/digital_village_v2/dvcp_v2_wechat_app into dev
This commit is contained in:
37
src/components/utils/PageBase.js
Normal file
37
src/components/utils/PageBase.js
Normal file
@@ -0,0 +1,37 @@
|
||||
class PageBase {
|
||||
constructor(path, vue) {
|
||||
this.path = path
|
||||
this.name = path.replace(/.*\\([^\\]+).vue/g, '$1')
|
||||
this.init(vue)
|
||||
}
|
||||
|
||||
init(vue) {
|
||||
if (/customNavigation/.test(vue)) {
|
||||
this.style = {navigationStyle: "custom"}
|
||||
} else {
|
||||
this.style = {navigationBarTitleText: this.label}
|
||||
//是否开启下拉刷新
|
||||
if (/enablePullDownRefresh/.test(vue)) {
|
||||
this.style.enablePullDownRefresh = true
|
||||
}
|
||||
//导航栏标题颜色及状态栏前景颜色,仅支持 black/white
|
||||
if (/navigationBarTextStyle/.test(vue)) {
|
||||
this.style.navigationBarTextStyle = vue.replace(/[\s\S]*(navigationBarTextStyle:.+),[\s\S]*/gm, '$1')
|
||||
}
|
||||
//导航栏背景颜色(同状态栏背景色)
|
||||
if (/navigationBarBackgroundColor/.test(vue)) {
|
||||
this.style.navigationBarBackgroundColor = vue.replace(/[\s\S]*(navigationBarBackgroundColor:.+),[\s\S]*/gm, '$1')
|
||||
}
|
||||
//下拉显示出来的窗口的背景色
|
||||
if (/backgroundColor/.test(vue)) {
|
||||
this.style.backgroundColor = vue.replace(/[\s\S]*(backgroundColor:.+),[\s\S]*/gm, '$1')
|
||||
}
|
||||
}
|
||||
if (/appName/.test(vue)) {
|
||||
let appName = vue.replace(/[\s\S]*(appName:.+),[\s\S]*/gm, '$1')
|
||||
this.label = appName.replace(/(appName:|["'])/g, '')?.trim()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = PageBase
|
||||
Reference in New Issue
Block a user