wangshan 4 lat temu
rodzic
commit
373e7ab254

+ 15 - 0
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_order_detail.js

@@ -29,6 +29,7 @@ $(function () {
             }
             //价格
             $(".price").text("¥ " + formatMoney(parseFloat(r.data.order.original_price) / 100) + "元");
+            $(".totalPrice").text("¥ " + formatMoney(parseFloat(r.data.order.original_price) / 100) + "元");
             if (!r.data.order.isLiveActive) {
                 $(".origin-price-container").hide();
             } else {
@@ -268,6 +269,12 @@ $(function () {
                 }
             }
             if (r.data.order.order_status == 0) {
+                if (r.data.order.discount_price&&r.data.order.discount_price>0){
+                  var totalPrice = Number(r.data.order.discount_price)+Number(r.data.order.original_price);
+                  $(".totalPrice").text('¥'+ formatMoney(totalPrice / 100)+'元')
+                  $(".discountPrice").text('-¥'+ formatMoney(parseFloat(r.data.order.discount_price) / 100)+'元')
+                }
+                $(".payPrice").text("¥ " + formatMoney(parseFloat(r.data.order.original_price) / 100) + "元");
                 //未支付
                 $("#card-header-bg").addClass("bg nopay-bg")
                 $("#pageTitle").addClass("status")
@@ -315,6 +322,12 @@ $(function () {
                 var pay_now = "<button class=\"j-button-confirm\" style='width: 100%!important;' onclick=choosePayWay()>去支付</button>"
                 $(".j-footer").show().html(pay_now)
             } else if (r.data.order.order_status == 1) {
+                if (r.data.order.discount_price&&r.data.order.discount_price>0){
+                  var totalPrice = Number(r.data.order.discount_price)+Number(r.data.order.original_price);
+                  $(".totalPrice").text('¥'+ formatMoney(totalPrice / 100)+'元')
+                  $(".discountPrice").text('-¥'+ formatMoney(parseFloat(r.data.order.discount_price) / 100)+'元')
+                }
+                $(".payPrice").text("¥ " + formatMoney(parseFloat(r.data.order.original_price) / 100) + "元");
                 $("#card-header-bg").addClass("bg finish-bg")
                 $("#pageTitle").addClass("status")
                 $("#pageTitle").text("已完成");
@@ -390,6 +403,8 @@ $(function () {
                 $("#pageTitle").addClass("status")
                 $("#pageTitle").text("已取消");
                 $(".invoice").css("display", "none");//隐藏开发票
+                $(".payPrice").parent().hide();
+                $(".discountPrice").parent().hide();
             }
         }
 

+ 153 - 132
src/jfw/modules/app/src/web/templates/commonPay/integral/integralDetail.html

@@ -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()'>&nbsp;查看凭证</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()'>&nbsp;查看凭证</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()'>&nbsp;查看凭证</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()'>&nbsp;查看凭证</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");

+ 18 - 5
src/jfw/modules/app/src/web/templates/dataExport/dataExport_toOrderDetail.html

@@ -601,12 +601,17 @@
                             <span class="label">数据量:</span>
                             <span class="value">{{.T.o.data_count}}条</span>
                         </p>
+                        <p class="l-item">
+                            <span class="label">商品总价:</span>
+                            <span class="value totalPrice">-</span>
+                        </p>
+                        <p class="l-item">
+                            <span class="label">优惠金额:</span>
+                            <span class="value discountPrice" style="color: #FB483D;">-</span>
+                        </p>
                         <p class="l-item">
                             <span class="label">实付金额:</span>
-                            <span class="value">¥ <script>
-											document.write(FormatNum({{.T.o.order_money}}))
-										</script>
-											元</span>
+                            <span class="value payPrice">-</span>
                         </p>
                         <p class="l-item">
                             <span class="label">邮箱地址:</span>
@@ -666,7 +671,13 @@
                 data: {"order_code": order_},
                 success: function (r) {
                     if (r.status == "success") {
+                        var totalPrice = r.data.order_money
                         if (r.data.order_status != -2 && r.data.order_status != -3) {
+                            if (r.data.discount_price&&r.data.discount_price>0){
+                              totalPrice = Number(r.data.discount_price)+Number(r.data.order_money)
+                              $(".discountPrice").text('-¥'+FormatNum(r.data.discount_price)+'元')
+                            }
+                            $(".payPrice").text('¥'+FormatNum(r.data.pay_money)+'元')
                             if (r.data.order_status == 1) {
                                 var finish_html = '<div class="bg finish-bg"><h3 class="status">已完成</h3></div>'
                                 $(".order-main").before(finish_html)
@@ -696,8 +707,10 @@
                                 '\t</div>'
                             $(".order-main").before(cancel_html)
                             $(".j-footer").append(buy_again)
+                            $(".payPrice").parent().hide();
+                            $(".discountPrice").parent().hide();
                         }
-
+                        $(".totalPrice").text('¥'+FormatNum(totalPrice)+'元')
                     }
                 }
             })

+ 9 - 1
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_order_detail.html

@@ -115,9 +115,17 @@
 											<span class="label">产品类型:</span>
 											<span class="productType value">超级订阅</span>
 										</p>
+                    <p class="l-item">
+                        <span class="label">商品总价:</span>
+                        <span class="totalPrice value">-</span>
+                    </p>
+                    <p class="l-item">
+                        <span class="label">优惠金额:</span>
+                        <span class="discountPrice value" style="color: #FB483D;">-</span>
+                    </p>
 										<p class="l-item">
 											<span class="label" id="price">实付金额:</span>
-											<span class="price value"></span><em class="qingdan valuationList" style="display:none">计费清单</em>
+											<span class="payPrice value"></span><em class="qingdan valuationList" style="display:none">计费清单</em>
 										</p>
 									</div>
 								</div>

+ 7 - 0
src/jfw/modules/subscribepay/src/service/invoice.go

@@ -824,6 +824,13 @@ func (this *Invoice) Invoiceinfo() {
 		if (*status)["d_relation_id"] != "" {
 			(*status)["userLotteryId"] = qutil.SE.Encode2Hex(qutil.ObjToString((*status)["d_relation_id"]))
 		}
+		(*status)["order_money"] = float64((*status)["order_money"].(int64)) / 100
+		if (*status)["discount_price"] != nil && (*status)["discount_price"].(int64) > 0 {
+			(*status)["discount_price"] = float64((*status)["discount_price"].(int64)) / 100
+		}
+		if (*status)["pay_money"] != nil && (*status)["pay_money"].(int64) > 0 {
+			(*status)["pay_money"] = float64((*status)["pay_money"].(int64)) / 100
+		}
 		delete((*status), "d_relation_id")
 		(*status)["countdown"] = countdowntime
 		this.ServeJson(map[string]interface{}{

+ 2 - 0
src/jfw/modules/subscribepay/src/service/orderListDetails.go

@@ -563,11 +563,13 @@ func (o *OrderListDetails) SetRes(res []map[string]interface{}, queryM map[strin
 			v["filter_id"] = qutil.SE.Encode2Hex(v["filter_id"].(string))
 		}
 		orderMoney := v["order_money"]
+		discount_price := v["discount_price"]
 		if orderMoney != nil {
 			if v["pay_way"] == "transferAccounts" && qutil.IntAll(v["order_status"]) == 1 { //对公转账 订单金额展示为实付金额
 				v["order_money"] = float64(qutil.Int64All(v["pay_money"])) / 100
 			} else {
 				v["order_money"] = float64(orderMoney.(int64)) / 100
+				v["discount_price"] = float64(discount_price.(int64)) / 100
 			}
 		}
 		/*if v["id"] != nil && v["order_money"] != nil && v["order_code"] != nil {

+ 144 - 127
src/web/templates/weixin/commonPay/integral/integralDetail.html

@@ -83,7 +83,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">
@@ -128,9 +128,17 @@
                             <span class="label">支付单号:</span>
                             <span class="transaction_id 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="value price"></span>
+                            <span class="value price">-</span>
                         </p>
                     </div>
                 </div>
@@ -167,139 +175,148 @@
                 }
                 //价格
                 var priceText = "¥ " + formatMoney((r.data.order_money / 100))
-                if (r.data.order_status == 1) {
-                    priceText = "¥ " + formatMoney((r.data.pay_money / 100));
-                }
                 $(".price").text(priceText);
+                $(".order_price").text(priceText);
                 $(".count_value").text(formatMoney(filterObj.score) + "枚");
-            }
-            //
-            if (r.data.order_status == 1) {
-                $("#card-header-bg").addClass("bg finish-bg")
-                $("#pageTitle").addClass("status")
-                $("#pageTitle").text("已完成");
-
-                //有效周期
-                $(".line_cycle").css("display", "");
-
-                var pay_again = ""
-                //发票
-                if (r.data.applybill_status === 0) {
-                    //已支付未申请发票
-                    pay_again += "<button class=\"j-button-cancel\" onclick='invoiceAdd()'>开发票</button>"
-                } else if (r.data.applybill_status === 1 || r.data.applybill_status === 2) {
-                    //已支付已申请发票
-                    pay_again += "<button class=\"j-button-cancel\" 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()'>&nbsp;查看凭证</span>");
+                //
+                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", "");
+    
+                    var pay_again = ""
+                    //发票
+                    if (r.data.applybill_status === 0) {
+                        //已支付未申请发票
+                        pay_again += "<button class=\"j-button-cancel\" onclick='invoiceAdd()'>开发票</button>"
+                    } else if (r.data.applybill_status === 1 || r.data.applybill_status === 2) {
+                        //已支付已申请发票
+                        pay_again += "<button class=\"j-button-cancel\" 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()'>&nbsp;查看凭证</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
                     }
-                    $(".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", "");
-                $(".price").text("¥ " + formatMoney(r.data.pay_money / 100) + "元");
-                if (r.data.pay_time) {
-                    $(".line_paytime").css("display", "");
-                    $(".payTime").text(r.data.pay_time.replace("-", ".").replace("-", "."));
-                }
-
-                $(".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") {
                     $(".l-item.paymoney").css("display", "");
-                    $(".paymoney .price").text("-");
-                    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;' >再次支付</button>").on("click", function () {
-                            window.location.href = "/weixin/pay/checkout_member?orderCode=" + orderCode;
-                        })
+                    $(".price").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) + "元");
                     }
-                    if (filterObj.transferV) {
-                        initImgView(filterObj.transferV)
-                        $(".payWay").html("公对公转账<span style='color: #2ABED1' onclick='showImg()'>&nbsp;查看凭证</span>");
+                    if (r.data.pay_time) {
+                        $(".line_paytime").css("display", "");
+                        $(".payTime").text(r.data.pay_time.replace("-", ".").replace("-", "."));
                     }
-                    $(".line_payway").css("display", "");
-                    return
+    
+                    $(".line_transaction").css("display", "");
+                    if (r.data.prepay_id) $(".transaction_id").text(r.data.prepay_id);
+    
                 }
-
-                $("#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)
+                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) + "元");
                     }
-                }, 1000)
-                $(".invoice").hide();//隐藏开发票
-                $(".j-footer").show().html("<button class='j-button-confirm' style='width: 100%!important;' >去支付</button>").on("click", function () {
-                    window.location.href = "/weixin/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.pay_way === "transferAccounts") {
+                        $(".l-item.paymoney").css("display", "");
+                        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;' >再次支付</button>").on("click", function () {
+                                window.location.href = "/weixin/pay/checkout_member?orderCode=" + orderCode;
+                            })
+                        }
+                        if (filterObj.transferV) {
+                            initImgView(filterObj.transferV)
+                            $(".payWay").html("公对公转账<span style='color: #2ABED1' onclick='showImg()'>&nbsp;查看凭证</span>");
+                        }
+                        $(".line_payway").css("display", "");
+                        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;' >去支付</button>").on("click", function () {
+                        window.location.href = "/weixin/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");//隐藏开发票
+                    $(".paymoney").hide();
+                    $(".discountmoney").hide();
+                }
+                $(".totalprice").text(priceText);
             }
         })
 

+ 18 - 5
src/web/templates/weixin/dataExport/dataExport_toOrderDetail.html

@@ -438,12 +438,17 @@
                             <span class="label">数据量:</span>
                             <span class="value">{{.T.o.data_count}}条</span>
                         </p>
+                        <p class="l-item">
+                            <span class="label">商品总价:</span>
+                            <span class="value totalPrice">-</span>
+                        </p>
+                        <p class="l-item">
+                            <span class="label">优惠金额:</span>
+                            <span class="value discountPrice" style="color: #FB483D;">-</span>
+                        </p>
                         <p class="l-item">
                             <span class="label">实付金额:</span>
-                            <span class="value">¥ <script>
-									document.write(FormatNum({{.T.o.order_money}}))
-								</script>
-									元</span>
+                            <span class="value payPrice">-</span>
                         </p>
                         <p class="l-item">
                             <span class="label">邮箱地址:</span>
@@ -476,7 +481,13 @@
                 success: function (r) {
                     console.log("rr", r)
                     if (r.status == "success") {
+                        var totalPrice = r.data.order_money
                         if (r.data.order_status != -2 && r.data.order_status != -3) {
+                            if (r.data.discount_price&&r.data.discount_price>0){
+                              totalPrice = Number(r.data.discount_price)+Number(r.data.order_money)
+                              $(".discountPrice").text('-¥'+FormatNum(r.data.discount_price)+'元')
+                            }
+                            $(".payPrice").text('¥'+FormatNum(r.data.pay_money)+'元')
                             if (r.data.order_status == 1) {
                                 var finish_html = '<div class="bg finish-bg"><h3 class="status">已完成</h3></div>'
                                 $(".order-main").before(finish_html)
@@ -506,8 +517,10 @@
                                 '\t</div>'
                             $(".order-main").before(cancel_html)
                             $(".j-footer").append(buy_again)
+                            $(".payPrice").parent().hide();
+                            $(".discountPrice").parent().hide();
                         }
-
+                        $(".totalPrice").text('¥'+FormatNum(totalPrice)+'元')
                     }
                 }
             })

+ 24 - 1
src/web/templates/weixin/vipsubscribe/vip_order_detail.html

@@ -138,9 +138,17 @@
                             <span class="label">产品类型:</span>
                             <span class="productType value">超级订阅</span>
                         </p>
+                        <p class="l-item">
+                            <span class="label">商品总价:</span>
+                            <span class="totalPrice value">-</span>
+                        </p>
+                        <p class="l-item">
+                            <span class="label">优惠金额:</span>
+                            <span class="discountPrice value" style="color: #FB483D;">-</span>
+                        </p>
                         <p class="l-item">
                             <span class="label" id="price">实付金额:</span>
-                            <span class="price value"></span><em class="qingdan valuationList"
+                            <span class="payPrice value">-</span><em class="qingdan valuationList"
                                                                  style="display:none">计费清单</em>
                         </p>
                     </div>
@@ -208,6 +216,7 @@
                 }
                 //价格
                 $(".price").text("¥ " + formatMoney(parseFloat(r.data.order.original_price) / 100) + "元");
+                $(".totalPrice").text("¥ " + formatMoney(parseFloat(r.data.order.original_price) / 100) + "元");
 
                 //优惠码
                 if (r.data.order.isUsedActiveCode) {
@@ -518,6 +527,12 @@
                 }
 
                 if (r.data.order.order_status == 0) {
+                    if (r.data.order.discount_price&&r.data.order.discount_price>0){
+                      var totalPrice = Number(r.data.order.discount_price)+Number(r.data.order.original_price);
+                      $(".totalPrice").text('¥'+ formatMoney(totalPrice / 100)+'元')
+                      $(".discountPrice").text('-¥'+ formatMoney(parseFloat(r.data.order.discount_price) / 100)+'元')
+                    }
+                    $(".payPrice").text("¥ " + formatMoney(parseFloat(r.data.order.original_price) / 100) + "元");
                     //未支付
                     $("#card-header-bg").addClass("bg nopay-bg")
                     $("#pageTitle").addClass("status")
@@ -579,6 +594,12 @@
                         window.location.href = "/weixin/pay/checkout_subvip?orderCode=" + orderCode + "&t=" + vipType
                     })
                 } else if (r.data.order.order_status == 1) {
+                    if (r.data.order.discount_price&&r.data.order.discount_price>0){
+                      var totalPrice = Number(r.data.order.discount_price)+Number(r.data.order.original_price);
+                      $(".totalPrice").text('¥'+ formatMoney(totalPrice / 100)+'元')
+                      $(".discountPrice").text('-¥'+ formatMoney(parseFloat(r.data.order.discount_price) / 100)+'元')
+                    }
+                    $(".payPrice").text("¥ " + formatMoney(parseFloat(r.data.order.original_price) / 100) + "元");
                     $("#card-header-bg").addClass("bg finish-bg")
                     $("#pageTitle").addClass("status")
                     $("#pageTitle").text("已完成");
@@ -630,6 +651,8 @@
                     $("#pageTitle").addClass("status")
                     $("#pageTitle").text("已取消");
                     $(".invoice").css("display", "none");//隐藏开发票
+                    $(".payPrice").parent().hide();
+                    $(".discountPrice").parent().hide();
                 }
             }
             //计价清单