activity.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view class="activity">
  3. <web-view :webview-styles="webviewStyles" :src="activityPath"></web-view>
  4. <!-- 侧边 -->
  5. <scroll-top v-if="isScrollTop"></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. console.log(option)
  24. switch(option.id){
  25. case '277':
  26. this.activityPath = 'https://static-b.caimei365.com/app/caimei-h5/html/2020/caimeih5_01.html'
  27. uni.setNavigationBarTitle({title:'三昭国际优惠'});
  28. break;
  29. case '278':
  30. this.activityPath = 'https://static-b.caimei365.com/app/caimei-h5/html/2020/caimeih5_02.html'
  31. uni.setNavigationBarTitle({title:'点斗优惠'});
  32. break;
  33. case '223':
  34. this.activityPath = 'https://static-b.caimei365.com/app/caimei-h5/html/2020/caimeih5_03.html'
  35. uni.setNavigationBarTitle({title:'品牌OEM服务'});
  36. break;
  37. }
  38. },
  39. methods:{
  40. },
  41. onPageScroll(e){//实时获取到滚动的值
  42. if(e.scrollTop>600){
  43. this.isScrollTop = true
  44. }else{
  45. this.isScrollTop = false
  46. }
  47. },
  48. }
  49. </script>
  50. <style lang="scss">
  51. .activity{
  52. width: 100%;
  53. height: auto;
  54. image{
  55. width: 100%;
  56. height: auto;
  57. }
  58. }
  59. </style>