zhangjinkun@topnet.net.cn 9 жил өмнө
parent
commit
83ce5112c5

+ 6 - 1
core/src/qfw/member/credit/creditdetail.go

@@ -57,7 +57,7 @@ func (c *credit) MyCredit() error {
 			}
 			}
 			c.T["B_QD"] = map[string]interface{}{"A": qd, "B": tmp[1]}
 			c.T["B_QD"] = map[string]interface{}{"A": qd, "B": tmp[1]}
 		} else {
 		} else {
-			c.T["B_QD"] = map[string]interface{}{"B": 1}
+			c.T["B_QD"] = map[string]interface{}{"A": false, "B": 1}
 		}
 		}
 		if ret := redis.Get(RedisDB, cd.B_FFW+"_"+userId); ret != nil {
 		if ret := redis.Get(RedisDB, cd.B_FFW+"_"+userId); ret != nil {
 			tmp := util.InterfaceArrTointArr(ret.([]interface{}))
 			tmp := util.InterfaceArrTointArr(ret.([]interface{}))
@@ -120,6 +120,7 @@ func (c *credit) InCreditAjx() error {
 //会员中心更新session签到信息
 //会员中心更新session签到信息
 func (c *credit) SessionQdAjx() error {
 func (c *credit) SessionQdAjx() error {
 	credit_qd := util.ObjToString(c.GetSession("credit_qd"))
 	credit_qd := util.ObjToString(c.GetSession("credit_qd"))
+	result := make(M)
 	if credit_qd == "y" {
 	if credit_qd == "y" {
 		return nil
 		return nil
 	}
 	}
@@ -128,10 +129,14 @@ func (c *credit) SessionQdAjx() error {
 		tmp := util.InterfaceArrTointArr(ret.([]interface{}))
 		tmp := util.InterfaceArrTointArr(ret.([]interface{}))
 		if time.Unix(int64(tmp[0]), 0).Day() == time.Now().Day() {
 		if time.Unix(int64(tmp[0]), 0).Day() == time.Now().Day() {
 			c.Session().UpdateByCustomField("id", userId, "credit_qd", "y")
 			c.Session().UpdateByCustomField("id", userId, "credit_qd", "y")
+			result["result"] = "y"
+		} else {
+			result["result"] = "n"
 		}
 		}
 	} else {
 	} else {
 		c.Session().UpdateByCustomField("id", userId, "credit_qd", "n")
 		c.Session().UpdateByCustomField("id", userId, "credit_qd", "n")
 	}
 	}
+	c.ServeJson(result)
 	return nil
 	return nil
 }
 }
 
 

+ 8 - 3
core/src/web/templates/common/memberleft.html

@@ -81,10 +81,10 @@
 				{{if eq (session "credit_qd") "y"}}
 				{{if eq (session "credit_qd") "y"}}
 					<button style="width:100px" class="btn" disabled>签到</button>
 					<button style="width:100px" class="btn" disabled>签到</button>
 				{{else}}
 				{{else}}
-					<button style="width:100px" class="btn btn-primary" onclick="qd()">签到</button>
+					<button id="credit_qd" style="width:100px" class="btn btn-primary" onclick="qd()">签到</button>
 				{{end}}	
 				{{end}}	
 			{{else}}
 			{{else}}
-				<button style="width:100px" class="btn btn-primary" onclick="qd()">签到</button>
+				<button id="credit_qd" style="width:100px" class="btn btn-primary" onclick="qd()">签到</button>
 			{{end}}	
 			{{end}}	
 			</div>
 			</div>
 			<div>
 			<div>
@@ -228,7 +228,12 @@ var MemberLeftMenu = {
 $(function (){
 $(function (){
 	//初始化菜单
 	//初始化菜单
 	MemberLeftMenu.init();
 	MemberLeftMenu.init();
-	$.post("/member/credit/sessionQdAjx",{},function(r){});
+	$.post("/member/credit/sessionQdAjx",{},function(r){
+		if(r&&r.result=="y"){
+			$("#credit_qd").attr("disabled","disabled");
+			$("#credit_qd").removeClass("btn-primary");
+		}
+	});
 });
 });
 function openSChat() {
 function openSChat() {
 	try {
 	try {

+ 40 - 6
core/src/web/templates/member/credit/mycredit.html

@@ -2,7 +2,7 @@
 <head>
 <head>
 <title>我的积分</title>
 <title>我的积分</title>
 {{include "/common/inc.html"}}
 {{include "/common/inc.html"}}
-<script src="/js/qfwtable.js"></script>
+<script charset="utf-8" src="/js/paging.js"></script>
 <style>
 <style>
 .credit-explain {
 .credit-explain {
     background-color: #FCF8E3;
     background-color: #FCF8E3;
@@ -289,25 +289,35 @@
 					</div>
 					</div>
 				</div>
 				</div>
 				<div class="tab-content hide" id="list_1">
 				<div class="tab-content hide" id="list_1">
-					<div class="tab-pane" >
-						 222
+					<div class="creditinfo">
+						<table class="table a-table" id="credittable">
+							<tr id="tableTitle" style="text-align:center;">
+								<td width="10%"><b>编号</b></td>
+								<td width="25%" align="center"><b>日期</b></td>
+								<td width="35%" align="center"><b>操作</b></td>
+								<td width="15%" align="center"><b>积分</b></td>
+								<td width="15%" align="center"><b>账户余额</b></td>
+							</tr>
+							<tr>
+								<td colspan="5" class="text-center" id="creditPaging"></td>
+							</tr>
+						</table>
 					</div>
 					</div>
 				</div>
 				</div>
 			</div>	
 			</div>	
 		</div>
 		</div>
 	</div>
 	</div>
 </div>
 </div>
- 
 <!-- 底部 -->
 <!-- 底部 -->
 {{include "/common/bottom.html"}}
 {{include "/common/bottom.html"}}
+
 <script type="text/javascript">
 <script type="text/javascript">
 $(function(){
 $(function(){
 	$("#c_0,#c_1").click(function(){
 	$("#c_0,#c_1").click(function(){
 		var _v=$(this).attr("value")
 		var _v=$(this).attr("value")
 		checkContent("list_"+_v)
 		checkContent("list_"+_v)
 	})
 	})
-
-	var AAll="{{.T.AAll}}"
+	var AAll="{{.T.AAll}}"//一次性任务完成,位置切换
 	if (AAll==true){
 	if (AAll==true){
 		rcrw=$("#rcrw").html();
 		rcrw=$("#rcrw").html();
 		csrw=$("#csrw").html();
 		csrw=$("#csrw").html();
@@ -315,6 +325,30 @@ $(function(){
 		$("#csrw").html(rcrw);
 		$("#csrw").html(rcrw);
 	}
 	}
 })
 })
+
+var pag;
+$(function(){
+	pag=new Paging("creditPaging","/member/credit/creditList",null,10,function(r){
+		var html = '';
+		var classattr="rowone";
+		for(var i in r){
+			if((r[i].index%2)>0){
+				classattr="rowone"
+			}else{
+				classattr="rowtwo"
+			}
+			html += '<tr class="'+classattr+'" data-id="'+r[i]._id+'" class="a-border-b">'
+					+'<td width="10%" align="center">'+r[i].index+'</td>'
+					+'<td width="25%" align="center">'+r[i].l_date+'</td>'
+					+'<td width="35%" align="center">'+r[i].s_operation+'</td>'
+					+'<td width="15%" align="center">'+r[i].i_score+'</td>'
+					+'<td width="15%" align="center">'+r[i].i_scorenow+'</td>';
+		}
+		$("#credittable #tableTitle").nextAll("[data-id]").remove();
+		$("#credittable #tableTitle").after(html);
+	});
+});
+
 function checkContent(id){
 function checkContent(id){
 	$(".tab-content").each(function(){
 	$(".tab-content").each(function(){
 	    if($(this).attr("id")!=id){
 	    if($(this).attr("id")!=id){