| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <!-- 商品列表模板2样式 -->
- <template>
- <div class="goods-temlate02 good-list-cell" @click.stop="clickItem">
- <div class="good-img">
- <img v-lazy="thumb">
- <div class="video-overlay" v-if="videoIcon">
- <!-- 视频播放按钮样式 -->
- <div class="triangle-right"></div>
- </div>
- </div>
- <div class="good-content">
- <!-- 标题 -->
- <div class="good-title text-overflow-2">{{title}}</div>
- <!-- 价格和标签 -->
- <div class="good-price" ><div class="limitTime-tag" v-if="goodType == 'limitTime'">限时购</div> ¥{{price}}</div>
- <div class="countDown-box">
- <!-- 倒计时 -->
- <slot name="countDown"></slot>
- </div>
- </div>
- </div>
- </template>
- <script>
- export default {
- props: {
- thumb: {
- type: String,
- default: ""
- },
- title: {
- type: String,
- default: ""
- },
- price: {
- type: [String,Number],
- default: ""
- },
- time: {
- type: [String,Number],
- default: null
- },
- goodType: {
- type: String,
- default: "goods"
- },
- videoIcon: {
- type: Boolean,
- default: false
- },
- },
- data () {
- return {
- };
- },
- activated() {},
- components: {},
- computed: {},
- mounted() {},
- methods: {
- clickItem() {
- this.$emit("click")
- },
- }
- }
- </script>
- <style lang='scss' rel='stylesheet/scss' scoped>
- .good-list-cell{
- width: 220px;
- padding: 20px 20px 15px;
- display: flex;
- flex-direction: column;
- border: 1px solid #f4f4f4;
- background: #fff;
- box-sizing: border-box;
- border-radius: 5px;
- margin-bottom: 10px;
- .good-img{
- width: 180px;
- height: 180px;
- background-color: #262626;
- border-radius: 5px;
- position: relative;
- overflow: hidden;
- img{
- width: 100%;
- height: 100%;
- }
- .video-overlay{
- position: absolute;
- width: 100%;
- height: 100%;
- background-color: rgba(38, 38, 38, 0.5);
- top: 0;
- left: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- .triangle-right {
- width: 0;
- height: 0;
- border-top: 15px solid transparent;
- border-left: 30px solid #fff;
- border-bottom: 15px solid transparent;
- }
- }
- }
- .good-content{
- .good-title,.good-price{
- line-height: 20px;
- font-size: 16px;
- padding-top: 14px;
- color: #000000;
- font-weight: bold;
- /*overflow: hidden;!*超出部分隐藏*!*/
- /*text-overflow:ellipsis;!* 超出部分显示省略号 *!*/
- /*white-space: nowrap;!*规定段落中的文本不进行换行 *!*/
- }
- .good-price{
- color: #ff0000;
- display: flex;
- .limitTime-tag{
- height: 20px;
- padding: 0 6px;
- position: relative;
- color: #fff;
- text-decoration: none;
- z-index: 1;
- font-size: 14px;
- margin:0 6px;
- }
- .limitTime-tag::before {
- content: '';
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- z-index: -1;
- background: #ff0000;
- transform: skewX(-20deg);
- }
- }
- }
- &:hover{
- cursor:pointer;
- box-shadow: 0px 0px 27px 0px rgba(4, 0, 0, 0.2);
- img {
- transform: scale(1.04);
- transition: all 0.5s ease;
- }
- }
- }
- </style>
|