chenrui 2 vuotta sitten
vanhempi
commit
2622bb6896

+ 8 - 5
src/views/promotionRulesManagement/promotionManagement/editModal.vue

@@ -131,13 +131,15 @@
         </a-form-model>
       </a-spin>
       <div class="btn-cont">
-        <a-button id="product-brand-edit-modal-back" @click="isShow = false" >取消</a-button>
+        <a-button id="product-brand-edit-modal-back" @click="isShow = false" style="margin-right:15px;">取消</a-button>
         <a-button
-          style="margin:0 15px;color: #fff;background-color: #39f;border-color: #39f;"
-          @click="handleSee">预览</a-button>
+          style="margin-right:15px;color: #fff;background-color: #39f;border-color: #39f;"
+          @click="handleSee" v-if="form.contentType !='LINK'">预览</a-button>
         <a-button type="primary" id="product-brand-edit-modal-save" @click="handleSave">确定</a-button>
       </div>
     </div>
+    <!-- 预览 -->
+    <promotion-show-modal ref="showModal" :openModal="openShowModal" @close="openShowModal = false"></promotion-show-modal>
   </a-modal>
 </template>
 
@@ -147,10 +149,11 @@ import moment from 'moment'
 import { VSelect, Upload } from '@/components'
 import Editor from '@/components/WEeditor'
 import { saveActive, promoTerminalDetail } from '@/api/promoTerminal'
