wike-ad.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <view>
  3. <u-swiper v-if="homeTemplate&&homeTemplate.banner&&homeTemplate.banner.length>0" :list="homeTemplate.banner" keyName="path" easingFunction="easeOutCubic" height="120" indicator radius="10"
  4. @click="click"></u-swiper>
  5. </view>
  6. </template>
  7. <script>
  8. import {
  9. mapMutations,
  10. mapActions,
  11. mapState,
  12. mapGetters
  13. } from 'vuex';
  14. export default {
  15. name: "wike-ad",
  16. data() {
  17. return {};
  18. },
  19. computed: {
  20. ...mapGetters(['appInfo', 'homeTemplate'])
  21. },
  22. methods: {
  23. click(index) {
  24. var that = this,
  25. del = {};
  26. del = that.homeTemplate.banner[index];
  27. // console.log(del);
  28. if (del.link_type == 2) {
  29. // #ifdef MP-WEIXIN
  30. uni.navigateTo({
  31. url: '/pages/user/public/webview?url=' + escape(del.link_url)
  32. })
  33. // #endif
  34. // #ifdef H5
  35. window.location = del.link_url
  36. // #endif
  37. } else if (del.link_type == 1) {
  38. // console.log(del);
  39. uni.navigateTo({
  40. url: del.link_url,
  41. });
  42. } else if (del.link_type == 0) {
  43. uni.switchTab({
  44. url: del.link_url
  45. });
  46. } else if (del.link_type == 3) {
  47. uni.navigateToMiniProgram({
  48. appId: del.link_url,
  49. path: del.link_other,
  50. success(res) {}
  51. })
  52. }
  53. }
  54. }
  55. }
  56. </script>
  57. <style>
  58. </style>