12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- import App from './App'
- import Vue from 'vue'
- import store from './store'
- import uvUI from '@/uni_modules/uv-ui-tools'
- Vue.use(uvUI);
- uni.$uv.setConfig({
- // 修改$uv.config对象的属性
- config: {
- // 修改默认单位为rpx,相当于执行 uni.$uv.config.unit = 'rpx'
- unit: 'rpx'
- }
- })
- Vue.prototype.$store = store;
- import chat from './uitls/chat.js'
- chat.init();
- import customerServe from './uitls/customerServe.js'
- customerServe.init();
- Vue.prototype.$chat = chat;
- Vue.prototype.$customerServe = customerServe;
- Vue.prototype.$toast = msg => {
- uni.showToast({
- title: msg,
- icon: "none"
- })
- };
- Vue.prototype.$navigateTo = (url) => {
- if (!uni.getStorageSync('token') && url != '/pages/login/login') {
- url = '/pages/login/login';
- }
- uni.navigateTo({
- url: url
- })
- }
- Vue.prototype.initBadge = () => {
- if (uni.getStorageSync('chatBadge')) {
- let badge = uni.getStorageSync('chatBadge');
- if (badge === '0') {
- uni.removeTabBarBadge({
- index: 3
- })
- } else {
- uni.setTabBarBadge({
- index: 3,
- text: badge
- })
- }
- }
- }
- Vue.config.productionTip = false;
- App.mpType = 'app'
- const app = new Vue({
- ...App
- })
- app.$mount()
|