review:【antd】【mp】components 组件

This commit is contained in:
YunaiV
2025-11-09 17:30:37 +08:00
parent 229ead48f1
commit 9fc5c7561e
20 changed files with 25 additions and 49 deletions

View File

@@ -18,6 +18,7 @@ const item = ref(props.item);
<div v-else-if="item.event === 'unsubscribe'">
<Tag color="error">取消关注</Tag>
</div>
<!-- @hw看看能不能处理下 linter 报错哈 -->
<div v-else-if="item.event === 'CLICK'">
<Tag>点击菜单</Tag>
{{ item.eventKey }}

View File

@@ -18,11 +18,10 @@ const props = defineProps<{
user: PropsUser;
}>();
// 使用常量对象替代枚举,避免 linter 误报
const SendFrom = {
MpBot: 2,
User: 1,
} as const;
} as const; // 使用常量对象替代枚举,避免 linter 误报
type SendFromType = (typeof SendFrom)[keyof typeof SendFrom];
@@ -72,6 +71,7 @@ const getNickname = (sendFrom: SendFromType) =>
<style lang="scss" scoped>
/* 因为 joolun 实现依赖 avue 组件,该页面使用了 comment.scss、card.scc */
/** TODO @hw这里有没办法重构掉哈。辛苦~~~ */
@import url('../comment.scss');
@import url('../card.scss');
</style>

View File

@@ -83,5 +83,3 @@ const item = ref<any>(props.item);
</div>
</div>
</template>
<style scoped></style>

View File

@@ -30,7 +30,6 @@ const props = defineProps({
},
});
// 消息弹窗
const accountId = ref(-1); // 公众号ID需要通过userId初始化
const loading = ref(false); // 消息列表是否正在加载中
const hasMore = ref(true); // 是否可以加载更多
@@ -41,21 +40,19 @@ const queryParams = reactive({
accountId,
});
// 由于微信不再提供昵称,直接使用"用户"展示
const user: User = reactive({
nickname: '用户',
nickname: '用户', // 由于微信不再提供昵称,直接使用"用户"展示
avatar: profile,
accountId, // 公众号账号编号
});
// ========= 消息发送 =========
const sendLoading = ref(false); // 发送消息是否加载中
// 微信发送消息
const reply = ref<Reply>({
type: ReplyType.Text,
accountId: -1,
articles: [],
});
}); // 微信发送消息
const replySelectRef = ref<InstanceType<typeof WxReplySelect> | null>(null); // WxReplySelect组件ref用于消息发送成功后清除内容
const msgDivRef = ref<HTMLDivElement | null>(null); // 消息显示窗口ref用于滚动到底部