perry-mall/main.js

114 lines
3.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import Vue from 'vue'
import App from './App'
import statusNav from './components/status-nav.vue';//引入状态栏组件
Vue.component('status-nav',statusNav)//全局注册状态栏组件
import footTab from './components/foot-tab.vue';//引入底部tab组件
Vue.component('foot-tab',footTab)//全局注册底部tab组件
import backTop from './components/backTop.vue';//引入返回顶部组件
Vue.component('back-top',backTop)//全局注册返回顶部组件
import catePu from './components/cate-items/cate-pu.vue';//引入分类组件
Vue.component('cate-pu',catePu)//全局注册分类组件
import listPu from './components/list-pu.vue';//引入视频、图片列表组件
Vue.component('list-pu',listPu)//全局注册视频、图片列表组件
import pupo from './components/pupo.vue';//引入弹框组件
Vue.component('pu-po',pupo)//全局注册弹框组件
import nothingPage from './components/nothing-page.vue'//引入无内容组件
Vue.component('nothing-page',nothingPage)//全局注册无内容组件
import publicCustomer from './components/public-customer.vue'//引入客服组件
Vue.component('public-customer',publicCustomer)//全局注册客服组件
import authPhone from './components/auth-phone.vue'//引入手机授权组件
Vue.component('auth-phone',authPhone)//全局注册手机授权组件
import empower from './components/empower.vue'//引入用户授权组件
Vue.component('empower',empower)//全局注册用户授权组件
import authUserInfoMobile from './components/auth-userInfo-mobile.vue'//引入授权用户信息,授权手机号组件
Vue.component('auth-userInfo-mobile',authUserInfoMobile)//全局注册授权用户信息,授权手机号组件
// 全局注册分享事件
import share from './jsFile/share.js'
Vue.mixin(share)
// 常用工具
import tools from '@/jsFile/tools.js'
Vue.prototype.$toolAll = tools;
// 响应数据
import requst from '@/jsFile/requst.js'
Vue.prototype.$requst = requst;
// 域名专治后台仔没有返回http/https的图片
// Vue.prototype.$http = 'https://hm.hmzfyy.cn'
Vue.prototype.$http = 'https://oss.hmzfyy.cn';
Vue.prototype.$hostapi = 'https://hengmei.scdxtc.cn/api/';
const {log} = console;
Vue.prototype.log = log;
// 动态获取手机电量栏,并设置状态栏高度
Vue.prototype.statusBarH = function(){
uni.getSystemInfo({
success: (e) => {
// 定义电量栏
let statusBar = 0;
// 定义状态栏
let customBar = 0;
// #ifdef APP-PLUS
// app时执行
// 设置电量栏高度
Vue.prototype.statusBar = e.statusBarHeight;
// 设置状态栏高度
Vue.prototype.customBar = e.statusBarHeight + 45;
// #endif
// 网页
// #ifdef H5
statusBar = 0
customBar = e.statusBarHeight + 45
// #endif
// 小程序
// #ifdef MP
statusBar = e.statusBarHeight
customBar = e.statusBarHeight + 45
if (e.platform === 'android') {
this.$store.commit('SET_SYSTEM_IOSANDROID', false)
customBar = e.statusBarHeight + 50
}
// #endif
// 微信小程序
// #ifdef MP-WEIXIN
statusBar = e.statusBarHeight;
// @ts-ignore
const custom = wx.getMenuButtonBoundingClientRect()
customBar = custom.bottom + custom.top - e.statusBarHeight;
// #endif
// 这里你可以自己决定存放方式建议放在store中因为store是实时变化的
uni.setStorageSync('statusBar',statusBar);
uni.setStorageSync('customBar',customBar);
// 全局配置域名
uni.setStorageSync('hostapi',`https://hengmei.scdxtc.cn/api/`);
}
})
}
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()