123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- import Vue from 'vue'
- import store from './store'
- import App from './App'
- import * as Api from '@/common/config/caimeiApi.js'
- import * as Regs from '@/common/config/common.js'
- import validate from '@/common/utils/ys-validate.js'
- import Json from './json' //本地数据
- const userOrganizeID = 2 //组织ID
- /**
- * 示例使用了uni.scss下的变量, 除变量外已尽量移除特有语法,可直接替换为其他预处理器使用
- */
- const msg = (title, duration=1500, mask=true, icon='none')=>{
- //统一提示方便全局修改
- if(Boolean(title) === false){return;}
- uni.showToast({
- title,
- duration,
- mask,
- icon
- });
- }
- const modal = (title,content,showCancel=false,callBack) =>{
- uni.showModal({
- title,
- content,
- showCancel,
- success: function (res) {
- if (res.confirm) {
- callBack()
- }
- }
- });
- }
- const json = type=>{
- //模拟异步请求数据
- return new Promise(resolve=>{
- setTimeout(()=>{
- // console.log(resolve+'======='+type);
- resolve(Json[type]);
- }, 500)
- })
- }
- const prePage = ()=>{
- let pages = getCurrentPages();
- let prePage = pages[pages.length - 2];
- // #ifdef H5
- return prePage;
- // #endif
- return prePage.$vm;
- }
- Vue.config.productionTip = false
- Vue.prototype.$fire = new Vue();
- Vue.prototype.$store = store;
- Vue.prototype.$util = {msg, json, prePage,modal};
- Vue.prototype.userOrganizeID = userOrganizeID;
- Vue.prototype.$api = Api;
- Vue.prototype.$reg = Regs;
- Vue.prototype.$validate = validate;
- App.mpType = 'app'
- const app = new Vue({
- ...App
- })
- app.$mount()
|