feat: 对接部分接口

This commit is contained in:
anonymous
2025-01-09 10:45:10 +08:00
parent 21d8f75f6a
commit e70ca852d8
17 changed files with 165 additions and 62 deletions
+3 -2
View File
@@ -6,7 +6,7 @@
}
</route>
<template>
<view class="hot-news-page p-15">
<view class="hot-news-page min-h-screen p-15">
<view class="bg-#fff rounded-10 px-15 py-15" v-if="newsList.length > 0">
<view
class="flex mb-15"
@@ -17,7 +17,7 @@
<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>{{ item.name }}</view>
<view class="text-12 text-#999">{{ item.source }}</view>
<view class="text-12 text-#999">{{ formatTime(item.createtime) }}</view>
</view>
</view>
</view>
@@ -27,6 +27,7 @@
<script setup lang="ts">
import { getIntroductionAPI } from '@/service'
import { formatTime } from '@/utils'
const { list: newsList } = useListPageRequest((params) =>
getIntroductionAPI({ type: 1, ...params }),
+1 -1
View File
@@ -27,6 +27,6 @@ onLoad(async (options) => {
</view>
</view>
<image class="w-full mt-15" mode="widthFix" :src="getImageUrl(newsDetail.image)" />
<view class="text-14 text-gray-600 mt-15">{{ newsDetail.content }}</view>
<view class="text-14 text-gray-600 mt-15" v-html="newsDetail.content" />
</view>
</template>
+42 -1
View File
@@ -38,6 +38,36 @@
v-model="form.cardnum"
/>
</view>
<view class="py-15 text-14">
<view class="flex items-center">
<image src="@/static/images/page-sub/realname/realname-card.png" class="w-20 h-20" />
<view class="ml-8">证件照片</view>
</view>
<view
class="flex items-center justify-center mt-15 rounded-10 bg-#F1F9FC h-168 w-full"
@click="onUploadZCardImage"
>
<view v-if="!zcardimage" class="text-center">
<image src="@/static/images/page-sub/realname/upload-icon.png" class="w-40 h-40" />
<view class="text-14 text-#999 mt-10">点击上传身份证正面</view>
</view>
<view v-else class="flex items-center">
<image :src="zcardimage" class="w-315 h-168" mode="aspectFit" />
</view>
</view>
<view
class="flex items-center justify-center mt-15 rounded-10 bg-#F1F9FC h-168 w-full"
@click="onUploadFCardImage"
>
<view v-if="!fcardimage" class="text-center">
<image src="@/static/images/page-sub/realname/upload-icon.png" class="w-40 h-40" />
<view class="text-14 text-#999 mt-10">点击上传身份证反面</view>
</view>
<view v-else class="flex items-center">
<image :src="fcardimage" class="w-315 h-168" mode="aspectFit" />
</view>
</view>
</view>
</view>
<view class="fixed bottom-0 left-0 right-0 pb-safe">
<button class="btn-gradient text-white rounded-full m-15 text-16" @click="onSubmit">
@@ -112,7 +142,15 @@ const onSubmit = async () => {
await showModal('请填写完整信息')
return
}
await realNameAuthAPI(form.value)
if (!zcardimage.value || !fcardimage.value) {
await showModal('请上传身份证照片')
return
}
await realNameAuthAPI({
...form.value,
zcardimage: zcardimage.value,
fcardimage: fcardimage.value,
})
await showModal('提交成功,请耐心等待审核!')
realnameInfo.value = await getRealNameAuthAPI().then((res) => {
return res.data
@@ -125,6 +163,9 @@ const onGoHome = () => {
})
}
const { data: zcardimage, run: onUploadZCardImage } = useUpload()
const { data: fcardimage, run: onUploadFCardImage } = useUpload()
const realnameInfo = ref(null)
onLoad(async () => {
realnameInfo.value = await getRealNameAuthAPI().then((res) => {