|
@@ -1,31 +1,41 @@
|
|
|
<script>
|
|
|
- const uat_URL = 'https://lese.test.sxzxyj.net/gc-channel/' // 预发布
|
|
|
- // const uat_URL = 'http://192.168.16.102:8303/gc-channel/' // 本地
|
|
|
- const pro_URL = 'https://lese.sxzxyj.net/gc-channel/' // 生产
|
|
|
- const buildType = 0 // 打包环境对应类型,1 生产 0 预发布
|
|
|
- const buildURL = buildType ? pro_URL : uat_URL // 打包后实际对应的url
|
|
|
- const envText = ['预发布环境','生产环境']
|
|
|
- const envTips = process.env.NODE_ENV == 'development' ? envText[0] : envText[buildType]
|
|
|
- console.log(process.env.NODE_ENV)
|
|
|
export default {
|
|
|
globalData: {
|
|
|
- baseUrl: process.env.NODE_ENV == 'development' ? uat_URL : buildURL,
|
|
|
+ baseUrl: '',
|
|
|
token: '',
|
|
|
version: '', // 当前版本号
|
|
|
- buildType: buildType,
|
|
|
- envTips: envTips
|
|
|
+ buildType: 'uat', // 打包环境对应类型,pro 生产 uat 预发布 dev 本地开发
|
|
|
+ envTips: '', // 环境文字提示
|
|
|
+ theme: 'default', // 主题,default
|
|
|
+ isIphoneXup: false //是否iphonex以及以上的版本
|
|
|
},
|
|
|
mounted() {
|
|
|
// 非V3模式
|
|
|
- if(this.$scope){
|
|
|
- this.$scope.globalData.token = this.$store.state.vuex_token
|
|
|
- }else{
|
|
|
+ if (this.$scope) {
|
|
|
+ this.$scope.globalData.token = this.$store.state.vuex_token;
|
|
|
+ } else {
|
|
|
// V3模式
|
|
|
- getApp({allowDefault: true}).globalData.token = this.$store.state.vuex_token
|
|
|
+ getApp({ allowDefault: true }).globalData.token = this.$store.state.vuex_token;
|
|
|
}
|
|
|
+ this.$config('init');
|
|
|
},
|
|
|
onLaunch: function() {
|
|
|
- console.log('App onLaunch')
|
|
|
+ const theme = getApp().globalData.theme
|
|
|
+ uni.setTabBarStyle({
|
|
|
+ color: this.$config("topBarTitleColors"),
|
|
|
+ selectedColor: this.$config("primaryColor"),
|
|
|
+ borderStyle: 'white'
|
|
|
+ })
|
|
|
+ uni.setTabBarItem({
|
|
|
+ "index": 0,
|
|
|
+ "iconPath": "static/"+theme+"/tabbar/record.png",
|
|
|
+ "selectedIconPath": "static/"+theme+"/tabbar/record-active.png",
|
|
|
+ })
|
|
|
+ uni.setTabBarItem({
|
|
|
+ "index": 1,
|
|
|
+ "iconPath": "static/"+theme+"/tabbar/user.png",
|
|
|
+ "selectedIconPath": "static/"+theme+"/tabbar/user-active.png",
|
|
|
+ })
|
|
|
},
|
|
|
onShow: function() {
|
|
|
console.log('App Show')
|