Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dongbw 8 years ago
parent
commit
70250a7a98

+ 17 - 1
donate-service/src/main/java/com/uas/service/donate/controller/WxpayController.java

@@ -212,13 +212,14 @@ public class WxpayController {
         }
 
         WxPayUnifiedOrderRequest wxPayUnifiedOrderRequest = createWxPayUnifiedOrderRequest(request, projectRecode, WxPayConstants.TradeType.MWEB);
+        // currentUrl当有三个参数时去掉第三个
+        currentUrl = getCurrentUrlInH5(currentUrl);
         Map map = unifiedOrder(wxPayUnifiedOrderRequest, currentUrl);
         if ("FAIL".equals(map.get("status"))) {
             modelMap.put("error", map.get("message"));
         } else {
             modelMap.put("mwebUrl", map.get("mwebUrl"));
         }
-
         return modelMap;
     }
 
@@ -651,4 +652,19 @@ public class WxpayController {
         }
         return ip;
     }
+
+    /**
+     * 微信h5支付时,对当前用户所在页面路径进行去第三个参数(订单号)处理
+     */
+    private String getCurrentUrlInH5(String currentUrl) {
+        String[] currents = currentUrl.split("/project/detail/");
+        String paraUrl = currents[1];
+        System.out.println(paraUrl);
+        String[] paras = paraUrl.split("/");
+        if (paras.length > 2) {
+            currentUrl = currents[0] + "/project/detail/" + paras[0] + "/" + paras[1];
+        }
+
+        return currentUrl;
+    }
 }

+ 2 - 6
donate-service/src/main/webapp/resources/js/mobile/controllers/MobileProjectDetailCtrl.js

@@ -62,10 +62,6 @@ define([ 'app/app' ], function(app) {
             Project.getCarousels({useFor: useFor}, {}, function(data) {
                 $scope.carousels = data;
             });
-
-            User.getUserUUByImId({imId : imId}, {}, function(data) {
-                $scope.uuid = data.userUU;
-            });
         };
         init();
 
@@ -126,12 +122,12 @@ define([ 'app/app' ], function(app) {
                     if ("SUCCESS" == res) {
                         window.location.href = "/project#/donationsOver/" + $scope.outTradeNo;
                     } else {
-                        window.location.href = "/mobile#/project/detail/" + id + "/" + imId;
+                        window.location.href = "/mobile#/project/detail/" + id + "/" + $scope.imId;
                     }
                 },
                 error : function () {
                     console.log("查询支付状态请求失败");
-                    window.location.href = "/mobile#/project/detail/" + id + "/" + imId;
+                    window.location.href = "/mobile#/project/detail/" + id + "/" + $scope.imId;
                 }
             });
         }