GoodsList.vue
3.7 KB
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
164
165
166
167
168
169
170
171
172
173
174
175
176
<template>
<view v-show="goodsList.length > 0" class="cate-right-cont">
<view class="cate-two-box">
<view class="cate-cont-box">
<view class="w-full" v-for="(item, idx) in goodsList" :key="idx" @click="goodDetail(item.id)">
<view class="cate-img-padding">
<view class="content-left">
<image class="image" mode="widthFix" :src="item.pic"></image>
</view>
<view class="content-right">
<view style="height: 100%;" class="dis-flex flex-dir-column flex-x-between flex-y-center">
<view class="title u-line-1">{{ item.name }}</view>
<view class="dis-flex flex-y-center">
<view class="btn up">上架</view>
<view class="btn mx-20">下架</view>
<view class="btn del">删除</view>
</view>
</view>
<u-icon name="arrow-right-double"></u-icon>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name:"goodsCard",
props: {
goodsList: {
type: Array,
require: true
}
},
methods: {
goodDetail(goodsID){
uni.navigateTo({
url: '/pages_mall/goodsDetail/goodsDetail?goods_id=' + goodsID
})
}
}
}
</script>
<style lang="scss" scoped>
// 右侧二级分类
.cate-cont-box {
margin-bottom: 30rpx;
padding-bottom: 10rpx;
background: #fff;
overflow: hidden;
.cate-img-padding{
display: flex;
align-items: center;
.content-left{
width: 120rpx;
height: 120rpx;
.image{
width: 100%;
border-radius: 12rpx;
}
}
.content-right{
display: flex;
align-items: center;
justify-content: center;
flex: 1;
height: 120rpx;
padding: 5rpx 30rpx;
.btn{
width: 80rpx;
height: 40rpx;
border-radius: 200rpx 200rpx 200rpx 200rpx;
border: 2rpx solid #DDDDDD;
line-height: 40rpx;
font-size: 24rpx;
text-align: center;
color: #DDDDDD;
&.up{
border-color: #509F00;
color: #509F00;
}
&.down{
border-color: #00A3EE;
color: #00A3EE;
}
&.del{
border-color: #CB0000;
color: #CB0000;
}
}
.title{
color: #333;
font-size: 26rpx;
font-weight: 500;
margin-bottom: 10rpx;
}
.content-title{
display: inline-block;
color: #999;
font-size: 22rpx;
margin: 15rpx 0 15rpx 0;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.tip{
font-size: 24rpx;
margin-bottom: 12rpx;
.delivery{
width: 80rpx;
height: 24rpx;
margin-left: 10rpx;
border: 1px solid #40AE36;
border-radius: 4rpx;
padding: 3rpx;
color: #40AE36;
}
}
.price{
position: relative;
font-size: 22rpx;
color: #999;
margin-top: 10rpx;
.price-detail{
width: 116rpx;
height: 27rpx;
font-size: 32rpx;
font-family: PingFangSC;
font-weight: 500;
color: #F55726;
}
.price-old{
width: 90rpx;
height: 21rpx;
font-size: 22rpx;
font-family: PingFangSC;
font-weight: 400;
color: #CCCCCC;
margin-left: 6rpx;
}
.addCart{
position: absolute;
top: -8rpx;
right: 6rpx;
width: 46rpx;
height: 46rpx;
background-color: #40AE36;
border-radius: 50%;
text-align: center;
line-height: 44rpx;
}
}
}
}
.name {
display: block;
padding-bottom: 30rpx;
text-align: center;
font-size: 26rpx;
color: #444444;
}
.cate-img-padding {
padding: 16rpx 16rpx 4rpx 16rpx;
}
.cate-img {
position: relative;
width: 100%;
padding-top: 100%;
}
}
</style>