1 Star 0 Fork 2

谢红英 / ifix_wx

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.js 2.02 KB
一键复制 编辑 原始数据 按行查看 历史
import Vue from 'vue'
import App from './App'
// 环信
let WebIM = require("utils/WebIM")["default"];
let conn = {
closed: false,
curOpenOpt: {},
open(opt) {
this.curOpenOpt = opt;
WebIM.conn.open(opt);
this.closed = false;
},
reopen() {
if (this.closed) {
//this.open(this.curOpenOpt);
WebIM.conn.open(this.curOpenOpt);
this.closed = false;
}
}
};
Vue.prototype.$im = WebIM;
Vue.prototype.$conn = conn;
const msg = (title, duration=1500, 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;
}
import store from './store'
Vue.prototype.$store = store;
// import Json from './Json' //测试用数据
import req from './api/' //封装的请求
Vue.prototype.$req = req
Vue.prototype.$api = {msg, json, prePage};
import uniIcons from '@/components/uni-icons/uni-icons.vue'
Vue.component('uniIcons',uniIcons)
import bottomButton from 'components/bottom-button.vue'
Vue.component('bottom-button',bottomButton) //注册为全局button
import shopItem from 'components/shop-item.vue'
Vue.component('shop-item',shopItem)//注册全局店铺列表
import goodsItem from 'components/goods-item.vue'
Vue.component('goods-item',goodsItem)//注册全局店铺列表
import evaluationItem from 'components/evaluation-item.vue'
Vue.component('evaluation-item',evaluationItem)//注册全局精选评价列表
import titleItem from 'components/title-item.vue'
Vue.component('title-item',titleItem)//注册全局精选评价列表
import imgFile from 'components/img-file.vue'
Vue.component('img-flie',imgFile)//全局注七牛上传图
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
1
https://gitee.com/xie_hongying/ifix.git
git@gitee.com:xie_hongying/ifix.git
xie_hongying
ifix
ifix_wx
master

搜索帮助