|
@@ -25,12 +25,6 @@
|
|
|
<CellGroup class="article">
|
|
<CellGroup class="article">
|
|
|
<Cell class="home-main__titlebar" :title="$t('routes.news')" :value="$t('common.more')" icon="fire"
|
|
<Cell class="home-main__titlebar" :title="$t('routes.news')" :value="$t('common.more')" icon="fire"
|
|
|
:to="{ name: 'news-list' }" is-link />
|
|
:to="{ name: 'news-list' }" is-link />
|
|
|
- <template v-if="!loginStore.token">
|
|
|
|
|
- <template v-for="(item, index) in newsList" :key="index">
|
|
|
|
|
- <Cell class="article-item" :title="item.title" :value="formatDate(item.publishdate, 'MM/DD')"
|
|
|
|
|
- :to="{ name: 'news-detail', query: { id: item.id } }" />
|
|
|
|
|
- </template>
|
|
|
|
|
- </template>
|
|
|
|
|
</CellGroup>
|
|
</CellGroup>
|
|
|
</app-block>
|
|
</app-block>
|
|
|
<ProductList :data-list="goodsList" />
|
|
<ProductList :data-list="goodsList" />
|
|
@@ -41,9 +35,7 @@
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { shallowRef, onMounted, onActivated } from 'vue'
|
|
import { shallowRef, onMounted, onActivated } from 'vue'
|
|
|
import { Cell, CellGroup, PullRefresh, Badge, Search } from 'vant'
|
|
import { Cell, CellGroup, PullRefresh, Badge, Search } from 'vant'
|
|
|
-import { formatDate } from '@/filters'
|
|
|
|
|
import { queryImageConfigs } from '@/services/api/common'
|
|
import { queryImageConfigs } from '@/services/api/common'
|
|
|
-import { queryNewTitles } from '@/services/api/news'
|
|
|
|
|
import { queryTouristGoods, queryTouristQuoteDay } from '@/services/api/goods'
|
|
import { queryTouristGoods, queryTouristQuoteDay } from '@/services/api/goods'
|
|
|
import { useLoginStore, useNoticeStore, useGlobalStore, useFuturesStore } from '@/stores'
|
|
import { useLoginStore, useNoticeStore, useGlobalStore, useFuturesStore } from '@/stores'
|
|
|
import Banner from '@mobile/components/base/banner/index.vue'
|
|
import Banner from '@mobile/components/base/banner/index.vue'
|
|
@@ -57,7 +49,6 @@ const futuresStore = useFuturesStore()
|
|
|
const refreshing = shallowRef(false) // 是否处于加载中状态
|
|
const refreshing = shallowRef(false) // 是否处于加载中状态
|
|
|
const topBanners = shallowRef<string[]>([]); // 轮播图列表
|
|
const topBanners = shallowRef<string[]>([]); // 轮播图列表
|
|
|
const goodsList = shallowRef<Model.GoodsQuote[]>([])
|
|
const goodsList = shallowRef<Model.GoodsQuote[]>([])
|
|
|
-const newsList = shallowRef<Model.NewTitlesRsp[]>([]) // 资讯列表
|
|
|
|
|
|
|
|
|
|
// 下拉刷新
|
|
// 下拉刷新
|
|
|
const onRefresh = () => {
|
|
const onRefresh = () => {
|
|
@@ -70,17 +61,6 @@ const onRefresh = () => {
|
|
|
topBanners.value = res.data.map((e) => e.imagepath)
|
|
topBanners.value = res.data.map((e) => e.imagepath)
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- // 市场资讯
|
|
|
|
|
- queryNewTitles({
|
|
|
|
|
- data: {
|
|
|
|
|
- page: 1,
|
|
|
|
|
- pagesize: 10,
|
|
|
|
|
- }
|
|
|
|
|
- }).then((res) => {
|
|
|
|
|
- newsList.value = res.data
|
|
|
|
|
- }).finally(() => {
|
|
|
|
|
- refreshing.value = false
|
|
|
|
|
- })
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const getGoodsList = () => {
|
|
const getGoodsList = () => {
|
|
@@ -90,11 +70,9 @@ const getGoodsList = () => {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-onActivated(() => getGoodsList())
|
|
|
|
|
-
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
onRefresh()
|
|
onRefresh()
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (!loginStore.token) {
|
|
if (!loginStore.token) {
|
|
|
// 获取游客商品列表
|
|
// 获取游客商品列表
|
|
|
queryTouristGoods({
|
|
queryTouristGoods({
|
|
@@ -121,6 +99,8 @@ onMounted(() => {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+onActivated(() => getGoodsList())
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less">
|
|
<style lang="less">
|