quanwei
2025-11-13 572f6074c5bedcdcbabcd42995c0a2890995c870
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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
<template>
    <view class="category-wrap"  :data-theme='theme()' :class="theme() || ''">
        <!-- #ifdef APP-PLUS -->
        <header-bar></header-bar>
        <!-- #endif -->
        <!-- 搜索框 -->
        <view class="d-b-c" id="searchBox">
            <view class="index-search t-c flex-1" style="height: 70rpx; line-height: 70rpx; margin: 10rpx;">
                <span class="icon iconfont icon-sousuo"></span>
                <input type="text" v-model="store_name" class="flex-1 ml10 f30 gray3" value="" placeholder-class="f24 gray6"
                 placeholder="输入名称" confirm-type="search" @confirm="gotoSearch()"/>
            </view>
        </view>
        <!--类别列表-->
        <view class="category-content" v-if="store_open">
        
            <!--列表-->
            <view class="cotegory-type cotegory-type-3">
                <view class="category-tab">
                    <scroll-view scroll-y="true" class="scroll-Y" :style="'height:'+scrollviewHigh+'px;'">
                        <view :class="item.category_id==category_id?'item active':'item'" v-for="(item,index) in listData"
                            :key="index" @click="selectCategory(item.category_id)">
                            <text>{{item.name}}</text>
                        </view>
                    </scroll-view>
                </view>
                <view class="category-content pr">
                    <scroll-view scroll-y="true" class="scroll-Y scroll-3" :style="'height:'+scrollviewHigh+'px;'">
                        <view class="shop_body">
                            <view class="shop_body_l_item" :class="index==storeData.length-1?'noborder':''" v-for="(item,index) in storeData"
                             :key="index" @click="gotoDetail(item.store_id)">
                                <view v-if="item.logo">
                                    <image :src="item.logo.file_path" mode=""></image>
                                </view>
                                <view class="shop_body_l_item_info">
                                    <view class="shop_body_l_item_info_title gray3 f32">{{item.store_name}}</view>
                                    <view class="shop_body_l_item_info_price">
                                            <view class="f24 shop_red">位置:{{item.address}}</view>
                                    </view> 
                                    <view class="shop_body_l_item_info_others f24">
                                            <view class="shop_body_l_item_info_others_sales">进店查看更多优惠</view>
                                    </view>
                                </view>
                            </view>
                        </view>
                        <!-- 没有记录 -->
                        <view class="d-c-c p30" v-if="storeData.length==0 && !isloadding">
                            <text class="iconfont icon-wushuju"></text>
                            <text class="cont">亲,暂无相关记录哦</text>
                        </view>
                    </scroll-view>
                </view>
            </view>
 
        </view>
        <tabBar></tabBar>
        <request-loading :loadding='isloadding'></request-loading>
    </view>
</template>
 
