1 Star 0 Fork 89

szp11 / ccm-b2b2c-uniapp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.js 943 Bytes
一键复制 编辑 原始数据 按行查看 历史
import Vue from 'vue'
import store from './store'
import App from './App'
import util from './config/util'
import * as request from './config/api'
import './components/ican-H5Api/ican-H5Api'
import Json from './Json'
const msg = (title, duration=2000, mask=false, icon='none')=>{
//统一提示方便全局修改
if(Boolean(title) === false){
return;
}
uni.showToast({
title,
duration,
mask,
icon
});
}
const json = type=>{
//模拟异步请求数据
return new Promise(resolve=>{
setTimeout(()=>{
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.$api = {msg, json, prePage,util,request};
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
Java
1
https://gitee.com/szp_gl/ccm-b2b2c-uniapp.git
git@gitee.com:szp_gl/ccm-b2b2c-uniapp.git
szp_gl
ccm-b2b2c-uniapp
ccm-b2b2c-uniapp
master

搜索帮助