Blame view

components/product.vue 1.25 KB
4b045f7c   刘淇   江阴初始化项目
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
  <template>
  	<view class="product">
  		<image class="product-image" :src="image ? image : 'https://via.placeholder.com/150x200'"></image>
  		<view class="product-title">{{title}}</view>
  		<view class="product-price">
  			<text class="product-price-favour">¥{{originalPrice}}</text>
  			<text class="product-price-original">¥{{favourPrice}}</text>
  			<text class="product-tip">{{tip}}</text>
  		</view>
  	</view>
  </template>
  
  <script>
  	export default {
  		name: 'product',
  		props: ['image', 'title', 'originalPrice', 'favourPrice', 'tip']
  	}
  </script>
  
  <style>
  	.product {
  		padding: 10rpx 20rpx;
  		display: flex;
  		flex-direction: column;
  	}
  
  	.product-image {
  		height: 330rpx;
  		width: 330rpx;
  	}
  
  	.product-title {
  		width: 300rpx;
  		font-size: 32rpx;
  		word-break: break-all;
  		display: -webkit-box;
  		overflow: hidden;
  		text-overflow: ellipsis;
  		-webkit-box-orient: vertical;
  		-webkit-line-clamp: 2;
  	}
  
  	.product-price {
  		font-size: 28rpx;
  		position: relative;
  	}
  
  	.product-price-original {
  		color: #E80080;
  	}
  
  	.product-price-favour {
  		color: #888888;
  		text-decoration: line-through;
  		margin-left: 10rpx;
  	}
  
  	.product-tip {
  		position: absolute;
  		right: 10rpx;
  		background-color: #FF3333;
  		color: #FFFFFF;
  		padding: 0 10rpx;
  		border-radius: 5rpx;
  	}
  </style>