Browse Source

数据到出价格抽取

wangkaiyue 5 years ago
parent
commit
a93f87191c

+ 0 - 4
src/dataexport.json

@@ -1,8 +1,4 @@
 {
-    "unitPrice_normal": 1,
-    "unitPrice_senior": 2,
-    "discount": 0.01,
-    "orderMinPrice": 0.001,
     "msgMaxCount": 20000,
     "font": {
         "enabled": true,

+ 0 - 16
src/jfw/front/dataExport.go

@@ -523,24 +523,8 @@ func (d *DataExport) ToCreateOrderPage(_id string) error {
 	}
 	d.T["_id"] = _id
 	d.T["msgCount"] = msgCount
-	d.T["msgMaxCount"] = public.ExConf.MsgMaxCount
-	d.T["discount"] = public.ExConf.Discount
-	d.T["discount10"] = public.ExConf.Discount * 10
-	d.T["unitPrice_normal"] = public.ExConf.UnitPrice_normal
-	d.T["unitPrice_senior"] = public.ExConf.UnitPrice_senior
-	d.T["unitPrice_normal_final"] = (public.ExConf.UnitPrice_normal * 100) * (public.ExConf.Discount * 100) / 10000
-	d.T["unitPrice_senior_final"] = (public.ExConf.UnitPrice_senior * 100) * (public.ExConf.Discount * 100) / 10000
-	d.T["orderMinPrice"] = public.ExConf.OrderMinPrice
 	incurKey := fmt.Sprintf("PreviewData_%s_%d", d.GetSession("userId"), time.Now().Day())
 	d.T["PreviewData"] = util.IntAll(redis.Get("other", incurKey))
-	//	go func() {
-	//		orderdata := public.Mysql.FindOne("dataexport_order", map[string]interface{}{
-	//			"order_code": "143049462075",
-	//		}, "id,filter,user_mail,user_phone,product_type,data_spec,filter_id,order_code,data_count,order_status,order_money,prepay_id,applybill_type,applybill_company,applybill_taxnum", "")
-	//		tt := time.Now()
-	//		pay_time := util.FormatDate(&tt, util.Date_Full_Layout)
-	//		go public.SendMailToBJFinance(orderdata, pay_time, 2, config.GmailAuth)
-	//	}()
 	d.Render("/pc/createOrderPage.html", &d.T)
 	return nil
 }

+ 2 - 10
src/jfw/front/ws_dataExport.go

@@ -219,16 +219,8 @@ func (w *WsDataExport) ToCreateOrderPage() error {
 		w.T["phone"] = phone
 	}
 	w.T["_id"] = w.GetString("id")
-	w.T["msgCount"] = msgCount                                                                                      //信息总量
-	w.T["msgMaxCount"] = public.ExConf.MsgMaxCount                                                                  //规定信息最大总量
-	w.T["discount"] = public.ExConf.Discount                                                                        //折扣:0.5
-	w.T["discount10"] = public.ExConf.Discount * 10                                                                 //折扣:5折
-	w.T["unitPrice_normal"] = public.ExConf.UnitPrice_normal                                                        //标准字段-原价每条价格
-	w.T["unitPrice_senior"] = public.ExConf.UnitPrice_senior                                                        //高级字段-原价每条价格
-	w.T["unitPrice_normal_final"] = (public.ExConf.UnitPrice_normal * 100) * (public.ExConf.Discount * 100) / 10000 //标准字段折扣后的价格
-	w.T["unitPrice_senior_final"] = (public.ExConf.UnitPrice_senior * 100) * (public.ExConf.Discount * 100) / 10000 //高级字段折扣后的价格
-	w.T["orderMinPrice"] = public.ExConf.OrderMinPrice                                                              //最低售价
-	incurKey := fmt.Sprintf("PreviewData_%s_%d", w.GetSession("userId"), time.Now().Day())                          //每日限制预览次数
+	w.T["msgCount"] = msgCount                                                             //信息总量
+	incurKey := fmt.Sprintf("PreviewData_%s_%d", w.GetSession("userId"), time.Now().Day()) //每日限制预览次数
 	w.T["PreviewData"] = util.IntAll(redis.Get("other", incurKey))
 
 	w.T["signature"] = wx.SignJSSDK(w.Site() + w.Url())

+ 2 - 10
src/jfw/modules/app/src/app/front/ws_dataExport.go

@@ -311,16 +311,8 @@ func (w *WsDataExport) ToCreateOrderPage() error {
 		w.T["dataspec"] = spec
 	}
 	w.T["_id"] = w.GetString("id")
-	w.T["msgCount"] = msgCount                                                                                      //信息总量
-	w.T["msgMaxCount"] = public.ExConf.MsgMaxCount                                                                  //规定信息最大总量
-	w.T["discount"] = public.ExConf.Discount                                                                        //折扣:0.5
-	w.T["discount10"] = public.ExConf.Discount * 10                                                                 //折扣:5折
-	w.T["unitPrice_normal"] = public.ExConf.UnitPrice_normal                                                        //标准字段-原价每条价格
-	w.T["unitPrice_senior"] = public.ExConf.UnitPrice_senior                                                        //高级字段-原价每条价格
-	w.T["unitPrice_normal_final"] = (public.ExConf.UnitPrice_normal * 100) * (public.ExConf.Discount * 100) / 10000 //标准字段折扣后的价格
-	w.T["unitPrice_senior_final"] = (public.ExConf.UnitPrice_senior * 100) * (public.ExConf.Discount * 100) / 10000 //高级字段折扣后的价格
-	w.T["orderMinPrice"] = public.ExConf.OrderMinPrice                                                              //最低售价
-	incurKey := fmt.Sprintf("PreviewData_%s_%d", w.GetSession("userId"), time.Now().Day())                          //每日限制预览次数
+	w.T["msgCount"] = msgCount                                                             //信息总量
+	incurKey := fmt.Sprintf("PreviewData_%s_%d", w.GetSession("userId"), time.Now().Day()) //每日限制预览次数
 	w.T["PreviewData"] = util.IntAll(redis.Get("other", incurKey))
 
 	w.Render("/dataExport/dataExport_payOrder.html", &w.T)

+ 0 - 4
src/jfw/modules/app/src/dataexport.json

@@ -1,8 +1,4 @@
 {
-    "unitPrice_normal": 1,
-    "unitPrice_senior": 2,
-    "discount": 0.01,
-    "orderMinPrice": 0.001,
     "msgMaxCount": 20000,
     "font": {
         "enabled": true,

+ 759 - 704
src/jfw/modules/app/src/web/templates/dataExport/dataExport_payOrder.html

@@ -1,60 +1,62 @@
 <html>
-	<head>
-		{{include "/common/meta.html"}}
-		<title>数据导出</title>
-		<link href="/jyapp/css/layout.css?v={{Msg "seo" "version"}}" rel="stylesheet">
-		<link href="/jyapp/css/font.css?v={{Msg "seo" "version"}}" rel="stylesheet">
-        <link rel="stylesheet" href="/jyapp/dataExport/css/weui.min.css?v={{Msg "seo" "version"}}">
-        <link rel="stylesheet" type="text/css" href="/jyapp/dataExport/css/base.css?v={{Msg "seo" "version"}}" />
-        <link rel="stylesheet" type="text/css" href="/jyapp/dataExport/iconfont/iconfont.css?v={{Msg "seo" "version"}}" />
-        <link rel="stylesheet" href="/jyapp/dataExport/css/pay_order.css?v={{Msg "seo" "version"}}21">
-        <script src="/jyapp/js/jquery-3.2.1.min.js"></script>
-        <script src="/jyapp/dataExport/js/weui.min.js"></script>
-		{{include "/common/js.html"}}
-		<style>
-		#pay_order{
-		    position: absolute;
-		    top: 0px;
-		    overflow-y: auto;
-		    bottom: 0px;
-		    left: 0px;
-		    right: 0px;
-		}
-		.weui-check__label:active {
-		    background-color: #fff;
-		}
-		#code{
-			margin-left: -0.2rem;
-		}
-		</style>
-	</head>
-  <body>
-	<div class="loading_" style="display:none;">
-		<p><span></span></p>
-	</div>
-	<div class="app-layout-header">
-		<span class="app-back jyapp-icon jyapp-icon-zuojiantou"></span>
-		数据导出
-	</div>
-	<div class="app-layout-content-b">
-		<div id="pay_order">
-		<main class="main">
-			<div class="progress">
-				<div class="p-item">
-					<p class="p-item-icon">
-						<i class="icon iconfont">&#xe606;</i>
-					</p>
-					<span class="active">条件筛选</span>
-					<div class="line" style="background: #2CB7CA"></div>
-				</div>
+<head>
+    {{include "/common/meta.html"}}
+    <title>数据导出</title>
+    <link href="/jyapp/css/layout.css?v={{Msg "seo" "version"}}" rel="stylesheet">
+    <link href="/jyapp/css/font.css?v={{Msg "seo" "version"}}" rel="stylesheet">
+    <link rel="stylesheet" href="/jyapp/dataExport/css/weui.min.css?v={{Msg "seo" "version"}}">
+    <link rel="stylesheet" type="text/css" href="/jyapp/dataExport/css/base.css?v={{Msg "seo" "version"}}"/>
+    <link rel="stylesheet" type="text/css" href="/jyapp/dataExport/iconfont/iconfont.css?v={{Msg "seo" "version"}}"/>
+    <link rel="stylesheet" href="/jyapp/dataExport/css/pay_order.css?v={{Msg "seo" "version"}}21">
+    <script src="/jyapp/js/jquery-3.2.1.min.js"></script>
+    <script src="/jyapp/dataExport/js/weui.min.js"></script>
+    {{include "/common/js.html"}}
+    <style>
+        #pay_order {
+            position: absolute;
+            top: 0px;
+            overflow-y: auto;
+            bottom: 0px;
+            left: 0px;
+            right: 0px;
+        }
+
+        .weui-check__label:active {
+            background-color: #fff;
+        }
+
+        #code {
+            margin-left: -0.2rem;
+        }
+    </style>
+</head>
+<body>
+<div class="loading_" style="display:none;">
+    <p><span></span></p>
+</div>
+<div class="app-layout-header">
+    <span class="app-back jyapp-icon jyapp-icon-zuojiantou"></span>
+    数据导出
+</div>
+<div class="app-layout-content-b">
+    <div id="pay_order">
+        <main class="main">
+            <div class="progress">
+                <div class="p-item">
+                    <p class="p-item-icon">
+                        <i class="icon iconfont">&#xe606;</i>
+                    </p>
+                    <span class="active">条件筛选</span>
+                    <div class="line" style="background: #2CB7CA"></div>
+                </div>
 
-				<div class="p-item">
-					<p class="p-item-icon">
-						<i class="icon iconfont">&#xe617;</i>
-					</p>
-					<span class="active">支付订单</span>
-					<div class="line"></div>
-				</div>
+                <div class="p-item">
+                    <p class="p-item-icon">
+                        <i class="icon iconfont">&#xe617;</i>
+                    </p>
+                    <span class="active">支付订单</span>
+                    <div class="line"></div>
+                </div>
 
                 <div class="p-item">
                     <p class="p-item-icon icon-gray">
@@ -101,36 +103,38 @@
                 </div>
                 <div class="form-item phone-number">
                     <div class="form-control">
-<!--                            <label for="">手机号:</label>-->
+                        <!--                            <label for="">手机号:</label>-->
                         <div class="input">
                             <input type="text" class="phone_input" maxlength="11" placeholder="手机号" id="phone_input">
-				<div id="devinput" style="top: -0.05rem;">
-					<i class="icon iconfont phone_check_ok"></i>
-					<span class="phone_err_msg">手机号不正确</span>
-				</div>
+                            <div id="devinput" style="top: -0.05rem;">
+                                <i class="icon iconfont phone_check_ok"></i>
+                                <span class="phone_err_msg">手机号不正确</span>
+                            </div>
                         </div>
                     </div>
                 </div>
                 <p class="msg">*数据导出将发送至邮箱</p>
                 <div class="form-item" id="verify">
                     <div class="form-control">
-<!--                            <label for="">邮箱:</label>-->
+                        <!--                            <label for="">邮箱:</label>-->
                         <div class="input" id="email-input">
                             <input type="text" class="email_input" placeholder="邮箱">
-				<div id="devinput">
-					<i class="icon iconfont email_check_ok"></i>
-					<span class="email_err_msg">邮箱不正确</span>
-				</div>
+                            <div id="devinput">
+                                <i class="icon iconfont email_check_ok"></i>
+                                <span class="email_err_msg">邮箱不正确</span>
+                            </div>
                         </div>
                     </div>
-                    <div class="form-control verification" style="display: none;border-top: 1px solid #e0e0e0;margin-top: 0.06rem;">
-<!--                            <label for="">验证码:</label>-->
+                    <div class="form-control verification"
+                         style="display: none;border-top: 1px solid #e0e0e0;margin-top: 0.06rem;">
+                        <!--                            <label for="">验证码:</label>-->
                         <div class="input" id="codeinput">
-                            <input type="text" value="" readonly=true class="verity_input" id="code" maxlength="6" placeholder="验证码">
-				<div id="devinput">
-					<i class="icon iconfont code_check_ok"></i>
-					<span class="code_err_msg">验证码错误</span>
-				</div>
+                            <input type="text" value="" readonly=true class="verity_input" id="code" maxlength="6"
+                                   placeholder="验证码">
+                            <div id="devinput">
+                                <i class="icon iconfont code_check_ok"></i>
+                                <span class="code_err_msg">验证码错误</span>
+                            </div>
                             <button type="button" class="sendCode" disabled id="sendCode">发送验证码</button>
                         </div>
                     </div>
@@ -138,18 +142,21 @@
                 <div class="form-item" style="margin-top: .2rem;">
                     <div class="way">
                         <span>支付方式</span>
-                        <div class="way-right" id="choose_way"><span class="payment">微信支付</span><i class="iconfont icon-arrow icon-right"></i></div>
+                        <div class="way-right" id="choose_way"><span class="payment">微信支付</span><i
+                                    class="iconfont icon-arrow icon-right"></i></div>
                     </div>
                 </div>
-                <p class="msg">购买须知:最低起售{{.T.orderMinPrice}}元;标准字段包:原价{{.T.unitPrice_normal}}元/条、{{.T.discount10}}折价{{.T.unitPrice_normal_final}}元/条计费;高级字段包:原价{{.T.unitPrice_senior}}元/条、{{.T.discount10}}折价{{.T.unitPrice_senior_final}}元/条计费;</p>
-                
+                <p class="msg">购买须知:最低起售<span></span>元;标准字段包:原价<span></span>元/条、<span></span>
+                    折价<span></span>元/条计费;高级字段包:原价<span></span>元/条、<span></span>
+                    折价<span></span>元/条计费;</p>
+
             </div>
         </main>
-		<div class="fixed-bottom-box" id="bottombox">
+        <div class="fixed-bottom-box" id="bottombox">
             <div class="weui-cells weui-cells_checkbox radio-form">
                 <label class="weui-cell weui-check__label" for="s11">
                     <div class="weui-cell__hd">
-                        <input type="checkbox" class="weui-check" name="checkbox1" id="s11" />
+                        <input type="checkbox" class="weui-check" name="checkbox1" id="s11"/>
                         <i class="weui-icon-checked"></i>
                     </div>
                     <div class="weui-cell__bd read">
@@ -179,7 +186,8 @@
                         </li>
                         <li>
                             <label>·高级字段包</label>
-                            <p>公告标题、公告内容、公告地址、剑鱼标讯地址、省份、城市、发布时间、项目名称、项目编号、采购单位、采购单位联系人、采购单位联系电话、预算、开标日期、中标单位、中标价、招标机构、项目范围、币种、公告类别</p>
+                            <p>
+                                公告标题、公告内容、公告地址、剑鱼标讯地址、省份、城市、发布时间、项目名称、项目编号、采购单位、采购单位联系人、采购单位联系电话、预算、开标日期、中标单位、中标价、招标机构、项目范围、币种、公告类别</p>
                         </li>
                     </ul>
                 </div>
@@ -188,7 +196,7 @@
                 </div>
             </div>
         </div>
-        <!-- 选择支付方式  --> 
+        <!-- 选择支付方式  -->
         <div class="js_dialog pay_way" id="pay_way" style="display: none;">
             <div class="weui-mask"></div>
             <div class="box">
@@ -204,7 +212,7 @@
                                 <p><img src="/jyapp/dataExport/images/weixin.png">微信支付</p>
                             </div>
                             <div class="weui-cell__hd">
-                                <input type="radio" class="weui-check" name="way" value="微信支付" id="wx" checked />
+                                <input type="radio" class="weui-check" name="way" value="微信支付" id="wx" checked/>
                                 <i class="weui-icon-checked"></i>
                             </div>
                         </label>
@@ -213,7 +221,7 @@
                                 <p><img src="/jyapp/dataExport/images/zhifubao.png">支付宝支付</p>
                             </div>
                             <div class="weui-cell__hd">
-                                <input type="radio" class="weui-check" name="way" value="支付宝支付" id="zfb" />
+                                <input type="radio" class="weui-check" name="way" value="支付宝支付" id="zfb"/>
                                 <i class="weui-icon-checked"></i>
                             </div>
                         </label>
@@ -221,644 +229,691 @@
                 </div>
             </div>
         </div>
-	</div>
-	</div>
+    </div>
+</div>
+
+<script>
+    var userId ={{session "userId"}}
+    var id = {{.T._id}}
+    var msgCount = {{.T.msgCount}}
+
+    var finishEmailVerity = false;
+    var readClause = false;
+    var dataType = 1;
+    var finishPhoneVerity = false;
+
+    var msgMaxCount, discount, unitPrice_normal, unitPrice_senior, orderMinPrice;
+    //
+    var email_lastInput = {{.T.email}}
+    var email_lastVerity = {{.T.timeSpaceing}}
+    var previewDataTime = {{.T.PreviewData}}
+    var phone_lastInput = {{.T.phone}}
+    var payway ={{.T.payway}}
+    var dataspec ={{.T.dataspec}}
+    //可以支付
+    var canpay = true;
+    //订单编号
+    var order_code = ""
+    //
+    var regInt = /[0-9]/;
+    var lstimes = 0;
+    //
+    var pay_way = "wx_app"
+
+    function accMul(arg1, arg2) {
+        var m = 0,
+            s1 = arg1.toString(),
+            s2 = arg2.toString();
+        try {
+            m += s1.split(".")[1].length
+        } catch (e) {
+        }
+        try {
+            m += s2.split(".")[1].length
+        } catch (e) {
+        }
+        return parseInt(Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m).toString() * 100) /
+            Math.pow(10, 2);
+    }
+
+    //
+    function FormatNum(n) {
+        if (n >= 1000) {
+            return Math.floor(n / 1000) + "," + ("0000" + n % 1000).slice(-3)
+        }
+        return n
+    }
+
+    //
+    function ChangePayMoney() {
+        var shouldPay = 0;
+        var beforePay = 0;
+        if (dataType == 1) {
+            beforePay = accMul(unitPrice_normal, msgCount)
+            shouldPay = accMul(beforePay, discount)
+        } else if (dataType == 2) {
+            beforePay = accMul(unitPrice_senior, msgCount)
+            shouldPay = accMul(beforePay, discount)
+        }
+        shouldPay = shouldPay > orderMinPrice ? shouldPay : orderMinPrice;
+        beforePay = beforePay > orderMinPrice ? beforePay : orderMinPrice;
+        $(".pay_discount").text("¥" + shouldPay);
+        $(".pay_before").text("¥" + beforePay)
+    }
 
