1
|
-<template>
|
|
|
2
|
- <view class="product_all">
|
|
|
3
|
- <view class="top">
|
|
|
4
|
- <image src="../../static/ic-back-false.png" mode="" @click="back"></image>
|
|
|
5
|
- <view class="search">
|
|
|
6
|
- <view class="tosear">
|
|
|
7
|
- <input type="text" value="" placeholder="搜索"
|
|
|
8
|
- placeholder-style="text-align: center;font-size: 28rpx; color: rgba(194,194,194,1);"
|
|
|
9
|
- v-model="keyword" @confirm="gosourch"/>
|
|
|
10
|
- <image src="../../static/icon-search.png" mode="" v-if="!keyword"></image>
|
|
|
11
|
- </view>
|
|
|
12
|
- </view>
|
1
|
+<template>
|
|
|
2
|
+ <view class="product_all">
|
|
|
3
|
+ <view class="top">
|
|
|
4
|
+ <image src="../../static/ic-back-false.png" mode="" @click="back"></image>
|
|
|
5
|
+ <view class="search">
|
|
|
6
|
+ <view class="tosear">
|
|
|
7
|
+ <input type="text" value="" placeholder="搜索"
|
|
|
8
|
+ placeholder-style="text-align: center;font-size: 28rpx; color: rgba(194,194,194,1);"
|
|
|
9
|
+ v-model="keyword" @confirm="gosourch" />
|
|
|
10
|
+ <image src="../../static/icon-search.png" mode="" v-if="!keyword"></image>
|
|
|
11
|
+ </view>
|
|
|
12
|
+ </view>
|
13
|
</view>
|
13
|
</view>
|
14
|
- <u-empty marginTop ="200" text="暂无数据" mode="data" v-if="!list.length"></u-empty>
|
|
|
15
|
- <scroll-view v-if="list.length" scroll-y="true" @scrolltolower="scrolltolower" style="height: 100vh">
|
|
|
16
|
- <view class="misslist">
|
|
|
17
|
- <custom-waterfalls-flow :value="list" @wapperClick="godetail" @imageClick="godetail">
|
|
|
18
|
- <template v-slot:default="item">
|
|
|
19
|
- <view class="item">
|
|
|
20
|
- <view class="title">{{item.name}}</view>
|
|
|
21
|
- <view class="types">
|
|
|
22
|
- 所属分类:{{item.sort.name}}
|
|
|
23
|
- </view>
|
|
|
24
|
- <view class="desc">
|
|
|
25
|
- <text v-if="item.seller_name">{{item.seller_name}}</text>
|
|
|
26
|
- <view class="money">
|
|
|
27
|
- <text>¥</text>{{item.price}}
|
|
|
28
|
- </view>
|
|
|
29
|
- </view>
|
|
|
30
|
- </view>
|
|
|
31
|
- </template>
|
|
|
32
|
- </custom-waterfalls-flow>
|
|
|
33
|
- </view>
|
14
|
+ <u-empty marginTop="200" text="暂无数据" mode="data" v-if="!list.length"></u-empty>
|
|
|
15
|
+ <scroll-view v-if="list.length" scroll-y="true" @scrolltolower="scrolltolower" style="height: 100vh">
|
|
|
16
|
+ <view class="misslist">
|
|
|
17
|
+ <custom-waterfalls-flow :value="list" @wapperClick="godetail" @imageClick="godetail">
|
|
|
18
|
+ <template v-slot:default="item">
|
|
|
19
|
+ <view class="item">
|
|
|
20
|
+ <view class="title">{{item.name}}</view>
|
|
|
21
|
+ <view class="types">
|
|
|
22
|
+ 所属分类:{{item.sort.name}}
|
|
|
23
|
+ </view>
|
|
|
24
|
+ <view class="desc">
|
|
|
25
|
+ <text v-if="item.seller_name">{{item.seller_name}}</text>
|
|
|
26
|
+ <view class="money">
|
|
|
27
|
+ <text>¥</text>{{item.price}}
|
|
|
28
|
+ </view>
|
|
|
29
|
+ </view>
|
|
|
30
|
+ </view>
|
|
|
31
|
+ </template>
|
|
|
32
|
+ </custom-waterfalls-flow>
|
|
|
33
|
+ </view>
|
34
|
</scroll-view>
|
34
|
</scroll-view>
|
35
|
-
|
|
|
36
|
- </view>
|
|
|
37
|
-</template>
|
|
|
38
|
-
|
|
|
39
|
-<script>
|
|
|
40
|
- import {
|
|
|
41
|
- product_list
|
|
|
42
|
- } from '@/api/index'
|
|
|
43
|
- export default {
|
|
|
44
|
- data() {
|
|
|
45
|
- return {
|
|
|
46
|
- //瀑布
|
|
|
47
|
- list: [],
|
|
|
48
|
- keyword: "",
|
|
|
49
|
- currentpage: 1,
|
|
|
50
|
- }
|
|
|
51
|
- },
|
|
|
52
|
- onLoad(options) {
|
|
|
53
|
- this.keyword = options.ktext
|
|
|
54
|
- this.product_list(true)
|
|
|
55
|
- },
|
35
|
+
|
|
|
36
|
+ </view>
|
|
|
37
|
+</template>
|
|
|
38
|
+
|
|
|
39
|
+<script>
|
|
|
40
|
+ import {
|
|
|
41
|
+ product_list
|
|
|
42
|
+ } from '@/api/index'
|
|
|
43
|
+ export default {
|
|
|
44
|
+ data() {
|
|
|
45
|
+ return {
|
|
|
46
|
+ //瀑布
|
|
|
47
|
+ list: [],
|
|
|
48
|
+ keyword: "",
|
|
|
49
|
+ currentpage: 1,
|
|
|
50
|
+ sort_id: "",
|
|
|
51
|
+ }
|
|
|
52
|
+ },
|
|
|
53
|
+ onLoad(options) {
|
|
|
54
|
+ if (options.ktext) {
|
|
|
55
|
+ this.keyword = options.ktext
|
|
|
56
|
+ }
|
|
|
57
|
+ if (options.sort_id) {
|
|
|
58
|
+ this.sort_id = options.sort_id
|
|
|
59
|
+ }
|
|
|
60
|
+ this.product_list(true)
|
|
|
61
|
+ },
|
56
|
methods: {
|
62
|
methods: {
|
57
|
- gosourch(){
|
63
|
+ gosourch() {
|
58
|
this.product_list(true)
|
64
|
this.product_list(true)
|
59
|
- },
|
|
|
60
|
- scrolltolower() {
|
|
|
61
|
- this.currentpage++
|
|
|
62
|
- this.product_list()
|
|
|
63
|
- },
|
|
|
64
|
- back() {
|
|
|
65
|
- uni.navigateBack({
|
|
|
66
|
- delta: 1
|
|
|
67
|
- })
|
|
|
68
|
- },
|
|
|
69
|
- //产品列表
|
|
|
70
|
- async product_list(x) {
|
|
|
71
|
- let obj = {
|
|
|
72
|
- keyword: this.keyword,
|
|
|
73
|
- page: this.currentpage,
|
|
|
74
|
- pagenum: 15,
|
|
|
75
|
- }
|
|
|
76
|
- try {
|
|
|
77
|
- const res = await product_list(obj)
|
|
|
78
|
- console.log('产品列表', res)
|
|
|
79
|
- this.list = x ? res.list.data : this.list.concat(res.list.data)
|
|
|
80
|
- this.list.forEach((item, index) => {
|
|
|
81
|
- item.image = item.images_preview[0]
|
|
|
82
|
- })
|
|
|
83
|
- if (res.list.data.length == 0) {
|
|
|
84
|
- // uni.showToast({
|
|
|
85
|
- // title: "暂无更多数据",
|
|
|
86
|
- // icon: 'none'
|
|
|
87
|
- // })
|
|
|
88
|
- return
|
|
|
89
|
- }
|
|
|
90
|
- console.log('产品列表', this.list)
|
|
|
91
|
- // 保存数据
|
|
|
92
|
- } catch (err) {
|
|
|
93
|
- uni.showToast({
|
|
|
94
|
- title: err,
|
|
|
95
|
- icon: 'none'
|
|
|
96
|
- })
|
|
|
97
|
- console.log('product_list', err)
|
|
|
98
|
- }
|
65
|
+ },
|
|
|
66
|
+ scrolltolower() {
|
|
|
67
|
+ this.currentpage++
|
|
|
68
|
+ this.product_list()
|
|
|
69
|
+ },
|
|
|
70
|
+ back() {
|
|
|
71
|
+ uni.navigateBack({
|
|
|
72
|
+ delta: 1
|
|
|
73
|
+ })
|
|
|
74
|
+ },
|
|
|
75
|
+ //产品列表
|
|
|
76
|
+ async product_list(x) {
|
|
|
77
|
+ let obj = {
|
|
|
78
|
+ keyword: this.keyword,
|
|
|
79
|
+ sort_id: this.sort_id,
|
|
|
80
|
+ page: this.currentpage,
|
|
|
81
|
+ pagenum: 15,
|
|
|
82
|
+ }
|
|
|
83
|
+ try {
|
|
|
84
|
+ const res = await product_list(obj)
|
|
|
85
|
+ console.log('产品列表', res)
|
|
|
86
|
+ this.list = x ? res.list.data : this.list.concat(res.list.data)
|
|
|
87
|
+ this.list.forEach((item, index) => {
|
|
|
88
|
+ item.image = item.images_preview[0]
|
|
|
89
|
+ })
|
|
|
90
|
+ if (res.list.data.length == 0) {
|
|
|
91
|
+ // uni.showToast({
|
|
|
92
|
+ // title: "暂无更多数据",
|
|
|
93
|
+ // icon: 'none'
|
|
|
94
|
+ // })
|
|
|
95
|
+ return
|
|
|
96
|
+ }
|
|
|
97
|
+ console.log('产品列表', this.list)
|
|
|
98
|
+ // 保存数据
|
|
|
99
|
+ } catch (err) {
|
|
|
100
|
+ uni.showToast({
|
|
|
101
|
+ title: err,
|
|
|
102
|
+ icon: 'none'
|
|
|
103
|
+ })
|
|
|
104
|
+ console.log('product_list', err)
|
|
|
105
|
+ }
|
99
|
},
|
106
|
},
|
100
|
//跳转详情
|
107
|
//跳转详情
|
101
|
godetail(item) {
|
108
|
godetail(item) {
|
|
@@ -103,113 +110,113 @@ |
|
@@ -103,113 +110,113 @@ |
103
|
uni.navigateTo({
|
110
|
uni.navigateTo({
|
104
|
url: "/pages/index/detail?id=" + item.id
|
111
|
url: "/pages/index/detail?id=" + item.id
|
105
|
})
|
112
|
})
|
106
|
- },
|
|
|
107
|
- }
|
|
|
108
|
- }
|
|
|
109
|
-</script>
|
|
|
110
|
-
|
|
|
111
|
-<style lang="scss">
|
|
|
112
|
- page {
|
|
|
113
|
- background: rgba(246, 246, 246, 1);
|
|
|
114
|
- }
|
|
|
115
|
-
|
|
|
116
|
- .product_all {
|
|
|
117
|
- .top {
|
|
|
118
|
- position: fixed;
|
|
|
119
|
- top: 0;
|
|
|
120
|
- left: 0;
|
|
|
121
|
- width: 100%;
|
|
|
122
|
- z-index: 99;
|
|
|
123
|
- height: 96rpx;
|
|
|
124
|
- opacity: 1;
|
|
|
125
|
- background: rgba(255, 255, 255, 1);
|
|
|
126
|
- padding: 16rpx 32rpx;
|
|
|
127
|
- display: flex;
|
|
|
128
|
- box-sizing: border-box;
|
|
|
129
|
- align-items: center;
|
|
|
130
|
-
|
|
|
131
|
- image {
|
|
|
132
|
- margin-right: 32rpx;
|
|
|
133
|
- width: 48rpx;
|
|
|
134
|
- height: 48rpx;
|
|
|
135
|
- }
|
|
|
136
|
-
|
|
|
137
|
- .search {
|
|
|
138
|
- flex: 1;
|
|
|
139
|
- display: flex;
|
|
|
140
|
- align-items: center;
|
|
|
141
|
-
|
|
|
142
|
- .tosear {
|
|
|
143
|
- position: relative;
|
|
|
144
|
- width: 522rpx;
|
|
|
145
|
- height: 64rpx;
|
|
|
146
|
- border-radius: 38rpx;
|
|
|
147
|
- opacity: 1;
|
|
|
148
|
-
|
|
|
149
|
- border: 0 solid rgba(0.5920000076293945, 0.5920000076293945, 0.5920000076293945, 1);
|
|
|
150
|
- background: rgba(245, 245, 245, 1);
|
|
|
151
|
- padding: 0 32rpx;
|
|
|
152
|
-
|
|
|
153
|
- input {
|
|
|
154
|
- text-align: center;
|
|
|
155
|
- width: 100%;
|
|
|
156
|
- height: 100%;
|
|
|
157
|
- }
|
|
|
158
|
-
|
|
|
159
|
- image {
|
|
|
160
|
- position: absolute;
|
|
|
161
|
- left: 280rpx;
|
|
|
162
|
- top: 50%;
|
|
|
163
|
- left: 36%;
|
|
|
164
|
- transform: translateY(-50%);
|
|
|
165
|
- width: 32rpx;
|
|
|
166
|
- height: 32rpx;
|
|
|
167
|
- }
|
|
|
168
|
- }
|
|
|
169
|
- }
|
|
|
170
|
-
|
|
|
171
|
- }
|
|
|
172
|
-
|
|
|
173
|
- .misslist {
|
|
|
174
|
- margin-top: 104rpx;
|
|
|
175
|
-
|
|
|
176
|
- .item {
|
|
|
177
|
- padding: 24rpx;
|
|
|
178
|
- box-sizing: border-box;
|
|
|
179
|
-
|
|
|
180
|
- .types {
|
|
|
181
|
- margin-top: 8rpx;
|
|
|
182
|
- color: rgba(0, 0, 0, 0.6);
|
|
|
183
|
- font-size: 24rpx;
|
|
|
184
|
- font-weight: 400;
|
|
|
185
|
- font-family: "PingFang SC";
|
|
|
186
|
- }
|
|
|
187
|
-
|
|
|
188
|
- .desc {
|
|
|
189
|
- margin-top: 14rpx;
|
|
|
190
|
- display: flex;
|
|
|
191
|
- align-items: center;
|
|
|
192
|
- justify-content: space-between;
|
|
|
193
|
- color: rgba(0, 0, 0, 0.6);
|
|
|
194
|
- font-size: 20rpx;
|
|
|
195
|
- font-weight: 400;
|
|
|
196
|
- font-family: "PingFang SC";
|
|
|
197
|
-
|
|
|
198
|
- .money {
|
|
|
199
|
-
|
|
|
200
|
- color: rgba(248, 83, 23, 1);
|
|
|
201
|
- font-size: 32rpx;
|
|
|
202
|
- font-weight: 700;
|
|
|
203
|
- font-family: "Montserrat";
|
|
|
204
|
-
|
|
|
205
|
- text {
|
|
|
206
|
- font-size: 24rpx;
|
|
|
207
|
- font-weight: 500;
|
|
|
208
|
- }
|
|
|
209
|
- }
|
|
|
210
|
- }
|
|
|
211
|
- }
|
|
|
212
|
-
|
|
|
213
|
- }
|
|
|
214
|
- }
|
113
|
+ },
|
|
|
114
|
+ }
|
|
|
115
|
+ }
|
|
|
116
|
+</script>
|
|
|
117
|
+
|
|
|
118
|
+<style lang="scss">
|
|
|
119
|
+ page {
|
|
|
120
|
+ background: rgba(246, 246, 246, 1);
|
|
|
121
|
+ }
|
|
|
122
|
+
|
|
|
123
|
+ .product_all {
|
|
|
124
|
+ .top {
|
|
|
125
|
+ position: fixed;
|
|
|
126
|
+ top: 0;
|
|
|
127
|
+ left: 0;
|
|
|
128
|
+ width: 100%;
|
|
|
129
|
+ z-index: 99;
|
|
|
130
|
+ height: 96rpx;
|
|
|
131
|
+ opacity: 1;
|
|
|
132
|
+ background: rgba(255, 255, 255, 1);
|
|
|
133
|
+ padding: 16rpx 32rpx;
|
|
|
134
|
+ display: flex;
|
|
|
135
|
+ box-sizing: border-box;
|
|
|
136
|
+ align-items: center;
|
|
|
137
|
+
|
|
|
138
|
+ image {
|
|
|
139
|
+ margin-right: 32rpx;
|
|
|
140
|
+ width: 48rpx;
|
|
|
141
|
+ height: 48rpx;
|
|
|
142
|
+ }
|
|
|
143
|
+
|
|
|
144
|
+ .search {
|
|
|
145
|
+ flex: 1;
|
|
|
146
|
+ display: flex;
|
|
|
147
|
+ align-items: center;
|
|
|
148
|
+
|
|
|
149
|
+ .tosear {
|
|
|
150
|
+ position: relative;
|
|
|
151
|
+ width: 522rpx;
|
|
|
152
|
+ height: 64rpx;
|
|
|
153
|
+ border-radius: 38rpx;
|
|
|
154
|
+ opacity: 1;
|
|
|
155
|
+
|
|
|
156
|
+ border: 0 solid rgba(0.5920000076293945, 0.5920000076293945, 0.5920000076293945, 1);
|
|
|
157
|
+ background: rgba(245, 245, 245, 1);
|
|
|
158
|
+ padding: 0 32rpx;
|
|
|
159
|
+
|
|
|
160
|
+ input {
|
|
|
161
|
+ text-align: center;
|
|
|
162
|
+ width: 100%;
|
|
|
163
|
+ height: 100%;
|
|
|
164
|
+ }
|
|
|
165
|
+
|
|
|
166
|
+ image {
|
|
|
167
|
+ position: absolute;
|
|
|
168
|
+ left: 280rpx;
|
|
|
169
|
+ top: 50%;
|
|
|
170
|
+ left: 36%;
|
|
|
171
|
+ transform: translateY(-50%);
|
|
|
172
|
+ width: 32rpx;
|
|
|
173
|
+ height: 32rpx;
|
|
|
174
|
+ }
|
|
|
175
|
+ }
|
|
|
176
|
+ }
|
|
|
177
|
+
|
|
|
178
|
+ }
|
|
|
179
|
+
|
|
|
180
|
+ .misslist {
|
|
|
181
|
+ margin-top: 104rpx;
|
|
|
182
|
+
|
|
|
183
|
+ .item {
|
|
|
184
|
+ padding: 24rpx;
|
|
|
185
|
+ box-sizing: border-box;
|
|
|
186
|
+
|
|
|
187
|
+ .types {
|
|
|
188
|
+ margin-top: 8rpx;
|
|
|
189
|
+ color: rgba(0, 0, 0, 0.6);
|
|
|
190
|
+ font-size: 24rpx;
|
|
|
191
|
+ font-weight: 400;
|
|
|
192
|
+ font-family: "PingFang SC";
|
|
|
193
|
+ }
|
|
|
194
|
+
|
|
|
195
|
+ .desc {
|
|
|
196
|
+ margin-top: 14rpx;
|
|
|
197
|
+ display: flex;
|
|
|
198
|
+ align-items: center;
|
|
|
199
|
+ justify-content: space-between;
|
|
|
200
|
+ color: rgba(0, 0, 0, 0.6);
|
|
|
201
|
+ font-size: 20rpx;
|
|
|
202
|
+ font-weight: 400;
|
|
|
203
|
+ font-family: "PingFang SC";
|
|
|
204
|
+
|
|
|
205
|
+ .money {
|
|
|
206
|
+
|
|
|
207
|
+ color: rgba(248, 83, 23, 1);
|
|
|
208
|
+ font-size: 32rpx;
|
|
|
209
|
+ font-weight: 700;
|
|
|
210
|
+ font-family: "Montserrat";
|
|
|
211
|
+
|
|
|
212
|
+ text {
|
|
|
213
|
+ font-size: 24rpx;
|
|
|
214
|
+ font-weight: 500;
|
|
|
215
|
+ }
|
|
|
216
|
+ }
|
|
|
217
|
+ }
|
|
|
218
|
+ }
|
|
|
219
|
+
|
|
|
220
|
+ }
|
|
|
221
|
+ }
|
215
|
</style> |
222
|
</style> |