main.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. console.log(sz)
  29. console.log("clearIntervalclearIntervalclearIntervalclearInterval")
  30. sz.forEach(item=>{
  31. clearInterval(item.id)
  32. })
  33. }
  34. this.jphelp.getIntervalClear()
  35. },
  36. onShow(){
  37. },
  38. onShareTimeline(){
  39. return {
  40. title: '智泊e家',
  41. path: '/pages/business/main' ,
  42. }
  43. },
  44. onShareAppMessage(res) {
  45. if (res.from === 'button') { // 来自页面内分享按钮
  46. //.log(res.target)
  47. }
  48. return {
  49. title: '智泊e家',
  50. path: '/pages/business/main'
  51. }
  52. },
  53. methods: {
  54. distanceN(distance){
  55. if(!distance){
  56. return ''
  57. }else if(distance*1000<50){
  58. return '小于50米'
  59. }else if(distance<1){
  60. return (distance*1000).toFixed(2)+'米'
  61. }else{
  62. return distance.toFixed(2)+'公里'
  63. }
  64. },
  65. gotoUrl(url,isLogin) {
  66. if(isLogin){
  67. if(!this.jphelp.getPersonInfo().id){
  68. uni.showToast({
  69. title: "当前用户未登录",
  70. icon: "none"
  71. })
  72. return
  73. }
  74. }
  75. // if(url.indexOf('pages/index/lockInfo')>-1){
  76. // uni.reLaunch({
  77. // url: "/" + url
  78. // })
  79. // }else{
  80. // }
  81. uni.navigateTo({
  82. url: "/" + url
  83. })
  84. }
  85. }
  86. })
  87. Vue.config.productionTip = false
  88. App.mpType = 'app'
  89. const app = new Vue({
  90. ...App
  91. })
  92. app.$mount()