Skip to content

Commit 5c52c17

Browse files
author
puhui999
committed
Merge remote-tracking branch 'yudao/dev' into dev-to-dev
2 parents c38abc3 + 0ceddc9 commit 5c52c17

File tree

23 files changed

+331
-345
lines changed

23 files changed

+331
-345
lines changed

build/vite/optimize.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const include = [
6464
'element-plus/es/components/dropdown-menu/style/index',
6565
'element-plus/es/components/dropdown-item/style/index',
6666
'element-plus/es/components/skeleton/style/index',
67+
6768
'element-plus/es/components/skeleton/style/css',
6869
'element-plus/es/components/backtop/style/css',
6970
'element-plus/es/components/menu/style/css',
@@ -76,7 +77,21 @@ const include = [
7677
'element-plus/es/components/badge/style/css',
7778
'element-plus/es/components/breadcrumb/style/css',
7879
'element-plus/es/components/breadcrumb-item/style/css',
79-
'element-plus/es/components/image/style/css'
80+
'element-plus/es/components/image/style/css',
81+
'element-plus/es/components/tag/style/css',
82+
'element-plus/es/components/dialog/style/css',
83+
'element-plus/es/components/form/style/css',
84+
'element-plus/es/components/form-item/style/css',
85+
'element-plus/es/components/card/style/css',
86+
'element-plus/es/components/tooltip/style/css',
87+
'element-plus/es/components/radio-group/style/css',
88+
'element-plus/es/components/radio/style/css',
89+
'element-plus/es/components/input-number/style/css',
90+
'element-plus/es/components/tree-select/style/css',
91+
'element-plus/es/components/drawer/style/css',
92+
'element-plus/es/components/image-viewer/style/css',
93+
'element-plus/es/components/upload/style/css',
94+
'element-plus/es/components/switch/style/css'
8095
]
8196

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

src/api/mall/product/category.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ export interface CategoryVO {
1717
*/
1818
name: string
1919
/**
20-
* 分类图片
20+
* 移动端分类图
2121
*/
2222
picUrl: string
2323
/**
24-
* 分类排序
24+
* PC 端分类图
2525
*/
26-
sort?: number
26+
bigPicUrl?: string
2727
/**
28-
* 分类描述
28+
* 分类排序
2929
*/
30-
description?: string
30+
sort: number
3131
/**
3232
* 开启状态
3333
*/

src/api/mp/account/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import request from '@/config/axios'
22

33
export interface AccountVO {
4-
id?: number
4+
id: number
55
name: string
66
}
77

src/views/mall/product/category/CategoryForm.vue

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,30 @@
44
ref="formRef"
55
:model="formData"
66
:rules="formRules"
7-
label-width="80px"
7+
label-width="120px"
88
v-loading="formLoading"
99
>
1010
<el-form-item label="上级分类" prop="parentId">
11-
<el-tree-select
12-
v-model="formData.parentId"
13-
:data="categoryTree"
14-
:props="{ label: 'name', value: 'id' }"
15-
:render-after-expand="false"
16-
placeholder="请选择上级分类"
17-
check-strictly
18-
default-expand-all
19-
/>
11+
<el-select v-model="formData.parentId" placeholder="请选择上级分类">
12+
<el-option :key="0" label="顶级分类" :value="0" />
13+
<el-option
14+
v-for="item in categoryList"
15+
:key="item.id"
16+
:label="item.name"
17+
:value="item.id"
18+
/>
19+
</el-select>
2020
</el-form-item>
2121
<el-form-item label="分类名称" prop="name">
2222
<el-input v-model="formData.name" placeholder="请输入分类名称" />
2323
</el-form-item>
24-
<el-form-item label="分类图片" prop="picUrl">
24+
<el-form-item label="移动端分类图" prop="picUrl">
2525
<UploadImg v-model="formData.picUrl" :limit="1" :is-show-tip="false" />
26-
<div v-if="formData.parentId === 0" style="font-size: 10px">推荐 200x100 图片分辨率</div>
27-
<div v-else style="font-size: 10px">推荐 100x100 图片分辨率</div>
26+
<div style="font-size: 10px" class="pl-10px">推荐 180x180 图片分辨率</div>
27+
</el-form-item>
28+
<el-form-item label="PC 端分类图" prop="bigPicUrl">
29+
<UploadImg v-model="formData.bigPicUrl" :limit="1" :is-show-tip="false" />
30+
<div style="font-size: 10px" class="pl-10px">推荐 468x340 图片分辨率</div>
2831
</el-form-item>
2932
<el-form-item label="分类排序" prop="sort">
3033
<el-input-number v-model="formData.sort" controls-position="right" :min="0" />
@@ -40,9 +43,6 @@
4043
</el-radio>
4144
</el-radio-group>
4245
</el-form-item>
43-
<el-form-item label="分类描述">
44-
<el-input v-model="formData.description" type="textarea" placeholder="请输入分类描述" />
45-
</el-form-item>
4646
</el-form>
4747
<template #footer>
4848
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
@@ -53,7 +53,6 @@
5353
<script setup lang="ts" name="ProductCategory">
5454
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
5555
import { CommonStatusEnum } from '@/utils/constants'
56-
import { handleTree } from '@/utils/tree'
5756
import * as ProductCategoryApi from '@/api/mall/product/category'
5857
const { t } = useI18n() // 国际化
5958
const message = useMessage() // 消息弹窗
@@ -66,8 +65,8 @@ const formData = ref({
6665
id: undefined,
6766
name: '',
6867
picUrl: '',
69-
status: CommonStatusEnum.ENABLE,
70-
description: ''
68+
bigPicUrl: '',
69+
status: CommonStatusEnum.ENABLE
7170
})
7271
const formRules = reactive({
7372
parentId: [{ required: true, message: '请选择上级分类', trigger: 'blur' }],
@@ -77,7 +76,7 @@ const formRules = reactive({
7776
status: [{ required: true, message: '开启状态不能为空', trigger: 'blur' }]
7877
})
7978
const formRef = ref() // 表单 Ref
80-
const categoryTree = ref<any[]>([]) // 分类树
79+
const categoryList = ref<any[]>([]) // 分类树
8180
8281
/** 打开弹窗 */
8382
const open = async (type: string, id?: number) => {
@@ -95,7 +94,7 @@ const open = async (type: string, id?: number) => {
9594
}
9695
}
9796
// 获得分类树
98-
await getTree()
97+
categoryList.value = await ProductCategoryApi.getCategoryList({ parentId: 0 })
9998
}
10099
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
101100
@@ -131,17 +130,9 @@ const resetForm = () => {
131130
id: undefined,
132131
name: '',
133132
picUrl: '',
134-
status: CommonStatusEnum.ENABLE,
135-
description: ''
133+
bigPicUrl: '',
134+
status: CommonStatusEnum.ENABLE
136135
}
137136
formRef.value?.resetFields()
138137
}
139-
140-
/** 获得分类树 */
141-
const getTree = async () => {
142-
const data = await ProductCategoryApi.getCategoryList({})
143-
const tree = handleTree(data, 'id', 'parentId')
144-
const menu = { id: 0, name: '顶级分类', children: tree }
145-
categoryTree.value = [menu]
146-
}
147138
</script>

src/views/mall/product/category/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
<ContentWrap>
3737
<el-table v-loading="loading" :data="list" row-key="id" default-expand-all>
3838
<el-table-column label="分类名称" prop="name" sortable />
39-
<el-table-column label="分类图片" align="center" prop="picUrl">
39+
<el-table-column label="移动端分类图" align="center" prop="picUrl">
4040
<template #default="scope">
41-
<img v-if="scope.row.picUrl" :src="scope.row.picUrl" alt="分类图片" class="h-100px" />
41+
<img v-if="scope.row.picUrl" :src="scope.row.picUrl" alt="移动端分类图" class="h-100px" />
4242
</template>
4343
</el-table-column>
4444
<el-table-column label="分类排序" align="center" prop="sort" />

src/views/mp/autoReply/index.vue

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,22 +103,18 @@ import ReplyTable from './components/ReplyTable.vue'
103103
import { MsgType } from './components/types'
104104
const message = useMessage() // 消息
105105
106+
const accountId = ref(-1) // 公众号ID
106107
const msgType = ref<MsgType>(MsgType.Keyword) // 消息类型
107108
const RequestMessageTypes = ['text', 'image', 'voice', 'video', 'shortvideo', 'location', 'link'] // 允许选择的请求消息类型
108109
const loading = ref(true) // 遮罩层
109110
const total = ref(0) // 总条数
110111
const list = ref<any[]>([]) // 自动回复列表
111112
const formRef = ref<FormInstance | null>(null) // 表单 ref
112113
// 查询参数
113-
interface QueryParams {
114-
pageNo: number
115-
pageSize: number
116-
accountId: number
117-
}
118-
const queryParams: QueryParams = reactive({
114+
const queryParams = reactive({
119115
pageNo: 1,
120116
pageSize: 10,
121-
accountId: 0
117+
accountId: accountId
122118
})
123119
124120
const dialogTitle = ref('') // 弹出层标题
@@ -127,7 +123,7 @@ const replyForm = ref<any>({}) // 表单参数
127123
// 回复消息
128124
const reply = ref<Reply>({
129125
type: ReplyType.Text,
130-
accountId: 0
126+
accountId: -1
131127
})
132128
// 表单校验
133129
const rules = {
@@ -137,8 +133,9 @@ const rules = {
137133
138134
/** 侦听账号变化 */
139135
const onAccountChanged = (id: number) => {
140-
queryParams.accountId = id
136+
accountId.value = id
141137
reply.value.accountId = id
138+
queryParams.pageNo = 1
142139
getList()
143140
}
144141

src/views/mp/components/wx-account-select/main.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
import * as MpAccountApi from '@/api/mp/account'
99
1010
const account: MpAccountApi.AccountVO = reactive({
11-
id: undefined,
11+
id: -1,
1212
name: ''
1313
})
14-
const accountList: Ref<MpAccountApi.AccountVO[]> = ref([])
14+
15+
const accountList = ref<MpAccountApi.AccountVO[]>([])
1516
1617
const emit = defineEmits<{
17-
(e: 'change', id: number, name: string): void
18+
(e: 'change', id: number, name: string)
1819
}>()
1920
2021
const handleQuery = async () => {
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<template>
2+
<div>
3+
<div v-if="item.event === 'subscribe'">
4+
<el-tag type="success">关注</el-tag>
5+
</div>
6+
<div v-else-if="item.event === 'unsubscribe'">
7+
<el-tag type="danger">取消关注</el-tag>
8+
</div>
9+
<div v-else-if="item.event === 'CLICK'">
10+
<el-tag>点击菜单</el-tag>
11+
【{{ item.eventKey }}】
12+
</div>
13+
<div v-else-if="item.event === 'VIEW'">
14+
<el-tag>点击菜单链接</el-tag>
15+
【{{ item.eventKey }}】
16+
</div>
17+
<div v-else-if="item.event === 'scancode_waitmsg'">
18+
<el-tag>扫码结果</el-tag>
19+
【{{ item.eventKey }}】
20+
</div>
21+
<div v-else-if="item.event === 'scancode_push'">
22+
<el-tag>扫码结果</el-tag>
23+
【{{ item.eventKey }}】
24+
</div>
25+
<div v-else-if="item.event === 'pic_sysphoto'">
26+
<el-tag>系统拍照发图</el-tag>
27+
</div>
28+
<div v-else-if="item.event === 'pic_photo_or_album'">
29+
<el-tag>拍照或者相册</el-tag>
30+
</div>
31+
<div v-else-if="item.event === 'pic_weixin'">
32+
<el-tag>微信相册</el-tag>
33+
</div>
34+
<div v-else-if="item.event === 'location_select'">
35+
<el-tag>选择地理位置</el-tag>
36+
</div>
37+
<div v-else>
38+
<el-tag type="danger">未知事件类型</el-tag>
39+
</div>
40+
</div>
41+
</template>
42+
43+
<script setup lang="ts">
44+
const props = defineProps<{
45+
item: any
46+
}>()
47+
48+
const item = ref(props.item)
49+
</script>
50+
51+
<style scoped></style>

0 commit comments

Comments
 (0)