main.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. import App from './App'
  2. import Vue from 'vue'
  3. import getOpenId from './apis/utils/init.js'
  4. import getALIOpenId from './apis/utils/initALI.js'
  5. //import './assets/font/font/font.css'
  6. var IS_WEIXIN = /MicroMessenger/.test(window.navigator.userAgent)
  7. var IS_ALI = /AlipayClient/.test(window.navigator.userAgent)
  8. if (IS_ALI) {
  9. getALIOpenId.init()
  10. } else {
  11. getOpenId.init()
  12. }
  13. import mixin from './apis/utils/mixin.js'
  14. Vue.prototype.carhelp = mixin
  15. window.wx = {}
  16. import Vconsole from 'vconsole'
  17. //import uView from "uview-ui";
  18. import uView from '@/uni_modules/uview-ui'
  19. import router from '@/components/bobo-router'
  20. Vue.use(uView);
  21. Vue.mixin({
  22. updated: function() {
  23. },
  24. onReady() {
  25. },
  26. onLoad(option) {
  27. if (option.test == 'test') {
  28. let vConsole = new Vconsole()
  29. }
  30. var ProjectName=process.car.ProjectName;
  31. if(process.car.NODE_ENV=='dev'||process.car.NODE_ENV=='test'){
  32. ProjectName+='('+process.car.NODE_ENV+')';
  33. }
  34. if(option.otherUserId){
  35. var currentDomain = window.location.hostname;
  36. // 判断域名并显示不同的内容
  37. if (currentDomain === 'yjwg.hbjp.com.cn') {
  38. }else{
  39. }
  40. ProjectName="壹家物管服务大厅"
  41. console.log(ProjectName)
  42. }
  43. uni.setNavigationBarTitle({
  44. title:ProjectName
  45. })
  46. this.personInfo=this.carhelp.getPersonInfo();
  47. },
  48. methods: {
  49. jpAmount(amount){
  50. if(amount){
  51. return amount.toFixed(2)
  52. }else{
  53. return "0.00"
  54. }
  55. },
  56. substrDate(date){
  57. if(date){
  58. return date.substr(0,11)
  59. }
  60. return ''
  61. },
  62. gotoUrl(url) {
  63. var mod = {}
  64. mod.clickUrl = url
  65. if (mod.clickUrl == null) {
  66. } else if (mod.clickUrl.indexOf('http') == 0) {
  67. window.location = mod.clickUrl ;
  68. } else if (mod.clickUrl.indexOf('#/') == 0) {
  69. if (mod.clickUrl.indexOf("?") == -1) {
  70. mod.clickUrl += '?';
  71. }
  72. var url = mod.clickUrl.split("#")[1]
  73. //window.location = mod.clickUrl;
  74. uni.navigateTo({
  75. url: url
  76. })
  77. } else if (mod.clickUrl == '#' || mod.clickUrl == '') {
  78. } else {
  79. uni.navigateTo({
  80. url: mod.clickUrl
  81. })
  82. }
  83. }
  84. }
  85. })
  86. Vue.config.productionTip = false
  87. App.mpType = 'app'
  88. const app = new Vue({
  89. ...App
  90. })
  91. app.$mount()