flat: 添加config项目配置文件
This commit is contained in:
16
App.vue
16
App.vue
@@ -37,6 +37,9 @@
|
|||||||
return this.news.allUnread
|
return this.news.allUnread
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$config.showTitle && document.documentElement.style.setProperty('--hide-title', 'block');
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
allUnread(value) {
|
allUnread(value) {
|
||||||
if (!this.$store.state.user.token) {} else if (value > 0) {
|
if (!this.$store.state.user.token) {} else if (value > 0) {
|
||||||
@@ -63,7 +66,7 @@
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="scss">
|
||||||
/*每个页面公共css */
|
/*每个页面公共css */
|
||||||
/* tabbar 字体大小 */
|
/* tabbar 字体大小 */
|
||||||
/* .uni-tabbar__label{
|
/* .uni-tabbar__label{
|
||||||
@@ -75,4 +78,15 @@
|
|||||||
font-style: mormal;
|
font-style: mormal;
|
||||||
src: url('/static/font/font_2225171_8kdcwk4po24.ttf') format('truetype');
|
src: url('/static/font/font_2225171_8kdcwk4po24.ttf') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--hide-title: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* #ifdef H5 */
|
||||||
|
uni-page-head {
|
||||||
|
display: var(--hide-title);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* #endif */
|
||||||
</style>
|
</style>
|
||||||
28
config.js
Normal file
28
config.js
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
module.exports = {
|
||||||
|
baseUrl: '',
|
||||||
|
// 图片地址
|
||||||
|
imageUrl: '',
|
||||||
|
// 显示标题
|
||||||
|
showTitle: false,
|
||||||
|
// 应用信息
|
||||||
|
appInfo: {
|
||||||
|
// 应用名称
|
||||||
|
name: "",
|
||||||
|
// 应用版本
|
||||||
|
version: "1.0.0",
|
||||||
|
// 应用logo
|
||||||
|
logo: "",
|
||||||
|
// 官方网站
|
||||||
|
site_url: "",
|
||||||
|
// 政策协议
|
||||||
|
agreements: [{
|
||||||
|
title: "隐私政策",
|
||||||
|
url: ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "用户服务协议",
|
||||||
|
url: ""
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
26
main.js
26
main.js
@@ -3,6 +3,7 @@ import store from './store';
|
|||||||
import App from './App'
|
import App from './App'
|
||||||
import util from './untils/func.js'
|
import util from './untils/func.js'
|
||||||
import uView from '@/uni_modules/uview-ui'
|
import uView from '@/uni_modules/uview-ui'
|
||||||
|
import config from './config';
|
||||||
|
|
||||||
// 注册全局组件
|
// 注册全局组件
|
||||||
// import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
|
// import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
|
||||||
@@ -11,9 +12,10 @@ import uView from '@/uni_modules/uview-ui'
|
|||||||
// Vue.component('mescroll-uni', MescrollUni)
|
// Vue.component('mescroll-uni', MescrollUni)
|
||||||
|
|
||||||
import empty from '@/components/empty/empty.vue'
|
import empty from '@/components/empty/empty.vue'
|
||||||
|
|
||||||
function navTo(url, needLogin) {
|
function navTo(url, needLogin) {
|
||||||
console.log(url)
|
console.log(url)
|
||||||
if(needLogin) {
|
if (needLogin) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@@ -21,13 +23,13 @@ function navTo(url, needLogin) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const msg = (title, duration=1500, mask=false, icon='none')=>{
|
const msg = (title, duration = 1500, mask = false, icon = 'none') => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title,
|
title,
|
||||||
duration,
|
duration,
|
||||||
mask,
|
mask,
|
||||||
icon
|
icon
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 注册全局组件
|
// 注册全局组件
|
||||||
@@ -41,7 +43,10 @@ Vue.component('jl-form-item', JlFormItem)
|
|||||||
Vue.component('cs-button', CSButton)
|
Vue.component('cs-button', CSButton)
|
||||||
Vue.component('empty', empty)
|
Vue.component('empty', empty)
|
||||||
|
|
||||||
Vue.prototype.$api = { msg }
|
Vue.prototype.$api = {
|
||||||
|
msg
|
||||||
|
}
|
||||||
|
Vue.prototype.$config = config
|
||||||
Vue.prototype.navTo = navTo
|
Vue.prototype.navTo = navTo
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
|
|
||||||
@@ -50,6 +55,7 @@ Vue.use(uView)
|
|||||||
|
|
||||||
App.mpType = 'app'
|
App.mpType = 'app'
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
...App,store
|
...App,
|
||||||
|
store
|
||||||
})
|
})
|
||||||
app.$mount()
|
app.$mount()
|
||||||
Reference in New Issue
Block a user