Browse Source

修改bug

chenrui 1 year ago
parent
commit
269bd69773

+ 16 - 1
src/views/promotionRulesManagement/promotionManagement/edit.vue

@@ -104,7 +104,13 @@
                   @change="changeVideo"
                 ></Upload>
                 <div v-else>
-                  <video width="230" height="150" controls loop controlsList="nodownload">
+                  <video
+                    ref="videoPlayer"
+                    width="230"
+                    height="150"
+                    controls
+                    loop
+                    controlsList="nodownload">
                     <source :src="form.content" type="video/mp4">
                   </video>
                 </div>
@@ -524,8 +530,17 @@ export default {
     pageInit () {
       this.pageType = this.$route.params.pageType
       if (this.pageType === 'edit' || this.pageType === 'see') {
+        this.destroyVideo()
         this.getDetail()
       }
+    },
+    // 重新加载视频
+    destroyVideo () {
+      const video = this.$refs.videoPlayer
+      if (video) {
+        video.pause() // 暂停视频
+        video.load() // 重新加载视频,以清除播放状态
+      }
     }
   },
   mounted () {

+ 1 - 1
src/views/promotionRulesManagement/promotionManagement/list.vue

@@ -116,7 +116,7 @@
                 type="link"
                 class="button-warning"
                 @click="handleRelease(record,'edit')"
-                v-if="((record.publishState=='PUBLISH'&&record.content!='/pagesB/promoDetail') || record.publishState=='CLOSE')&&$hasPermissions('B_promotionManagementContent')"
+                v-if="((record.publishState=='PUBLISH'&&record.content!='/pagesB/promoDetail')||(record.publishState=='PUBLISH'&&record.content==='/pagesB/promoDetail'&&record.dealerEditFlag==='0') || record.publishState=='CLOSE')&&$hasPermissions('B_promotionManagementContent')"
                 id="promotion-modify-btn">发布修改</a-button>
               <a-button
                 size="small"

+ 13 - 2
src/views/promotionRulesManagement/promotionManagement/setPromotion.vue

@@ -130,7 +130,7 @@
                           :disabled="disabledVal"
                           style="width:80%;"
                           type="textarea"
-                          placeholder="请输入使用说明"
+                          placeholder="请输入使用说明(最多50个字符)"
                           :maxLength="200" />
                       </a-form-model-item>
                     </a-form-model>
@@ -152,7 +152,7 @@
           :xl="24"
           v-if="sellForm.ruleBaseType!='category'">
           <a-form-model-item label="使用说明" prop="ruleExplain">
-            <a-input v-model="sellForm.ruleExplain" type="textarea" placeholder="请输入使用说明" :disabled="disabledVal" :maxLength="200" />
+            <a-input v-model="sellForm.ruleExplain" type="textarea" placeholder="请输入使用说明(最多50个字符)" :disabled="disabledVal" :maxLength="200" />
           </a-form-model-item>
         </a-col>
         <a-col :xs="24" :sm="24" :md="12" :lg="24" :xl="24">
@@ -400,6 +400,17 @@ export default {
           return false
         }
       }
+      if (this.sellForm.validType === 'FIXED') {
+        if (!this.sellForm.validStartDate || this.sellForm.validStartDate.validEndDate) {
+          this.$message.warning('请选择固定日期!')
+          return false
+        }
+      } else {
+        if (!this.sellForm.validDays) {
+          this.$message.warning('请输入有效天数!')
+          return false
+        }
+      }
       this.$refs.sellRuleForm.validate(valid => {
         if (valid) {
           callBack(valid)