feat: 接口对接完成

This commit is contained in:
anonymous
2025-01-03 16:44:05 +08:00
parent 0889d068a8
commit 2d19bbce4c
37 changed files with 1220 additions and 398 deletions
+49 -13
View File
@@ -20,11 +20,11 @@
<image class="w-30 h-30" src="@/static/images/home/nav-1.png" mode="aspectFill" />
<text class="mt-8 text-14 text-#333">简介</text>
</view>
<view class="flex-1 flex flex-col items-center" @click="handleInvite">
<!-- <view class="flex-1 flex flex-col items-center" @click="handleInvite">
<image class="w-30 h-30" src="@/static/images/home/nav-2.png" mode="aspectFill" />
<text class="mt-8 text-14 text-#333">抽奖转盘</text>
</view>
<view class="flex-1 flex flex-col items-center" @click="handleInvite">
</view> -->
<view class="flex-1 flex flex-col items-center" @click="handleReward">
<image class="w-30 h-30" src="@/static/images/home/nav-2.png" mode="aspectFill" />
<text class="mt-8 text-14 text-#333">奖励制度</text>
</view>
@@ -34,22 +34,29 @@
</view>
</view>
<view class="flex bg-white py-8 px-15 rounded-10 m-15">
<view class="flex bg-white py-8 px-15 rounded-10 m-15 items-center">
<view class="text-14 text-#333">系统公告</view>
<view class="text-12 ml-15 text-#999">每邀请人可以获得20股马尔代夫股权</view>
<view class="flex-1">
<wd-notice-bar
color="#999999"
background-color="transparent"
:text="announcementList.map((item) => item.name)"
/>
</view>
</view>
<view class="bg-white py-15 px-15 rounded-10 m-15">
<view class="text-14 text-#333">热点新闻</view>
<view class="flex mt-15" v-for="item in 10" :key="item">
<image
class="w-85 h-85 rounded-10"
src="@/static/images/home/news-2.png"
mode="aspectFill"
/>
<view
class="flex mt-15"
v-for="item in newsList"
:key="item.id"
@click="handleNewsDetail(item.id)"
>
<image class="w-85 h-85 rounded-10" :src="item.image" mode="aspectFill" />
<view class="ml-15 flex-1 flex flex-col justify-between">
<view text-14>#人海战术#签约!中央广播电视总台与农业农村部达成战略合作</view>
<view class="text-12 text-#999">证券时报网</view>
<view text-14>{{ item.name }}</view>
<view class="text-12 text-#999">{{ item.source }}</view>
</view>
</view>
</view>
@@ -58,17 +65,34 @@
<script lang="ts" setup>
import NavBar from '@/components/NavBar.vue'
import { getIntroductionAPI } from '@/service'
import { showModal } from '@/utils'
defineOptions({
name: 'Home',
})
const { list: newsList } = useListPageRequest((params) =>
getIntroductionAPI({ type: 1, ...params }),
)
// 系统公告
const { list: announcementList } = useListPageRequest((params) =>
getIntroductionAPI({ type: 2, ...params }),
)
const handleIntroduction = () => {
uni.navigateTo({
url: '/pages-sub/introduction/index',
})
}
const handleNewsDetail = (id: number) => {
uni.navigateTo({
url: `/pages-sub/news-detail/index?id=${id}`,
})
}
const handleInvite = () => {
uni.navigateTo({
url: '/pages/invite/index',
@@ -80,6 +104,18 @@ const handleOfficialCommunity = () => {
url: '/pages-sub/official-community/index',
})
}
const handleReward = () => {
showModal(
`1.注册立即送5000股马尔代夫股权;\n
2.每股马尔代夫股权价值500元;\n
3.每邀请一人可以获得20股马尔代夫股权`,
{
title: '奖励制度',
confirmText: '我知道了',
},
)
}
</script>
<style>