path.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view class="activity">
  3. <!-- <image @click.stop="navToDetailPage" src="https://img.caimei365.com/group1/M00/03/9A/Cmis216Zf8GAb_UqABE6NiwUUZs004.jpg" mode="widthFix"></image> -->
  4. <web-view :webview-styles="webviewStyles" :src="activityPath"></web-view>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. data() {
  10. return {
  11. webviewStyles: {
  12. progress: {
  13. color: '#FF3333'
  14. }
  15. },
  16. productID:'',
  17. activityPath:'',
  18. type : '',
  19. }
  20. },
  21. onLoad(option) {
  22. this.type = option.type
  23. console.log(option)
  24. this.initPath(option.link)
  25. },
  26. methods:{
  27. navToDetailPage() {//跳转商品详情页
  28. this.$api.navigateTo(`/pages/goods/product?id=${this.productID}`)
  29. },
  30. initPath(path){
  31. if(this.type === '1'){
  32. let URL_CONFIG = ''
  33. if(process.env.NODE_ENV === 'development'){
  34. URL_CONFIG = 'https://www-b.caimei365.com'
  35. }
  36. this.activityPath = `${URL_CONFIG}/document/pdfdetails.html?type=1&src=${path}`
  37. console.log(this.activityPath)
  38. }else{
  39. this.activityPath = path
  40. }
  41. }
  42. }
  43. }
  44. </script>
  45. <style lang="scss">
  46. .activity{
  47. width: 100%;
  48. height: auto;
  49. image{
  50. width: 100%;
  51. height: auto;
  52. }
  53. }
  54. </style>