|
@@ -0,0 +1,1553 @@
|
|
|
+<html>
|
|
|
+<head>
|
|
|
+ <title>我的订单</title>
|
|
|
+ <meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
|
+ <meta HTTP-EQUIV="pragma" CONTENT="no-cache">
|
|
|
+ <meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
|
|
|
+ <meta HTTP-EQUIV="expires" CONTENT="0">
|
|
|
+ <script src="{{Msg "seo" "cdn"}}/js/rem.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+ <script src="{{Msg "seo" "cdn"}}/js/jquery-3.2.1.min.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+ <script src="{{Msg "seo" "cdn"}}/js/dropload.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+ <script src="//cdn.bootcss.com/jquery-confirm/3.1.0/jquery-confirm.min.js"></script>
|
|
|
+ <script src="{{Msg "seo" "cdn"}}/wxswordfish/share.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+ {{include "/common/weixin.html"}}
|
|
|
+ <script src="{{Msg "seo" "cdn"}}/vipsubscribe/js/common.js"></script>
|
|
|
+ <script src="{{Msg "seo" "cdn"}}/vipsubscribe/js/weui.min.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+ <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wxCommonPay/css/weui.min.css?v={{Msg "seo" "version"}}">
|
|
|
+ <link rel="stylesheet" type="text/css"
|
|
|
+ href="{{Msg "seo" "cdn"}}/wx_dataExport/css/base_myorder.css?v={{Msg "seo" "version"}}"/>
|
|
|
+ <link rel="stylesheet" type="text/css"
|
|
|
+ href="{{Msg "seo" "cdn"}}/wxCommonPay/iconfont/iconfont.css?v={{Msg "seo" "version"}}"/>
|
|
|
+ <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_dataExport/css/order_list.css?v={{Msg "seo" "version"}}">
|
|
|
+ <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/css/dropload.css?v={{Msg "seo" "version"}}">
|
|
|
+ <link href="//cdn.bootcss.com/jquery-confirm/3.1.0/jquery-confirm.min.css" rel="stylesheet">
|
|
|
+ <!--2.8.8-->
|
|
|
+ <link rel="stylesheet" href="{{Msg "seo" "cdn"}}/wx_course/css/order_list.css?v={{Msg "seo" "version"}}">
|
|
|
+ <style>
|
|
|
+ #order_list .main .tabs .card .card-content .price {
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* vip订阅原价 */
|
|
|
+ .origin-price-container {
|
|
|
+ display: inline-block;
|
|
|
+ margin-top: .06rem;
|
|
|
+ margin-right: .1rem;
|
|
|
+ color: #9B9CA3;
|
|
|
+ font-size: .22rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ .origin-price-container .origin-price {
|
|
|
+ text-decoration: line-through;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+</head>
|
|
|
+<body>
|
|
|
+<!-- 加载数据-->
|
|
|
+<div class="loading_">
|
|
|
+ <p><span></span></p>
|
|
|
+</div>
|
|
|
+<div id="order_list" class="j-container">
|
|
|
+ <main class="main j-body">
|
|
|
+ <div class="buttons-tab">
|
|
|
+ <ul>
|
|
|
+ <li class="tab-link active">全部</li>
|
|
|
+ <li class="tab-link ">待付款</li>
|
|
|
+ <li class="tab-link ">已完成</li>
|
|
|
+ <li class="tab-link ">已取消</li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <div class="tabs">
|
|
|
+ <div class="tab active">
|
|
|
+ <div class="card_lists">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </main>
|
|
|
+</div>
|
|
|
+<!-- 取消购买弹窗 -->
|
|
|
+<div class="custom-dialog cancel_dialog" style="display: none;">
|
|
|
+ <div class="weui-mask weui-animate-fade-in"></div>
|
|
|
+ <div class="weui-dialog weui-animate-fade-in">
|
|
|
+ <div class="weui-dialog__hd"><strong class="weui-dialog__title">确定取消订单</strong></div>
|
|
|
+ <div class="weui-dialog__bd">确定取消订单,取消后无法恢复</div>
|
|
|
+ <div class="weui-dialog__ft">
|
|
|
+ <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_default" id="cancel_n">取消</a>
|
|
|
+ <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary" id="cancel_y">确定</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+<!-- 删除订单弹窗 -->
|
|
|
+<div class="custom-dialog delete_dialog" style="display: none;">
|
|
|
+ <div class="weui-mask weui-animate-fade-in"></div>
|
|
|
+ <div class="weui-dialog weui-animate-fade-in">
|
|
|
+ <div class="weui-dialog__hd"><strong class="weui-dialog__title">确定删除订单</strong></div>
|
|
|
+ <div class="weui-dialog__bd">确定删除订单,删除后无法恢复</div>
|
|
|
+ <div class="weui-dialog__ft">
|
|
|
+ <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_default" id="del_n">取消</a>
|
|
|
+ <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary" id="del_y">确定</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+<!-- 客服电话弹窗 -->
|
|
|
+<div class="jy-alert" style="display: none;">
|
|
|
+ <div class="weui-mask weui-animate-fade-in"></div>
|
|
|
+ <div class="weui-dialog weui-animate-fade-in">
|
|
|
+ <div class="weui-dialog__bd">客服电话:400-108-6670</div>
|
|
|
+ <div class="weui-dialog__ft">
|
|
|
+ <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_" onclick="phoneHide()">我知道了</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+<script src="{{Msg "seo" "cdn"}}/wx_dataExport/js/zepto.js?v={{Msg "seo" "version"}}"></script>
|
|
|
+<script>
|
|
|
+ var hasNextPage = false;
|
|
|
+ var pageIndex = 1;
|
|
|
+ var wxflag = "";
|
|
|
+ var scrollTop = 0;
|
|
|
+ var dataCache = new Array();
|
|
|
+ var count = 0;
|
|
|
+ var typ = 0;
|
|
|
+ var deleteIndex = 0;
|
|
|
+ var orderTabActive = 0;
|
|
|
+ initShare({{.T.signature}},{{.T.openid}}, 2, "jy_wxmyorder",{{.T.nickname}},{{.T.avatar}});
|
|
|
+
|
|
|
+ //时间格式化
|
|
|
+ function timestampToTime(timestamp) {
|
|
|
+ var date = new Date(timestamp * 1000);
|
|
|
+ Y = date.getFullYear() + '.';
|
|
|
+ M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '.';
|
|
|
+ D = date.getDate();
|
|
|
+ return Y + M + D;
|
|
|
+ }
|
|
|
+
|
|
|
+ //格式化数字
|
|
|
+ function toThousands(num) {
|
|
|
+ var num = (num || 0).toString(), result = '';
|
|
|
+ while (num.length > 3) {
|
|
|
+ result = ',' + num.slice(-3) + result;
|
|
|
+ num = num.slice(0, num.length - 3);
|
|
|
+ }
|
|
|
+ if (num) {
|
|
|
+ result = num + result;
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ function appendList(listhtml) {
|
|
|
+ $(".card_lists").append(listhtml);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ function setSessionStorage() {
|
|
|
+ sessionStorage.orderScrollTop = $(".main")[0].scrollTop;
|
|
|
+ sessionStorage.orderTabActive = $("ul .active").index();
|
|
|
+ sessionStorage.orderPageNum = parseInt(pageIndex) - 1;
|
|
|
+ sessionStorage.course_order_href = "true";
|
|
|
+ }
|
|
|
+
|
|
|
+ function onceMore(e) {
|
|
|
+ setSessionStorage();
|
|
|
+ var orderCode = $(e).parent(".card-footer").prev(".card-content").find("a").attr("eid");
|
|
|
+ window.location.href = "/front/wx_dataExport/toSieve?orderCode=" + orderCode;
|
|
|
+ }
|
|
|
+
|
|
|
+ //续费 1 再次购买 2
|
|
|
+ function renewalOrBuyAgain(pattern, e) {
|
|
|
+ setSessionStorage();
|
|
|
+ var orderCode = $(e).parent(".card-footer").prev(".card-content").find("a").attr("eid");
|
|
|
+ if (pattern === 1) {
|
|
|
+ window.location.href = "/front/vipsubscribe/vipsubscribe_renew?orderCode" + orderCode;
|
|
|
+ } else if (pattern === 2) {
|
|
|
+ window.location.href = "/front/vipsubscribe/vipsubscribe_new?orderCode=" + orderCode;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function deleteOrder(id, obj) {
|
|
|
+ typ = $("ul .active").index()
|
|
|
+ $('.delete_dialog').show();
|
|
|
+ $('#del_y').unbind("click").click(function () {
|
|
|
+ $(".loading_").show();
|
|
|
+ $.post("/subscribepay/orderListDetails/deleteOrder", {
|
|
|
+ "id": id,
|
|
|
+ "pageNum": pageIndex,
|
|
|
+ "type": typ,
|
|
|
+ "fromPage": "wx"
|
|
|
+ }, function (data) {
|
|
|
+ $(".loading_").hide();
|
|
|
+ if (data && data["success"]) {
|
|
|
+ var self = $(obj).parent().parent();
|
|
|
+ var parent = self.parent();
|
|
|
+ if (self.next().find("a").attr("courseOrder") === "true") {
|
|
|
+ self.parent().remove();
|
|
|
+ } else {
|
|
|
+ deleteIndex = self.index();
|
|
|
+ dataCache.splice(deleteIndex, 1)
|
|
|
+ //删除索引存入缓存
|
|
|
+ sessionStorage.setItem("deleteIndex", deleteIndex);
|
|
|
+ if (data.res != null) {
|
|
|
+ dataCache.push(data.res[0])
|
|
|
+ //hasNextPage=data.hasNextPage;
|
|
|
+ hasNextPage = data.nextPage;
|
|
|
+ }
|
|
|
+ self.parent().remove();
|
|
|
+ }
|
|
|
+ weui.toast('删除成功', {
|
|
|
+ duration: 1500,
|
|
|
+ className: 'j-toast',
|
|
|
+ callback: function () {
|
|
|
+ $(".loading_").show();
|
|
|
+ if ($(".card_lists").children("div").length == 0) {
|
|
|
+ nodataHtml = ""
|
|
|
+ nodataHtml += '<div style="text-align:center;">';
|
|
|
+ s
|
|
|
+ nodataHtml += '<img src="/wx_dataExport/images/fish.png" style="width: 2.8rem;height: 2.8rem;margin-top: 45%;">'
|
|
|
+ nodataHtml += '<div style="color: #888;font-size: .32rem;text-align:center;">暂无数据</div></div>'
|
|
|
+ $(".card_lists").append(nodataHtml);
|
|
|
+ $(".dropload-down").hide();
|
|
|
+ } else {//删除一条数据 往后铺一条数据
|
|
|
+ structureHtml(data.res, typ);
|
|
|
+ }//铺数据 end
|
|
|
+ if (parent.children("div").length < 10) {
|
|
|
+ $(".dropload-refresh").text("没有更多了");
|
|
|
+ }
|
|
|
+ $(".loading_").hide();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ alertS("删除失败,请联系管理员!");
|
|
|
+ }
|
|
|
+ }) //post end
|
|
|
+ $('.delete_dialog').hide()
|
|
|
+ })
|
|
|
+ $('#del_n').click(function () {
|
|
|
+ $('.delete_dialog').hide();
|
|
|
+ })
|
|
|
+
|
|
|
+ }//delete end
|
|
|
+
|
|
|
+ //取消订单
|
|
|
+ function cancelOrder(id, obj) {
|
|
|
+ typ = $("ul .active").index()
|
|
|
+ $('.cancel_dialog').show();
|
|
|
+ $("#cancel_y").unbind("click").click(function () {
|
|
|
+ $(".loading_").show();
|
|
|
+ $.post("/subscribepay/orderListDetails/deleteOrder", {
|
|
|
+ "id": id,
|
|
|
+ "pageNum": pageIndex,
|
|
|
+ "type": typ,
|
|
|
+ "cancel": "cancel",
|
|
|
+ "fromPage": "wx"
|
|
|
+ }, function (data) {
|
|
|
+ $(".loading_").hide();
|
|
|
+ if (data && data["success"]) {
|
|
|
+ weui.toast('取消成功', {
|
|
|
+ duration: 1500,
|
|
|
+ className: 'j-toast',
|
|
|
+ callback: function () {
|
|
|
+ $(".loading_").show();
|
|
|
+ if (typ === 1) {
|
|
|
+ var self = $(obj).parent().parent();
|
|
|
+ self.remove();
|
|
|
+ }
|
|
|
+ var self = $(obj).parent(".card-footer").prev(".card-content").prev(".card-header").children(".notpay");
|
|
|
+ self.css("color", "#686868");
|
|
|
+ var isVipOrder = $(obj).parent(".card-footer").prev(".card-content").children(".media").attr("isvipOrder");
|
|
|
+ var courseOrder = $(obj).parent(".card-footer").prev(".card-content").children(".media").attr("courseOrder");
|
|
|
+ var courseOnlineOrder = $(obj).parent(".card-footer").prev(".card-content").children(".media").attr("courseOnlineOrder");
|
|
|
+ var courseId = $(obj).parent(".card-footer").prev(".card-content").find("a").attr("eid");
|
|
|
+ //vip订单取消了没有再次购买
|
|
|
+ if (isVipOrder !== "true") {
|
|
|
+ if (courseOrder !== "true") {
|
|
|
+ self.children().remove();
|
|
|
+ self.removeClass("notpay").addClass("cancel_text").append('<span class="status-text">已取消</span><a class="delete_icon" title="删除订单" onclick="deleteOrder(' + id + ',this)"></a>');
|
|
|
+ if (courseOnlineOrder === "true") {
|
|
|
+ $(obj).parent(".card-footer").remove();
|
|
|
+ } else {
|
|
|
+ $(obj).parent(".card-footer").html('<a onclick="onceMore(this)" class="btn cancle">再次购买</a>')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $(obj).parent(".card-footer").html('<a href="/swordfish/course/detail/' + courseId + '" class="btn cancle">再次购买</a>')
|
|
|
+ self.children().remove()
|
|
|
+ self.removeClass("notpay").addClass("cancel_text").append('<span class="status-text">已取消</span><a class="delete_icon" title="删除订单" onclick="deleteOrder(' + id + ',this)"></a>');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ $(obj).parent().parent().remove();
|
|
|
+ $(".card_lists").empty();
|
|
|
+ queryOrder($("ul .active").index(), 10);
|
|
|
+ }
|
|
|
+
|
|
|
+ $(".loading_").hide();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ alertS("取消失败,请联系管理员!");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ $('.cancel_dialog').hide()
|
|
|
+ })
|
|
|
+ $('#cancel_n').click(function () {
|
|
|
+ $('.cancel_dialog').hide();
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function alertS(content) {
|
|
|
+ $.alert({
|
|
|
+ title: "",
|
|
|
+ content: content,
|
|
|
+ buttons: {
|
|
|
+ ok: {
|
|
|
+ text: '确定',
|
|
|
+ btnClass: 'btn-primary-2'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ clickFlag = true;
|
|
|
+ $(function () {
|
|
|
+ sessionStorage.removeItem("applysuccess");
|
|
|
+ sessionStorage.removeItem("companyName");
|
|
|
+ sessionStorage.removeItem("taxNumer");
|
|
|
+
|
|
|
+ $(".buttons-tab .tab-link").each(function () {
|
|
|
+ $(".loading_").hide();
|
|
|
+ var index = $(this).index();
|
|
|
+ $(".buttons-tab .tab-link").eq(0).addClass("active");
|
|
|
+ //
|
|
|
+ $(this).click(function () {
|
|
|
+ $(".loading_").show();
|
|
|
+ $(this).addClass("active").siblings().removeClass("active");
|
|
|
+ $(".tabs>.tab").eq(index).show().siblings().hide();
|
|
|
+ typ = $("ul .active").index();
|
|
|
+ $(".card_lists").empty();
|
|
|
+ queryOrder(index, 10);
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ //解决苹果手机里面的网页返回不刷新页面的问题
|
|
|
+ var browserRule = /^.*((iPhone)|(iPad)|(Safari))+.*$/;
|
|
|
+ if (browserRule.test(navigator.userAgent)) {
|
|
|
+ window.onpageshow = function (event) {
|
|
|
+ if (event.persisted) {
|
|
|
+ window.location.reload()
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+ if (sessionStorage.orderTabActive) {
|
|
|
+ $(".buttons-tab .tab-link").eq(sessionStorage.orderTabActive).addClass("active").siblings().removeClass("active");
|
|
|
+ typ = Number(sessionStorage.orderTabActive);
|
|
|
+ var orderPageNum = parseInt(sessionStorage.orderPageNum);
|
|
|
+ queryOrder(sessionStorage.orderTabActive, orderPageNum * 10);
|
|
|
+ sessionStorage.removeItem("orderPageNum");
|
|
|
+ sessionStorage.removeItem("orderTabActive");
|
|
|
+ if (sessionStorage.orderScrollTop) {
|
|
|
+ setTimeout(function () {
|
|
|
+ $(".main")[0].scrollTop = parseInt(sessionStorage.orderScrollTop);
|
|
|
+ }, 500)
|
|
|
+ setTimeout(function () {
|
|
|
+ sessionStorage.removeItem("orderScrollTop");
|
|
|
+ }, 2000)
|
|
|
+
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //后续版本用
|
|
|
+ var active = getParam("active");
|
|
|
+ if (active) {
|
|
|
+ $(".buttons-tab .tab-link").eq(active).addClass("active").siblings().removeClass("active");
|
|
|
+ $(".tabs>.tab").eq(active).show().siblings().hide();
|
|
|
+ $(".card_lists").empty();
|
|
|
+ queryOrder(active, 10);
|
|
|
+ } else {
|
|
|
+ queryOrder(0, 10);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ //查询订单ajax
|
|
|
+ //typ 0全部 1未支付 2已支付
|
|
|
+ function queryOrder(typ, page_size) {
|
|
|
+ var result = true;
|
|
|
+ $.post("/subscribepay/orderListDetails/myOrder", {
|
|
|
+ "type": typ,
|
|
|
+ "page_size": page_size,
|
|
|
+ "fromPage": "wx"
|
|
|
+ }, function (data) {
|
|
|
+ $(".loading_").hide();
|
|
|
+ var list = data.res;
|
|
|
+ dataCache = data.res;
|
|
|
+ if (page_size != 10) {
|
|
|
+ pageIndex = parseInt(page_size / 10) + 1;
|
|
|
+ } else {
|
|
|
+ pageIndex = 2;
|
|
|
+ }
|
|
|
+ hasNextPage = data.hasNextPage;
|
|
|
+ if (data.res && data.res.length > 0) {
|
|
|
+ structureHtml(data.res, typ);
|
|
|
+ } else {
|
|
|
+ result = false;
|
|
|
+ nodataHtml = ""
|
|
|
+ nodataHtml += '<div style="text-align:center;">';
|
|
|
+ nodataHtml += '<img src="/wx_dataExport/images/fish.png" style="width: 2.8rem;height: 2.8rem;margin-top: 45%;">'
|
|
|
+ nodataHtml += '<div style="color: #888;font-size: .32rem;text-align:center;">暂无数据</div></div>'
|
|
|
+ $(".card_lists").append(nodataHtml);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!result) {
|
|
|
+ $(".dropload-down").hide()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (hasNextPage) {
|
|
|
+ wxflag = $(' .main').dropload({
|
|
|
+ scrollArea: $(".main"),
|
|
|
+ loadDownFn: function (me) {
|
|
|
+ $.post('/subscribepay/orderListDetails/myOrder', {
|
|
|
+ "pageNum": pageIndex,
|
|
|
+ "type": typ,
|
|
|
+ "fromPage": "wx"
|
|
|
+ }, function (data) {
|
|
|
+ //没有数据
|
|
|
+ if (data.res == null || data.res.length == 0) {
|
|
|
+ noMoreData(me);
|
|
|
+ } else {
|
|
|
+ dataCache = dataCache.concat(data.res);
|
|
|
+ pageIndex++;
|
|
|
+ structureHtml(data.res, typ);
|
|
|
+ if (data.hasNextPage) {
|
|
|
+ // 每次数据插入,必须重置
|
|
|
+ me.resetload();
|
|
|
+ } else {
|
|
|
+ noMoreData(me);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ wxflag = $('.main').dropload({
|
|
|
+ scrollArea: window,
|
|
|
+ loadDownFn: function (me) {
|
|
|
+ if (wxflag == null) {
|
|
|
+ wxflag = me;
|
|
|
+ }
|
|
|
+ noMoreData(me);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ noMoreData(wxflag);
|
|
|
+ }
|
|
|
+ //},500)
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ function structureHtml(object, typ) {
|
|
|
+ var listhtml = '';
|
|
|
+ var psss = 0;
|
|
|
+ for (var index in object) {
|
|
|
+ var obj = object[index];
|
|
|
+ var isLiveActive = false;
|
|
|
+ if (obj.isLiveActive) {
|
|
|
+ isLiveActive = true;
|
|
|
+ }
|
|
|
+ if (obj.product_type === "历史数据") {
|
|
|
+ count++;
|
|
|
+ var id = obj.id;
|
|
|
+ //订单编号
|
|
|
+ var orderCode = obj.order_code;
|
|
|
+ //创建时间
|
|
|
+ var createTime = obj.create_time;
|
|
|
+ createTime = createTime.replace(/-/g, ".");
|
|
|
+ //选择时间
|
|
|
+ var publishTime = obj.filter_publishtime;
|
|
|
+ if (!publishTime) {
|
|
|
+ publishTime = "全部";
|
|
|
+ } else {
|
|
|
+ if (publishTime.length === 11) {
|
|
|
+ if (publishTime.slice(0, 1) !== "_") {
|
|
|
+ publishTime = timestampToTime(publishTime.slice(0, 10));
|
|
|
+ publishTime = publishTime + "-";
|
|
|
+ } else {
|
|
|
+ publishTime = timestampToTime(publishTime.slice(1, 11));
|
|
|
+ publishTime = publishTime + "前全部";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //1标准字段包 2高级字段包
|
|
|
+ var spec = obj.data_spec;
|
|
|
+ if (spec === 1) {
|
|
|
+ spec = "标准字段包";
|
|
|
+ } else if (spec === 2) {
|
|
|
+ spec = "高级字段包";
|
|
|
+ }
|
|
|
+ //订单总数
|
|
|
+ var data_count = obj.data_count;
|
|
|
+ //订单金额
|
|
|
+ var orderMoney = obj.order_money;
|
|
|
+ //金额格式化 小数点前 1,000
|
|
|
+ orderMoney = orderMoney + "";
|
|
|
+ orderMoney_1 = toThousands(orderMoney.split(".")[0]);
|
|
|
+ orderMoney_2 = orderMoney.split(".")[1];
|
|
|
+ if (orderMoney_2) {
|
|
|
+ orderMoney = orderMoney_1 + "." + orderMoney_2;
|
|
|
+ } else {
|
|
|
+ orderMoney = orderMoney_1;
|
|
|
+ }
|
|
|
+ //
|
|
|
+ var token = obj.token;
|
|
|
+ //订单状态 0待支付 1已完成 -1删除
|
|
|
+ var orderStatus = obj.order_status;
|
|
|
+ if (sessionStorage && sessionStorage.getItem("paySuccess_" + obj.order_code) != null) {
|
|
|
+ orderStatus = sessionStorage.getItem("paySuccess_" + obj.order_code);
|
|
|
+ if (orderTabActive === 1 && orderStatus === 1) {
|
|
|
+ gopayIndex = index;
|
|
|
+ psss = obj.order_code;
|
|
|
+ continue;
|
|
|
+ } else {
|
|
|
+ sessionStorage.removeItem("paySuccess_" + obj.order_code);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (orderStatus === 0) {
|
|
|
+ orderStatus = "待付款"
|
|
|
+ orderHtml = "";
|
|
|
+ orderHtml += '<span class="status notpay">'
|
|
|
+ orderHtml += '<span class="status-text">' + orderStatus + '</span>'
|
|
|
+ orderHtml += "<span class=\"delete_icon\" title=\"删除订单\" onclick=\"deleteOrder(" + id + ",this)\"></span></span>";
|
|
|
+ iconHtml = ""
|
|
|
+ iconHtml += '<div class="card-footer">'
|
|
|
+ + '<a class="btn cancle gray-btn" onclick="cancelOrder(' + id + ',this)">取消订单</a>'
|
|
|
+ + '<a href="javascript:void(0)" onclick="window.location.href =\'' + "/weixin/pay/checkout_dataexport?orderCode=" + orderCode + '\'" class="btn green-btn">去支付</a>'
|
|
|
+ + '</div>'
|
|
|
+ } else if (orderStatus === 1) {
|
|
|
+ orderStatus = "已完成";
|
|
|
+ orderHtml = ""
|
|
|
+ orderHtml += ' <span class="status finish">'
|
|
|
+ orderHtml += '<span class="status-text">' + orderStatus + '</span>'
|
|
|
+ orderHtml += "<a class=\"delete_icon\" title=\"删除订单\" onclick=\"deleteOrder(" + id + ",this)\"></a></span>";
|
|
|
+
|
|
|
+ iconHtml = ""
|
|
|
+ iconHtml += '<div class="card-footer">'
|
|
|
+ //已完成订单 开发票判断 0未申请 1已申请
|
|
|
+ var applybill_status = obj.applybill_status;
|
|
|
+ if (applybill_status === 0) {
|
|
|
+ iconHtml += '<a onclick="invoiceAdd(this)" class="btn gray-btn">开发票</a>'
|
|
|
+ iconHtml += '<a onclick="onceMore(this)" class="btn cancle green-btn">再次购买</a>'
|
|
|
+ } else if (applybill_status === 1) {
|
|
|
+ iconHtml += '<a onclick="checkinvoice(this)" class="btn gray-btn">查看发票</a>'
|
|
|
+ iconHtml += '<a onclick="onceMore(this)" class="btn cancle green-btn">再次购买</a>'
|
|
|
+ }
|
|
|
+ iconHtml += '</div>'
|
|
|
+ } else if (orderStatus === -2) {
|
|
|
+ orderStatus = "已取消";
|
|
|
+ orderHtml = "";
|
|
|
+ orderHtml += '<span class="status cancel_text">'
|
|
|
+ orderHtml += '<span class="status-text">' + orderStatus + '</span>'
|
|
|
+ orderHtml += "<span class=\"delete_icon\" title=\"删除订单\" onclick=\"deleteOrder(" + id + ",this)\"></span></span>";
|
|
|
+ iconHtml = "";
|
|
|
+ iconHtml += '<div class="card-footer">'
|
|
|
+ + '<a onclick="onceMore(this)" class="btn cancle green-btn">再次购买</a>'
|
|
|
+ + '</div>'
|
|
|
+ }
|
|
|
+ //关键词
|
|
|
+ if (obj.filter_keys && obj.filter_keys.split(",").length > 0) {
|
|
|
+ var keysHtml = "";
|
|
|
+ var keysArr = obj.filter_keys.split(",");
|
|
|
+ var keysLen = keysArr.length;
|
|
|
+ for (var j = 0; j < keysLen; j++) {
|
|
|
+ keysHtml += "<span>" + keysArr[j] + " </span>";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ keysHtml = ""
|
|
|
+ }
|
|
|
+
|
|
|
+ listhtml += '<div class="card">'
|
|
|
+ + '<div class="card-header">'
|
|
|
+ + '<span class="time" style="color:#888888">' + createTime + '</span>'
|
|
|
+ + orderHtml
|
|
|
+ + '</div>'
|
|
|
+ + '<div class="card-content">'
|
|
|
+ + '<a onclick="setSessionStorage()" eid=' + orderCode + ' href="/front/wx_dataExport/wxToOrderDetail?orderCode=' + orderCode + '" class="media">'
|
|
|
+ + '<div class="media-img">'
|
|
|
+ + '<img src="/dataExport/image/dataOutput.png">'
|
|
|
+ + '</div>'
|
|
|
+ + '<div class="media-info">'
|
|
|
+ + '<p class="item-ifo ellipsis">关键词:' + keysHtml + '</p>'
|
|
|
+ + '<p class="item-ifo ellipsis">数据量:' + data_count + '条</p>'
|
|
|
+ + '<p class="item-ifo ellipsis">数据规格:' + spec + '</p>'
|
|
|
+ + '<p class="item-ifo ellipsis">筛选日期:' + publishTime + '</p>'
|
|
|
+ + '</div>'
|
|
|
+ + '</a>'
|
|
|
+ + '<div class="price">'
|
|
|
+ + '<strong class="current">¥' + orderMoney + '</strong>'
|
|
|
+ + '</div>'
|
|
|
+ + '</div>'
|
|
|
+ + iconHtml
|
|
|
+ + '</div>'
|
|
|
+ } else if ((obj.product_type === "vip订阅") || (obj.product_type === "VIP订阅")) {
|
|
|
+ if (typ === 1) { //待付款订单列表页
|
|
|
+ if (obj.order_status === -2) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ count++;
|
|
|
+ var id_vip = obj.id;
|
|
|
+ //订单编号
|
|
|
+ var orderCode_vip = obj.order_code;
|
|
|
+ //创建时间
|
|
|
+ var createTime_vip = obj.create_time;
|
|
|
+ createTime_vip = createTime_vip.replace(/-/g, ".")
|
|
|
+ //筛选条件
|
|
|
+ var filter_vip = JSON.parse(obj.filter);
|
|
|
+ var newbuyset = filter_vip.newBuyset;
|
|
|
+ //判断该订单是否是升级订单
|
|
|
+ var vip_type = obj.vip_type;
|
|
|
+ var region_vip = ""
|
|
|
+ if ((vip_type !== 2) && (vip_type !== 1)) {
|
|
|
+ //地区
|
|
|
+ if (!$.isEmptyObject(newbuyset)) { //不为空
|
|
|
+ if (newbuyset.areacount !== -1) {
|
|
|
+ var newcitys = newbuyset.newcitys;
|
|
|
+ var scatter = newcitys.length;//分布
|
|
|
+ var citynum = 0;
|
|
|
+ for (var k in newcitys) {
|
|
|
+ citynum += newcitys[k];
|
|
|
+ }
|
|
|
+ if (newbuyset.areacount > 0) {
|
|
|
+ region_vip = newbuyset.areacount + "个省级区域";
|
|
|
+ if (citynum !== 0) {
|
|
|
+ region_vip += "、" + citynum + "个地市";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ region_vip += citynum + "个地市";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ region_vip = "全国";
|
|
|
+ }
|
|
|
+ //行业
|
|
|
+ var industry_vip = newbuyset.buyerclasscount; //数组
|
|
|
+ if (industry_vip === -1) {
|
|
|
+ industry_vip = "全行业";
|
|
|
+ } else {
|
|
|
+ industry_vip = industry_vip + "个行业";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ var region_vipArr = filter_vip.area;
|
|
|
+ var province_length = 0;
|
|
|
+ var city_length = 0;
|
|
|
+ if (JSON.stringify(region_vipArr) !== JSON.stringify({})) {
|
|
|
+ for (i in region_vipArr) {
|
|
|
+ if (region_vipArr[i].length === 0) {
|
|
|
+ province_length++;
|
|
|
+ } else {
|
|
|
+ city_length += region_vipArr[i].length;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ region_vip = "全国";
|
|
|
+ }
|
|
|
+ if ((province_length !== 0) && (city_length !== 0)) {
|
|
|
+ region_vip = province_length + "个省级区域、" + city_length + "个地市";
|
|
|
+ } else if ((province_length === 0) && (city_length !== 0)) {
|
|
|
+ region_vip = city_length + "个地市";
|
|
|
+ } else if ((province_length !== 0) && (city_length === 0)) {
|
|
|
+ region_vip = province_length + "个省级区域";
|
|
|
+ }
|
|
|
+ //行业
|
|
|
+ var industry_vip = filter_vip.industry.length; //数组
|
|
|
+ if (industry_vip === 0) {
|
|
|
+ industry_vip = "全行业";
|
|
|
+ } else {
|
|
|
+ industry_vip = industry_vip + "个行业";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var cyclecount_vip = filter_vip.cyclecount; //时长
|
|
|
+ var cycleunit_vip = filter_vip.cycleunit;//单位 1:年 2:月 3:天
|
|
|
+ //订阅周期
|
|
|
+ var effectiveduration_vip = ""
|
|
|
+ if ((obj.vip_starttime) && (obj.vip_endtime)) {
|
|
|
+ var start_time_vip = obj.vip_starttime;
|
|
|
+ var end_time_vip = obj.vip_endtime;
|
|
|
+ var start_time_arr = start_time_vip.split(" ")[0].split("-")
|
|
|
+ var end_time_arr = end_time_vip.split(" ")[0].split("-")
|
|
|
+ var start_year = start_time_arr[0];
|
|
|
+ var start_month = start_time_arr[1];
|
|
|
+ var end_year = end_time_arr[0];
|
|
|
+ var end_month = end_time_arr[1];
|
|
|
+
|
|
|
+ var year = 0;
|
|
|
+ var month = 0;
|
|
|
+ if (end_year > start_year) {
|
|
|
+ if (end_month > start_month) {
|
|
|
+ year = end_year - start_year;
|
|
|
+ month = end_month - start_month;
|
|
|
+ } else {
|
|
|
+ year = end_year - start_year - 1;
|
|
|
+ month = 12 + Number(end_month) - start_month;
|
|
|
+ if (month === 12) {
|
|
|
+ year = Number(year) + 1;
|
|
|
+ month = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (end_year === start_year) {
|
|
|
+ month = end_month - start_month;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (year !== 0 && month !== 0) {
|
|
|
+ effectiveduration_vip = year + "年" + month + "个月";
|
|
|
+ } else if (year !== 0 && month === 0) {
|
|
|
+ effectiveduration_vip = year + "年";
|
|
|
+ } else if (year === 0 && month !== 0) {
|
|
|
+ effectiveduration_vip = month + "个月";
|
|
|
+ }
|
|
|
+ if (cycleunit_vip === 3) {
|
|
|
+ effectiveduration_vip = cyclecount_vip + "天";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (cycleunit_vip === 1) {
|
|
|
+ effectiveduration_vip = cyclecount_vip + "年";
|
|
|
+ } else if (cycleunit_vip === 2) {
|
|
|
+ effectiveduration_vip = cyclecount_vip + "个月"
|
|
|
+ } else if (cycleunit_vip === 3) {
|
|
|
+ effectiveduration_vip = cyclecount_vip + "天";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //试用用户生成订单 周期
|
|
|
+ if (effectiveduration_vip === "") {
|
|
|
+ if (cycleunit_vip === 1) {
|
|
|
+ effectiveduration_vip = cyclecount_vip + "年";
|
|
|
+ } else if (cycleunit_vip === 2) {
|
|
|
+ effectiveduration_vip = cyclecount_vip + "个月"
|
|
|
+ } else if (cycleunit_vip === 3) {
|
|
|
+ effectiveduration_vip = cyclecount_vip + "天";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (vip_type === 2) {
|
|
|
+ //新增全部行业:-1 新增部分行业:123 无新增:0
|
|
|
+ //新增全国{"province":0,"city":0} 无新增:{}
|
|
|
+ //区域
|
|
|
+ var filterObj = filter_vip;
|
|
|
+ if (!$.isEmptyObject(newbuyset)) { //不为空
|
|
|
+ if (newbuyset.areacount !== -1) {
|
|
|
+ var newcitys = newbuyset.newcitys;
|
|
|
+ var scatter = newcitys.length;//分布
|
|
|
+ var citynum = 0;
|
|
|
+ for (var k in newcitys) {
|
|
|
+ citynum += newcitys[k];
|
|
|
+ }
|
|
|
+ if (newbuyset.areacount > 0) {
|
|
|
+ region_vip = newbuyset.areacount + "个省级区域";
|
|
|
+ if (citynum != 0) {
|
|
|
+ region_vip += "、" + citynum + "个地市";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ region_vip += citynum + "个地市";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ region_vip = "全国";
|
|
|
+ }
|
|
|
+ var buyerclasscount = newbuyset.buyerclasscount;
|
|
|
+ if (buyerclasscount > 3) {
|
|
|
+ buyerclasscount = filterObj.industry.length;
|
|
|
+ industry_vip = "全行业(" + buyerclasscount + "个行业)";
|
|
|
+ } else {
|
|
|
+ industry_vip = buyerclasscount + "个行业";
|
|
|
+ }
|
|
|
+ if (buyerclasscount === -1) {
|
|
|
+ industry_vip = "全行业";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!$.isEmptyObject(filterObj.addareacount)) {
|
|
|
+ if ((filterObj.addareacount.province === 0) && (filterObj.addareacount.city === 0)) {
|
|
|
+ region_vip = "全国";
|
|
|
+ }
|
|
|
+ if ((filterObj.addareacount.province !== 0) && (filterObj.addareacount.city === 0)) {
|
|
|
+ region_vip = filterObj.addareacount.province + "个省级区域";
|
|
|
+ }
|
|
|
+ if ((filterObj.addareacount.province === 0) && (filterObj.addareacount.city !== 0)) {
|
|
|
+ region_vip = filterObj.addareacount.city + "个地市";
|
|
|
+ }
|
|
|
+ if ((filterObj.addareacount.province !== 0) && (filterObj.addareacount.city !== 0)) {
|
|
|
+ region_vip = filterObj.addareacount.province + "个省级区域、" + filterObj.addareacount.city + "个地市";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ region_vip = "无";
|
|
|
+ }
|
|
|
+ //行业
|
|
|
+ var industry_vip = "";
|
|
|
+ industry_vip = filterObj.addbuyerclasscount + "个行业";
|
|
|
+ if (filterObj.addbuyerclasscount === 0) {
|
|
|
+ industry_vip = "无";
|
|
|
+ }
|
|
|
+ if (filterObj.addbuyerclasscount === -1) {
|
|
|
+ industry_vip = "全行业";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //延长周期
|
|
|
+ var effectiveduration_vip = "";
|
|
|
+ if (filterObj.cycleunit === 1) {
|
|
|
+ effectiveduration_vip = filterObj.cyclecount + "年";
|
|
|
+ } else if (filterObj.cycleunit === 2) {
|
|
|
+ effectiveduration_vip = filterObj.cyclecount + "个月";
|
|
|
+ } else if (filterObj.cycleunit === 3) {
|
|
|
+ effectiveduration_vip = filterObj.cyclecount + "天";
|
|
|
+ } else if (filterObj.cycleunit === -1) {
|
|
|
+ effectiveduration_vip = "不延期";
|
|
|
+ } else {
|
|
|
+ if ((obj.vip_starttime !== undefined) && (obj.vip_endtime !== undefined)) {
|
|
|
+ var start_time_vip = obj.vip_starttime;
|
|
|
+ var end_time_vip = obj.vip_endtime;
|
|
|
+ var start_time_arr = start_time_vip.split(" ")[0].split("-")
|
|
|
+ var end_time_arr = end_time_vip.split(" ")[0].split("-")
|
|
|
+ var start_year = start_time_arr[0];
|
|
|
+ var start_month = start_time_arr[1];
|
|
|
+ var end_year = end_time_arr[0];
|
|
|
+ var end_month = end_time_arr[1];
|
|
|
+
|
|
|
+ var year = 0;
|
|
|
+ var month = 0;
|
|
|
+ if (end_year > start_year) {
|
|
|
+ if (end_month > start_month) {
|
|
|
+ year = end_year - start_year;
|
|
|
+ month = end_month - start_month;
|
|
|
+ } else {
|
|
|
+ year = end_year - start_year - 1;
|
|
|
+ month = 12 + Number(end_month) - start_month;
|
|
|
+ if (month === 12) {
|
|
|
+ year = Number(year) + 1;
|
|
|
+ month = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (end_year === start_year) {
|
|
|
+ month = end_month - start_month;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (year !== 0 && month !== 0) {
|
|
|
+ effectiveduration_vip = year + "年" + month + "个月";
|
|
|
+ } else if (year !== 0 && month === 0) {
|
|
|
+ effectiveduration_vip = year + "年";
|
|
|
+ } else if (year === 0 && month !== 0) {
|
|
|
+ effectiveduration_vip = month + "个月";
|
|
|
+ }
|
|
|
+ if (cycleunit_vip === 3) {
|
|
|
+ effectiveduration_vip = cyclecount_vip + "天";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (cycleunit_vip === 1) {
|
|
|
+ effectiveduration_vip = cyclecount_vip + "年";
|
|
|
+ } else if (cycleunit_vip === 2) {
|
|
|
+ effectiveduration_vip = cyclecount_vip + "个月"
|
|
|
+ } else if (cycleunit_vip === 3) {
|
|
|
+ effectiveduration_vip = cyclecount_vip + "天";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //续费升级逻辑修改后判断是否不延期
|
|
|
+ if (filterObj.cycleunit === 0 && filterObj.cyclecount === 0) {
|
|
|
+ effectiveduration_vip = "不延期";
|
|
|
+ }
|
|
|
+ } else if (vip_type === 1) {
|
|
|
+ filter_vip = JSON.parse(obj.filter);
|
|
|
+ var renewal_market = 0; //续费市级地区
|
|
|
+ var buyset = filter_vip.buyset;
|
|
|
+ if ($.isEmptyObject(newbuyset)) {
|
|
|
+ //续费订单根据buyset 中ciyts判断 老订单为citys 新订单为newcitys 续费以外根据newbuyset判断
|
|
|
+ if (buyset.ciyts !== undefined) {
|
|
|
+ if (buyset.areacount === -1) {
|
|
|
+ region_vip = "全国";
|
|
|
+ } else {
|
|
|
+ if (!$.isEmptyObject(buyset.citys)) {
|
|
|
+ for (var key in buyset.citys) {
|
|
|
+ renewal_market += (buyset.citys[key]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //
|
|
|
+ var areaText = "";
|
|
|
+ if ((buyset.areacount !== 0) && (renewal_market !== 0)) {
|
|
|
+ region_vip = buyset.areacount + "个省级地区、" + renewal_market + "个地市";
|
|
|
+ } else if ((buyset.areacount === 0) && (renewal_market !== 0)) {
|
|
|
+ region_vip = renewal_market + "个地市";
|
|
|
+ } else if ((buyset.areacount !== 0) && (renewal_market === 0)) {
|
|
|
+ region_vip = buyset.areacount + "个省级地区";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (buyset.buyerclasscount === -1) {
|
|
|
+ industry_vip = "全行业";
|
|
|
+ } else {
|
|
|
+ industry_vip = buyset.buyerclasscount + "个行业";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (newbuyset.areacount !== -1) {
|
|
|
+ var newcitys = newbuyset.newcitys;
|
|
|
+ var scatter = newcitys.length;//分布
|
|
|
+ var citynum = 0;
|
|
|
+ for (var k in newcitys) {
|
|
|
+ citynum += newcitys[k];
|
|
|
+ }
|
|
|
+ if (newbuyset.areacount > 0) {
|
|
|
+ region_vip = newbuyset.areacount + "个省级区域";
|
|
|
+ if (citynum !== 0) {
|
|
|
+ region_vip += "、" + citynum + "个地市";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (citynum !== 0) {
|
|
|
+ region_vip += citynum + "个地市";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ region_vip = "全国";
|
|
|
+ }
|
|
|
+ if (newbuyset.buyerclasscount !== -1) {
|
|
|
+ industry_vip = newbuyset.buyerclasscount + "个行业";
|
|
|
+ } else {
|
|
|
+ industry_vip = "全行业";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //订阅周期
|
|
|
+ var effectiveduration_vip = ""
|
|
|
+ if ((obj.vip_starttime !== undefined) && (obj.vip_endtime !== undefined)) {
|
|
|
+ var start_time_vip = obj.vip_starttime;
|
|
|
+ var end_time_vip = obj.vip_endtime;
|
|
|
+ var start_time_arr = start_time_vip.split(" ")[0].split("-")
|
|
|
+ var end_time_arr = end_time_vip.split(" ")[0].split("-")
|
|
|
+ var start_year = start_time_arr[0];
|
|
|
+ var start_month = start_time_arr[1];
|
|
|
+ var end_year = end_time_arr[0];
|
|
|
+ var end_month = end_time_arr[1];
|
|
|
+
|
|
|
+ var year = 0;
|
|
|
+ var month = 0;
|
|
|
+ if (end_year > start_year) {
|
|
|
+ if (end_month > start_month) {
|
|
|
+ year = end_year - start_year;
|
|
|
+ month = end_month - start_month;
|
|
|
+ } else {
|
|
|
+ year = end_year - start_year - 1;
|
|
|
+ month = 12 + Number(end_month) - start_month;
|
|
|
+ if (month === 12) {
|
|
|
+ year = Number(year) + 1;
|
|
|
+ month = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (end_year === start_year) {
|
|
|
+ month = end_month - start_month;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (year !== 0 && month !== 0) {
|
|
|
+ effectiveduration_vip = year + "年" + month + "个月";
|
|
|
+ } else if (year !== 0 && month === 0) {
|
|
|
+ effectiveduration_vip = year + "年";
|
|
|
+ } else if (year === 0 && month !== 0) {
|
|
|
+ effectiveduration_vip = month + "个月";
|
|
|
+ }
|
|
|
+ if (cycleunit_vip === 3) {
|
|
|
+ effectiveduration_vip = cyclecount_vip + "天";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (cycleunit_vip === 1) {
|
|
|
+ effectiveduration_vip = cyclecount_vip + "年";
|
|
|
+ } else if (cycleunit_vip === 2) {
|
|
|
+ effectiveduration_vip = cyclecount_vip + "个月"
|
|
|
+ } else if (cycleunit_vip === 3) {
|
|
|
+ effectiveduration_vip = cyclecount_vip + "天";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ var vip_status = obj.i_vip_status; // 1:试用 2:正式 -1:试用到期 -2:正式到期
|
|
|
+ //订单状态 0待支付 1已完成 -1删除
|
|
|
+ var orderStatus_vip = obj.order_status;
|
|
|
+ var token_vip = obj.token;
|
|
|
+ if (sessionStorage && sessionStorage.getItem("paySuccess_" + obj.order_code) != null) {
|
|
|
+ orderStatus = sessionStorage.getItem("paySuccess_" + obj.order_code);
|
|
|
+ if (orderTabActive === 1 && orderStatus === 1) {
|
|
|
+ gopayIndex = index;
|
|
|
+ psss = obj.order_code;
|
|
|
+ continue;
|
|
|
+ } else {
|
|
|
+ sessionStorage.removeItem("paySuccess_" + obj.order_code);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //订单金额
|
|
|
+ var orderMoney_vip = obj.order_money;
|
|
|
+ var orginsPrices = obj.order_money;
|
|
|
+ //金额格式化 小数点前 1,000
|
|
|
+ orderMoney_vip = orderMoney_vip + "";
|
|
|
+ orderMoney_vip1 = toThousands(orderMoney_vip.split(".")[0]);
|
|
|
+ orderMoney_vip2 = orderMoney_vip.split(".")[1];
|
|
|
+ if (orderMoney_vip2) {
|
|
|
+ orderMoney_vip = orderMoney_vip1 + "." + orderMoney_vip2;
|
|
|
+ } else {
|
|
|
+ orderMoney_vip = orderMoney_vip1;
|
|
|
+ }
|
|
|
+ if (orderStatus_vip === 0) {
|
|
|
+ orderStatus_vip = "待付款"
|
|
|
+ orderHtml = ""
|
|
|
+ orderHtml += '<span class="status notpay">'
|
|
|
+ orderHtml += '<span class="status-text">' + orderStatus_vip + '</span>'
|
|
|
+ orderHtml += "<a class=\"delete_icon\" title=\"删除订单\" onclick=\"deleteOrder(" + id_vip + ",this)\"></a></span>";
|
|
|
+ iconHtml = ""
|
|
|
+ iconHtml += '<div class="card-footer">'
|
|
|
+ + '<a class="btn cancle" onclick="cancelOrder(' + id_vip + ',this)">取消订单</a>'
|
|
|
+ + '<a href="javascript:void(0)" onclick="window.location.href =\'' + "/weixin/pay/checkout_vip?orderCode=" + orderCode + '\'" class="btn green-btn">去支付</a>'
|
|
|
+ + '</div>'
|
|
|
+ } else if (orderStatus_vip === 1) {
|
|
|
+ orderStatus_vip = "已完成";
|
|
|
+ orderHtml = ""
|
|
|
+ orderHtml += '<span class="status finish">'
|
|
|
+ orderHtml += '<span class="status-text">' + orderStatus_vip + '</span>'
|
|
|
+ orderHtml += "<a class=\"delete_icon\" title=\"删除订单\" onclick=\"deleteOrder(" + id_vip + ",this)\"></a></span>";
|
|
|
+ iconHtml = ""
|
|
|
+ //最后一次购买完 1:试用 2:正式 -1:试用到期 -2:正式到期
|
|
|
+ if ((vip_status === "-2") && (obj.lastbuy_code !== undefined)) {
|
|
|
+ iconHtml += '<div class="card-footer">'
|
|
|
+ if (obj.applybill_status === 0) {
|
|
|
+ iconHtml += '<a onclick="invoiceAdd(this)" class="btn gray-btn">开发票</a>'
|
|
|
+ } else {
|
|
|
+ iconHtml += '<a onclick="checkinvoice(this)" class="btn gray-btn">查看发票</a>'
|
|
|
+ }
|
|
|
+ iconHtml += '<a onclick="renewalOrBuyAgain(2,this)" class="btn green-btn">再次购买</a></div>'
|
|
|
+ } else if ((vip_status === "2") && (obj.lastbuy_code !== undefined)) {
|
|
|
+ if (obj.pay_way !== "trial") {
|
|
|
+ iconHtml += '<div class="card-footer">'
|
|
|
+ if (obj.applybill_status === 0) {
|
|
|
+ iconHtml += '<a onclick="invoiceAdd(this)" class="btn gray-btn">开发票</a>'
|
|
|
+ } else {
|
|
|
+ iconHtml += '<a onclick="checkinvoice(this)" class="btn gray-btn">查看发票</a>'
|
|
|
+ }
|
|
|
+ iconHtml += '<a onclick="renewalOrBuyAgain(1,this)" class="btn green-btn">续费</a></div>'
|
|
|
+ }
|
|
|
+ } else if ((vip_status === "-2") && (obj.lastbuy_code === undefined)) {
|
|
|
+ iconHtml += '<div class="card-footer">'
|
|
|
+ if (obj.applybill_status === 0) {
|
|
|
+ iconHtml += '<a onclick="invoiceAdd(this)" class="btn gray-btn">开发票</a></div>'
|
|
|
+ } else {
|
|
|
+ iconHtml += '<a onclick="checkinvoice(this)" class="btn gray-btn">查看发票</a></div>'
|
|
|
+ }
|
|
|
+ } else if ((vip_status === "2") && (obj.lastbuy_code === undefined)) {
|
|
|
+ if (obj.pay_way !== "trial") {
|
|
|
+ iconHtml += '<div class="card-footer">'
|
|
|
+ if (obj.applybill_status === 0) {
|
|
|
+ iconHtml += '<a onclick="invoiceAdd(this)" class="btn gray-btn">开发票</a></div>'
|
|
|
+ } else {
|
|
|
+ iconHtml += '<a onclick="checkinvoice(this)" class="btn gray-btn">查看发票</a></div>'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (orderStatus_vip === -2) {
|
|
|
+ orderStatus_vip = "已取消";
|
|
|
+ orderHtml = "<span class=\"status cancel_text\">";
|
|
|
+ orderHtml += '<span class="status-text">' + orderStatus_vip + '</span>'
|
|
|
+ orderHtml += "<a class=\"delete_icon\" title=\"删除订单\" onclick=\"deleteOrder(" + id_vip + ",this)\"></a></span>";
|
|
|
+ iconHtml = "";
|
|
|
+ iconHtml += '<div class="card-footer">'
|
|
|
+ + '</div>'
|
|
|
+ }
|
|
|
+ if (filter_vip.cyclecount !== undefined && filter_vip.cyclecount !== "" && filter_vip.cycleunit !== undefined && filter_vip.cycleunit !== "") {
|
|
|
+ if (parseInt(filter_vip.cycleunit) === 1) {
|
|
|
+ effectiveduration_vip = filter_vip.cyclecount + "年"
|
|
|
+ } else if (parseInt(filter_vip.cycleunit) === 2) {
|
|
|
+ effectiveduration_vip = filter_vip.cyclecount + "个月"
|
|
|
+ } else {
|
|
|
+ effectiveduration_vip = "7天"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (filter_vip.cycleunit === 0 && filter_vip.cyclecount === 0) {
|
|
|
+ effectiveduration_vip = "不延期";
|
|
|
+ }
|
|
|
+ //vip状态 0不是vip 1试用 2正式
|
|
|
+ if (orderStatus_vip !== "已完成") {
|
|
|
+ //未支付 或 已取消
|
|
|
+ listhtml += '<div class="card">'
|
|
|
+ + '<div class="card-header">'
|
|
|
+ + '<span class="time" style="color:#888888">' + createTime_vip + '</span>'
|
|
|
+ + orderHtml
|
|
|
+ + '</div>'
|
|
|
+ + '<div class="card-content">'
|
|
|
+ + '<a onclick="setSessionStorage()" eid=' + orderCode_vip + ' href="/front/vipsubscribe/toOrderDetailPage?orderCode=' + orderCode_vip + '" class="media" isvipOrder="true">'
|
|
|
+ + '<div class="media-img">'
|
|
|
+ + '<img src="/vipsubscribe/image/vipBook.png">'
|
|
|
+ + '</div>'
|
|
|
+ + '<div class="media-info">';
|
|
|
+ listhtml += '<p class="item-ifo ellipsis">区域:' + region_vip + '</p>'
|
|
|
+ + '<p class="item-ifo ellipsis">行业:' + industry_vip + '</p>'
|
|
|
+ + '<p class="item-ifo ellipsis">订阅周期:' + effectiveduration_vip + '</p>';
|
|
|
+ //}
|
|
|
+ listhtml += '</div></a>'
|
|
|
+ listhtml += '<div class="price">'
|
|
|
+ if (isLiveActive) {
|
|
|
+ var originPrice = formatMoney(parseFloat(orginsPrices) / parseFloat(0.6));
|
|
|
+ listhtml += '<span class="origin-price-container">'
|
|
|
+ + '<span>原价:¥</span>'
|
|
|
+ + '<span class="origin-price">' + originPrice + '</span>'
|
|
|
+ + '</span>'
|
|
|
+ }
|
|
|
+ listhtml += '<strong class="current">¥' + orderMoney_vip + '</strong>'
|
|
|
+ + '</div>'
|
|
|
+ + '</div>'
|
|
|
+ + iconHtml
|
|
|
+ + '</div>'
|
|
|
+ } else {
|
|
|
+ //有效时间
|
|
|
+ var starttime_vip = obj.vip_starttime + "";
|
|
|
+ var endtime_vip = obj.vip_endtime + "";
|
|
|
+ starttime_vip = starttime_vip.split(" ")[0].replace(/-/g, ".")
|
|
|
+ endtime_vip = endtime_vip.split(" ")[0].replace(/-/g, ".")
|
|
|
+ var effectivetime_vip = starttime_vip + "-" + endtime_vip;
|
|
|
+ //已完成
|
|
|
+ listhtml += '<div class="card">'
|
|
|
+ + '<div class="card-header">'
|
|
|
+ + '<span class="time" style="color:#888888">' + createTime_vip + '</span>'
|
|
|
+ + orderHtml
|
|
|
+ + '</div>'
|
|
|
+ + '<div class="card-content">'
|
|
|
+ + '<a onclick="setSessionStorage()" eid=' + orderCode_vip + ' href="/front/vipsubscribe/toOrderDetailPage?orderCode=' + orderCode_vip + '" class="media" isvipOrder="true">'
|
|
|
+ + '<div class="media-img">'
|
|
|
+ + '<img src="/vipsubscribe/image/vipBook.png">'
|
|
|
+ + '</div>'
|
|
|
+ + '<div class="media-info">';
|
|
|
+ listhtml += '<p class="item-ifo ellipsis">区域:' + region_vip + '</p>'
|
|
|
+ + '<p class="item-ifo ellipsis">行业:' + industry_vip + '</p>'
|
|
|
+ + '<p class="item-ifo ellipsis">订阅周期:' + effectiveduration_vip + '</p>'
|
|
|
+ + '<p class="item-ifo ellipsis">有效日期:' + effectivetime_vip + '</p>';
|
|
|
+ //}
|
|
|
+ listhtml += '</div></a>'
|
|
|
+ listhtml += '<div class="price">'
|
|
|
+ if (isLiveActive) {
|
|
|
+ var originPrice = formatMoney(parseFloat(orginsPrices) / parseFloat(0.6));
|
|
|
+ listhtml += '<span class="origin-price-container">'
|
|
|
+ + '<span>原价:¥</span>'
|
|
|
+ + '<span class="origin-price">' + originPrice + '</span>'
|
|
|
+ + '</span>'
|
|
|
+ }
|
|
|
+ listhtml += '<strong class="current">¥' + orderMoney_vip + '</strong>'
|
|
|
+ + '</div>'
|
|
|
+ + '</div>'
|
|
|
+ + iconHtml
|
|
|
+ + '</div>'
|
|
|
+ }
|
|
|
+
|
|
|
+ } else if (obj.product_type === "招投标课程") {
|
|
|
+ count++;
|
|
|
+ // console.log(obj)
|
|
|
+ var id = obj.id;
|
|
|
+ //订单编号
|
|
|
+ var orderCode = obj.order_code;
|
|
|
+ //创建时间
|
|
|
+ var createTime = obj.create_time;
|
|
|
+ createTime = createTime.replace(/-/g, ".")
|
|
|
+ var payWay = obj.pay_way
|
|
|
+ var filterObj = JSON.parse(obj.filter);
|
|
|
+ var courseName = filterObj.courseName;
|
|
|
+ var courseType = filterObj.courseType;
|
|
|
+ var courseAddress = filterObj.courseAddress;
|
|
|
+ var peopleNum = filterObj.peoleNum;
|
|
|
+ var orderStatus = obj.order_status;
|
|
|
+ var courseStatus = obj.course_status;
|
|
|
+ var orderStatusHtml = "";
|
|
|
+ var orderStatusHtmls = "";
|
|
|
+ var coursePrice = filterObj.coursePrice;
|
|
|
+ var costPrice = peopleNum * coursePrice;
|
|
|
+ var orderMoney = obj.order_money;
|
|
|
+ var courseId = filterObj.courseMgoId;
|
|
|
+ var lastHtml = "";
|
|
|
+ var orderUrl = "/swordfish/course/orderDetail?code=" + orderCode;
|
|
|
+ var helpHtml = "";
|
|
|
+
|
|
|
+ if (payWay !== "transferAccounts") {
|
|
|
+ if (orderStatus === 0) {
|
|
|
+ orderStatusHtml = "待付款";
|
|
|
+ orderStatusHtmls = "notpay";
|
|
|
+ lastHtml = '<div class="card-footer">'
|
|
|
+ + '<a class="btn cancle gopay_btn" onclick="cancelOrder(' + id + ',this)">取消订单</a>'
|
|
|
+ + '<a onclick="setSessionStorage()" href="/weixin/pay/optionPay?code=' + orderCode + '" class="btn green-btn">去支付</a>'
|
|
|
+ + '</div>';
|
|
|
+ } else if (orderStatus === 1) {
|
|
|
+ if (courseStatus === 5) {
|
|
|
+ orderStatusHtml = "退款审核中";
|
|
|
+ orderStatusHtmls = "refund";
|
|
|
+ lastHtml = '<div class="card-footer">'
|
|
|
+ + '<a onclick="setSessionStorage()" href="/swordfish/course/detail/' + courseId + '" class="btn cancle green-btn">再次购买</a>'
|
|
|
+ + '</div>';
|
|
|
+ orderUrl = "/swordfish/course/refundVerify?code=" + orderCode;
|
|
|
+ } else if (courseStatus === 6) {
|
|
|
+ orderStatusHtml = "已退款";
|
|
|
+ orderStatusHtmls = "refund";
|
|
|
+ lastHtml = '<div class="card-footer">'
|
|
|
+ + '<a onclick="setSessionStorage()" href="/swordfish/course/detail/' + courseId + '" class="btn cancle green-btn">再次购买</a>'
|
|
|
+ + '</div>';
|
|
|
+ orderUrl = "/swordfish/course/refundVerify?code=" + orderCode + "&isrefund=true";
|
|
|
+ } else {
|
|
|
+ orderStatusHtml = "已完成";
|
|
|
+ lastHtml = '<div class="card-footer refundable tooltip">'
|
|
|
+ + '<i class="show-more" onclick="show_more(this)"></i>'
|
|
|
+ + '<a onclick="setSessionStorage()" href="/swordfish/course/refund?code=' + orderCode + '" class="tooltip-text hide" data-id="订单id" style="display: none;">退款</a>'
|
|
|
+ + '<a onclick="setSessionStorage()" href="/swordfish/course/detail/' + courseId + '" class="btn cancle green-btn">再次购买</a>'
|
|
|
+ + '</div>'
|
|
|
+ var endTime = "";
|
|
|
+ try {
|
|
|
+ var startTime = new Date(filterObj.startTime * 1000).toLocaleString().split(" ")[0];
|
|
|
+ var startTimes = new Date(startTime + " 00:00:00").getTime();
|
|
|
+ var nowTime = new Date().getTime();
|
|
|
+ if (nowTime >= startTimes) {
|
|
|
+ lastHtml = '<div class="card-footer">'
|
|
|
+ + '<a onclick="setSessionStorage()" href="/swordfish/course/detail/' + courseId + '" class="btn cancle">再次购买</a>'
|
|
|
+ + '</div>'
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ orderStatusHtml = "已取消";
|
|
|
+ lastHtml = '<div class="card-footer">'
|
|
|
+ + '<a onclick="setSessionStorage()" href="/swordfish/course/detail/' + courseId + '" class="btn cancle green-btn">再次购买</a>'
|
|
|
+ + '</div>'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //公对公
|
|
|
+ if (orderStatus === 0) {
|
|
|
+ if (courseStatus === 2) {
|
|
|
+ orderStatusHtml = "转账审核中";
|
|
|
+ orderUrl = "/swordfish/course/transferVerify?code=" + orderCode;
|
|
|
+ orderStatusHtmls = "refund";
|
|
|
+ } else if (courseStatus === 3) {
|
|
|
+ orderStatusHtml = "未收到转账";
|
|
|
+ lastHtml = '<div class="card-footer">'
|
|
|
+ + '<a class="btn cancle gray-btn" onclick="cancelOrder(' + id + ',this)">取消订单</a>'
|
|
|
+ + '<a onclick="setSessionStorage()" href="/weixin/pay/optionPay?code=' + orderCode + '" class="btn green-btn">再次支付</a>'
|
|
|
+ + '</div>';
|
|
|
+ helpHtml = '<span class="doubt iconfont icon-bangzhu" onclick="phoneShow()"></span>'
|
|
|
+ orderStatusHtmls = "refund";
|
|
|
+ } else {
|
|
|
+ orderStatusHtml = "待付款";
|
|
|
+ orderStatusHtmls = "notpay";
|
|
|
+ lastHtml = '<div class="card-footer">'
|
|
|
+ + '<a class="btn cancle gray-btn" onclick="cancelOrder(' + id + ',this)">取消订单</a>'
|
|
|
+ + '<a onclick="setSessionStorage()" href="/weixin/pay/optionPay?code=' + orderCode + '" class="btn green-btn">去支付</a>'
|
|
|
+ + '</div>';
|
|
|
+ }
|
|
|
+ } else if (orderStatus === 1) {
|
|
|
+ if (courseStatus === 5) {
|
|
|
+ orderStatusHtml = "退款审核中";
|
|
|
+ orderStatusHtmls = "refund";
|
|
|
+ lastHtml = '<div class="card-footer">'
|
|
|
+ + '<a onclick="setSessionStorage()" href="/swordfish/course/detail/' + courseId + '" class="btn cancle green-btn">再次购买</a>'
|
|
|
+ + '</div>';
|
|
|
+ orderUrl = "/swordfish/course/refundVerify?code=" + orderCode;
|
|
|
+ } else if (courseStatus === 6) {
|
|
|
+ orderStatusHtml = "已退款";
|
|
|
+ orderStatusHtmls = "refund";
|
|
|
+ lastHtml = '<div class="card-footer">'
|
|
|
+ + '<a onclick="setSessionStorage()" href="/swordfish/course/detail/' + courseId + '" class="btn cancle green-btn">再次购买</a>'
|
|
|
+ + '</div>';
|
|
|
+ orderUrl = "/swordfish/course/refundVerify?code=" + orderCode + "&isrefund=true";
|
|
|
+ } else {
|
|
|
+ orderStatusHtml = "已完成";
|
|
|
+ lastHtml = '<div class="card-footer refundable tooltip">'
|
|
|
+ + '<i class="show-more" onclick="show_more(this)"></i>'
|
|
|
+ + '<a onclick="setSessionStorage()" href="/swordfish/course/refund?code=' + orderCode + '" class="tooltip-text hide" data-id="订单id" style="display: none;">退款</a>'
|
|
|
+ + '<a onclick="setSessionStorage()" href="/swordfish/course/detail/' + courseId + '" class="btn cancle green-btn">再次购买</a>'
|
|
|
+ + '</div>'
|
|
|
+ var endTime = "";
|
|
|
+ try {
|
|
|
+ var startTime = new Date(filterObj.startTime * 1000).toLocaleString().split(" ")[0];
|
|
|
+ var startTimes = new Date(startTime + " 00:00:00").getTime();
|
|
|
+ var nowTime = new Date().getTime();
|
|
|
+ if (nowTime >= startTimes) {
|
|
|
+ lastHtml = '<div class="card-footer">'
|
|
|
+ + '<a onclick="setSessionStorage()" href="/swordfish/course/detail/' + courseId + '" class="btn cancle">再次购买</a>'
|
|
|
+ + '</div>'
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ orderStatusHtml = "已取消";
|
|
|
+ lastHtml = '<div class="card-footer">'
|
|
|
+ + '<a onclick="setSessionStorage()" href="/swordfish/course/detail/' + courseId + '" class="btn cancle">再次购买</a>'
|
|
|
+ + '</div>'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ listhtml += '<div class="card">'
|
|
|
+ + '<div class="card-header">'
|
|
|
+ + '<span class="time">' + createTime + '</span>'
|
|
|
+ + '<span class="status ' + orderStatusHtmls + '">'
|
|
|
+ + helpHtml
|
|
|
+ + '<span class="status-text">' + orderStatusHtml + '</span>'
|
|
|
+ + '<a class="delete_icon" title="删除订单" onclick="deleteOrder(' + id + ',this)"></a>'
|
|
|
+ + '</span>'
|
|
|
+ + '</div>'
|
|
|
+ + '<div class="card-content">'
|
|
|
+ + '<a onclick="setSessionStorage()" href="' + orderUrl + '" eid="' + courseId + '" class="media" courseOrder="true" vid="' + orderCode + '">'
|
|
|
+ + '<div class="media-img">'
|
|
|
+ + '<img src="/course/image/lessonsOffline.png">'
|
|
|
+ + '</div>'
|
|
|
+ + '<div class="media-info">'
|
|
|
+ + '<p class="item-ifo ellipsis-2">' + courseName + '</p>'
|
|
|
+ + '<p class="item-ifo ellipsis">课程类型:' + courseType + '</p>'
|
|
|
+ + '<p class="item-ifo ellipsis">课程地点:' + courseAddress + '</p>'
|
|
|
+ + '<p class="item-ifo ellipsis">购买人数:' + peopleNum + '人</p>'
|
|
|
+ + '</div>'
|
|
|
+ + '</a>'
|
|
|
+ + '<div class="price">'
|
|
|
+ + '<strong class="current">¥' + formatMoney(orderMoney) + '</strong>'
|
|
|
+ + '</div>'
|
|
|
+ + '</div>'
|
|
|
+ + lastHtml
|
|
|
+ + '</div>'
|
|
|
+ } else if (obj.product_type === "线上课程") {
|
|
|
+ count++;
|
|
|
+ var id = obj.id;
|
|
|
+ //订单编号
|
|
|
+ var orderCode = obj.order_code;
|
|
|
+ //创建时间
|
|
|
+ var createTime = obj.create_time;
|
|
|
+ createTime = createTime.replace(/-/g, ".")
|
|
|
+ var payWay = obj.pay_way
|
|
|
+ var filterObj = JSON.parse(obj.filter);
|
|
|
+ var courseName = filterObj.s_name;
|
|
|
+ var courseLength = filterObj.s_courseDate;
|
|
|
+ var courseEndTimeStamp = filterObj.l_endtime;
|
|
|
+ var courseId = filterObj._id;
|
|
|
+ var orderStatus = obj.order_status;
|
|
|
+ var orderStatusHtml = "";
|
|
|
+ var orderStatusHtmls = "";
|
|
|
+ var orderMoney = obj.order_money;
|
|
|
+ var applybillStatus = obj.applybill_status;
|
|
|
+
|
|
|
+ var courseEndTime = new Date(courseEndTimeStamp * 1000)
|
|
|
+
|
|
|
+ var lastHtml = "";
|
|
|
+ var orderUrl = "/weixin/pay/xs_payNow?code=" + orderCode;
|
|
|
+ var helpHtml = "";
|
|
|
+
|
|
|
+ if (orderStatus === 0) {
|
|
|
+ orderStatusHtml = "待付款";
|
|
|
+ orderStatusHtmls = "notpay";
|
|
|
+ lastHtml = '<div class="card-footer">'
|
|
|
+ + '<a class="btn cancle" onclick="cancelOrder(' + id + ',this)">取消订单</a>'
|
|
|
+ + '<a onclick="window.location.href =\'' + "/weixin/pay/checkout_onlineCourse?orderCode=" + orderCode + '\'" class="btn green-btn">去支付</a>'
|
|
|
+ + '</div>'
|
|
|
+ } else if (orderStatus === 1) {
|
|
|
+ orderStatusHtml = "已完成";
|
|
|
+ if (applybillStatus === 1) {
|
|
|
+ lastHtml = '<div class="card-footer">'
|
|
|
+ + '<a onclick="setSessionStorage()" href="/jyxsapp/invoiceDetail?code=' + orderCode + '&id=' + id + '" class="btn cancle">查看发票</a>'
|
|
|
+ + '</div>'
|
|
|
+ } else {
|
|
|
+ lastHtml = '<div class="card-footer">'
|
|
|
+ + '<a onclick="setSessionStorage()" href="/jyxsapp/invoice?code=' + orderCode + '}" class="btn cancle">开发票</a>'
|
|
|
+ + '</div>'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ orderStatusHtml = "已取消";
|
|
|
+ }
|
|
|
+
|
|
|
+ listhtml += '<div class="card">'
|
|
|
+ + '<div class="card-header">'
|
|
|
+ + '<span class="time">' + createTime + '</span>'
|
|
|
+ + '<span class="status ' + orderStatusHtmls + '">'
|
|
|
+ + helpHtml
|
|
|
+ + '<span class="status-text">' + orderStatusHtml + '</span>'
|
|
|
+ + '<a class="delete_icon" title="删除订单" onclick="deleteOrder(' + id + ',this)"></a>'
|
|
|
+ + '</span>'
|
|
|
+ + '</div>'
|
|
|
+ + '<div class="card-content">'
|
|
|
+ + '<a onclick="setSessionStorage()" href="' + orderUrl + '" eid="' + courseId + '" vid="' + orderCode + '" class="media" courseOnlineOrder="true">'
|
|
|
+ + '<div class="media-img">'
|
|
|
+ + '<img src="/course/image/lessonsOnline.png">'
|
|
|
+ + '</div>'
|
|
|
+ + '<div class="media-info">'
|
|
|
+ + '<p class="item-ifo ellipsis-2">' + courseName + '</p>'
|
|
|
+ + '<p class="item-ifo ellipsis">课程类型:线上课程</p>'
|
|
|
+ + '<p class="item-ifo ellipsis">课程时长:' + courseLength + '</p>'
|
|
|
+ + '<p class="item-ifo ellipsis">有效日期:' + (courseEndTime.getFullYear() / (courseEndTime.getMonth() + 1) / courseEndTime.getDate()) + ' 到期</p>'
|
|
|
+ + '</div>'
|
|
|
+ + '</a>'
|
|
|
+ + '<div class="price">'
|
|
|
+ + '<strong class="current">¥' + formatMoney(orderMoney) + '</strong>'
|
|
|
+ + '</div>'
|
|
|
+ + '</div>'
|
|
|
+ + lastHtml
|
|
|
+ + '</div>'
|
|
|
+ } else if (obj.product_type === "数据报告") {
|
|
|
+ if (typ === 1 || $(".tab-link.active").index() === 1) { //待付款订单列表页
|
|
|
+ if (obj.order_status === -2) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ count++;
|
|
|
+ var id = obj.id;
|
|
|
+ //订单编号
|
|
|
+ var orderCode = obj.order_code;
|
|
|
+ //创建时间
|
|
|
+ var createTime = obj.create_time;
|
|
|
+ createTime = createTime.replace(/-/g, ".")
|
|
|
+ var filterObj = JSON.parse(obj.filter);
|
|
|
+ var reportName = filterObj.report_name;
|
|
|
+ var pushTimeStamp = filterObj.l_pushtime;
|
|
|
+
|
|
|
+ var orderStatus = obj.order_status;
|
|
|
+ var orderStatusHtml = "";
|
|
|
+ var orderStatusHtmls = "";
|
|
|
+ var orderMoney = obj.order_money;
|
|
|
+ var applybillStatus = obj.applybill_status;
|
|
|
+
|
|
|
+ var pushTime = new Date(pushTimeStamp * 1000)
|
|
|
+
|
|
|
+ var lastHtml = "";
|
|
|
+ var orderUrl = "/datareport/page/order/detail/" + orderCode;
|
|
|
+ var helpHtml = "";
|
|
|
+
|
|
|
+ if (orderStatus === 0) {
|
|
|
+ orderStatusHtml = "待付款";
|
|
|
+ orderStatusHtmls = "notpay";
|
|
|
+ lastHtml = '<div class="card-footer">'
|
|
|
+ + '<a class="btn cancle" onclick="cancelOrder(' + id + ',this)">取消订单</a>'
|
|
|
+ + '<a onclick="window.location.href=\'' + '/weixin/pay/datareport?ordercode =' + orderCode + '\'" class="btn green-btn">去支付</a>'
|
|
|
+ + '</div>';
|
|
|
+ } else if (orderStatus === 1) {
|
|
|
+ orderStatusHtml = "已完成";
|
|
|
+ if (applybillStatus === 1) {
|
|
|
+ lastHtml = '<div class="card-footer">'
|
|
|
+ + '<a onclick="checkinvoice(this)" class="btn gray-btn">查看发票</a>'
|
|
|
+ + '</div>'
|
|
|
+ } else {
|
|
|
+ lastHtml = '<div class="card-footer">'
|
|
|
+ + '<a onclick="invoiceAdd(this)" class="btn gray-btn">开发票</a>'
|
|
|
+ + '</div>'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ orderStatusHtml = "已取消";
|
|
|
+ }
|
|
|
+
|
|
|
+ listhtml += '<div class="card">'
|
|
|
+ + '<div class="card-header">'
|
|
|
+ + '<span class="time">' + createTime + '</span>'
|
|
|
+ + '<span class="status ' + orderStatusHtmls + '}">'
|
|
|
+ + helpHtml
|
|
|
+ + '<span class="status-text">' + orderStatusHtml + '</span>'
|
|
|
+ + '<a class="delete_icon" title="删除订单" onclick="deleteOrder(\'' + id + '\',this)"></a>'
|
|
|
+ + '</span>'
|
|
|
+ + '</div>'
|
|
|
+ + '<div class="card-content">'
|
|
|
+ + '<a onclick="setSessionStorage()" href="' + orderUrl + '" eid="' + orderCode + '" class="media" datareportOrder="true">'
|
|
|
+ + '<div class="media-img">'
|
|
|
+ + '<img src="/datareport/image/report_icon.png">'
|
|
|
+ + '</div>'
|
|
|
+ + '<div class="media-info">'
|
|
|
+ + '<p class="item-ifo ellipsis">报告名称:' + reportName + '</p>'
|
|
|
+ + '<p class="item-ifo ellipsis">发布日期:' + (pushTime.getFullYear() / (pushTime.getMonth() + 1) / pushTime.getDate()) + '</p>'
|
|
|
+ + '</div>'
|
|
|
+ + '</a>'
|
|
|
+ + '<div class="price">'
|
|
|
+ + '<strong class="current">¥' + formatMoney(orderMoney) + '</strong>'
|
|
|
+ + '</div>'
|
|
|
+ + '</div>'
|
|
|
+ + lastHtml
|
|
|
+ + '</div>'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ appendList($(listhtml));
|
|
|
+ }
|
|
|
+
|
|
|
+ function noMoreData(me) {
|
|
|
+ if (me == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ wxflag = me;
|
|
|
+ hasNextPage = false;
|
|
|
+ // 锁定
|
|
|
+ me.lock();
|
|
|
+ // 无数据
|
|
|
+ me.noData();
|
|
|
+ // 即使加载出错,也得重置
|
|
|
+ me.resetload();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 退款按钮
|
|
|
+ function show_more(e) {
|
|
|
+ $this = $(e)
|
|
|
+ $tooltip = $(e).siblings('.tooltip-text')
|
|
|
+ if ($tooltip.is(':hidden')) {
|
|
|
+ $tooltip.show()
|
|
|
+ } else {
|
|
|
+ $tooltip.hide()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 格式化金钱的函数
|
|
|
+ // s: 金额(number) 必传
|
|
|
+ // n: 保留小数的位数(int:0-100)
|
|
|
+ function formatMoney(s, n) {
|
|
|
+ if (n === undefined) {
|
|
|
+ n = -1
|
|
|
+ } else {
|
|
|
+ n = n > 0 && n <= 20 ? n : 2;
|
|
|
+ }
|
|
|
+ var intS = parseInt(s)
|
|
|
+ var point = '.'
|
|
|
+ var left;
|
|
|
+ var right;
|
|
|
+ s = parseFloat((s + '').replace(/[^\d\.-]/g, ''))
|
|
|
+ // 没传n,默认(如果为整数,则不保留小数。如果为浮点数,则保留两位小数)
|
|
|
+ if (n === -1) {
|
|
|
+ if (s === intS) {
|
|
|
+ n = 0
|
|
|
+ right = ''
|
|
|
+ point = ''
|
|
|
+ } else {
|
|
|
+ n = 2
|
|
|
+ s = s.toFixed(n);
|
|
|
+ right = s.split('.')[1];
|
|
|
+ }
|
|
|
+ s = s + ''
|
|
|
+ left = s.split('.')[0].split("").reverse();
|
|
|
+ } else {
|
|
|
+ s = parseFloat((s + '').replace(/[^\d\.-]/g, '')).toFixed(n) + '';
|
|
|
+ left = s.split('.')[0].split('').reverse();
|
|
|
+ right = s.split('.')[1];
|
|
|
+ }
|
|
|
+
|
|
|
+ t = "";
|
|
|
+ for (i = 0; i < left.length; i++) {
|
|
|
+ t += left[i] + ((i + 1) % 3 == 0 && (i + 1) != left.length ? ',' : '');
|
|
|
+ }
|
|
|
+
|
|
|
+ var money = t.split('').reverse().join('') + point + right;
|
|
|
+ return money;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 客服电话弹窗
|
|
|
+ function phoneShow() {
|
|
|
+ $('.jy-alert').show();
|
|
|
+ }
|
|
|
+
|
|
|
+ function phoneHide() {
|
|
|
+ $('.jy-alert').hide();
|
|
|
+ }
|
|
|
+
|
|
|
+ //开发票
|
|
|
+ function invoiceAdd(e) {
|
|
|
+ setSessionStorage()
|
|
|
+ var orderCode = $(e).parent(".card-footer").prev(".card-content").find("a").attr("eid");
|
|
|
+ $.post("/subscribepay/orderListDetails/isOver", {"order_code": orderCode}, function (data) {
|
|
|
+ if (data.status == 1) {
|
|
|
+ window.location.href = "/front/invoice/showpage?order_code=" + orderCode;
|
|
|
+ } else {
|
|
|
+ window.location.href = "/front/invoice/cantInvoice";
|
|
|
+ }
|
|
|
+ ;
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ //查看发票
|
|
|
+ function checkinvoice(e) {
|
|
|
+ setSessionStorage()
|
|
|
+ var orderCode = $(e).parent(".card-footer").prev(".card-content").find("a").attr("eid");
|
|
|
+ window.location.href = "/front/invoice/check_invoice.html?order_code=" + orderCode
|
|
|
+ }
|
|
|
+</script>
|
|
|
+{{include "/common/baiducc.html"}}
|
|
|
+</body>
|
|
|
+</html>
|