Bläddra i källkod

Merge branch 'dev2.8' of http://192.168.3.207:10080/qmx/jy into dev2.8

xuzhiheng 6 år sedan
förälder
incheckning
3f111b6ac1
2 ändrade filer med 41 tillägg och 62 borttagningar
  1. 25 1
      src/jfw/front/wxMyOrder.go
  2. 16 61
      src/web/templates/weixin/dataExport/dataExport_toMyOrder.html

+ 25 - 1
src/jfw/front/wxMyOrder.go

@@ -137,7 +137,31 @@ func (w *WxMyOrder) MyOrderPaging() error {
 	} else {
 		queryM["order_status"] = map[string]interface{}{"ne": orderStatus_deleted}
 	}
-	res, haveNextPage, _ := w.Datas(queryM, pageNum)
+	log.Println("pagenum:", pageNum)
+	haveNextPage, res, _ := w.Datas(queryM, pageNum)
+	log.Println(len((res)))
+	if res != nil {
+		for _, v := range res {
+			filter_publishtime := v["filter_publishtime"]
+			if filter_publishtime != nil || filter_publishtime != "" {
+				timeArr := strings.Split(filter_publishtime.(string), "_")
+				if len(timeArr) == 2 {
+					start, err := strconv.ParseInt(timeArr[0], 10, 64)
+					end, erro := strconv.ParseInt(timeArr[1], 10, 64)
+					if err == nil && erro == nil {
+						v["filter_publishtime"] = util.FormatDateByInt64(&start, layout_date) + "-" + util.FormatDateByInt64(&end, layout_date)
+					}
+				}
+			}
+			orderMoney := v["order_money"]
+			if orderMoney != nil {
+				v["order_money"] = float64(orderMoney.(int64)) / 100
+			}
+			if v["id"] != nil && orderMoney != nil && v["order_code"] != nil {
+				v["token"] = public.GetWaitPayToken(v["id"].(int64), int(orderMoney.(int64)), v["order_code"].(string), queryM["user_openid"].(string))
+			}
+		}
+	}
 	w.ServeJson(map[string]interface{}{
 		"haveNextPage": haveNextPage,
 		"res":          res,

+ 16 - 61
src/web/templates/weixin/dataExport/dataExport_toMyOrder.html

@@ -7,7 +7,7 @@
 		<meta name="apple-mobile-web-app-status-bar-style" content="black">
 		<script src="/wx_dataExport/js/rem.js"></script>
 		<script src="/js/jquery-3.2.1.min.js"></script>
-		<script src="/js/dropload.js?v=16"></script>
+		<script src="/js/dropload.js?v=271"></script>
 		<link rel="stylesheet" type="text/css" href="/wx_dataExport/css/base.css" />
 		<link rel="stylesheet" type="text/css" href="/wx_dataExport/iconfont/iconfont.css" />
 		<link rel="stylesheet" href="/wx_dataExport/css/order_list.css">
@@ -91,7 +91,7 @@
 			                                    self.remove();
 			                                    $.alert({
 			                                        title:"",
-			                                        content:"删除成功!",
+			                                        content:"取消成功!",
 			                                        buttons: {
 			                                            ok: {
 			                                                text: '确认',
@@ -151,6 +151,9 @@
 //				$(".buttons-tab ul li").on("click",function(){
 //					var index = $(this).index();
 //				})
+				$(".media").on("click",function(){
+					alert("~~~")
+				})
 
 			/*------------------------------------------------------------------*/	
 				//查询订单ajax
@@ -167,6 +170,7 @@
 						dataType: 'json',
 						success:function(data){
 							var list=data.res;
+							pageIndex=2;
 						    haveNextPage=data.haveNextPage;
 							if (data.res&&data.res.length>0){
 								structureHtml(data.res);	
@@ -193,80 +197,31 @@
 						return
 					}
 					console.log(haveNextPage)
-//					if(haveNextPage){
-//						console.log("!")
-////						setTimeout(function(){
-//							wxflag = $('#order_list > .main > .tabs').dropload({
-//						        scrollArea : window,
-//						        loadDownFn : function(me){
-//									if(wxflag == null){
-//										wxflag = me;
-//									}
-//									console.log("pageIndex:"+pageIndex+"==="+typ)
-//						            $.ajax({
-//						                type: 'post',
-//						                url: '/front/wxMyOrder/myOrder/myOrderPaging',
-//										data: {"pageNum": pageIndex,"type":typ},
-//						                dataType: 'json',
-//						                success: function(data){
-//						                	console.log("===="+data.hasNextPage)
-//											//没有数据
-//											if(data.res.length==0){
-//												noMoreData(me);
-//											}else{
-//												pageIndex++;
-//												structureHtml(data["res"]);
-//												if(data.hasNextPage){
-//													// 每次数据插入,必须重置
-//													me.resetload();
-//												}else{
-//													noMoreData(me);
-//												}
-//											}
-//						                },
-//						                error: function(xhr, type){
-//											noMoreData(me);
-//						                }
-//						            });
-//						        }
-//						    });
-////						    },1500)	
-//						}else{
-//							wxflag = $('.tabs').dropload({
-//						        scrollArea : window,
-//						        loadDownFn : function(me){
-//									if(wxflag == null){
-//										wxflag = me;
-//									}
-//									noMoreData(me);
-//						        }
-//						    });
-//							noMoreData(wxflag);
-//						}
+
 						if(haveNextPage){
 							setTimeout(function(){
+								console.log("======")
 								wxflag = $('#order_list > .main > .tabs').dropload({
 							        scrollArea : window,
 							        loadDownFn : function(me){
-										if(wxflag == null){
-											wxflag = me;
-										}
-//										me.$domDown.html(me.opts.domDown.domLoad);
-//										me.isData = true;
-//										me.isLockUp = false;
-//										me.isLockDown = false;
+//										if(wxflag == null){
+//											wxflag = me;
+//										}
 										$.ajax({
 											type: 'post',
 											url: '/front/wxMyOrder/myOrder/myOrderPaging',
 											data: {"pageNum": pageIndex,"type":typ},
 											dataType: 'json',
 											success: function(data){
+//												for(var i=0;i<data.res.length;i++){
+//													alert(data.res[i]["order_money"])
+//												}
 												//没有数据
-												if(data.data.length==0){
+												if(data.res.length==0){
 													noMoreData(me);
 												}else{
 													pageIndex++;
-													structureHtml(data["res"]);
+													structureHtml(data.res);
 													if(data.hasNextPage){
 														// 每次数据插入,必须重置
 														me.resetload();