|
@@ -79,7 +79,7 @@
|
|
|
</div>
|
|
|
<div class="order-name">
|
|
|
<p class="o-name"></p>
|
|
|
- <p class="o-price price"></p>
|
|
|
+ <p class="o-price order_price"></p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="middle">
|
|
@@ -123,9 +123,17 @@
|
|
|
<span class="label">产品类型:</span>
|
|
|
<span class="value">剑鱼币</span>
|
|
|
</p>
|
|
|
+ <p class="l-item totalmoney">
|
|
|
+ <span class="label" id="price">商品总价:</span>
|
|
|
+ <span class="value totalprice">-</span>
|
|
|
+ </p>
|
|
|
+ <p class="l-item discountmoney">
|
|
|
+ <span class="label" id="price">优惠金额:</span>
|
|
|
+ <span class="value discountprice" style="color: #FB483D;">-</span>
|
|
|
+ </p>
|
|
|
<p class="l-item paymoney">
|
|
|
<span class="label" id="price">实付金额:</span>
|
|
|
- <span class="price value"></span>
|
|
|
+ <span class="price value">-</span>
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -174,145 +182,158 @@
|
|
|
}
|
|
|
//价格
|
|
|
var priceText = "¥ " + formatMoney((r.data.order_money / 100));
|
|
|
- ;
|
|
|
- if (r.data.order_status == 1) {
|
|
|
- priceText = "¥ " + formatMoney((r.data.pay_money / 100));
|
|
|
- }
|
|
|
$(".price").text(priceText);
|
|
|
- }
|
|
|
- //
|
|
|
- //
|
|
|
-
|
|
|
- if (r.data.order_status === 1) {
|
|
|
- $("#card-header-bg").addClass("bg finish-bg")
|
|
|
- $("#pageTitle").addClass("status")
|
|
|
- $("#pageTitle").text("已完成");
|
|
|
-
|
|
|
- //有效周期
|
|
|
- $(".line_cycle").css("display", "");
|
|
|
- console.log(r.data.pay_way, r.data.course_status, r.data.pay_way === "transferAccounts", r.data.course_status === 4)
|
|
|
-
|
|
|
- var pay_again = ""
|
|
|
- //发票
|
|
|
- if (r.data.applybill_status === 0) {
|
|
|
- //已支付未申请发票
|
|
|
- pay_again += "<button class=\"j-button-cancel\" style=\"width: 100%!important;height: 0.92rem!important;\"; onclick='invoiceAdd()'>开发票</button>"
|
|
|
- } else if (r.data.applybill_status === 1 || r.data.applybill_status === 2) {
|
|
|
- //已支付已申请发票
|
|
|
- pay_again += "<button class=\"j-button-cancel\" style=\"width: 100%!important;height: 0.92rem!important;\" onclick='checkinvoice(" + r.data.applybill_status + ")'>查看发票</button>"
|
|
|
- }
|
|
|
- $('.j-footer').show().html(pay_again);
|
|
|
-
|
|
|
- //支付方式
|
|
|
- if (r.data.pay_way.indexOf("wx") > -1) {
|
|
|
- $(".line_payway").css("display", "");
|
|
|
- $(".payWay").text("微信支付");
|
|
|
- } else if (r.data.pay_way.indexOf("ali") > -1) {
|
|
|
- $(".payWay").text("支付宝支付");
|
|
|
- $(".line_payway").css("display", "");
|
|
|
- } else if (r.data.pay_way === "transferAccounts") {//试用用户
|
|
|
- if (filterObj.transferV) {
|
|
|
- initImgView(filterObj.transferV)
|
|
|
- $(".payWay").html("公对公转账<span style='color: #2ABED1' onclick='showImg()'> 查看凭证</span>");
|
|
|
+ //if (r.data.order_status == 1) {
|
|
|
+ // priceText = "¥ " + formatMoney((r.data.pay_money / 100));
|
|
|
+ //}
|
|
|
+ $(".order_price").text(priceText);
|
|
|
+ if (r.data.order_status === 1) {
|
|
|
+ $("#card-header-bg").addClass("bg finish-bg")
|
|
|
+ $("#pageTitle").addClass("status")
|
|
|
+ $("#pageTitle").text("已完成");
|
|
|
+ priceText = "¥ " + formatMoney((r.data.pay_money / 100));
|
|
|
+ //有效周期
|
|
|
+ $(".line_cycle").css("display", "");
|
|
|
+ console.log(r.data.pay_way, r.data.course_status, r.data.pay_way === "transferAccounts", r.data.course_status === 4)
|
|
|
+
|
|
|
+ var pay_again = ""
|
|
|
+ //发票
|
|
|
+ if (r.data.applybill_status === 0) {
|
|
|
+ //已支付未申请发票
|
|
|
+ pay_again += "<button class=\"j-button-cancel\" style=\"width: 100%!important;height: 0.92rem!important;\"; onclick='invoiceAdd()'>开发票</button>"
|
|
|
+ } else if (r.data.applybill_status === 1 || r.data.applybill_status === 2) {
|
|
|
+ //已支付已申请发票
|
|
|
+ pay_again += "<button class=\"j-button-cancel\" style=\"width: 100%!important;height: 0.92rem!important;\" onclick='checkinvoice(" + r.data.applybill_status + ")'>查看发票</button>"
|
|
|
}
|
|
|
- $(".line_payway").css("display", "");
|
|
|
-
|
|
|
+ $('.j-footer').show().html(pay_again);
|
|
|
+
|
|
|
+ //支付方式
|
|
|
+ if (r.data.pay_way.indexOf("wx") > -1) {
|
|
|
+ $(".line_payway").css("display", "");
|
|
|
+ $(".payWay").text("微信支付");
|
|
|
+ } else if (r.data.pay_way.indexOf("ali") > -1) {
|
|
|
+ $(".payWay").text("支付宝支付");
|
|
|
+ $(".line_payway").css("display", "");
|
|
|
+ } else if (r.data.pay_way === "transferAccounts") {//试用用户
|
|
|
+ if (filterObj.transferV) {
|
|
|
+ initImgView(filterObj.transferV)
|
|
|
+ $(".payWay").html("公对公转账<span style='color: #2ABED1' onclick='showImg()'> 查看凭证</span>");
|
|
|
+ }
|
|
|
+ $(".line_payway").css("display", "");
|
|
|
+
|
|
|
+ $(".l-item.paymoney").css("display", "");
|
|
|
+ $(".price").text("¥ " + formatMoney(r.data.pay_money / 100) + "元");
|
|
|
+ return
|
|
|
+ } else {//试用用户
|
|
|
+ $(".invoice").css("display", "none");
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
$(".l-item.paymoney").css("display", "");
|
|
|
+ $(".totalprice").text(priceText)
|
|
|
+ if (r.data.discount_price&&r.data.discount_price>0){
|
|
|
+ var totalmoney = Number(r.data.pay_money)+Number(r.data.discount_price)
|
|
|
+ priceText = "¥ " + formatMoney(totalmoney / 100) + "元";
|
|
|
+ $(".discountprice").text("-¥ " + formatMoney(r.data.discount_price/100) + "元");
|
|
|
+ }
|
|
|
$(".price").text("¥ " + formatMoney(r.data.pay_money / 100) + "元");
|
|
|
- return
|
|
|
- } else {//试用用户
|
|
|
- $(".invoice").css("display", "none");
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- $(".l-item.paymoney").css("display", "");
|
|
|
- $(".price").text("¥ " + formatMoney(r.data.pay_money / 100) + "元");
|
|
|
-
|
|
|
- if (r.data.pay_time) {
|
|
|
- $(".line_paytime").css("display", "");
|
|
|
- $(".payTime").css("display", "").text(r.data.pay_time.replace("-", "/").replace("-", "/"));
|
|
|
+ if (r.data.pay_time) {
|
|
|
+ $(".line_paytime").css("display", "");
|
|
|
+ $(".payTime").css("display", "").text(r.data.pay_time.replace("-", "/").replace("-", "/"));
|
|
|
+ }
|
|
|
+
|
|
|
+ $(".line_transaction").css("display", "");
|
|
|
+ if (r.data.prepay_id) $(".transaction_id").text(r.data.prepay_id);
|
|
|
}
|
|
|
-
|
|
|
- $(".line_transaction").css("display", "");
|
|
|
- if (r.data.prepay_id) $(".transaction_id").text(r.data.prepay_id);
|
|
|
- }
|
|
|
- if (r.data.order_status == 0) {
|
|
|
- //未支付
|
|
|
- $("#card-header-bg").addClass("bg nopay-bg")
|
|
|
- $("#pageTitle").addClass("status")
|
|
|
-
|
|
|
- if (r.data.pay_way === "transferAccounts") {
|
|
|
- if (r.data.course_status === 2) {
|
|
|
- $("#pageTitle").text("转账审核中");
|
|
|
- } else if (r.data.course_status === 3) {
|
|
|
- $("#pageTitle").text("未收到转账");
|
|
|
- $(".remaining").show().text("客服电话:400-108-6670")
|
|
|
-
|
|
|
- $(".j-footer").show().html("<button class='j-button-confirm' style='width: 100%!important;height: 0.92rem!important;' >再次支付</button>").on("click", function () {
|
|
|
- window.location.href = "/jyapp/pay/checkout_integral?orderCode=" + orderCode;
|
|
|
- })
|
|
|
+ if (r.data.order_status == 0) {
|
|
|
+ //未支付
|
|
|
+ $("#card-header-bg").addClass("bg nopay-bg")
|
|
|
+ $("#pageTitle").addClass("status")
|
|
|
+
|
|
|
+ if (r.data.discount_price&&r.data.discount_price>0){
|
|
|
+ var totalmoney = Number(r.data.pay_money)+Number(r.data.discount_price)
|
|
|
+ priceText = "¥ " + formatMoney(totalmoney / 100) + "元";
|
|
|
+ $(".discountprice").text("-¥ " + formatMoney(r.data.discount_price/100) + "元");
|
|
|
}
|
|
|
- if (filterObj.transferV) {
|
|
|
- initImgView(filterObj.transferV)
|
|
|
- $(".payWay").html("公对公转账<span style='color: #2ABED1' onclick='showImg()'> 查看凭证</span>");
|
|
|
+ if (r.data.pay_way === "transferAccounts") {
|
|
|
+ if (r.data.course_status === 2) {
|
|
|
+ $("#pageTitle").text("转账审核中");
|
|
|
+ } else if (r.data.course_status === 3) {
|
|
|
+ $("#pageTitle").text("未收到转账");
|
|
|
+ $(".remaining").show().text("客服电话:400-108-6670")
|
|
|
+
|
|
|
+ $(".j-footer").show().html("<button class='j-button-confirm' style='width: 100%!important;height: 0.92rem!important;' >再次支付</button>").on("click", function () {
|
|
|
+ window.location.href = "/jyapp/pay/checkout_integral?orderCode=" + orderCode;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (filterObj.transferV) {
|
|
|
+ initImgView(filterObj.transferV)
|
|
|
+ $(".payWay").html("公对公转账<span style='color: #2ABED1' onclick='showImg()'> 查看凭证</span>");
|
|
|
+ }
|
|
|
+ $(".line_payway").css("display", "");
|
|
|
+
|
|
|
+ $(".l-item.paymoney").css("display", "");
|
|
|
+ $(".paymoney .price").text("-");
|
|
|
+ return
|
|
|
}
|
|
|
- $(".line_payway").css("display", "");
|
|
|
-
|
|
|
- $(".l-item.paymoney").css("display", "");
|
|
|
- $(".paymoney .price").text("-");
|
|
|
- return
|
|
|
+
|
|
|
+ $("#pageTitle").text("待付款");
|
|
|
+ $(".remaining").show()
|
|
|
+ var order_create_time = r.data.create_time
|
|
|
+ order_create_time = order_create_time.replace(/-/g, '/')
|
|
|
+ var downtime = r.data.order_countdown.split("h")[0]
|
|
|
+ downtime = downtime * 60 * 60 * 1000
|
|
|
+ var create_unix = new Date(order_create_time).getTime();
|
|
|
+ var t = setInterval(() => {
|
|
|
+ var nowtime = new Date() //获取当前时间
|
|
|
+ endtime = new Date(order_create_time); //定义结束时间
|
|
|
+ var lefttime = endtime.getTime() + downtime - nowtime.getTime() //距离结束时间的毫秒数
|
|
|
+ if (Math.floor(lefttime % 1000) <= 0) {
|
|
|
+ clearInterval(t)
|
|
|
+ $.ajax({
|
|
|
+ type: "post",
|
|
|
+ url: "/subscribepay/orderListDetails/deleteOrder",
|
|
|
+ data: {
|
|
|
+ "id": r.data.order.id,
|
|
|
+ "pageNum": 1,
|
|
|
+ "type": 1,
|
|
|
+ "cancel": "cancel"
|
|
|
+ },
|
|
|
+ dataType: 'json',
|
|
|
+ success: function () {
|
|
|
+ $(".nopay-bg h3").text("已取消")
|
|
|
+ $(".remaining").text("")
|
|
|
+ $(".nopay-bg").removeClass("nopay-bg").addClass("cancel-bg")
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ var hour = Math.floor(lefttime / (1000 * 60 * 60)), //计算小时数
|
|
|
+ hour = hour < 10 ? '0' + hour : hour;
|
|
|
+ var minute = Math.floor(lefttime / (1000 * 60) % 60), //计算分钟数
|
|
|
+ minute = minute < 10 ? '0' + minute : minute;
|
|
|
+ var seconds = Math.floor(lefttime / 1000 % 60); //计算秒数
|
|
|
+ seconds = seconds < 10 ? '0' + seconds : seconds;
|
|
|
+ $(".remaining").text("剩余支付时间" + hour + ":" + minute + ":" + seconds)
|
|
|
+ }
|
|
|
+ }, 1000)
|
|
|
+ $(".invoice").hide();//隐藏开发票
|
|
|
+ $(".j-footer").show().html("<button class='j-button-confirm' style='width: 100%!important;height: 0.92rem!important;' >去支付</button>").on("click", function () {
|
|
|
+ window.location.href = "/jyapp/pay/checkout_integral?orderCode=" + orderCode;
|
|
|
+ })
|
|
|
}
|
|
|
-
|
|
|
- $("#pageTitle").text("待付款");
|
|
|
- $(".remaining").show()
|
|
|
- var order_create_time = r.data.create_time
|
|
|
- order_create_time = order_create_time.replace(/-/g, '/')
|
|
|
- var downtime = r.data.order_countdown.split("h")[0]
|
|
|
- downtime = downtime * 60 * 60 * 1000
|
|
|
- var create_unix = new Date(order_create_time).getTime();
|
|
|
- var t = setInterval(() => {
|
|
|
- var nowtime = new Date() //获取当前时间
|
|
|
- endtime = new Date(order_create_time); //定义结束时间
|
|
|
- var lefttime = endtime.getTime() + downtime - nowtime.getTime() //距离结束时间的毫秒数
|
|
|
- if (Math.floor(lefttime % 1000) <= 0) {
|
|
|
- clearInterval(t)
|
|
|
- $.ajax({
|
|
|
- type: "post",
|
|
|
- url: "/subscribepay/orderListDetails/deleteOrder",
|
|
|
- data: {
|
|
|
- "id": r.data.order.id,
|
|
|
- "pageNum": 1,
|
|
|
- "type": 1,
|
|
|
- "cancel": "cancel"
|
|
|
- },
|
|
|
- dataType: 'json',
|
|
|
- success: function () {
|
|
|
- $(".nopay-bg h3").text("已取消")
|
|
|
- $(".remaining").text("")
|
|
|
- $(".nopay-bg").removeClass("nopay-bg").addClass("cancel-bg")
|
|
|
- }
|
|
|
- })
|
|
|
- } else {
|
|
|
- var hour = Math.floor(lefttime / (1000 * 60 * 60)), //计算小时数
|
|
|
- hour = hour < 10 ? '0' + hour : hour;
|
|
|
- var minute = Math.floor(lefttime / (1000 * 60) % 60), //计算分钟数
|
|
|
- minute = minute < 10 ? '0' + minute : minute;
|
|
|
- var seconds = Math.floor(lefttime / 1000 % 60); //计算秒数
|
|
|
- seconds = seconds < 10 ? '0' + seconds : seconds;
|
|
|
- $(".remaining").text("剩余支付时间" + hour + ":" + minute + ":" + seconds)
|
|
|
- }
|
|
|
- }, 1000)
|
|
|
- $(".invoice").hide();//隐藏开发票
|
|
|
- $(".j-footer").show().html("<button class='j-button-confirm' style='width: 100%!important;height: 0.92rem!important;' >去支付</button>").on("click", function () {
|
|
|
- window.location.href = "/jyapp/pay/checkout_integral?orderCode=" + orderCode;
|
|
|
- })
|
|
|
- }
|
|
|
- if (r.data.order_status == -2 || r.data.order_status == -3) {
|
|
|
- $("#card-header-bg").addClass("bg cancel-bg")
|
|
|
- $("#pageTitle").addClass("status")
|
|
|
- $("#pageTitle").text("已取消");
|
|
|
- $(".invoice").css("display", "none");//隐藏开发票
|
|
|
+ if (r.data.order_status == -2 || r.data.order_status == -3) {
|
|
|
+ $("#card-header-bg").addClass("bg cancel-bg")
|
|
|
+ $("#pageTitle").addClass("status")
|
|
|
+ $("#pageTitle").text("已取消");
|
|
|
+ $(".invoice").css("display", "none");//隐藏开发票
|
|
|
+ $(".paymoney").hide();
|
|
|
+ $(".discountmoney").hide();
|
|
|
+ }
|
|
|
+ $(".totalprice").text(priceText);
|
|
|
}
|
|
|
+ //
|
|
|
+ //
|
|
|
+
|
|
|
})
|
|
|
$(".page.pinch-zoom-parent").on("click", function () {
|
|
|
$(this).css("display", "none");
|