wike-ad.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. // uni.navigateTo({
  30. // url: '/pages/user/public/webview?url=' + escape(del.link_url)
  31. // })
  32. window.location = del.link_url
  33. } else if (del.link_type == 1) {
  34. // console.log(del);
  35. uni.navigateTo({
  36. url: del.link_url,
  37. });
  38. } else if (del.link_type == 0) {
  39. uni.switchTab({
  40. url: del.link_url
  41. });
  42. } else if (del.link_type == 3) {
  43. uni.navigateToMiniProgram({
  44. appId: del.link_url,
  45. path: del.link_other,
  46. success(res) {}
  47. })
  48. }
  49. }
  50. }
  51. }
  52. </script>
  53. <style>
  54. </style>