Parcourir la source

feat: 菜单新增"去洗车"按钮,miniprogram 类型跳转小程序首页

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
skyline il y a 20 heures
Parent
commit
22799de7e1

+ 5 - 1
car-wash-miniapp/src/main/java/com/kym/miniapp/controller/WeixinMPController.java

@@ -100,7 +100,11 @@ public class WeixinMPController {
     @ResponseBody
     public R<?> createMenu() {
         try {
-            String menuJson = "{\"button\":[{\"type\":\"view\",\"name\":\"停车减免\",\"url\":\"https://cloud.yeswash.cn/parking.html\"},{\"type\":\"view\",\"name\":\"商家入口\",\"url\":\"https://cloud.yeswash.cn/h5#/\"}]}";
+            String menuJson = "{\"button\":["
+                    + "{\"type\":\"view\",\"name\":\"停车减免\",\"url\":\"https://cloud.yeswash.cn/parking.html\"},"
+                    + "{\"type\":\"miniprogram\",\"name\":\"去洗车\",\"appid\":\"wxe466e6b630cc47ae\",\"pagepath\":\"pages/index/index\",\"url\":\"https://cloud.yeswash.cn\"},"
+                    + "{\"type\":\"view\",\"name\":\"商家入口\",\"url\":\"https://cloud.yeswash.cn/h5#/\"}"
+                    + "]}";
             log.info("创建菜单: {}", menuJson);
             String result = wxMpService.getMenuService().menuCreate(menuJson);
             log.info("菜单创建结果: {}", result);

+ 7 - 0
docs/mp_menu.json

@@ -5,6 +5,13 @@
       "name": "停车减免",
       "url": "https://cloud.yeswash.cn/parking.html"
     },
+    {
+      "type": "miniprogram",
+      "name": "去洗车",
+      "appid": "wxe466e6b630cc47ae",
+      "pagepath": "pages/index/index",
+      "url": "https://cloud.yeswash.cn"
+    },
     {
       "type": "view",
       "name": "商家入口",