import Vue from 'vue'
import App from './App'
import './uni.promisify.adaptor'

Vue.config.productionTip = false

App.mpType = 'app'


import store from './store';
import uView from "uview-ui";


Vue.prototype.$util = 5555
Vue.prototype.$store = store
// 获取当前完整路由
Vue.prototype.$getCurrentRoute = function () {
  var pages = getCurrentPages();
  var currentPage = pages[pages.length - 1];
  let url = currentPage.route
  let param = currentPage.options
  let arr = []
  for (let key in param) {
    if (param[key] || param[key] == 0) {
      arr.push(`${key}=${param[key]}`)
    }
  }
  console.log(url + '?' + arr.join('&'));
  return url + '?' + arr.join('&')
}

App.mpType = 'app'
Vue.use(uView);

const app = new Vue({
  ...App
})

// http接口API集中管理引入部分
import httpApi from '@/config/http.api.js'
Vue.use(httpApi, app)

app.$mount()