-		<script>
-			var userId={{session "userId"}}
-			var id = {{.T._id}}
-			var msgCount = {{.T.msgCount}}
-			var msgMaxCount = {{.T.msgMaxCount}}
-			var discount = {{.T.discount}}
-			var unitPrice_normal = {{.T.unitPrice_normal}}
-			var unitPrice_senior = {{.T.unitPrice_senior}}
-			var orderMinPrice = {{.T.orderMinPrice}}
-			var finishEmailVerity = false;
-			var readClause = false;
-			var dataType = 1;
-			var finishPhoneVerity = false;
-			//
-			var email_lastInput = {{.T.email}}
-			var email_lastVerity = {{.T.timeSpaceing}}
-			var previewDataTime = {{.T.PreviewData}}
-			var phone_lastInput = {{.T.phone}}
-			var payway ={{.T.payway}}
-			var dataspec={{.T.dataspec}}
-			//可以支付
-			var canpay = true;
-			//订单编号
-			var order_code = ""
-			//
-			var regInt = /[0-9]/;
-			var lstimes =0;
-			//
-      		var pay_way="wx_app"
-			function accMul(arg1, arg2) {
-				var m = 0,
-					s1 = arg1.toString(),
-					s2 = arg2.toString();
-				try {
-					m += s1.split(".")[1].length
-				} catch (e) {}
-				try {
-					m += s2.split(".")[1].length
-				} catch (e) {}
-				return parseInt(Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m).toString() * 100) /
-					Math.pow(10, 2);
-			}
-			//
-			function FormatNum(n) {
-				if (n >= 1000) {
-					return Math.floor(n / 1000) + "," + ("0000" + n % 1000).slice(-3)
-				}
-				return n
-			}
-			//
-			function ChangePayMoney() {
-				var shouldPay = 0;
-				var beforePay = 0;
-				if (dataType == 1) {
-					beforePay = accMul(unitPrice_normal, msgCount)
-					shouldPay = accMul(beforePay, discount)
-				} else if (dataType == 2) {
-					beforePay = accMul(unitPrice_senior, msgCount)
-					shouldPay = accMul(beforePay, discount)
-				}
-				shouldPay = shouldPay > orderMinPrice ? shouldPay : orderMinPrice;
-				beforePay = beforePay > orderMinPrice ? beforePay : orderMinPrice;
-				$(".pay_discount").text("¥" + shouldPay);
-				$(".pay_before").text("¥" + beforePay)
-			}
-			//
-			function toRead(){
-				event.preventDefault();
-				if(regInt.test($(".sendCode").text())){
-					var email_input = $(".email_input").val().replace(/\s*/g, "");
+    //
+    function toRead() {
+        event.preventDefault();
+        if (regInt.test($(".sendCode").text())) {
+            var email_input = $(".email_input").val().replace(/\s*/g, "");
 //					if (/\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(email_input)){
 //						sessionStorage.setItem("send_email_"+{{.T._id}}, $(".email_input").val().replace(/\s*/g,""));
 //					}
-				}
-				if($("#phone_input").val()){
-					sessionStorage.setItem("order_phone"+{{.T._id}}, $("#phone_input").val().replace(/\s*/g,""));
-				}
-				sessionStorage.email_lastVerity=email_lastVerity;
-				window.location.href="/jyapp/front/staticPage/dataExport_serviceterms.html";
-			}
-			$(function() {     
-				if(sessionStorage.pay_way){
-					if(sessionStorage.pay_way=="ali_app"){
-						$(".payment").text("支付宝支付");
-					}
-				}
-				//记录用户上次付款信息
-				if(payway){
-					if(payway=="ali"){
-						$("#zfb").prop("checked",true);
-						$(".payment").text("支付宝支付");
-						sessionStorage.pay_way="ali_app"
-					}else if (payway=="wx"){
-						$("#wx").prop("checked",true);
-						$(".payment").text("微信支付");
-						sessionStorage.pay_way="wx_app"
-					}
-				}
-				//记录用户上次选择的字段包  1标准2高级
-				if(dataspec){
-					if(dataspec=="1"){
-						$(".choose").children().eq(0).addClass("active");
-						$(".choose").children().eq(1).removeClass("active");
-						dataType=1;
-					}else if(dataspec=="2"){
-						$(".choose").children().eq(1).addClass("active");
-						$(".choose").children().eq(0).removeClass("active");
-						dataType=2;
-					}
-					ChangePayMoney();
-				}
-				
-				if(sessionStorage.index=="1"){
-            		$(".choose .choose-item").eq(sessionStorage.index).addClass("active").siblings().removeClass("active");
-            		dataType=2;
-            	}
-				ChangePayMoney();
+        }
+        if ($("#phone_input").val()) {
+            sessionStorage.setItem("order_phone" +{{.T._id}}, $("#phone_input").val().replace(/\s*/g, ""));
+        }
+        sessionStorage.email_lastVerity = email_lastVerity;
+        window.location.href = "/jyapp/front/staticPage/dataExport_serviceterms.html";
+    }
+
+    $(function () {
+        //加载价格
+        $.ajax({
+            url: "/jypay/dataexport/getPrice",
+            type: "POST",
+            async: false,
+            dataType: "json",
+            success: function (r) {
+                if (r) {
+                    discount = r.discount;
+                    msgMaxCount = r.unitPrice_normal;
+                    orderMinPrice = r.orderMinPrice;
+                    unitPrice_normal = r.unitPrice_normal;
+                    unitPrice_senior = r.unitPrice_senior;
+                }
+            }
+        });
 
-				//软键盘弹起 
-				var oHeight = $(document).height(); //浏览器当前的高度
-				var mainHeight=$(".main").height();
-				
-				$(window).resize(function(){
-					 if($(document).height() < oHeight){
-					   $("#bottombox").css("position","static");
-					  $("#pay_order").css("padding-bottom","0rem");
-					}else{
-					    $("#bottombox").css("position","fixed");
-					    $("#pay_order").css("padding-bottom","2.7rem");
-					}
-			   	});
-			   //	alert(sessionStorage.getItem("send_email_"+userId)!=null)
-			 //  	alert(sessionStorage.getItem("send_code_"+userId)!=null)
-			 //  	alert(sessionStorage.getItem("send_email_"+userId)==null)
-			 //  	alert(localStorage.getItem("new_email_"+userId)!=null)
-			   	//缓存  1.如果有sessionStorage邮箱 先显示此邮箱 再发送邮箱五分钟内 显示验证码输入框 2.如果没有 显示localStorage邮箱 3.如果都没得 显示email_lastInput数据库中邮箱
-			   	if((sessionStorage.getItem("send_email_"+userId)!=null)&&(sessionStorage.getItem("send_code_"+userId)!=null)){
-			   		//alert("1")
-			   		$(".email_check_ok").hide();
-					$(".email_input").parents('div.form-control').siblings().slideDown();
-			   		$(".email_input").val(sessionStorage.getItem("send_email_"+userId));
-		   			lstimes = parseInt(sessionStorage.getItem("send_code_"+userId));
-					$(".verity_input").removeAttr("readonly");
-					lstimes = lstimes -  Date.parse(new Date())/1000 + 60*5;
-					if (lstimes>0){
-						sendemailTimer(lstimes);
-					}
-					//.getItem("new_email_"+userId)!=null)
-			   	}else if((sessionStorage.getItem("send_email_"+userId)==null)&&(localStorage.getItem("new_email_"+userId)!=null)){
-			   		//alert("2")
-			   		$(".email_check_ok").show();
-					$(".email_input").val(localStorage.getItem("new_email_"+userId));
-					finishEmailVerity = true;
-			   	}else if (email_lastInput!=""){
-			   		//alert("~~")
-			   		$(".email_check_ok").show();
-					$(".email_input").val(email_lastInput);
-					finishEmailVerity = true;
-			   	}else{
-		   			$(".email_input").val("");
-			   	}
-				
-				if (email_lastVerity > 0) {
-					sendemailTimer(email_lastVerity);
-				}
-				
-				if (sessionStorage.getItem("order_phone"+{{.T._id}})!=null){
-					if((/^[1][3-9][0-9]{9}$/.test(sessionStorage.getItem("order_phone"+{{.T._id}})))){
-						$(".phone_check_ok").show();
-						$(".phone_input").val(sessionStorage.getItem("order_phone"+{{.T._id}}));
-						finishPhoneVerity=true;
-					}else{
-						$(".phone_err_msg").show();
-						$(".phone_check_ok").hide();
-						finishPhoneVerity = false;
-						$(".toPay").attr("disabled", "disabled");
-					}
-				}else if(phone_lastInput!=""){
-					$(".phone_check_ok").show();
-					$(".phone_input").val(phone_lastInput);
-					finishPhoneVerity=true;
-				}
-				
-				if(readClause&&finishPhoneVerity&&finishEmailVerity){
-					$(".toPay").removeAttr("disabled")
-				}
-				
-				//缓存判断是否点击我已阅读
-				if((sessionStorage.readClause=="true")&&finishPhoneVerity&&finishEmailVerity){
-					$(".toPay").removeAttr("disabled")
-					readClause=true;
-				}
-				//
-				$('#choose_way').click(function() {
-					$('.pay_way').slideDown('slow')
-					if(sessionStorage.pay_way=="ali_app"){
-						$("#zfb").prop("checked",true);
-						$("#wx").prop("checked",false);
-						 pay_way=sessionStorage.pay_way;
-					}
-				})
-				/* 选择支付方式*/
-				$('input:radio[name="way"]').click(function() {
-					var checkValue = $('input:radio[name="way"]:checked').val();
-			          if(checkValue=="微信支付"){
-			            pay_way="wx_app";
-			          }else{
-			            pay_way="ali_app";
-			          }
-					$('.pay_way').hide(200)
-					sessionStorage.pay_way=pay_way;
-					$('.payment').html(checkValue)
-				});
-				$(".cancel").click(function() {
-					$('.pay_way').hide(200)
-				})
-				//数据展示
-				if (sessionStorage.getItem("order_spec" + {{.T._id}}) != null) {
-					dataType = sessionStorage.getItem("order_spec" + {{.T._id}});
-				}
-				if (dataType == 1) {
-					$(".switch-dataType .bz").addClass("active")
-					$(".switch-dataType .gj").removeClass("active")
-				} else {
-					$(".switch-dataType .bz").removeClass("active")
-					$(".switch-dataType .gj").addClass("active")
-				}
-				//
-				$('.choose .choose-item').each(function() {
-					var index = $(this).index();
-					$(this).click(function() {
-						//类型切换
-						$(this).addClass("active").siblings().removeClass("active");
-						if (index == 0) {
-							dataType = 1;
-						} else if (index == 1) {
-							dataType = 2;
-						}
-						sessionStorage.index=index;
-						ChangePayMoney();
-					})
-				})
-				$('.tips-icon').on('click', function() {
-					$('#tipDialog').show(200);
-					$('.weui-dialog__btn_primary').click(function() {
-						$('#tipDialog').hide(200);
-					})
-				});
-				//手机号输入监控
-				var Verification = {
-					//手机号验证
-					isPhone: function(value) {
-						return /^[1][3-9][0-9]{9}$/.test(value);
-					}
-				};
-				$(".phone_input").on("input propertychange", function() {
-					var phone_input = $(this).val().replace(/\s*/g, "");
-					if (phone_input.length == 11) {
-						if (Verification.isPhone(phone_input)) {
-							$.post("/jyapp/front/dataExport/checkPhoneVerify", {
-								"phone": phone_input
-							}, function(data) {
-								if (data.success) {
-									$(".phone_check_ok").show();
-									$(".phone_err_msg").hide();
-									finishPhoneVerity = true;
-									if (readClause && finishEmailVerity) {
-										$(".toPay").removeAttr("disabled")
-									}
-								} else {
-									$(".phone_err_msg").show();
-									$(".phone_check_ok").hide();
-									finishPhoneVerity = false;
-									$(".toPay").attr("disabled", "disabled");
-								}
-							})
-						} else {
-							$(".phone_err_msg").show();
-							$(".phone_check_ok").hide();
-							finishPhoneVerity = false;
-							$(".toPay").attr("disabled", "disabled");
-						}
-					} else {
-						$(".phone_err_msg").hide();
-						$(".phone_check_ok").hide();
-						finishPhoneVerity = false;
-						$(".toPay").attr("disabled", "disabled");
-						sessionStorage.removeItem("ischecked");
-					}
-				}).blur(function() {
-					var phone_input = $(this).val().replace(/\s*/g, "");
-					if (phone_input.length != 11&&phone_input.length!=0) {
-						$(".phone_err_msg").show();
-						$(".phone_check_ok").hide();
-						finishPhoneVerity = false;
-						$(".toPay").attr("disabled", "disabled");
-					}
-				});
-				//邮箱输入监控
-				$(".email_input").on("input propertychange", function() {
-					var email_input = $(this).val().replace(/\s*/g, "");
-					if (email_input.indexOf("@") > 0) {
-						if (email_input != email_lastInput) {
-							$(this).parents('div.form-control').siblings().slideDown();
-							if (email_lastVerity > 0) {
-								$("#sendCode").prop("disabled", true);
-								//返回后验证码可输入  sessionStorage
-								if((localStorage.getItem("new_email_"+userId)!=null)&&(localStorage.getItem("new_email_"+userId)==email_input)){
-									$(".verity_input").prop("readonly", false);
-								}else{
-									if(email_lastVerity>0){
-										$(".verity_input").removeAttr("readonly");
-									}else if(lstimes>0){
-										$(".verity_input").removeAttr("readonly");
-									}else{
-										$(".verity_input").attr("readonly", true);
-									}
-								}
-							}else{ //app杀掉进程的 新用户  ↓
-								$(".verity_input").prop("readonly", false);
-								$("#sendCode").prop("disabled", true);
-							}
-							finishEmailVerity = false;
-							$(".toPay").prop("disabled", "disabled");
-							if (/\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(email_input)) {
-								lstimes_ = parseInt(sessionStorage.getItem("send_code_"+userId));
-								lstimes_ = lstimes_ -  Date.parse(new Date())/1000 + 60*5;
-								if (lstimes_>0) {
-									$("#sendCode").prop("disabled", true);
-								}else{
-									$("#sendCode").prop("disabled", false);
-								}
-								$(".email_err_msg").hide();
-								$(".email_check_ok").hide();
-							} else {
-								$("#sendCode").prop("disabled", true);
-								$(".email_check_ok").hide();
-								$(".email_err_msg").hide();
-							}
-						}else {
-							finishEmailVerity = true;
-							if (readClause && finishPhoneVerity) {
-								$(".toPay").removeAttr("disabled")
-							}
-							$("#sendCode").attr("disabled", "disabled");
-							$(".verity_input").attr("readonly", true);
-							$(".email_err_msg").hide();
-							$(".email_check_ok").show();
-							sessionStorage.removeItem("ischecked");
-							//验证通过后 存 localStorage邮箱  此邮箱为验证通过的邮箱   并清除sessionStorage发送验证码的邮箱
-							localStorage.setItem("new_email_"+userId,$(".email_input").val().replace(/\s*/g,""));
-							sessionStorage.removeItem("send_email_"+userId);
-							$(this).parents('div.form-control').siblings().slideUp();
-						}
-					} else {
-						$(this).parents('div.form-control').siblings().slideUp();
-						$("#sendCode").attr("disabled", "disabled");
-						$(".verity_input").attr("readonly", true);
-						$(".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)&&( $(".email_input").val().length!=0)) {
-						$(".email_err_msg").show();
-						$(".email_check_ok").hide();
-						return
-					}
-					if($(".email_input").val()==email){
-						return;
-					}
-					$("#sendCode").removeAttr("disabled");
-					$(".email_check_ok").hide();
-					$(".email_err_msg").hide();
-				}).on("focus",function(){
-			   		  this.scrollIntoView();
-				});
-				//点击发送验证码-邮箱验证
-				var canVerify = true;
-				$(".sendCode").on("click", 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)) {
-						$(".email_err_msg").show();
-						$(".email_check_ok").hide();
-						return
-					}
-					if (!canVerify) {
-						return
-					}
-					canVerify = false;
-					$.post("/jyapp/front/dataExport/sendMailVerify", {
-						"email": email
-					}, function(data) {
-						canVerify = true;
-						if (data.success) {
-							if (data.errCode == 4) {
-								EasyAlert.show(data.errMsg, "", 3000);
-								finishEmailVerity = true;
-								$(".email_check_ok").show();
-								if(readClause&&finishPhoneVerity){
-									$(".toPay").removeAttr("disabled")
-								}
-								$(".email_input").parents('div.form-control').siblings().slideUp();
-							} else {
-								$(".toPay").attr("disabled", "disabled");
-								finishEmailVerity = false;
-								//发送成功
-								sendemailTimer(60 * 5);
-								$(".verity_input").removeAttr("readonly");;
-								$(".sendCode").attr("disabled", "disabled");
-								$(".email_input").attr("readonly", true);
-								sessionStorage.setItem("send_code_"+userId, Date.parse(new Date())/1000);
-								//发送验证码后 sessionStorage邮箱 
-								sessionStorage.setItem("send_email_"+userId, $(".email_input").val().replace(/\s*/g,""));
-							}
-						} else {
-							EasyAlert.show(data.errMsg, "", 3000)
-							if (data.errCode == 2) {
-								sendemailTimer(data.time);
-								$(".sendCode").attr("disabled", "disabled");
-								$(".email_input").attr("readonly", true);
-								//发送验证码后 sessionStorage邮箱 
-								sessionStorage.setItem("send_email_"+userId, $(".email_input").val().replace(/\s*/g,""));
-							}
-						}
-					}, "json")
-				});
-				//校验验证码
-				$(".verity_input").bind("input propertychange",function(){
-					var verity=$(this).val()
-					var email=$(".email_input").val().replace(/\s*/g,"");
-					if(verity.length==6){
-						$.post("/jyapp/front/dataExport/checkMailVerify",{"emailVerity":verity,"email":email},function(data){
-							if(data.success){
-								finishEmailVerity=true;
-								if(readClause&&finishPhoneVerity){
-									$(".toPay").removeAttr("disabled")
-								}
-								$(".email_check_ok").show();
-								$(".email_err_msg").hide();
-								$(".verity_input").val("");
-								$(".verity_input").attr("readonly", true);
-								$(".email_input").parents('div.form-control').siblings().slideUp();
-								sessionStorage.setItem("EmailVerity_"+{{.T._id}},"T");
-								//验证通过后 存 localStorage邮箱  此邮箱为验证通过的邮箱   并清除sessionStorage发送验证码的邮箱
-								localStorage.setItem("new_email_"+userId,$(".email_input").val().replace(/\s*/g,""));
-								sessionStorage.removeItem("send_email_"+userId);
-							} else {
-								EasyAlert.show("验证码错误", "", 3000);
-							}
-						})
-					} else {
-						$(".email_err_msg").hide();
-					}
-					//防遮挡
-				}).on("focus",function(){
-			   		 var target = this;
-			   		setTimeout(function(){
-			   		  	target.scrollIntoViewIfNeeded();
-			   		},600)
-				})
+        //数据规格
+        $(".initial:eq(0)").text(unitPrice_normal + "元/条");
+        $(".current:eq(0)").text(unitPrice_normal * discount + "元/条");
+        $(".initial:eq(1)").text(unitPrice_senior + "元/条");
+        $(".current:eq(1)").text(unitPrice_senior * discount + "元/条");
+        //购买须知
+        $(".msg span:eq(0)").text(orderMinPrice);
+        $(".msg span:eq(1)").text(unitPrice_normal);
+        $(".msg span:eq(2)").text(discount * 10);
+        $(".msg span:eq(3)").text(discount * unitPrice_normal);
 
-				//点击阅读条款
-				$(".fixed-bottom-box .weui-check").on("click", function() {
-					if ($(this).is(":checked")) {
-						if (finishEmailVerity && finishPhoneVerity) {
-							sessionStorage.setItem("ischecked","ischecked");
-							readClause = true;
-							sessionStorage.readClause="true";
-							$(".toPay").removeAttr("disabled")
-						}else{
-							readClause=true;
-							sessionStorage.readClause="true";
-							$(".toPay").attr("disabled","disabled");
-						}
-					} else {
-						sessionStorage.removeItem("ischecked");
-						readClause = false;
-						sessionStorage.readClause="false";
-						$(".toPay").attr("disabled", "disabled");
-					}
-				})
+        $(".msg span:eq(4)").text(unitPrice_senior);
+        $(".msg span:eq(5)").text(discount * 10);
+        $(".msg span:eq(6)").text(discount * unitPrice_senior);
+
+
+        if (sessionStorage.pay_way) {
+            if (sessionStorage.pay_way == "ali_app") {
+                $(".payment").text("支付宝支付");
+            }
+        }
+        //记录用户上次付款信息
+        if (payway) {
+            if (payway == "ali") {
+                $("#zfb").prop("checked", true);
+                $(".payment").text("支付宝支付");
+                sessionStorage.pay_way = "ali_app"
+            } else if (payway == "wx") {
+                $("#wx").prop("checked", true);
+                $(".payment").text("微信支付");
+                sessionStorage.pay_way = "wx_app"
+            }
+        }
+        //记录用户上次选择的字段包  1标准2高级
+        if (dataspec) {
+            if (dataspec == "1") {
+                $(".choose").children().eq(0).addClass("active");
+                $(".choose").children().eq(1).removeClass("active");
+                dataType = 1;
+            } else if (dataspec == "2") {
+                $(".choose").children().eq(1).addClass("active");
+                $(".choose").children().eq(0).removeClass("active");
+                dataType = 2;
+            }
+            ChangePayMoney();
+        }
+
+        if (sessionStorage.index == "1") {
+            $(".choose .choose-item").eq(sessionStorage.index).addClass("active").siblings().removeClass("active");
+            dataType = 2;
+        }
+        ChangePayMoney();
 
-				//数据浏览
-				$(".dataPreview").on("tap",function(){
-					if(previewDataTime<50){
-						previewDataTime++
-						if(regInt.test($(".sendCode").text())){
-							var email_input = $(".email_input").val().replace(/\s*/g, "");
+        //软键盘弹起
+        var oHeight = $(document).height(); //浏览器当前的高度
+        var mainHeight = $(".main").height();
+
+        $(window).resize(function () {
+            if ($(document).height() < oHeight) {
+                $("#bottombox").css("position", "static");
+                $("#pay_order").css("padding-bottom", "0rem");
+            } else {
+                $("#bottombox").css("position", "fixed");
+                $("#pay_order").css("padding-bottom", "2.7rem");
+            }
+        });
+        //	alert(sessionStorage.getItem("send_email_"+userId)!=null)
+        //  	alert(sessionStorage.getItem("send_code_"+userId)!=null)
+        //  	alert(sessionStorage.getItem("send_email_"+userId)==null)
+        //  	alert(localStorage.getItem("new_email_"+userId)!=null)
+        //缓存  1.如果有sessionStorage邮箱 先显示此邮箱 再发送邮箱五分钟内 显示验证码输入框 2.如果没有 显示localStorage邮箱 3.如果都没得 显示email_lastInput数据库中邮箱
+        if ((sessionStorage.getItem("send_email_" + userId) != null) && (sessionStorage.getItem("send_code_" + userId) != null)) {
+            //alert("1")
+            $(".email_check_ok").hide();
+            $(".email_input").parents('div.form-control').siblings().slideDown();
+            $(".email_input").val(sessionStorage.getItem("send_email_" + userId));
+            lstimes = parseInt(sessionStorage.getItem("send_code_" + userId));
+            $(".verity_input").removeAttr("readonly");
+            lstimes = lstimes - Date.parse(new Date()) / 1000 + 60 * 5;
+            if (lstimes > 0) {
+                sendemailTimer(lstimes);
+            }
+            //.getItem("new_email_"+userId)!=null)
+        } else if ((sessionStorage.getItem("send_email_" + userId) == null) && (localStorage.getItem("new_email_" + userId) != null)) {
+            //alert("2")
+            $(".email_check_ok").show();
+            $(".email_input").val(localStorage.getItem("new_email_" + userId));
+            finishEmailVerity = true;
+        } else if (email_lastInput != "") {
+            //alert("~~")
+            $(".email_check_ok").show();
+            $(".email_input").val(email_lastInput);
+            finishEmailVerity = true;
+        } else {
+            $(".email_input").val("");
+        }
+
+        if (email_lastVerity > 0) {
+            sendemailTimer(email_lastVerity);
+        }
+
+        if (sessionStorage.getItem("order_phone" +{{.T._id}}) != null) {
+            if ((/^[1][3-9][0-9]{9}$/.test(sessionStorage.getItem("order_phone" +{{.T._id}})))) {
+                $(".phone_check_ok").show();
+                $(".phone_input").val(sessionStorage.getItem("order_phone" +{{.T._id}}));
+                finishPhoneVerity = true;
+            } else {
+                $(".phone_err_msg").show();
+                $(".phone_check_ok").hide();
+                finishPhoneVerity = false;
+                $(".toPay").attr("disabled", "disabled");
+            }
+        } else if (phone_lastInput != "") {
+            $(".phone_check_ok").show();
+            $(".phone_input").val(phone_lastInput);
+            finishPhoneVerity = true;
+        }
+
+        if (readClause && finishPhoneVerity && finishEmailVerity) {
+            $(".toPay").removeAttr("disabled")
+        }
+
+        //缓存判断是否点击我已阅读
+        if ((sessionStorage.readClause == "true") && finishPhoneVerity && finishEmailVerity) {
+            $(".toPay").removeAttr("disabled")
+            readClause = true;
+        }
+        //
+        $('#choose_way').click(function () {
+            $('.pay_way').slideDown('slow')
+            if (sessionStorage.pay_way == "ali_app") {
+                $("#zfb").prop("checked", true);
+                $("#wx").prop("checked", false);
+                pay_way = sessionStorage.pay_way;
+            }
+        })
+        /* 选择支付方式*/
+        $('input:radio[name="way"]').click(function () {
+            var checkValue = $('input:radio[name="way"]:checked').val();
+            if (checkValue == "微信支付") {
+                pay_way = "wx_app";
+            } else {
+                pay_way = "ali_app";
+            }
+            $('.pay_way').hide(200)
+            sessionStorage.pay_way = pay_way;
+            $('.payment').html(checkValue)
+        });
+        $(".cancel").click(function () {
+            $('.pay_way').hide(200)
+        })
+        //数据展示
+        if (sessionStorage.getItem("order_spec" + {{.T._id}}) != null) {
+            dataType = sessionStorage.getItem("order_spec" + {{.T._id}});
+        }
+        if (dataType == 1) {
+            $(".switch-dataType .bz").addClass("active")
+            $(".switch-dataType .gj").removeClass("active")
+        } else {
+            $(".switch-dataType .bz").removeClass("active")
+            $(".switch-dataType .gj").addClass("active")
+        }
+        //
+        $('.choose .choose-item').each(function () {
+            var index = $(this).index();
+            $(this).click(function () {
+                //类型切换
+                $(this).addClass("active").siblings().removeClass("active");
+                if (index == 0) {
+                    dataType = 1;
+                } else if (index == 1) {
+                    dataType = 2;
+                }
+                sessionStorage.index = index;
+                ChangePayMoney();
+            })
+        })
+        $('.tips-icon').on('click', function () {
+            $('#tipDialog').show(200);
+            $('.weui-dialog__btn_primary').click(function () {
+                $('#tipDialog').hide(200);
+            })
+        });
+        //手机号输入监控
+        var Verification = {
+            //手机号验证
+            isPhone: function (value) {
+                return /^[1][3-9][0-9]{9}$/.test(value);
+            }
+        };
+        $(".phone_input").on("input propertychange", function () {
+            var phone_input = $(this).val().replace(/\s*/g, "");
+            if (phone_input.length == 11) {
+                if (Verification.isPhone(phone_input)) {
+                    $.post("/jyapp/front/dataExport/checkPhoneVerify", {
+                        "phone": phone_input
+                    }, function (data) {
+                        if (data.success) {
+                            $(".phone_check_ok").show();
+                            $(".phone_err_msg").hide();
+                            finishPhoneVerity = true;
+                            if (readClause && finishEmailVerity) {
+                                $(".toPay").removeAttr("disabled")
+                            }
+                        } else {
+                            $(".phone_err_msg").show();
+                            $(".phone_check_ok").hide();
+                            finishPhoneVerity = false;
+                            $(".toPay").attr("disabled", "disabled");
+                        }
+                    })
+                } else {
+                    $(".phone_err_msg").show();
+                    $(".phone_check_ok").hide();
+                    finishPhoneVerity = false;
+                    $(".toPay").attr("disabled", "disabled");
+                }
+            } else {
+                $(".phone_err_msg").hide();
+                $(".phone_check_ok").hide();
+                finishPhoneVerity = false;
+                $(".toPay").attr("disabled", "disabled");
+                sessionStorage.removeItem("ischecked");
+            }
+        }).blur(function () {
+            var phone_input = $(this).val().replace(/\s*/g, "");
+            if (phone_input.length != 11 && phone_input.length != 0) {
+                $(".phone_err_msg").show();
+                $(".phone_check_ok").hide();
+                finishPhoneVerity = false;
+                $(".toPay").attr("disabled", "disabled");
+            }
+        });
+        //邮箱输入监控
+        $(".email_input").on("input propertychange", function () {
+            var email_input = $(this).val().replace(/\s*/g, "");
+            if (email_input.indexOf("@") > 0) {
+                if (email_input != email_lastInput) {
+                    $(this).parents('div.form-control').siblings().slideDown();
+                    if (email_lastVerity > 0) {
+                        $("#sendCode").prop("disabled", true);
+                        //返回后验证码可输入  sessionStorage
+                        if ((localStorage.getItem("new_email_" + userId) != null) && (localStorage.getItem("new_email_" + userId) == email_input)) {
+                            $(".verity_input").prop("readonly", false);
+                        } else {
+                            if (email_lastVerity > 0) {
+                                $(".verity_input").removeAttr("readonly");
+                            } else if (lstimes > 0) {
+                                $(".verity_input").removeAttr("readonly");
+                            } else {
+                                $(".verity_input").attr("readonly", true);
+                            }
+                        }
+                    } else { //app杀掉进程的 新用户  ↓
+                        $(".verity_input").prop("readonly", false);
+                        $("#sendCode").prop("disabled", true);
+                    }
+                    finishEmailVerity = false;
+                    $(".toPay").prop("disabled", "disabled");
+                    if (/\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(email_input)) {
+                        lstimes_ = parseInt(sessionStorage.getItem("send_code_" + userId));
+                        lstimes_ = lstimes_ - Date.parse(new Date()) / 1000 + 60 * 5;
+                        if (lstimes_ > 0) {
+                            $("#sendCode").prop("disabled", true);
+                        } else {
+                            $("#sendCode").prop("disabled", false);
+                        }
+                        $(".email_err_msg").hide();
+                        $(".email_check_ok").hide();
+                    } else {
+                        $("#sendCode").prop("disabled", true);
+                        $(".email_check_ok").hide();
+                        $(".email_err_msg").hide();
+                    }
+                } else {
+                    finishEmailVerity = true;
+                    if (readClause && finishPhoneVerity) {
+                        $(".toPay").removeAttr("disabled")
+                    }
+                    $("#sendCode").attr("disabled", "disabled");
+                    $(".verity_input").attr("readonly", true);
+                    $(".email_err_msg").hide();
+                    $(".email_check_ok").show();
+                    sessionStorage.removeItem("ischecked");
+                    //验证通过后 存 localStorage邮箱  此邮箱为验证通过的邮箱   并清除sessionStorage发送验证码的邮箱
+                    localStorage.setItem("new_email_" + userId, $(".email_input").val().replace(/\s*/g, ""));
+                    sessionStorage.removeItem("send_email_" + userId);
+                    $(this).parents('div.form-control').siblings().slideUp();
+                }
+            } else {
+                $(this).parents('div.form-control').siblings().slideUp();
+                $("#sendCode").attr("disabled", "disabled");
+                $(".verity_input").attr("readonly", true);
+                $(".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) && ($(".email_input").val().length != 0)) {
+                $(".email_err_msg").show();
+                $(".email_check_ok").hide();
+                return
+            }
+            if ($(".email_input").val() == email) {
+                return;
+            }
+            $("#sendCode").removeAttr("disabled");
+            $(".email_check_ok").hide();
+            $(".email_err_msg").hide();
+        }).on("focus", function () {
+            this.scrollIntoView();
+        });
+        //点击发送验证码-邮箱验证
+        var canVerify = true;
+        $(".sendCode").on("click", 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)) {
+                $(".email_err_msg").show();
+                $(".email_check_ok").hide();
+                return
+            }
+            if (!canVerify) {
+                return
+            }
+            canVerify = false;
+            $.post("/jyapp/front/dataExport/sendMailVerify", {
+                "email": email
+            }, function (data) {
+                canVerify = true;
+                if (data.success) {
+                    if (data.errCode == 4) {
+                        EasyAlert.show(data.errMsg, "", 3000);
+                        finishEmailVerity = true;
+                        $(".email_check_ok").show();
+                        if (readClause && finishPhoneVerity) {
+                            $(".toPay").removeAttr("disabled")
+                        }
+                        $(".email_input").parents('div.form-control').siblings().slideUp();
+                    } else {
+                        $(".toPay").attr("disabled", "disabled");
+                        finishEmailVerity = false;
+                        //发送成功
+                        sendemailTimer(60 * 5);
+                        $(".verity_input").removeAttr("readonly");
+                        ;
+                        $(".sendCode").attr("disabled", "disabled");
+                        $(".email_input").attr("readonly", true);
+                        sessionStorage.setItem("send_code_" + userId, Date.parse(new Date()) / 1000);
+                        //发送验证码后 sessionStorage邮箱
+                        sessionStorage.setItem("send_email_" + userId, $(".email_input").val().replace(/\s*/g, ""));
+                    }
+                } else {
+                    EasyAlert.show(data.errMsg, "", 3000)
+                    if (data.errCode == 2) {
+                        sendemailTimer(data.time);
+                        $(".sendCode").attr("disabled", "disabled");
+                        $(".email_input").attr("readonly", true);
+                        //发送验证码后 sessionStorage邮箱
+                        sessionStorage.setItem("send_email_" + userId, $(".email_input").val().replace(/\s*/g, ""));
+                    }
+                }
+            }, "json")
+        });
+        //校验验证码
+        $(".verity_input").bind("input propertychange", function () {
+            var verity = $(this).val()
+            var email = $(".email_input").val().replace(/\s*/g, "");
+            if (verity.length == 6) {
+                $.post("/jyapp/front/dataExport/checkMailVerify", {
+                    "emailVerity": verity,
+                    "email": email
+                }, function (data) {
+                    if (data.success) {
+                        finishEmailVerity = true;
+                        if (readClause && finishPhoneVerity) {
+                            $(".toPay").removeAttr("disabled")
+                        }
+                        $(".email_check_ok").show();
+                        $(".email_err_msg").hide();
+                        $(".verity_input").val("");
+                        $(".verity_input").attr("readonly", true);
+                        $(".email_input").parents('div.form-control').siblings().slideUp();
+                        sessionStorage.setItem("EmailVerity_" +{{.T._id}}, "T");
+                        //验证通过后 存 localStorage邮箱  此邮箱为验证通过的邮箱   并清除sessionStorage发送验证码的邮箱
+                        localStorage.setItem("new_email_" + userId, $(".email_input").val().replace(/\s*/g, ""));
+                        sessionStorage.removeItem("send_email_" + userId);
+                    } else {
+                        EasyAlert.show("验证码错误", "", 3000);
+                    }
+                })
+            } else {
+                $(".email_err_msg").hide();
+            }
+            //防遮挡
+        }).on("focus", function () {
+            var target = this;
+            setTimeout(function () {
+                target.scrollIntoViewIfNeeded();
+            }, 600)
+        })
+
+        //点击阅读条款
+        $(".fixed-bottom-box .weui-check").on("click", function () {
+            if ($(this).is(":checked")) {
+                if (finishEmailVerity && finishPhoneVerity) {
+                    sessionStorage.setItem("ischecked", "ischecked");
+                    readClause = true;
+                    sessionStorage.readClause = "true";
+                    $(".toPay").removeAttr("disabled")
+                } else {
+                    readClause = true;
+                    sessionStorage.readClause = "true";
+                    $(".toPay").attr("disabled", "disabled");
+                }
+            } else {
+                sessionStorage.removeItem("ischecked");
+                readClause = false;
+                sessionStorage.readClause = "false";
+                $(".toPay").attr("disabled", "disabled");
+            }
+        })
+
+        //数据浏览
+        $(".dataPreview").on("tap", function () {
+            if (previewDataTime < 50) {
+                previewDataTime++
+                if (regInt.test($(".sendCode").text())) {
+                    var email_input = $(".email_input").val().replace(/\s*/g, "");
 //							if (/\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(email_input)){
 //								sessionStorage.setItem("send_email_"+{{.T._id}}, $(".email_input").val().replace(/\s*/g,""));
 //							}
-						}
-						if($("#phone_input").val()){
-							sessionStorage.setItem("order_phone"+{{.T._id}}, $("#phone_input").val().replace(/\s*/g,""));
-						}
-						if ($(".fixed-bottom-box .weui-check").is(":checked")) {
-							if (finishEmailVerity && finishPhoneVerity) {
-								sessionStorage.setItem("ischecked","ischecked");
-								readClause = true;
-								sessionStorage.readClause="true";
-								$(".toPay").removeAttr("disabled")
-							}else{
-								readClause=true;
-								sessionStorage.readClause="true";
-								$(".toPay").attr("disabled","disabled");
-							}
-						} else {
-							sessionStorage.removeItem("ischecked");
-							readClause = false;
-							sessionStorage.readClause="false";
-							$(".toPay").attr("disabled", "disabled");
-						}
-						sessionStorage.email_lastVerity=email_lastVerity;
-						window.location.href="/jyapp/front/dataExport/previewData/"+{{.T._id}}+"?dataType="+dataType;
-					}else{
-						EasyAlert.show("预览数据次数超出今日上限!","",3000);
-					}
-				})
+                }
+                if ($("#phone_input").val()) {
+                    sessionStorage.setItem("order_phone" +{{.T._id}}, $("#phone_input").val().replace(/\s*/g, ""));
+                }
+                if ($(".fixed-bottom-box .weui-check").is(":checked")) {
+                    if (finishEmailVerity && finishPhoneVerity) {
+                        sessionStorage.setItem("ischecked", "ischecked");
+                        readClause = true;
+                        sessionStorage.readClause = "true";
+                        $(".toPay").removeAttr("disabled")
+                    } else {
+                        readClause = true;
+                        sessionStorage.readClause = "true";
+                        $(".toPay").attr("disabled", "disabled");
+                    }
+                } else {
+                    sessionStorage.removeItem("ischecked");
+                    readClause = false;
+                    sessionStorage.readClause = "false";
+                    $(".toPay").attr("disabled", "disabled");
+                }
+                sessionStorage.email_lastVerity = email_lastVerity;
+                window.location.href = "/jyapp/front/dataExport/previewData/"+{{.T._id}}+
+                "?dataType=" + dataType;
+            } else {
+                EasyAlert.show("预览数据次数超出今日上限!", "", 3000);
+            }
+        })
 
