xuxueyang
2024-07-12 da1f751bea60280504d7fa04e6a547c68ef4381a
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
<template>
    <!-- 列表页面 -->
    <view class="trade-list">
        <view class="category-detail flex">
            <view class="flex1 info">
                <view class="title flex">
                    <view>牛油果泡泡</view>
                    <view>
                        <image src="../../../static/common/icon-kf.png" class="icon-kf m-l-15 img100"></image>
                        
                    </view>
                </view>
                <view class="desc">
                    规格:10支/扎
                </view>
                <view class="desc">
                    估重:1.3kg/扎
                </view>
                <view class="desc">
                    包袋:棉袋
                </view>
            </view>
            <view class="info-price">
                <view class="title">当日均价</view>
                <view class="price">19.66</view>
                <view class="flex desc">
                    <view class="m-l-a m-r-5">+0.76</view>
                    <view class="m-r-a m-l-5">+4.02%</view>
                </view>
            </view>
        </view>
        <view class="" style="min-height: calc(100vh - 260rpx);">
            <no-data v-if="!list||list.length==0" style="width: 100%;"></no-data>
            <view v-else>
                <!-- 查询条件 -->
                <view class="component-filter-container">
                    <view class="flex1">
                        等级<image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
                    </view>
                    <view class="flex1">
                        等级<image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
                    </view>
                    <view class="flex1">
                        好卖家<image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
                    </view>
                    <view class="flex1">
                        颜色<image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
                    </view>
                    <view class="flex1">
                        筛选<image src="../../../static/common/icon-arrow-down.png" class="icon-arrow-down"></image>
                    </view>
                </view>
            </view>
            <view class="component-shop-item flex" v-for="(item,index) of list" :key="index"
             @click="toDetail(item)">
                <view class="img">
                    <image class="img img100"
                        src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/ff/fff3027bd0a146478fd1f0aae816a028%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20240710224139.png">
                    </image>
                    <view class="level">
                        A级
                    </view>
                </view>
 
                <view class="m-l-12 info-container flex1">
                    <view class="title">
                        橙色芭比
                        <view class="price">
                            ¥6.60/扎
                        </view>
                    </view>
                    <view class="shop-name">
                        牛油果泡泡·白色
                    </view>
                    <view class="other-info flex">
                        <view class="m-r-15">
                            已售:7
                        </view>
                        <view class="m-r-15">
                            剩余:13
                        </view>
                        <view class="m-r-15">
                            1支/扎
                        </view>
                    </view>
                    <view class="bottom-buttons  flex">
 
                        <view class="icons flex">
                            <uni-icons v-if="item.shopnum&&item.shopnum>=1" type="minus" size="32"
                                @click.stop="mulnum(item)"></uni-icons>
                            <view class="curnums" v-if="item.shopnum&&item.shopnum>=1">{{item.shopnum}}</view>
                            <uni-icons v-if="!item.shopnum||item.shopnum<=99" type="plus-filled" size="32"
                                @click.stop="addnum(item)"></uni-icons>
                        </view>
                    </view>
                </view>
            </view>
 
 
            <view class="icon-shop"  v-if="list&&list.length>0">
                <!-- 购物图标 -->
                <!-- 如果有购买的东西,就要附带数字了 -->
                <view v-if="shoptotal>0" class="number">
                    {{shoptotal}}
                </view>
            </view>
        </view>
 
        <!-- 判断是否到底了,自动吧 -->
        <footer-msg :more="page.total>0&&page.total>page.current*page.size"></footer-msg>
        
        
    
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                query: {
                    category: '',
                },
                shoptotal:0,
                list:[{},{},{}]
            }
        },
        async onLoad(options) {
            // this.list = [{},{}]
            console.log('options', options)
            this.query.category = options.categoryId || ''
            this.listApi = '/api/customer/flower/list'
            // await this.getList('post')
            // this.
        },
        onReachBottom() {
            this.page.current += 1
            this.getMore('post')
        },
        async onPullDownRefresh() {
            this.page.current = 1
            await this.getList('post')
            uni.stopPullDownRefresh()
        },
        methods: {
            toDetail(item) {
                uni.navigateTo({
                    url: `/sub_pages/customer/trade/detail?id=${item.id}`
                })
            },
            mulnum(item) {
                if (item.shopnum > 0) {
                    item.shopnum -= 1
                }
                this.shoptotal -= 1
                this.$forceUpdate()
            
            },
            addnum(item) {
                if (item.shopnum) {
                    item.shopnum += 1
                } else {
                    item.shopnum = 1
                }
                this.shoptotal += 1
                this.$forceUpdate()
            },
        }
    }
</script>
 
<style lang="scss">
    .trade-list {
        padding: 24rpx 30rpx;
 
        .category-detail {
            padding: 22rpx 38rpx;
            margin-bottom: 10rpx;
            background-color: #E1F0E7;
            border-radius: 8rpx;
 
            .info {
                .title {
                    font-weight: 600;
                    font-size: 36rpx;
                    color: #000000;
                    line-height: 50rpx;
                }
 
                .icon-kf {
                    width: 44rpx;
                    height: 44rpx;
                }
 
                .desc {
                    font-weight: 400;
                    font-size: 24rpx;
                    color: #666666;
                    line-height: 34rpx;
                    margin-top: 8rpx;
                }
            }
 
            .info-price {
                padding: 22rpx;
                text-align: center;
                background: #FFFFFF;
                border-radius: 8rpx;
                min-width: 260rpx;
                .title {
                    font-weight: 400;
                    font-size: 24rpx;
                    color: #000000;
                    line-height: 34rpx;
                }
 
                .price {
                    font-weight: 600;
                    font-size: 32rpx;
                    color: #BF0000;
                    line-height: 44rpx;
                    margin-top: 12rpx;
                }
 
                .desc {
                    font-weight: 400;
                    font-size: 24rpx;
                    color: #666666;
                    line-height: 34rpx;
                    margin-top: 12rpx;
                }
            }
        }
 
 
    .icon-shop {
        position: absolute;
        position: fixed;
    
        background-image: url('../../../static/images/customer/gwc.png');
        width: 140rpx;
        height: 140rpx;
        // box-shadow: 0rpx 4rpx 22rpx 0rpx rgba(0, 0, 0, 0.16);
        border-radius: 50%;
        right: 40rpx;
        bottom: 300rpx;
        background-size: 100% 100%;
    
        .number {
            width: 30rpx;
            height: 30rpx;
            background: #F20000;
            line-height: 30rpx;
            text-align: center;
            position: absolute;
            right: 14rpx;
            top: 14rpx;
            color: #FFFFFF;
            border-radius: 50%;
            font-size: 24rpx;
        }
    
    }
    
    }
</style>