123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- import Vue from 'vue'
- import App from './App'
- import store from './store'
- import TuniaoUI from 'tuniao-ui'
- Vue.use(TuniaoUI)
- import tabbar from '@/components/tabbar/tabbar.vue';
- Vue.component('tabbar', tabbar);
- import login from '@/components/login/login.vue';
- Vue.component('login', login);
- import utils from './common/js/utils';
- Vue.prototype.utils = utils;
- import adUtils from './common/js/ad';
- Vue.prototype.adUtils = adUtils;
- const app_info = require("@/static/appInfo.js");
- Vue.prototype.appInfo = app_info
- Vue.config.productionTip = false
- Vue.prototype.login = function() {
- if (!this.utils.getData('token')) {
- this.$refs.login.modal = true
- return;
- }
- }
- let api_host = app_info.api_host;
- Vue.prototype.imgUrl = api_host
- Vue.prototype.http = function(path, data, method = 'post', showLoading = true) {
- return utils.http(this, path, data, method, showLoading)
- }
- Vue.prototype.currentPage = function () {
- var pages = getCurrentPages()
- let currentRoute = pages[pages.length-1].route;
- let currentPage = pages[pages.length-1]['$page']['fullPath']
- return currentPage
- }
- Vue.filter('format_date', function(time) {
- const dateTime = new Date(time * 1000);
- const YY = dateTime.getFullYear();
- const MM =
- dateTime.getMonth() + 1 < 10 ?
- '0' + (dateTime.getMonth() + 1) :
- dateTime.getMonth() + 1;
- const D =
- dateTime.getDate() < 10 ? '0' + dateTime.getDate() : dateTime.getDate();
- const hh =
- dateTime.getHours() < 10 ?
- '0' + dateTime.getHours() :
- dateTime.getHours();
- const mm =
- dateTime.getMinutes() < 10 ?
- '0' + dateTime.getMinutes() :
- dateTime.getMinutes();
- const ss =
- dateTime.getSeconds() < 10 ?
- '0' + dateTime.getSeconds() :
- dateTime.getSeconds();
- return `${YY}-${MM}-${D} ${hh}:${mm}`
- });
- Vue.filter('format_second', function(second, tips = '不限时') {
- if (second == undefined) return ''
- if (second == 0) return tips
- let result = parseInt(second)
- let h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600);
- let m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result / 60 % 60));
- let s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60));
- let res = '';
- if(h !== '00') res += `${h}时`;
- if(m !== '00') res += `${m}分`;
- res += `${s}秒`;
- return res;
- });
- let vuexStore = require('@/store/$t.mixin.js')
- Vue.mixin(vuexStore)
- import wxShare from '@/common/mixins/share.js'
- Vue.mixin(wxShare)
- App.mpType = 'app'
- const app = new Vue({
- store,
- ...App
- })
- app.$mount()
|