index.vue 1.7 KB

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