wangshan 6 years ago
parent
commit
32ca9cdedb

+ 56 - 34
src/jfw/front/dataExport.go

@@ -460,8 +460,10 @@ func (d *DataExport) ToCreateOrderPage(_id string) error {
 		"data_count": msgCount, //匹配到的数据总数 int
 	})
 	//邮箱验证
-	email := d.GetSession("DataExportVerifyEmail")
-	resPhone := d.GetSession("DataExportVerifyPhone")
+	//	d.DelSession("DataExportVerifyEmail_val")
+	//	d.DelSession("DataExportVerifyPhone_val")
+	email := d.GetSession("DataExportVerifyEmail_val")
+	resPhone := d.GetSession("DataExportVerifyPhone_val")
 	if email != nil {
 		lastSendDEVerify := util.Int64All(d.GetSession("CreatEVerifyTime"))
 		timeSpaceing := lastSendDEVerify - time.Now().Unix() + 60*5
@@ -482,12 +484,12 @@ func (d *DataExport) ToCreateOrderPage(_id string) error {
 		}
 		if email != nil && email != "" {
 			d.SetSession("EMVerifySucess", true)
-			d.SetSession("DataExportVerifyEmail", email)
+			d.SetSession("DataExportVerifyEmail_val", email)
 		}
 		d.T["email"] = email
 	}
 	//手机号
-	phone := d.GetSession("DataExportVerifyPhone")
+	phone := d.GetSession("DataExportVerifyPhone_val")
 	if phone != nil {
 		d.T["phone"] = phone
 	} else {
@@ -497,7 +499,7 @@ func (d *DataExport) ToCreateOrderPage(_id string) error {
 			phone = resPhone
 		}
 		if phone != nil && phone != "" {
-			d.SetSession("DataExportVerifyPhone", phone)
+			d.SetSession("DataExportVerifyPhone_val", phone)
 		}
 		d.T["phone"] = phone
 	}
