|
@@ -0,0 +1,586 @@
|
|
|
+<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"}}/jyapp/js/rem.js"></script>
|
|
|
+ <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/jyapp/wx_dataExport/css/weui.min.css?v={{Msg "seo" "version"}}">
|
|
|
+ <link rel="stylesheet" type="text/css" href="{{Msg "seo" "cdn"}}/jyapp/wx_dataExport/css/base.css?v={{Msg "seo" "version"}}" />
|
|
|
+ <link rel="stylesheet" type="text/css" href="{{Msg "seo" "cdn"}}/jyapp/wx_dataExport/iconfont/iconfont.css?v={{Msg "seo" "version"}}" />
|
|
|
+ <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/jyapp/wx_dataExport/css/pay_order.css?v={{Msg "seo" "version"}}2">
|
|
|
+ <script src="{{Msg "seo" "cdn"}}/jyapp/js/jquery-3.2.1.min.js"></script>
|
|
|
+ <script src="{{Msg "seo" "cdn"}}/jyapp/wx_dataExport/js/weui.min.js"></script>
|
|
|
+ </head>
|
|
|
+ <body>
|
|
|
+ <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"></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"></i>
|
|
|
+ </p>
|
|
|
+ <span class="active">支付订单</span>
|
|
|
+ <div class="line"></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="p-item">
|
|
|
+ <p class="p-item-icon icon-gray">
|
|
|
+ <i class="icon iconfont"></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>
|
|
|
+ <!-- <i class="icon iconfont mark"></i> -->
|
|
|
+ <img class="mark" src="/wx_dataExport/images/mark.png">
|
|
|
+ </div>
|
|
|
+ <div class="choose-item">
|
|
|
+ <h2>
|
|
|
+ <i class="icon iconfont crown"></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"></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"></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="手机号">
|
|
|
+ <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;">
|
|
|
+<!-- <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>
|
|
|
+ </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">购买须知:最低起售{{.T.orderMinPrice}}元;标准字段包:原价{{.T.unitPrice_normal}}元/条、{{.T.discount10}}折价{{.T.unitPrice_normal_final}}元/条计费;高级字段包:原价{{.T.unitPrice_senior}}元/条、{{.T.discount10}}折价{{.T.unitPrice_senior_final}}元/条计费;</p>
|
|
|
+ <div class="fixed-bottom-box">
|
|
|
+ <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 href="/jyapp/front/staticPage/dataExport_serviceterms.html">《剑鱼标讯线上购买与服务条款》</a></p>
|
|
|
+ </div>
|
|
|
+ </label>
|
|
|
+ </div>
|
|
|
+ <div class="price">
|
|
|
+ <span class="pay_before">原价:¥20,000</span>
|
|
|
+ <strong class="pay_discount">¥16,300</strong>
|
|
|
+ </div>
|
|
|
+ <div class="form-btn">
|
|
|
+ <button class="btn prew dataPreview">预览数据</button>
|
|
|
+ <button class="btn enter toPay" disabled="disabled">确认支付</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </main>
|
|
|
+ <!-- 引用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 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>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <script>
|
|
|
+ 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 canpay=true;
|
|
|
+ //订单编号
|
|
|
+ var order_code = ""
|
|
|
+ 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() {
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ //
|
|
|
+ $('#choose_way').click(function() {
|
|
|
+ $('.pay_way').slideDown('slow')
|
|
|
+ })
|
|
|
+ /* 选择支付方式*/
|
|
|
+ $('input:radio[name="way"]').click(function() {
|
|
|
+ var checkValue = $('input:radio[name="way"]:checked').val();
|
|
|
+ console.log(checkValue);
|
|
|
+ $('.pay_way').hide(200)
|
|
|
+ $('.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;
|
|
|
+ }
|
|
|
+ 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_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();
|
|
|
+ console.log(email_lastVerity)
|
|
|
+ if(email_lastVerity>0){
|
|
|
+ $("#sendCode").attr("disabled", true);
|
|
|
+ $(".verity_input").attr("readonly",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)){
|
|
|
+ $("#sendCode").removeAttr("disabled");
|
|
|
+ $(".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();
|
|
|
+ $(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_err_msg").show();
|
|
|
+ $(".email_check_ok").hide();
|
|
|
+ return
|
|
|
+ }
|
|
|
+ $("#sendCode").removeAttr("disabled");
|
|
|
+ $(".email_check_ok").hide();
|
|
|
+ $(".email_err_msg").hide();
|
|
|
+ });
|
|
|
+ //点击发送验证码-邮箱验证
|
|
|
+ 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();
|
|
|
+ }else{
|
|
|
+ $(".toPay").attr("disabled","disabled");
|
|
|
+ finishEmailVerity=false;
|
|
|
+ //发送成功
|
|
|
+ sendemailTimer(60*5);
|
|
|
+ $(".verity_input").removeAttr("readonly");;
|
|
|
+ $(".sendCode").attr("disabled","disabled");
|
|
|
+ $(".email_input").attr("readonly",true);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ EasyAlert.show(data.errMsg,"",3000)
|
|
|
+ if(data.errCode==2){
|
|
|
+ sendemailTimer(data.time);
|
|
|
+ $(".sendCode").attr("disabled","disabled");
|
|
|
+ $(".email_input").attr("readonly",true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },"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);
|
|
|
+ $(".email_input").parents('div.form-control').siblings().slideUp();
|
|
|
+ }else{
|
|
|
+ EasyAlert.show("验证码错误","",3000);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ $(".email_err_msg").hide();
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ //点击阅读条款
|
|
|
+ $(".weui-check").on("click", function () {
|
|
|
+ if($(this).is(":checked")){
|
|
|
+ readClause=true;
|
|
|
+ if(finishEmailVerity&&finishPhoneVerity){
|
|
|
+ $(".toPay").removeAttr("disabled")
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ readClause=false;
|
|
|
+ $(".toPay").attr("disabled","disabled");
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ //数据浏览
|
|
|
+ $(".dataPreview").on("click",function(){
|
|
|
+ if(previewDataTime<50){
|
|
|
+ previewDataTime++
|
|
|
+ window.open("/jyapp/front/wx_dataExport/toPreview/"+{{.T._id}});
|
|
|
+ }else{
|
|
|
+ EasyAlert.show("预览数据次数超出今日上限!","",3000);
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ //确认支付
|
|
|
+ $(".toPay").on("click",function(){
|
|
|
+ if(!finishEmailVerity||!readClause||!canpay||!finishPhoneVerity){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ $(".loading_").show();
|
|
|
+ canpay=false;
|
|
|
+
|
|
|
+ var param={};
|
|
|
+ param.pay_way="weixin";
|
|
|
+ param.data_spec=dataType==2?"senior":"standard";
|
|
|
+ param.id={{.T._id}}
|
|
|
+ param.sourcePage="weixin"
|
|
|
+ //先去创建预支付订单
|
|
|
+ $.post("/weixin/sacnPay/createOrder",param,function(data){
|
|
|
+ //alert(JSON.stringify(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;
|
|
|
+ //------
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ canpay=true;
|
|
|
+ EasyAlert.show("生成订单出错,请稍后尝试!","",3000);
|
|
|
+ }
|
|
|
+ $(".loading_").hide();
|
|
|
+ },"json");
|
|
|
+
|
|
|
+ })
|
|
|
+ })
|
|
|
+ //倒计时
|
|
|
+ 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();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+ </body>
|
|
|
+</html>
|