Skip to content

Commit 1a1bfe0

Browse files
committed
REVIEW 公众号的实现
1 parent 3aefedf commit 1a1bfe0

File tree

9 files changed

+20
-334
lines changed

9 files changed

+20
-334
lines changed

build/vite/optimize.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ const include = [
7575
'element-plus/es/components/dropdown-item/style/css',
7676
'element-plus/es/components/badge/style/css',
7777
'element-plus/es/components/breadcrumb/style/css',
78-
'element-plus/es/components/breadcrumb-item/style/css'
78+
'element-plus/es/components/breadcrumb-item/style/css',
79+
'element-plus/es/components/image/style/css'
7980
]
8081

8182
const exclude = ['@iconify/json']

src/views/mp/components/WxMpSelect.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<el-option v-for="item in accountList" :key="item.id" :label="item.name" :value="item.id" />
44
</el-select>
55
</template>
6-
6+
<!-- TODO @芋艿:WxMpSelect 改成 WxAccountSelect,然后挪到现有的 wx-account-select 包下 -->
77
<script lang="ts" setup name="WxMpSelect">
88
import * as MpAccountApi from '@/api/mp/account'
99

src/views/mp/components/wx-editor/WxEditor.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,3 @@ const uploadError = () => {
102102
</div>
103103
</div>
104104
</template>
105-
106-
<style></style>

src/views/mp/draft/index.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,6 @@ import * as MpFreePublishApi from '@/api/mp/freePublish'
252252
import type { UploadFiles, UploadProps, UploadRawFile } from 'element-plus'
253253
// 可以用改本地数据模拟,避免API调用超限
254254
// import drafts from './mock'
255-
256255
const message = useMessage() // 消息
257256
258257
const loading = ref(true) // 列表的加载中
@@ -362,7 +361,7 @@ const submitForm = async () => {
362361
} finally {
363362
dialogNewsVisible.value = false
364363
addMaterialLoading.value = false
365-
getList()
364+
await getList()
366365
}
367366
}
368367

src/views/mp/material/index.vue

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -277,14 +277,11 @@ const uploadRules: FormRules = {
277277
}
278278
279279
// 素材类型
280-
type MatertialType = 'image' | 'voice' | 'video'
281-
const type = ref<MatertialType>('image')
282-
// 遮罩层
283-
const loading = ref(false)
284-
// 总条数
285-
// 数据列表
286-
const list = ref<any[]>([])
287-
const total = ref(0)
280+
type MaterialType = 'image' | 'voice' | 'video'
281+
const type = ref<MaterialType>('image')
282+
const loading = ref(false) // 遮罩层
283+
const list = ref<any[]>([]) // 总条数
284+
const total = ref(0) // 数据列表
288285
// 查询参数
289286
interface QueryParams {
290287
pageNo: number
@@ -302,7 +299,7 @@ const queryParams: QueryParams = reactive({
302299
const fileList = ref<UploadUserFile[]>([])
303300
304301
interface UploadData {
305-
type: MatertialType
302+
type: MaterialType
306303
title: string
307304
introduction: string
308305
}
@@ -346,7 +343,7 @@ const handleQuery = () => {
346343
347344
const onTabChange = (tabName: TabPaneName) => {
348345
// 设置 type
349-
uploadData.type = tabName as MatertialType
346+
uploadData.type = tabName as MaterialType
350347
351348
// 提前情况数据,避免tab切换后显示垃圾数据
352349
list.value = []

src/views/mp/tag/index.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,10 @@
7171
<TagForm ref="formRef" @success="getList" />
7272
</template>
7373
<script setup lang="ts" name="MpTag">
74+
import { dateFormatter } from '@/utils/formatTime'
7475
import * as MpTagApi from '@/api/mp/tag'
7576
import TagForm from './TagForm.vue'
7677
import WxMpSelect from '@/views/mp/components/WxMpSelect.vue'
77-
import { dateFormatter } from '@/utils/formatTime'
78-
7978
const message = useMessage() // 消息弹窗
8079
const { t } = useI18n() // 国际化
8180
@@ -93,7 +92,6 @@ const queryParams: QueryParams = reactive({
9392
pageSize: 10,
9493
accountId: undefined
9594
})
96-
9795
const formRef = ref<InstanceType<typeof TagForm> | null>(null)
9896
9997
/** 侦听公众号变化 **/

src/views/mp/user/index.vue

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,8 @@ const queryParams: QueryParams = reactive({
121121
openid: null,
122122
nickname: null
123123
})
124-
125-
const tagList = ref<any[]>([]) // 公众号标签列表
126124
const queryFormRef = ref<FormInstance | null>(null) // 搜索的表单
127-
const formRef = ref<InstanceType<typeof UserForm> | null>(null)
128-
129-
/** 初始化 */
130-
onMounted(async () => {
131-
tagList.value = await MpTagApi.getSimpleTagList()
132-
})
125+
const tagList = ref<any[]>([]) // 公众号标签列表
133126
134127
/** 侦听公众号变化 **/
135128
const onAccountChanged = (id?: number) => {
@@ -165,6 +158,7 @@ const resetQuery = () => {
165158
}
166159
167160
/** 添加/修改操作 */
161+
const formRef = ref<InstanceType<typeof UserForm> | null>(null)
168162
const openForm = (id: number) => {
169163
formRef.value?.open(id)
170164
}
@@ -175,7 +169,12 @@ const handleSync = async () => {
175169
await message.confirm('是否确认同步粉丝?')
176170
await MpUserApi.syncUser(queryParams.accountId)
177171
message.success('开始从微信公众号同步粉丝信息,同步需要一段时间,建议稍后再查询')
178-
getList()
172+
await getList()
179173
} catch {}
180174
}
175+
176+
/** 初始化 */
177+
onMounted(async () => {
178+
tagList.value = await MpTagApi.getSimpleTagList()
179+
})
181180
</script>

src/views/pay/order/orderForm.vue

Lines changed: 0 additions & 152 deletions
This file was deleted.

0 commit comments

Comments
 (0)