import Vue from 'vue'
import App from './App'
import qs from 'qs'

// uView组件库
import uView from '@/uni_modules/uview-ui'
Vue.use(uView)

//挂载全局http请求
import http from '@/config/requestConfig.js';
Vue.prototype.$http = http
import commonJS from '@/common/commonJS.js'
Vue.prototype.$commonJS = commonJS
//数据管理中心
import store from '@/store'
Vue.prototype.$store = store;
//权限配置中心
import base from '@/config/baseUrl.js'
Vue.prototype.$base = base;

Vue.config.productionTip = false

//判断是否登录
import { judgeLogin } from '@/config/login';
Vue.prototype.judgeLogin = judgeLogin;
Vue.prototype.isShowHtml = store.state.loadingShow;

Vue.prototype.$baseUrl = "https://api.nuttyreading.com/"
//Vue.prototype.$baseUrl = "http://192.168.110.100:9200/pb/"

//判断手机型号
uni.getSystemInfo({
	success: function (res) {
		Vue.prototype.$platform = res.platform;
		Vue.prototype.iosHidden = true;
		if (res.platform == 'ios') {
			Vue.prototype.iosHidden = false; //ios临时隐藏听书
			Vue.prototype.iosHide = true;
		} else {
			Vue.prototype.iosHide = true;
		}
	}
})

import commonGoodsNav from '@/pages/component/commonComponents/goodsNav.vue'
Vue.component('common-goods-nav', commonGoodsNav);
import commonList from '@/pages/component/commonComponents/list.vue'
Vue.component('common-list', commonList);
import commonOrderSubmit from '@/pages/component/commonComponents/orderSubmit.vue'
Vue.component('common-order-submit', commonOrderSubmit);
import commonSelectGoods from '@/pages/component/commonComponents/selectGoods.vue'
Vue.component('common-select-goods', commonSelectGoods);
import commonAnchorLink from '@/pages/component/commonComponents/anchorLink.vue'
Vue.component('common-anchor-link', commonAnchorLink);

import commonVideo from '@/pages/component/commonComponents/video.vue'
Vue.component('common-video', commonVideo);
import commonCurriculumVideo from '@/pages/component/commonComponents/curriculumVideo.vue'
Vue.component('common-curriculum-video', commonCurriculumVideo);
import commonRichDetail from '@/pages/component/commonComponents/richDetail.vue'
Vue.component('common-rich-detail', commonRichDetail);
import commonVideoAudio from '@/pages/component/commonComponents/audio.vue'
Vue.component('common-list-audio', commonVideoAudio);
import commonVideoAliyun from '@/pages/component/commonComponents/AliPlayer.vue'
Vue.component('common-list-aliyun', commonVideoAliyun);

import commonSticky from '@/pages/component/commonComponents/sticky.vue'
Vue.component('common-sticky', commonSticky);

App.mpType = 'app'
const app = new Vue({
	store,
  ...App
})
app.$mount()