fuliqi
2024-01-24 29c1e7eb5ac16e90d8991a86c1c071bc312ec8d9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<template>
  <div class="proActivityPre">
    <div class="topContent">
      <el-carousel :interval="5000" arrow="always">
        <el-carousel-item v-for="item in form.fileList" :key="item.id">
          <img :src="item.url" />
        </el-carousel-item>
      </el-carousel>
    </div>
    <div class="topContent" v-show="form.promotionRuleFile.length">
      <el-carousel :interval="5000" arrow="always">
        <el-carousel-item v-for="item in form.promotionRuleFile" :key="item.id">
          <img :src="item.url" />
        </el-carousel-item>
      </el-carousel>
    </div>
    <div v-show="form.promotionRuledesc" class="promotionRuledesc">活动规则<br/>{{form.promotionRuledesc}}</div>
    <div class="activityProd">
      <div v-for="item in form.productList" :key="item.skuId" class="prodBox">
        <img :src="item.imageUrl" />
        <div class="prodName" :title="item.spuName">{{ item.spuName }}</div>
        <div class="price">
          ¥
          {{
            item.saleMaxPrice === item.saleMinPrice
              ? item.saleMaxPrice.toFixed(2)
              : item.saleMinPrice.toFixed(2) +
                ' ~ ' +
                item.saleMaxPrice.toFixed(2)
          }}
        </div>
      </div>
    </div>
  </div>
</template>
 
<script>
import { getFileType } from '@/utils/getFileType'
export default {
  props: ['form'],
  methods: {
    // 获取文件类型
    getFileType (file) {
      return getFileType(file)
    }
  }
}
</script>
 
<style lang="scss">
.proActivityPre {
  font-size: 16px;
  width: 100%;
  .topContent {
    img {
      width: 100%;
      height: 300px;
    }
  }
  .promotionRuledesc{
    margin-top: 10px;
    font-size: 14px;
  }
  .activityProd{
    margin-top: 20px;
    .prodBox{
      width: 198px;
      display: inline-block;
      vertical-align: top;
      margin-left: 10px;
      margin-bottom: 10px;
      .prodName{
      white-space:nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      -o-text-overflow:ellipsis;
      margin-bottom: 10px;
      }
      img{
       width: 100%;
       height: 100px;
      }
    }
  }
}
</style>