-				//确认支付
-				$(".toPay").on("click", function() {
-					if (!finishEmailVerity || !readClause || !canpay || !finishPhoneVerity) {
-						return
-					}
-					$(".loading_").show();
-					canpay = false;
-					var param = {};
-					param.pay_way = pay_way;
-					if (sessionStorage.pay_way){
-						param.pay_way=sessionStorage.pay_way;
-						pay_way=sessionStorage.pay_way;
-					}
-					param.data_spec = dataType == 2 ? "senior" : "standard";
-					param.id = {{.T._id}}
-					param.sourcePage = "weixin"
-					//先去创建预支付订单
-					/*-----------------*/
-					$.post("/jypay/dataExport/app/createOrder", param, function(data) {
-						if (data.success) {
-							localStorage.setItem("new_email_"+userId, $(".email_input").val().replace(/\s*/g,""));
-							try {
-				                if(pay_way=="wx_app"){
-				                	localStorage.setItem({{.T._id}},"wx");
-				                  	JyObj.wxPay(data.data);
-				                }else{
-				                	localStorage.setItem({{.T._id}},"ali");
-				                  	JyObj.aliPay(data.data);
-				                }
-				                checkPaySuccess(data.order);
-							} catch (e) {
-								alert(e);
-							}
-						}
-			            $(".loading_").hide();
-			            canpay = true;
-					})
-				})
+        //确认支付
+        $(".toPay").on("click", function () {
+            if (!finishEmailVerity || !readClause || !canpay || !finishPhoneVerity) {
+                return
+            }
+            $(".loading_").show();
+            canpay = false;
+            var param = {};
+            param.pay_way = pay_way;
+            if (sessionStorage.pay_way) {
+                param.pay_way = sessionStorage.pay_way;
+                pay_way = sessionStorage.pay_way;
+            }
+            param.data_spec = dataType == 2 ? "senior" : "standard";
+            param.id = {{.T._id}}
+                param.sourcePage = "weixin"
+            //先去创建预支付订单
+            /*-----------------*/
+            $.post("/jypay/dataExport/app/createOrder", param, function (data) {
+                if (data.success) {
+                    localStorage.setItem("new_email_" + userId, $(".email_input").val().replace(/\s*/g, ""));
+                    try {
+                        if (pay_way == "wx_app") {
+                            localStorage.setItem({{.T._id}}, "wx");
+                            JyObj.wxPay(data.data);
+                        } else {
+                            localStorage.setItem({{.T._id}}, "ali");
+                            JyObj.aliPay(data.data);
+                        }
+                        checkPaySuccess(data.order);
+                    } catch (e) {
+                        alert(e);
+                    }
+                }
+                $(".loading_").hide();
+                canpay = true;
+            })
+        })
         var interval
+
         //支付完成跳转
-        function checkPaySuccess(orderCode){
-          if(interval){
-            clearInterval(interval);
-          }
-         interval=setInterval(function() {
-            $.post("/jypay/isPaySuccess", {
-							code: orderCode
-						}, function(r) {
-								if (r.success) {
-						            //清除我已阅读缓存
-							    sessionStorage.removeItem("readClause");
-								  sessionStorage.removeItem("index");
-									sessionStorage.removeItem("pay_way");
-									sessionStorage.removeItem("EmailVerity_"+{{.T._id}});
-									sessionStorage.removeItem("ischecked");
-									clearInterval(interval);
-									setTimeout(function(){
-										window.location.replace("/jyapp/front/dataExport/paySuccessPage?code=" + r.orderCode+"&email="+r.email+"&payTime="+r.payTime+"&pay_way="+r.pay_way);
-									},500)
-								}
-							})
-         },1000)
+        function checkPaySuccess(orderCode) {
+            if (interval) {
+                clearInterval(interval);
+            }
+            interval = setInterval(function () {
+                $.post("/jypay/isPaySuccess", {
+                    code: orderCode
+                }, function (r) {
+                    if (r.success) {
+                        //清除我已阅读缓存
+                        sessionStorage.removeItem("readClause");
+                        sessionStorage.removeItem("index");
+                        sessionStorage.removeItem("pay_way");
+                        sessionStorage.removeItem("EmailVerity_" +{{.T._id}});
+                        sessionStorage.removeItem("ischecked");
+                        clearInterval(interval);
+                        setTimeout(function () {
+                            window.location.replace("/jyapp/front/dataExport/paySuccessPage?code=" + r.orderCode + "&email=" + r.email + "&payTime=" + r.payTime + "&pay_way=" + r.pay_way);
+                        }, 500)
+                    }
+                })
+            }, 1000)
         }
-			})
-			//倒计时
-			function sendemailTimer(t) {
-				$(".sendCode").text("" + t + "s");
-				$(".sendCode").attr("disabled", "disabled");
-				r = setInterval(function() {
-					t--;
-					$(".sendCode").text("" + t + "s")
-					if (t <= 0) {
-						clearInterval(r)
-						$(".sendCode").text("发送验证码");
-						if (!finishEmailVerity) {
-							$(".verity_input").attr("readonly", true);
-							$(".sendCode").removeAttr("disabled");
-							$(".email_input").removeAttr("readonly");
-							$(".sendCode").css("color", "#2CB7CA");
-						}
-					}
-				}, 1000)
-			}
-			//提示框
-			var EasyAlert = {
-				timeout: null,
-				waitTime: 1000,
-				show: function(text, css, waitTime) {
-					if (this.timeout != null) {
-						clearTimeout(this.timeout);
-						this.hide();
-						this.timeout = null;
-					}
-					var thisClass = this;
-					this.timeout = setTimeout(function() {
-						thisClass.hide();
-						thisClass.timeout = null;
-					}, waitTime ? waitTime : this.waitTime);
-					$("body").append('<div class="easyalert" id="easyAlert">' + text + '</div>');
-					$("#easyAlert").css({
-						"left": "50%",
-						"margin-top": -($("#easyAlert").outerHeight() / 2),
-						"margin-left": -($("#easyAlert").outerWidth() / 2)
-					}).show();
-				},
-				hide: function() {
-					$("#easyAlert").remove();
-				}
-			}
-			//
-            function showToast (content) {
-              EasyAlert.show(content,"",3000);
+    })
+
+    //倒计时
+    function sendemailTimer(t) {
+        $(".sendCode").text("" + t + "s");
+        $(".sendCode").attr("disabled", "disabled");
+        r = setInterval(function () {
+            t--;
+            $(".sendCode").text("" + t + "s")
+            if (t <= 0) {
+                clearInterval(r)
+                $(".sendCode").text("发送验证码");
+                if (!finishEmailVerity) {
+                    $(".verity_input").attr("readonly", true);
+                    $(".sendCode").removeAttr("disabled");
+                    $(".email_input").removeAttr("readonly");
+                    $(".sendCode").css("color", "#2CB7CA");
+                }
             }
-		</script>
+        }, 1000)
+    }
+
+    //提示框
+    var EasyAlert = {
+        timeout: null,
+        waitTime: 1000,
+        show: function (text, css, waitTime) {
+            if (this.timeout != null) {
+                clearTimeout(this.timeout);
+                this.hide();
+                this.timeout = null;
+            }
+            var thisClass = this;
+            this.timeout = setTimeout(function () {
+                thisClass.hide();
+                thisClass.timeout = null;
+            }, waitTime ? waitTime : this.waitTime);
+            $("body").append('<div class="easyalert" id="easyAlert">' + text + '</div>');
+            $("#easyAlert").css({
+                "left": "50%",
+                "margin-top": -($("#easyAlert").outerHeight() / 2),
+                "margin-left": -($("#easyAlert").outerWidth() / 2)
+            }).show();
+        },
+        hide: function () {
+            $("#easyAlert").remove();
+        }
+    }
+
+    //
+    function showToast(content) {
+        EasyAlert.show(content, "", 3000);
+    }
+</script>
 <!--百度统计end-->
 {{include "/common/baiducc.html"}}
