main.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import App from './App'
  2. import request from 'utils/request.js' //引入异步请求函数
  3. import share from '@/utils/share.js'
  4. Vue.mixin(share)
  5. // #ifndef VUE3
  6. import Vue from 'vue'
  7. // uview
  8. import uView from '@/uni_modules/uview-ui'
  9. Vue.use(uView)
  10. // Vue.prototype.request = request.request //挂载到全局
  11. // let imgurldev = 'http://localhost:8083'
  12. let imgurl = 'https://ga.rasmall.cn/prod-api'
  13. Vue.prototype.myimgurl = function () {
  14. return imgurl;
  15. };
  16. Vue.config.productionTip = false
  17. App.mpType = 'app'
  18. const app = new Vue({
  19. ...App
  20. })
  21. let adlist = [
  22. {
  23. bannerAd: 'adunit-3187490d80ba92ca',//Banner广告
  24. gridAd: 'adunit-26da28df208c002c',//原生广告
  25. videoAd: 'adunit-e3777ebcaaad92af',//视频广告
  26. awardAd: 'adunit-c6b420834b40ddbb',//激励式广告
  27. plaqueAd: 'adunit-67e3b026600b6582',//插屏广告
  28. }
  29. ]
  30. function myad(){
  31. return adlist;
  32. }
  33. function jump(url){
  34. uni.navigateTo({
  35. url: url
  36. });
  37. }
  38. // function GoLogin(url){
  39. // uni.redirectTo({
  40. // url: '/pages/login/login'
  41. // });
  42. // uni.switchTab({
  43. // url: '/pages/index/index'
  44. // });
  45. // }
  46. function Godetails(v,url){
  47. console.log(JSON.stringify(v))
  48. uni.navigateTo({
  49. url:url+'?params='+ JSON.stringify(v)
  50. })
  51. }
  52. function ZH(json){
  53. return JSON.parse(json)
  54. }
  55. function mes(str){
  56. uni.showToast({
  57. title:str,
  58. icon:'none'
  59. })
  60. }
  61. Vue.prototype.jump = jump;
  62. Vue.prototype.myad = myad;
  63. Vue.prototype.mes = mes;
  64. Vue.prototype.Godetails = Godetails;
  65. Vue.prototype.ZH = ZH;
  66. app.$mount()
  67. // #endif
  68. // #ifdef VUE3
  69. import { createSSRApp } from 'vue'
  70. export function createApp() {
  71. const app = createSSRApp(App)
  72. return {
  73. app
  74. }
  75. }
  76. // #endif