123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- import Vue from 'vue'
- import App from './App'
- // 引入全局存储
- import store from './store'
- // 引入全局配置
- import $mAssetsPath from '@/config/assets.config.js';
- import $mConfig from '@/config/global.config.js';
- // 引入全局方法
- import {
- http
- } from '@/common/request/index.js';
- import {
- shopHttp
- } from '@/common/request/index-shop.js';
- import $mUtil from '@/common/util.js';
- // 全局组件
- import navbar from '@/components/hx-navbar/hx-navbar.nvue';
- import ldLoading from '@/components/ld-loading/index.vue';
- import nodata from '@/components/noData/nodata.vue';
- import loadMore from '@/components/uni-load-more/uni-load-more.vue';
- import Directives from './directives/index.js';
- import '@/common/wx/jswx.js'
- // 网络状态监听
- // uni.getNetworkType({
- // success: res => {
- // console.log(res)
- // store.dispatch('networkStateChange', res.networkType);
- // }
- // });
- // uni.onNetworkStatusChange(function (res) {
- // console.log(res+'onNetworkStatusChange')
- // store.dispatch('networkStateChange', res.networkType);
- // });
- Vue.config.ignoredElements.push('wx-open-launch-app')
- if (process.env.NODE_ENV === 'production') {
- Vue.config.productionTip = false;
- Vue.config.ignoredElements.push('wx-open-launch-app')
- // Vue.config.ignoredElements.push('wx-open-launch-weapp')
- }
- // 挂载全局自定义方法
- Vue.prototype.$store = store
- Vue.prototype.$adpid = ""
- Vue.prototype.$http = http;
- Vue.prototype.$shopHttp = shopHttp;
- Vue.prototype.$mConfig = $mConfig;
- Vue.prototype.$mAssetsPath = $mAssetsPath;
- Vue.prototype.$mUtil = $mUtil;
- Vue.component('navbar', navbar);
- Vue.component('ldLoading', ldLoading);
- Vue.component('nodata', nodata);
- Vue.component('loadMore', loadMore);
- App.mpType = 'app'
- import uView from "uview-ui";
- Vue.use(uView);
- Vue.use(Directives);
- // 保留小数点后两位
- Vue.filter('keepTwo', value => {
- return (Math.floor((value || 0) * 100) / 100).toFixed(2);
- });
- // import Vue from 'vue'
- /**
- * 注册指令
- */
- const app = new Vue({
- store,
- ...App
- })
- app.$mount()
|