var user_id,token,source = '0',already_html="",obtained_html=""; var qs = parseQueryString(location.href); $().ready(function(){ $(".copyTarget").text(getLocation()+"inviteWeixin.html?user_id=" + user_id + '&source=' + source) inviteInformation(); }) $(".hasDone").on("click",function(){ $(this).addClass("active").siblings().removeClass("active"); $(".noList").hide() $(".doneList").show(); }) $(".didnot").on("click",function(){ $(this).addClass("active").siblings().removeClass("active") $(".noList").show() $(".doneList").hide(); }) function getTokenAddUserId (data) {//app token 回调 var dataes = JSON.parse(data) token = dataes.token; user_id = dataes.user_id; if(dataes.source){source = dataes.source} inviteInformation();//获得的金币数量 } function inviteInformation () { //获取邀请好友数量以及获得的金币数量 $.ajax({ url:'/user/inviteInformation', type:'get', dataType:'json', headers:{ token:qs.token, source:qs.source?qs.source:"", version:qs.version?qs.version:"" }, success: function (res){ if(res && res.errno == 0){ $(".total").html(res.rst.invite_gold?res.rst.invite_gold:0); $(".register .num").html(res.rst.invite_num?res.rst.invite_num:0); $(".besure .num").html(res.rst.auth_num?res.rst.auth_num:0); $(".recharge .num").html(res.rst.recharge_num?res.rst.recharge_num:0) var already=res.rst.already_obtained;//获得奖励 var not_obtained=res.rst.not_obtained;//未获得奖励 for(var i in already) { already_html+= '