|
@@ -87,12 +87,12 @@
|
|
|
<div>
|
|
|
{{if session "credit_qd"}}
|
|
|
{{if eq (session "credit_qd") "y"}}
|
|
|
- <button style="width:100px" class="btn" disabled>已签到</button>
|
|
|
+ <button id="credit_qd" style="width:100px" class="btn btn-default" onclick='$("#bookin").modal("show");' >查看签到</button>
|
|
|
{{else}}
|
|
|
- <button id="credit_qd" style="width:100px" class="btn btn-primary" onclick="qd()">签到</button>
|
|
|
+ <button id="credit_qd" style="width:100px" class="btn btn-primary" onclick='$("#bookin").modal("show");'>签到</button>
|
|
|
{{end}}
|
|
|
{{else}}
|
|
|
- <button id="credit_qd" style="width:100px" class="btn btn-primary" onclick="qd()">签到</button>
|
|
|
+ <button id="credit_qd" style="width:100px" class="btn btn-primary" onclick='$("#bookin").modal("show");'>签到</button>
|
|
|
{{end}}
|
|
|
</div>
|
|
|
</div>
|
|
@@ -101,7 +101,7 @@
|
|
|
<div style="width:198px;height:40px;text-align:center;">
|
|
|
<div onclick="creditModel(1)" style="float:left;width:90px;border-right:1px">
|
|
|
<div>积分</div>
|
|
|
- <div><i class="glyphicon jinbi" style="width:25px;color:red;font-size:18px"></i><span style="font-weight:normal;">{{session "i_credit"}}</span></div>
|
|
|
+ <div><i class="glyphicon jinbi" style="width:25px;color:red;font-size:18px"></i><span style="font-weight:normal;" class="gold">{{session "i_credit"}}</span></div>
|
|
|
</div>
|
|
|
<div style="height:40px;float:left;width:1px;background-color:#DDDDDD"></div>
|
|
|
<div onclick="window.location.href='/member/accountset/index'" style="float:left;width:105px;">
|
|
@@ -156,6 +156,43 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+<div class="modal fade b-modal in" id="bookin" tabindex="-1" role="dialog" aria-labelledby="bidModalLabel" aria-hidden="true">
|
|
|
+ <div class="modal-dialog">
|
|
|
+ <div class="modal-content">
|
|
|
+ <div class="modal-header u-weightsmall">
|
|
|
+ 查看签到信息
|
|
|
+ <span data-dismiss="modal" aria-label="Close" class="close glyphicon guanbi1"></span>
|
|
|
+ </div>
|
|
|
+ <div class="modal-body">
|
|
|
+ <div class="content">
|
|
|
+ <div>
|
|
|
+ <table width="110%;" style=" margin: 15px auto;" class="credittop">
|
|
|
+ <tr>
|
|
|
+ <td><img src="/images/10jf.png"><div>第一天</div></td>
|
|
|
+ <td><img src="/images/20jf.png"><div>第二天</div></td>
|
|
|
+ <td><img src="/images/30jf.png"><div>第三天</div></td>
|
|
|
+ <td><img src="/images/40jf.png"><div>第四天</div></td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ <table style=" margin: 0px 66px; width: 80%;" class="creditbottom">
|
|
|
+ <tr>
|
|
|
+ <td><img src="/images/50jf.png"><div>第五天</div></td>
|
|
|
+ <td><img src="/images/60jf.png"><div>第六天</div></td>
|
|
|
+ <td><img src="/images/70jf.png"><div>第七天</div></td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ <div class="text-center" style="width:110%;">
|
|
|
+ <button class="btn " style="width:180px;margin-top:10px;" id="bookinbtn" disabled="disabled" style="display:none;">已签到</button>
|
|
|
+ <button class="btn btn-primary " style="width:180px;margin-top:10px;" id="bookinbtn1" style="display:none;">签到</button>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="text-center" style="width:110%;"><small>(已连续签到<span class="days"></span>天)</small></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
<script type="text/javascript">
|
|
|
var role = "{{$s_role}}"=="<nil>"?"":"{{$s_role}}";
|
|
|
var identWay = "{{$identWay}}";
|
|
@@ -270,14 +307,12 @@ var MemberLeftMenu = {
|
|
|
$(function (){
|
|
|
//初始化菜单
|
|
|
MemberLeftMenu.init();
|
|
|
- $.post("/member/credit/sessionQdAjx",{},function(r){
|
|
|
- if(r&&r.result=="y"){
|
|
|
- $("#credit_qd").attr("disabled","disabled");
|
|
|
- $("#credit_qd").removeClass("btn-primary");
|
|
|
- $("#credit_qd").html("已签到")
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
+ changeStatus();
|
|
|
+ $("#bookinbtn1").bind("click",qd);
|
|
|
+ bookinfo();
|
|
|
+ if ($(".gold").text()==""){
|
|
|
+ $(".gold").text("0");
|
|
|
+ }
|
|
|
});
|
|
|
function openSChat() {
|
|
|
try {
|
|
@@ -288,8 +323,9 @@ function openSChat() {
|
|
|
function qd(){
|
|
|
$.post("/member/credit/inCreditAjx",{"param":"qd"},function(r){
|
|
|
if (r.result=="y"){
|
|
|
- window.location.reload()
|
|
|
- }
|
|
|
+ bookinfo(1);
|
|
|
+ }
|
|
|
+ changeStatus();
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -312,4 +348,60 @@ function toMyCredit(){
|
|
|
$("#vipcreditModal").modal("hide");
|
|
|
window.location.href="/member/credit/myCredit";
|
|
|
}
|
|
|
+
|
|
|
+function changeStatus(){
|
|
|
+ $.ajax({
|
|
|
+ url:"/member/credit/sessionQdAjx",
|
|
|
+ success:function(n){
|
|
|
+ if (n.result=="n"){
|
|
|
+ $("#bookinbtn1").show();
|
|
|
+ $("#bookinbtn").hide();
|
|
|
+ }else{
|
|
|
+ $("#credit_qd").removeClass("btn-primary");
|
|
|
+ $("#credit_qd").addClass("btn-default");
|
|
|
+ $("#credit_qd").text("查看签到");
|
|
|
+ $("#bookinbtn").show();
|
|
|
+ $("#bookinbtn1").hide();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+function bookinfo(isInCredit){
|
|
|
+ $.ajax({
|
|
|
+ url:"/member/credit/bookinfo",
|
|
|
+ method:"POST",
|
|
|
+ type:"json",
|
|
|
+ success:function(r){
|
|
|
+ if (r){
|
|
|
+ var d={"1":"一","2":"二","3":"三","4":"四","5":"五","6":"六","7":"七","8":"八","9":"九","0":"零"};
|
|
|
+ $(".days").text(d[""+r[1]]);
|
|
|
+ $(".days").attr("data",r[1]);
|
|
|
+ var images=$("#bookin .content img");
|
|
|
+ if(r[1]>7){
|
|
|
+ r[1]=1;
|
|
|
+ }
|
|
|
+ for(var i=0;i<r[1];i++){
|
|
|
+ var src=images.eq(i).attr("src");
|
|
|
+ if (src.indexOf("ff")==-1){
|
|
|
+ src=src.replace("f","ff");
|
|
|
+ images.eq(i).attr("src",src);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ $(".days").text("0");
|
|
|
+ $(".days").attr("data",0);
|
|
|
+ }
|
|
|
+ if (isInCredit){
|
|
|
+ var g=parseInt($(".gold").text());
|
|
|
+ var days=parseInt($(".days").attr("data"))
|
|
|
+ if (days==0){
|
|
|
+ days=1
|
|
|
+ }
|
|
|
+ var d=parseInt(days*10)
|
|
|
+ var g=g+d;
|
|
|
+ $(".gold").text(g);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
</script>
|