-	</body>
+</body>
 </html>

+ 16 - 5
src/jfw/modules/subscribepay/src/service/dataExportPay_pc.go

@@ -19,9 +19,10 @@ import (
 
 type DataExportPayPC struct {
 	*xweb.Action
-	waitPayMsg            xweb.Mapper `xweb:"/dataExport/sacnPay/waitPayMsg"`     //pc端创建订单获取二维码 前后端分离
-	sacnPay_CreateOrder   xweb.Mapper `xweb:"/dataExport/sacnPay/createOrder"`    //pc端生成数据导出订单
-	getOrderPayMsg        xweb.Mapper `xweb:"/dataexport/getOrderPayMsg"`         //我的订单页面获取支付二维码
+	waitPayMsg          xweb.Mapper `xweb:"/dataExport/sacnPay/waitPayMsg"`  //pc端创建订单获取二维码 前后端分离
+	sacnPay_CreateOrder xweb.Mapper `xweb:"/dataExport/sacnPay/createOrder"` //pc端生成数据导出订单
+	getOrderPayMsg      xweb.Mapper `xweb:"/dataexport/getOrderPayMsg"`      //我的订单页面获取支付二维码
+	getPrice            xweb.Mapper `xweb:"/dataexport/getPrice"`            //我的订单页面获取支付二维码
 }
 
 var reg *regexp.Regexp //匹配特殊字符
@@ -31,6 +32,18 @@ func init() {
 	reg, _ = regexp.Compile("[^A-Za-z0-9\u4e00-\u9fa5]")
 }
 
+//获取价格
+func (p *DataExportPayPC) GetPrice() {
+	//获取数量
+	p.ServeJson(map[string]interface{}{
+		"unitPrice_normal": entity.ExConf.UnitPrice_normal,
+		"unitPrice_senior": entity.ExConf.UnitPrice_senior,
+		"discount":         entity.ExConf.Discount,
+		"orderMinPrice":    entity.ExConf.OrderMinPrice,
+		"msgMaxCount":      entity.ExConf.MsgMaxCount,
+	})
+}
+
 //pc端创建订单获取二维码 前后端分离
 func (p *DataExportPayPC) WaitPayMsg() {
 	defer qutil.Catch()
@@ -116,7 +129,6 @@ func (p *DataExportPayPC) WaitPayMsg() {
 	})
 }
 
-
 //pc端生成数据导出订单
 func (p *DataExportPayPC) SacnPay_CreateOrder() {
 	defer qutil.Catch()
@@ -456,4 +468,3 @@ func (p *DataExportPayPC) GetOrderPayMsg() {
 	})
 
 }
-

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

