REVIEW 公众号的实现

(cherry picked from commit 1a1bfe0ebb)
pull/173/head
YunaiV 2023-04-13 22:25:35 +08:00 committed by shizhong
parent 0da3c00dea
commit df41b6860e
7 changed files with 20 additions and 28 deletions

View File

@ -79,7 +79,8 @@ const include = [
'element-plus/es/components/dropdown-item/style/css',
'element-plus/es/components/badge/style/css',
'element-plus/es/components/breadcrumb/style/css',
'element-plus/es/components/breadcrumb-item/style/css'
'element-plus/es/components/breadcrumb-item/style/css',
'element-plus/es/components/image/style/css'
]
const exclude = ['@iconify/json']

View File

@ -3,7 +3,7 @@
<el-option v-for="item in accountList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</template>
<!-- TODO @芋艿WxMpSelect 改成 WxAccountSelect然后挪到现有的 wx-account-select 包下 -->
<script lang="ts" setup name="WxMpSelect">
import * as MpAccountApi from '@/api/mp/account'

View File

@ -102,5 +102,3 @@ const uploadError = () => {
</div>
</div>
</template>
<style></style>

View File

@ -252,7 +252,6 @@ import * as MpFreePublishApi from '@/api/mp/freePublish'
import type { UploadFiles, UploadProps, UploadRawFile } from 'element-plus'
// API
// import drafts from './mock'
const message = useMessage() //
const loading = ref(true) //
@ -362,7 +361,7 @@ const submitForm = async () => {
} finally {
dialogNewsVisible.value = false
addMaterialLoading.value = false
getList()
await getList()
}
}

View File

@ -276,14 +276,11 @@ const uploadRules: FormRules = {
}
//
type MatertialType = 'image' | 'voice' | 'video'
const type = ref<MatertialType>('image')
//
const loading = ref(false)
//
//
const list = ref<any[]>([])
const total = ref(0)
type MaterialType = 'image' | 'voice' | 'video'
const type = ref<MaterialType>('image')
const loading = ref(false) //
const list = ref<any[]>([]) //
const total = ref(0) //
//
interface QueryParams {
pageNo: number
@ -301,7 +298,7 @@ const queryParams: QueryParams = reactive({
const fileList = ref<UploadUserFile[]>([])
interface UploadData {
type: MatertialType
type: MaterialType
title: string
introduction: string
}
@ -345,7 +342,7 @@ const handleQuery = () => {
const onTabChange = (tabName: TabPaneName) => {
// type
uploadData.type = tabName as MatertialType
uploadData.type = tabName as MaterialType
// tab
list.value = []

View File

@ -71,11 +71,10 @@
<TagForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts" name="MpTag">
import { dateFormatter } from '@/utils/formatTime'
import * as MpTagApi from '@/api/mp/tag'
import TagForm from './TagForm.vue'
import WxMpSelect from '@/views/mp/components/WxMpSelect.vue'
import { dateFormatter } from '@/utils/formatTime'
const message = useMessage() //
const { t } = useI18n() //
@ -93,7 +92,6 @@ const queryParams: QueryParams = reactive({
pageSize: 10,
accountId: undefined
})
const formRef = ref<InstanceType<typeof TagForm> | null>(null)
/** 侦听公众号变化 **/

View File

@ -121,15 +121,8 @@ const queryParams: QueryParams = reactive({
openid: null,
nickname: null
})
const tagList = ref<any[]>([]) //
const queryFormRef = ref<FormInstance | null>(null) //
const formRef = ref<InstanceType<typeof UserForm> | null>(null)
/** 初始化 */
onMounted(async () => {
tagList.value = await MpTagApi.getSimpleTagList()
})
const tagList = ref<any[]>([]) //
/** 侦听公众号变化 **/
const onAccountChanged = (id?: number) => {
@ -165,6 +158,7 @@ const resetQuery = () => {
}
/** 添加/修改操作 */
const formRef = ref<InstanceType<typeof UserForm> | null>(null)
const openForm = (id: number) => {
formRef.value?.open(id)
}
@ -175,7 +169,12 @@ const handleSync = async () => {
await message.confirm('是否确认同步粉丝?')
await MpUserApi.syncUser(queryParams.accountId)
message.success('开始从微信公众号同步粉丝信息,同步需要一段时间,建议稍后再查询')
getList()
await getList()
} catch {}
}
/** 初始化 */
onMounted(async () => {
tagList.value = await MpTagApi.getSimpleTagList()
})
</script>