+import promotionShowModal from './promotionShowModal'
 export default {
   name: 'ProductBrandEditModal',
   mixins: [commonMixin],
-  components: { VSelect, Upload, Editor },
+  components: { VSelect, Upload, Editor ,promotionShowModal},
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -217,7 +220,7 @@ export default {
   methods: {
     // 预览
     handleSee () {
-
+      this.$refs.showModal.pageInit({type:this.form.contentType,con:this.form.content})
     },
     onChange (e) {
       console.log('radio checked', e.target.value)

+ 9 - 6
src/views/promotionRulesManagement/promotionManagement/list.vue

@@ -136,13 +136,13 @@
       </s-table>
     </a-spin>
     <!-- 参与客户 -->
-    <lookUp-customers-modal ref="lookUpCustomers" :openModal="openCustomerModal" @close="openCustomerModal = false;"></lookUp-customers-modal>
+    <lookUp-customers-modal ref="lookUpCustomers" :openModal="openCustomerModal" @close="openCustomerModal = false"></lookUp-customers-modal>
     <!-- 促销描述 -->
     <promotion-desc-modal :openModal="openDescModal" :con="descCon" @close="openDescModal = false;descCon=''"></promotion-desc-modal>
     <!-- 促销展示 -->
-    <promotion-show-modal :imgList="imgsList" :openModal="openShowModal" @close="openShowModal = false"></promotion-show-modal>
+    <promotion-show-modal ref="showModal" :openModal="openShowModal" @close="openShowModal = false"></promotion-show-modal>
     <!-- 新增 -->
-    <addModal :openModal="openAddModal" :itemId="itemId" @close="openAddModal = false;itemId = ''"></addModal>
+    <addModal :openModal="openAddModal" :itemId="itemId" @close="closeAddModal" @ok="$refs.table.refresh()"></addModal>
     <!-- 促销发布 -->
     <promotion-edit-modal :pageType="pageType" :openModal="openPromotionEditModal" :itemId="itemId" @close="closePromotionEditModal" @ok="$refs.table.refresh()" />
   </a-card>
@@ -194,7 +194,6 @@ export default {
         showFlag: undefined,
         state: undefined
       },
-      imgsList: [],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
@@ -230,6 +229,10 @@ export default {
     }
   },
   methods: {
+    // 关闭添加促销活动弹窗
+    closeAddModal () {
+      this.openAddModal = false; this.itemId = ''
+    },
     // 参与经销商
     handleCustomers (row) {
       this.openCustomerModal = true
@@ -244,9 +247,9 @@ export default {
     },
     // 促销展示
     handleSaleShow (record) {
-      this.imgsList = record.imageSet
+      this.openShowModal = true
       this.$nextTick(() => {
-        this.openShowModal = true
+        this.$refs.showModal.getDetail({ sn: record.promoActiveSn })
       })
     },
     // 修改显示状态

+ 42 - 31
src/views/promotionRulesManagement/promotionManagement/promotionShowModal.vue

@@ -7,25 +7,13 @@
     :title="modalTit"
     v-model="isShow"
     @cancel="isShow=false"
-    :width="750">
-    <div class="promotionDesc-con" v-if="imgList&&imgList.length>0">
-      <a-carousel arrows>
-        <div
-          slot="prevArrow"
-          slot-scope="props"
-          class="custom-slick-arrow"
-          style="left: 10px;zIndex: 1"
-        >
-          <a-icon type="left-circle" />
-        </div>
-        <div slot="nextArrow" slot-scope="props" class="custom-slick-arrow" style="right: 10px">
-          <a-icon type="right-circle" />
-        </div>
-        <img :src="con" alt="图片走丢了" v-for="(con,i) in imgList" :key="i" />
-      </a-carousel>
+    :width="500">
+    <div class="promotionDesc-con">
+      <img src="@/assets/iphone.png" alt="图片走丢了" srcset="">
+      <div class="promotionDescCon" v-html="mainContent"></div>
     </div>
     <div class="btn-cont">
-      <!-- <a-button style="margin-right:10px;"  id="promotionDesc-modal-back" @click="isShow = false">下载图片</a-button> -->
+      <!-- <a-button id="promotionDesc-modal-back" @click="isShow = false" style="margin-right:10px;">下载图片</a-button> -->
       <a-button type="primary" id="promotionDesc-modal-back" @click="isShow = false">关闭</a-button>
     </div>
   </a-modal>
@@ -33,6 +21,7 @@
 
 <script>
 import { commonMixin } from '@/utils/mixin'
+import { promoTerminalDetail } from '@/api/promoTerminal'
 export default {
   name: 'PromotionDescModal',
   mixins: [commonMixin],
@@ -40,22 +29,26 @@ export default {
     openModal: { //  弹框显示状态
       type: Boolean,
       default: false
-    },
-    imgList: { //  弹框显示状态
-      type: Array,
-      default: function () {
-        return []
-      }
     }
   },
   data () {
     return {
       modalTit: '促销展示',
-      isShow: this.openModal //  是否打开弹框
+      isShow: this.openModal, //  是否打开弹框
+      mainContent: ''
     }
   },
   methods: {
-
+    getDetail (con) {
+      promoTerminalDetail(con).then(res => {
+        if (res.status == 200) {
+          this.mainContent = res.data.content
+        }
+      })
+    },
+    pageInit (con) {
+      this.mainContent = con
+    }
   },
   watch: {
     //  父页面传过来的弹框状态
@@ -72,17 +65,35 @@ export default {
 }
 </script>
 
-<style lang="less">
+<style lang="less" scoped>
   .promotionDesc-modal{
+    /deep/.ant-modal-body{
+       text-algin:center !important;
+    }
+
     .promotionDesc-con{
-      max-height:600px;
-      overflow-y: scroll;
+      width:340px;
+      margin:0 auto;
+      position:relative;
       img{
-         width:100%;
-          height:600px;
-         object-fit:cover;
+         width:81%;
+         height:auto;
+       }
+       .promotionDescCon{
+         position: absolute;
+         left:15%;
+         top:12.5%;
+         width: 70%;
+         max-height:420px;
+         overflow-y: scroll;
+         scrollbar-width:none;
+         -ms-overflow-style: none;
+       }
+       .promotionDescCon::-webkit-scrollbar{
+           display:none;
        }
     }
+
     .btn-cont {
       text-align: center;
       margin: 30px 0 0px;