123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <template>
- <a-modal
- centered
- class="promotionDesc-modal"
- :footer="null"
- :maskClosable="false"
- :title="modalTit"
- v-model="isShow"
- @cancel="isShow=false"
- :width="500">
- <div class="promotionDesc-con">
- <img src="@/assets/iphone.png" alt="图片走丢了" srcset="">
- <div class="promotionDescCon" v-show="showType=='IMAGE_CONTENT'" v-html="mainContent"></div>
- <div class="promotionDescCon" v-show="showType=='VIDEO'">
- <video width="100%" height="auto">
- <source :src="mainContent" type="video/mp4"></source>
- </video>
- </div>
- </div>
- <div class="btn-cont">
- <!-- <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>
- </template>
- <script>
- import { commonMixin } from '@/utils/mixin'
- import { promoTerminalDetail } from '@/api/promoTerminal'
- export default {
- name: 'PromotionDescModal',
- mixins: [commonMixin],
- props: {
- openModal: { // 弹框显示状态
- type: Boolean,
- default: false
- }
- },
- data () {
- return {
- modalTit: '促销展示',
- isShow: this.openModal, // 是否打开弹框
- mainContent: '', // 主要显示内容
- showType: undefined//
- }
- },
- methods: {
- getDetail (con) {
- const ajaxData = {
- id: con.id
- }
- this.showType = con.showType
- promoTerminalDetail(ajaxData).then(res => {
- if (res.status == 200) {
- this.mainContent = res.data.content
- }
- })
- }
- },
- watch: {
- // 父页面传过来的弹框状态
- openModal (newValue, oldValue) {
- this.isShow = newValue
- },
- // 重定义的弹框状态
- isShow (newValue, oldValue) {
- if (!newValue) {
- this.$emit('close')
- }
- }
- }
- }
- </script>
- <style lang="less" scoped>
- .promotionDesc-modal{
- /deep/.ant-modal-body{
- text-algin:center !important;
- }
- .promotionDesc-con{
- width:340px;
- margin:0 auto;
- position:relative;
- img{
- 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;
- }
- }
- </style>
|