activity.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view class="activity">
  3. <web-view :webview-styles="webviewStyles" :src="activityPath"></web-view>
  4. <!-- 侧边 -->
  5. <scroll-top :isScrollTop="isScrollTop" :bottom="200"></scroll-top>
  6. </view>
  7. </template>
  8. <script>
  9. export default {
  10. data() {
  11. return {
  12. webviewStyles: {
  13. progress: {
  14. color: '#FF3333'
  15. }
  16. },
  17. productID: '',
  18. activityPath: '',
  19. isScrollTop: false,
  20. }
  21. },
  22. onLoad(option) {
  23. this.initPageFree(option.linkId, option.link)
  24. },
  25. methods: {
  26. initPageFree(linkId, link) {
  27. this.CommonService.GetPageFree({ id: linkId })
  28. .then(response => {
  29. this.activityPath = link
  30. uni.setNavigationBarTitle({ title: response.data.title })
  31. uni.setStorageSync('pageLabel', `${response.data.contentLabel}`)
  32. })
  33. .catch(error => {
  34. console.log('获取活动专题页数据异常')
  35. })
  36. }
  37. },
  38. onPageScroll(e) {
  39. //实时获取到滚动的值
  40. if (e.scrollTop > 600) {
  41. this.isScrollTop = true
  42. } else {
  43. this.isScrollTop = false
  44. }
  45. }
  46. }
  47. </script>
  48. <style lang="scss">
  49. .activity {
  50. width: 100%;
  51. height: auto;
  52. image {
  53. width: 100%;
  54. height: auto;
  55. }
  56. }
  57. </style>