浏览代码

fix: 百宝箱广告位取值问题

cuiyalong 10 月之前
父节点
当前提交
b74ec61fa2
共有 1 个文件被更改,包括 13 次插入12 次删除
  1. 13 12
      apps/mobile/src/components/treasure-box/Recommend.vue

+ 13 - 12
apps/mobile/src/components/treasure-box/Recommend.vue

@@ -1,22 +1,21 @@
 <template>
   <div class="box-swipe">
-    <div class="box-swipe-skeleton" v-show="!getImages.length">
-      <van-skeleton title avatar v-for="index in getFills" :key="index">
-      </van-skeleton>
+    <div v-show="!getImages.length" class="box-swipe-skeleton">
+      <van-skeleton v-for="index in getFills" :key="index" title avatar />
     </div>
-    <div :id="'ad-' + ad" class="box-swipe-group">
+    <div :id="`ad-${ad}`" class="box-swipe-group">
       <div class="box-swipe-wrapper">
         <div
-          class="box-swipe-item clickable"
           v-for="(floor, fIndex) in getImages"
+          :id="`ad-swipe-floor-item-${floor.name || fIndex}`"
           :key="fIndex"
-          :id="'ad-swipe-floor-item-' + (floor.name || fIndex)"
+          class="box-swipe-item clickable"
           @click="open(floor)"
         >
-          <van-image fit="contain" :src="floor.pic"></van-image>
+          <van-image fit="contain" :src="floor.pic" />
           <div class="floor-text">
-            <span class="img-text">{{ floor.name }}</span>
-            <span class="img-sub-text">{{ floor.s_picalt }}</span>
+            <span class="img-text">{{ floor.title }}</span>
+            <span class="img-sub-text">{{ floor.name }}</span>
           </div>
         </div>
       </div>
@@ -25,10 +24,11 @@
 </template>
 
 <script>
-import { adConfigFormatter, callChangeTab, openLinkOfAd } from '@/utils'
 import { Image, Loading, Skeleton } from 'vant'
-import { ajaxGetAD } from '@/api/modules'
 import { mapGetters } from 'vuex'
+import { adConfigFormatter, callChangeTab, openLinkOfAd } from '@/utils'
+import { ajaxGetAD } from '@/api/modules'
+
 export default {
   name: 'SwipeBox',
   components: {
@@ -40,7 +40,7 @@ export default {
    * 组件参数
    * @typedef {object} props
    * @property {string} ad 广告位ID
-   * @property {array} images 广告位数据数组,规定长度为大于0整数
+   * @property {Array} images 广告位数据数组,规定长度为大于0整数
    */
   props: {
     ad: {
@@ -167,6 +167,7 @@ export default {
   }
 }
 </script>
+
 <style lang="scss" scoped>
 $swiper-floor-pagination-fill-color: #2abed1;
 $swiper-floor-pagination-bg-color: rgba(