维基小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

39 lines
808 B

import Vue from 'vue';
import moment from 'moment';
import { http } from 'plugins/request/index';
import App from './App';
import store from './store';
Vue.config.productionTip = false;
Vue.prototype.$http = http;
Vue.prototype.$moment = moment;
moment.locale('zh-cn');
Vue.prototype.goHome = () => {
uni.reLaunch({
url: '/pages/index/index',
});
};
/**
* 打开某个页面
* @param {string} path 页面完成路径
* @param {string} query 参数字符串a=x&b=y
*/
Vue.prototype.openPage = function(path, query = '') {
let url = query ? `${path}?${query}` : path;
store.commit('user/setPagePath',url)
if(!store.state.user.userInfo) {
url = '/pages/basic-info/basic-info';
}
uni.navigateTo({ url });
};
App.mpType = 'app';
const app = new Vue({
store,
...App,
});
app.$mount();