2 lines
8.0 KiB
JavaScript
2 lines
8.0 KiB
JavaScript
|
var datime,deid,leftTime,urls=location.search,channels=getchannel();if(urls.indexOf("?")!=-1)var ster=urls.substr(1),sty=ster.split("&"),cide=sty[0].split("cid="),bdid=sty[1].split("did="),uid=sty[2].split("uid=");$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/operate/bargainDetail?projectid=43",data:{bargainActivityId:bdid[1],userId:uid[1]},dataType:"json",async:!1,success:function(s){deid=s.data.bargainFoundId}});function datlts(){$.ajax({headers:{token:getCookie("token")},type:"GET",url:"/api/operate/bargainFollowed?projectid=43",data:{bargainFoundId:deid},dataType:"json",async:!0,success:function(s){var a=s.data;datime=s.timeStamp,console.log(a);var n=new Date(datime),t=n.getTime(),i=new Date(a.gmtEnd),c=i.getTime();leftTime=c-t;var p=a.dealMoney,u=a.oldPrice,d=window.location.href,f=u-p,m=a.oldPrice-a.price,v=m-f,b=f/m*100,y=a.courseName,w=a.cover,x=new Array;x[0]={goodsId:cide[1],price:p,goodsUrl:d,goodsType:1,goodsName:y,cover:w,operateType:4};var e="";e+='<div class="topcover">',e+=" <img src="+((window.cdnPath||"")+w)+" />",e+=' <p class="ataser">\u8DDD\u79BB\u780D\u4EF7\u7ED3\u675F\u8FD8\u6709',e+=' <span id="_d">00</span>\u5929',e+=' <span id="_h">00</span>:',e+=' <span id="_m">00</span>:',e+=' <span id="_s">00</span>',e+=" </p>",e+=' <p class="bottke">'+y+"</p>",e+="</div>",e+='<div class="stmian">',e+=' <div class="hexes">',e+=' <span class="mt10">\u539F\u4EF7</span>',e+=" <span>\uFFE5"+(a.oldPrice/100).toFixed(2)+"</span>",e+=" </div>",e+=' <div class="hexes">',e+=' <span class="mt10">\u53EF\u780D\u81F3</span>',e+=" <span>\uFFE5"+(a.price/100).toFixed(2)+"</span>",e+=" </div>",e+=' <div class="hexes">',e+=' <span class="mt10">\u5F53\u524D\u4EF7</span>',e+=" <span>\uFFE5"+(p/100).toFixed(2)+"</span>",e+=" </div>",e+=' <div class="ytdsr"><span style="width:'+b+'%"></span></div>',v!=0&&(e+=' <p class="xasrt">\u5DF2\u780D<span class="redes">'+(f/100).toFixed(2)+'</span>\u5143\uFF0C\u8FD8\u5DEE<span class="redes">'+(v/100).toFixed(2)+"</span>\u5143</p>"),e+="</div>",e+='<div class="divbtn">',a.type==0?v==0?(e+=' <span style="margin:0 0 15px 43%;float:left;">\u780D\u4EF7\u5DF2\u5B8C\u6210</span>',e+=' <a class="mycutbtn hasrer" style="color:#fff;border:none;" href="javascript:void(0);">\u6211\u4E5F\u8981\u780D\u4EF7></a>',e+="</div>"):(e+=' <div class="retset">',e+=' <img src="'+((window.cdnPath||"")+a.headPortrait)+'" />',e+=' <span class="kasnry">\u4EB2\uFF0C\u5FEB\u5E2E\u6211\u780D\u4E00\u5200\u5427\uFF01</span>',e+="</div>",e+=' <a class="sharebtn" href="javascript:void(0);">\u5E2E\u4ED6\u780D\u4E00\u5200</a>',e+=' <a class="mycutbtn" href="javascript:void(0);">\u6211\u4E5F\u8981\u780D\u4EF7></a>',e+="</div>"):a.type==1?(e+=' <div class="retset">',e+=' <p class="atxte">\u4F60\u5DF2\u7ECF\u5E2E\u4ED6\u780D\u4E86<span class="redes">'+(a.bargainFollows[0].price/100).toFixed(2)+"</span>\u5143\uFF0C\u4E0D\u5982\u81EA\u5DF1\u4E5F\u6765\u4E00\u5355\u5427\uFF01</p>",e+="</div>",e+=' <a class="sharebtn" href="javascript:void(0);">\u6211\u4E5F\u8981\u780D\u4EF7></a>',e+="</div>"):a.type==2&&(v==0?(e+='<span style="margin:0 0 15px 43%;float:left;">\u5DF2\u780D\u81F3\u6700\u4F4E</span>',e+=' <a class="openkebtn hasrer" href="javascript:void(0);">\u7ACB\u5373\u5F00\u901A</a>',e+="</div>"):(e+=' <a class="sharebtn" href="javascript:void(0);">\u5206\u4EAB\u7ED9\u597D\u53CB\uFF0C\u9080\u8BF7\u780D\u4E00\u5200</a>',e+=' <a class="openkebtn" href="javascript:void(0);">\u4E0D\u780D\u4E86\uFF0C\u6309\u5F53\u524D\u4EF7\u5F00\u901A ></a>',e+="</div>")),e+='<div class="botlist">',e+=" <h2>\u780D\u4EF7\u699C</h2>",e+=' <ul class="uclist">';for(var g=0,T=a.bargainFollows.length;g<T;g++){var l=a.bargainFollows[g],I=formatDate(l.gmtCreate);e+=' <li class="lishow">',e+=" <img src="+((window.cdnPath||"")+l.headPortrait)+" />",e+=' <div class="jusrte">',l.realName==""?e+=' <p class="pnamt">'+l.loginName+"</p>":e+=' <p class="pnamt">'+l.realName+"</p>",e+=' <p class="pnamt">'+I+"</p>",e+=" </div>",e+=' <span class="woret">'+(l.price/100).toFixed(2)+"\u5143</span>",e+=' <span class="wistde">\u5E
|