1
0
Quellcode durchsuchen

公众号添加扫码功能
取消公众号绑定手机号校验

XFIOOLS\xfIools vor 2 Jahren
Ursprung
Commit
d30cd418b5

+ 2 - 0
src/main/java/com/ematou/wxservice/common/constant/WeChatConstant.java

@@ -30,6 +30,8 @@ public class WeChatConstant {
     public static class CustomEventKey {
         public static final String CALL_COMPANY = "call_company_button";        // 联系我们
         public static final String MY_TAKE_PARCEL_CODE = "my_code_button";      // 我的取件码
+
+        public static final String SCANCODE_PUSH_BUTTON = "scancode_push_button";      // 扫码取件
         public static final String MY_HISTORY_RECORD = "my_history_button";     // 取件历史
         public static final String POLICY_SUPPORT = "policy_support_button";    // 政策支持
     }

+ 6 - 0
src/main/java/com/ematou/wxservice/mp/handler/WeChatClickEventMessageHandler.java

@@ -39,6 +39,12 @@ public class WeChatClickEventMessageHandler implements WeChatMessageHandler {
             case WeChatConstant.CustomEventKey.MY_HISTORY_RECORD:
                 // TODO 取件记录
                 break;
+            case WeChatConstant.CustomEventKey.SCANCODE_PUSH_BUTTON:
+                // TODO 扫码取件
+//                WeChatMessageHandler handler = new WeChatScannHandler();
+//                WeChatMpXmlOutMessage outMessage = handler.handlerMessage(weChatMessage);
+
+                break;
             default:
                 break;
         }

+ 3 - 1
src/main/java/com/ematou/wxservice/mp/menu/MenuButtonManager.java

@@ -42,11 +42,13 @@ public class MenuButtonManager {
     public void init() {
         // TODO 初始化菜单按钮
         //ViewButton testBtn = new ViewButton("测试按钮", WeChatConstant.EventType.VIEW.toLowerCase(), "http://f3dhion.nat.ipyingshe.com/view/main");
+
         ClickButton myCodeBtn = new ClickButton("我的取件码", WeChatConstant.EventType.CLICK.toLowerCase(), WeChatConstant.CustomEventKey.MY_TAKE_PARCEL_CODE);
+        ClickButton scanPush = new ClickButton("扫码取件", WeChatConstant.EventType.SCANCODE_PUSH.toLowerCase(), WeChatConstant.CustomEventKey.SCANCODE_PUSH_BUTTON);
         //ClickButton myHistoryBtn = new ClickButton("取件历史", WeChatConstant.EventType.CLICK.toLowerCase(), WeChatConstant.CustomEventKey.MY_HISTORY_RECORD);
         ViewButton addressEntryBtn = new ViewButton("收货地址管理", WeChatConstant.EventType.VIEW.toLowerCase(), "http://kmall-test.ds-bay.com:8080/qrcode/verification.html");
         MenuButton takeParcelMenuButton = new MenuButton("取件服务");
-        takeParcelMenuButton.setSub_button(Arrays.asList(myCodeBtn, addressEntryBtn));
+        takeParcelMenuButton.setSub_button(Arrays.asList(scanPush, addressEntryBtn)); // myCodeBtn  我的取件码菜单屏蔽
 
         ViewButton companyState = new ViewButton("公司状态", WeChatConstant.EventType.VIEW.toLowerCase(), "http://mp.weixin.qq.com/mp/homepage?__biz=MzIwMTI2MTg1MA==&hid=3&sn=da0db13971baf7a27bf639f2f7eaebbe&scene=18#wechat_redirect");
         ViewButton companyInfo = new ViewButton("公司简介", WeChatConstant.EventType.VIEW.toLowerCase(), "http://mp.weixin.qq.com/s?__biz=MzIwMTI2MTg1MA==&mid=503159833&idx=1&sn=fbddc8c56f960d7912cee60c959c42e8&chksm=0ef9aa6c398e237a862143c4f4c7314c0159a77e87ad4fd39a89d22181bcb05aedc9a816c8b2&scene=18#wechat_redirect");

+ 5 - 5
src/main/resources/static/js/clean.js

@@ -53,17 +53,17 @@
 }
 )(jQuery);
 
-var phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/;
+// var phoneReg = /^1\d{11}$/; //
 var count = 60;
 var InterValObj1;
 var curCount1;
 function sendMessage1() {
     curCount1 = count;
     var phone = $.trim($('#phone1').val());
-    if (!phoneReg.test(phone)) {
-        alert("请输入有效的手机号码");
-        return false;
-    }
+    // if (!phoneReg.test(phone)) {
+    //     alert("请输入有效的手机号码");
+    //     return false;
+    // }
     $("#btnSendCode1").attr("disabled", "true");
     $("#btnSendCode1").val(+curCount1 + "秒再获取");