review:【antd】【mp】components 组件
This commit is contained in:
@@ -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 }}】
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -83,5 +83,3 @@ const item = ref<any>(props.item);
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
@@ -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,用于滚动到底部
|
||||
|
||||
Reference in New Issue
Block a user