| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- import App from './App'
- //store
- import store from '@/store';
- let vuexStore = require("@/store/$u.mixin.js");
- Vue.mixin(vuexStore);
- //登录组件
- import login from "@/components/login.vue"
- Vue.component('login',login)
- //uView
- import uView from "uview-ui";
- Vue.use(uView);
- import toast from '@/components/toast/toast.vue'
- Vue.component('toast',toast)
- import loading from '@/components/loading/loading.vue'
- Vue.component('loading',loading)
- import pointAuth from '@/components/alert/pointAuth.vue'
- Vue.component('pointAuth',pointAuth)
- // util begin
- //缓存
- import simpleCache from "@/utils/cache.js"
- Vue.prototype.$cache = simpleCache
- //封装日期时间工具类
- import dateTime from 'utils/dateTime.js'
- Vue.prototype.$dateTime = dateTime
- //封装提示工具
- import dialog from 'utils/dialog.js'
- Vue.prototype.$dialog = dialog
- //数字处理
- import digital from './utils/digital.js'
- Vue.prototype.$digital = digital
- // 全局注入
- import Mixin from './utils/mixin'
- Vue.mixin(Mixin)
- // 微信函数封装
- import Mpi from './utils/mpi'
- Vue.prototype.$mpi = Mpi
- //引入工具类
- import util from 'utils/util.js'
- Vue.prototype.$util = util
- //校验文件
- import verify from 'utils/verify.js'
- Vue.prototype.$verify = verify
- //全局变量
- import global from 'utils/global.js'
- Vue.prototype.$global = global
- //util end
- import config from 'assets/http/config.js'
- Vue.prototype.$config = config
- //封装api
- import {
- api
- } from 'assets/http/api.js'
- Vue.prototype.$api = api
- //跳转
- Vue.prototype.$jump = function(url, events) {
- if(this.$isEmpty(url)){
- uni.showToast({
- title: '暂未开放',
- icon: 'none'
- });
- }
- uni.navigateTo({
- url,
- events,
- fail(err) {
- console.log(err);
- }
- })
- }
- Vue.prototype.$back = function() {
- uni.navigateBack({
- delta: 1
- })
- }
- //判空函数
- Vue.prototype.$isEmpty = function(value) {
- switch (typeof value) {
- case 'undefined':
- return true;
- case 'string':
- if (value == 'undefined') return true
- if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
- break;
- case 'boolean':
- if (!value) return true;
- break;
- case 'number':
- if (0 === value || isNaN(value)) return true;
- break;
- case 'object':
- if (null === value || value.length === 0) return true;
- for (var i in value) {
- return false;
- }
- return true;
- }
- return false;
- }
- Vue.prototype.$isNotEmpty = function(value) {
- switch (typeof value) {
- case 'undefined':
- return false;
- case 'string':
- if (value == 'undefined') return false
- if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return false;
- break;
- case 'boolean':
- if (!value) return false;
- break;
- case 'number':
- if (0 === value || isNaN(value)) return false;
- break;
- case 'object':
- if (null === value || value.length === 0) return false;
- for (var i in value) {
- return true;
- }
- return false;
- }
- return true;
- }
- // #ifndef VUE3
- import Vue from 'vue'
- Vue.config.productionTip = false
- App.mpType = 'app'
- const app = new Vue({
- store,
- ...App
- })
- app.$mount();
- // #endif
- // #ifdef VUE3
- import {
- createSSRApp
- } from 'vue'
- export function createApp() {
- const app = createSSRApp(App)
- return {
- app
- }
- }
- // #endif
|