index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view class="content">
  3. <web-view :webview-styles="webviewStyles"
  4. :src="to_url"
  5. @message="getMessage"></web-view>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. data() {
  11. return {
  12. webviewStyles: {
  13. progress: {
  14. color: '#FF3333'
  15. }
  16. },
  17. to_url: '',
  18. }
  19. },
  20. onLoad(options) {
  21. // jzg-7kP9xL2mN5vQ8zR1jW ,晋掌柜
  22. // gyy-aB4cD6eF8gH0iJ2kL4 ,广誉源
  23. // bdsh-X9yZ1wV3uT5sR7qP9o ,本地生活
  24. let currentPlatform = 'gyy-aB4cD6eF8gH0iJ2kL4';// 当前平台
  25. // let currentUser = '2043971820430372866'
  26. let currentUser = '2049045470263193601'// 当前用户id
  27. let tenantId = '2049045470263193601'// 晋掌柜 租户id 需要传不需要不传
  28. let activityId = '2029805805219950593';// 当前活动id
  29. // this.to_url = 'http://192.168.5.21:8080/custh5/#/packageF/pages/activity/lottery/turntable?activityId='+ activityId + '&currentPlatform='+currentPlatform+'&currentUser='+currentUser;
  30. this.to_url = 'https://life.baoxianzhanggui.com/custh5/#/packageF/pages/activity/lottery/turntable?activityId='+ activityId + '&currentPlatform='+currentPlatform+'&currentUser='+currentUser+'&tenantId='+tenantId;
  31. },
  32. methods: {
  33. // 这个 getMessage 在 H5 下其实不会被调到,可以保留给 App/小程序用
  34. getMessage(event) {
  35. console.log("🚀 ~ event:", event)
  36. const list = event.detail && event.detail.data
  37. const urlType = list && list[list.length - 1]
  38. switch (urlType && urlType.type) {
  39. case 'back':
  40. uni.navigateBack()
  41. break
  42. default:
  43. }
  44. }
  45. }
  46. }
  47. </script>
  48. <style lang="scss" scoped>
  49. </style>