Bläddra i källkod

增加轮播图

huangxiaojing 2 år sedan
förälder
incheckning
135508a666
1 ändrade filer med 9 tillägg och 13 borttagningar
  1. 9 13
      pages/activity/invite-user/guide.vue

+ 9 - 13
pages/activity/invite-user/guide.vue

@@ -1,6 +1,8 @@
 <template>
   <div class="bg2C2C2D">
-    <video v-for="item in topADList" id="ad" :key="item.id" class="w345h120" :poster="item.imgUrls[0]" :src="item.videoUrl" @click="playAd()" />
+    <v-carousel :show-arrows="false" cycle interval="3000" height="120" hide-delimiter-background class="w345h120" delimiter-icon="mdi-minus">
+      <v-carousel-item v-for="item in topADList" :key="item.id" :src="item.imgUrls[0]" @click="playAd(item)"></v-carousel-item>
+    </v-carousel>
     <div v-for="item in videoList" :key="item.plateId">
       <div class="fs16">{{item.plateName}}</div>
       <div :class="item.displayMode === 1 ? 'jjjc-list' : 'jcjc-list'">
@@ -51,6 +53,7 @@ export default {
     },
     async getAdInfoByAdPlace() {
       const data = {
+        id: 1,
         adPlace: 20,
         os: 1
       }
@@ -86,19 +89,11 @@ export default {
       }, false);
       this.submit(item, ele, 1)
     },
-    playAd(item, ele) {
-      const elVideo = document.getElementById('ad')
-      if (elVideo.requestFullscreen) {
-        elVideo.requestFullscreen()
-        elVideo.play()
-      } else if (elVideo.mozRequestFullscreen) {
-        elVideo.mozRequestFullscreen()
-        elVideo.play()
-      } else if (elVideo.webkitRequestFullscreen) {
-        elVideo.webkitRequestFullscreen()
-        elVideo.play()
+    playAd(item) {
+      this.submit(item, '', 2)
+      if (item.actionType === '1' || item.actionType === '3' || item.actionType === '4' || item.actionType === '5' || item.actionType === '6') {
+        window.location.href = item.clickUrl
       }
-      this.submit(item, ele, 2)
     },
     submit(item, ele, flag) {
       const data = flag === 1 ? { id: ele.id, plateId: item.plateId, type: flag, videoId: ele.id } : { type: 2 }
@@ -146,6 +141,7 @@ export default {
   width: 345px;
   height: 120px;
   margin: 15px;
+  border-radius: 5px;
 }
 .fs16 {
   font-weight: 500;