points-view.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view >
  3. <swiper class="screen-swiper square-dot margin-sm" style="height: 260rpx;min-height: 268rpx;"
  4. :indicator-dots="true" :circular="true" :autoplay="true" interval="5000" duration="500">
  5. <swiper-item v-for="(item,index) in adsList" :key="index">
  6. <u-image @click="jump(item)" style="width: 100%;height: 268rpx;" :src="item.url"
  7. mode="aspectFill"></u-image>
  8. </swiper-item>
  9. </swiper>
  10. <goods :goodsList="goodsList" :activityId="activityId"></goods>
  11. <view style="height: 50rpx;">
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import goods from "@/components/goods/goods.vue"
  17. import {
  18. wx_launch
  19. } from "../../common/utils/wx_launch.js"; // 引入公共js文件
  20. export default {
  21. components: {
  22. goods
  23. },
  24. props: {
  25. activityId: {
  26. type: String,
  27. default: '',
  28. }
  29. },
  30. data() {
  31. return {
  32. goodsList: [],
  33. adsList: [],
  34. appletList: []
  35. }
  36. },
  37. created() {
  38. this.fetchGoodsList();
  39. this.fetchAds()
  40. },
  41. methods: {
  42. async fetchAds() {
  43. let res = await this.$u.api.pointsGoods.ads({
  44. activityId: this.activityId
  45. })
  46. this.adsList = res.records;
  47. },
  48. fetchGoodsList() {
  49. this.$u.api.pointsGoods.list({
  50. activityId: this.activityId
  51. }).then(res => {
  52. this.goodsList = res.records;
  53. })
  54. },
  55. jump(item) {
  56. if (item.type==0) {
  57. window.location.href=item.path
  58. return
  59. }
  60. uni.navigateTo({
  61. url: '/pages/web-view/web-view?url=' + item.path
  62. })
  63. }
  64. }
  65. }
  66. </script>
  67. <style>
  68. </style>