@@ -13,12 +13,8 @@ var ExConf *DataexportConfig
 
 //价格配置文件
 type DataexportConfig struct {
-	UnitPrice_normal float64 `json:"unitPrice_normal"`
-	UnitPrice_senior float64 `json:"unitPrice_senior"`
-	Discount         float64 `json:"discount"`
-	OrderMinPrice    float64 `json:"orderMinPrice"`
-	MsgMaxCount      int     `json:"msgMaxCount"`
-	Font             Font    `json:"font"`
+	MsgMaxCount int  `json:"msgMaxCount"`
+	Font        Font `json:"font"`
 }
 
 type Font struct {

+ 487 - 446
src/web/templates/pc/createOrderPage.html

@@ -4,18 +4,20 @@
     <meta name="viewport"
           content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
     <meta http-equiv="X-UA-Compatible" content="ie=edge">
-    <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/dataExport/css/font_624651_bjdvktmum68.css?v={{Msg "seo" "version"}}">
+    <link rel="stylesheet"
+          href="{{Msg "seo" "cdn"}}/dataExport/css/font_624651_bjdvktmum68.css?v={{Msg "seo" "version"}}">
     <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/dataExport/css/reset_pc.css?v={{Msg "seo" "version"}}">
     <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/dataExport/css/payment_order.css?v={{Msg "seo" "version"}}">
     <link rel="stylesheet" href="https://at.alicdn.com/t/font_624651_wz9gl1vebtf.css">
-	
-	{{include "/common/pnc.html"}}
-	<link href="{{Msg "seo" "cdn"}}/css/pc.css?v={{Msg "seo" "version"}}" rel="stylesheet">
-	<link href="{{Msg "seo" "cdn"}}/css/dev2/reset_pc.css?v={{Msg "seo" "version"}}" rel="stylesheet">
-	<link rel="stylesheet" type="text/css" href="{{Msg "seo" "cdn"}}/pccss/public-nav-1200.css?v={{Msg "seo" "version"}}" />
-	<link href="//cdn.bootcss.com/jquery-confirm/3.1.0/jquery-confirm.min.css" rel="stylesheet">
+
+    {{include "/common/pnc.html"}}
+    <link href="{{Msg "seo" "cdn"}}/css/pc.css?v={{Msg "seo" "version"}}" rel="stylesheet">
+    <link href="{{Msg "seo" "cdn"}}/css/dev2/reset_pc.css?v={{Msg "seo" "version"}}" rel="stylesheet">
+    <link rel="stylesheet" type="text/css"
+          href="{{Msg "seo" "cdn"}}/pccss/public-nav-1200.css?v={{Msg "seo" "version"}}"/>
+    <link href="//cdn.bootcss.com/jquery-confirm/3.1.0/jquery-confirm.min.css" rel="stylesheet">
     <script src="//cdn.bootcss.com/jquery-confirm/3.1.0/jquery-confirm.min.js"></script>
-	<script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/public-nav.js?v={{Msg "seo" "version"}}"></script>
+    <script type="text/javascript" src="{{Msg "seo" "cdn"}}/js/public-nav.js?v={{Msg "seo" "version"}}"></script>
     <title>支付订单</title>
 </head>
 <body>
@@ -31,10 +33,10 @@
         <div class="pro r a1">
             3.数据导出
         </div>
-		<div class="call">
-			<div>如有疑问,请拨</div>
-			<div class="callNum">400-108-6670</div>
-		</div>
+        <div class="call">
+            <div>如有疑问,请拨</div>
+            <div class="callNum">400-108-6670</div>
+        </div>
     </div>
     <div class="inner all" style="position: relative;">
         <div class="infotitle clearfix">
@@ -42,7 +44,8 @@
             <em style="display:none">最大限额20,000条</em>
             <a class="dataPreview"><span class="iconfont icon-yulan"></span>预览数据</a>
             <a class="fr goback" style="position: relative;text-decoration: none;">
-				<img class="goback" src="{{Msg "seo" "cdn"}}/dataExport/image/sieve.png" style="width: 16px;height: 16px;position: absolute;left: -19px;top: 2px;">返回筛选</a>
+                <img class="goback" src="{{Msg "seo" "cdn"}}/dataExport/image/sieve.png"
+                     style="width: 16px;height: 16px;position: absolute;left: -19px;top: 2px;">返回筛选</a>
         </div>
         <div class="guige">
             <div class="title">数据规格<i id="exp" class="iconfont icon-bangzhu"></i></div>
@@ -50,7 +53,7 @@
                 <div class="bz no-select">
                     <p>标准字段包</p>
                     <p>
-                        <del>{{.T.unitPrice_normal}}元/条</del>&nbsp;<span>{{.T.unitPrice_normal_final}}元/条</span></p>
+                        <del>**元/条</del>&nbsp;<span>**元/条</span></p>
                 </div>
                 <div class="gj no-select">
                     <p><i class="iconfont icon-huangguan"></i>高级字段包</p>
@@ -61,33 +64,25 @@
         </div>
         <div class="email" id="email">
             <div class="title">联系方式</div>
-			<div class="icon-input email">
-			    <input type="text" class="fl input-c email_input" placeholder="请输入邮箱地址,用于接收导出的数据">
-                <input type="text" class="fl test verity_input" style="display:none;" type="text" maxlength="6" placeholder="请输入邮箱验证码">
+            <div class="icon-input email">
+                <input type="text" class="fl input-c email_input" placeholder="请输入邮箱地址,用于接收导出的数据">
+                <input type="text" class="fl test verity_input" style="display:none;" type="text" maxlength="6"
+                       placeholder="请输入邮箱验证码">
                 <button class="fl sub sendEmail" style="display:none;">获取验证码</button>
                 <div class="fl status clearfix">
                     <i class="iconfont icon-zhengque succ email_check_ok" style="display:none"></i>
                     <p class="err email_err_msg" style="display:none"><i class="iconfont icon-cuowu"></i>您输入的验证码不正确</p>
                 </div>
-				<div style="clear:both;"></div>
-			</div>
-			<div class="icon-input phone">
-			    <input type="text" class="fl input-c phone_input" maxlength="11" placeholder="请输入手机号">
+                <div style="clear:both;"></div>
+            </div>
+            <div class="icon-input phone">
+                <input type="text" class="fl input-c phone_input" maxlength="11" placeholder="请输入手机号">
                 <div class="fl status clearfix">
                     <i class="iconfont icon-zhengque succ phone_check_ok" style="margin-left:15px; display:none"></i>
                     <p class="err phone_err_msg" style="display:none"><i class="iconfont icon-cuowu"></i>您输入的手机号不正确</p>
                 </div>
-				<div style="clear:both;"></div>
-			</div>
-<!--            <div class="input clearfix" style="display:block;">
-                <input class="fl em email_input" type="text" placeholder="请输入邮箱地址,用于接收导出的数据">
-                <input class="fl test verity_input" type="text" maxlength="6" placeholder="请输入邮箱验证码">
-                <button class="fl sub sendEmail">获取验证码</button>
-                <div class="fl status clearfix">
-                    <i class="fl iconfont icon-zhengque succ email_check_ok" style="display:none"></i>
-                    <p class="err fl email_err_msg" style="display:none"><i class="iconfont icon-cuowu"></i>您输入的验证码不正确</p>
-                </div>
-            </div>-->
+                <div style="clear:both;"></div>
+            </div>
         </div>
         <!--字段包说明-->
         <span class="remind" style="display:none;">
@@ -112,11 +107,11 @@
             </div>
         </div>
         <div class="money ">
-			<div>
-<!--				<p>如需发票,请拨打客服电话 400-108-6670</p>-->
-				<!--<p>如发票金额低于200元(不含),则快递费用到付。</p>-->
-			</div>
-			<div class="clearfix">
+            <div>
+                <!--				<p>如需发票,请拨打客服电话 400-108-6670</p>-->
+                <!--<p>如发票金额低于200元(不含),则快递费用到付。</p>-->
+            </div>
+            <div class="clearfix">
                 <p class="fr">应付总额:现价 <span class="pay_discount"></span></p>
             </div>
             <div class="clearfix">
@@ -127,9 +122,10 @@
         </div>
         <div class="info clearfix">
             <div class="fl left">
-				<p>购买须知:</p>
-				<p>最低起售{{.T.orderMinPrice}}元,标准字段包:原价{{.T.unitPrice_normal}}元/条,{{.T.discount10}}折价{{.T.unitPrice_normal_final}}元/条计费,</p>
-				<p>高级字段包:原价{{.T.unitPrice_senior}}元/条,{{.T.discount10}}折价{{.T.unitPrice_senior_final}}元/条计费</p>       
+                <p>购买须知:</p>
+                <p>最低起售<span></span>元,标准字段包:原价<span></span>元/条,<span></span>
+                    折价<span></span>元/条计费,</p>
+                <p>高级字段包:原价<span></span>元/条,<span></span>折价<span></span>元/条计费</p>
             </div>
             <div class="fr right">
                 <p class="clearfix t fr">
@@ -144,418 +140,463 @@
             </div>
         </div>
     </div>
-	<div class="dialog-box type-a"></div>
+    <div class="dialog-box type-a"></div>
 </section>
 
 <script>
-	var msgCount={{.T.msgCount}}
-	var msgMaxCount={{.T.msgMaxCount}}
-	var discount={{.T.discount}}
-	var unitPrice_normal={{.T.unitPrice_normal}}
-	var unitPrice_senior={{.T.unitPrice_senior}}
-	var orderMinPrice={{.T.orderMinPrice}}
-	var finishEmailVerity=false;
-	var readClause=false;
-	var dataType=1;
-  	var pay_way="wx_pc";
-	var finishPhoneVerity=false;
-	
-	var email_lastInput={{.T.email}}
-	var email_lastVerity={{.T.timeSpaceing}}
-	var previewDataTime={{.T.PreviewData}}
-	var phone_lastInput={{.T.phone}}
-	$(function () {
-		haslogin({{.T.logid}});
-		//样式
-		selcetIndexNav(4);
-		$(".public-nav").css("background","#fff")
-		$(".logo img").attr("src","/images/swordfish/sf_01_new.png");
-		//数据展示
-		var showCount=FormatNum(msgCount);
-		$(".msgCount").text(showCount);
-		if (sessionStorage.getItem("order_spec"+{{.T._id}})!=null){
-			dataType = sessionStorage.getItem("order_spec"+{{.T._id}});
-		}
-		if(dataType==1){
-			$(".switch-dataType .bz").addClass("active")
-			$(".switch-dataType .gj").removeClass("active")
-		}else{
-			$(".switch-dataType .bz").removeClass("active")
-			$(".switch-dataType .gj").addClass("active")
-		}
-		ChangePayMoney();
+    var msgCount ={{.T.msgCount}}
+    var previewDataTime ={{.T.PreviewData}}
+
+    var msgMaxCount, discount, unitPrice_normal, unitPrice_senior, orderMinPrice;
+
+    var finishEmailVerity = false;
+    var readClause = false;
+    var dataType = 1;
+    var pay_way = "wx_pc";
+    var finishPhoneVerity = false;
+
+    var email_lastInput ={{.T.email}}
+    var email_lastVerity ={{.T.timeSpaceing}}
+
+    var phone_lastInput ={{.T.phone}}
+        $(function () {
+            haslogin({{.T.logid}});
+            //加载价格
+            $.ajax({
+                url: "/jypay/dataexport/getPrice",
+                type: "POST",
+                async: false,
+                dataType: "json",
+                success: function (r) {
+                    if (r) {
+                        discount = r.discount;
+                        msgMaxCount = r.unitPrice_normal;
+                        orderMinPrice = r.orderMinPrice;
+                        unitPrice_normal = r.unitPrice_normal;
+                        unitPrice_senior = r.unitPrice_senior;
+                    }
+                }
+            });
+            //样式
+            selcetIndexNav(4);
+            $(".public-nav").css("background", "#fff")
+            $(".logo img").attr("src", "/images/swordfish/sf_01_new.png");
+
+            //数据展示
+            var showCount = FormatNum(msgCount);
+            $(".msgCount").text(showCount);
+            //数据规格
+            $(".guige .bz del").text(unitPrice_normal + "元/条");
+            $(".guige .bz span").text(unitPrice_normal * discount + "元/条");
+            $(".guige .gj del").text(unitPrice_senior + "元/条");
+            $(".guige .gj span").text(unitPrice_senior * discount + "元/条");
+            //购买须知
+            $(".fl.left p:eq(1) span:eq(0)").text(orderMinPrice);
+            $(".fl.left p:eq(1) span:eq(1)").text(unitPrice_normal);
+            $(".fl.left p:eq(1) span:eq(2)").text(discount*10);
+            $(".fl.left p:eq(1) span:eq(3)").text(discount*unitPrice_normal);
+
+            $(".fl.left p:eq(2) span:eq(0)").text(unitPrice_senior);
+            $(".fl.left p:eq(2) span:eq(1)").text(discount*10);
+            $(".fl.left p:eq(2) span:eq(2)").text(discount*unitPrice_senior);
+
+            if (sessionStorage.getItem("order_spec" +{{.T._id}}) != null) {
+                dataType = sessionStorage.getItem("order_spec" +{{.T._id}});
+            }
+            if (dataType == 1) {
+                $(".switch-dataType .bz").addClass("active")
+                $(".switch-dataType .gj").removeClass("active")
+            } else {
+                $(".switch-dataType .bz").removeClass("active")
+                $(".switch-dataType .gj").addClass("active")
+            }
+            ChangePayMoney();
+
+            if (sessionStorage.getItem("order_email" +{{.T._id}}) != null) {
+                $(".email_check_ok").show();
+                $(".email_input").val(sessionStorage.getItem("order_email" +{{.T._id}}));
+                finishEmailVerity = true;
+            } else if (email_lastInput != "") {
+                $(".email_check_ok").show();
+                $(".email_input").val(email_lastInput);
+                finishEmailVerity = true;
+            }
+            if (email_lastVerity > 0) {
+                sendemailTimer(email_lastVerity);
+            }
+            if (sessionStorage.getItem("order_phone" +{{.T._id}}) != null) {
+                $(".phone_check_ok").show();
+                $(".phone_input").val(sessionStorage.getItem("order_phone" +{{.T._id}}));
+                finishPhoneVerity = true;
+            } else if (phone_lastInput != "") {
+                $(".phone_check_ok").show();
+                $(".phone_input").val(phone_lastInput);
+                finishPhoneVerity = true;
+            }
+            //邮箱输入监控
+            $(".email_input").on("input propertychange", function () {
+                var email_input = $(this).val().replace(/\s*/g, "");
+                if (email_input.indexOf("@") > 0) {
+                    if (email_input != email_lastInput) {
+                        $(".sendEmail").show();
+                        if (email_lastVerity > 0) {
+                            $(".sendEmail").addClass("verity_send");
+                            $(".verity_input").show();
+                        }
+                        finishEmailVerity = false;
+                        $(".toPay").css("background-color", "#ddd")
+                        $(".toPay").attr("disabled", "disabled");
+                        $(".email_check_ok").hide();
+                    } else {
+                        finishEmailVerity = true;
+                        if (readClause && finishPhoneVerity) {
+                            $(".toPay").css("background-color", "#2CB7CA");
+                            $(".toPay").removeAttr("disabled")
+                        }
+                        $(".sendEmail").hide();
+                        $(".verity_input").hide();
+                        $(".email_err_msg").hide();
+                        $(".email_check_ok").show();
+                    }
+                } else {
+                    $(".sendEmail").hide();
+                    $(".verity_input").hide();
+                    $(".email_err_msg").hide();
+                    $(".email_check_ok").hide();
+                }
+            }).blur(function () {
+                console.log("xxx")
+                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("邮箱格式不正确");
+                    finishEmailVerity = false;
+                    $(".toPay").css("background-color", "#ddd")
+                    $(".toPay").attr("disabled", "disabled");
+                    return
+                }
+                $(".email_check_ok").show();
+                showEmailErr("");
+            });
+            //手机号输入监控
+            var Verification = {
+                //手机号验证
+                isPhone: function (value) {
+                    return /^[1][3-9][0-9]{9}$/.test(value);
+                }
+            };
+            $(".phone_input").on("input propertychange", function () {
+                var phone_input = $(this).val().replace(/\s*/g, "");
+                if (phone_input.length == 11) {
+                    if (Verification.isPhone(phone_input)) {
+                        $.post("/front/dataExport/checkPhoneVerify", {"phone": phone_input}, function (data) {
+                            if (data.success) {
+                                $(".phone_check_ok").show();
+                                $(".phone_err_msg").hide();
+                                finishPhoneVerity = true;
+                                if (readClause && finishEmailVerity) {
+                                    $(".toPay").css("background-color", "#2CB7CA");
+                                    $(".toPay").removeAttr("disabled")
+                                }
+                            } else {
+                                $(".phone_err_msg").show();
+                                $(".phone_check_ok").hide();
+                                finishPhoneVerity = false;
+                                $(".toPay").css("background-color", "#ddd")
+                                $(".toPay").attr("disabled", "disabled");
+                            }
+                        })
+                    } else {
+                        $(".phone_err_msg").show();
+                        $(".phone_check_ok").hide();
+                        finishPhoneVerity = false;
+                        $(".toPay").css("background-color", "#ddd")
+                        $(".toPay").attr("disabled", "disabled");
+                    }
+                } else {
+                    $(".phone_err_msg").hide();
+                    $(".phone_check_ok").hide();
+                    finishPhoneVerity = false;
+                    $(".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 () {
+                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
+                }
+                showEmailErr("");
+                if (!canVerify) {
+                    return
+                }
+                canVerify = false;
+                $.post("/front/dataExport/sendMailVerify", {"email": email}, function (data) {
+                    canVerify = true;
+                    if (data.success) {
+                        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) {
+                            sendemailTimer(data.time);
+                            $(".sendEmail").attr("disabled", "disabled");
+                            $(".email_input").attr("disabled", "disabled");
+                        }
+                    }
+                }, "json")
+            });
+            //校验验证码
+            $(".verity_input").bind("input propertychange", function () {
+                var verity = $(this).val()
+                var email = $(".email_input").val().replace(/\s*/g, "");
+                if (verity.length == 6) {
+                    $.post("/front/dataExport/checkMailVerify", {
+                        "emailVerity": verity,
+                        "email": email
+                    }, function (data) {
+                        if (data.success) {
+                            showEmailErr("");
+                            finishEmailVerity = true;
+                            if (readClause && finishPhoneVerity) {
+                                $(".toPay").css("background-color", "#2CB7CA");
+                                $(".toPay").removeAttr("disabled")
+                            }
+                            $(".verity_input").css({"margin-left": "15px"});
+                            $(".sendEmail").hide();
+                            $(".email_check_ok").css("display", "");
+                            $(".verity_input").attr("disabled", "disabled");
+                        } else {
+                            $(".verity_input").css({"margin-left": ""});
+                            showEmailErr("验证码错误");
+                        }
+                    })
+                } else {
+                    $(".email_err_msg").hide();
+                }
+            })
+
+            //是否显示最大条数
+            if (msgCount == msgMaxCount) {
+                $(".infotitle em").text("最大限额" + showCount + "条");
+                $(".infotitle em").css("display", "");
+            }
 
-		if (sessionStorage.getItem("order_email"+{{.T._id}})!=null){
-			$(".email_check_ok").show();
-			$(".email_input").val(sessionStorage.getItem("order_email"+{{.T._id}}));
-			finishEmailVerity=true;
-		}else if(email_lastInput!=""){
-      $(".email_check_ok").show();
-		  $(".email_input").val(email_lastInput);
-		  finishEmailVerity=true;	
-		}
-		if(email_lastVerity>0){
-			sendemailTimer(email_lastVerity);
-		}
-		if (sessionStorage.getItem("order_phone"+{{.T._id}})!=null){
-			$(".phone_check_ok").show();
-			$(".phone_input").val(sessionStorage.getItem("order_phone"+{{.T._id}}));
-			finishPhoneVerity=true;
-		}else if(phone_lastInput!=""){
-			$(".phone_check_ok").show();
-			$(".phone_input").val(phone_lastInput);
-			finishPhoneVerity=true;
-		}
-		//邮箱输入监控
-		$(".email_input").on("input propertychange",function() {
-			var email_input = $(this).val().replace(/\s*/g,"");
-			if(email_input.indexOf("@")>0){
-				if(email_input!=email_lastInput){
-					$(".sendEmail").show();
-					if(email_lastVerity>0){
-						$(".sendEmail").addClass("verity_send");
-						$(".verity_input").show();
-					}
-					finishEmailVerity=false;
-					$(".toPay").css("background-color","#ddd")
-					$(".toPay").attr("disabled","disabled");
-					$(".email_check_ok").hide();
-				}else{
-					finishEmailVerity=true;
-					if(readClause&&finishPhoneVerity){
-						$(".toPay").css("background-color","#2CB7CA");
-						$(".toPay").removeAttr("disabled")
-					}
-					$(".sendEmail").hide();
-					$(".verity_input").hide();
-					$(".email_err_msg").hide();
-					$(".email_check_ok").show();
-				}
-			}else{
-				$(".sendEmail").hide();
-				$(".verity_input").hide();
-				$(".email_err_msg").hide();
-				$(".email_check_ok").hide();
-			}
-		}).blur(function(){
-      console.log("xxx")
-			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("邮箱格式不正确");
-        finishEmailVerity=false;
-        $(".toPay").css("background-color","#ddd")
-				$(".toPay").attr("disabled","disabled");
-				return
-			}
-			$(".email_check_ok").show();
-			showEmailErr("");
-		});
-		//手机号输入监控
-		var Verification = {
-	    	//手机号验证
-	    	isPhone: function(value) {
-		        return /^[1][3-9][0-9]{9}$/.test(value);
-		    }
-		};
-		$(".phone_input").on("input propertychange",function() {
-			var phone_input = $(this).val().replace(/\s*/g,"");
-			if (phone_input.length == 11) {
-				if(Verification.isPhone(phone_input)){
-					$.post("/front/dataExport/checkPhoneVerify",{"phone":phone_input},function(data){
-						if(data.success){
-							$(".phone_check_ok").show();
-							$(".phone_err_msg").hide();
-							finishPhoneVerity=true;
-							if(readClause&&finishEmailVerity){
-								$(".toPay").css("background-color","#2CB7CA");
-								$(".toPay").removeAttr("disabled")
-							}
-						}else{
-							$(".phone_err_msg").show();
-							$(".phone_check_ok").hide();
-							finishPhoneVerity=false;
-							$(".toPay").css("background-color","#ddd")
-							$(".toPay").attr("disabled","disabled");
-						}
-					})
-				}else{
-					$(".phone_err_msg").show();
-					$(".phone_check_ok").hide();
-					finishPhoneVerity=false;
-					$(".toPay").css("background-color","#ddd")
-					$(".toPay").attr("disabled","disabled");
-				}
-			}else{
-				$(".phone_err_msg").hide();
-				$(".phone_check_ok").hide();
-				finishPhoneVerity=false;
-				$(".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(){
-			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
-			}
-			showEmailErr("");
-			if(!canVerify){
-				return
-			}
-			canVerify=false;
-			$.post("/front/dataExport/sendMailVerify",{"email":email},function(data){
-				canVerify=true;
-				if(data.success){
-					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){
-						sendemailTimer(data.time);
-						$(".sendEmail").attr("disabled","disabled");
-						$(".email_input").attr("disabled","disabled");
-					}
-				}
-			},"json")
-		});
-		//校验验证码
-		$(".verity_input").bind("input propertychange",function(){
-			var verity=$(this).val()
-			var email=$(".email_input").val().replace(/\s*/g,"");
-			if(verity.length==6){
-				$.post("/front/dataExport/checkMailVerify",{"emailVerity":verity,"email":email},function(data){
-					if(data.success){
-						showEmailErr("");
-						finishEmailVerity=true;
-						if(readClause&&finishPhoneVerity){
-							$(".toPay").css("background-color","#2CB7CA");
-							$(".toPay").removeAttr("disabled")
-						}
-						$(".verity_input").css({"margin-left": "15px"});
-						$(".sendEmail").hide();
-						$(".email_check_ok").css("display","");
-						$(".verity_input").attr("disabled","disabled");
-					}else{
-						$(".verity_input").css({"margin-left": ""});
-						showEmailErr("验证码错误");
-					}
-				})
-			}else{
-				$(".email_err_msg").hide();
-			}
-		})
-		
-		//是否显示最大条数
-		if(msgCount==msgMaxCount){
-			$(".infotitle em").text("最大限额"+showCount+"条");
-			$(".infotitle em").css("display","");
-		} 
-		
-    //支付方式
-    if(sessionStorage.getItem("order_payway"+{{.T._id}})!=null){
-      pay_way=sessionStorage.getItem("order_payway"+{{.T._id}})  
+            //支付方式
+            if (sessionStorage.getItem("order_payway" +{{.T._id}}) != null) {
+                pay_way = sessionStorage.getItem("order_payway" +{{.T._id}})
+            }
+            if (pay_way == "wx_pc") {
+                $(".payway .wx").addClass("active");
+            } else if (pay_way == "ali_pc") {
+                $(".payway .alipay").addClass("active");
+            }
+            //支付方式切换
+            $(".payway>div").on("click", function () {
+                $(this).addClass("active").siblings().removeClass("active");
+                if ($(this).hasClass("wx")) {
+                    pay_way = "wx_pc"
+                } else if ($(this).hasClass("alipay")) {
+                    pay_way = "ali_pc"
+                }
+            })
+
+            //点击阅读条款
+            $('#checkBoxjy').on('click', function () {
+                $(this).toggleClass('hideBf');
+                if ($(this).attr("class").indexOf("hideBf") > -1) {
+                    readClause = true;
+                    if (finishEmailVerity && finishPhoneVerity) {
+                        $(".toPay").css("background-color", "#2CB7CA")
+                        $(".toPay").removeAttr("disabled")
+                    }
+                } else {
+                    readClause = false;
+                    $(".toPay").css("background-color", "#ddd")
+                    $(".toPay").attr("disabled", "disabled");
+                }
+            })
+
+            //类型切换
+            $(".switch-dataType div").on("click", function () {
+                $($(this).addClass("active").siblings()).removeClass("active")
+                if ($(this).attr("class").indexOf("bz") > -1) {
+                    dataType = 1;
+                } else if ($(this).attr("class").indexOf("gj") > -1) {
+                    dataType = 2;
+                }
+                ChangePayMoney();
+            })
+            //确认支付
+            var canpay = true;
+            $(".toPay").on("click", function () {
+                if (!finishEmailVerity || !readClause || !canpay || !finishPhoneVerity) {
+                    return
+                }
+                canpay = false;
+                var param = {};
+                param.pay_way = pay_way;
+                param.data_spec = dataType == 2 ? "senior" : "standard";
+                param.id ={{.T._id}}
+
+                    $.post("/jypay/dataExport/sacnPay/createOrder", param, function (data) {
+                        if (data.status == "y") {
+                            sessionStorage.setItem("order_spec" +{{.T._id}}, dataType);
+                            sessionStorage.setItem("order_email" +{{.T._id}}, $(".email_input").val().replace(/\s*/g, ""));
+                            sessionStorage.setItem("order_phone" +{{.T._id}}, $(".phone_input").val().replace(/\s*/g, ""));
+                            sessionStorage.setItem("order_payway" +{{.T._id}}, pay_way);
+                            window.location.href = "/dataExport/sacnPay/waitPay?code=" + data.code + "&token=" + data.token;
+                        } else {
+                            canpay = true;
+                            $.confirm({
+                                title: '提示',
+                                content: '生成订单出错,请稍后尝试!',
+                                buttons: {
+                                    ok: {
+                                        text: '确认',
+                                        btnClass: 'btn-primary-0',
+                                    }
+                                }
+                            });
+                        }
+                    }, "json");
+
+            })
+            //数据浏览
+            $(".dataPreview").on("click", function () {
+                if (previewDataTime < 50) {
+                    previewDataTime++
+                    window.open("/front/dataExport/previewData/"+{{.T._id}}+"?dataType=" + dataType
+                )
+                } else {
+                    $.confirm({
+                        title: '提示',
+                        content: '预览数据次数超出今日上限!',
+                        buttons: {
+                            ok: {
+                                text: '确认',
+                                btnClass: 'btn-primary-0',
+                            }
+                        }
+                    });
+                }
+            })
+
+            $(".goback").on("click", function () {
+                window.history.back();
+            });
+
+        })
+
+    function FormatNum(n) {
+        if (n >= 1000) {
+            return Math.floor(n / 1000) + "," + ("0000" + n % 1000).slice(-3)
+        }
+        return n
+    }
+
+    function ChangePayMoney() {
+        var shouldPay = 0;
+        var beforePay = 0;
+        if (dataType == 1) {
+            beforePay = accMul(unitPrice_normal, msgCount)
+            shouldPay = accMul(beforePay, discount)
+        } else if (dataType == 2) {
+            beforePay = accMul(unitPrice_senior, msgCount)
+            shouldPay = accMul(beforePay, discount)
+        }
+        shouldPay = shouldPay > orderMinPrice ? shouldPay : orderMinPrice;
+        beforePay = beforePay > orderMinPrice ? beforePay : orderMinPrice;
+        $(".pay_discount").text("¥" + shouldPay);
+        $(".pay_before").text("¥" + beforePay)
+    }
+
+    function showEmailErr(str) {
+        if (!finishEmailVerity) {
+            $(".email_check_ok").css("display", "none");
+        }
+
+        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")
+        }
     }
-    if(pay_way=="wx_pc"){
-      $(".payway .wx").addClass("active");
-    }else if(pay_way=="ali_pc"){
-      $(".payway .alipay").addClass("active");
+
+    function sendemailTimer(t) {
+        $(".sendEmail").css("background", "#ddd");
+        $(".sendEmail").text("再次尝试(" + t + "s)");
+        $(".sendEmail").attr("disabled", "disabled");
+        r = setInterval(function () {
+            t--;
+            $(".sendEmail").text("再次尝试(" + t + "s)")
+            if (t <= 0) {
+                clearInterval(r)
+                $(".sendEmail").removeClass("verity_send");
+                $(".sendEmail").text("获取验证码");
+                if (!finishEmailVerity) {
+                    $(".verity_input").hide();
+                    $(".sendEmail").removeAttr("disabled");
+                    $(".email_input").removeAttr("disabled");
+                    $(".sendEmail").css("background", "#2CB7CA");
+                    $(".sendEmail").css("cursor", "pointer");
+                }
+                showEmailErr("");
+            }
+        }, 1000)
+    }
+
+    function accMul(arg1, arg2) {
+        var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
+        try {
+            m += s1.split(".")[1].length
+        } catch (e) {
+        }
+        try {
+            m += s2.split(".")[1].length
+        } catch (e) {
+        }
+        return parseInt(Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m).toString() * 100) / Math.pow(10, 2);
     }
-    //支付方式切换
-    $(".payway>div").on("click",function(){
-      $(this).addClass("active").siblings().removeClass("active");
-      if($(this).hasClass("wx")){
-        pay_way="wx_pc"
-      }else if($(this).hasClass("alipay")){
-        pay_way="ali_pc"
-      }
-    })
-    
-		//点击阅读条款
-		$('#checkBoxjy').on('click', function () {
-			$(this).toggleClass('hideBf');
-			if($(this).attr("class").indexOf("hideBf")>-1){
-				readClause=true;
-				if(finishEmailVerity&&finishPhoneVerity){
-					$(".toPay").css("background-color","#2CB7CA")	
-					$(".toPay").removeAttr("disabled")
-				} 
-			}else{
-				readClause=false;
-				$(".toPay").css("background-color","#ddd")
-				$(".toPay").attr("disabled","disabled");
-			}
-		})
-		
-		//类型切换
-		$(".switch-dataType div").on("click",function(){
-			$($(this).addClass("active").siblings()).removeClass("active")
-			if($(this).attr("class").indexOf("bz")>-1){
-				dataType=1;
-			}else if($(this).attr("class").indexOf("gj")>-1){
-				dataType=2;
-			}
-			ChangePayMoney();
-		})
-		//确认支付
-		var canpay=true;
-		$(".toPay").on("click",function(){
-			if(!finishEmailVerity||!readClause||!canpay||!finishPhoneVerity){
-				return	
-			}
-			canpay=false;
-			var param={};
-      		param.pay_way=pay_way;
-			param.data_spec=dataType==2?"senior":"standard";
-			param.id={{.T._id}}
-			
-			$.post("/jypay/dataExport/sacnPay/createOrder",param,function(data){
-				if(data.status=="y"){
-					sessionStorage.setItem("order_spec"+{{.T._id}}, dataType);
-					sessionStorage.setItem("order_email"+{{.T._id}}, $(".email_input").val().replace(/\s*/g,""));
-					sessionStorage.setItem("order_phone"+{{.T._id}}, $(".phone_input").val().replace(/\s*/g,""));
-          sessionStorage.setItem("order_payway"+{{.T._id}},pay_way);
-					window.location.href="/dataExport/sacnPay/waitPay?code="+data.code+"&token="+data.token;
-				}else{
-					canpay=true;
-					$.confirm({
-			            title: '提示',
-			            content: '生成订单出错,请稍后尝试!',
-			            buttons: {
-			                ok: {
-			                    text: '确认',
-			                    btnClass: 'btn-primary-0',
-			                }
-			            }
-			        });
-				}
-			},"json");
-			
-		})
-		//数据浏览
-		$(".dataPreview").on("click",function(){
-			if(previewDataTime<50){
-				previewDataTime++
-				window.open("/front/dataExport/previewData/"+{{.T._id}}+"?dataType="+dataType);
-			}else{
-				 $.confirm({
-		            title: '提示',
-		            content: '预览数据次数超出今日上限!',
-		            buttons: {
-		                ok: {
-		                    text: '确认',
-		                    btnClass: 'btn-primary-0',
-		                }
-		            }
-		        });
-			}
-		})
-		
-		$(".goback").on("click",function(){
-			window.history.back();
-		});
-		
-	})
-	
-	function FormatNum(n){
-		if(n>=1000){
-			return Math.floor(n/1000)+","+("0000"+n%1000).slice(-3)
-		}
-		return n
-	}
-	
-	function ChangePayMoney(){
-		var shouldPay=0;var beforePay=0;
-		if(dataType==1){
-			beforePay=accMul(unitPrice_normal,msgCount)
-			shouldPay=accMul(beforePay,discount)
-		}else if(dataType==2){
-			beforePay=accMul(unitPrice_senior,msgCount)
-			shouldPay=accMul(beforePay,discount)
-		}
-		shouldPay=shouldPay>orderMinPrice?shouldPay:orderMinPrice;
-		beforePay=beforePay>orderMinPrice?beforePay:orderMinPrice;
-		$(".pay_discount").text("¥"+shouldPay);
-		$(".pay_before").text("¥"+beforePay)
-	}
-	function showEmailErr(str){
-		if(!finishEmailVerity){
-			$(".email_check_ok").css("display","none");
-		}
-		
-		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")
-		}
-	}
-	function sendemailTimer(t){
-		$(".sendEmail").css("background","#ddd");
-		$(".sendEmail").text("再次尝试("+t+"s)");
-		$(".sendEmail").attr("disabled","disabled");
-		r=setInterval(function(){
-			t--;
-			$(".sendEmail").text("再次尝试("+t+"s)")
-			if(t<=0){
-				clearInterval(r)
-				$(".sendEmail").removeClass("verity_send");
-				$(".sendEmail").text("获取验证码");
-				if(!finishEmailVerity){
-					$(".verity_input").hide();
-					$(".sendEmail").removeAttr("disabled");
-					$(".email_input").removeAttr("disabled");
-					$(".sendEmail").css("background","#2CB7CA");
-					$(".sendEmail").css("cursor","pointer");
-				}
-				showEmailErr("");
-			}
-		},1000)
-	}
-	function accMul(arg1,arg2){  
-		 var m=0,s1=arg1.toString(),s2=arg2.toString();  
-		 try{m+=s1.split(".")[1].length}catch(e){}  
-		 try{m+=s2.split(".")[1].length}catch(e){} 
-		 return parseInt(Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m).toString()*100)/Math.pow(10,2);
-	}  
-   
-	$("body").on("click",function(e){
-		if(e.target.id=="exp"){
-			$(".remind").fadeIn();
-		}else{
-			$(".remind").fadeOut();
-		}
-	});
+
+    $("body").on("click", function (e) {
+        if (e.target.id == "exp") {
+            $(".remind").fadeIn();
+        } else {
+            $(".remind").fadeOut();
+        }
+    });
 </script>
 {{include "/common/pcbottom.html"}}
 <!--百度统计end-->

+ 853 - 823
src/web/templates/weixin/dataExport/dataExport_payOrder.html

@@ -1,852 +1,882 @@
 <html>
-    <head>
-        <meta charset="utf-8">
-        <title>数据导出</title>
-		<meta name="format-detection" content="telephone=no" />
-		<meta name="viewport" content="width=device-width, initial-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">
-        <script src="{{Msg "seo" "cdn"}}/js/rem.js"></script>
-        <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/css/weui.min.css?v={{Msg "seo" "version"}}">
-        <link rel="stylesheet" type="text/css" href="{{Msg "seo" "cdn"}}/wx_dataExport/css/base.css?v={{Msg "seo" "version"}}" />
-        <link rel="stylesheet" type="text/css" href="{{Msg "seo" "cdn"}}/wx_dataExport/iconfont/iconfont.css?v={{Msg "seo" "version"}}" />
-        <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/css/pay_order.css?v={{Msg "seo" "version"}}35">
-        <script src="{{Msg "seo" "cdn"}}/js/jquery-3.2.1.min.js"></script>
-        <script src="{{Msg "seo" "cdn"}}/wx_dataExport/js/weui.min.js"></script>
-		{{include "/common/weixin.html"}}
-		<script>
-			var signature = {{.T.signature}};
-			var isConfigSuccess = true;
-			var id = {{.T._id}}
-			if(signature && signature.length == 4){
-				wx.config({
-				    debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-				    appId: signature[0], // 必填,公众号的唯一标识
-				    timestamp:signature[1], // 必填,生成签名的时间戳
-				    nonceStr: signature[2], // 必填,生成签名的随机串
-				    signature: signature[3],// 必填,签名,见附录1
-				    jsApiList: ['chooseWXPay','hideAllNonBaseMenuItem'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
-				});
-				wx.ready(function () {
-					if(!isConfigSuccess){
-						return;
-					}
-					wx.hideAllNonBaseMenuItem();
-			    });
-				wx.error(function(res){
-				    //config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
-					//alert(res);
-					isConfigSuccess = false;
-				});
-			}
-		</script>
-    </head>
-    <body>
-    	<style>
-			#code{
-				margin-left: -0.2rem;
-			}
-			body{
-				height: auto;
-				overflow: auto;	
-			}
-    	</style>
-		<div class="loading_" style="display:none;">
-		    <p><span></span></p>
-		</div>
-        <div id="pay_order">
-            <main class="main">
-                <div class="progress">
-                    <div class="p-item">
-                        <p class="p-item-icon">
-                            <i class="icon iconfont">&#xe606;</i>
-                        </p>
-                        <span class="active">条件筛选</span>
-                        <div class="line" style="background: #2CB7CA"></div>
-                    </div>
+<head>
+    <meta charset="utf-8">
+    <title>数据导出</title>
+    <meta name="format-detection" content="telephone=no"/>
+    <meta name="viewport" content="width=device-width, initial-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">
+    <script src="{{Msg "seo" "cdn"}}/js/rem.js"></script>
+    <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/css/weui.min.css?v={{Msg "seo" "version"}}">
+    <link rel="stylesheet" type="text/css"
+          href="{{Msg "seo" "cdn"}}/wx_dataExport/css/base.css?v={{Msg "seo" "version"}}"/>
+    <link rel="stylesheet" type="text/css"
+          href="{{Msg "seo" "cdn"}}/wx_dataExport/iconfont/iconfont.css?v={{Msg "seo" "version"}}"/>
+    <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/css/pay_order.css?v={{Msg "seo" "version"}}35">
+    <script src="{{Msg "seo" "cdn"}}/js/jquery-3.2.1.min.js"></script>
+    <script src="{{Msg "seo" "cdn"}}/wx_dataExport/js/weui.min.js"></script>
+    {{include "/common/weixin.html"}}
+    <script>
+        var signature = {{.T.signature}};
+        var isConfigSuccess = true;
+        var id = {{.T._id}}
+        if (signature && signature.length == 4) {
+            wx.config({
+                debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+                appId: signature[0], // 必填,公众号的唯一标识
+                timestamp: signature[1], // 必填,生成签名的时间戳
+                nonceStr: signature[2], // 必填,生成签名的随机串
+                signature: signature[3],// 必填,签名,见附录1
+                jsApiList: ['chooseWXPay', 'hideAllNonBaseMenuItem'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
+            });
+            wx.ready(function () {
+                if (!isConfigSuccess) {
+                    return;
+                }
+                wx.hideAllNonBaseMenuItem();
+            });
+            wx.error(function (res) {
+                //config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
+                //alert(res);
+                isConfigSuccess = false;
+            });
+        }
+    </script>
+</head>
+<body>
+<style>
+    #code {
+        margin-left: -0.2rem;
+    }
+
+    body {
+        height: auto;
+        overflow: auto;
+    }
+</style>
+<div class="loading_" style="display:none;">
+    <p><span></span></p>
+</div>
+<div id="pay_order">
+    <main class="main">
+        <div class="progress">
+            <div class="p-item">
+                <p class="p-item-icon">
+                    <i class="icon iconfont">&#xe606;</i>
+                </p>
+                <span class="active">条件筛选</span>
+                <div class="line" style="background: #2CB7CA"></div>
+            </div>
+
+            <div class="p-item">
+                <p class="p-item-icon">
+                    <i class="icon iconfont">&#xe617;</i>
+                </p>
+                <span class="active">支付订单</span>
+                <div class="line"></div>
+            </div>
 
