@@ -162,14 +162,14 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
<Tabs.TabPane :key="String(AutoReplyMsgType.Follow)">
|
<Tabs.TabPane :key="String(AutoReplyMsgType.Follow)">
|
||||||
<template #tab>
|
<template #tab>
|
||||||
<Row align="middle">
|
<Row align="middle">
|
||||||
<IconifyIcon icon="ep:star" class="mr-2px" /> 关注时回复
|
<IconifyIcon icon="lucide:star" class="mr-2px" /> 关注时回复
|
||||||
</Row>
|
</Row>
|
||||||
</template>
|
</template>
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
<Tabs.TabPane :key="String(AutoReplyMsgType.Message)">
|
<Tabs.TabPane :key="String(AutoReplyMsgType.Message)">
|
||||||
<template #tab>
|
<template #tab>
|
||||||
<Row align="middle">
|
<Row align="middle">
|
||||||
<IconifyIcon icon="ep:chat-line-round" class="mr-2px" />
|
<IconifyIcon icon="lucide:message-circle-more" class="mr-2px" />
|
||||||
消息回复
|
消息回复
|
||||||
</Row>
|
</Row>
|
||||||
</template>
|
</template>
|
||||||
@@ -177,7 +177,8 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
<Tabs.TabPane :key="String(AutoReplyMsgType.Keyword)">
|
<Tabs.TabPane :key="String(AutoReplyMsgType.Keyword)">
|
||||||
<template #tab>
|
<template #tab>
|
||||||
<Row align="middle">
|
<Row align="middle">
|
||||||
<IconifyIcon icon="fa:newspaper-o" class="mr-2px" /> 关键词回复
|
<IconifyIcon icon="lucide:newspaper" class="mr-2px" />
|
||||||
|
关键词回复
|
||||||
</Row>
|
</Row>
|
||||||
</template>
|
</template>
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
|
|||||||
@@ -291,11 +291,19 @@ watch(
|
|||||||
<!-- TODO @dylan:看看图片的小卡片,是不是可以整齐点,类似微信公众号,图片的高度是一致的哈;https://mp.weixin.qq.com/cgi-bin/filepage?type=2&begin=0&count=12&token=1646383362&lang=zh_CN -->
|
<!-- TODO @dylan:看看图片的小卡片,是不是可以整齐点,类似微信公众号,图片的高度是一致的哈;https://mp.weixin.qq.com/cgi-bin/filepage?type=2&begin=0&count=12&token=1646383362&lang=zh_CN -->
|
||||||
<template v-if="props.type === 'image'">
|
<template v-if="props.type === 'image'">
|
||||||
<Spin :spinning="loading">
|
<Spin :spinning="loading">
|
||||||
<div class="waterfall">
|
<div
|
||||||
<div v-for="item in list" :key="item.mediaId" class="waterfall-item">
|
class="mx-auto w-full columns-1 [column-gap:10px] md:columns-2 lg:columns-3 xl:columns-4 2xl:columns-5"
|
||||||
<img class="material-img" :src="item.url" alt="素材图片" />
|
>
|
||||||
<p class="item-name">{{ item.name }}</p>
|
<div
|
||||||
<Row class="ope-row">
|
v-for="item in list"
|
||||||
|
:key="item.mediaId"
|
||||||
|
class="mb-2.5 break-inside-avoid border border-[#eaeaea] p-2.5"
|
||||||
|
>
|
||||||
|
<img class="w-full" :src="item.url" alt="素材图片" />
|
||||||
|
<p class="truncate text-center text-xs leading-[30px]">
|
||||||
|
{{ item.name }}
|
||||||
|
</p>
|
||||||
|
<Row class="flex justify-center pt-2.5">
|
||||||
<Button type="primary" @click="selectMaterialFun(item)">
|
<Button type="primary" @click="selectMaterialFun(item)">
|
||||||
选择
|
选择
|
||||||
<template #icon>
|
<template #icon>
|
||||||
@@ -353,11 +361,17 @@ watch(
|
|||||||
<!-- 类型:news -->
|
<!-- 类型:news -->
|
||||||
<template v-else-if="props.type === 'news'">
|
<template v-else-if="props.type === 'news'">
|
||||||
<Spin :spinning="loading">
|
<Spin :spinning="loading">
|
||||||
<div class="waterfall">
|
<div
|
||||||
<div v-for="item in list" :key="item.mediaId" class="waterfall-item">
|
class="mx-auto w-full columns-1 [column-gap:10px] md:columns-2 lg:columns-3 xl:columns-4 2xl:columns-5"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-for="item in list"
|
||||||
|
:key="item.mediaId"
|
||||||
|
class="mb-2.5 break-inside-avoid border border-[#eaeaea] p-2.5"
|
||||||
|
>
|
||||||
<div v-if="item.content && item.content.newsItem">
|
<div v-if="item.content && item.content.newsItem">
|
||||||
<WxNews :articles="item.content.newsItem" />
|
<WxNews :articles="item.content.newsItem" />
|
||||||
<Row class="ope-row">
|
<Row class="flex justify-center pt-2.5">
|
||||||
<Button type="primary" @click="selectMaterialFun(item)">
|
<Button type="primary" @click="selectMaterialFun(item)">
|
||||||
选择
|
选择
|
||||||
<template #icon>
|
<template #icon>
|
||||||
@@ -380,67 +394,3 @@ watch(
|
|||||||
</template>
|
</template>
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
/** TODO @dylan:看看有没适合 tindwind 的哈。 */
|
|
||||||
@media (width >= 992px) and (width <= 1300px) {
|
|
||||||
.waterfall {
|
|
||||||
column-count: 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (width >= 768px) and (width <= 991px) {
|
|
||||||
.waterfall {
|
|
||||||
column-count: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
color: orange;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (width <= 767px) {
|
|
||||||
.waterfall {
|
|
||||||
column-count: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.waterfall {
|
|
||||||
column-count: 5;
|
|
||||||
column-gap: 10px;
|
|
||||||
width: 100%;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.waterfall-item {
|
|
||||||
padding: 10px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
border: 1px solid #eaeaea;
|
|
||||||
break-inside: avoid;
|
|
||||||
}
|
|
||||||
|
|
||||||
.material-img {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
line-height: 30px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ope-row {
|
|
||||||
padding-top: 10px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item-name {
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
font-size: 12px;
|
|
||||||
text-align: center;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -32,25 +32,44 @@ function getNickname(sendFrom: number) {
|
|||||||
<template>
|
<template>
|
||||||
<div class="execution" v-for="item in props.list" :key="item.id">
|
<div class="execution" v-for="item in props.list" :key="item.id">
|
||||||
<div
|
<div
|
||||||
class="mp-comment"
|
class="mb-[30px] flex items-start"
|
||||||
:class="{ 'mp-comment--reverse': item.sendFrom === SendFrom.MpBot }"
|
:class="{ 'flex-row-reverse': item.sendFrom === SendFrom.MpBot }"
|
||||||
>
|
>
|
||||||
<div class="avatar-div">
|
<div class="flex w-20 flex-col items-center text-center">
|
||||||
<img :src="getAvatar(item.sendFrom)" class="mp-comment__avatar" />
|
<img
|
||||||
<div class="mp-comment__author">
|
:src="getAvatar(item.sendFrom)"
|
||||||
|
class="mb-2 h-12 w-12 rounded-full border border-transparent object-cover"
|
||||||
|
/>
|
||||||
|
<div class="text-sm font-semibold text-[#999]">
|
||||||
{{ getNickname(item.sendFrom) }}
|
{{ getNickname(item.sendFrom) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mp-comment__main">
|
<div class="relative mx-2 flex-1 rounded-[5px] border border-[#dedede]">
|
||||||
<div class="mp-comment__header">
|
<span
|
||||||
<div class="mp-comment__create_time">
|
class="pointer-events-none absolute -left-2 top-[10px] h-0 w-0 border-y-[8px] border-r-[8px] border-y-transparent border-r-[#dedede]"
|
||||||
|
:class="{
|
||||||
|
'-right-2 left-auto border-l-[8px] border-r-0 border-l-[#dedede]':
|
||||||
|
item.sendFrom === SendFrom.MpBot,
|
||||||
|
}"
|
||||||
|
></span>
|
||||||
|
<span
|
||||||
|
class="pointer-events-none absolute -left-[7px] top-[10px] h-0 w-0 border-y-[8px] border-r-[8px] border-y-transparent border-r-[#f8f8f8]"
|
||||||
|
:class="{
|
||||||
|
'-right-[7px] left-auto border-l-[8px] border-r-0 border-l-[#f8f8f8]':
|
||||||
|
item.sendFrom === SendFrom.MpBot,
|
||||||
|
}"
|
||||||
|
></span>
|
||||||
|
<div
|
||||||
|
class="flex items-center justify-between rounded-t-[5px] border-b border-[#eee] bg-[#f8f8f8] px-[15px] py-[5px]"
|
||||||
|
>
|
||||||
|
<div class="text-xs text-gray-500">
|
||||||
{{ formatDateTime(item.createTime) }}
|
{{ formatDateTime(item.createTime) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="mp-comment__body"
|
class="overflow-hidden rounded-b-[5px] p-[15px] text-sm text-[#333]"
|
||||||
:style="
|
:class="
|
||||||
item.sendFrom === SendFrom.MpBot ? 'background: #6BED72;' : ''
|
item.sendFrom === SendFrom.MpBot ? 'bg-[#6BED72]' : 'bg-white'
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<Msg :item="item" />
|
<Msg :item="item" />
|
||||||
@@ -59,17 +78,3 @@ function getNickname(sendFrom: number) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
/* 因为 joolun 实现依赖 avue 组件,该页面使用了 comment.scss、card.scc */
|
|
||||||
|
|
||||||
/** TODO @dylan: 看看有没适合 tindwind 的哈。 */
|
|
||||||
|
|
||||||
@import url('./comment.scss');
|
|
||||||
@import url('./card.scss');
|
|
||||||
|
|
||||||
.avatar-div {
|
|
||||||
width: 80px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -28,64 +28,27 @@ defineExpose({
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<Link :href="href" target="_blank" class="text-success no-underline">
|
<Link :href="href" target="_blank" class="text-success no-underline">
|
||||||
<div class="music-card">
|
<div
|
||||||
<div class="music-avatar">
|
class="flex items-center rounded-[5px] border border-[#e8e8e8] bg-white p-2.5 transition hover:border-black/10 hover:shadow-sm"
|
||||||
<img :src="thumbMediaUrl" alt="音乐封面" />
|
>
|
||||||
|
<div
|
||||||
|
class="mr-3 h-[60px] w-[60px] overflow-hidden rounded-[4px] border border-transparent"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
:src="thumbMediaUrl"
|
||||||
|
alt="音乐封面"
|
||||||
|
class="h-full w-full object-cover"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="music-detail">
|
<div class="min-w-0 flex-1">
|
||||||
<div class="music-title">{{ title }}</div>
|
<div class="mb-2 truncate text-sm font-medium text-[#333]">
|
||||||
<div class="music-description">{{ description }}</div>
|
{{ title }}
|
||||||
|
</div>
|
||||||
|
<div class="truncate text-xs text-[#666]">
|
||||||
|
{{ description }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
/** TODO @dylan:看看有没适合 tindwind 的哈。 */
|
|
||||||
|
|
||||||
.music-card {
|
|
||||||
display: flex;
|
|
||||||
padding: 10px;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.music-avatar {
|
|
||||||
flex-shrink: 0;
|
|
||||||
width: 60px;
|
|
||||||
height: 60px;
|
|
||||||
margin-right: 12px;
|
|
||||||
overflow: hidden;
|
|
||||||
border-radius: 4px;
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
object-fit: cover;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.music-detail {
|
|
||||||
flex: 1;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.music-title {
|
|
||||||
margin-bottom: 8px;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.music-description {
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #666;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { Image } from 'ant-design-vue';
|
|
||||||
|
|
||||||
/** 微信消息 - 图文 */
|
/** 微信消息 - 图文 */
|
||||||
defineOptions({ name: 'WxNews' });
|
defineOptions({ name: 'WxNews' });
|
||||||
|
|
||||||
@@ -22,14 +20,13 @@ defineExpose({
|
|||||||
<div class="news-home">
|
<div class="news-home">
|
||||||
<div v-for="(article, index) in articles" :key="index" class="news-div">
|
<div v-for="(article, index) in articles" :key="index" class="news-div">
|
||||||
<!-- 头条 -->
|
<!-- 头条 -->
|
||||||
<!-- TODO @hw:第一篇文章(头条)图片是铺满,不过要限制高度;第二篇文章开始(次条),图片是在右侧,也是需要限制宽高 -->
|
|
||||||
<a v-if="index === 0" :href="article.url" target="_blank">
|
<a v-if="index === 0" :href="article.url" target="_blank">
|
||||||
<div class="news-main">
|
<div class="news-main">
|
||||||
<div class="news-content">
|
<div class="news-content">
|
||||||
<Image
|
<img
|
||||||
:src="article.picUrl"
|
:src="article.picUrl"
|
||||||
:preview="false"
|
:preview="false"
|
||||||
class="material-img flex items-center justify-center"
|
class="material-img flex w-[100px] items-center justify-center"
|
||||||
/>
|
/>
|
||||||
<div class="news-content-title">
|
<div class="news-content-title">
|
||||||
<span>{{ article.title }}</span>
|
<span>{{ article.title }}</span>
|
||||||
@@ -41,9 +38,14 @@ defineExpose({
|
|||||||
<a v-else :href="article.url" target="_blank">
|
<a v-else :href="article.url" target="_blank">
|
||||||
<div class="news-main-item">
|
<div class="news-main-item">
|
||||||
<div class="news-content-item">
|
<div class="news-content-item">
|
||||||
<div class="news-content-item-title">{{ article.title }}</div>
|
|
||||||
<div class="news-content-item-img">
|
<div class="news-content-item-img">
|
||||||
<img :src="article.picUrl" class="material-img" alt="文章图片" />
|
<div class="news-content-item-title">{{ article.title }}</div>
|
||||||
|
|
||||||
|
<img
|
||||||
|
:src="article.picUrl"
|
||||||
|
class="h-[70px] w-[70px] object-cover"
|
||||||
|
alt="文章图片"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -56,6 +58,9 @@ defineExpose({
|
|||||||
/** TODO @dylan:看看有没适合 tindwind 的哈。 */
|
/** TODO @dylan:看看有没适合 tindwind 的哈。 */
|
||||||
|
|
||||||
.news-home {
|
.news-home {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@@ -80,39 +85,35 @@ defineExpose({
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 98%;
|
width: 98%;
|
||||||
padding: 1%;
|
padding: 1%;
|
||||||
font-size: 12px;
|
margin-left: 10px;
|
||||||
|
font-size: 16px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
background-color: black;
|
|
||||||
opacity: 0.65;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.news-main-item {
|
.news-main-item {
|
||||||
padding: 5px 0;
|
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-top: 1px solid #eaeaea;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.news-content-item {
|
.news-content-item {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.news-content-item-title {
|
.news-content-item-title {
|
||||||
display: inline-block;
|
flex: 1;
|
||||||
width: 70%;
|
font-size: 14px;
|
||||||
margin-left: 1%;
|
// padding-left: 10px;
|
||||||
font-size: 10px;
|
|
||||||
white-space: normal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.news-content-item-img {
|
.news-content-item-img {
|
||||||
display: inline-block;
|
display: flex;
|
||||||
width: 25%;
|
align-items: center;
|
||||||
margin-right: 1%;
|
|
||||||
background-color: #acadae;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.material-img {
|
.material-img {
|
||||||
width: 100%;
|
width: auto;
|
||||||
|
object-fit: cover;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ function selectMaterial(item: any) {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
/** TODO @dylan:看看有没适合 tindwind 的哈。 */
|
/** TODO @dylan:看看有没适合 tindwind 的哈。 */
|
||||||
.select-item {
|
.select-item {
|
||||||
width: 280px;
|
// width: 280px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
margin: 0 auto 10px;
|
margin: 0 auto 10px;
|
||||||
border: 1px solid #eaeaea;
|
border: 1px solid #eaeaea;
|
||||||
|
|||||||
@@ -1,20 +1,6 @@
|
|||||||
import { requestClient } from '#/api/request';
|
import { MenuType } from '@vben/constants';
|
||||||
|
|
||||||
/** 菜单类型枚举 */
|
import { requestClient } from '#/api/request';
|
||||||
// TODO @hw:这里还有枚举
|
|
||||||
export enum MenuType {
|
|
||||||
CLICK = 'click', // 点击推事件
|
|
||||||
LOCATION_SELECT = 'location_select', // 发送位置
|
|
||||||
MEDIA_ID = 'media_id', // 下发消息
|
|
||||||
MINIPROGRAM = 'miniprogram', // 小程序
|
|
||||||
PIC_PHOTO_OR_ALBUM = 'pic_photo_or_album', // 拍照或者相册发图
|
|
||||||
PIC_SYSPHOTO = 'pic_sysphoto', // 系统拍照发图
|
|
||||||
PIC_WEIXIN = 'pic_weixin', // 微信相册发图
|
|
||||||
SCANCODE_PUSH = 'scancode_push', // 扫码推事件
|
|
||||||
SCANCODE_WAITMSG = 'scancode_waitmsg', // 扫码带提示
|
|
||||||
VIEW = 'view', // 跳转URL
|
|
||||||
VIEW_LIMITED = 'view_limited', // 跳转图文消息URL
|
|
||||||
}
|
|
||||||
|
|
||||||
export namespace MpMenuApi {
|
export namespace MpMenuApi {
|
||||||
/** 菜单按钮信息 */
|
/** 菜单按钮信息 */
|
||||||
|
|||||||
@@ -161,14 +161,17 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
<ElTabPane :name="String(AutoReplyMsgType.Follow)">
|
<ElTabPane :name="String(AutoReplyMsgType.Follow)">
|
||||||
<template #label>
|
<template #label>
|
||||||
<ElRow align="middle">
|
<ElRow align="middle">
|
||||||
<IconifyIcon icon="ep:star" class="mr-[2px]" /> 关注时回复
|
<IconifyIcon icon="lucide:star" class="mr-[2px]" /> 关注时回复
|
||||||
</ElRow>
|
</ElRow>
|
||||||
</template>
|
</template>
|
||||||
</ElTabPane>
|
</ElTabPane>
|
||||||
<ElTabPane :name="String(AutoReplyMsgType.Message)">
|
<ElTabPane :name="String(AutoReplyMsgType.Message)">
|
||||||
<template #label>
|
<template #label>
|
||||||
<ElRow align="middle">
|
<ElRow align="middle">
|
||||||
<IconifyIcon icon="ep:chat-line-round" class="mr-[2px]" />
|
<IconifyIcon
|
||||||
|
icon="lucide:message-circle-more"
|
||||||
|
class="mr-[2px]"
|
||||||
|
/>
|
||||||
消息回复
|
消息回复
|
||||||
</ElRow>
|
</ElRow>
|
||||||
</template>
|
</template>
|
||||||
@@ -176,7 +179,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||||||
<ElTabPane :name="String(AutoReplyMsgType.Keyword)">
|
<ElTabPane :name="String(AutoReplyMsgType.Keyword)">
|
||||||
<template #label>
|
<template #label>
|
||||||
<ElRow align="middle">
|
<ElRow align="middle">
|
||||||
<IconifyIcon icon="fa:newspaper-o" class="mr-[2px]" />
|
<IconifyIcon icon="lucide:newspaper" class="mr-[2px]" />
|
||||||
关键词回复
|
关键词回复
|
||||||
</ElRow>
|
</ElRow>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -4,32 +4,54 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { WxLocationProps } from './types';
|
import type { WxLocationProps } from './types';
|
||||||
|
|
||||||
import { computed } from 'vue';
|
import { computed, onMounted, ref } from 'vue';
|
||||||
|
|
||||||
import { IconifyIcon } from '@vben/icons';
|
import { IconifyIcon } from '@vben/icons';
|
||||||
|
|
||||||
// TODO @dylan:@hw:apps/web-antd/src/views/mall/trade/delivery/pickUpStore/modules/form.vue 参考这个,从后端拿 key 哈
|
import { ElCol, ElLink, ElMessage, ElRow } from 'element-plus';
|
||||||
import { ElCol, ElLink, ElRow } from 'element-plus';
|
|
||||||
|
import { getTradeConfig } from '#/api/mall/trade/config';
|
||||||
|
|
||||||
defineOptions({ name: 'Location' });
|
defineOptions({ name: 'Location' });
|
||||||
|
|
||||||
const props = withDefaults(defineProps<WxLocationProps>(), {
|
const props = defineProps<WxLocationProps>();
|
||||||
qqMapKey: 'TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E', // QQ 地图的密钥 https://lbs.qq.com/service/staticV2/staticGuide/staticDoc
|
|
||||||
});
|
const fetchedQqMapKey = ref('');
|
||||||
|
const resolvedQqMapKey = computed(
|
||||||
|
() => props.qqMapKey || fetchedQqMapKey.value || '',
|
||||||
|
);
|
||||||
|
|
||||||
const mapUrl = computed(() => {
|
const mapUrl = computed(() => {
|
||||||
return `https://map.qq.com/?type=marker&isopeninfowin=1&markertype=1&pointx=${props.locationY}&pointy=${props.locationX}&name=${props.label}&ref=yudao`;
|
return `https://map.qq.com/?type=marker&isopeninfowin=1&markertype=1&pointx=${props.locationY}&pointy=${props.locationX}&name=${props.label}&ref=yudao`;
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapImageUrl = computed(() => {
|
const mapImageUrl = computed(() => {
|
||||||
return `https://apis.map.qq.com/ws/staticmap/v2/?zoom=10&markers=color:blue|label:A|${props.locationX},${props.locationY}&key=${props.qqMapKey}&size=250*180`;
|
return `https://apis.map.qq.com/ws/staticmap/v2/?zoom=10&markers=color:blue|label:A|${props.locationX},${props.locationY}&key=${resolvedQqMapKey.value}&size=250*180`;
|
||||||
|
});
|
||||||
|
|
||||||
|
async function fetchQqMapKey() {
|
||||||
|
try {
|
||||||
|
const data = await getTradeConfig();
|
||||||
|
fetchedQqMapKey.value = data.tencentLbsKey ?? '';
|
||||||
|
if (!fetchedQqMapKey.value) {
|
||||||
|
ElMessage.warning('请先配置腾讯位置服务密钥');
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
ElMessage.error('获取腾讯位置服务密钥失败');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
if (!props.qqMapKey) {
|
||||||
|
await fetchQqMapKey();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
locationX: props.locationX,
|
locationX: props.locationX,
|
||||||
locationY: props.locationY,
|
locationY: props.locationY,
|
||||||
label: props.label,
|
label: props.label,
|
||||||
qqMapKey: props.qqMapKey,
|
qqMapKey: resolvedQqMapKey,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -42,7 +64,7 @@ defineExpose({
|
|||||||
<img :src="mapImageUrl" alt="地图位置" />
|
<img :src="mapImageUrl" alt="地图位置" />
|
||||||
</ElRow>
|
</ElRow>
|
||||||
<ElRow>
|
<ElRow>
|
||||||
<IconifyIcon icon="ep:location" />
|
<IconifyIcon icon="lucide:map-pin" />
|
||||||
{{ label }}
|
{{ label }}
|
||||||
</ElRow>
|
</ElRow>
|
||||||
</ElCol>
|
</ElCol>
|
||||||
|
|||||||
@@ -36,8 +36,9 @@ const props = withDefaults(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const emit = defineEmits(['selectMaterial']);
|
const emit = defineEmits<{
|
||||||
|
(e: 'selectMaterial', item: any): void;
|
||||||
|
}>();
|
||||||
const loading = ref(false); // 遮罩层
|
const loading = ref(false); // 遮罩层
|
||||||
const total = ref(0); // 总条数
|
const total = ref(0); // 总条数
|
||||||
const list = ref<any[]>([]); // 数据列表
|
const list = ref<any[]>([]); // 数据列表
|
||||||
@@ -116,14 +117,23 @@ onMounted(async () => {
|
|||||||
<div class="pb-30px">
|
<div class="pb-30px">
|
||||||
<!-- 类型:image -->
|
<!-- 类型:image -->
|
||||||
<div v-if="props.type === 'image'">
|
<div v-if="props.type === 'image'">
|
||||||
<div class="waterfall" v-loading="loading">
|
<div
|
||||||
<div class="waterfall-item" v-for="item in list" :key="item.mediaId">
|
class="mx-auto w-full columns-1 [column-gap:10px] md:columns-2 lg:columns-3 xl:columns-4 2xl:columns-5"
|
||||||
<img class="material-img" :src="item.url" />
|
v-loading="loading"
|
||||||
<p class="item-name">{{ item.name }}</p>
|
>
|
||||||
<ElRow class="ope-row">
|
<div
|
||||||
|
class="mb-2.5 break-inside-avoid border border-[#eaeaea] p-2.5"
|
||||||
|
v-for="item in list"
|
||||||
|
:key="item.mediaId"
|
||||||
|
>
|
||||||
|
<img class="w-full" :src="item.url" />
|
||||||
|
<p class="truncate text-center text-xs leading-[30px]">
|
||||||
|
{{ item.name }}
|
||||||
|
</p>
|
||||||
|
<ElRow class="flex justify-center pt-2.5">
|
||||||
<ElButton type="success" @click="selectMaterialFun(item)">
|
<ElButton type="success" @click="selectMaterialFun(item)">
|
||||||
选择
|
选择
|
||||||
<IconifyIcon icon="ep:circle-check" />
|
<IconifyIcon icon="lucide:circle-check" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</ElRow>
|
</ElRow>
|
||||||
</div>
|
</div>
|
||||||
@@ -163,7 +173,7 @@ onMounted(async () => {
|
|||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<ElButton type="primary" link @click="selectMaterialFun(scope.row)">
|
<ElButton type="primary" link @click="selectMaterialFun(scope.row)">
|
||||||
选择
|
选择
|
||||||
<IconifyIcon icon="ep:plus" />
|
<IconifyIcon icon="lucide:plus" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</ElTableColumn>
|
||||||
@@ -210,7 +220,7 @@ onMounted(async () => {
|
|||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<ElButton type="primary" link @click="selectMaterialFun(scope.row)">
|
<ElButton type="primary" link @click="selectMaterialFun(scope.row)">
|
||||||
选择
|
选择
|
||||||
<IconifyIcon icon="akar-icons:circle-plus" />
|
<IconifyIcon icon="lucide:circle-plus" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</template>
|
</template>
|
||||||
</ElTableColumn>
|
</ElTableColumn>
|
||||||
@@ -228,14 +238,21 @@ onMounted(async () => {
|
|||||||
</div>
|
</div>
|
||||||
<!-- 类型:news -->
|
<!-- 类型:news -->
|
||||||
<div v-else-if="props.type === 'news'">
|
<div v-else-if="props.type === 'news'">
|
||||||
<div class="waterfall" v-loading="loading">
|
<div
|
||||||
<div class="waterfall-item" v-for="item in list" :key="item.mediaId">
|
class="mx-auto w-full columns-1 [column-gap:10px] md:columns-2 lg:columns-3 xl:columns-4 2xl:columns-5"
|
||||||
|
v-loading="loading"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="mb-2.5 break-inside-avoid border border-[#eaeaea] p-2.5"
|
||||||
|
v-for="item in list"
|
||||||
|
:key="item.mediaId"
|
||||||
|
>
|
||||||
<div v-if="item.content && item.content.newsItem">
|
<div v-if="item.content && item.content.newsItem">
|
||||||
<News :articles="item.content.newsItem" />
|
<News :articles="item.content.newsItem" />
|
||||||
<ElRow class="ope-row">
|
<ElRow class="flex justify-center pt-2.5">
|
||||||
<ElButton type="success" @click="selectMaterialFun(item)">
|
<ElButton type="success" @click="selectMaterialFun(item)">
|
||||||
选择
|
选择
|
||||||
<IconifyIcon icon="ep:circle-check" />
|
<IconifyIcon icon="lucide:circle-check" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</ElRow>
|
</ElRow>
|
||||||
</div>
|
</div>
|
||||||
@@ -254,54 +271,3 @@ onMounted(async () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
|
||||||
@media (width >= 992px) and (width <= 1300px) {
|
|
||||||
.waterfall {
|
|
||||||
column-count: 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (width >= 768px) and (width <= 991px) {
|
|
||||||
.waterfall {
|
|
||||||
column-count: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
color: orange;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (width <= 767px) {
|
|
||||||
.waterfall {
|
|
||||||
column-count: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** TODO @dylan:@hw:看看有没适合 tindwind 的哈。 */
|
|
||||||
|
|
||||||
.waterfall {
|
|
||||||
column-gap: 10px;
|
|
||||||
width: 100%;
|
|
||||||
margin: 0 auto;
|
|
||||||
column-count: 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.waterfall-item {
|
|
||||||
padding: 10px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
border: 1px solid #eaeaea;
|
|
||||||
break-inside: avoid;
|
|
||||||
}
|
|
||||||
|
|
||||||
.material-img {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
line-height: 30px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -1,15 +1,11 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
|
||||||
|
|
||||||
import { ElTag } from 'element-plus';
|
import { ElTag } from 'element-plus';
|
||||||
|
|
||||||
const props = defineProps<{
|
defineOptions({ name: 'MsgEvent' });
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
item: any;
|
item: any;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
// TODO @hw:看看用 antd 的风格,还是 ele 的风格,就是下面的 item。
|
|
||||||
// 等antd修改完再调整
|
|
||||||
const item = ref(props.item);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -32,25 +32,44 @@ function getNickname(sendFrom: number) {
|
|||||||
<template>
|
<template>
|
||||||
<div class="execution" v-for="item in props.list" :key="item.id">
|
<div class="execution" v-for="item in props.list" :key="item.id">
|
||||||
<div
|
<div
|
||||||
class="mp-comment"
|
class="mb-[30px] flex items-start"
|
||||||
:class="{ 'mp-comment--reverse': item.sendFrom === SendFrom.MpBot }"
|
:class="{ 'flex-row-reverse': item.sendFrom === SendFrom.MpBot }"
|
||||||
>
|
>
|
||||||
<div class="avatar-div">
|
<div class="flex w-20 flex-col items-center text-center">
|
||||||
<img :src="getAvatar(item.sendFrom)" class="mp-comment__avatar" />
|
<img
|
||||||
<div class="mp-comment__author">
|
:src="getAvatar(item.sendFrom)"
|
||||||
|
class="mb-2 h-12 w-12 rounded-full border border-transparent object-cover"
|
||||||
|
/>
|
||||||
|
<div class="text-sm font-semibold text-[#999]">
|
||||||
{{ getNickname(item.sendFrom) }}
|
{{ getNickname(item.sendFrom) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="mp-comment__main">
|
<div class="relative mx-2 flex-1 rounded-[5px] border border-[#dedede]">
|
||||||
<div class="mp-comment__header">
|
<span
|
||||||
<div class="mp-comment__create_time">
|
class="pointer-events-none absolute -left-2 top-[10px] h-0 w-0 border-y-[8px] border-r-[8px] border-y-transparent border-r-[#dedede]"
|
||||||
|
:class="{
|
||||||
|
'-right-2 left-auto border-l-[8px] border-r-0 border-l-[#dedede]':
|
||||||
|
item.sendFrom === SendFrom.MpBot,
|
||||||
|
}"
|
||||||
|
></span>
|
||||||
|
<span
|
||||||
|
class="pointer-events-none absolute -left-[7px] top-[10px] h-0 w-0 border-y-[8px] border-r-[8px] border-y-transparent border-r-[#f8f8f8]"
|
||||||
|
:class="{
|
||||||
|
'-right-[7px] left-auto border-l-[8px] border-r-0 border-l-[#f8f8f8]':
|
||||||
|
item.sendFrom === SendFrom.MpBot,
|
||||||
|
}"
|
||||||
|
></span>
|
||||||
|
<div
|
||||||
|
class="flex items-center justify-between rounded-t-[5px] border-b border-[#eee] bg-[#f8f8f8] px-[15px] py-[5px]"
|
||||||
|
>
|
||||||
|
<div class="text-xs text-gray-500">
|
||||||
{{ formatDateTime(item.createTime) }}
|
{{ formatDateTime(item.createTime) }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="mp-comment__body"
|
class="overflow-hidden rounded-b-[5px] p-[15px] text-sm text-[#333]"
|
||||||
:style="
|
:class="
|
||||||
item.sendFrom === SendFrom.MpBot ? 'background: #6BED72;' : ''
|
item.sendFrom === SendFrom.MpBot ? 'bg-[#6BED72]' : 'bg-white'
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<Msg :item="item" />
|
<Msg :item="item" />
|
||||||
@@ -59,17 +78,3 @@ function getNickname(sendFrom: number) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
/* 因为 joolun 实现依赖 avue 组件,该页面使用了 comment.scss、card.scc */
|
|
||||||
|
|
||||||
/** TODO @hw: 看看有没适合 tindwind 的哈。 */
|
|
||||||
|
|
||||||
@import url('./comment.scss');
|
|
||||||
@import url('./card.scss');
|
|
||||||
|
|
||||||
.avatar-div {
|
|
||||||
width: 80px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -42,16 +42,21 @@ defineExpose({
|
|||||||
:underline="false"
|
:underline="false"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
:href="hqMusicUrl ? hqMusicUrl : musicUrl"
|
:href="hqMusicUrl ? hqMusicUrl : musicUrl"
|
||||||
|
class="block"
|
||||||
>
|
>
|
||||||
<div class="mp-card__body rounded-sm bg-background p-2.5">
|
<div
|
||||||
<div class="mp-card__avatar">
|
class="flex items-center rounded-sm border border-[#e8e8e8] bg-background p-4 transition hover:border-black/10 hover:shadow-sm"
|
||||||
<img :src="thumbMediaUrl" alt="" />
|
>
|
||||||
|
<div
|
||||||
|
class="mr-3 h-12 w-12 overflow-hidden rounded-full border border-transparent"
|
||||||
|
>
|
||||||
|
<img :src="thumbMediaUrl" alt="" class="h-full w-full object-cover" />
|
||||||
</div>
|
</div>
|
||||||
<div class="mp-card__detail">
|
<div class="flex-1">
|
||||||
<div class="mp-card__title" style="margin-bottom: unset">
|
<div class="mb-3 text-base font-medium text-[#000000d9]">
|
||||||
{{ title }}
|
{{ title }}
|
||||||
</div>
|
</div>
|
||||||
<div class="mp-card__info" style="height: unset">
|
<div class="line-clamp-3 h-16 overflow-hidden text-sm text-black/45">
|
||||||
{{ description }}
|
{{ description }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -59,10 +64,3 @@ defineExpose({
|
|||||||
</ElLink>
|
</ElLink>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
/** TODO @dylan:@hw:看看有没适合 tindwind 的哈。 */
|
|
||||||
|
|
||||||
/* 因为 joolun 实现依赖 avue 组件,该页面使用了 card.scss */
|
|
||||||
@import url('../wx-msg/card.scss');
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ElImage } from 'element-plus';
|
|
||||||
|
|
||||||
/** 微信消息 - 图文 */
|
/** 微信消息 - 图文 */
|
||||||
defineOptions({ name: 'WxNews' });
|
defineOptions({ name: 'WxNews' });
|
||||||
|
|
||||||
@@ -22,13 +20,13 @@ defineExpose({
|
|||||||
<div class="news-home">
|
<div class="news-home">
|
||||||
<div v-for="(article, index) in articles" :key="index" class="news-div">
|
<div v-for="(article, index) in articles" :key="index" class="news-div">
|
||||||
<!-- 头条 -->
|
<!-- 头条 -->
|
||||||
<!-- TODO @hw:第一篇文章(头条)图片是铺满,不过要限制高度;第二篇文章开始(次条),图片是在右侧,也是需要限制宽高 -->
|
|
||||||
<a v-if="index === 0" :href="article.url" target="_blank">
|
<a v-if="index === 0" :href="article.url" target="_blank">
|
||||||
<div class="news-main">
|
<div class="news-main">
|
||||||
<div class="news-content flex items-center justify-center">
|
<div class="news-content">
|
||||||
<ElImage
|
<img
|
||||||
:src="article.picUrl || article.thumbUrl"
|
:src="article.picUrl"
|
||||||
class="material-img"
|
:preview="false"
|
||||||
|
class="material-img flex w-[100px] items-center justify-center"
|
||||||
/>
|
/>
|
||||||
<div class="news-content-title">
|
<div class="news-content-title">
|
||||||
<span>{{ article.title }}</span>
|
<span>{{ article.title }}</span>
|
||||||
@@ -40,12 +38,13 @@ defineExpose({
|
|||||||
<a v-else :href="article.url" target="_blank">
|
<a v-else :href="article.url" target="_blank">
|
||||||
<div class="news-main-item">
|
<div class="news-main-item">
|
||||||
<div class="news-content-item">
|
<div class="news-content-item">
|
||||||
<div class="news-content-item-title">{{ article.title }}</div>
|
<div class="news-content-item-img">
|
||||||
<div class="news-content-item-img flex items-center justify-center">
|
<div class="news-content-item-title">{{ article.title }}</div>
|
||||||
|
|
||||||
<img
|
<img
|
||||||
:src="article.picUrl || article.thumbUrl"
|
:src="article.picUrl"
|
||||||
class="material-img"
|
class="h-[70px] w-[70px] object-cover"
|
||||||
height="100%"
|
alt="文章图片"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -56,9 +55,12 @@ defineExpose({
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
/** TODO @dylan:@hw:看看有没适合 tindwind 的哈。 */
|
/** TODO @dylan:看看有没适合 tindwind 的哈。 */
|
||||||
|
|
||||||
.news-home {
|
.news-home {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@@ -83,42 +85,34 @@ defineExpose({
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 98%;
|
width: 98%;
|
||||||
padding: 1%;
|
padding: 1%;
|
||||||
font-size: 12px;
|
margin-left: 10px;
|
||||||
|
font-size: 16px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
background-color: black;
|
|
||||||
opacity: 0.65;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.news-main-item {
|
.news-main-item {
|
||||||
padding: 5px 0;
|
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-top: 1px solid #eaeaea;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.news-content-item {
|
.news-content-item {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.news-content-item-title {
|
.news-content-item-title {
|
||||||
display: inline-block;
|
flex: 1;
|
||||||
width: 70%;
|
font-size: 14px;
|
||||||
margin-left: 1%;
|
|
||||||
font-size: 10px;
|
|
||||||
white-space: normal;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.news-content-item-img {
|
.news-content-item-img {
|
||||||
display: inline-block;
|
display: flex;
|
||||||
width: 25%;
|
align-items: center;
|
||||||
margin-right: 1%;
|
|
||||||
background-color: #acadae;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.material-img {
|
.material-img {
|
||||||
display: flex;
|
width: auto;
|
||||||
align-items: center;
|
object-fit: cover;
|
||||||
justify-content: center;
|
|
||||||
width: 100%;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ function selectMaterial(item: any) {
|
|||||||
</p>
|
</p>
|
||||||
<ElRow class="pt-[10px] text-center" justify="center">
|
<ElRow class="pt-[10px] text-center" justify="center">
|
||||||
<ElButton type="danger" circle @click="onDelete">
|
<ElButton type="danger" circle @click="onDelete">
|
||||||
<IconifyIcon icon="ep:delete" />
|
<IconifyIcon icon="lucide:trash-2" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</ElRow>
|
</ElRow>
|
||||||
</div>
|
</div>
|
||||||
@@ -112,7 +112,7 @@ function selectMaterial(item: any) {
|
|||||||
class="h-[160px] w-[49.5%] border border-[rgb(234,234,234)] py-[50px]"
|
class="h-[160px] w-[49.5%] border border-[rgb(234,234,234)] py-[50px]"
|
||||||
>
|
>
|
||||||
<ElButton type="success" @click="showDialog = true">
|
<ElButton type="success" @click="showDialog = true">
|
||||||
素材库选择 <IconifyIcon icon="ep:circle-check" />
|
素材库选择 <IconifyIcon icon="lucide:circle-check" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
<ElDialog
|
<ElDialog
|
||||||
title="选择图片"
|
title="选择图片"
|
||||||
@@ -133,7 +133,6 @@ function selectMaterial(item: any) {
|
|||||||
:span="12"
|
:span="12"
|
||||||
class="float-right h-[160px] w-[49.5%] border border-[rgb(234,234,234)] py-[50px]"
|
class="float-right h-[160px] w-[49.5%] border border-[rgb(234,234,234)] py-[50px]"
|
||||||
>
|
>
|
||||||
{{ uploadData }}
|
|
||||||
<ElUpload
|
<ElUpload
|
||||||
:action="UPLOAD_URL"
|
:action="UPLOAD_URL"
|
||||||
:headers="HEADERS"
|
:headers="HEADERS"
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ function selectMaterial(item: any) {
|
|||||||
v-if="reply.thumbMediaUrl"
|
v-if="reply.thumbMediaUrl"
|
||||||
:src="reply.thumbMediaUrl"
|
:src="reply.thumbMediaUrl"
|
||||||
/>
|
/>
|
||||||
<IconifyIcon v-else icon="ep:plus" />
|
<IconifyIcon v-else icon="lucide:plus" />
|
||||||
</ElRow>
|
</ElRow>
|
||||||
<ElRow align="middle" justify="center" class="mt-[2%]">
|
<ElRow align="middle" justify="center" class="mt-[2%]">
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ function onDelete() {
|
|||||||
<News :articles="reply.articles" />
|
<News :articles="reply.articles" />
|
||||||
<ElCol class="pt-[10px] text-center">
|
<ElCol class="pt-[10px] text-center">
|
||||||
<ElButton type="danger" circle @click="onDelete">
|
<ElButton type="danger" circle @click="onDelete">
|
||||||
<IconifyIcon icon="ep:delete" />
|
<IconifyIcon icon="lucide:trash-2" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</ElCol>
|
</ElCol>
|
||||||
</div>
|
</div>
|
||||||
@@ -65,7 +65,7 @@ function onDelete() {
|
|||||||
? '选择已发布图文'
|
? '选择已发布图文'
|
||||||
: '选择草稿箱图文'
|
: '选择草稿箱图文'
|
||||||
}}
|
}}
|
||||||
<IconifyIcon icon="ep:circle-check" />
|
<IconifyIcon icon="lucide:circle-check" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</ElCol>
|
</ElCol>
|
||||||
</ElRow>
|
</ElRow>
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ function selectMaterial(item: any) {
|
|||||||
<!-- 选择素材 -->
|
<!-- 选择素材 -->
|
||||||
<ElCol :span="12">
|
<ElCol :span="12">
|
||||||
<ElButton type="success" @click="showDialog = true">
|
<ElButton type="success" @click="showDialog = true">
|
||||||
素材库选择 <IconifyIcon icon="ep:circle-check" />
|
素材库选择 <IconifyIcon icon="lucide:circle-check" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
<ElDialog
|
<ElDialog
|
||||||
title="选择视频"
|
title="选择视频"
|
||||||
@@ -133,7 +133,7 @@ function selectMaterial(item: any) {
|
|||||||
:on-success="onUploadSuccess"
|
:on-success="onUploadSuccess"
|
||||||
>
|
>
|
||||||
<ElButton type="primary">
|
<ElButton type="primary">
|
||||||
新建视频 <IconifyIcon icon="ep:upload" />
|
新建视频 <IconifyIcon icon="lucide:upload" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</ElUpload>
|
</ElUpload>
|
||||||
</ElCol>
|
</ElCol>
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ function selectMaterial(item: Reply) {
|
|||||||
</ElRow>
|
</ElRow>
|
||||||
<ElRow class="w-full pt-[10px] text-center" justify="center">
|
<ElRow class="w-full pt-[10px] text-center" justify="center">
|
||||||
<ElButton type="danger" circle @click="onDelete">
|
<ElButton type="danger" circle @click="onDelete">
|
||||||
<IconifyIcon icon="ep:delete" />
|
<IconifyIcon icon="lucide:trash-2" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</ElRow>
|
</ElRow>
|
||||||
</div>
|
</div>
|
||||||
@@ -114,7 +114,7 @@ function selectMaterial(item: Reply) {
|
|||||||
class="h-[160px] w-[49.5%] border border-[rgb(234,234,234)] py-[50px]"
|
class="h-[160px] w-[49.5%] border border-[rgb(234,234,234)] py-[50px]"
|
||||||
>
|
>
|
||||||
<ElButton type="success" @click="showDialog = true">
|
<ElButton type="success" @click="showDialog = true">
|
||||||
素材库选择<IconifyIcon icon="ep:circle-check" />
|
素材库选择<IconifyIcon icon="lucide:circle-check" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
<ElDialog
|
<ElDialog
|
||||||
title="选择语音"
|
title="选择语音"
|
||||||
|
|||||||
@@ -117,7 +117,9 @@ defineExpose({
|
|||||||
<!-- 类型 1:文本 -->
|
<!-- 类型 1:文本 -->
|
||||||
<ElTabPane :name="ReplyType.Text">
|
<ElTabPane :name="ReplyType.Text">
|
||||||
<template #label>
|
<template #label>
|
||||||
<ElRow align="middle"><IconifyIcon icon="ep:document" /> 文本</ElRow>
|
<ElRow align="middle">
|
||||||
|
<IconifyIcon icon="lucide:file-text" /> 文本
|
||||||
|
</ElRow>
|
||||||
</template>
|
</template>
|
||||||
<TabText v-model="reply.content" />
|
<TabText v-model="reply.content" />
|
||||||
</ElTabPane>
|
</ElTabPane>
|
||||||
@@ -126,7 +128,7 @@ defineExpose({
|
|||||||
<ElTabPane :name="ReplyType.Image">
|
<ElTabPane :name="ReplyType.Image">
|
||||||
<template #label>
|
<template #label>
|
||||||
<ElRow align="middle">
|
<ElRow align="middle">
|
||||||
<IconifyIcon icon="ep:picture" class="mr-5px" /> 图片
|
<IconifyIcon icon="lucide:image" class="mr-5px" /> 图片
|
||||||
</ElRow>
|
</ElRow>
|
||||||
</template>
|
</template>
|
||||||
<TabImage v-model="reply" />
|
<TabImage v-model="reply" />
|
||||||
@@ -135,7 +137,7 @@ defineExpose({
|
|||||||
<!-- 类型 3:语音 -->
|
<!-- 类型 3:语音 -->
|
||||||
<ElTabPane :name="ReplyType.Voice">
|
<ElTabPane :name="ReplyType.Voice">
|
||||||
<template #label>
|
<template #label>
|
||||||
<ElRow align="middle"><IconifyIcon icon="ep:phone" /> 语音</ElRow>
|
<ElRow align="middle"> <IconifyIcon icon="lucide:mic" /> 语音 </ElRow>
|
||||||
</template>
|
</template>
|
||||||
<TabVoice v-model="reply" />
|
<TabVoice v-model="reply" />
|
||||||
</ElTabPane>
|
</ElTabPane>
|
||||||
@@ -143,7 +145,7 @@ defineExpose({
|
|||||||
<!-- 类型 4:视频 -->
|
<!-- 类型 4:视频 -->
|
||||||
<ElTabPane :name="ReplyType.Video">
|
<ElTabPane :name="ReplyType.Video">
|
||||||
<template #label>
|
<template #label>
|
||||||
<ElRow align="middle"><IconifyIcon icon="ep:share" /> 视频</ElRow>
|
<ElRow align="middle"><IconifyIcon icon="lucide:video" /> 视频</ElRow>
|
||||||
</template>
|
</template>
|
||||||
<TabVideo v-model="reply" />
|
<TabVideo v-model="reply" />
|
||||||
</ElTabPane>
|
</ElTabPane>
|
||||||
@@ -151,7 +153,9 @@ defineExpose({
|
|||||||
<!-- 类型 5:图文 -->
|
<!-- 类型 5:图文 -->
|
||||||
<ElTabPane :name="ReplyType.News">
|
<ElTabPane :name="ReplyType.News">
|
||||||
<template #label>
|
<template #label>
|
||||||
<ElRow align="middle"><IconifyIcon icon="ep:reading" /> 图文</ElRow>
|
<ElRow align="middle">
|
||||||
|
<IconifyIcon icon="lucide:newspaper" /> 图文
|
||||||
|
</ElRow>
|
||||||
</template>
|
</template>
|
||||||
<TabNews v-model="reply" :news-type="newsType" />
|
<TabNews v-model="reply" :news-type="newsType" />
|
||||||
</ElTabPane>
|
</ElTabPane>
|
||||||
@@ -159,7 +163,7 @@ defineExpose({
|
|||||||
<!-- 类型 6:音乐 -->
|
<!-- 类型 6:音乐 -->
|
||||||
<ElTabPane :name="ReplyType.Music">
|
<ElTabPane :name="ReplyType.Music">
|
||||||
<template #label>
|
<template #label>
|
||||||
<ElRow align="middle"><IconifyIcon icon="ep:service" />音乐</ElRow>
|
<ElRow align="middle"> <IconifyIcon icon="lucide:music" />音乐 </ElRow>
|
||||||
</template>
|
</template>
|
||||||
<TabMusic v-model="reply" />
|
<TabMusic v-model="reply" />
|
||||||
</ElTabPane>
|
</ElTabPane>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ const playVideo = () => {
|
|||||||
<div @click="playVideo()">
|
<div @click="playVideo()">
|
||||||
<!-- 提示 -->
|
<!-- 提示 -->
|
||||||
<div class="flex cursor-pointer flex-col items-center">
|
<div class="flex cursor-pointer flex-col items-center">
|
||||||
<IconifyIcon icon="ep:video-play" :size="32" class="mr-5px" />
|
<IconifyIcon icon="lucide:circle-play" :size="32" class="mr-5px" />
|
||||||
<p class="text-sm">点击播放视频</p>
|
<p class="text-sm">点击播放视频</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -9,18 +9,15 @@ import BenzAMRRecorder from 'benz-amr-recorder';
|
|||||||
/** 微信消息 - 语音 */
|
/** 微信消息 - 语音 */
|
||||||
defineOptions({ name: 'VoicePlayer' });
|
defineOptions({ name: 'VoicePlayer' });
|
||||||
|
|
||||||
// TODO @hw:antd 和 ele 代码风格一致;
|
const props = withDefaults(
|
||||||
const props = defineProps({
|
defineProps<{
|
||||||
url: {
|
content?: string; // 语音文本
|
||||||
type: String, // 语音地址,例如说:https://www.iocoder.cn/xxx.amr
|
url: string; // 语音地址,例如说:https://www.iocoder.cn/xxx.amr
|
||||||
required: true,
|
}>(),
|
||||||
|
{
|
||||||
|
content: '',
|
||||||
},
|
},
|
||||||
content: {
|
);
|
||||||
type: String, // 语音文本
|
|
||||||
required: false,
|
|
||||||
default: '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const amr = ref();
|
const amr = ref();
|
||||||
const playing = ref(false);
|
const playing = ref(false);
|
||||||
@@ -72,8 +69,12 @@ const amrStop = () => {
|
|||||||
<template>
|
<template>
|
||||||
<div class="wx-voice-div" @click="playVoice">
|
<div class="wx-voice-div" @click="playVoice">
|
||||||
<el-icon>
|
<el-icon>
|
||||||
<IconifyIcon v-if="playing !== true" icon="ep:video-play" :size="32" />
|
<IconifyIcon
|
||||||
<IconifyIcon v-else icon="ep:video-pause" :size="32" />
|
v-if="playing !== true"
|
||||||
|
icon="lucide:circle-play"
|
||||||
|
:size="32"
|
||||||
|
/>
|
||||||
|
<IconifyIcon v-else icon="lucide:circle-pause" :size="32" />
|
||||||
<span class="amr-duration" v-if="duration">{{ duration }} 秒</span>
|
<span class="amr-duration" v-if="duration">{{ duration }} 秒</span>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
<div v-if="content">
|
<div v-if="content">
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ function onUploadError(err: Error) {
|
|||||||
/>
|
/>
|
||||||
<IconifyIcon
|
<IconifyIcon
|
||||||
v-else
|
v-else
|
||||||
icon="ep:plus"
|
icon="lucide:plus"
|
||||||
class="border border-[#d9d9d9] text-center text-[28px] leading-[120px] text-[#8c939d]"
|
class="border border-[#d9d9d9] text-center text-[28px] leading-[120px] text-[#8c939d]"
|
||||||
:class="isFirst ? 'h-[120px] w-[230px]' : 'h-[120px] w-[120px]'"
|
:class="isFirst ? 'h-[120px] w-[230px]' : 'h-[120px] w-[120px]'"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,32 +1,27 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { NewsItem } from './types';
|
import type { MpDraftApi } from '#/api/mp/draft';
|
||||||
|
|
||||||
import { computed, provide, ref } from 'vue';
|
import { computed, provide, ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
|
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus';
|
import { ElMessage } from 'element-plus';
|
||||||
|
|
||||||
import * as MpDraftApi from '#/api/mp/draft';
|
import { createDraft, updateDraft } from '#/api/mp/draft';
|
||||||
|
|
||||||
import NewsForm from './news-form.vue';
|
import NewsForm from './news-form.vue';
|
||||||
|
|
||||||
const emit = defineEmits(['success']);
|
const emit = defineEmits(['success']);
|
||||||
|
|
||||||
// TODO @hw:代码风格,要和对应的 antd index.vue 一致,类似方法的顺序,注释等。原因是,这样后续两端迭代,会方便很多。
|
|
||||||
|
|
||||||
const formData = ref<{
|
const formData = ref<{
|
||||||
accountId: number;
|
accountId: number;
|
||||||
isCreating: boolean;
|
|
||||||
mediaId?: string;
|
mediaId?: string;
|
||||||
newsList?: NewsItem[];
|
newsList?: MpDraftApi.NewsItem[];
|
||||||
}>();
|
}>();
|
||||||
const newsList = ref<NewsItem[]>([]);
|
const newsList = ref<MpDraftApi.NewsItem[]>([]);
|
||||||
const isSubmitting = ref(false);
|
|
||||||
const isSaved = ref(false);
|
|
||||||
|
|
||||||
const getTitle = computed(() => {
|
const getTitle = computed(() => {
|
||||||
return formData.value?.isCreating ? '新建图文' : '修改图文';
|
return formData.value?.mediaId ? '修改图文' : '新建图文';
|
||||||
});
|
});
|
||||||
|
|
||||||
// 提供 accountId 给子组件
|
// 提供 accountId 给子组件
|
||||||
@@ -39,59 +34,45 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
if (!formData.value) {
|
if (!formData.value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
isSubmitting.value = true;
|
|
||||||
modalApi.lock();
|
modalApi.lock();
|
||||||
try {
|
try {
|
||||||
if (formData.value.isCreating) {
|
if (formData.value.mediaId) {
|
||||||
await MpDraftApi.createDraft(formData.value.accountId, newsList.value);
|
await updateDraft(
|
||||||
ElMessage.success('新增成功');
|
|
||||||
} else if (formData.value.mediaId) {
|
|
||||||
await MpDraftApi.updateDraft(
|
|
||||||
formData.value.accountId,
|
formData.value.accountId,
|
||||||
formData.value.mediaId,
|
formData.value.mediaId,
|
||||||
newsList.value,
|
newsList.value,
|
||||||
);
|
);
|
||||||
ElMessage.success('更新成功');
|
ElMessage.success('更新成功');
|
||||||
|
} else {
|
||||||
|
await createDraft(formData.value.accountId, newsList.value);
|
||||||
|
ElMessage.success('新增成功');
|
||||||
}
|
}
|
||||||
isSaved.value = true;
|
|
||||||
await modalApi.close();
|
await modalApi.close();
|
||||||
emit('success');
|
emit('success');
|
||||||
} finally {
|
} finally {
|
||||||
isSubmitting.value = false;
|
|
||||||
modalApi.unlock();
|
modalApi.unlock();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async onBeforeClose() {
|
|
||||||
// 如果已经成功保存,直接关闭,不显示提示
|
|
||||||
if (isSaved.value) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
await ElMessageBox.confirm('修改内容可能还未保存,确定关闭吗?');
|
|
||||||
return true;
|
|
||||||
} catch {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async onOpenChange(isOpen: boolean) {
|
async onOpenChange(isOpen: boolean) {
|
||||||
if (!isOpen) {
|
if (!isOpen) {
|
||||||
formData.value = undefined;
|
formData.value = undefined;
|
||||||
newsList.value = [];
|
newsList.value = [];
|
||||||
isSaved.value = false;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
isSaved.value = false;
|
|
||||||
const data = modalApi.getData<{
|
const data = modalApi.getData<{
|
||||||
accountId: number;
|
accountId: number;
|
||||||
isCreating: boolean;
|
isCreating: boolean;
|
||||||
mediaId?: string;
|
mediaId?: string;
|
||||||
newsList?: NewsItem[];
|
newsList?: MpDraftApi.NewsItem[];
|
||||||
}>();
|
}>();
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
formData.value = data;
|
formData.value = {
|
||||||
|
accountId: data.accountId,
|
||||||
|
mediaId: data.mediaId,
|
||||||
|
newsList: data.newsList,
|
||||||
|
};
|
||||||
newsList.value = data.newsList || [];
|
newsList.value = data.newsList || [];
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -102,8 +83,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
<NewsForm
|
<NewsForm
|
||||||
v-if="formData"
|
v-if="formData"
|
||||||
v-model="newsList"
|
v-model="newsList"
|
||||||
v-loading="isSubmitting"
|
:is-creating="!formData.mediaId"
|
||||||
:is-creating="formData.isCreating"
|
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { NewsItem } from './types';
|
import type { MpDraftApi } from '#/api/mp/draft';
|
||||||
|
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
@@ -16,24 +16,23 @@ import {
|
|||||||
ElRow,
|
ElRow,
|
||||||
} from 'element-plus';
|
} from 'element-plus';
|
||||||
|
|
||||||
|
import { createEmptyNewsItem } from '#/api/mp/draft';
|
||||||
import { Tinymce as RichTextarea } from '#/components/tinymce';
|
import { Tinymce as RichTextarea } from '#/components/tinymce';
|
||||||
|
|
||||||
import CoverSelect from './cover-select.vue';
|
import CoverSelect from './cover-select.vue';
|
||||||
import { createEmptyNewsItem } from './types';
|
|
||||||
|
|
||||||
defineOptions({ name: 'NewsForm' });
|
defineOptions({ name: 'NewsForm' });
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
isCreating: boolean;
|
isCreating: boolean;
|
||||||
modelValue: NewsItem[] | null;
|
modelValue: MpDraftApi.NewsItem[] | null;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'update:modelValue', v: NewsItem[]): void;
|
(e: 'update:modelValue', v: MpDraftApi.NewsItem[]): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
// TODO @hw: 对齐 antd,应该是 MpDraftApi.NewsItem 这种哈。
|
const newsList = computed<MpDraftApi.NewsItem[]>({
|
||||||
const newsList = computed<NewsItem[]>({
|
|
||||||
get() {
|
get() {
|
||||||
return props.modelValue === null
|
return props.modelValue === null
|
||||||
? [createEmptyNewsItem()]
|
? [createEmptyNewsItem()]
|
||||||
@@ -124,7 +123,7 @@ function plusNews() {
|
|||||||
size="small"
|
size="small"
|
||||||
@click="() => moveDownNews(index)"
|
@click="() => moveDownNews(index)"
|
||||||
>
|
>
|
||||||
<IconifyIcon icon="ep:arrow-down-bold" />
|
<IconifyIcon icon="lucide:arrow-down" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
<ElButton
|
<ElButton
|
||||||
v-if="isCreating"
|
v-if="isCreating"
|
||||||
@@ -133,7 +132,7 @@ function plusNews() {
|
|||||||
size="small"
|
size="small"
|
||||||
@click="() => removeNews(index)"
|
@click="() => removeNews(index)"
|
||||||
>
|
>
|
||||||
<IconifyIcon icon="ep:delete" />
|
<IconifyIcon icon="lucide:trash-2" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -168,7 +167,7 @@ function plusNews() {
|
|||||||
size="small"
|
size="small"
|
||||||
@click="() => moveDownNews(index)"
|
@click="() => moveDownNews(index)"
|
||||||
>
|
>
|
||||||
<IconifyIcon icon="ep:arrow-down-bold" />
|
<IconifyIcon icon="lucide:arrow-down" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
<ElButton
|
<ElButton
|
||||||
v-if="index > 0"
|
v-if="index > 0"
|
||||||
@@ -177,7 +176,7 @@ function plusNews() {
|
|||||||
size="small"
|
size="small"
|
||||||
@click="() => moveUpNews(index)"
|
@click="() => moveUpNews(index)"
|
||||||
>
|
>
|
||||||
<IconifyIcon icon="ep:arrow-up-bold" />
|
<IconifyIcon icon="lucide:arrow-up" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
<ElButton
|
<ElButton
|
||||||
v-if="isCreating"
|
v-if="isCreating"
|
||||||
@@ -186,7 +185,7 @@ function plusNews() {
|
|||||||
circle
|
circle
|
||||||
@click="() => removeNews(index)"
|
@click="() => removeNews(index)"
|
||||||
>
|
>
|
||||||
<IconifyIcon icon="ep:delete" />
|
<IconifyIcon icon="lucide:trash-2" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -201,7 +200,7 @@ function plusNews() {
|
|||||||
@click="plusNews"
|
@click="plusNews"
|
||||||
v-if="newsList.length < 8 && isCreating"
|
v-if="newsList.length < 8 && isCreating"
|
||||||
>
|
>
|
||||||
<IconifyIcon icon="ep:plus" />
|
<IconifyIcon icon="lucide:plus" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</ElRow>
|
</ElRow>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
// TODO @hw:合并到 api 里,参考 antd 的做法;
|
|
||||||
interface NewsItem {
|
|
||||||
title: string;
|
|
||||||
thumbMediaId: string;
|
|
||||||
author: string;
|
|
||||||
digest: string;
|
|
||||||
showCoverPic: number;
|
|
||||||
content: string;
|
|
||||||
contentSourceUrl: string;
|
|
||||||
needOpenComment: number;
|
|
||||||
onlyFansCanComment: number;
|
|
||||||
thumbUrl: string;
|
|
||||||
picUrl?: string; // 用于预览封面
|
|
||||||
}
|
|
||||||
|
|
||||||
interface NewsItemList {
|
|
||||||
newsItem: NewsItem[];
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Article {
|
|
||||||
mediaId: string;
|
|
||||||
content: NewsItemList;
|
|
||||||
updateTime: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
const createEmptyNewsItem = (): NewsItem => {
|
|
||||||
return {
|
|
||||||
title: '',
|
|
||||||
thumbMediaId: '',
|
|
||||||
author: '',
|
|
||||||
digest: '',
|
|
||||||
showCoverPic: 0,
|
|
||||||
content: '',
|
|
||||||
contentSourceUrl: '',
|
|
||||||
needOpenComment: 0,
|
|
||||||
onlyFansCanComment: 0,
|
|
||||||
thumbUrl: '',
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export type { Article, NewsItem, NewsItemList };
|
|
||||||
export { createEmptyNewsItem };
|
|
||||||
@@ -291,7 +291,6 @@ function menuToBackend(menu: any) {
|
|||||||
};
|
};
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
// TODO @hw:antd 和 ele 版本,基本没用自定义组件,他们的 tindwind 需要进一步对齐么?(主要还是考虑维护性哈。)
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -310,21 +309,21 @@ function menuToBackend(menu: any) {
|
|||||||
>
|
>
|
||||||
<!--左边配置菜单-->
|
<!--左边配置菜单-->
|
||||||
<div
|
<div
|
||||||
class="left relative box-border block h-[715px] w-[350px] flex-shrink-0 bg-[length:100%_auto] bg-no-repeat px-[25px] pb-[88px] pt-[518px]"
|
class="relative float-left box-border block h-[715px] w-[350px] bg-[length:100%_auto] bg-no-repeat p-[518px_25px_88px]"
|
||||||
:style="{ backgroundImage: `url(${iphoneBackImg})` }"
|
:style="{ backgroundImage: `url(${iphoneBackImg})` }"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="relative bottom-[426px] left-0 h-[64px] w-[300px] bg-[length:100%_auto] bg-no-repeat text-center text-white"
|
class="relative bottom-[426px] left-0 h-[64px] w-[300px] bg-[length:100%] bg-[position:0_0] bg-no-repeat text-center text-white"
|
||||||
:style="{ backgroundImage: `url(${menuHeadImg})` }"
|
:style="{ backgroundImage: `url(${menuHeadImg})` }"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="absolute left-0 top-[33px] w-full text-center text-[14px] text-white"
|
class="absolute left-0 top-[33px] w-full text-center text-sm text-white"
|
||||||
>
|
>
|
||||||
{{ accountName }}
|
{{ accountName }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="h-[46px] bg-no-repeat pl-[43px] text-[12px]"
|
class="bg-[position:0_0] bg-no-repeat pl-[43px] text-xs after:clear-both after:table after:content-['']"
|
||||||
:style="{ backgroundImage: `url(${menuFootImg})` }"
|
:style="{ backgroundImage: `url(${menuFootImg})` }"
|
||||||
>
|
>
|
||||||
<Previewer
|
<Previewer
|
||||||
@@ -336,7 +335,7 @@ function menuToBackend(menu: any) {
|
|||||||
@submenu-clicked="(child, x, y) => subMenuClicked(child, x, y)"
|
@submenu-clicked="(child, x, y) => subMenuClicked(child, x, y)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-[15px] text-center">
|
<div class="mt-[15px] flex items-center justify-center gap-[10px]">
|
||||||
<ElButton
|
<ElButton
|
||||||
class="mx-2"
|
class="mx-2"
|
||||||
type="success"
|
type="success"
|
||||||
@@ -357,7 +356,7 @@ function menuToBackend(menu: any) {
|
|||||||
</div>
|
</div>
|
||||||
<!--右边配置-->
|
<!--右边配置-->
|
||||||
<div
|
<div
|
||||||
class="right box-border flex-1 basis-[63%] bg-[#e8e7e7] p-[20px]"
|
class="float-left ml-5 box-border w-[63%] bg-[#e8e7e7] p-5"
|
||||||
v-if="showRightPanel"
|
v-if="showRightPanel"
|
||||||
>
|
>
|
||||||
<Editor
|
<Editor
|
||||||
@@ -368,11 +367,8 @@ function menuToBackend(menu: any) {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<!-- 一进页面就显示的默认页面,当点击左边按钮的时候,就不显示了-->
|
<!-- 一进页面就显示的默认页面,当点击左边按钮的时候,就不显示了-->
|
||||||
<div
|
<div v-else class="float-left ml-5 box-border w-[63%] bg-[#e8e7e7] p-5">
|
||||||
v-else
|
<p>请选择菜单配置</p>
|
||||||
class="right box-border flex-1 basis-[63%] bg-[#e8e7e7] p-[20px]"
|
|
||||||
>
|
|
||||||
<p class="text-left">请选择菜单配置</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|||||||
@@ -14,10 +14,7 @@ import {
|
|||||||
ElSelect,
|
ElSelect,
|
||||||
} from 'element-plus';
|
} from 'element-plus';
|
||||||
|
|
||||||
// TODO @hw:import { WxMaterialSelect, WxNews, WxReply } from '#/views/mp/components';
|
import { WxMaterialSelect, WxNews, WxReply } from '#/views/mp/components';
|
||||||
import MaterialSelect from '#/views/mp/components/wx-material-select/wx-material-select.vue';
|
|
||||||
import News from '#/views/mp/components/wx-news/wx-news.vue';
|
|
||||||
import ReplySelect from '#/views/mp/components/wx-reply/wx-reply.vue';
|
|
||||||
|
|
||||||
import { menuOptions } from './types';
|
import { menuOptions } from './types';
|
||||||
|
|
||||||
@@ -79,7 +76,7 @@ function deleteMaterial() {
|
|||||||
<div class="space-y-5">
|
<div class="space-y-5">
|
||||||
<div class="flex justify-end">
|
<div class="flex justify-end">
|
||||||
<ElButton type="danger" @click="emit('delete')">
|
<ElButton type="danger" @click="emit('delete')">
|
||||||
<IconifyIcon icon="ep:delete" />
|
<IconifyIcon icon="lucide:trash-2" />
|
||||||
删除当前菜单
|
删除当前菜单
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</div>
|
</div>
|
||||||
@@ -183,10 +180,10 @@ function deleteMaterial() {
|
|||||||
class="mx-auto mb-2.5 w-[280px] border border-[#eaeaea] p-2.5"
|
class="mx-auto mb-2.5 w-[280px] border border-[#eaeaea] p-2.5"
|
||||||
v-if="menu && menu.replyArticles"
|
v-if="menu && menu.replyArticles"
|
||||||
>
|
>
|
||||||
<News :articles="menu.replyArticles" />
|
<WxNews :articles="menu.replyArticles" />
|
||||||
<ElRow class="pt-2.5 text-center" justify="center" align="middle">
|
<ElRow class="pt-2.5 text-center" justify="center" align="middle">
|
||||||
<ElButton type="danger" circle @click="deleteMaterial">
|
<ElButton type="danger" circle @click="deleteMaterial">
|
||||||
<IconifyIcon icon="ep:delete" />
|
<IconifyIcon icon="ep:trash-2" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</ElRow>
|
</ElRow>
|
||||||
</div>
|
</div>
|
||||||
@@ -195,7 +192,7 @@ function deleteMaterial() {
|
|||||||
<ElCol :span="24" class="text-center">
|
<ElCol :span="24" class="text-center">
|
||||||
<ElButton type="success" @click="showNewsDialog = true">
|
<ElButton type="success" @click="showNewsDialog = true">
|
||||||
素材库选择
|
素材库选择
|
||||||
<IconifyIcon icon="ep:circle-check" />
|
<IconifyIcon icon="lucide:circle-check" />
|
||||||
</ElButton>
|
</ElButton>
|
||||||
</ElCol>
|
</ElCol>
|
||||||
</ElRow>
|
</ElRow>
|
||||||
@@ -206,7 +203,7 @@ function deleteMaterial() {
|
|||||||
width="80%"
|
width="80%"
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
>
|
>
|
||||||
<MaterialSelect
|
<WxMaterialSelect
|
||||||
type="news"
|
type="news"
|
||||||
:account-id="props.accountId"
|
:account-id="props.accountId"
|
||||||
@select-material="selectMaterial"
|
@select-material="selectMaterial"
|
||||||
@@ -218,7 +215,7 @@ function deleteMaterial() {
|
|||||||
class="rounded bg-white px-3 py-5 shadow-sm"
|
class="rounded bg-white px-3 py-5 shadow-sm"
|
||||||
v-if="menu.type === 'click' || menu.type === 'scancode_waitmsg'"
|
v-if="menu.type === 'click' || menu.type === 'scancode_waitmsg'"
|
||||||
>
|
>
|
||||||
<ReplySelect v-model="menu.reply" />
|
<WxReply v-model="menu.reply" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -140,8 +140,9 @@ function onChildDragEnd({ newIndex }: { newIndex: number }) {
|
|||||||
"
|
"
|
||||||
@click="menuClicked(parent, x)"
|
@click="menuClicked(parent, x)"
|
||||||
>
|
>
|
||||||
<!-- TODO @hw:尽量用中立的 lucide icon -->
|
<IconifyIcon icon="lucide:list-collapse" color="black" />{{
|
||||||
<IconifyIcon icon="ep:fold" color="black" />{{ parent.name }}
|
parent.name
|
||||||
|
}}
|
||||||
</div>
|
</div>
|
||||||
<!-- 以下为二级菜单-->
|
<!-- 以下为二级菜单-->
|
||||||
<div
|
<div
|
||||||
@@ -180,8 +181,7 @@ function onChildDragEnd({ newIndex }: { newIndex: number }) {
|
|||||||
v-if="!parent.children || parent.children.length < 5"
|
v-if="!parent.children || parent.children.length < 5"
|
||||||
@click="addSubMenu(x, parent)"
|
@click="addSubMenu(x, parent)"
|
||||||
>
|
>
|
||||||
<!-- TODO @hw:尽量用中立的 lucide icon -->
|
<IconifyIcon icon="lucide:plus" class="" />
|
||||||
<IconifyIcon icon="ep:plus" class="" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -194,8 +194,7 @@ function onChildDragEnd({ newIndex }: { newIndex: number }) {
|
|||||||
v-if="menuList.length < 3"
|
v-if="menuList.length < 3"
|
||||||
@click="addMenu"
|
@click="addMenu"
|
||||||
>
|
>
|
||||||
<!-- TODO @hw:尽量用中立的 lucide icon -->
|
<IconifyIcon icon="lucide:plus" class="" />
|
||||||
<IconifyIcon icon="ep:plus" class="" />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user