<script>
    export default {
        components: {},
        data() {
            return {
                isloadding: true,
                searchName: '搜索门店',
                /*手机高度*/
                phoneHeight: 0,
                /*可滚动视图区域高度*/
                scrollviewHigh: 0,
                /*数据*/
                listData: [],
                /*当前选中的分类*/
                select_index: 0,
                storeData:[],
                /*底部加载*/
                loading: true,
                page:1,
                list_rows:250,
                store_name:'',
                category_id:'',
                store_open:false
            };
        },
        mounted() {
            this.init();
            this.getCategoryData();
        },
        onShow(){
            
        },
        methods: {
            /*初始化*/
            init() {
                let _this = this;
                uni.getSystemInfo({
                    success(res) {
                        _this.phoneHeight = res.windowHeight;
                        // 计算组件的高度
                        let view = uni.createSelectorQuery().select('#searchBox');
                        view.boundingClientRect(data => {
                            let h = _this.phoneHeight - data.height;
                            _this.scrollviewHigh = h;
                        }).exec();
                    }
                });
            },
            
            /*获取数据*/
            getCategoryData() {
                let _this = this;
                _this.isloadding = true;
                _this._get('plus.goodstore.category/index', {
                    
                }, function(res) {
                    _this.store_open = res.data.store_open;
                    if(!_this.store_open){
                        uni.setNavigationBarTitle({
                          title: '我的订单',
                        });
                        _this.gotoPage('/pages/index/index');
                    }else{
                        uni.setNavigationBarTitle({
                          title: '好店列表',
                        });
                    }
                    _this.listData = res.data.category_list;
                    if(res.data.category_list){
                        _this.category_id = _this.listData[0]["category_id"]
                        _this.getStoreData();
                    }
                    _this.isloadding = false;
                });
            },
            
            /*选择分类*/
            selectCategory(e) {
                let self = this;
                self.category_id = e;
                self.page = 1;
                self.storeData=[];
                self.getStoreData();
            },
 
            /*获取门店数据*/
            getStoreData() {
                let self = this;
                self.isloadding = true;
                self._get('plus.goodstore.store/lists', {
                    page: self.page,
                    list_rows: self.list_rows,
                    category_id: self.category_id,
                    store_name: self.store_name,    
                }, function(res) {
                    self.isloadding = false;
                    self.storeData = res.data.list.data;
                });
            },
            /*跳转门店详情*/
            gotoDetail(e) {
                let url = 'pages2/goodstore/detail?store_id=' + e
                this.gotoPage(url);
            },
 
            /*搜索*/
            gotoSearch() {
                this.getStoreData();
            },
 
        }
    };
</script>
 
