Pārlūkot izejas kodu

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

wangshan 6 gadi atpakaļ
vecāks
revīzija
4b0663fcb2

+ 12 - 12
src/jfw/front/follow.go

@@ -355,14 +355,14 @@ func (m *Follow) Photo(tp string) error {
 		m.T["l_lastpushtime"] = (*data)["l_lastpushtime"]
 		m.T["a_lastpushids"] = (*data)["a_lastpushids"]
 		l_bidopentime := (*data)["l_bidopentime"]
-		if l_bidopentime != nil {
+		if l_bidopentime != nil && l_bidopentime != "" {
 			m.T["bidopentime"] = util.FormatDateWithObj(&l_bidopentime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(l_bidopentime), 0).Weekday().String())
 			m.T["l_bidopentime"] = l_bidopentime
 		}
-		if l_remindtime := (*data)["l_remindtime"]; l_remindtime != nil {
+		if l_remindtime := (*data)["l_remindtime"]; l_remindtime != nil && l_remindtime != "" {
 			m.T["remindtime"] = util.FormatDateWithObj(&l_remindtime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(l_remindtime), 0).Weekday().String())
 			m.T["l_remindtime"] = l_remindtime
-		} else if l_bidopentime != nil {
+		} else if l_bidopentime != nil && l_bidopentime != "" {
 			date := time.Unix(util.Int64All(l_bidopentime), 0).AddDate(0, 0, -1)
 			m.T["remindtime"] = util.FormatDate(&date, "2006年01月02日 15时") + " " + convertWeekday(date.Weekday().String())
 			m.T["l_remindtime"] = date.Unix()
@@ -394,14 +394,14 @@ func (m *Follow) Photo(tp string) error {
 			}
 			////////////////////////
 			bidopentime := (*data)["bidopentime"]
-			if bidopentime != nil {
+			if bidopentime != nil && bidopentime != "" {
 				m.T["bidopentime"] = util.FormatDateWithObj(&bidopentime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(bidopentime), 0).Weekday().String())
 				m.T["l_bidopentime"] = bidopentime
 			}
-			if remindtime := (*data)["remindtime"]; remindtime != nil {
+			if remindtime := (*data)["remindtime"]; remindtime != nil && remindtime != "" {
 				m.T["remindtime"] = util.FormatDateWithObj(&remindtime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(remindtime), 0).Weekday().String())
 				m.T["l_remindtime"] = remindtime
-			} else if bidopentime != nil {
+			} else if bidopentime != nil && bidopentime != "" {
 				date := time.Unix(util.Int64All(bidopentime), 0).AddDate(0, 0, -1)
 				m.T["remindtime"] = util.FormatDate(&date, "2006年01月02日 15时") + " " + convertWeekday(date.Weekday().String())
 				m.T["l_remindtime"] = date.Unix()
@@ -737,14 +737,14 @@ func (m *Follow) Set(tp, id string) error {
 			mySelf["l_publishtime"] = (*data)["publishtime"]
 			////////////////////////
 			bidopentime := (*data)["bidopentime"]
-			if bidopentime != nil {
+			if bidopentime != nil && bidopentime != "" {
 				m.T["bidopentime"] = util.FormatDateWithObj(&bidopentime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(bidopentime), 0).Weekday().String())
 				m.T["l_bidopentime"] = bidopentime
 			}
-			if remindtime := (*data)["remindtime"]; remindtime != nil {
+			if remindtime := (*data)["remindtime"]; remindtime != nil && remindtime != "" {
 				m.T["remindtime"] = util.FormatDateWithObj(&remindtime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(remindtime), 0).Weekday().String())
 				m.T["l_remindtime"] = remindtime
-			} else if bidopentime != nil {
+			} else if bidopentime != nil && bidopentime != "" {
 				date := time.Unix(util.Int64All(bidopentime), 0).AddDate(0, 0, -1)
 				m.T["remindtime"] = util.FormatDate(&date, "2006年01月02日 15时") + " " + convertWeekday(date.Weekday().String())
 				m.T["l_remindtime"] = date.Unix()
@@ -804,14 +804,14 @@ func (m *Follow) Set(tp, id string) error {
 		m.T["l_lastpushtime"] = (*data)["l_lastpushtime"]
 		m.T["a_lastpushids"] = (*data)["a_lastpushids"]
 		l_bidopentime := (*data)["l_bidopentime"]
-		if l_bidopentime != nil {
+		if l_bidopentime != nil && l_bidopentime != "" {
 			m.T["bidopentime"] = util.FormatDateWithObj(&l_bidopentime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(l_bidopentime), 0).Weekday().String())
 			m.T["l_bidopentime"] = l_bidopentime
 		}
-		if l_remindtime := (*data)["l_remindtime"]; l_remindtime != nil {
+		if l_remindtime := (*data)["l_remindtime"]; l_remindtime != nil && l_remindtime != "" {
 			m.T["remindtime"] = util.FormatDateWithObj(&l_remindtime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(l_remindtime), 0).Weekday().String())
 			m.T["l_remindtime"] = l_remindtime
-		} else if l_bidopentime != nil {
+		} else if l_bidopentime != nil && l_bidopentime != "" {
 			date := time.Unix(util.Int64All(l_bidopentime), 0).AddDate(0, 0, -1)
 			m.T["remindtime"] = util.FormatDate(&date, "2006年01月02日 15时") + " " + convertWeekday(date.Weekday().String())
 			m.T["l_remindtime"] = date.Unix()

+ 12 - 12
src/jfw/modules/app/src/app/front/follow.go

@@ -233,14 +233,14 @@ func (m *Follow) Photo(tp string) error {
 		m.T["l_lastpushtime"] = (*data)["l_lastpushtime"]
 		m.T["a_lastpushids"] = (*data)["a_lastpushids"]
 		l_bidopentime := (*data)["l_bidopentime"]
-		if l_bidopentime != nil {
+		if l_bidopentime != nil && l_bidopentime != "" {
 			m.T["bidopentime"] = util.FormatDateWithObj(&l_bidopentime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(l_bidopentime), 0).Weekday().String())
 			m.T["l_bidopentime"] = l_bidopentime
 		}
-		if l_remindtime := (*data)["l_remindtime"]; l_remindtime != nil {
+		if l_remindtime := (*data)["l_remindtime"]; l_remindtime != nil && l_remindtime != "" {
 			m.T["remindtime"] = util.FormatDateWithObj(&l_remindtime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(l_remindtime), 0).Weekday().String())
 			m.T["l_remindtime"] = l_remindtime
-		} else if l_bidopentime != nil {
+		} else if l_bidopentime != nil && l_bidopentime != "" {
 			date := time.Unix(util.Int64All(l_bidopentime), 0).AddDate(0, 0, -1)
 			m.T["remindtime"] = util.FormatDate(&date, "2006年01月02日 15时") + " " + convertWeekday(date.Weekday().String())
 			m.T["l_remindtime"] = date.Unix()
@@ -272,14 +272,14 @@ func (m *Follow) Photo(tp string) error {
 			}
 			////////////////////////
 			bidopentime := (*data)["bidopentime"]
-			if bidopentime != nil {
+			if bidopentime != nil && bidopentime != "" {
 				m.T["bidopentime"] = util.FormatDateWithObj(&bidopentime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(bidopentime), 0).Weekday().String())
 				m.T["l_bidopentime"] = bidopentime
 			}
-			if remindtime := (*data)["remindtime"]; remindtime != nil {
+			if remindtime := (*data)["remindtime"]; remindtime != nil && remindtime != "" {
 				m.T["remindtime"] = util.FormatDateWithObj(&remindtime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(remindtime), 0).Weekday().String())
 				m.T["l_remindtime"] = remindtime
-			} else if bidopentime != nil {
+			} else if bidopentime != nil && bidopentime != "" {
 				date := time.Unix(util.Int64All(bidopentime), 0).AddDate(0, 0, -1)
 				m.T["remindtime"] = util.FormatDate(&date, "2006年01月02日 15时") + " " + convertWeekday(date.Weekday().String())
 				m.T["l_remindtime"] = date.Unix()
@@ -595,14 +595,14 @@ func (m *Follow) Set(tp, id string) error {
 			mySelf["l_publishtime"] = (*data)["publishtime"]
 			////////////////////////
 			bidopentime := (*data)["bidopentime"]
-			if bidopentime != nil {
+			if bidopentime != nil && bidopentime != "" {
 				m.T["bidopentime"] = util.FormatDateWithObj(&bidopentime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(bidopentime), 0).Weekday().String())
 				m.T["l_bidopentime"] = bidopentime
 			}
-			if remindtime := (*data)["remindtime"]; remindtime != nil {
+			if remindtime := (*data)["remindtime"]; remindtime != nil && remindtime != "" {
 				m.T["remindtime"] = util.FormatDateWithObj(&remindtime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(remindtime), 0).Weekday().String())
 				m.T["l_remindtime"] = remindtime
-			} else if bidopentime != nil {
+			} else if bidopentime != nil && bidopentime != "" {
 				date := time.Unix(util.Int64All(bidopentime), 0).AddDate(0, 0, -1)
 				m.T["remindtime"] = util.FormatDate(&date, "2006年01月02日 15时") + " " + convertWeekday(date.Weekday().String())
 				m.T["l_remindtime"] = date.Unix()
@@ -662,14 +662,14 @@ func (m *Follow) Set(tp, id string) error {
 		m.T["l_lastpushtime"] = (*data)["l_lastpushtime"]
 		m.T["a_lastpushids"] = (*data)["a_lastpushids"]
 		l_bidopentime := (*data)["l_bidopentime"]
-		if l_bidopentime != nil {
+		if l_bidopentime != nil && l_bidopentime != "" {
 			m.T["bidopentime"] = util.FormatDateWithObj(&l_bidopentime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(l_bidopentime), 0).Weekday().String())
 			m.T["l_bidopentime"] = l_bidopentime
 		}
-		if l_remindtime := (*data)["l_remindtime"]; l_remindtime != nil {
+		if l_remindtime := (*data)["l_remindtime"]; l_remindtime != nil && l_remindtime != "" {
 			m.T["remindtime"] = util.FormatDateWithObj(&l_remindtime, "2006年01月02日 15时") + " " + convertWeekday(time.Unix(util.Int64All(l_remindtime), 0).Weekday().String())
 			m.T["l_remindtime"] = l_remindtime
-		} else if l_bidopentime != nil {
+		} else if l_bidopentime != nil && l_bidopentime != "" {
 			date := time.Unix(util.Int64All(l_bidopentime), 0).AddDate(0, 0, -1)
 			m.T["remindtime"] = util.FormatDate(&date, "2006年01月02日 15时") + " " + convertWeekday(date.Weekday().String())
 			m.T["l_remindtime"] = date.Unix()

+ 3 - 0
src/jfw/modules/app/src/app/front/myorder.go

@@ -302,6 +302,7 @@ func (m *MyOrder) DeleteOrder() error {
 		}
 		queryM := map[string]interface{}{}
 		queryM["user_id"] = userId
+		nextPage := false
 		// 0全部 1未支付 2已支付
 		typ := m.GetString("type")
 		pageNum, _ := m.GetInteger("pageNum")
@@ -319,6 +320,7 @@ func (m *MyOrder) DeleteOrder() error {
 		haveNextPage, res, _ := m.Datas(queryM, pageNum)
 		if len(res) > 0 {
 			res = res[0:1]
+			nextPage = true
 		}
 		if res != nil {
 			for _, v := range res {
@@ -347,6 +349,7 @@ func (m *MyOrder) DeleteOrder() error {
 			"success":     boo,
 			"res":         res,
 			"hasNextPage": haveNextPage,
+			"nextPage":    nextPage,
 		})
 	}
 	return nil

+ 31 - 9
src/jfw/modules/app/src/web/templates/dataExport/dataExport_toMyOrder.html

@@ -93,6 +93,30 @@
 			var typ=0;
 			var deleteIndex=0;
 			
+			function appendList(listhtml){
+				listhtml.children(".card-content").on("click", function(event){
+					var eid = $(this).find(".media").attr("eid");
+					beforeJump(eid);
+				});
+				$(".card_lists").append(listhtml);
+			}
+			
+			function beforeJump(eid){
+				setSessionStorage();
+				window.location.href="/jyapp/front/myOrder/toOrderDetail/"+eid;
+			}
+			
+			function setSessionStorage(){
+				if(sessionStorage){
+					sessionStorage.orderDataCache = JSON.stringify(dataCache);
+					sessionStorage.orderPageIndexCache = pageIndex;
+					sessionStorage.orderHasNextPage = hasNextPage;
+					sessionStorage.orderCount = count;
+					sessionStorage.orderScrollTop =scrollTop;
+					sessionStorage.orderTabActive=$("ul .active").index();
+				}
+			}
+			
 			function deleteOrder(id,obj) {
 			        $.confirm({
 			            title: '取消购买',
@@ -115,7 +139,8 @@
 			                                	dataCache.splice(deleteIndex,1)
 			                                	if(data.res!=null){
 			                                		dataCache.push(data.res[0])
-			                                		hasNextPage=data.hasNextPage;
+			                                		//hasNextPage=data.hasNextPage;
+			                                		hasNextPage=data.nextPage;
 			                                	}
 			                                    self.remove();
 			                                    $.alert({
@@ -224,21 +249,16 @@
 																							+'</div>'
 																						+'</a>'
 																						+'<div class="price">'
-																							//+'<span class="initial">原价:¥'+orderMoney+'</span>'
 																							+'<strong class="current">¥'+orderMoney+'</strong>'
 																						+'</div>'
 																					+'</div>'
-																					/*
-																					+'<div class="card-footer">'
-																						+'<a href="#" class="btn cancle">取消购买</a>'
-																						+'<a href="pay_order.html" class="btn pay">去支付</a>'
-																					+'</div>'
-																					*/
 																					+iconHtml
 																				+'</div>'
 																	
 																		}
-																		$(".card_lists").append(listhtml);
+																		//$(".card_lists").append(listhtml);
+																		//删除完成后补的订单仍可点击
+																		appendList($(listhtml))
 			                                                    	}
 			                                                   
 			                                                }
@@ -570,6 +590,7 @@
 				}
 				
 				//
+				/*
 				function appendList(listhtml){
 					listhtml.children(".card-content").on("click", function(event){
 						var eid = $(this).find(".media").attr("eid");
@@ -593,6 +614,7 @@
 						sessionStorage.orderTabActive=$("ul .active").index();
 					}
 				}
+				*/
 				
 					//下拉刷新
 		function reloadFirstPage(me){