-                    <div class="p-item">
-                        <p class="p-item-icon">
-                            <i class="icon iconfont">&#xe617;</i>
+            <div class="p-item">
+                <p class="p-item-icon icon-gray">
+                    <i class="icon iconfont">&#xe616;</i>
+                </p>
+                <span>数据导出</span>
+            </div>
+        </div>
+        <div class="form">
+            <div class="form-item">
+                <div class="label-title">
+                    <span class="left">已为您筛选 <strong id="msgCount">{{.T.msgCount}}</strong> 条数据</span>
+                    <a href="javascript:history.go(-1)" class="right">返回筛选</a>
+                </div>
+                <!-- 选择字段包 -->
+                <div class="choose">
+                    <div class="choose-item active">
+                        <h2>标准字段包</h2>
+                        <p>
+                            <span class="initial">{{.T.unitPrice_normal}}元/条</span>
+                            <span class="current">{{.T.unitPrice_normal_final}}元/条</span>
                         </p>
-                        <span class="active">支付订单</span>
-                        <div class="line"></div>
+                        <!-- <i class="icon iconfont mark">&#xe611;</i> -->
+                        <img class="mark" src="/wx_dataExport/images/mark.png">
                     </div>
-
-                    <div class="p-item">
-                        <p class="p-item-icon icon-gray">
-                            <i class="icon iconfont">&#xe616;</i>
+                    <div class="choose-item">
+                        <h2>
+                            <i class="icon iconfont crown">&#xe604;</i>
+                            <span>高级字段包</span>
+                        </h2>
+                        <p>
+                            <span class="initial">{{.T.unitPrice_senior}}元/条</span>
+                            <span class="current">{{.T.unitPrice_senior_final}}元/条</span>
                         </p>
-                        <span>数据导出</span>
+                        <!-- <i class="icon iconfont mark">&#xe611;</i> -->
+                        <img class="mark" src="/wx_dataExport/images/mark.png">
                     </div>
                 </div>
-                <div class="form">
-                    <div class="form-item">
-                        <div class="label-title">
-                            <span class="left">已为您筛选 <strong id="msgCount">{{.T.msgCount}}</strong> 条数据</span>
-                            <a href="javascript:history.go(-1)" class="right">返回筛选</a>
-                        </div>
-                        <!-- 选择字段包 -->
-                        <div class="choose">
-                            <div class="choose-item active">
-                                <h2>标准字段包</h2>
-                                <p>
-                                    <span class="initial">{{.T.unitPrice_normal}}元/条</span>
-                                    <span class="current">{{.T.unitPrice_normal_final}}元/条</span>
-                                </p>
-                                <!-- <i class="icon iconfont mark">&#xe611;</i> -->
-                                <img class="mark" src="/wx_dataExport/images/mark.png">
-                            </div>
-                            <div class="choose-item">
-                                <h2>
-                                    <i class="icon iconfont crown">&#xe604;</i>
-                                    <span>高级字段包</span>
-                                </h2>
-                                <p>
-                                    <span class="initial">{{.T.unitPrice_senior}}元/条</span>
-                                    <span class="current">{{.T.unitPrice_senior_final}}元/条</span>
-                                </p>
-                                <!-- <i class="icon iconfont mark">&#xe611;</i> -->
-                                <img class="mark" src="/wx_dataExport/images/mark.png">
-                            </div>
-                        </div>
-                        <!-- 字段包提示 -->
-                        <div class="tips">
-                            <span>标准字段包、高级字段包</span>
-                            <i class="icon iconfont tips-icon" data-id="dialog">&#xe63b;</i>
-                        </div>
-                    </div>
-                    <div class="form-item phone-number">
-                        <div class="form-control">
-<!--                            <label for="">手机号:</label>-->
-                            <div class="input">
-                                <input type="text" class="phone_input" maxlength="11" placeholder="手机号" id="phone_input">
-								<div id="devinput" style="top: -0.05rem;">
-									<i class="icon iconfont phone_check_ok"></i>
-									<span class="phone_err_msg">手机号不正确</span>
-								</div>
-                            </div>
-                        </div>
-                    </div>
-                    <p class="msg">*数据导出将发送至邮箱</p>
-                    <div class="form-item" id="verify">
-                        <div class="form-control">
-<!--                            <label for="">邮箱:</label>-->
-                            <div class="input" id="email-input">
-                                <input type="text" class="email_input" placeholder="邮箱">
-								<div id="devinput">
-									<i class="icon iconfont email_check_ok"></i>
-									<span class="email_err_msg">邮箱不正确</span>
-								</div>
-                            </div>
-                        </div>
-                        <div class="form-control" style="display: none;border-top: 1px solid #e0e0e0;margin-top: 0.06rem;" id="vCode">
-<!--                            <label for="">验证码:</label>-->
-                            <div class="input" id="codeinput">
-                                <input type="text" value="" readonly=true class="verity_input" id="code" maxlength="6" placeholder="验证码">
-								<div id="devinput">
-									<i class="icon iconfont code_check_ok"></i>
-									<span class="code_err_msg">验证码错误</span>
-								</div>
-                                <button type="button" class="sendCode" disabled id="sendCode">发送验证码</button>
-                            </div>
+                <!-- 字段包提示 -->
+                <div class="tips">
+                    <span>标准字段包、高级字段包</span>
+                    <i class="icon iconfont tips-icon" data-id="dialog">&#xe63b;</i>
+                </div>
+            </div>
+            <div class="form-item phone-number">
+                <div class="form-control">
+                    <!--                            <label for="">手机号:</label>-->
+                    <div class="input">
+                        <input type="text" class="phone_input" maxlength="11" placeholder="手机号" id="phone_input">
+                        <div id="devinput" style="top: -0.05rem;">
+                            <i class="icon iconfont phone_check_ok"></i>
+                            <span class="phone_err_msg">手机号不正确</span>
                         </div>
                     </div>
-                    <div class="form-item" style="margin-top: .2rem;">
-                        <div class="way">
-                            <span>支付方式</span>
-                            <div class="way-right" id="choose_way"><span class="payment">微信支付</span><i class="iconfont icon-arrow icon-right"></i></div>
+                </div>
+            </div>
+            <p class="msg">*数据导出将发送至邮箱</p>
+            <div class="form-item" id="verify">
+                <div class="form-control">
+                    <!--                            <label for="">邮箱:</label>-->
+                    <div class="input" id="email-input">
+                        <input type="text" class="email_input" placeholder="邮箱">
+                        <div id="devinput">
+                            <i class="icon iconfont email_check_ok"></i>
+                            <span class="email_err_msg">邮箱不正确</span>
                         </div>
                     </div>
-                    <p class="msg">购买须知:最低起售{{.T.orderMinPrice}}元;标准字段包:原价{{.T.unitPrice_normal}}元/条、{{.T.discount10}}折价{{.T.unitPrice_normal_final}}元/条计费;高级字段包:原价{{.T.unitPrice_senior}}元/条、{{.T.discount10}}折价{{.T.unitPrice_senior_final}}元/条计费;</p>
-
                 </div>
-            </main>
-                                <div class="fixed-bottom-box" id="bottombox">
-                        <div class="weui-cells weui-cells_checkbox radio-form">
-                            <label class="weui-cell weui-check__label" for="s11">
-                                <div class="weui-cell__hd">
-                                    <input type="checkbox" class="weui-check" name="checkbox1" id="s11" />
-                                    <i class="weui-icon-checked"></i>
-                                </div>
-                                <div class="weui-cell__bd read">
-                                    <p>我已阅读,理解并接受 <a onclick="toRead()" style="color:#2cb7ca">《剑鱼标讯线上购买与服务条款》</a></p>
-                                </div>
-                            </label>
-                        </div>
-                        <div class="price">
-                            <span class="pay_before"></span>
-                            <strong class="pay_discount"></strong>
-                        </div>
-                        <div class="form-btn">
-                            <button class="btn prew dataPreview">预览数据</button>
-                            <button class="btn enter toPay" disabled="disabled">确认支付</button>
+                <div class="form-control" style="display: none;border-top: 1px solid #e0e0e0;margin-top: 0.06rem;"
+                     id="vCode">
+                    <!--                            <label for="">验证码:</label>-->
+                    <div class="input" id="codeinput">
+                        <input type="text" value="" readonly=true class="verity_input" id="code" maxlength="6"
+                               placeholder="验证码">
+                        <div id="devinput">
+                            <i class="icon iconfont code_check_ok"></i>
+                            <span class="code_err_msg">验证码错误</span>
                         </div>
-                    </div>
-            <!-- 引用weui Dialog组件 -->
-            <div class="js_dialog" id="tipDialog" style="display: none;">
-                <div class="weui-mask"></div>
-                <div class="weui-dialog">
-                    <div class="weui-dialog__bd">
-                        <h1 class="dialog-title">字段包说明</h1>
-                        <ul class="info">
-                            <li>
-                                <label>·标准字段包</label>
-                                <p>公告标题、公告内容、剑鱼标讯地址、省份、城市、发布时间、项目名称、采购单位、中标单位、中标价、币种、公告类别</p>
-                            </li>
-                            <li>
-                                <label>·高级字段包</label>
-                                <p>公告标题、公告内容、公告地址、剑鱼标讯地址、省份、城市、发布时间、项目名称、项目编号、采购单位、采购单位联系人、采购单位联系电话、预算、开标日期、中标单位、中标价、招标机构、项目范围、币种、公告类别</p>
-                            </li>
-                        </ul>
-                    </div>
-                    <div class="weui-dialog__ft">
-                        <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary">我知道了</a>
+                        <button type="button" class="sendCode" disabled id="sendCode">发送验证码</button>
                     </div>
                 </div>
             </div>
-            <!-- 选择支付方式 
-            <div class="js_dialog pay_way" id="pay_way" style="display: none;">
-                <div class="weui-mask"></div>
-                <div class="box">
-                    <div class="box_hd">
-                        <span></span>
-                        <h3>支付方式</h3>
-                        <span class="cancel">取消</span>
-                    </div>
-                    <div class="box_bd">
-                        <div class="weui-cells weui-cells_checkbox choose-form">
-                            <label class="weui-cell weui-check__label wx_label" for="wx">
-                                <div class="weui-cell__bd read">
-                                    <p><img src="/wx_dataExport/images/weixin.png">微信支付</p>
-                                </div>
-                                <div class="weui-cell__hd">
-                                    <input type="radio" class="weui-check" name="way" value="微信支付" id="wx" checked />
-                                    <i class="weui-icon-checked"></i>
-                                </div>
-                            </label>
-                            <label class="weui-cell weui-check__label zfb_label" for="zfb">
-                                <div class="weui-cell__bd read">
-                                    <p><img src="/wx_dataExport/images/zhifubao.png">支付宝支付</p>
-                                </div>
-                                <div class="weui-cell__hd">
-                                    <input type="radio" class="weui-check" name="way" value="支付宝支付" id="zfb" />
-                                    <i class="weui-icon-checked"></i>
-                                </div>
-                            </label>
-                        </div>
-                    </div>
+            <div class="form-item" style="margin-top: .2rem;">
+                <div class="way">
+                    <span>支付方式</span>
+                    <div class="way-right" id="choose_way"><span class="payment">微信支付</span><i
+                                class="iconfont icon-arrow icon-right"></i></div>
                 </div>
             </div>
