1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
| export interface Replay {
| title: string;
| description: string;
| picUrl: string;
| url: string;
| }
|
| export type MenuType =
| | ''
| | 'article_view_limited'
| | 'click'
| | 'location_select'
| | 'pic_photo_or_album'
| | 'pic_sysphoto'
| | 'pic_weixin'
| | 'scancode_push'
| | 'scancode_waitmsg'
| | 'view';
|
| interface _RawMenu {
| // db
| id: number;
| parentId: number;
| accountId: number;
| appId: string;
| createTime: number;
|
| // mp-native
| name: string;
| menuKey: string;
| type: MenuType;
| url: string;
| miniProgramAppId: string;
| miniProgramPagePath: string;
| articleId: string;
| replyMessageType: string;
| replyContent: string;
| replyMediaId: string;
| replyMediaUrl: string;
| replyThumbMediaId: string;
| replyThumbMediaUrl: string;
| replyTitle: string;
| replyDescription: string;
| replyArticles: Replay;
| replyMusicUrl: string;
| replyHqMusicUrl: string;
| }
|
| export type RawMenu = Partial<_RawMenu>;
|
| interface _Reply {
| type: string;
| accountId: number;
| content: string;
| mediaId: string;
| url: string;
| thumbMediaId: string;
| thumbMediaUrl: string;
| title: string;
| description: string;
| articles: null | Replay[];
| musicUrl: string;
| hqMusicUrl: string;
| }
|
| export type Reply = Partial<_Reply>;
|
| interface _Menu extends RawMenu {
| children: _Menu[];
| reply: Reply;
| }
|
| export type Menu = Partial<_Menu>;
|
| export const menuOptions = [
| {
| value: 'view',
| label: '跳转网页',
| },
| {
| value: 'miniprogram',
| label: '跳转小程序',
| },
| {
| value: 'click',
| label: '点击回复',
| },
| {
| value: 'article_view_limited',
| label: '跳转图文消息',
| },
| {
| value: 'scancode_push',
| label: '扫码直接返回结果',
| },
| {
| value: 'scancode_waitmsg',
| label: '扫码回复',
| },
| {
| value: 'pic_sysphoto',
| label: '系统拍照发图',
| },
| {
| value: 'pic_photo_or_album',
| label: '拍照或者相册',
| },
| {
| value: 'pic_weixin',
| label: '微信相册',
| },
| {
| value: 'location_select',
| label: '选择地理位置',
| },
| ];
|
|