fix: todo修复
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
export { default as WxAccountSelect } from './wx-account-select.vue';
|
||||
|
||||
// TODO @hw:每个组件下的 index.ts 要不都删除,统一在 mp/components/index.ts 暴露就好了?
|
||||
@@ -1,4 +0,0 @@
|
||||
export * from './types';
|
||||
export { default as WxLocation } from './wx-location.vue';
|
||||
|
||||
// TODO @hw:每个组件下的 index.ts 要不都删除,统一在 mp/components/index.ts 暴露就好了?
|
||||
@@ -1,4 +1,3 @@
|
||||
// TODO @hw:ele 没这个文件,是不是也要搞个?
|
||||
export interface WxLocationProps {
|
||||
label: string;
|
||||
locationX: number;
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Col, Row } from 'ant-design-vue';
|
||||
|
||||
defineOptions({ name: 'WxLocation' });
|
||||
|
||||
// TODO @dylan:@hw:apps/web-antd/src/views/mall/trade/delivery/pickUpStore/modules/form.vue 参考这个,从后端拿 key 哈
|
||||
// TODO @dylan:apps/web-antd/src/views/mall/trade/delivery/pickUpStore/modules/form.vue 参考这个,从后端拿 key 哈
|
||||
const props = withDefaults(defineProps<WxLocationProps>(), {
|
||||
qqMapKey: 'TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E', // QQ 地图的密钥 https://lbs.qq.com/service/staticV2/staticGuide/staticDoc
|
||||
});
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export { default as WxMaterialSelect } from './wx-material-select.vue';
|
||||
|
||||
// TODO @hw:每个组件下的 index.ts 要不都删除,统一在 mp/components/index.ts 暴露就好了?
|
||||
@@ -43,7 +43,7 @@ const queryParams = reactive({
|
||||
}); // 查询参数
|
||||
|
||||
const voiceGridColumns: VxeTableGridOptions<any>['columns'] = [
|
||||
// TODO @hw:@dylan:any 有 linter 告警;看看别的模块哈
|
||||
// TODO @dylan:any 有 linter 告警;看看别的模块哈
|
||||
{
|
||||
field: 'mediaId',
|
||||
title: '编号',
|
||||
@@ -78,7 +78,7 @@ const voiceGridColumns: VxeTableGridOptions<any>['columns'] = [
|
||||
];
|
||||
|
||||
const videoGridColumns: VxeTableGridOptions<any>['columns'] = [
|
||||
// TODO @hw:@dylan:any 有 linter 告警;看看别的模块哈
|
||||
// TODO @dylan:any 有 linter 告警;看看别的模块哈
|
||||
{
|
||||
field: 'mediaId',
|
||||
title: '编号',
|
||||
@@ -382,7 +382,7 @@ watch(
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/** TODO @dylan:@hw:看看有没适合 tindwind 的哈。 */
|
||||
/** TODO @dylan:看看有没适合 tindwind 的哈。 */
|
||||
@media (width >= 992px) and (width <= 1300px) {
|
||||
.waterfall {
|
||||
column-count: 3;
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
export * from './types';
|
||||
|
||||
export { default as WxMsg } from './wx-msg.vue';
|
||||
|
||||
// TODO @hw:每个组件下的 index.ts 要不都删除,统一在 mp/components/index.ts 暴露就好了?
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import type { User } from './types';
|
||||
import type { MpUserApi } from '#/api/mp/user/index';
|
||||
|
||||
import { preferences } from '@vben/preferences';
|
||||
import { formatDateTime } from '@vben/utils';
|
||||
@@ -11,7 +11,7 @@ defineOptions({ name: 'MsgList' });
|
||||
const props = defineProps<{
|
||||
accountId: number;
|
||||
list: any[];
|
||||
user: User;
|
||||
user: Partial<MpUserApi.User>;
|
||||
}>();
|
||||
|
||||
const SendFrom = {
|
||||
@@ -63,7 +63,7 @@ function getNickname(sendFrom: number) {
|
||||
<style lang="scss" scoped>
|
||||
/* 因为 joolun 实现依赖 avue 组件,该页面使用了 comment.scss、card.scc */
|
||||
|
||||
/** TODO @dylan:@hw 看看有没适合 tindwind 的哈。 */
|
||||
/** TODO @dylan: 看看有没适合 tindwind 的哈。 */
|
||||
|
||||
@import url('./comment.scss');
|
||||
@import url('./card.scss');
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
import { MpMsgType } from '@vben/constants';
|
||||
import { IconifyIcon } from '@vben/icons';
|
||||
|
||||
// TODO @hw:貌似这个 antd 才有?ele 需要有么?
|
||||
import {
|
||||
WxLocation,
|
||||
WxMusic,
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
// TODO @hw:用 MpUserApi 里的 user 可以么?
|
||||
|
||||
export interface User {
|
||||
accountId: number;
|
||||
avatar: string;
|
||||
nickname: string;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import type { User } from './types';
|
||||
import type { MpUserApi } from '#/api/mp/user/index';
|
||||
|
||||
import { nextTick, onMounted, reactive, ref, unref } from 'vue';
|
||||
|
||||
@@ -29,7 +29,7 @@ const queryParams = reactive({
|
||||
pageSize: 14, // 每页显示多少条
|
||||
});
|
||||
|
||||
const user: User = reactive({
|
||||
const user: Partial<MpUserApi.User> = reactive({
|
||||
accountId, // 公众号账号编号
|
||||
avatar: preferences.app.defaultAvatar,
|
||||
nickname: '用户', // 由于微信不再提供昵称,直接使用"用户"展示
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export { default as WxMusic } from './wx-music.vue';
|
||||
|
||||
// TODO @hw:每个组件下的 index.ts 要不都删除,统一在 mp/components/index.ts 暴露就好了?
|
||||
@@ -3,6 +3,8 @@ import type { WxMusicProps } from './types';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { Typography } from 'ant-design-vue';
|
||||
|
||||
/** 微信消息 - 音乐 */
|
||||
defineOptions({ name: 'WxMusic' });
|
||||
|
||||
@@ -14,6 +16,8 @@ const props = withDefaults(defineProps<WxMusicProps>(), {
|
||||
thumbMediaUrl: '',
|
||||
});
|
||||
|
||||
const { Link } = Typography;
|
||||
|
||||
const href = computed(() => props.hqMusicUrl || props.musicUrl);
|
||||
|
||||
defineExpose({
|
||||
@@ -23,8 +27,7 @@ defineExpose({
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<!-- TODO @hw:是不是用 antd link 更好? -->
|
||||
<a :href="href" target="_blank" class="text-success no-underline">
|
||||
<Link :href="href" target="_blank" class="text-success no-underline">
|
||||
<div class="music-card">
|
||||
<div class="music-avatar">
|
||||
<img :src="thumbMediaUrl" alt="音乐封面" />
|
||||
@@ -34,12 +37,12 @@ defineExpose({
|
||||
<div class="music-description">{{ description }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/** TODO @dylan:@hw:看看有没适合 tindwind 的哈。 */
|
||||
/** TODO @dylan:看看有没适合 tindwind 的哈。 */
|
||||
|
||||
.music-card {
|
||||
display: flex;
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export { default as WxNews } from './wx-news.vue';
|
||||
|
||||
// TODO @hw:每个组件下的 index.ts 要不都删除,统一在 mp/components/index.ts 暴露就好了?
|
||||
@@ -52,7 +52,7 @@ defineExpose({
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/** TODO @dylan:@hw:看看有没适合 tindwind 的哈。 */
|
||||
/** TODO @dylan:看看有没适合 tindwind 的哈。 */
|
||||
|
||||
.news-home {
|
||||
width: 100%;
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
export * from './types';
|
||||
|
||||
export { default as WxReply } from './wx-reply.vue';
|
||||
|
||||
// TODO @hw:每个组件下的 index.ts 要不都删除,统一在 mp/components/index.ts 暴露就好了?
|
||||
@@ -65,21 +65,20 @@ async function customRequest(options: any) {
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
// TODO @hw:if return 风格,简化掉。if (result.code !=== 0) { ... }
|
||||
if (result.code === 0) {
|
||||
// 清空上传时的各种数据
|
||||
fileList.value = [];
|
||||
uploadData.title = '';
|
||||
uploadData.introduction = '';
|
||||
|
||||
// 上传好的文件,本质是个素材,所以可以进行选中
|
||||
selectMaterial(result.data);
|
||||
message.success('上传成功');
|
||||
onSuccess(result, file);
|
||||
} else {
|
||||
if (result.code !== 0) {
|
||||
message.error(result.msg || '上传出错');
|
||||
onError(new Error(result.msg || '上传失败'));
|
||||
return;
|
||||
}
|
||||
// 清空上传时的各种数据
|
||||
fileList.value = [];
|
||||
uploadData.title = '';
|
||||
uploadData.introduction = '';
|
||||
|
||||
// 上传好的文件,本质是个素材,所以可以进行选中
|
||||
selectMaterial(result.data);
|
||||
message.success('上传成功');
|
||||
onSuccess(result, file);
|
||||
} catch (error) {
|
||||
message.error('上传失败,请重试');
|
||||
onError(error);
|
||||
|
||||
@@ -21,8 +21,6 @@ import {
|
||||
import { WxMaterialSelect } from '#/views/mp/components';
|
||||
import { UploadType, useBeforeUpload } from '#/views/mp/hooks/useUpload';
|
||||
|
||||
// TODO @hw:类似 tab-image.vue 的建议
|
||||
|
||||
defineOptions({ name: 'TabMusic' });
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -76,20 +74,20 @@ async function customRequest(options: any) {
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
if (result.code === 0) {
|
||||
// 清空上传时的各种数据
|
||||
fileList.value = [];
|
||||
uploadData.title = '';
|
||||
uploadData.introduction = '';
|
||||
|
||||
// 上传好的文件,本质是个素材,所以可以进行选中
|
||||
selectMaterial(result.data);
|
||||
message.success('上传成功');
|
||||
onSuccess(result, file);
|
||||
} else {
|
||||
if (result.code !== 0) {
|
||||
message.error(result.msg || '上传出错');
|
||||
onError(new Error(result.msg || '上传失败'));
|
||||
return;
|
||||
}
|
||||
// 清空上传时的各种数据
|
||||
fileList.value = [];
|
||||
uploadData.title = '';
|
||||
uploadData.introduction = '';
|
||||
|
||||
// 上传好的文件,本质是个素材,所以可以进行选中
|
||||
selectMaterial(result.data);
|
||||
message.success('上传成功');
|
||||
onSuccess(result, file);
|
||||
} catch (error) {
|
||||
message.error('上传失败,请重试');
|
||||
onError(error);
|
||||
|
||||
@@ -93,7 +93,7 @@ function onDelete() {
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/** TODO @dylan:@hw:看看有没适合 tindwind 的哈。 */
|
||||
/** TODO @dylan:看看有没适合 tindwind 的哈。 */
|
||||
.select-item {
|
||||
width: 280px;
|
||||
padding: 10px;
|
||||
|
||||
@@ -74,21 +74,20 @@ async function customRequest(options: any) {
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
// TODO @hw:也采用类似 ele 的 if return(res.code !== 0) return 写法;
|
||||
if (result.code === 0) {
|
||||
// 清空上传时的各种数据
|
||||
fileList.value = [];
|
||||
uploadData.title = '';
|
||||
uploadData.introduction = '';
|
||||
|
||||
// 选择素材
|
||||
selectMaterial(result.data);
|
||||
message.success('上传成功');
|
||||
onSuccess(result, file);
|
||||
} else {
|
||||
if (result.code !== 0) {
|
||||
message.error(result.msg || '上传出错');
|
||||
onError(new Error(result.msg || '上传失败'));
|
||||
return;
|
||||
}
|
||||
// 清空上传时的各种数据
|
||||
fileList.value = [];
|
||||
uploadData.title = '';
|
||||
uploadData.introduction = '';
|
||||
|
||||
// 选择素材
|
||||
selectMaterial(result.data);
|
||||
message.success('上传成功');
|
||||
onSuccess(result, file);
|
||||
} catch (error) {
|
||||
message.error('上传失败,请重试');
|
||||
onError(error);
|
||||
|
||||
@@ -66,21 +66,21 @@ async function customRequest(options: any) {
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
// TODO @hw:if result.code !== 0 return,代码简洁一点。
|
||||
if (result.code === 0) {
|
||||
// 清空上传时的各种数据
|
||||
fileList.value = [];
|
||||
uploadData.title = '';
|
||||
uploadData.introduction = '';
|
||||
|
||||
// 上传好的文件,本质是个素材,所以可以进行选中
|
||||
selectMaterial(result.data);
|
||||
message.success('上传成功');
|
||||
onSuccess(result, file);
|
||||
} else {
|
||||
if (result.code !== 0) {
|
||||
message.error(result.msg || '上传出错');
|
||||
onError(new Error(result.msg || '上传失败'));
|
||||
return;
|
||||
}
|
||||
|
||||
// 清空上传时的各种数据
|
||||
fileList.value = [];
|
||||
uploadData.title = '';
|
||||
uploadData.introduction = '';
|
||||
|
||||
// 上传好的文件,本质是个素材,所以可以进行选中
|
||||
selectMaterial(result.data);
|
||||
message.success('上传成功');
|
||||
onSuccess(result, file);
|
||||
} catch (error) {
|
||||
message.error('上传失败,请重试');
|
||||
onError(error);
|
||||
@@ -169,7 +169,7 @@ function selectMaterial(item: Reply) {
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/** TODO @dylan:@hw:看看有没适合 tindwind 的哈。 */
|
||||
/** TODO @dylan:看看有没适合 tindwind 的哈。 */
|
||||
.select-item {
|
||||
padding: 10px;
|
||||
margin: 0 auto 10px;
|
||||
|
||||
@@ -26,7 +26,6 @@ const emit = defineEmits<{
|
||||
(e: 'update:modelValue', v: Reply): void;
|
||||
}>();
|
||||
|
||||
// TODO @hw:antd 和 ele 风格不同,需要统一;
|
||||
interface Props {
|
||||
modelValue: Reply | undefined;
|
||||
newsType?: NewsType;
|
||||
@@ -45,7 +44,6 @@ const reply = computed<Reply>({
|
||||
const tabCache = new Map<ReplyType, Reply>(); // 作为多个标签保存各自 Reply 的缓存
|
||||
const currentTab = ref<ReplyType>(props.modelValue?.type || ReplyType.Text); // 采用独立的 ref 来保存当前 tab,避免在 watch 标签变化,对 reply 进行赋值会产生了循环调用
|
||||
|
||||
// TODO @hw:antd 和 ele 风格不同,需要统一;
|
||||
// 监听 modelValue 变化,同步更新 currentTab 和缓存
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
@@ -64,7 +62,6 @@ watch(
|
||||
{ immediate: true, deep: true },
|
||||
);
|
||||
|
||||
// TODO @hw:antd 和 ele 风格不同,需要统一;
|
||||
watch(
|
||||
currentTab,
|
||||
(newTab, oldTab) => {
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export { default as WxVideoPlayer } from './wx-video-play.vue';
|
||||
|
||||
// TODO @hw:每个组件下的 index.ts 要不都删除,统一在 mp/components/index.ts 暴露就好了?
|
||||
@@ -1,3 +0,0 @@
|
||||
export { default as WxVoicePlayer } from './wx-voice-play.vue';
|
||||
|
||||
// TODO @hw:每个组件下的 index.ts 要不都删除,统一在 mp/components/index.ts 暴露就好了?
|
||||
Reference in New Issue
Block a user