| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- import App from './App'
- import Vue from 'vue'
- import store from './store'
- // 引入全局uView
- import uView from "@/node_modules/uview-ui";
- import {parseIDCardInfo,logout,parseText,getDictLabelName,parseIdCard,getAge,parsePhone,isEmpty,
- isLogin,navBack,navTo,getUserInfo,formatHour,dateFormatStr,registerIdCode,updateMsgDot,handleBindCompanyFsUser,
- setSource,companyUserIsLogin,checkWechatInstalled,isAndroid,isIos,loginNavTo} from './utils/common.js'
- import { showLoginPage,getRegistrationID } from './utils/login.js'
- import { formatSeconds,formatDate } from './utils/tools.js'
- import { qconfig } from './utils/config.js'
- // 时间格式化
- import timeFormat from './utils/timeFormat.js'
- //数据格式化
- import dataProcess from './utils/dataProcess.js'
- // Vuex
- import Vuex from 'vuex'
- // #ifndef VUE3
- import './uni.promisify.adaptor'
- Vue.config.productionTip = false
- App.mpType = 'app'
- // Vuex 插件注册
- Vue.use(Vuex)
- Vue.use(uView);
- Vue.prototype.$isLogin = isLogin;
- Vue.prototype.$isEmpty = isEmpty;
- Vue.prototype.$parsePhone = parsePhone;
- Vue.prototype.$showLoginPage = showLoginPage;
- Vue.prototype.$getRegistrationID = getRegistrationID;
- Vue.prototype.$navBack = navBack;
- Vue.prototype.$navTo = navTo;
- Vue.prototype.$qconfig = qconfig;
- Vue.prototype.$getAge = getAge;
- Vue.prototype.$parseIdCard = parseIdCard;
- Vue.prototype.$getDictLabelName = getDictLabelName;
- Vue.prototype.$parseText = parseText;
- Vue.prototype.$logout = logout;
- Vue.prototype.$getUserInfo = getUserInfo;
- Vue.prototype.$dateFormatStr = dateFormatStr;
- Vue.prototype.$registerIdCode = registerIdCode;
- Vue.prototype.$formatSeconds = formatSeconds;
- Vue.prototype.$formatDate = formatDate;
- Vue.prototype.$parseIDCardInfo = parseIDCardInfo;
- Vue.prototype.$timeFormat = timeFormat;
- Vue.prototype.$formatHour = formatHour;
- Vue.prototype.$dataProcess = dataProcess;
- // Vue.prototype.$updateMsgDot = updateMsgDot;
- Vue.prototype.$handleBindCompanyFsUser = handleBindCompanyFsUser;
- Vue.prototype.$setSource = setSource;
- Vue.prototype.$companyUserIsLogin = companyUserIsLogin;
- Vue.prototype.$checkWechatInstalled = checkWechatInstalled;
- Vue.prototype.$isAndroid = isAndroid;
- Vue.prototype.$isIos = isIos;
- Vue.prototype.$loginNavTo = loginNavTo;
- const app = new Vue({
- store,
- ...App
- });
- // 引入请求封装
- // require("./pages_im/util/request/index")(app);
- app.$mount()
- // #endif
- // #ifdef VUE3
- import { createSSRApp } from 'vue'
- export function createApp() {
- const app = createSSRApp(App)
- app.use(uviewPlus)
- app.use(Vuex)
- app.use(store)
- app.config.globalProperties.$toast = (options) => {
- // 创建虚拟节点
- const toastVnode = createVNode(CustomToast);
- // 挂载到DOM
- render(toastVnode, document.body);
- // 调用组件的showToast方法
- toastVnode.component.exposed.showToast(options);
- };
- app.config.globalProperties.$isLogin = isLogin
- app.config.globalProperties.$isEmpty = isEmpty
- app.config.globalProperties.$parsePhone = parsePhone
- app.config.globalProperties.$showLoginPage = showLoginPage
- app.config.globalProperties.$getRegistrationID = getRegistrationID
- app.config.globalProperties.$navBack = navBack
- app.config.globalProperties.$navTo = navTo
- app.config.globalProperties.$qconfig = qconfig
- app.config.globalProperties.$getAge = getAge
- app.config.globalProperties.$parseIdCard = parseIdCard
- app.config.globalProperties.$getDictLabelName = getDictLabelName
- app.config.globalProperties.$parseText = parseText
- app.config.globalProperties.$logout = logout,
- app.config.globalProperties.$getUserInfo = getUserInfo,
- app.config.globalProperties.$dateFormatStr = dateFormatStr,
- app.config.globalProperties.$registerIdCode = registerIdCode,
- app.config.globalProperties.$formatSeconds = formatSeconds,
- app.config.globalProperties.$formatDate = formatDate,
- app.config.globalProperties.$parseIDCardInfo = parseIDCardInfo
- app.config.globalProperties.$timeFormat = timeFormat;
- app.config.globalProperties.$formatHour = formatHour;
- app.config.globalProperties.$dataProcess = dataProcess;
- // app.config.globalProperties.$updateMsgDot = updateMsgDot;
- app.config.globalProperties.$handleBindCompanyFsUser = handleBindCompanyFsUser;
- app.config.globalProperties.$setSource = setSource;
- app.config.globalProperties.$loginNavTo = loginNavTo;
- return {
- app
- }
- }
- // #endif
|