import Vue from 'vue' import store from './store' import App from './App' import request from './utils/request' import { checkPaginationHasMore, checkSpace, replaceConByPosition, getPartNumber, checkMobile, checkPwd, loginGoPage, formatW, checkEmail, diyNavTo, setCookie, setStoreIsCookie, isWeiXinBrower, weiXinBrowerShare, weiXinAppShare, getQueryVariable, weiXinBrowerPay, sldCommonTip, getLoginClient, formatPercent, setPointIsCookie, frequentyleClick, back, getCurLanguage, isShowTime, formatChatTime, } from './utils/common.js' const msg = (title, duration = 1500, mask = false, icon = 'none') => { //统一提示方便全局修改 if (Boolean(title) === false) { return; } uni.showToast({ title, duration, mask, icon }); } const prePage = () => { let pages = getCurrentPages(); let prePage = pages[pages.length - 2]; // // #ifdef H5 return prePage; // // #endif return prePage.$vm; } const updateToken = () => { App.methods.updateAccessToken(); } Vue.config.productionTip = false Vue.prototype.$fire = new Vue(); Vue.prototype.$store = store; Vue.prototype.$request = request; Vue.prototype.$checkPaginationHasMore = checkPaginationHasMore; Vue.prototype.$checkSpace = checkSpace; Vue.prototype.$replaceConByPosition = replaceConByPosition; Vue.prototype.$getPartNumber = getPartNumber; Vue.prototype.$checkMobile = checkMobile; Vue.prototype.$checkPwd = checkPwd; Vue.prototype.$loginGoPage = loginGoPage; Vue.prototype.$formatW = formatW; Vue.prototype.$checkEmail = checkEmail; Vue.prototype.$diyNavTo = diyNavTo; Vue.prototype.$setCookie = setCookie; Vue.prototype.$formatPercent = formatPercent; Vue.prototype.$setStoreIsCookie = setStoreIsCookie; Vue.prototype.$setPointIsCookie = setPointIsCookie; Vue.prototype.$frequentyleClick = frequentyleClick; Vue.prototype.$L = getCurLanguage; Vue.prototype.$api = { msg, prePage }; Vue.prototype.$isWeiXinBrower = isWeiXinBrower; Vue.prototype.$weiXinBrowerShare = weiXinBrowerShare; Vue.prototype.$weiXinAppShare = weiXinAppShare; Vue.prototype.$getQueryVariable = getQueryVariable; Vue.prototype.$weiXinBrowerPay = weiXinBrowerPay; Vue.prototype.$sldCommonTip = sldCommonTip; Vue.prototype.$getLoginClient = getLoginClient; Vue.prototype.$back= back; Vue.prototype.$isShowTime = isShowTime; Vue.prototype.$formatChatTime = formatChatTime; App.mpType = 'app' //全局注册组件 import loadingState from '@/components/loading-state' Vue.component('loadingState',loadingState) // import DiyTabBar from './extra/tshou/component/DiyTabBar' // Vue.component('DiyTabBar',DiyTabBar) const app = new Vue({ ...App }) app.$mount()