-       --> 
-		</div>
-
-        <script>
-			//节后待处理:
-			//用户输入邮箱验证,点击获取验证码,在没有输入验证码的情况下,1.点击预览或者条款,返回后存session的邮件缓存和剩余时间,(返回后页面不会读取后台新的剩余数量,需处理一下。)处理后清除。2.返回上一页,重新点击数据导出到此页面,之前填写的邮件缓存等已不存在,但是剩余时间还在,当下的处理是时间直接显示,存在缺陷,需要出现发送验证按钮 ,如果此次属于邮箱和上次属于邮箱一致,则剩余时间继续减少,否则,重新发送验证。
-			//记录send_code_*改为发送验证码的时间-返回后重新计算剩余时间(同后台)。
-			var userId={{session "userId"}}
-			var msgCount={{.T.msgCount}}
-			var msgMaxCount={{.T.msgMaxCount}}
-			var discount={{.T.discount}}
-			var unitPrice_normal={{.T.unitPrice_normal}}
-			var unitPrice_senior={{.T.unitPrice_senior}}
-			var orderMinPrice={{.T.orderMinPrice}}
-			var finishEmailVerity=false;
-			var readClause=false;
-			var dataType=1;
-			var finishPhoneVerity=false;
-			//
-			var email_lastInput={{.T.email}}
-			var email_lastVerity={{.T.timeSpaceing}}
-			var previewDataTime={{.T.PreviewData}}
-			var phone_lastInput={{.T.phone}}
-			var dataspec={{.T.dataspec}}
-			//可以支付
-			var canpay=true;
-			//订单编号
-			var order_code = "";
-			//
-			var regInt = /[0-9]/;
-			var lstimes =0;
-			//处理苹果留白
-			(/iphone|ipod|ipad/i.test(navigator.appVersion)) && document.addEventListener('blur', (e) => {
-			    // 这里加了个类型判断,因为a等元素也会触发blur事件
-			    ['input', 'textarea'].includes(e.target.localName) && document.body.scrollIntoView(false)
-			}, true)
-			//
-			function accMul(arg1,arg2){  
-				 var m=0,s1=arg1.toString(),s2=arg2.toString();  
-				 try{m+=s1.split(".")[1].length}catch(e){}  
-				 try{m+=s2.split(".")[1].length}catch(e){} 
-				 return parseInt(Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m).toString()*100)/Math.pow(10,2);
-			}  	
-			//
-			function FormatNum(n){
-				if(n>=1000){
-					return Math.floor(n/1000)+","+("0000"+n%1000).slice(-3)
-				}
-				return n
-			}
-			//
-			function ChangePayMoney(){
-				var shouldPay=0;var beforePay=0;
-				if(dataType==1){
-					beforePay=accMul(unitPrice_normal,msgCount)
-					shouldPay=accMul(beforePay,discount)
-				}else if(dataType==2){
-					beforePay=accMul(unitPrice_senior,msgCount)
-					shouldPay=accMul(beforePay,discount)
-				}
-				shouldPay=shouldPay>orderMinPrice?shouldPay:orderMinPrice;
-				beforePay=beforePay>orderMinPrice?beforePay:orderMinPrice;
-				$(".pay_discount").text("¥"+shouldPay);
-				$(".pay_before").text("¥"+beforePay)
-			}
-			//
-			function toRead(){
-				event.preventDefault();
-				if(regInt.test($(".sendCode").text())){
-					var email_input = $(".email_input").val().replace(/\s*/g, "");
-//					if (/\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(email_input)){
-//						sessionStorage.setItem("send_email_"+{{.T._id}}, $(".email_input").val().replace(/\s*/g,""));
-//					}
-				}
-				if($("#phone_input").val()){
-					sessionStorage.setItem("order_phone"+{{.T._id}}, $("#phone_input").val().replace(/\s*/g,""));
-				}
-				window.location.href="/front/staticPage/wx-serviceterms.html";
-			}
-			
-			
-			//
-            $(function() {		
-            	//记录用户上次选择的字段包  1标准2高级
-				if(dataspec){
-					if(dataspec=="1"){
-						$(".choose").children().eq(0).addClass("active");
-						$(".choose").children().eq(1).removeClass("active");
-						dataType=1;
-					}else if(dataspec=="2"){
-						$(".choose").children().eq(1).addClass("active");
-						$(".choose").children().eq(0).removeClass("active");
-						dataType=2;
-					}
-					ChangePayMoney();
-				}
-            	
-            	if(sessionStorage.index=="1"){
-            		$(".choose .choose-item").eq(sessionStorage.index).addClass("active").siblings().removeClass("active");
-            		dataType=2;
-            	}
-				ChangePayMoney();
-
-				
-				
-				var oHeight = $(document).height(); //浏览器当前的高度
-				if(!mySysIsIos()){
-					//软键盘弹起 
-					var isInFocus = false;
-					var timeObj = null;
-					$("input").click(function(){
-						isInFocus = true;
-						$("#bottombox").hide();
-						if(timeObj != null){
-							clearTimeout(timeObj);
-						}
-						timeObj = setTimeout(function(){
-							isInFocus = false;
-						},500);
-					}).blur(function(){
-						isInFocus = false;
-						$("#bottombox").show();
-					});
-					$(window).resize(function(){
-						if(!isInFocus && $("#bottombox").is(":hidden")){
-							$("#bottombox").show();
-						}
-				  	});
-				}
-
-			   
+            <p class="msg">购买须知:最低起售<span></span>元;标准字段包:原价<span></span>元/条、<span></span>
+                折价<span></span>元/条计费;高级字段包:原价<span></span>元/条、<span></span>
+                折价<span></span>元/条计费;</p>
+
+        </div>
+    </main>
+    <div class="fixed-bottom-box" id="bottombox">
+        <div class="weui-cells weui-cells_checkbox radio-form">
+            <label class="weui-cell weui-check__label" for="s11">
+                <div class="weui-cell__hd">
+                    <input type="checkbox" class="weui-check" name="checkbox1" id="s11"/>
+                    <i class="weui-icon-checked"></i>
+                </div>
+                <div class="weui-cell__bd read">
+                    <p>我已阅读,理解并接受 <a onclick="toRead()" style="color:#2cb7ca">《剑鱼标讯线上购买与服务条款》</a></p>
+                </div>
+            </label>
+        </div>
+        <div class="price">
+            <span class="pay_before"></span>
+            <strong class="pay_discount"></strong>
+        </div>
+        <div class="form-btn">
+            <button class="btn prew dataPreview">预览数据</button>
+            <button class="btn enter toPay" disabled="disabled">确认支付</button>
+        </div>
+    </div>
+    <!-- 引用weui Dialog组件 -->
+    <div class="js_dialog" id="tipDialog" style="display: none;">
+        <div class="weui-mask"></div>
+        <div class="weui-dialog">
+            <div class="weui-dialog__bd">
+                <h1 class="dialog-title">字段包说明</h1>
+                <ul class="info">
+                    <li>
+                        <label>·标准字段包</label>
+                        <p>公告标题、公告内容、剑鱼标讯地址、省份、城市、发布时间、项目名称、采购单位、中标单位、中标价、币种、公告类别</p>
+                    </li>
+                    <li>
+                        <label>·高级字段包</label>
+                        <p>
+                            公告标题、公告内容、公告地址、剑鱼标讯地址、省份、城市、发布时间、项目名称、项目编号、采购单位、采购单位联系人、采购单位联系电话、预算、开标日期、中标单位、中标价、招标机构、项目范围、币种、公告类别</p>
+                    </li>
+                </ul>
+            </div>
+            <div class="weui-dialog__ft">
+                <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary">我知道了</a>
+            </div>
+        </div>
+    </div>
+</div>
+
+<script>
+    //节后待处理:
+    //用户输入邮箱验证,点击获取验证码,在没有输入验证码的情况下,1.点击预览或者条款,返回后存session的邮件缓存和剩余时间,(返回后页面不会读取后台新的剩余数量,需处理一下。)处理后清除。2.返回上一页,重新点击数据导出到此页面,之前填写的邮件缓存等已不存在,但是剩余时间还在,当下的处理是时间直接显示,存在缺陷,需要出现发送验证按钮 ,如果此次属于邮箱和上次属于邮箱一致,则剩余时间继续减少,否则,重新发送验证。
+    //记录send_code_*改为发送验证码的时间-返回后重新计算剩余时间(同后台)。
+    var userId ={{session "userId"}}
+    var msgCount ={{.T.msgCount}}
+
+    var msgMaxCount, discount, unitPrice_normal, unitPrice_senior, orderMinPrice;
+
+    var finishEmailVerity = false;
+    var readClause = false;
+    var dataType = 1;
+    var finishPhoneVerity = false;
+    //
+    var email_lastInput ={{.T.email}}
+    var email_lastVerity ={{.T.timeSpaceing}}
+    var previewDataTime ={{.T.PreviewData}}
+    var phone_lastInput ={{.T.phone}}
+    var dataspec ={{.T.dataspec}}
+
+
+
+    //可以支付
+    var canpay = true;
+    //订单编号
+    var order_code = "";
+    //
+    var regInt = /[0-9]/;
+    var lstimes = 0;
+    //处理苹果留白
+    (/iphone|ipod|ipad/i.test(navigator.appVersion)) && document.addEventListener('blur', (e) => {
+        // 这里加了个类型判断,因为a等元素也会触发blur事件
+        ['input', 'textarea'].includes(e.target.localName) && document.body.scrollIntoView(false)
+    }, true)
+
+
+    $(function () {
+
+        //加载价格
+        $.ajax({
+            url: "/jypay/dataexport/getPrice",
+            type: "POST",
+            async: false,
+            dataType: "json",
+            success: function (r) {
+                if (r) {
+                    discount = r.discount;
+                    msgMaxCount = r.unitPrice_normal;
+                    orderMinPrice = r.orderMinPrice;
+                    unitPrice_normal = r.unitPrice_normal;
+                    unitPrice_senior = r.unitPrice_senior;
+                }
+            }
+        });
+
+        //数据规格
+        $(".initial:eq(0)").text(unitPrice_normal + "元/条");
+        $(".current:eq(0)").text(unitPrice_normal * discount + "元/条");
+        $(".initial:eq(1)").text(unitPrice_senior + "元/条");
+        $(".current:eq(1)").text(unitPrice_senior * discount + "元/条");
+        //购买须知
+        $(".msg span:eq(0)").text(orderMinPrice);
+        $(".msg span:eq(1)").text(unitPrice_normal);
+        $(".msg span:eq(2)").text(discount*10);
+        $(".msg span:eq(3)").text(discount*unitPrice_normal);
+
+        $(".msg span:eq(4)").text(unitPrice_senior);
+        $(".msg span:eq(5)").text(discount*10);
+        $(".msg span:eq(6)").text(discount*unitPrice_senior);
+
+
+        //记录用户上次选择的字段包  1标准2高级
+        if (dataspec) {
+            if (dataspec == "1") {
+                $(".choose").children().eq(0).addClass("active");
+                $(".choose").children().eq(1).removeClass("active");
+                dataType = 1;
+            } else if (dataspec == "2") {
+                $(".choose").children().eq(1).addClass("active");
+                $(".choose").children().eq(0).removeClass("active");
+                dataType = 2;
+            }
+            ChangePayMoney();
+        }
+
+        if (sessionStorage.index == "1") {
+            $(".choose .choose-item").eq(sessionStorage.index).addClass("active").siblings().removeClass("active");
+            dataType = 2;
+        }
+        ChangePayMoney();
+
+
+        var oHeight = $(document).height(); //浏览器当前的高度
+        if (!mySysIsIos()) {
+            //软键盘弹起
+            var isInFocus = false;
+            var timeObj = null;
+            $("input").click(function () {
+                isInFocus = true;
+                $("#bottombox").hide();
+                if (timeObj != null) {
+                    clearTimeout(timeObj);
+                }
+                timeObj = setTimeout(function () {
+                    isInFocus = false;
+                }, 500);
+            }).blur(function () {
+                isInFocus = false;
+                $("#bottombox").show();
+            });
+            $(window).resize(function () {
+                if (!isInFocus && $("#bottombox").is(":hidden")) {
+                    $("#bottombox").show();
+                }
+            });
+        }
+
+
 //			   	alert(sessionStorage.getItem("send_email_"+userId)!=null)
 //			   	alert(sessionStorage.getItem("send_code_"+{{.T._id}})!=null)
 //			   	alert(sessionStorage.getItem("send_email_"+userId)==null)
 //			   	alert(localStorage.getItem("new_email_"+userId)!=null)
-			   	//缓存  1.如果有sessionStorage邮箱 先显示此邮箱 再发送邮箱五分钟内 显示验证码输入框 2.如果没有 显示localStorage邮箱 3.如果都没得 显示email_lastInput数据库中邮箱
+        //缓存  1.如果有sessionStorage邮箱 先显示此邮箱 再发送邮箱五分钟内 显示验证码输入框 2.如果没有 显示localStorage邮箱 3.如果都没得 显示email_lastInput数据库中邮箱
 //			   	if((sessionStorage.getItem("send_email_"+userId)!=null)&&(sessionStorage.getItem("send_code_"+{{.T._id}})!=null)){
-		if((sessionStorage.getItem("send_email_"+userId)!=null)&&(sessionStorage.getItem("send_code_"+userId)!=null)){
-			   		//alert("1")
-			   		$(".email_check_ok").hide();
-					$(".email_input").parents('div.form-control').siblings().slideDown();
-			   		$(".email_input").val(sessionStorage.getItem("send_email_"+userId));
-		   			lstimes = parseInt(sessionStorage.getItem("send_code_"+userId));
-					$(".verity_input").removeAttr("readonly");
-					lstimes = lstimes -  Date.parse(new Date())/1000 + 60*5;
-					if (lstimes>0){
-						sendemailTimer(lstimes);
-					}
-					//.getItem("new_email_"+userId)!=null)
-			   	}else if((sessionStorage.getItem("send_email_"+userId)==null)&&(localStorage.getItem("new_email_"+userId)!=null)){
-			   		//alert("2")
-			   		$(".email_check_ok").show();
-					$(".email_input").val(localStorage.getItem("new_email_"+userId));
-					finishEmailVerity = true;
-			   	}else if (email_lastInput!=""){
-			   		//alert("~~")
-			   		$(".email_check_ok").show();
-					$(".email_input").val(email_lastInput);
-					finishEmailVerity = true;
-			   	}else{
-		   			$(".email_input").val("");
-			   	}
-			   	if(email_lastVerity>0){
-					sendemailTimer(email_lastVerity);
-					$(".verity_input").removeAttr("readonly");
-				}else if(lstimes>0){
-					sendemailTimer(lstimes);
-					$(".verity_input").removeAttr("readonly");
-				}
-			   	if (sessionStorage.getItem("order_phone"+{{.T._id}})!=null){
-					if((/^[1][3-9][0-9]{9}$/.test(sessionStorage.getItem("order_phone"+{{.T._id}})))){
-						$(".phone_check_ok").show();
-						$(".phone_input").val(sessionStorage.getItem("order_phone"+{{.T._id}}));
-						finishPhoneVerity=true;
-					}else{
-						$(".phone_err_msg").show();
-						$(".phone_check_ok").hide();
-						finishPhoneVerity = false;
-						$(".toPay").attr("disabled", "disabled");
-					}
-				}else if(phone_lastInput!=""){
-					$(".phone_check_ok").show();
-					$(".phone_input").val(phone_lastInput);
-					finishPhoneVerity=true;
-				}
-				
-				if(readClause&&finishPhoneVerity&&finishEmailVerity){
-					$(".toPay").removeAttr("disabled")
-				}
-				
-				//判断支付按钮状态 
-				if((sessionStorage.readClause=="true")&&finishPhoneVerity&&finishEmailVerity){
-					//刷新
-					if($(".fixed-bottom-box .weui-check").is(":checked")){
-						$(".toPay").removeAttr("disabled")
-						readClause=true;
-					}
-				}
-
-				//数据展示
-				if (sessionStorage.getItem("order_spec"+{{.T._id}})!=null){
-					dataType = sessionStorage.getItem("order_spec"+{{.T._id}});
-				}
-				if(dataType==1){
-					$(".switch-dataType .bz").addClass("active")
-					$(".switch-dataType .gj").removeClass("active")
-				}else{
-					$(".switch-dataType .bz").removeClass("active")
-					$(".switch-dataType .gj").addClass("active")
-				}
-				//
-                $('.choose .choose-item').each(function() {
-                    var index = $(this).index();
-                    $(this).click(function() {
-						//类型切换
-                        $(this).addClass("active").siblings().removeClass("active");
-						if(index==0){
-							dataType=1;
-						}else if(index==1){
-							dataType=2;
-						}
-						sessionStorage.index=index;
-						ChangePayMoney();
+        if ((sessionStorage.getItem("send_email_" + userId) != null) && (sessionStorage.getItem("send_code_" + userId) != null)) {
+            //alert("1")
+            $(".email_check_ok").hide();
+            $(".email_input").parents('div.form-control').siblings().slideDown();
+            $(".email_input").val(sessionStorage.getItem("send_email_" + userId));
+            lstimes = parseInt(sessionStorage.getItem("send_code_" + userId));
+            $(".verity_input").removeAttr("readonly");
+            lstimes = lstimes - Date.parse(new Date()) / 1000 + 60 * 5;
+            if (lstimes > 0) {
+                sendemailTimer(lstimes);
+            }
+            //.getItem("new_email_"+userId)!=null)
+        } else if ((sessionStorage.getItem("send_email_" + userId) == null) && (localStorage.getItem("new_email_" + userId) != null)) {
+            //alert("2")
+            $(".email_check_ok").show();
+            $(".email_input").val(localStorage.getItem("new_email_" + userId));
+            finishEmailVerity = true;
+        } else if (email_lastInput != "") {
+            //alert("~~")
+            $(".email_check_ok").show();
+            $(".email_input").val(email_lastInput);
+            finishEmailVerity = true;
+        } else {
+            $(".email_input").val("");
+        }
+        if (email_lastVerity > 0) {
+            sendemailTimer(email_lastVerity);
+            $(".verity_input").removeAttr("readonly");
+        } else if (lstimes > 0) {
+            sendemailTimer(lstimes);
+            $(".verity_input").removeAttr("readonly");
+        }
+        if (sessionStorage.getItem("order_phone" +{{.T._id}}) != null) {
+            if ((/^[1][3-9][0-9]{9}$/.test(sessionStorage.getItem("order_phone" +{{.T._id}})))) {
+                $(".phone_check_ok").show();
+                $(".phone_input").val(sessionStorage.getItem("order_phone" +{{.T._id}}));
+                finishPhoneVerity = true;
+            } else {
+                $(".phone_err_msg").show();
+                $(".phone_check_ok").hide();
+                finishPhoneVerity = false;
+                $(".toPay").attr("disabled", "disabled");
+            }
+        } else if (phone_lastInput != "") {
+            $(".phone_check_ok").show();
+            $(".phone_input").val(phone_lastInput);
+            finishPhoneVerity = true;
+        }
+
+        if (readClause && finishPhoneVerity && finishEmailVerity) {
+            $(".toPay").removeAttr("disabled")
+        }
+
+        //判断支付按钮状态
+        if ((sessionStorage.readClause == "true") && finishPhoneVerity && finishEmailVerity) {
+            //刷新
+            if ($(".fixed-bottom-box .weui-check").is(":checked")) {
+                $(".toPay").removeAttr("disabled")
+                readClause = true;
+            }
+        }
+
+        //数据展示
+        if (sessionStorage.getItem("order_spec" +{{.T._id}}) != null) {
+            dataType = sessionStorage.getItem("order_spec" +{{.T._id}});
+        }
+        if (dataType == 1) {
+            $(".switch-dataType .bz").addClass("active")
+            $(".switch-dataType .gj").removeClass("active")
+        } else {
+            $(".switch-dataType .bz").removeClass("active")
+            $(".switch-dataType .gj").addClass("active")
+        }
+        //
+        $('.choose .choose-item').each(function () {
+            var index = $(this).index();
+            $(this).click(function () {
+                //类型切换
+                $(this).addClass("active").siblings().removeClass("active");
+                if (index == 0) {
+                    dataType = 1;
+                } else if (index == 1) {
+                    dataType = 2;
+                }
+                sessionStorage.index = index;
+                ChangePayMoney();
+            })
+        })
+        $('.tips-icon').on('click', function () {
+            $('#tipDialog').show(200);
+            $('.weui-dialog__btn_primary').click(function () {
+                $('#tipDialog').hide(200);
+            })
+        });
+        //手机号输入监控
+        var Verification = {
+            //手机号验证
+            isPhone: function (value) {
+                return /^[1][3-9][0-9]{9}$/.test(value);
+            }
+        };
+        $(".phone_input").on("input propertychange", function () {
+            var phone_input = $(this).val().replace(/\s*/g, "");
+            if (phone_input.length == 11) {
+                if (Verification.isPhone(phone_input)) {
+                    $.post("/front/dataExport/checkPhoneVerify", {"phone": phone_input}, function (data) {
+                        if (data.success) {
+                            $(".phone_check_ok").show();
+                            $(".phone_err_msg").hide();
+                            finishPhoneVerity = true;
+                            if (readClause && finishEmailVerity) {
+                                $(".toPay").removeAttr("disabled")
+                            }
+                        } else {
+                            $(".phone_err_msg").show();
+                            $(".phone_check_ok").hide();
+                            finishPhoneVerity = false;
+                            $(".toPay").attr("disabled", "disabled");
+                        }
                     })
+                } else {
+                    $(".phone_err_msg").show();
+                    $(".phone_check_ok").hide();
+                    finishPhoneVerity = false;
+                    $(".toPay").attr("disabled", "disabled");
+                }
+            } else {
+                $(".phone_err_msg").hide();
+                $(".phone_check_ok").hide();
+                finishPhoneVerity = false;
+                $(".toPay").attr("disabled", "disabled");
+            }
+        }).blur(function () {
+            var phone_input = $(this).val().replace(/\s*/g, "");
+            if (phone_input.length != 11 && phone_input.length != 0) {
+                $(".phone_err_msg").show();
+                $(".phone_check_ok").hide();
+                finishPhoneVerity = false;
+                $(".toPay").attr("disabled", "disabled");
+            }
+        }).on("focus", function () {
+            this.scrollIntoView();
+        });
+        //邮箱输入监控
+        $(".email_input").on("input propertychange", function () {
+            var email_input = $(this).val().replace(/\s*/g, "");
+            if (email_input.indexOf("@") > 0) {
+                if (email_input != email_lastInput) {
+                    $(this).parents('div.form-control').siblings().slideDown();
+                    if (email_lastVerity > 0) {
+                        $("#sendCode").attr("disabled", true);
+                        //返回后验证码可输入
+                        if ((localStorage.getItem("new_email_" + userId) != null) && (localStorage.getItem("new_email_" + userId) == email_input)) {
+                            $(".verity_input").attr("readonly", false);
+                        } else {
+                            if (email_lastVerity > 0) {
+                                $(".verity_input").removeAttr("readonly");
+                            } else if (lstimes > 0) {
+                                $(".verity_input").removeAttr("readonly");
+                            } else {
+                                $(".verity_input").attr("readonly", true);
+                            }
+                        }
+                    } else {
+                        //新用户输入后 从新进来
+                        $(".verity_input").prop("readonly", false);
+                        $("#sendCode").prop("disabled", true);
+                    }
+                    finishEmailVerity = false;
+                    $(".toPay").attr("disabled", "disabled");
+                    if (/\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(email_input)) {
+                        lstimes_ = parseInt(sessionStorage.getItem("send_code_" + userId));
+                        lstimes_ = lstimes_ - Date.parse(new Date()) / 1000 + 60 * 5;
+                        if (lstimes_ > 0) {
+                            $("#sendCode").prop("disabled", true);
+                        } else {
+                            $("#sendCode").prop("disabled", false);
+                        }
+                        $(".email_err_msg").hide();
+                        $(".email_check_ok").hide();
+                    } else {
+                        $("#sendCode").attr("disabled", true);
+                        $(".email_check_ok").hide();
+                        $(".email_err_msg").hide();
+                    }
+                } else {
+                    finishEmailVerity = true;
+                    if (readClause && finishPhoneVerity) {
+                        $(".toPay").removeAttr("disabled")
+                    }
+                    $("#sendCode").attr("disabled", "disabled");
+                    $(".verity_input").attr("readonly", true);
+                    $(".email_err_msg").hide();
+                    $(".email_check_ok").show();
+                    //验证通过后 存 localStorage邮箱  此邮箱为验证通过的邮箱   并清除sessionStorage发送验证码的邮箱
+                    localStorage.setItem("new_email_" + userId, $(".email_input").val().replace(/\s*/g, ""));
+                    sessionStorage.removeItem("send_email_" + userId);
+                    $(this).parents('div.form-control').siblings().slideUp();
+                }
+            } else {
+                $(this).parents('div.form-control').siblings().slideUp();
+                $("#sendCode").attr("disabled", "disabled");
+                $(".verity_input").attr("readonly", true);
+                $(".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) && ($(".email_input").val().length != 0)) {
+                $(".email_err_msg").show();
+                $(".email_check_ok").hide();
+                return
+            }
+            if ($(".email_input").val() == email) {
+                return;
+            }
+            $("#sendCode").removeAttr("disabled");
+            $(".email_check_ok").hide();
+            $(".email_err_msg").hide();
+        }).on("focus", function () {
+            this.scrollIntoView();
+        });
+        //点击发送验证码-邮箱验证
+        var canVerify = true;
+        $(".sendCode").on("click", 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)) {
+                $(".email_err_msg").show();
+                $(".email_check_ok").hide();
+                return
+            }
+            if (!canVerify) {
+                return
+            }
+            canVerify = false;
+            $.post("/front/dataExport/sendMailVerify", {"email": email}, function (data) {
+                canVerify = true;
+                if (data.success) {
+                    if (data.errCode == 4) {
+                        EasyAlert.show(data.errMsg, "", 3000);
+                        finishEmailVerity = true;
+                        $(".email_check_ok").show();
+                        $(".email_input").parents('div.form-control').siblings().slideUp();
+                        if (readClause && finishPhoneVerity) {
+                            $(".toPay").removeAttr("disabled")
+                        }
+                    } else {
+                        $(".toPay").attr("disabled", "disabled");
+                        finishEmailVerity = false;
+                        //发送成功
+                        sendemailTimer(60 * 5);
+                        sessionStorage.email_sign = "1";
+                        $(".verity_input").removeAttr("readonly");
+                        $(".sendCode").attr("disabled", "disabled");
+                        $(".email_input").attr("readonly", true);
+                        sessionStorage.setItem("send_code_" + userId, Date.parse(new Date()) / 1000);
+                        //发送验证码后 sessionStorage邮箱
+                        sessionStorage.setItem("send_email_" + userId, $(".email_input").val().replace(/\s*/g, ""));
+                    }
+                } else {
+                    EasyAlert.show(data.errMsg, "", 3000)
+                    if (data.errCode == 2) {
+                        sendemailTimer(data.time);
+                        $(".sendCode").attr("disabled", "disabled");
+                        $(".email_input").attr("readonly", true);
+                        //发送验证码后 sessionStorage邮箱
+                        sessionStorage.setItem("send_email_" + userId, $(".email_input").val().replace(/\s*/g, ""));
+                    }
+                }
+            }, "json")
+        });
+        //校验验证码
+        $(".verity_input").bind("input propertychange", function () {
+            var verity = $(this).val()
+            var email = $(".email_input").val().replace(/\s*/g, "");
+            if (verity.length == 6) {
+                $.post("/front/dataExport/checkMailVerify", {"emailVerity": verity, "email": email}, function (data) {
+                    if (data.success) {
+                        finishEmailVerity = true;
+                        if (readClause && finishPhoneVerity) {
+                            $(".toPay").removeAttr("disabled")
+                        }
+                        $(".email_check_ok").show();
+                        $(".email_err_msg").hide();
+                        $(".verity_input").attr("readonly", true);
+                        $(".verity_input").val("");
+                        $(".email_input").parents('div.form-control').siblings().slideUp();
+                        sessionStorage.setItem("EmailVerity_" +{{.T._id}}, "T");
+                        //验证通过后 存 localStorage邮箱  此邮箱为验证通过的邮箱   并清除sessionStorage发送验证码的邮箱
+                        localStorage.setItem("new_email_" + userId, $(".email_input").val().replace(/\s*/g, ""));
+                        sessionStorage.removeItem("send_email_" + userId);
+                    } else {
+                        EasyAlert.show("验证码错误", "", 3000);
+                    }
                 })
-                $('.tips-icon').on('click', function() {
-                    $('#tipDialog').show(200);
-                    $('.weui-dialog__btn_primary').click(function() {
-                        $('#tipDialog').hide(200);
-                    })
-                });
-				//手机号输入监控
-				var Verification = {
-			    	//手机号验证
-			    	isPhone: function(value) {
-				        return /^[1][3-9][0-9]{9}$/.test(value);
-				    }
-				};
-				$(".phone_input").on("input propertychange",function() {
-					var phone_input = $(this).val().replace(/\s*/g,"");
-					if (phone_input.length == 11) {
-						if(Verification.isPhone(phone_input)){
-							$.post("/front/dataExport/checkPhoneVerify",{"phone":phone_input},function(data){
-								if(data.success){
-									$(".phone_check_ok").show();
-									$(".phone_err_msg").hide();
-									finishPhoneVerity=true;
-									if(readClause&&finishEmailVerity){
-										$(".toPay").removeAttr("disabled")
-									}
-								}else{
-									$(".phone_err_msg").show();
-									$(".phone_check_ok").hide();
-									finishPhoneVerity=false;
-									$(".toPay").attr("disabled","disabled");
-								}
-							})
-						}else{
-							$(".phone_err_msg").show();
-							$(".phone_check_ok").hide();
-							finishPhoneVerity=false;
-							$(".toPay").attr("disabled","disabled");
-						}
-					}else{
-						$(".phone_err_msg").hide();
-						$(".phone_check_ok").hide();
-						finishPhoneVerity=false;
-						$(".toPay").attr("disabled","disabled");
-					}
-				}).blur(function(){
-					var phone_input = $(this).val().replace(/\s*/g,"");
-					if (phone_input.length != 11&&phone_input.length!=0) {
-						$(".phone_err_msg").show();
-						$(".phone_check_ok").hide();
-						finishPhoneVerity=false;
-						$(".toPay").attr("disabled","disabled");
-					}
-				}).on("focus",function(){
-			   		  this.scrollIntoView();
-				});
-				//邮箱输入监控
-				$(".email_input").on("input propertychange",function() {
-					var email_input = $(this).val().replace(/\s*/g,"");
-					if(email_input.indexOf("@")>0){
-						if (email_input != email_lastInput) {
-							$(this).parents('div.form-control').siblings().slideDown();
-							if(email_lastVerity>0){
-								$("#sendCode").attr("disabled", true);
-								//返回后验证码可输入
-								if((localStorage.getItem("new_email_"+userId)!=null)&&(localStorage.getItem("new_email_"+userId)==email_input)){
-									$(".verity_input").attr("readonly", false);
-								}else{
-								   	if(email_lastVerity>0){
-										$(".verity_input").removeAttr("readonly");
-									}else if(lstimes>0){
-										$(".verity_input").removeAttr("readonly");
-									}else{
-										$(".verity_input").attr("readonly", true);
-									}
-								}
-							}else{
-								//新用户输入后 从新进来
-								$(".verity_input").prop("readonly", false);
-								$("#sendCode").prop("disabled", true);
-							}
-							finishEmailVerity=false;
-							$(".toPay").attr("disabled","disabled");
-							if(/\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(email_input)){
-								lstimes_ = parseInt(sessionStorage.getItem("send_code_"+userId));
-								lstimes_ = lstimes_ -  Date.parse(new Date())/1000 + 60*5;
-								if (lstimes_>0) {
-									$("#sendCode").prop("disabled", true);
-								}else{
-									$("#sendCode").prop("disabled", false);
-								}
-								$(".email_err_msg").hide();
-								$(".email_check_ok").hide();
-							}else{
-								$("#sendCode").attr("disabled", true);
-								$(".email_check_ok").hide();
-								$(".email_err_msg").hide();
-							}
-						}else{
-							finishEmailVerity=true;
-							if(readClause&&finishPhoneVerity){
-								$(".toPay").removeAttr("disabled")
-							}
-							$("#sendCode").attr("disabled","disabled");
-							$(".verity_input").attr("readonly",true);
-							$(".email_err_msg").hide();
-							$(".email_check_ok").show();
-							//验证通过后 存 localStorage邮箱  此邮箱为验证通过的邮箱   并清除sessionStorage发送验证码的邮箱
-							localStorage.setItem("new_email_"+userId,$(".email_input").val().replace(/\s*/g,""));
-							sessionStorage.removeItem("send_email_"+userId);
-							$(this).parents('div.form-control').siblings().slideUp();
-						}
-					}else{
-						$(this).parents('div.form-control').siblings().slideUp();
-						$("#sendCode").attr("disabled","disabled");
-						$(".verity_input").attr("readonly",true);
-						$(".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)&&($(".email_input").val().length!=0)){
-						$(".email_err_msg").show();
-						$(".email_check_ok").hide();
-						return
-					}
-					if($(".email_input").val()==email){
-						return;
-					}
-					$("#sendCode").removeAttr("disabled");
-					$(".email_check_ok").hide();
-					$(".email_err_msg").hide();
-				}).on("focus",function(){
-			   		  this.scrollIntoView();
-				});
-				//点击发送验证码-邮箱验证
-				var canVerify=true;
-				$(".sendCode").on("click",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)) {
-						$(".email_err_msg").show();
-						$(".email_check_ok").hide();
-						return
-					}
-					if(!canVerify){
-						return
-					}
-					canVerify=false;
-					$.post("/front/dataExport/sendMailVerify",{"email":email},function(data){
-						canVerify=true;
-						if(data.success){
-							if(data.errCode==4){
-								EasyAlert.show(data.errMsg,"",3000);
-								finishEmailVerity=true;
-								$(".email_check_ok").show();
-								$(".email_input").parents('div.form-control').siblings().slideUp();
-								if(readClause&&finishPhoneVerity){
-									$(".toPay").removeAttr("disabled")
-								}
-							}else{
-								$(".toPay").attr("disabled","disabled");
-								finishEmailVerity=false;
-								//发送成功
-								sendemailTimer(60*5);
-								sessionStorage.email_sign="1";
-								$(".verity_input").removeAttr("readonly");
-								$(".sendCode").attr("disabled","disabled");
-								$(".email_input").attr("readonly",true);
-								sessionStorage.setItem("send_code_"+userId, Date.parse(new Date())/1000);
-								//发送验证码后 sessionStorage邮箱 
-								sessionStorage.setItem("send_email_"+userId, $(".email_input").val().replace(/\s*/g,""));
-							}
-						}else{
-							EasyAlert.show(data.errMsg,"",3000)
-							if(data.errCode==2){
-								sendemailTimer(data.time);
-								$(".sendCode").attr("disabled","disabled");
-								$(".email_input").attr("readonly",true);
-								//发送验证码后 sessionStorage邮箱 
-								sessionStorage.setItem("send_email_"+userId, $(".email_input").val().replace(/\s*/g,""));
-							}
-						}
-					},"json")
-				});
-				//校验验证码
-				$(".verity_input").bind("input propertychange",function(){
-					var verity=$(this).val()
-					var email=$(".email_input").val().replace(/\s*/g,"");
-					if(verity.length==6){
-						$.post("/front/dataExport/checkMailVerify",{"emailVerity":verity,"email":email},function(data){
-							if(data.success){
-								finishEmailVerity=true;
-								if(readClause&&finishPhoneVerity){
-									$(".toPay").removeAttr("disabled")
-								}
-								$(".email_check_ok").show();
-								$(".email_err_msg").hide();
-								$(".verity_input").attr("readonly",true);
-								$(".verity_input").val("");
-								$(".email_input").parents('div.form-control').siblings().slideUp();
-								sessionStorage.setItem("EmailVerity_"+{{.T._id}},"T");
-								//验证通过后 存 localStorage邮箱  此邮箱为验证通过的邮箱   并清除sessionStorage发送验证码的邮箱
-								localStorage.setItem("new_email_"+userId,$(".email_input").val().replace(/\s*/g,""));
-								sessionStorage.removeItem("send_email_"+userId);
-							}else{
-								EasyAlert.show("验证码错误","",3000);
-							}
-						})
-					}else{
-						//进入其他页面 验证码显示 清除缓存
-						sessionStorage.removeItem("email_sign");
-						$(".email_err_msg").hide();
-					}
-					//防遮挡
-				}).on("focus",function(){
-					var target = this;
-			   		setTimeout(function(){
-			   		  	target.scrollIntoViewIfNeeded();
-			   		},500)
-				});
-				
-				//点击阅读条款
-				$(".fixed-bottom-box .weui-check").on("click", function () {
-					if($(this).is(":checked")){
-						if(finishEmailVerity&&finishPhoneVerity){
-							readClause=true;
-							sessionStorage.readClause="true";
-							$(".toPay").removeAttr("disabled")
-						}else{
-							readClause=true;
-							sessionStorage.readClause="true";
-							$(".toPay").attr("disabled","disabled");
-						}
-					}else{
-						readClause=false;
-						sessionStorage.readClause="false";
-						$(".toPay").attr("disabled","disabled");
-					}
-				})
-				
-				//数据浏览
-				$(".dataPreview").on("click",function(){
-					if(previewDataTime<50){
-						previewDataTime++
-						var dataType = $(".choose").find("div.active").index()+1;
-						//缓存
-						if(regInt.test($(".sendCode").text())){
-							var email_input = $(".email_input").val().replace(/\s*/g, "");
+            } else {
+                //进入其他页面 验证码显示 清除缓存
+                sessionStorage.removeItem("email_sign");
+                $(".email_err_msg").hide();
+            }
+            //防遮挡
+        }).on("focus", function () {
+            var target = this;
+            setTimeout(function () {
+                target.scrollIntoViewIfNeeded();
+            }, 500)
+        });
+
+        //点击阅读条款
+        $(".fixed-bottom-box .weui-check").on("click", function () {
+            if ($(this).is(":checked")) {
+                if (finishEmailVerity && finishPhoneVerity) {
+                    readClause = true;
+                    sessionStorage.readClause = "true";
+                    $(".toPay").removeAttr("disabled")
+                } else {
+                    readClause = true;
+                    sessionStorage.readClause = "true";
+                    $(".toPay").attr("disabled", "disabled");
+                }
+            } else {
+                readClause = false;
+                sessionStorage.readClause = "false";
+                $(".toPay").attr("disabled", "disabled");
+            }
+        })
+
+        //数据浏览
+        $(".dataPreview").on("click", function () {
+            if (previewDataTime < 50) {
+                previewDataTime++
+                var dataType = $(".choose").find("div.active").index() + 1;
+                //缓存
+                if (regInt.test($(".sendCode").text())) {
+                    var email_input = $(".email_input").val().replace(/\s*/g, "");
 //							if (/\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(email_input)){
 //								sessionStorage.setItem("send_email_"+{{.T._id}}, $(".email_input").val().replace(/\s*/g,""));
 //							}
-						}
-						if($("#phone_input").val()){
-							sessionStorage.setItem("order_phone"+{{.T._id}}, $("#phone_input").val().replace(/\s*/g,""));
-						}
-						if ($(".fixed-bottom-box .weui-check").is(":checked")) {
-							if (finishEmailVerity && finishPhoneVerity) {
-								readClause = true;
-								sessionStorage.readClause="true";
-							}else{
-								readClause = true;
-								sessionStorage.readClause="true";
-								$(".toPay").attr("disabled", "disabled");
-							}
-						} else {
-							readClause = false;
-							sessionStorage.readClause="false";
-							$(".toPay").attr("disabled", "disabled");
-						}
-						window.open("/front/wx_dataExport/toPreview/"+{{.T._id}}+"?dataType="+dataType);
-					}else{
-						EasyAlert.show("预览数据次数超出今日上限!","",3000);
-					}
-				})
-				
-				//确认支付
-				$(".toPay").on("click",function(){
-					if(!finishEmailVerity||!readClause||!canpay||!finishPhoneVerity){
-						return	
-					}
-					$(".loading_").show();
-					canpay=false;
-					
-					var param={};
-					param.pay_way="wx_js";
-					param.data_spec=dataType==2?"senior":"standard";
-					param.id={{.T._id}}
-					//先去创建预支付订单
-					$.post("/jypay/dataExport/weixin/createOrder",param,function(data){
-						if(data.status=="y"){
-							sessionStorage.setItem("order_spec"+{{.T._id}}, dataType);
-							sessionStorage.setItem("order_email"+{{.T._id}}, $(".email_input").val().replace(/\s*/g,""));
-							sessionStorage.setItem("order_phone"+{{.T._id}}, $(".phone_input").val().replace(/\s*/g,""));
-							//预支付订单创建成功后 调微信支付
-							if(data.res){
-								order_code=data.code;
-								onBridgeReady(data.res);
-							}
-						}else{
-							canpay=true;
-							EasyAlert.show("生成订单出错,请稍后尝试!","",3000);
-						}
-						$(".loading_").hide();
-					},"json");
-					
-				})
-            })
-			//调用微信支付接口
-			function onBridgeReady(res){
-			   	WeixinJSBridge.invoke('getBrandWCPayRequest',{
-			    		"appId": res["appId"],
-			          	"timeStamp": res["timestamp"],
-			          	"nonceStr": res["nonceStr"],
-			          	"package": res["prepayId"],
-			          	"signType": res["signType"],
-			         	"paySign": res["sign"]
-					},
-					function(r){
-				        if(r.err_msg == "get_brand_wcpay_request:ok"){
-							//清除我已阅读缓存
-							sessionStorage.removeItem("readClause");
-							sessionStorage.removeItem("index");
-							sessionStorage.removeItem("EmailVerity_"+{{.T._id}});
-							sessionStorage.removeItem("keyWords");
-							$(".toPay").attr("disabled","disabled");
-							var email_pay = sessionStorage.getItem("order_email"+{{.T._id}})
-							setTimeout(function(){
-								window.location.replace("/front/wx_dataExport/paySuccessPage?email="+email_pay+"&orderCode="+order_code+"&payTime="+res["timestamp"]);
-							},500)
-						}else if(r.err_msg == "get_brand_wcpay_request:cancel"){
-							//取消支付 可以再次支付
-							canpay=true;
-						}else{
-							EasyAlert.show("系统异常,请稍微再试","",3000);
-					}
-					//清除我已阅读缓存 	
-					sessionStorage.removeItem("index");
-					sessionStorage.removeItem("EmailVerity_"+{{.T._id}});
-				});
-			}
-			//倒计时
-			function sendemailTimer(t){
-				$(".sendCode").text(""+t+"s");
-				$(".sendCode").attr("disabled","disabled");
-				r=setInterval(function(){
-					t--;
-					$(".sendCode").text(""+t+"s")
-					if(t<=0){
-						clearInterval(r);
-						$(".sendCode").text("发送验证码");
-						if(!finishEmailVerity){
-							$(".verity_input").attr("readonly",true);
-							$(".sendCode").removeAttr("disabled");
-							$(".email_input").removeAttr("readonly");
-							$(".sendCode").css("color","#2CB7CA");
-						}
-					}
-				},1000)
-			}
-			//提示框
-			var EasyAlert = {
-				timeout: null,
-				waitTime: 1000,
-				show: function(text,css,waitTime){
-					if(this.timeout != null){
-						clearTimeout(this.timeout);
-						this.hide();
-						this.timeout = null;
-					}
-					var thisClass = this;
-					this.timeout = setTimeout(function(){
-						thisClass.hide();
-						thisClass.timeout = null;
-					},waitTime?waitTime:this.waitTime);
-					$("body").append('<div class="easyalert" id="easyAlert">'+text+'</div>');
-					$("#easyAlert").css({"left":"50%","margin-top":-($("#easyAlert").outerHeight()/2),"margin-left":-($("#easyAlert").outerWidth()/2)}).show();
-				},
-				hide: function(){
-					$("#easyAlert").remove();
-				}
-			}
-			function mySysIsIos(){
-				return !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
-			}
-        </script>
-	{{include "/common/baiducc.html"}}
-    </body>
+                }
+                if ($("#phone_input").val()) {
+                    sessionStorage.setItem("order_phone" +{{.T._id}}, $("#phone_input").val().replace(/\s*/g, ""));
+                }
+                if ($(".fixed-bottom-box .weui-check").is(":checked")) {
+                    if (finishEmailVerity && finishPhoneVerity) {
+                        readClause = true;
+                        sessionStorage.readClause = "true";
+                    } else {
+                        readClause = true;
+                        sessionStorage.readClause = "true";
+                        $(".toPay").attr("disabled", "disabled");
+                    }
+                } else {
+                    readClause = false;
+                    sessionStorage.readClause = "false";
+                    $(".toPay").attr("disabled", "disabled");
+                }
+                window.open("/front/wx_dataExport/toPreview/"+{{.T._id}}+
+                "?dataType=" + dataType
+            )
+                ;
+            } else {
+                EasyAlert.show("预览数据次数超出今日上限!", "", 3000);
+            }
+        })
+
+        //确认支付
+        $(".toPay").on("click", function () {
+            if (!finishEmailVerity || !readClause || !canpay || !finishPhoneVerity) {
+                return
+            }
+            $(".loading_").show();
+            canpay = false;
+
+            var param = {};
+            param.pay_way = "wx_js";
+            param.data_spec = dataType == 2 ? "senior" : "standard";
+            param.id ={{.T._id}}
+                //先去创建预支付订单
+                $.post("/jypay/dataExport/weixin/createOrder", param, function (data) {
+                    if (data.status == "y") {
+                        sessionStorage.setItem("order_spec" +{{.T._id}}, dataType);
+                        sessionStorage.setItem("order_email" +{{.T._id}}, $(".email_input").val().replace(/\s*/g, ""));
+                        sessionStorage.setItem("order_phone" +{{.T._id}}, $(".phone_input").val().replace(/\s*/g, ""));
+                        //预支付订单创建成功后 调微信支付
+                        if (data.res) {
+                            order_code = data.code;
+                            onBridgeReady(data.res);
+                        }
+                    } else {
+                        canpay = true;
+                        EasyAlert.show("生成订单出错,请稍后尝试!", "", 3000);
+                    }
+                    $(".loading_").hide();
+                }, "json");
+
+        })
+    })
+
+    //调用微信支付接口
+    function onBridgeReady(res) {
+        WeixinJSBridge.invoke('getBrandWCPayRequest', {
+                "appId": res["appId"],
+                "timeStamp": res["timestamp"],
+                "nonceStr": res["nonceStr"],
+                "package": res["prepayId"],
+                "signType": res["signType"],
+                "paySign": res["sign"]
+            },
+            function (r) {
+                if (r.err_msg == "get_brand_wcpay_request:ok") {
+                    //清除我已阅读缓存
+                    sessionStorage.removeItem("readClause");
+                    sessionStorage.removeItem("index");
+                    sessionStorage.removeItem("EmailVerity_" +{{.T._id}});
+                    sessionStorage.removeItem("keyWords");
+                    $(".toPay").attr("disabled", "disabled");
+                    var email_pay = sessionStorage.getItem("order_email" +{{.T._id}})
+                    setTimeout(function () {
+                        window.location.replace("/front/wx_dataExport/paySuccessPage?email=" + email_pay + "&orderCode=" + order_code + "&payTime=" + res["timestamp"]);
+                    }, 500)
+                } else if (r.err_msg == "get_brand_wcpay_request:cancel") {
+                    //取消支付 可以再次支付
+                    canpay = true;
+                } else {
+                    EasyAlert.show("系统异常,请稍微再试", "", 3000);
+                }
+                //清除我已阅读缓存
+                sessionStorage.removeItem("index");
+                sessionStorage.removeItem("EmailVerity_" +{{.T._id}});
+            });
+    }
+
+    //倒计时
+    function sendemailTimer(t) {
+        $(".sendCode").text("" + t + "s");
+        $(".sendCode").attr("disabled", "disabled");
+        r = setInterval(function () {
+            t--;
+            $(".sendCode").text("" + t + "s")
+            if (t <= 0) {
+                clearInterval(r);
+                $(".sendCode").text("发送验证码");
+                if (!finishEmailVerity) {
+                    $(".verity_input").attr("readonly", true);
+                    $(".sendCode").removeAttr("disabled");
+                    $(".email_input").removeAttr("readonly");
+                    $(".sendCode").css("color", "#2CB7CA");
+                }
+            }
+        }, 1000)
+    }
+
+    //提示框
+    var EasyAlert = {
+        timeout: null,
+        waitTime: 1000,
+        show: function (text, css, waitTime) {
+            if (this.timeout != null) {
+                clearTimeout(this.timeout);
+                this.hide();
+                this.timeout = null;
+            }
+            var thisClass = this;
+            this.timeout = setTimeout(function () {
+                thisClass.hide();
+                thisClass.timeout = null;
+            }, waitTime ? waitTime : this.waitTime);
+            $("body").append('<div class="easyalert" id="easyAlert">' + text + '</div>');
+            $("#easyAlert").css({
+                "left": "50%",
+                "margin-top": -($("#easyAlert").outerHeight() / 2),
+                "margin-left": -($("#easyAlert").outerWidth() / 2)
+            }).show();
+        },
+        hide: function () {
+            $("#easyAlert").remove();
+        }
+    }
+
+    function mySysIsIos() {
+        return !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
+    }
+
+    //
+    function accMul(arg1, arg2) {
+        var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
+        try {
+            m += s1.split(".")[1].length
+        } catch (e) {
+        }
+        try {
+            m += s2.split(".")[1].length
+        } catch (e) {
+        }
+        return parseInt(Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m).toString() * 100) / Math.pow(10, 2);
+    }
+
+    //
+    function FormatNum(n) {
+        if (n >= 1000) {
+            return Math.floor(n / 1000) + "," + ("0000" + n % 1000).slice(-3)
+        }
+        return n
+    }
+
+    //
+    function ChangePayMoney() {
+        var shouldPay = 0;
+        var beforePay = 0;
+        if (dataType == 1) {
+            beforePay = accMul(unitPrice_normal, msgCount)
+            shouldPay = accMul(beforePay, discount)
+        } else if (dataType == 2) {
+            beforePay = accMul(unitPrice_senior, msgCount)
+            shouldPay = accMul(beforePay, discount)
+        }
+        shouldPay = shouldPay > orderMinPrice ? shouldPay : orderMinPrice;
+        beforePay = beforePay > orderMinPrice ? beforePay : orderMinPrice;
+        $(".pay_discount").text("¥" + shouldPay);
+        $(".pay_before").text("¥" + beforePay)
+    }
+
+    //
+    function toRead() {
+        event.preventDefault();
+        if (regInt.test($(".sendCode").text())) {
+            var email_input = $(".email_input").val().replace(/\s*/g, "");
+//					if (/\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(email_input)){
+//						sessionStorage.setItem("send_email_"+{{.T._id}}, $(".email_input").val().replace(/\s*/g,""));
+//					}
+        }
+        if ($("#phone_input").val()) {
+            sessionStorage.setItem("order_phone" +{{.T._id}}, $("#phone_input").val().replace(/\s*/g, ""));
+        }
+        window.location.href = "/front/staticPage/wx-serviceterms.html";
+    }
+</script>
+{{include "/common/baiducc.html"}}
+</body>
 </html>