|
|
@@ -119,17 +119,12 @@
|
|
119
|
119
|
</template>
|
|
120
|
120
|
|
|
121
|
121
|
<script setup lang="ts">
|
|
122
|
|
-import CXBBasePage from "~/components/CXBBasePage/CXBBasePage.vue";
|
|
123
|
|
-import FSearch from "~/components/FSearch/FSearch.vue";
|
|
124
|
122
|
import {computed} from "vue";
|
|
125
|
123
|
import {getVipAreaList} from "~/apis/merchant";
|
|
126
|
|
-import {CDN_URL} from "~/config/app";
|
|
127
|
|
-import CXBEmpty from "~/components/CXBEmpty/CXBEmpty.vue";
|
|
128
|
124
|
import {getHomeBanner, getProductShare} from "~/apis/common";
|
|
129
|
125
|
import {useUserStore} from "~/stores/userStore";
|
|
130
|
126
|
import Cache from "~/utils/cache";
|
|
131
|
127
|
|
|
132
|
|
-const homeBanner = CDN_URL + '/static/assets/home-banner.png'
|
|
133
|
128
|
|
|
134
|
129
|
const systemInfo = uni.getSystemInfoSync()
|
|
135
|
130
|
const statusBarHeight = systemInfo.statusBarHeight ?? 0
|
|
|
@@ -149,7 +144,7 @@ const state = reactive({
|
|
149
|
144
|
|
|
150
|
145
|
keyword: '' ,
|
|
151
|
146
|
status: 'noMore',
|
|
152
|
|
- indicatorDots: true,
|
|
|
147
|
+ indicatorDots: false,
|
|
153
|
148
|
circular: true,
|
|
154
|
149
|
autoplay: true,
|
|
155
|
150
|
interval: 5000,
|
|
|
@@ -171,7 +166,7 @@ onLoad((option) => {
|
|
171
|
166
|
})
|
|
172
|
167
|
userStore.setRedirectPage(`/pages/vip/index`, 'page')
|
|
173
|
168
|
|
|
174
|
|
- getHomeBanner().then(res => {
|
|
|
169
|
+ getHomeBanner("user_banner").then(res => {
|
|
175
|
170
|
// console.log(res)
|
|
176
|
171
|
state.banners = res
|
|
177
|
172
|
})
|
|
|
@@ -216,7 +211,9 @@ onPageScroll((page) => {
|
|
216
|
211
|
|
|
217
|
212
|
|
|
218
|
213
|
function loadList(action: 'page' | 'reload', callback?: (items) => void) {
|
|
219
|
|
- // console.log(state.keyword)
|
|
|
214
|
+ if (action === 'reload') {
|
|
|
215
|
+ state.currentPage=1;
|
|
|
216
|
+ }
|
|
220
|
217
|
const params = {
|
|
221
|
218
|
page: state.currentPage,
|
|
222
|
219
|
limit: state.pageSize,
|
|
|
@@ -225,17 +222,26 @@ function loadList(action: 'page' | 'reload', callback?: (items) => void) {
|
|
225
|
222
|
if (state.keyword) {
|
|
226
|
223
|
params.keyword = state.keyword
|
|
227
|
224
|
}
|
|
228
|
|
- console.log(params)
|
|
229
|
225
|
getVipAreaList({
|
|
230
|
226
|
// page: state.currentPage,
|
|
231
|
227
|
// limit: state.pageSize
|
|
232
|
228
|
...params
|
|
233
|
229
|
}).then(res => {
|
|
234
|
|
- // console.log(res.list)
|
|
235
|
|
- console.log(res.list)
|
|
|
230
|
+
|
|
236
|
231
|
if (res) {
|
|
237
|
|
- list.value = res.list
|
|
|
232
|
+ if (action === 'reload') {
|
|
|
233
|
+ list.value = res.list
|
|
|
234
|
+ }else if (action === 'page') {
|
|
|
235
|
+ list.value = list.value.concat(res.list)
|
|
|
236
|
+ }
|
|
|
237
|
+ state.totalPage = Math.ceil(res.count / state.pageSize);
|
|
|
238
|
+ state.status = 'more'
|
|
|
239
|
+
|
|
|
240
|
+ if (callback) {
|
|
|
241
|
+ callback(res.list)
|
|
|
242
|
+ }
|
|
238
|
243
|
}
|
|
|
244
|
+
|
|
239
|
245
|
})
|
|
240
|
246
|
}
|
|
241
|
247
|
function handleItemClick(item) {
|
|
|
@@ -247,7 +253,7 @@ function handleItemClick(item) {
|
|
247
|
253
|
function handleScrollToLower() {
|
|
248
|
254
|
state.status = 'loading';
|
|
249
|
255
|
state.currentPage += 1;
|
|
250
|
|
- console.log(state.totalPage)
|
|
|
256
|
+ // console.log(state.totalPage)
|
|
251
|
257
|
if (state.currentPage > state.totalPage) {
|
|
252
|
258
|
state.status = 'noMore';
|
|
253
|
259
|
} else {
|
|
|
@@ -259,7 +265,6 @@ function handleScrollToLower() {
|
|
259
|
265
|
|
|
260
|
266
|
onReachBottom(() => {
|
|
261
|
267
|
console.log('到底了。。。')
|
|
262
|
|
-
|
|
263
|
268
|
handleScrollToLower()
|
|
264
|
269
|
|
|
265
|
270
|
})
|
|
|
@@ -304,4 +309,4 @@ page {
|
|
304
|
309
|
.f-nav-bar-icon {
|
|
305
|
310
|
--at-apply: 'text-lg'
|
|
306
|
311
|
}
|
|
307
|
|
-</style>
|
|
|
312
|
+</style>
|