main.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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/subpackage'
  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,isLogin) {
  64. if(isLogin){
  65. if(!this.jphelp.getPersonInfo().id){
  66. uni.showToast({
  67. title: "当前用户未登录",
  68. icon: "none"
  69. })
  70. return
  71. }
  72. }
  73. // if(url.indexOf('pages/index/lockInfo')>-1){
  74. // uni.reLaunch({
  75. // url: "/" + url
  76. // })
  77. // }else{
  78. // }
  79. uni.navigateTo({
  80. url: "/" + url
  81. })
  82. }
  83. }
  84. })
  85. Vue.config.productionTip = false
  86. App.mpType = 'app'
  87. const app = new Vue({
  88. ...App
  89. })
  90. app.$mount()