fix: resolve todo
This commit is contained in:
@@ -16,12 +16,6 @@ export namespace MpAccountApi {
|
||||
remark?: string;
|
||||
createTime?: Date;
|
||||
}
|
||||
|
||||
// TODO @dylan:这个直接使用 Account,简化一点;
|
||||
export interface AccountSimple {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询公众号账号列表 */
|
||||
@@ -41,7 +35,7 @@ export function getAccount(id: number) {
|
||||
|
||||
/** 查询公众号账号列表 */
|
||||
export function getSimpleAccountList() {
|
||||
return requestClient.get<MpAccountApi.AccountSimple[]>(
|
||||
return requestClient.get<MpAccountApi.Account[]>(
|
||||
'/mp/account/list-all-simple',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,18 +17,20 @@ defineExpose({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="news-home">
|
||||
<div v-for="(article, index) in articles" :key="index" class="news-div">
|
||||
<div class="mx-auto flex w-full flex-col gap-[10px] bg-white">
|
||||
<div v-for="(article, index) in articles" :key="index">
|
||||
<!-- 头条 -->
|
||||
<a v-if="index === 0" :href="article.url" target="_blank">
|
||||
<div class="news-main">
|
||||
<div class="news-content">
|
||||
<div class="mx-auto w-full">
|
||||
<div class="relative w-full bg-[#acadae]">
|
||||
<img
|
||||
:src="article.picUrl"
|
||||
:preview="false"
|
||||
class="material-img flex w-[100px] items-center justify-center"
|
||||
class="w-[100px] object-cover"
|
||||
/>
|
||||
<div class="news-content-title">
|
||||
<div
|
||||
class="absolute bottom-0 left-0 ml-[10px] inline-block w-[98%] whitespace-normal p-[1%] text-base text-white"
|
||||
>
|
||||
<span>{{ article.title }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -36,10 +38,10 @@ defineExpose({
|
||||
</a>
|
||||
<!-- 二条/三条等等 -->
|
||||
<a v-else :href="article.url" target="_blank">
|
||||
<div class="news-main-item">
|
||||
<div class="news-content-item">
|
||||
<div class="news-content-item-img">
|
||||
<div class="news-content-item-title">{{ article.title }}</div>
|
||||
<div class="bg-white">
|
||||
<div class="relative box-border p-[10px]">
|
||||
<div class="flex items-center">
|
||||
<div class="flex-1 text-sm">{{ article.title }}</div>
|
||||
|
||||
<img
|
||||
:src="article.picUrl"
|
||||
@@ -53,66 +55,3 @@ defineExpose({
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/** TODO @dylan:看看有没适合 tindwind 的哈。 */
|
||||
|
||||
.news-home {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
width: 100%;
|
||||
margin: auto;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.news-main {
|
||||
width: 100%;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.news-content {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
background-color: #acadae;
|
||||
}
|
||||
|
||||
.news-content-title {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
box-sizing: unset !important;
|
||||
display: inline-block;
|
||||
width: 98%;
|
||||
padding: 1%;
|
||||
margin-left: 10px;
|
||||
font-size: 16px;
|
||||
color: #fff;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.news-main-item {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.news-content-item {
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.news-content-item-title {
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.news-content-item-img {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.material-img {
|
||||
width: auto;
|
||||
object-fit: cover;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -63,11 +63,13 @@ function amrStop() {
|
||||
playing.value = false;
|
||||
amr.value.stop();
|
||||
}
|
||||
// TODO dylan:下面样式有点问题
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="wx-voice-div" @click="playVoice">
|
||||
<div
|
||||
class="flex h-[50px] w-[120px] cursor-pointer items-center justify-center rounded-[10px] bg-[#eaeaea] p-[5px]"
|
||||
@click="playVoice"
|
||||
>
|
||||
<el-icon>
|
||||
<IconifyIcon
|
||||
v-if="playing !== true"
|
||||
@@ -75,7 +77,9 @@ function amrStop() {
|
||||
:size="32"
|
||||
/>
|
||||
<IconifyIcon v-else icon="lucide:circle-pause" :size="32" />
|
||||
<span class="amr-duration" v-if="duration">{{ duration }} 秒</span>
|
||||
<span v-if="duration" class="ml-[5px] text-[11px]">
|
||||
{{ duration }} 秒
|
||||
</span>
|
||||
</el-icon>
|
||||
<div v-if="content">
|
||||
<el-tag type="success" size="small">语音识别</el-tag>
|
||||
@@ -83,21 +87,3 @@ function amrStop() {
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
/** TODO @dylan:看看有没适合 tindwind 的哈。 */
|
||||
.wx-voice-div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
padding: 5px;
|
||||
background-color: #eaeaea;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.amr-duration {
|
||||
margin-left: 5px;
|
||||
font-size: 11px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -6,7 +6,7 @@ import { formatDateTime } from '@vben/utils';
|
||||
|
||||
import { getSimpleAccountList } from '#/api/mp/account';
|
||||
|
||||
let accountList: MpAccountApi.AccountSimple[] = [];
|
||||
let accountList: MpAccountApi.Account[] = [];
|
||||
getSimpleAccountList().then((data) => (accountList = data));
|
||||
|
||||
/** 搜索表单配置 */
|
||||
|
||||
Reference in New Issue
Block a user