1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- import Vue from 'vue'
- import App from '@/App'
- import $store from '@/store'
- import config from "./config.js"
- Vue.prototype.$config = config
- import uView from "uview-ui";
- Vue.use(uView);
- import common from './common/util/clicks.js'
- Vue.prototype.$noMultipleClicks = common.noMultipleClicks;
- Vue.directive('throttle', {
- inserted(el, binding) {
- el.addEventListener('click', () => {
- el.style.pointerEvents = 'none'
- if (!el.disabled) {
- setTimeout(() => {
- el.style.pointerEvents = 'auto'
- }, binding.value || 2000)
- }
- })
- }
- })
- Vue.prototype.$store = $store
- Vue.prototype.$offset = function(selector) {
- return new Promise((resolve, reject) => {
- uni.createSelectorQuery().in(this).select(selector).boundingClientRect(data => {
- console.log(data,'data')
- data ? data.x = data.left + data.width / 2 : ''
- data ? data.y = data.top + data.height / 2 : ''
- data ? resolve(data) : reject('元素不存在')
- }).exec()
- })
- }
- Vue.prototype.$scrollViewHeight = function (className) {
- this.$nextTick(() => {
- const query = uni.createSelectorQuery().in(this)
- query.select(className).boundingClientRect()
- query.exec(res => this.scrollViewHeight = res[0].height)
- })
- }
- Vue.prototype.$hideLoading = function() {
- this.$nextTick(() => {
- uni.hideLoading()
- })
- }
- Vue.prototype.$drawHonour = function(ctx, infoArr) {
- console.log('infoArr',infoArr)
- ctx.setTextAlign('center')
- ctx.setFontSize(infoArr[0][0])
- ctx.fillText(infoArr[0][1], infoArr[0][2], infoArr[0][3])
- ctx.setFontSize(infoArr[1][0])
- ctx.fillText(infoArr[1][1], infoArr[1][2], infoArr[1][3])
- ctx.setFontSize(infoArr[2][0])
- ctx.fillText(infoArr[2][1], infoArr[2][2], infoArr[2][3])
- ctx.draw()
- }
- import CustomNav from './components/public/custom-nav.vue'
- import pageToast from './components/toast.vue'
- import reachBot from './components/custom-reach-bottom.vue'
- Vue.component('custom-nav', CustomNav)
- Vue.component('page-toast', pageToast)
- Vue.component('custom-reach-bottom', reachBot)
- import * as filters from '@/filters'
- Object.keys(filters).forEach(e => {
- Vue.filter(e, filters[e])
- })
- App.mpType = 'app'
- Vue.config.productionTip = false;
- (new Vue({
- ...App
- })).$mount()
|