<style lang="scss">
    @import '@/common/mixin.scss';
 
    .foot_ {
        height: 98rpx;
        width: 100%;
    }
 
    .cotegory-type {
        line-height: 40rpx;
        background: #ffffff;
    }
 
    .cotegory-type image {
        width: 100%;
    }
 
    .cotegory-type-1 .list {
        padding: 20rpx;
    }
 
    .cotegory-type-1 .list .item {
        margin-top: 30rpx;
    }
 
    .cotegory-type-1 .list .item .pic {
        border: 1px solid #e3e3e3;
        width: 710rpx;
        height: auto;
        overflow: hidden;
        border-radius: 8px;
    }
 
    .cotegory-type-1 .list .item image {
        width: 100%;
        height: 100%;
    }
 
    .cotegory-type-2 .list,
    .cotegory-type-3 .list {
        padding: 0 20rpx;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
 
    .cotegory-type-2 .list .item,
    .cotegory-type-3 .list .item {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
 
    .cotegory-type-2 .list .item {
        padding: 0 16rpx;
        width: 200rpx;
        height: 300rpx;
        font-size: 28rpx;
    }
 
    .cotegory-type-2 .list .item image {
        width: 180rpx;
        height: 180rpx;
        margin-bottom: 20rpx;
    }
 
    .cotegory-type-3 {
        display: flex;
    }
 
    .cotegory-type-3 .category-tab {
        width: 200rpx;
        background: #FFFFFF;
        // border-right: 1px solid #e3e3e3;
    }
 
    .cotegory-type-3 .category-tab .item {
        padding: 40rpx 0;
        font-size: 26rpx;
        text-align: center;
        color: #666666;
        font-weight: bold;
    }
 
    .cotegory-type-3 .category-tab .item.active {
        position: relative;
        background: #ffffff;
 
        color: #333333;
    }
 
    .cotegory-type-3 .category-tab .item.active::after {
        position: absolute;
        content: '';
        top: 40rpx;
        bottom: 40rpx;
        left: 0;
        width: 6rpx;
        height: 22rpx;
        margin: auto;
        @include background_linear('titleft1', 'titleft2', 180deg, 0%, 100%);
    }
 
    .cotegory-type-3 .category-content {
        flex: 1;
        margin: 0 20rpx;
    }
 
    .cotegory-type-3 .list .item {
        width: 140rpx;
        height: 200rpx;
        margin-top: 40rpx;
        margin-right: 20rpx;
        font-size: 24rpx;
    }
 
    .cotegory-type-3 .list .item:nth-child(3n) {
        margin-right: 0;
    }
 
    .cotegory-type-3 .list .item image {
        width: 140rpx;
        height: 140rpx;
    }
 
    .cotegory-type-3 .list .item .type-name {
        display: block;
        margin-top: 20rpx;
        height: 80rpx;
        line-height: 60rpx;
        text-overflow: ellipsis;
        width: 100%;
        color: #818181;
        font-size: 26rpx;
        white-space: nowrap;
        overflow: hidden;
        text-align: center;
    }
 
    .scroll-3 {
        position: absolute;
        background: #ffffff;
        border-radius: 12px;
    }
    .shop_body {
        width: 100%;
        background-color: #ffffff;
        padding: 0rpx 20rpx;
        box-sizing: border-box;
    }
    
    .shop_body_l_item {
        // width: 90%;
        // height: 250rpx;
        margin: 0 auto;
        background-color: white;
        // border-radius: 15rpx;
        // margin-top: 20rpx;
        display: flex;
        padding: 40rpx 0;
        box-sizing: border-box;
        border-bottom: 1rpx solid #D9D9D9;
    
    }
    
    .shop_body_l_item image {
        width: 150rpx;
        height: 150rpx;
        border-radius: 12rpx;
        background-color: rgba(0, 0, 0, 0.1);
    }
    
    .shop_body_l_item_info {
        // width: 70%;
        // height: 100%;
        flex: 1;
        display: flex;
        justify-content: space-between;
        flex-direction: column;
        padding-left: 20rpx;
        box-sizing: border-box;
    }
    
    .shop_body_l_item_info_title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        text-overflow: ellipsis;
        -webkit-box-orient: vertical;
        word-wrap: break-word;
        word-break: break-all;
        overflow: hidden;
    }
    
    .shop_body_l_item_info_price {
        display: flex;
        align-items: flex-end;
    }
    
    .shop_body_l_item_info_price view {
        margin-right: 15rpx;
    }
    
    .shop_body_l_item_info_others {
        // width: 100%;
        height: 30rpx;
        display: flex;
        justify-content: space-between;
    }
    
    .shop_body_l_item_info_others_activity {
        width: 150rpx;
        height: 30rpx;
        line-height: 30rpx;
        border: 1rpx #E22319 solid;
        border-radius: 30rpx;
        /* font-size: 16rpx; */
        color: #E22319;
        text-align: center;
        box-sizing: border-box;
    }
    
    .shop_body_l_item_info_others_sales {
        color: #333333;
    }
    
    .shop_body2 {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
        background-color: #f2f2f2;
    }
    
    .shop_body_t_item {
        width: 345rpx;
        // margin: 0 2.5%;
        margin-bottom: 20rpx;
        height: 520rpx;
        overflow: hidden;
        background-color: white;
        border-radius: 12rpx;
    }
    
    .collect text {
        color: #FFFFFF;
    }
    
    .shop_body_t_item image {
        width: 100%;
        height: 337.5rpx;
        background-color: rgba(0, 0, 0, 0.1);
    }
    
    .shop_body_t_item_info {
        // height: 182.5rpx;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding: 20rpx;
        box-sizing: border-box;
    }
    
    .shop_body_t_item_info_title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
        text-overflow: ellipsis;
        -webkit-box-orient: vertical;
        word-wrap: break-word;
        word-break: break-all;
        overflow: hidden;
        margin-bottom: 30rpx;
    }
    
    .shop_body_t_item_info_price {
        display: flex;
        align-items: flex-end;
    
    }
    
    .shop_body_t_item_info_others {
        display: flex;
        justify-content: space-between;
        margin-bottom: 8rpx;
    }
    
    .shop_body_t_item_info_others_activity {}
    
    .shop_body_t_item_info_others_sales {
        color: #999999;
    }
    
    .huaxianjia {
        text-decoration: line-through;
        color: #999;
        margin-left: 5rpx;
    }
    
    .shop_red {
        color: #808080;
    }
    
    .inner-tab .item .icon-sanjiao2 {
        font-size: 13rpx;
    }
    
    .inner-tab .item .icon-sanjiao1 {
        font-size: 13rpx;
    }
    
    .noborder {
        border: none;
    }
</style>