Browse Source

修改封面重复问题

朱鑫波 4 năm trước cách đây
mục cha
commit
64e415fad1
1 tập tin đã thay đổi với 16 bổ sung9 xóa
  1. 16 9
      src/views/modules/kuaishouapp/newBatch/index.vue

+ 16 - 9
src/views/modules/kuaishouapp/newBatch/index.vue

@@ -1072,7 +1072,7 @@ li.chouzhen.first:before {
                     @change="changeBidMin"
                     :min="1"
                     :precision="2"
-                    :max="unitInfo.dayBudget ? unitInfo.dayBudget>3000?3000:unitInfo.dayBudget : 3000"
+                    :max="unitInfo.dayBudget ? (unitInfo.dayBudget > 3000 ? 3000 : unitInfo.dayBudget) : 3000"
                   />
                 </a-form-model-item>
               </a-col>
@@ -1085,7 +1085,7 @@ li.chouzhen.first:before {
                     @change="changeBidMax"
                     :min="1"
                     :precision="2"
-                    :max="unitInfo.dayBudget ? unitInfo.dayBudget>3000?3000:unitInfo.dayBudget : 3000"
+                    :max="unitInfo.dayBudget ? (unitInfo.dayBudget > 3000 ? 3000 : unitInfo.dayBudget) : 3000"
                   />
                 </a-form-model-item>
               </a-col>
@@ -3468,12 +3468,14 @@ export default {
           if (this.materialInfo.isMakeCover == 2) {
             this.getImageCover(this.materialInfo.materialList[i].photoArr[j].photoId).then((res) => {
               setTimeout(() => {
-                if (res.length > 0) {
-                  this.materialInfo.materialList[i].photoArr[j].image =
-                    res[i % 2 == 0 ? j % this.materialInfo.coverNumber : 7 - (j % this.materialInfo.coverNumber)]
-                  this.materialList[i].photoArr[j].image =
-                    res[i % 2 == 0 ? j % this.materialInfo.coverNumber : 7 - (j % this.materialInfo.coverNumber)]
-                }
+               if(res.length>=this.materialInfo.coverNumber){
+                this.materialInfo.materialList[i].photoArr[j].image =
+                  res[i % 2 == 0 ? j % this.materialInfo.coverNumber : (res.length-1) - (j % this.materialInfo.coverNumber)]
+                this.materialList[i].photoArr[j].image =
+                  res[i % 2 == 0 ? j % this.materialInfo.coverNumber : (res.length-1) - (j % this.materialInfo.coverNumber)]
+               }
+               
+              
 
                 this.checkMatemalVisible = false
               }, 100)
@@ -3510,7 +3512,12 @@ export default {
       return new Promise((resolve, reject) => {
         this.getAction('/cutFrame/material/queryByPhotoId', params).then((res) => {
           if (res.success) {
-            resolve(res.result)
+            var data = res.result.sort(function (a, b) {
+              return a.imageIndex - b.imageIndex
+            })
+            setTimeout(() => {
+              resolve(res.result)
+            })
           }
         })
       })