Просмотр исходного кода

修改了电动牙刷商城的页面

liuzhiwei 7 лет назад
Родитель
Сommit
e7e71cc246

+ 16 - 1
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/agentInfoMapper.xml

@@ -64,7 +64,10 @@
                 and a.agent_id = #{agentId}
             </if>
             <if test="configStatus != null">
-                AND config_status = #{configStatus}
+                AND a.config_status = #{configStatus}
+            </if>
+            <if test="colorId != null and colorId != ''">
+                and a.color_id = #{colorId}
             </if>
         </where>
         ORDER BY a.config_create_time DESC
@@ -98,6 +101,15 @@
             <if test="colorName != null and colorName != ''">
                 and c.color_name like CONCAT('%',#{colorName},'%')
             </if>
+            <if test="agentId != null and agentId != ''">
+                and a.agent_id = #{agentId}
+            </if>
+            <if test="configStatus != null">
+                AND a.config_status = #{configStatus}
+            </if>
+            <if test="colorId != null and colorId != ''">
+                and a.color_id = #{colorId}
+            </if>
         </where>
         ORDER BY a.config_create_time DESC
     </select>
@@ -236,6 +248,9 @@
         </set>
         <where>
               agent_tel = #{agentTel}
+            <if test="agentStatus != null and agentStatus != ''">
+              and agent_status = #{agentStatus}
+            </if>
         </where>
     </update>
 

+ 12 - 6
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/admin/AdminAgentToothHandler.java

@@ -308,18 +308,24 @@ public class AdminAgentToothHandler {
             msg.setResultCode(ResultInfo.ERRORCODE);
             msg.setStatus(false);
             msg.setMessage("修改代理商优惠价配置失败!");
+            return msg;
         }
         AgentConfig config2 = new AgentConfig();
         config2.setConfigStatus(1);
         config2.setAgentId(config.getAgentId());
         config2.setColorId(config.getColorId());
+        config2.setPage(null);
         //根据代理商id和产品颜色id查询配置信息
-        config2 = agentInfoService.getAgentConfig(config);
-        if (config2 != null && config2.getConfigId().intValue() != config.getConfigId()) {
-            msg.setResultCode(ResultInfo.ERRORCODE);
-            msg.setStatus(false);
-            msg.setMessage("该代理商已配置过该产品的优惠价,不能重复配置!");
-            return msg;
+        List<AgentConfig> configList = agentInfoService.listAgentConfig(config2);
+        if (configList != null && configList.size() > 0) {
+            for (AgentConfig agent : configList) {
+                if (agent != null && agent.getConfigId().intValue() != config.getConfigId()) {
+                    msg.setResultCode(ResultInfo.ERRORCODE);
+                    msg.setStatus(false);
+                    msg.setMessage("该代理商已配置过该产品的优惠价,不能重复配置!");
+                    return msg;
+                }
+            }
         }
         //修改代理商优惠价配置信息
         int num = agentInfoService.updateAgentConfig(config);

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

@@ -115,6 +115,7 @@ public class AgentToothHandler {
             return msg;
         }
         agentTooth.setAgentOpenid(member.getUserOpenid());
+        agentTooth.setAgentStatus(1);
         //激活代理商信息
         int num = agentInfoService.updateAgentOpenId(agentTooth);
         if (num > 0) {

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

@@ -156,7 +156,7 @@ $(document).on('tap', '#pull-code', function() {
                         }else{
 						if(dt.resultCode=="200"){
                             console.log("获取短信成功!");
-                            $("#btn-submit").removeAttr("disabled").addClass("active");
+                            $("#btn_submit").removeAttr("disabled").removeClass("mui-active");
 						}else{
 						    mui.alert("短信发送失败!")
 						}
@@ -270,7 +270,7 @@ function change_input() {
                             } else {
                                 if(dt.resultCode == "200") {
                                     mui.alert("提交成功!",function(){
-                                        location.href="agent_center.html";
+                                        location.href="/tooth/view/agent_tooth/agent_center.html";
                                     });
                                 } else {
                                     console.log("提交失败!请重试");

Разница между файлами не показана из-за своего большого размера
+ 113 - 11
tooth-wechat-web/src/main/webapp/view/agent_tooth/agent_center.html


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

@@ -364,7 +364,7 @@ mui('body').on('tap','.btn-clearing',function(){
                 if(data.status == true) { // 支付成功
                     window.location.href = base_path + "/order/paySuccess?orderId=" + orderId + "&dates=" + new Date().getTime();
                 } else {
-                    window.location.href = '/tooth/pay/goOrderInfo?orderId=' + orderId + "&dates=" + new Date().getTime();;
+                    window.location.href = '/tooth/view/agent_tooth/agent_center.html';
                 }
             });
         }

+ 172 - 0
tooth-wechat-web/src/main/webapp/view/agent_tooth/replace_point.html

@@ -0,0 +1,172 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<meta charset="UTF-8">
+		<title>更换刷头提示</title>
+		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
+		<meta name="apple-mobile-web-app-capable" content="yes">
+		<meta name="apple-mobile-web-app-status-bar-style" content="black">
+		<link rel="stylesheet" type="text/css" href="//css.iamberry.com/tooth/css/mui.min.css?v=2017101701" />
+		<link rel="stylesheet" type="text/css" href="//css.iamberry.com/tooth/css/iconfont.css?v=2017101701" />
+		<link rel="stylesheet" type="text/css" href="//css.iamberry.com/tooth/css/style.css?v=2017101701" />
+		<style>
+			.yuan{width: 100px;height: 100px;margin: 50px auto;border-radius: 50%;border:3px solid #a6e7fe;line-height: 100px;position: relative;color: #3ba7c9;}
+			.yuan:before{content: '';position: absolute;width: 1px;height: 30px;left: 50%;top: -40px;background-color: rgba(0,0,0,.1);}
+			.yuan:after{content: '';position: absolute;width: 1px;height: 30px;left: 50%;bottom: -40px;background-color: rgba(0,0,0,.1);}
+			.price{position: relative;font-size: 50px;color: #54c0dc;padding-left: 5px;height: 70px;}
+			.price:after{content: '¥';position: absolute;left: 0;top:30px;color: #54c0dc;font-size: 16px;}
+			.btn-send{width: 70px;height: 70px;position: absolute;right: 18px;top: 50%;-webkit-transform: translateY(-50%);transform: translateY(-50%);border-radius: 50%;color:#54c0dc;background-color: #fff;line-height: 70px;}
+			.content1{position: absolute;left: 120px;top: 50%;-webkit-transform: translateY(-50%);transform: translateY(-50%); color: #54c0dc;text-align: left;}
+			.couponbox{padding: 0 10px;position: relative;margin: 15px 0;display: none;}
+			.mui-popup.mui-popup-in{height: 360px;background: url(http://static.iamberry.com/images/shop/yhq_dlg_bg.png) center top /100% no-repeat;}
+			.mui-popup-inner{background-color: transparent;margin-top: 80px;padding: 15px 15px 5px 15px;position: static;}
+			.mui-popup-title{font-size: 16px;color: #939393;}
+			.mui-popup-title+.mui-popup-text{margin-top: 15px;}
+			.mui-popup-text strong{color: #fc5b8b;font-size:20px;}
+			.mui-popup-text span{color: #fc5b8b;font-size: 30px;}
+			.mui-popup-button{background-color: transparent;}
+			.mui-popup-button:after,.mui-popup-inner:after{display: none;}
+			.mui-popup-button:last-child{border-radius: 25px;background: #f44f80;height: 38px;line-height: 40px;font-weight: 100;color: #fff;width: 50%;margin: 10px auto;}
+			.mui-popup-button:last-child:active{background: #fc5b8b;}
+			.mui-popup-button:first-child{border-radius: 25px;background: #fff;height: 38px;line-height: 40px;font-weight: 100;color:#ed376c;width: 50%;margin: 10px auto;border:1px solid #ed376c}
+			.mui-popup-button:first-child:active{background: #c9c9c9;}
+			.mui-popup-buttons{display: block;}
+			.x-close{position: absolute;right:32px;top: 0;width:20px;}
+			.mui-popup.mui-popup-out{-webkit-transition-duration: 0ms;transition-duration: 0ms;}
+			.no_yhq{text-align: center;position:absolute;left:0;top:50%;width:100%;display: none;-webkit-transform: translateY(-70%);transform: translateY(-70%);}
+			.no_yhq img{width:33%;}
+		</style>
+		<script type="text/javascript">
+            // 屏蔽分享
+            window.hiddenAllWechatMenu = true;
+		</script>
+	</head>
+	<body style="background: #fff;">
+	<div class="loading-bg">
+			<div class="mui-loading">
+				<div class="mui-spinner">
+				</div>
+				&nbsp;&nbsp;加载中...
+			</div>
+	</div>
+	<div class="mui-content" style="background: #fff;">
+		<div style="height: 200px; background:-webkit-gradient(linear, 0 0, 0 bottom, from(#34a3c5), to(#75cbe8));">
+			<div style="width: 100px;margin: 0 auto;padding: 20px 0 15px 0;">
+				<img width="100px" src="/tooth/common/shop/images/tx-4.png" />
+			</div>
+			<div style="color: #fff;text-align: center;">
+				亲,您的牙刷刷头已经使用3个月 <br/>定期更换刷头,可有效防止细菌滋生
+			</div>
+		</div>
+		<div class="mui-text-center" style="padding: 10px 0;">
+			<h5 id="hintCreateTime">1900-01-01</h5>
+			<div>开始使用</div>
+			<div class="yuan">
+				三个月
+			</div>
+			<h5 id="hintTime">1900-01-01</h5>
+			<div>需要更换</div>
+			<div class="couponbox">
+				<img width="100%" src="/tooth/common/shop/images/quan-bg3.png" />
+				<div style="position: absolute;left: 45px;top: 50%;-webkit-transform: translateY(-50%);"><span class="price">0</span></div>
+				<div class="content1">
+				<div>仅供购买刷头使用</div>
+				<div style="font-size: 12px;">限量100份</div>
+				</div>
+				<div class="btn-send">立即领取</div>
+			</div>
+		</div>
+	</div>
+<script src="//s.iamberry.com/tooth/js/mui.min.js?v=2017101701"></script>
+<script src="//s.iamberry.com/tooth/js/jquery-2.1.1.min.js"></script>
+<script src="//s.iamberry.com/tooth/js/shop/main.js?v=2017101701"></script>
+<script src="//s.iamberry.com/tooth/js/shop/wechat-utils-1.0.js"></script>
+<script type="text/javascript">
+    var hintId=getParam("hintId");
+    var couponTypeId='';
+	mui.ready(function(){
+        mui.ajax(base_path + '/agentTooth/select_order_hint?dates=' + new Date().getTime(), {
+            data:{"hintId":hintId},
+            dataType: 'json',
+            type: 'post',
+            timeout: 15000,
+            success: function(dt) {
+                //console.log(dt)
+                if(dt.resultCode=="200") {
+                    $("#hintCreateTime").text(formatDate(dt.data.hint.hintCreateTime));
+                    $("#hintTime").text(formatDate(dt.data.hint.hintTime));
+                    coupon(dt.data.couponTypeId);
+                    couponTypeId=dt.data.couponTypeId;
+                }else{
+                    console.log("获取信息失败!");
+				}
+            },
+            error: function(xhr, type, errorThrown) {
+                errorfn(xhr)
+            }
+        });
+		document.querySelector('.loading-bg').style.display='none';
+	});
+	function coupon(typeId){
+        var btnArray = ['否', '是'];
+        mui.ajax(base_path + '/coupon/couponTypeList', {
+            data: {
+                "typeId": typeId
+            },
+            dataType: 'json',
+            type: 'post',
+            timeout: 15000,
+            success: function(dt) {
+                //console.log(dt);
+                if(dt.resultCode=="200") {
+                    if(dt.data.typeList.length>0){
+                    $(".price").text(accDiv(dt.data.typeList[0].couponReduce, 100));
+                    /*$(".btn-send").attr("name",dt.data.typeList[0].couponId);*/
+                    $(".couponbox").show();
+                    }
+                }
+            },
+            error: function(xhr, type, errorThrown) {
+                console.log(xhr);
+            }
+        });
+	}
+	//领券
+    $(document).on('tap','.btn-send',function(){
+        if(couponTypeId!=''){
+            mui.ajax(base_path + '/coupon/getCoupon', {
+                data: {
+                    "couponId": couponTypeId
+                },
+                dataType: 'json',
+                type: 'post',
+                timeout: 15000,
+                success: function(dt) {
+                    //console.log(dt);
+                    if(dt.status) {
+                        var btnArray = ['查看优惠券', '立 即 使 用'];
+                        mui.confirm('<span>' + $(".price").text() + '元 </span>优惠券<img class="x-close" src="/tooth/common/shop/images/x.png" />', '恭喜您成功领取一张', btnArray, function(e) {
+                            if(e.index == 1) {
+                                location.href = base_path + '/wxCart/goProductList'
+                            } else {
+                                location.href = base_path + '/couponWechat/couponList'
+                            }
+                        })
+                    } else {
+                        var r = confirm(dt.message);
+                        if(r == true) {
+                            location.reload(true)
+                        }
+                    }
+                },
+                error: function(xhr, type, errorThrown) {
+                    if(xhr.readyState == 4 && xhr.status == 200) {} else {
+                        location.href = domanUrl + base_path + "/couponWechat/coupon?dates=" + new Date().getTime()
+                    }
+                }
+            });
+		}
+	});
+	</script>
+	</body>
+</html>