|
|
@@ -33,28 +33,29 @@
|
|
|
</template>
|
|
|
</CellGroup>
|
|
|
</app-block>
|
|
|
- <app-block class="home-main__group" v-if="loginStore.token">
|
|
|
- <GroupList :market-id="53201" />
|
|
|
- </app-block>
|
|
|
+ <ProductList :data-list="goodsList" v-if="loginStore.token" />
|
|
|
</PullRefresh>
|
|
|
</app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef } from 'vue'
|
|
|
+import { shallowRef, onMounted, onActivated } from 'vue'
|
|
|
import { Cell, CellGroup, PullRefresh, Badge, Search } from 'vant'
|
|
|
import { formatDate } from '@/filters'
|
|
|
import { queryImageConfigs } from '@/services/api/common'
|
|
|
import { queryNewTitles } from '@/services/api/news'
|
|
|
-import { useLoginStore, useNoticeStore, useGlobalStore } from '@/stores'
|
|
|
+import { useLoginStore, useNoticeStore, useGlobalStore, useFuturesStore } from '@/stores'
|
|
|
import Banner from '@mobile/components/base/banner/index.vue'
|
|
|
-import GroupList from '../../group/list/index.vue'
|
|
|
+import ProductList from '../../product/list/components/waterfall-list/index.vue'
|
|
|
|
|
|
const noticeStore = useNoticeStore()
|
|
|
const loginStore = useLoginStore()
|
|
|
const globalStore = useGlobalStore()
|
|
|
+const futuresStore = useFuturesStore()
|
|
|
+
|
|
|
const refreshing = shallowRef(false) // 是否处于加载中状态
|
|
|
const topBanners = shallowRef<string[]>([]); // 轮播图列表
|
|
|
+const goodsList = shallowRef<Model.GoodsQuote[]>([])
|
|
|
const newsList = shallowRef<Model.NewTitlesRsp[]>([]) // 资讯列表
|
|
|
|
|
|
// 下拉刷新
|
|
|
@@ -81,7 +82,19 @@ const onRefresh = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-onRefresh()
|
|
|
+const getGoodsList = () => {
|
|
|
+ const list = futuresStore.quotationList.filter((e) => e.marketid === 53201)
|
|
|
+ goodsList.value = list.map((e) => ({ ...e }))
|
|
|
+}
|
|
|
+
|
|
|
+futuresStore.onDataCompleted(() => {
|
|
|
+ getGoodsList()
|
|
|
+})
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ onRefresh()
|
|
|
+ onActivated(() => getGoodsList())
|
|
|
+})
|
|
|
</script>
|
|
|
|
|
|
<style lang="less">
|