Browse Source

修改了代理商支付跳转

liuzhiwei 7 years ago
parent
commit
3a30497ad8

+ 3 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/agentInfoMapper.xml

@@ -259,6 +259,9 @@
             <if test="agentStatus!=null and agentStatus!=''">
                 and agent_status = #{agentStatus}
             </if>
+            <if test="agentOpenid!=null and agentOpenid!=''">
+                and agent_openid = #{agentOpenid}
+            </if>
         </where>
         order by agent_create_date desc
         <if test="page!=null and page.pageSize>0 ">

+ 18 - 0
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/agentInfo/AgentToothHandler.java

@@ -11,6 +11,7 @@ import com.iamberry.wechat.face.agentInfo.AgentInfoService;
 import com.iamberry.wechat.face.agentInfo.AgentPurchaseOrderService;
 import com.iamberry.wechat.face.member.MemberService;
 import com.iamberry.wechat.face.order.CodeService;
+import com.iamberry.wechat.tools.NameUtils;
 import com.iamberry.wechat.tools.ResponseJson;
 import com.iamberry.wechat.tools.ResultInfo;
 import org.apache.commons.lang.StringUtils;
@@ -18,8 +19,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -163,4 +166,19 @@ public class AgentToothHandler {
         msg.setStatus(true);
         return msg;
     }
+
+    @RequestMapping("/go_agent_tooth")
+    public void goAgentTooth(HttpServletRequest req,HttpServletResponse res) throws Exception {
+        Member member = WechatUtils.getUserBySession(req);
+        AgentTooth tooth = new AgentTooth();
+        tooth.setAgentOpenid(member.getUserOpenid());
+        tooth.setAgentStatus(1);
+        //查询代理商信息
+        List<AgentTooth> toothList = agentInfoService.selectAllAgentinfo(tooth);
+        if (toothList == null || toothList.size() == 0) {
+            req.getRequestDispatcher(NameUtils.getConfig("WECHAT_AGENT_TOOT_ACTIVATE")).forward(req, res);
+        } else {
+            req.getRequestDispatcher(NameUtils.getConfig("WECHAT_AGENT_TOOT_CENTER")).forward(req, res);
+        }
+    }
 }

+ 5 - 0
tooth-wechat-web/src/main/resources/platform.properties

@@ -89,6 +89,11 @@ WECHAT_SHOP_ORDER_GOORDERLIST=/WEB-INF/views/wechat/order_list.html
 WECHAT_SHOP_PRODUCT_LIST=/WEB-INF/views/wechat/chanpin_list.html
 # wechat_cash_log_list
 WECHAT_CASH_LOG_LIST=/WEB-INF/views/wechat/cash_log.html
+
+WECHAT_AGENT_TOOT_ACTIVATE=/view/agent_tooth/activate_agent_id.html
+
+WECHAT_AGENT_TOOT_CENTER=/view/agent_tooth/agent_center.html
+
 # wechat_withdraw_cash_log_list
 WECHAT_WITHDRAW_CASH_LOG_LIST=/WEB-INF/views/wechat/tixian_log_cash.html
 # WECHAT_SHOP_FENXIAO_INDEX !!!

+ 2 - 2
tooth-wechat-web/src/main/webapp/WEB-INF/views/wechat/chanpin_details.html

@@ -65,9 +65,9 @@
 
 		<div class="chanpin-ditails-dic">
 			<ul>
-				<li class="color-list" id="product_details" style="display: none;">
+				<!--<li class="color-list" id="product_details" style="display: none;">
 					<button type="button" class="blue chanpin_details" proid="59" colorid="41">蓝色款</button><button type="button" class="red chanpin_details" proid="56" colorid="37">红色款</button><button type="button" class="black chanpin_details" proid="57" colorid="39">黑色款</button>
-				</li>
+				</li>-->
 				<!-- 产品参数图 -->
 				<li id="product-param-img">
                             <span id="youhui_img">

+ 3 - 1
tooth-wechat-web/src/main/webapp/view/agent_tooth/agent_center.html

@@ -257,7 +257,9 @@ mui.each(document.querySelectorAll('#tabbar-chart-bar .mui-control-item'), funct
 	}, false);
 });
     mui('body').on('tap','.go-purchasing',function() {
-       location.href='purchasing_products.html';
+        mui.openWindow({
+            url: '/tooth/view/agent_tooth/purchasing_products.html'
+        })
     });
 	</script>
 	</body>

+ 9 - 2
tooth-wechat-web/src/main/webapp/view/agent_tooth/purchasing_products.html

@@ -250,7 +250,9 @@ mui('body').on('tap','.btn-clearing',function(){
                                     "orderId": dt.data.orderId
                                 }, function(data) {
                                     if(data.status == true) { // 支付成功
-                                        window.location.href = base_path + "/order/paySuccess?orderId=" + orderIds.orderId + "&dates=" + new Date().getTime();
+                                        mui.openWindow({
+                                            url: '/tooth/view/agent_tooth/agent_center.html'
+                                        })
                                     } else {
                                         setTimeout("checkOrderStatus('" + dt.data.orderId + "')", 1000);
                                     }
@@ -258,12 +260,17 @@ mui('body').on('tap','.btn-clearing',function(){
                             } else {
                                 isPay = true;
                                  mui.alert("支付失败!请稍后重试,订单编号:" + dt.data.orderId + "!");
+                                mui.openWindow({
+                                    url: '/tooth/view/agent_tooth/agent_center.html'
+                                })
                             }
                         });
                     } else {
                         isPay = true;
                         mui.alert(dt.message);
-                        window.location.href = "/tooth/pay/goOrderInfo?orderId=" + dt.data.orderId + "&dates=" + new Date().getTime(); // 前往订单详情
+                        mui.openWindow({
+                            url: '/tooth/view/agent_tooth/agent_center.html'
+                        })
                     }
                 },
                 error: function(xhr, type, errorThrown) {