|
@@ -27,33 +27,26 @@ const list = ref([
|
|
|
])
|
|
|
const requestUrl = `${baseURL}${Api.CatalogueList}`
|
|
|
const params = { pageNo: 1, pageSize: 9, state: 1, trend: '', order: 'desc' }
|
|
|
-const { data, pending, error, refresh } = await useAsyncData(
|
|
|
+const { data, refresh } = await useAsyncData(
|
|
|
'catalogue-list-s',
|
|
|
- () => $fetch(requestUrl, { params }),
|
|
|
+ () => $fetch(requestUrl, { method: 'GET', params }),
|
|
|
)
|
|
|
-watch(() => data.value, (newValue) => {
|
|
|
- if (newValue?.result)
|
|
|
- catalogueList.value = newValue?.result?.records || []
|
|
|
+watch(() => data.value?.result?.records, (newRecords: any[]) => {
|
|
|
+ if (newRecords) catalogueList.value = newRecords
|
|
|
}, { immediate: true })
|
|
|
|
|
|
function onVerticalSwiper(swiper: any) {
|
|
|
swiperVertical.value = swiper
|
|
|
}
|
|
|
function onClickLeft() {
|
|
|
- // swiperVertical.value.slideTo()
|
|
|
swiperVertical.value.slidePrev()
|
|
|
}
|
|
|
function onClickRight() {
|
|
|
- // swiperVertical.value.slideTo(4)
|
|
|
swiperVertical.value.slideNext()
|
|
|
}
|
|
|
function switchCatalogs(item: any) {
|
|
|
solution.value = item.key
|
|
|
- if (item.key === 'category')
|
|
|
- params.trend = ''
|
|
|
- else
|
|
|
- params.trend = '1'
|
|
|
-
|
|
|
+ params.trend = item.key === 'category' ? '' : '1'
|
|
|
refresh()
|
|
|
}
|
|
|
</script>
|