import Vue from 'vue' import App from './App' import store from './store' import Cache from './utils/cache' import util from 'utils/util' import configs from './config/app.js' import * as Order from './libs/order'; import uView from "uview-ui"; Vue.use(uView); Vue.prototype.$util = util; Vue.prototype.$config = configs; Vue.prototype.$Cache = Cache; Vue.prototype.$eventHub = new Vue(); Vue.config.productionTip = false Vue.prototype.$Order = Order; // #ifdef APP-PLUS // Vue.use(uView) // uni.$u.config.unit = 'rpx' // #endif // #ifdef H5 import { parseQuery } from "./utils"; import Auth from './libs/wechat'; import { SPREAD } from './config/cache'; Vue.prototype.$wechat = Auth; let cookieName = "VCONSOLE", query = parseQuery(), urlSpread = query["spread"], vconsole = query[cookieName.toLowerCase()], md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式 TODO 芋艿:这个是啥,后面研究下 md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式 if (urlSpread !== undefined) { var spread = Cache.get(SPREAD); urlSpread = parseInt(urlSpread); if (!Number.isNaN(urlSpread) && spread !== urlSpread) { Cache.set("spread", urlSpread || 0); } else if (spread === 0 || typeof spread !== "number") { Cache.set("spread", urlSpread || 0); } } if (vconsole !== undefined) { if (vconsole === md5UnCrmeb && Cache.has(cookieName)) Cache.clear(cookieName); } else vconsole = Cache.get(cookieName); import VConsole from './components/vconsole.min.js' if (vconsole !== undefined && vconsole === md5Crmeb) { Cache.set(cookieName, md5Crmeb, 3600); let vConsole = new VConsole(); } // Auth.isWeixin() && Auth.oAuth(); // #endif App.mpType = 'app' import * as DecorateApi from '@/api/promotion/decorate.js'; DecorateApi.getDecorateComponentListByPage(1).then(res => { // TODO 芋艿:暂时写死 // uni.setNavigationBarTitle({ // title: '首页' // }) // this.$set(this, "logoUrl", 'https://static.iocoder.cn/ruoyi-vue-pro-logo.png'); // this.$set(this, "site_name", '首页'); // 将装修内容存到vuex store.commit("TEMPLATE", res.data.home); // // #ifdef H5 // this.$store.commit("SET_CHATURL", // 'https://cschat.antcloud.com.cn/index.htm?tntInstId=jm7_c46J&scene=SCE01197657'); // Cache.set('chatUrl', 'https://cschat.antcloud.com.cn/index.htm?tntInstId=jm7_c46J&scene=SCE01197657'); // // #endif // // 轮播图 // const slideShow = res.data.find(item => item.code === 'slide-show'); // if (slideShow) { // this.$set(this, "slideShows", JSON.parse(slideShow.value)); // } // // 菜单 // const menu = res.data.find(item => item.code === 'menu'); // if (menu) { // this.$set(this, "menus", JSON.parse(menu.value)); // } // // 滚动新闻 // const scrollingNews = res.data.find(item => item.code === 'scrolling-news'); // if (scrollingNews) { // this.$set(this, "scrollingNews", JSON.parse(scrollingNews.value)); // } // // 商品推荐 // const productRecommend = res.data.find(item => item.code === 'product-recommend'); // if (productRecommend) { // this.$set(this, "productRecommends", JSON.parse(productRecommend.value)); // if (this.productRecommends.length > 0) { // this.goodType = this.productRecommends[0].type // this.getGroomList(); // } // } }) const app = new Vue({ ...App, store, Cache }) app.$mount();