main.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import App from './App'
  2. import Vue from 'vue'
  3. import getOpenId from './apis/utils/init.js'
  4. //import './assets/font/font.css'
  5. // #ifdef MP-WEIXIN
  6. // #endif
  7. getOpenId.init()
  8. import mixin from './apis/utils/mixin.js'
  9. Vue.prototype.jphelp = mixin
  10. //import Vconsole from 'vconsole'
  11. //import uView from "uview-ui";
  12. import uView from '@/uni_modules/uview-ui'
  13. Vue.use(uView);
  14. import {
  15. newDate,
  16. } from '@/apis/utils'
  17. Vue.mixin({
  18. updated: function() {
  19. },
  20. onReady() {
  21. },
  22. onLoad(option) {
  23. if (option.test == 'test') {
  24. //let vConsole = new Vconsole()
  25. }
  26. var sz=this.jphelp.getInterval()
  27. if(sz){
  28. sz.forEach(item=>{
  29. clearInterval(item.id)
  30. })
  31. }
  32. this.jphelp.getIntervalClear()
  33. },
  34. onShow(){
  35. },
  36. onShareTimeline(){
  37. return {
  38. title: '智泊e家',
  39. path: '/pages/index/index' ,
  40. }
  41. },
  42. onShareAppMessage(res) {
  43. if (res.from === 'button') { // 来自页面内分享按钮
  44. //.log(res.target)
  45. }
  46. return {
  47. title: '智泊e家',
  48. path: '/pages/index/index'
  49. }
  50. },
  51. methods: {
  52. distanceN(distance){
  53. if(!distance){
  54. return ''
  55. }else if(distance*1000<50){
  56. return '小于50米'
  57. }else if(distance<1){
  58. return (distance*1000).toFixed(2)+'米'
  59. }else{
  60. return distance.toFixed(2)+'公里'
  61. }
  62. },
  63. gotoUrl(url,tab) {
  64. uni.navigateTo({
  65. url: "/" + url
  66. })
  67. }
  68. }
  69. })
  70. Vue.config.productionTip = false
  71. App.mpType = 'app'
  72. const app = new Vue({
  73. ...App
  74. })
  75. app.$mount()