import Vue from 'vue' import App from './App' import store from '@/store' import getConfig from '@/config' import {delayDel} from '@/libs/tools.js' Vue.config.productionTip = false App.mpType = 'app' import uView from "uview-ui" Vue.use(uView) let vuexStore = require("@/store/$u.mixin.js") Vue.mixin(vuexStore) //延迟执行函数 Vue.prototype.$delayDel = delayDel // 系统配置 Vue.prototype.$config = function (key) { const envText = {pro:'生产环境',dev:'开发环境',uat:'预发布环境'} const theme = getApp().globalData.theme const config = getConfig(theme) if(key == 'init'){ let buildType = getApp().globalData.buildType let baseUrl = config[buildType+'_URL'] getApp().globalData.baseUrl = baseUrl getApp().globalData.envTips = envText[buildType] } return config[key] } /** * 权限检查 */ Vue.prototype.$hasPermissions = function (value) { let isExist = false; let permissionsStr = store.state.vuex_userData.permCodes; if (permissionsStr == undefined || permissionsStr == null) { return false; } let has = permissionsStr.find(item => { return item == value }) if (has) { isExist = true; } return isExist; } /* * 提示信息 */ Vue.prototype.toashMsg = function (title,duration) { title = title == undefined ? "系统繁忙" : title; uni.showToast({ title:title, icon:'none', duration: duration||4000 }) } Vue.prototype.showLoading = function (title) { title = title == undefined ? "正在加载..." : title; uni.showLoading({ title:title, mask: true }) } const app = new Vue({ store, ...App }) app.$mount()