mp:优化【菜单】其它类型的处理

This commit is contained in:
YunaiV 2023-01-15 19:52:59 +08:00
parent 3654afedcc
commit 8600214532
4 changed files with 39 additions and 3 deletions

View File

@ -72,6 +72,12 @@ public class MpUtils {
group = ScanCodeWaitMsgButtonGroup.class; group = ScanCodeWaitMsgButtonGroup.class;
validateMessage(validator, messageType, button); // 需要额外校验回复的消息格式 validateMessage(validator, messageType, button); // 需要额外校验回复的消息格式
break; break;
case WxConsts.MenuButtonType.SCANCODE_PUSH: // 不用校验直接 return 即可
case WxConsts.MenuButtonType.PIC_SYSPHOTO:
case WxConsts.MenuButtonType.PIC_PHOTO_OR_ALBUM:
case WxConsts.MenuButtonType.PIC_WEIXIN:
case WxConsts.MenuButtonType.LOCATION_SELECT:
return;
default: default:
log.error("[validateButton][未知的按钮({})]", button); log.error("[validateButton][未知的按钮({})]", button);
throw new IllegalArgumentException("不支持的按钮类型:" + type); throw new IllegalArgumentException("不支持的按钮类型:" + type);

View File

@ -39,9 +39,24 @@
<div v-else-if="item.type === 'event' && item.event === 'VIEW'"> <div v-else-if="item.type === 'event' && item.event === 'VIEW'">
<el-tag size="mini">点击菜单链接</el-tag>{{ item.eventKey }} <el-tag size="mini">点击菜单链接</el-tag>{{ item.eventKey }}
</div> </div>
<div v-else-if="item.type === 'event' && item.event === 'scancode_waitmsg'"> <!-- TODO 芋艿需要测试下 --> <div v-else-if="item.type === 'event' && item.event === 'scancode_waitmsg'">
<el-tag size="mini">扫码结果</el-tag>{{ item.eventKey }} <el-tag size="mini">扫码结果</el-tag>{{ item.eventKey }}
</div> </div>
<div v-else-if="item.type === 'event' && item.event === 'scancode_push'">
<el-tag size="mini">扫码结果</el-tag>{{ item.eventKey }}
</div>
<div v-else-if="item.type === 'event' && item.event === 'pic_sysphoto'">
<el-tag size="mini">系统拍照发图</el-tag>
</div>
<div v-else-if="item.type === 'event' && item.event === 'pic_photo_or_album'">
<el-tag size="mini">拍照或者相册</el-tag>
</div>
<div v-else-if="item.type === 'event' && item.event === 'pic_weixin'">
<el-tag size="mini">微信相册</el-tag>
</div>
<div v-else-if="item.type === 'event' && item.event === 'location_select'">
<el-tag size="mini">选择地理位置</el-tag>
</div>
<div v-else-if="item.type === 'event'"> <div v-else-if="item.type === 'event'">
<el-tag type="danger" size="mini">未知事件类型</el-tag> <el-tag type="danger" size="mini">未知事件类型</el-tag>
</div> </div>

View File

@ -438,7 +438,7 @@ export default {
if (!item.children || item.children.length <= 0) { if (!item.children || item.children.length <= 0) {
return; return;
} }
item.children = []; menu.children = [];
item.children.forEach(subItem => { item.children.forEach(subItem => {
menu.children.push(this.convertMenuForm(subItem)) menu.children.push(this.convertMenuForm(subItem))
}) })

View File

@ -63,9 +63,24 @@
<div v-else-if="scope.row.type === 'event' && scope.row.event === 'VIEW'"> <div v-else-if="scope.row.type === 'event' && scope.row.event === 'VIEW'">
<el-tag size="mini">点击菜单链接</el-tag>{{ scope.row.eventKey }} <el-tag size="mini">点击菜单链接</el-tag>{{ scope.row.eventKey }}
</div> </div>
<div v-else-if="scope.row.type === 'event' && scope.row.event === 'scancode_waitmsg'"> <!-- TODO 芋艿需要测试下 --> <div v-else-if="scope.row.type === 'event' && scope.row.event === 'scancode_waitmsg'">
<el-tag size="mini">扫码结果</el-tag>{{ scope.row.eventKey }} <el-tag size="mini">扫码结果</el-tag>{{ scope.row.eventKey }}
</div> </div>
<div v-else-if="scope.row.type === 'event' && scope.row.event === 'scancode_push'">
<el-tag size="mini">扫码结果</el-tag>{{ scope.row.eventKey }}
</div>
<div v-else-if="scope.row.type === 'event' && scope.row.event === 'pic_sysphoto'">
<el-tag size="mini">系统拍照发图</el-tag>
</div>
<div v-else-if="scope.row.type === 'event' && scope.row.event === 'pic_photo_or_album'">
<el-tag size="mini">拍照或者相册</el-tag>
</div>
<div v-else-if="scope.row.type === 'event' && scope.row.event === 'pic_weixin'">
<el-tag size="mini">微信相册</el-tag>
</div>
<div v-else-if="scope.row.type === 'event' && scope.row.event === 'location_select'">
<el-tag size="mini">选择地理位置</el-tag>
</div>
<div v-else-if="scope.row.type === 'event'"> <div v-else-if="scope.row.type === 'event'">
<el-tag type="danger" size="mini">未知事件类型</el-tag> <el-tag type="danger" size="mini">未知事件类型</el-tag>
</div> </div>