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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<template>
    <div class="productContentBox">
       <div class="topContent">
           <el-carousel :interval="5000" arrow="always">
              <el-carousel-item v-for="(item,index) in form.images" :key="index">
                  <video v-show='getFileType(item.imgUrl) === "video"' controls :src="item.imgUrl"/>
                  <img v-show='getFileType(item.imgUrl) !== "video"' :src="item.imgUrl"/>
              </el-carousel-item>
          </el-carousel>
          <div class="spuName">{{form.spuInfo.spuName}}</div>
          <div>{{form.spuInfo.spuAdWords}}</div>
          <div class="price"> <span class="salePrice">¥ {{form.salePrice ? form.salePrice.toFixed(2) : 0}}</span><span class="listPrice">¥ {{form.listPrice ? form.listPrice.toFixed(2) : 0}}</span></div>
          <div class="label" v-show="form.spuInfo.spuTags"><span>{{form.spuInfo.spuTags}}</span></div>
          <div class="stock">
              <span>运费:包邮</span>
              <!-- <span>库存</span> -->
            </div>
       </div>
       <div class="infoContent">
            <div class="infoTop">详情 </div>
            <ul class="productInfo">
                <p>商品信息</p>
                <li  v-for="(item,index) in form.spuPropList" :key="index">
                    <span class="spuPropWordsLimit">{{item.propName}} {{item.propUnit ? '('+item.propUnit+')' : ''}}</span>
                    <el-tooltip class="item" effect="dark" :content="item.propValues.map(item=>item.value).join('、')" placement="right-start">
                        <span class="spuPropWordsLimit">{{item.propValues.map(item=>item.value).join('、')}}</span>
                    </el-tooltip>
                </li>
            </ul>
             <div class="infoTop">介绍 </div>
             <div class="introduce" v-html="form.details[0].spuContent"></div>
       </div>
    </div>
</template>
<script>
import { getFileType } from '@/utils/getFileType'
export default {
  props: ['form'],
  methods: {
    // 获取文件类型
    getFileType(file) {
      return getFileType(file)
    }
  }
}
</script>
<style lang="scss">
.productContentBox{
     font-size: 16px;
     width: 100%;
    .topContent{
        img, video{
         width: 100%;
         height: 100%;
        }
        div{
            margin-bottom: 8px;
        }
        .price{
          font-weight: bold;
            .listPrice{
              text-decoration:line-through;
              margin-left: 10px;
            }
            .salePrice{
              color:#fe4646 ;
            }
        }
        .label{
            span{
             font-size: 12px;
            font-weight: 400;
            color: #fff;
            padding: 5px 10px;
            border-radius: 4px;
            background-color: #fe4646;
            }
        }
        .stock{
          display: flex;
          span{
            flex:1;
          }
          span:nth-child(2){
              text-align: right;
          }
        }
    }
    .infoContent{
      margin-top: 40px;
      margin-bottom: 15px;
      max-width: 455px;
      .infoTop{
        width: 100%;
        height: 20px;
        line-height: 20px;
        text-align: center;
        font-size: 14px;
        font-weight: 400;
        color: #333;
        position: relative;
        margin-bottom: 12px;
      }
     .infoTop::after{
          right: 8%;
      }
     .infoTop::before{
          left: 8%;
       }
      .infoTop::after,  .infoTop::before{
        content: '';
        width: 25%;
        height: 1px;
        position: absolute;
        top: 50%;
        background-color: #bdbdbd;
      }
      .productInfo{
        height: auto;
        overflow: hidden;
        font-size: 12px;
        box-sizing: border-box;
        border: 1px solid #d9d9d9;
        border-bottom: transparent;
        margin-bottom: 20px;
        p{
            color: #333;
            padding: 5px;
            border-bottom: 1px solid #d9d9d9;
         }
         li{
              border-bottom: 1px solid #d9d9d9;
              display: flex;
              color: #000;
              height: 30px;
              line-height: 30px;
              span{
                  flex: 1;
                  display: inline-block;
                  padding-left: 5px;
              }
              span:last-child{
                   border-left: 1px solid #d9d9d9;
              }
              .spuPropWordsLimit{
                max-width:200px;
                text-overflow:ellipsis;
                overflow:hidden;
                white-space: nowrap;
              }
         }
        }
      }
      .introduce{
        width: 95%;
        padding-left: 13px;
        img, video{width: 100%;height: auto}
        div,p{
          width: 100% !important;
        }
      }
    }
</style>