@@ -614,41 +616,60 @@ func subUrl(list *[]map[string]interface{}, dataType string) *[]map[string]inter
 func (d *DataExport) SendMailVerify() {
 	email := d.GetString("email")
 	if isEmail(email) {
-		lastSendDEVerify := util.Int64All(d.GetSession("CreatEVerifyTime"))
-		timeSpaceing := lastSendDEVerify - time.Now().Unix() + 60*5
-		incurKey := fmt.Sprintf("SendEmail_%s_%d", d.GetSession("s_m_openid"), time.Now().Day())
-		//log.Println(incurKey)
-		if lastSendDEVerify == 0 || timeSpaceing < 0 {
-			//每日限制10次
-			times := util.IntAll(redis.Get("other", incurKey))
-			if times < 10 {
-				if times == 0 {
-					redis.Put("other", incurKey, 1, 24*60*60)
+		var email_used = true
+		if email != d.GetSession("DataExportVerifyEmail") {
+			d.DelSession("CreatEVerifyTime")
+			openid := util.ObjToString(d.GetSession("s_m_openid"))
+			emails := public.Mysql.FindOne("dataexport_order", map[string]interface{}{
+				"user_mail":   email,
+				"user_openid": openid,
+			}, "user_mail", "")
+			if emails != nil && util.ObjToString((*emails)["user_mail"]) != "" {
+				email_used = false
+				d.T["success"] = true
+				d.T["errCode"] = 4
+				d.T["errMsg"] = "此邮箱已被验证"
+				d.SetSession("DataExportVerifyEmail_val", email)
+				d.SetSession("EMVerifySucess", true)
+			}
+		}
+		if email_used {
+			lastSendDEVerify := util.Int64All(d.GetSession("CreatEVerifyTime"))
+			timeSpaceing := lastSendDEVerify - time.Now().Unix() + 60*5
+			incurKey := fmt.Sprintf("SendEmail_%s_%d", d.GetSession("s_m_openid"), time.Now().Day())
+			//log.Println(incurKey)
+			if lastSendDEVerify == 0 || timeSpaceing < 0 {
+				//每日限制10次
+				times := util.IntAll(redis.Get("other", incurKey))
+				if times < 10 {
+					if times == 0 {
+						redis.Put("other", incurKey, 1, 24*60*60)
+					} else {
+						redis.Incr("other", incurKey)
+					}
+					//生成随机数
+					verifyStr := strings.ToUpper(util.GetComplexRandom(6, 3, 3))
+					d.SetSession("EMVerifySucess", false)
+					d.SetSession("DataExportVerifyEmail", email)
+					d.SetSession("DataExportVerify", verifyStr)
+					d.SetSession("CreatEVerifyTime", time.Now().Unix())
+					//log.Println("====================", verifyStr, "====================")
+					//发送邮箱验证码
+					go public.SendMailIdentCode(email, verifyStr, config.GmailAuth)
+					d.T["success"] = true
 				} else {
-					redis.Incr("other", incurKey)
+					d.T["success"] = false
+					d.T["errCode"] = 3
+					d.T["time"] = timeSpaceing
+					d.T["errMsg"] = "验证码发送次数已达到今日上限"
 				}
-				//生成随机数
-				verifyStr := strings.ToUpper(util.GetComplexRandom(6, 3, 3))
-				d.SetSession("EMVerifySucess", false)
-				d.SetSession("DataExportVerifyEmail", email)
-				d.SetSession("DataExportVerify", verifyStr)
-				d.SetSession("CreatEVerifyTime", time.Now().Unix())
-				//log.Println("====================", verifyStr, "====================")
-				//发送邮箱验证码
-				go public.SendMailIdentCode(email, verifyStr, config.GmailAuth)
-				d.T["success"] = true
+
 			} else {
 				d.T["success"] = false
-				d.T["errCode"] = 3
+				d.T["errCode"] = 2
 				d.T["time"] = timeSpaceing
-				d.T["errMsg"] = "验证码发送次数已达到今日上限"
+				d.T["errMsg"] = "已发送,5分钟后再尝试"
 			}
-
-		} else {
-			d.T["success"] = false
-			d.T["errCode"] = 2
-			d.T["time"] = timeSpaceing
-			d.T["errMsg"] = "已发送,5分钟后再尝试"
 		}
 	} else {
 		d.T["success"] = false
@@ -687,6 +708,7 @@ func (d *DataExport) CheckMailVerify() {
 		d.DelSession("DataExportVerify")
 		d.DelSession("CreatEVerifyTime")
 		d.SetSession("EMVerifySucess", true)
+		d.SetSession("DataExportVerifyEmail_val", DataExportEmail)
 	}
 	d.T["success"] = verityResult
 	d.ServeJson(&d.T)

+ 5 - 5
src/jfw/modules/weixin/src/config.json

@@ -11,11 +11,11 @@
     "weixinrpcport": "8083",
     "webrpcport": "127.0.0.1:8084",
     "jyop_webrpcport": "127.0.0.1:8012",
-    "webdomain": "http://webzxl.qmx.top",
-    "appid": "wxdedd73f450993685",
-    "apptoken": "top2019top2019",
-    "appsecret": "d55898fde0b7887e5fe4660bd2494700",
-    "proxysess": "http://webzxl.qmx.top/front/sess/%s",
+    "webdomain": "http://webws.qmx.top",
+    "appid": "wx5b1c6e7cc4dac0e4",
+    "apptoken": "top2015top2015",
+    "appsecret": "b026103ffebd2291b3edb7a269612112",
+    "proxysess": "http://webws.qmx.top/front/sess/%s",
     "followCompany": 10,
     "welcomemsg": "用剑鱼,所有功能完全免费,\n和传统的会员制说再见!\n\n<a href='%s'>点击这里</a>设置关键词,或直接回复“订阅 关键词”,如“订阅 教学设备”,您将随时随地接收招标信息!\n\n剑鱼,让投标无限可能!",
     "tpl_subscribe_push_id": "UgDiQfxHKj4kJXOeOV8fslKRyjZeLbaSyU7qc20b5-I",

+ 3 - 2
src/jfw/pay/weixin.go

@@ -323,8 +323,8 @@ func (p *WxPayAction) SacnPay_CreateOrder() {
 		}
 	}
 	//
-	user_mail, _ := p.GetSession("DataExportVerifyEmail").(string)
-	user_phone, _ := p.GetSession("DataExportVerifyPhone").(string)
+	user_mail, _ := p.GetSession("DataExportVerifyEmail_val").(string)
+	user_phone, _ := p.GetSession("DataExportVerifyPhone_val").(string)
 	user_mail_status := p.GetSession("EMVerifySucess").(bool)
 	data_spec := p.GetString("data_spec")
 	pay_way := p.GetString("pay_way")
@@ -416,6 +416,7 @@ func (p *WxPayAction) SacnPay_CreateOrder() {
 					"filter_id":          id,
 				})
 				if orderid > 0 {
+					p.SetSession("DataExportVerifyPhone_val", user_phone)
 					result["status"] = "y"
 					result["code"] = ordercode
 					result["token"] = public.GetWaitPayToken(orderid, order_money, ordercode, openId)

+ 2 - 2
src/jfw/public/dataexport.go

@@ -211,7 +211,7 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time string, mailTyp
 	data_spec := util.ObjToString((*order)["data_spec"])
 	data_count := util.IntAll((*order)["data_count"])
 	//
-	product_type := util.ObjToString((*order)["product_type"])
+	product_type := util.ObjToString((*order)["product_type"]) + "导出"
 	//
 	order_money := float64(util.IntAll((*order)["order_money"])) / 100
 	out_trade_no := util.ObjToString((*order)["out_trade_no"])
@@ -278,7 +278,7 @@ func SendMailToBJFinance(order *map[string]interface{}, pay_time string, mailTyp
 		company_flag := "none"
 		taxnum_flag := "none"
 		if applybill_type != 0 {
-			bill_title = "公司"
+			bill_title = "单位"
 			bill_company = util.ObjToString((*order)["applybill_company"])
 			bill_taxnum = util.ObjToString((*order)["applybill_taxnum"])
 			company_flag = "flex"

+ 21 - 2
src/web/staticres/dataExport/css/payment_order.css

@@ -90,7 +90,7 @@ body { background-color: #F5F5FB !important; }
 
 #pay .inner .money > div { font-size: 14px; }
 
-#pay .inner .money > div:nth-of-type(1) {margin: 20px 0 0px 20px;float: left; line-height: 20px; color: #888888; font-size: 12px;}
+#pay .inner .money > div:nth-of-type(1) {margin: 30px 0 10px 20px;float: left; line-height: 20px; color: #888888; font-size: 12px;}
 
 #pay .inner .money > div:nth-of-type(2) { margin: 18px 0 11px 0; color: #1d1d1d; }
 
@@ -294,4 +294,23 @@ button{
     margin-left: -16px !important;
     border: 1px solid #ccc !important;
 }
-/* --end-- */
+/* --end-- */
+.type-a {
+    height: 52px;
+    line-height: 52px;
+	display:none;
+}
+
+.dialog-box {
+    background-color: #4c4c4c;
+    color: white;
+    font-size: 16px;
+    width: 176px;
+    box-sizing: border-box;
+    border-radius: 8px;
+    position: absolute;
+    left: 50%;
+    bottom: 56%;
+    transform: translateX(-50%);
+    text-align: center;
+}

+ 46 - 11
src/web/templates/pc/createOrderPage.html

@@ -110,7 +110,7 @@
         </div>
         <div class="money ">
 			<div>
-				<p>如需发票,请拨打客服电话 400-108-6670</p>
+<!--				<p>如需发票,请拨打客服电话 400-108-6670</p>-->
 				<p>如发票金额低于200元(不含),则快递费用到付。</p>
 			</div>
 			<div class="clearfix">
@@ -141,6 +141,7 @@
             </div>
         </div>
     </div>
+	<div class="dialog-box type-a"></div>
 </section>
 
 <script>
@@ -172,6 +173,7 @@
 		ChangePayMoney();
 
 		if(email_lastInput!=""){
+			$(".email_check_ok").show();
 			$(".email_input").val(email_lastInput);
 			finishEmailVerity=true;
 		}
@@ -179,6 +181,7 @@
 			sendemailTimer(email_lastVerity);
 		}
 		if(phone_lastInput!=""){
+			$(".phone_check_ok").show();
 			$(".phone_input").val(phone_lastInput);
 			finishPhoneVerity=true;
 		}
@@ -195,6 +198,7 @@
 					finishEmailVerity=false;
 					$(".toPay").css("background-color","#ddd")
 					$(".toPay").attr("disabled","disabled");
+					$(".email_check_ok").hide();
 				}else{
 					finishEmailVerity=true;
 					if(readClause&&finishPhoneVerity){
@@ -204,7 +208,7 @@
 					$(".sendEmail").hide();
 					$(".verity_input").hide();
 					$(".email_err_msg").hide();
-					$(".email_check_ok").hide();
+					$(".email_check_ok").show();
 				}
 			}else{
 				$(".sendEmail").hide();
@@ -212,6 +216,14 @@
 				$(".email_err_msg").hide();
 				$(".email_check_ok").hide();
 			}
+		}).blur(function(){
+			var email=$(".email_input").val().replace(/\s*/g,"");
+			if(!/\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(email)){
+				showEmailErr("邮箱格式不正确");
+				return
+			}
+			$(".email_check_ok").show();
+			showEmailErr("");
 		});
 		//手机号输入监控
 		var Verification = {
@@ -255,7 +267,16 @@
 				$(".toPay").css("background-color","#ddd")
 				$(".toPay").attr("disabled","disabled");
 			}
-		});
+		}).blur(function(){
+			var phone_input = $(this).val().replace(/\s*/g,"");
+			if (phone_input.length != 11) {
+				$(".phone_err_msg").show();
+				$(".phone_check_ok").hide();
+				finishPhoneVerity=false;
+				$(".toPay").css("background-color","#ddd")
+				$(".toPay").attr("disabled","disabled");
+			}
+		});;
 		//邮箱验证
 		var canVerify=true;
 		$(".sendEmail").on("click",function(){
@@ -272,14 +293,25 @@
 			$.post("/front/dataExport/sendMailVerify",{"email":email},function(data){
 				canVerify=true;
 				if(data.success){
-					$(".toPay").attr("disabled","disabled");
-					finishEmailVerity=false;
-					//发送成功
-					sendemailTimer(60*5);
-					$(".sendEmail").addClass("verity_send");
-					$(".verity_input").show();
-					$(".sendEmail").attr("disabled","disabled");
-					$(".email_input").attr("disabled","disabled");
+					if(data.errCode==4){
+						$(".type-a").text(data.errMsg);
+						$(".type-a").show();
+						setTimeout(function(){
+							$(".type-a").hide();
+						},2000)
+						finishEmailVerity=true;
+						$(".sendEmail").hide();
+						$(".email_check_ok").show();
+					}else{
+						$(".toPay").attr("disabled","disabled");
+						finishEmailVerity=false;
+						//发送成功
+						sendemailTimer(60*5);
+						$(".sendEmail").addClass("verity_send");
+						$(".verity_input").show();
+						$(".sendEmail").attr("disabled","disabled");
+						$(".email_input").attr("disabled","disabled");
+					}
 				}else{
 					showEmailErr(data.errMsg)
 					if(data.errCode==2){
@@ -433,6 +465,9 @@
 		}
 		
 		if(str!=""){
+			if(str.indexOf("5分钟")>0){
+				$(".verity_input").show();
+			}
 			$(".email_err_msg").css("display","").html("<i class=\"iconfont icon-cuowu\"></i>"+str);
 		}else{
 			$(".email_err_msg").css("display","none")

+ 9 - 5
src/web/templates/pc/dataExport_sieve.html

@@ -798,7 +798,7 @@
     function onclearing(obj) {
         $(obj).attr("data-value", "");
         if (!$("#starttime").attr("data-value") && !$("#endtime").attr("data-value")) {
-            $("#sieveDate .u-select").first().addClass("select");
+            //$("#sieveDate .u-select").first().addClass("select");
             selectDateDisSelect();
         }
     }
@@ -858,15 +858,19 @@
 	$("#dateConfirm").click(function () {
         var startt = $("#starttime").attr("data-value");
         var endt = $("#endtime").attr("data-value");
-		if(startt!=undefined||endt!=undefined){
+		if((startt==undefined&&endt==undefined)||(startt==""&&endt=="")){
+			if(startt==""&&endt==""){
+				$("#sieveDate .u-select").first().addClass("select");
+			}
+            dateDisSel();
+			resetSelectDate();
+            selectDateDisSelect();
+		}else{
 	        dateDisSel();
 	        $("#sieveDate .u-select").removeClass("select");
 			dateSelected();
 	        selectDateSelect();
 	    	dateConfirmHide();
-		}else{
-            dateDisSel();
-			resetSelectDate();
 		}
 	    dateShow = false;
     });

+ 3 - 1
src/web/templates/pc/myOrder.html

@@ -160,12 +160,14 @@
                                     "<a class=\"xq\" onclick=\"toDetail('" + orderCode + "');\" target=\"_blank\">查看详情</a>" +
                                     "<a class=\"pay\" onclick=\"toPay('" + orderCode + "','" + token + "');\">去支付</a>";
                             cla = "nopay";
-                            deleteOrderHtml = "<a class=\"fr iconfont  icon-shanchu\" onclick=\"deleteOrder(" + id + ",this)\"></a>";
+                            deleteOrderHtml = "<a class=\"fr iconfont  icon-shanchu\" title=\"删除订单\" onclick=\"deleteOrder(" + id + ",this)\"></a>";
                         }else if(orderStatus==1){
                             orderStatusHtml +=
                                     "<p class=\"wc\">已完成</p>" +
                                     "<a class=\"wcxq\" onclick=\"toDetail('" + orderCode + "');\" target=\"_blank\">查看详情</a>";
                             cla = "pay";
+							deleteOrderHtml = "<a class=\"fr iconfont  icon-shanchu\" title=\"删除订单\" onclick=\"deleteOrder(" + id + ",this)\"></a>";
+
                         }
                         if(obj.filter_keys && obj.filter_keys.split(",").length>0){
                             var height = 66;