lottery.html 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="x-ua-compatible" content="IE=edge" >
  6. <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>
  7. <title>coderutil出品幸运抽奖系统</title>
  8. <link rel="shortcut icon" href="/favicon.ico" />
  9. <link rel="bookmark" href="/favicon.ico" />
  10. <link rel="stylesheet" href="/css/common/common.css">
  11. <link href="/css/client/luck.css" rel="stylesheet" type="text/css" />
  12. <link href="/ref/layui-v2.6.8/layui/css/layui.css" rel="stylesheet" type="text/css" />
  13. <script src="/ref/jquery/jquery-3.4.1.js" type="text/javascript"></script>
  14. <script src="/ref/layui-v2.6.8/layui/layui.js" type="text/javascript"></script>
  15. <script src="/js/common/common.js" type="text/javascript"></script>
  16. <style>
  17. .popup {
  18. background-color: transparent;/*背景透明*/
  19. box-shadow: 0 0 0 rgba(0,0,0,0);/*前景无阴影*/
  20. }
  21. .popup {
  22. background-color: transparent;/*背景透明*/
  23. box-shadow: 0 0 0 rgba(0,0,0,0);/*前景无阴影*/
  24. }
  25. .close-popup-btn {
  26. width: 30px;
  27. height: 30px;
  28. background-color: transparent;
  29. border: 2px solid white;
  30. border-radius: 100px;
  31. }
  32. .userOrderMaxHeight {
  33. max-height: 420px;
  34. overflow-y: hidden;
  35. }
  36. #time1LuckBtn {
  37. position: absolute;
  38. right: 30px;
  39. top: 30px;
  40. height: 70px;
  41. width: 200px;
  42. border: none;
  43. border-radius: 5px;
  44. font-size: 20px;
  45. color: white;
  46. font-weight: 600;
  47. box-shadow: 0px 0px 10px #dedede;
  48. background: #11998e; /* fallback for old browsers */ background: -webkit-linear-gradient(to right, rgb(17, 153, 142), rgb(56, 239, 125)); /* Chrome 10-25, Safari 5.1-6 */ background: linear-gradient(to right, rgb(17, 153, 142), rgb(56, 239, 125)); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
  49. }
  50. #time10LuckBtn {
  51. position: absolute;
  52. left: 30px;
  53. top: 30px;
  54. height: 70px;
  55. width: 250px;
  56. border: none;
  57. border-radius: 5px;
  58. font-size: 20px;
  59. color: white;
  60. font-weight: 600;
  61. background: #360033; /* fallback for old browsers */ background: -webkit-linear-gradient(to right, rgb(54, 0, 51), rgb(11, 135, 147)); /* Chrome 10-25, Safari 5.1-6 */ background: linear-gradient(to right, rgb(54, 0, 51), rgb(11, 135, 147)); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
  62. box-shadow: 0px 0px 10px #dedede;
  63. }
  64. #time1LuckBtn img, #time10LuckBtn img {
  65. margin: 0px 5px 0px 15px;
  66. }
  67. .time10result-container {
  68. position: relative;
  69. width: 120px;
  70. background-color: transparent;
  71. height: 120px;
  72. float: left;
  73. margin: 0px 0px 30px 0px;
  74. text-align: center;
  75. overflow: hidden;
  76. }
  77. </style>
  78. </head>
  79. <body style="background-color: whitesmoke">
  80. <center>
  81. <div id="header" style="position: fixed; top: 0px; left: 0px; width: 100%; height: 60px; z-index: 1999"></div>
  82. <div class="luck-body"><div class="div-1190px">
  83. <!-- 抽奖器模块 -->
  84. <div class="luck-player-module" style="background-image: url('http://coderutil.oss-cn-beijing.aliyuncs.com/bbs-image/file_7ce6e36d2bf44e689a6d078e690e8202.png')">
  85. <div class="luck-player-top">
  86. <span class="luck-title"><span class="layui-badge" id="activityStatus">进行中</span> <span id="activityName"></span></span>
  87. </div>
  88. <!-- ali player -->
  89. <div class="luck-box">
  90. <div class="luck-container">
  91. <div id="luck-container"></div>
  92. <button class="luck-border"></button>
  93. <button class="luck-btn" id="luck-btn">抽奖</button>
  94. </div>
  95. <div class="luck-reduce-integral-rule">本期每抽奖一次需 <b id="reduce-count">-</b> ¥</div>
  96. <div class="luck-item-count-container">
  97. <div class="luck-item-count-container-line" style="color: white; font-weight: 700">
  98. <span class="luck-item-rule-left">奖品名称</span>
  99. <span class="luck-item-rule-right">奖品数量</span>
  100. </div>
  101. <div id="luck-item-count-container">
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. <!-- 抽奖结果 -->
  107. <div class="luck-recommend-module">
  108. <span class="luck-recommend-title">最近中奖 TOP5</span>
  109. <div class="winPrizeListContainer">
  110. <div class="winPrizeListContainerList" id="winPrizeListContainerList">
  111. </div>
  112. <div class="ww-recommend">
  113. <div class="wwads-cn wwads-horizontal" data-id="181" style="max-width: 300px; margin-top:0px;"></div>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. <div class="unlogin-luck-mode" id="unlogin-mode">未登录, 没有查看权限!</div>
  119. <div class="unlogin-luck-mode" id="end-mode" style="display: none">活动已经结束</div>
  120. <div class="unlogin-luck-mode" id="prepare-mode" style="display: none">活动筹备中</div>
  121. </div>
  122. <!-- 奖品清单 -->
  123. <div class="luck-list-module"><div class="div-1190px">
  124. <div class="luck-list-box">
  125. <div class="luck-list-title-box">
  126. <span class="luck-list-title" data-v-04c4730d="">本期奖品清单</span>
  127. </div>
  128. <div id="luck-lists">
  129. </div>
  130. <div style="clear: both"></div>
  131. </div>
  132. </div>
  133. </div>
  134. <!-- 我的本期中奖订单 -->
  135. <div class="luck-list-module"><div class="div-1190px">
  136. <div class="luck-list-box">
  137. <div class="luck-list-title-box">
  138. <span class="luck-list-title" data-v-04c4730d="">我的中奖记录</span>
  139. <a style="float: right" onclick="masterWeixin()">兑换 <i class="layui-icon">&#xe602;</i> </a>
  140. </div>
  141. <div id="curr-user-order-lists" class="userOrderMaxHeight">
  142. </div>
  143. <div style="clear: both"></div>
  144. <a id="showAllOrderBtn" style="display: none" onclick="$('#curr-user-order-lists').removeClass('userOrderMaxHeight'); $(this).hide();">
  145. <p style="height: 50px; line-height: 50px;">
  146. 展开查看全部 <i class="layui-icon">&#xe61a;</i>
  147. </p>
  148. </a>
  149. </div>
  150. </div></div>
  151. <!-- 往期活动 -->
  152. <div class="luck-list-module"><div class="div-1190px">
  153. <div class="luck-list-box">
  154. <div class="luck-list-title-box">
  155. <span class="luck-list-title" data-v-04c4730d="">往期活动</span>
  156. </div>
  157. <div id="history-luck-lists">
  158. </div>
  159. <div style="clear: both"></div>
  160. </div>
  161. </div></div>
  162. <div style="width: 100%; line-height: 50px; margin-top: 50px;">
  163. © 2023 https://www.coderutil.com
  164. </div>
  165. </center>
  166. </body>
  167. <script>
  168. $("#header").load("/client/header");
  169. var index = 1;
  170. var redu = 4;
  171. var time = 85;
  172. var reduceCount = 0;
  173. var luckRandomCount = 300;
  174. var luckId;
  175. var luckIdArr;
  176. var luckTimes = 1;
  177. var enableLuck = false;
  178. var running = false;
  179. var itemMap = new HashMap();
  180. var activityId = getUserParamByName("id");
  181. var historyLastId = '';
  182. var money = 0;
  183. var walletBalance = 0;
  184. function refreshUserWalletBalance(balance) {
  185. this.walletBalance = balance;
  186. $("#walletBalance").text(balance)
  187. }
  188. if (activityId == '') {
  189. $.ajax({
  190. url: "/api/lottery/activity/lastId",
  191. type: "get",
  192. success: function (data) {
  193. data = eval(data);
  194. if (data.success) {
  195. activityId = data.data;
  196. initLotteryInfo();
  197. loadActivityOrderList();
  198. loadCurrentUserActivityOrderList();
  199. }
  200. }
  201. })
  202. } else {
  203. initLotteryInfo();
  204. loadActivityOrderList();
  205. loadCurrentUserActivityOrderList();
  206. }
  207. function initLotteryInfo() {
  208. $.ajax({
  209. url: "/api/lottery/activity/detail/" + activityId,
  210. type: "get",
  211. success: function (data) {
  212. data = eval(data);
  213. if (data.success) {
  214. data = data.data;
  215. if (data == null) {
  216. layer.msg("活动未开启");
  217. return;
  218. }
  219. var status = data.status;
  220. money = data.money;
  221. refreshUserWalletBalance(data.userInitWalletBalance);
  222. $("#activityStatus").text(data.statusName);
  223. $("#activityName").text(data.name);
  224. $("#reduce-count").text(data.money);
  225. setDisableLuckStateByActivityStatus();
  226. if (status == 1) {
  227. $("#prepare-mode").show();
  228. $("#activityStatus").addClass("layui-bg-orange");
  229. } else if (status == 2) {
  230. setEnableLuckState();
  231. } else if (status == 3) {
  232. $("#end-mode").show();
  233. $("#activityStatus").addClass("layui-bg-cyan");
  234. } else if (status == 4) {
  235. $("#activityStatus").addClass("layui-bg-gray");
  236. }
  237. $.each(data.items, function (index, item) {
  238. var itemElem = "<div class=\"luck-item luck-item-"+item.slot+"\" id=\"luck-item-"+item.slot+"\">\n" +
  239. " <img src=\""+item.icon+"\">\n" +
  240. " <p class=\"line1ppp\">"+item.name+"</p>\n" +
  241. " </div>";
  242. var itemStock = "<div class=\"luck-item-count-container-line\">\n" +
  243. " <span class=\"luck-item-rule-left line1ppp\">"+item.name+"</span>\n" +
  244. " <span class=\"luck-item-rule-right\">"+item.stock+"</span>\n" +
  245. " </div>";
  246. var itemGood = "<div class=\"luck-list\">\n" +
  247. " <img class=\"recommend-luck-cover\"\n" +
  248. " src=\""+item.cover+"?x-oss-process=image/resize,m_fill,w_250,h_150\">\n" +
  249. " <div class=\"title-container\"><span class=\"title\">"+item.name+"</span></div>\n" +
  250. " <span class=\"luck-item-count\"><span class=\"layui-badge\">X "+item.stock+"</span></span>\n" +
  251. " </div>";
  252. $("#luck-container").append(itemElem);
  253. $("#luck-item-count-container").append(itemStock);
  254. $("#luck-lists").append(itemGood);
  255. // 维护奖品信息到map
  256. itemMap.put(item.id, item);
  257. })
  258. $.each(data.sponsors, function (index, sponsor) {
  259. var hrefAttr = "";
  260. if (sponsor.url != null && sponsor.url != '') {
  261. hrefAttr = "href='"+sponsor.url+"'"
  262. }
  263. var sponsorElem = "<a "+hrefAttr+" target=\"_blank\">\n" +
  264. " <div class=\"sponsor-container\">\n" +
  265. " <img src=\""+sponsor.logo+"?x-oss-process=image/resize,m_fill,w_50,h_50\" class=\"sponsor-logo\">\n" +
  266. " <p class=\"sponsor-content line1ppp\">"+sponsor.content+"</p>\n" +
  267. " </div>\n" +
  268. " </a>";
  269. $("#sponsor-lists").append(sponsorElem);
  270. })
  271. // 点击开始抽奖
  272. $("#luck-btn").on('click', function () {
  273. var popupContent =
  274. "<div style='width: 540px; height: 130px; background-color: white; border-radius: 10px;'>" +
  275. "<button id='time1LuckBtn'>抽一次 <img src='http://coderutil.oss-cn-beijing.aliyuncs.com/bbs-image/file_75493b4c9d2a40be8b96b3ea00b13793.png' style='height: 30px;'><b style='color: #ee954d'>"+reduceCount+"</b></button>" +
  276. "<button id='time10LuckBtn'>十连抽 <img src='http://coderutil.oss-cn-beijing.aliyuncs.com/bbs-image/file_75493b4c9d2a40be8b96b3ea00b13793.png' style='height: 30px;'><b style='color: #ee954d'>"+(reduceCount * 10)+"</b></button>"+
  277. "</div>";
  278. layer.open({
  279. type: 1,
  280. title: false,
  281. closeBtn: 0,
  282. shadeClose: true,
  283. area: ['540px', '130px'],
  284. content: popupContent
  285. });
  286. $("#time1LuckBtn").on('click', function () {
  287. layer.closeAll();
  288. startLuckDraw(1);
  289. })
  290. $("#time10LuckBtn").on('click', function () {
  291. layer.closeAll();
  292. startLuckDraw(10);
  293. })
  294. })
  295. }
  296. }, error: function () {
  297. }
  298. })
  299. }
  300. function startLuckDraw(times) {
  301. if (!isEnableLuck()) {
  302. layer.msg("活动处于非抽奖状态");
  303. return;
  304. }
  305. if (this.isRunning()) {
  306. return;
  307. }
  308. var validateBalance = money * times;
  309. if (walletBalance < validateBalance) {
  310. layer.msg("钱包余额不足");
  311. return;
  312. }
  313. setDisableLuckState();
  314. // 抽奖api
  315. var luckApi = "/api/lottery/luckDraw/" + activityId;
  316. if (times == 10) {
  317. luckApi = "/api/lottery/luckDraw/" + activityId + "/" + times;
  318. }
  319. luckTimes = times;
  320. // 抽奖之前先重置抽奖结果
  321. resetLuckResult();
  322. $.ajax({
  323. url: luckApi,
  324. type: "post",
  325. success: function (data) {
  326. data = eval(data);
  327. if (data.success) {
  328. // 获取到抽奖结果
  329. data = data.data;
  330. if (times == 1) {
  331. luckId = data.itemId;
  332. refreshUserWalletBalance(data.walletBalance);
  333. } else if (times == 10) {
  334. luckIdArr = data.itemIdList;
  335. refreshUserWalletBalance(data.walletBalance);
  336. } else {
  337. layer.msg("不支持的抽奖个数!");
  338. }
  339. }
  340. }
  341. })
  342. initLuckItemSelectedState();
  343. initLuckParam();
  344. luckAnimation();
  345. }
  346. function resetLuckResult() {
  347. luckId="";
  348. luckIdArr="";
  349. }
  350. function luckResultSelected(id) {
  351. $("#luck-item-"+id).css("background-color", "#93e3ad");
  352. }
  353. function initLuckParam() {
  354. luckRandomCount = 300;
  355. index = ((++index) % 8 + 1);
  356. }
  357. function initLuckItemSelectedState() {
  358. $(".luck-item").css("background-color", "#ffffff");
  359. }
  360. /**
  361. * 设置不允许抽奖
  362. */
  363. function setDisableLuckState() {
  364. running = true;
  365. $(".luck-btn").text("抽奖中");
  366. $(".luck-btn").css("background-color", "#265732");
  367. }
  368. function setDisableLuckStateByActivityStatus() {
  369. enableLuck = false;
  370. $(".luck-btn").text("暂停");
  371. $(".luck-btn").css("background-color", "#265732");
  372. }
  373. /**
  374. * 设置允许抽奖
  375. */
  376. function setEnableLuckState() {
  377. running = false;
  378. enableLuck = true;
  379. $(".luck-btn").text("抽奖");
  380. $(".luck-btn").css("background-color", "#58d576");
  381. }
  382. function isRunning() {
  383. return running;
  384. }
  385. function isEnableLuck() {
  386. return enableLuck;
  387. }
  388. function luckAnimation() {
  389. initLuckItemSelectedState();
  390. if (luckRandomCount <= 0) {
  391. showLuckResult();
  392. // luckResultSelected(luckId);
  393. setEnableLuckState();
  394. // 重新加载活动下的中奖名单
  395. loadActivityOrderList();
  396. // 重新加载我的中奖记录
  397. loadCurrentUserActivityOrderList();
  398. } else {
  399. var tempId = ((++index) % 8 + 1);
  400. luckResultSelected(tempId);
  401. luckRandomCount -= redu;
  402. setTimeout("luckAnimation()", time);
  403. }
  404. }
  405. function showLuckResult() {
  406. if (luckTimes == 1) {
  407. var luckItem = itemMap.get(luckId);
  408. var popupContent =
  409. "<div style='width: 500px; height: 300px; text-align: center; overflow: hidden'>" +
  410. "<p style='line-height: 80px; font-size: 30px; color: white; font-weight: 700'>恭喜你,本次抽中</p>" +
  411. "<img src=\""+luckItem.icon+"\" style='height: 150px;'>" +
  412. "<p style='line-height: 80px; font-size: 20px; color: white; font-weight: 500'>"+luckItem.name+"</p>" +
  413. "</div>"+
  414. "<p style='width: 500px; height: 30px; margin-top: 20px; text-align: center'>" +
  415. "<button onclick='layer.closeAll()' class='close-popup-btn'>" +
  416. "<i class=\"layui-icon\" style='font-size: 20px; color: white'>&#x1007;</i>" +
  417. "</button></p>";
  418. layer.open({
  419. type: 1,
  420. title: false,
  421. closeBtn: 0,
  422. shadeClose: false,
  423. area: ['500px', '450px'],
  424. skin: 'popup',
  425. content: popupContent
  426. });
  427. } else if (luckTimes == 10) {
  428. var popupContent =
  429. "<div style='width: 600px; height: 400px; text-align: center; overflow: hidden'>" +
  430. "<p style='line-height: 80px; font-size: 25px; color: white; font-weight: 700'>恭喜你,十连抽中</p>";
  431. for (var i = 0; i < luckIdArr.length; i++) {
  432. var luckItem = itemMap.get(luckIdArr[i]);
  433. popupContent += "<div class='time10result-container'><div style='height: 80px; width: 120px; text-align: center'><img src=\""+luckItem.icon+"\" style='height: 80px;'></div><p style='line-height: 40px; font-size: 17px; color: white' class='line1ppp'>"+luckItem.name+"</p></div>";
  434. }
  435. popupContent += "</div>"+
  436. "<p style='width: 600px; height: 30px; margin-top: 20px; text-align: center'>" +
  437. "<button onclick='layer.closeAll()' class='close-popup-btn'>" +
  438. "<i class=\"layui-icon\" style='font-size: 20px; color: white'>&#x1007;</i>" +
  439. "</button></p>";
  440. layer.open({
  441. type: 1,
  442. title: false,
  443. closeBtn: 0,
  444. shadeClose: false,
  445. area: ['600px', '500px'],
  446. skin: 'popup',
  447. content: popupContent
  448. });
  449. } else {
  450. layer.msg("抽奖参数异常!");
  451. }
  452. }
  453. /**
  454. * 查询当前用户本期活动所有中奖订单记录
  455. */
  456. function loadCurrentUserActivityOrderList() {
  457. $("#curr-user-order-lists").empty();
  458. $.ajax({
  459. url: "/api/lottery/order/byCurrUser/"+activityId,
  460. type: "get",
  461. success: function (data) {
  462. data = eval(data);
  463. if (data.success) {
  464. data = data.data;
  465. if (data.legend == 0) {
  466. $("#curr-user-order-lists").append("<div style='margin: 50px 0px 100px 0px;'><img src=\"http://coderutil.oss-cn-beijing.aliyuncs.com/bbs-image/file_9983ba5b80bf4b5b9e7c7ea25dee139f.png\" style=\"height: 300px\">\n" +
  467. " <p style=\"line-height: 60px; color: gray; font-size: 15px;\">暂无中奖记录 ~ </p></div>");
  468. return;
  469. }
  470. $.each(data, function (index, order) {
  471. var meOrder = "<div class=\"curr-user-order\" style=\"text-align: left; width: 100%; line-height: 40px; border-bottom: 1px dashed whitesmoke\">\n" +
  472. " <span style=\"width: 100px; margin-right: 20px;\"><span class=\"layui-badge layui-bg-green\">已兑换</span></span>\n" +
  473. " <span style=\"width: 200px; margin-right: 30px; font-family: Courier\">"+order.orderId+"</span>\n" +
  474. " <span class=\"line1ppp\" style=\"width: 400px;\">"+order.item.name+"</span>\n"+
  475. " <span style=\"float: right; color: gray\">中奖时间: "+formatMsgTime(order.luckTime)+"</span>\n";
  476. if (order.exchangeTime != 0) {
  477. meOrder += " <span style=\"float: right; margin-right: 30px; width: 200px; color: gray\">兑换时间: "+formatMsgTime(order.exchangeTime)+"</span>\n";
  478. }
  479. meOrder += " </div>";
  480. $("#curr-user-order-lists").append(meOrder);
  481. })
  482. if (data.length > 10) {
  483. $("#showAllOrderBtn").show();
  484. }
  485. }
  486. }, error: function () {
  487. }
  488. })
  489. }
  490. function loadActivityOrderList() {
  491. $("#winPrizeListContainerList").empty();
  492. $.ajax({
  493. url: "/api/lottery/order/byActivity/"+activityId,
  494. type: "get",
  495. success: function (data) {
  496. data = eval(data);
  497. if (data.success) {
  498. data = data.data;
  499. if (data.legend == 0) {
  500. $("#winPrizeListContainerList").append("<p style='line-height: 200px'>暂无中奖记录 ~ </p>");
  501. return;
  502. }
  503. $.each(data, function (index, order) {
  504. var order = "<div class=\"winPrize\">\n" +
  505. " <p class=\"prize-header\">\n" +
  506. " <span class=\"prize-username\"><img src=\""+order.user.photo+"?x-oss-process=image/resize,m_fill,w_20,h_20\">"+order.user.userName+"</span>\n" +
  507. " <span class=\"prize-time\">"+formatMsgTime(order.luckTime)+"</span>\n" +
  508. " </p>\n" +
  509. " <p class=\"prize-detail line1ppp\">\n" +
  510. " 抽中 <span style=\"color: orangered\">"+order.item.name+"</span>\n" +
  511. " </p>\n" +
  512. " </div>";
  513. $("#winPrizeListContainerList").append(order);
  514. })
  515. }
  516. }, error: function () {
  517. }
  518. })
  519. }
  520. /**
  521. * 加载历史活动列表
  522. */
  523. loadHistoryActivityList();
  524. function loadHistoryActivityList() {
  525. $.ajax({
  526. url: "/api/lottery/activity/history/list",
  527. type: "get",
  528. success: function (data) {
  529. data = eval(data);
  530. if (data.success) {
  531. data = data.data;
  532. $.each(data, function (index, activity) {
  533. var statusTag;
  534. var status = activity.status;
  535. if (status == 1) {
  536. statusTag = "<span class=\"layui-badge layui-bg-orange\">"+activity.statusName+"</span>";
  537. } else if (status == 2) {
  538. statusTag = "<span class=\"layui-badge\">"+activity.statusName+"</span>";
  539. } else if (status == 3) {
  540. statusTag = "<span class=\"layui-badge layui-bg-cyan\">"+activity.statusName+"</span>";
  541. } else if (status == 4) {
  542. statusTag = "<span class=\"layui-badge layui-bg-gray\">"+activity.statusName+"</span>";
  543. }
  544. var historyActivity = "<a href='/client/index?id="+activity.activityId+"'><div class=\"luck-list\">\n" +
  545. " <img class=\"recommend-luck-cover\"\n" +
  546. " src=\""+activity.cover+"?x-oss-process=image/resize,m_fill,w_250,h_150\">\n" +
  547. " <div class=\"title-container\"><span class=\"title\">"+activity.name+"</span></div>\n" +
  548. " <span class=\"luck-item-count\">"+statusTag+"</span>\n" +
  549. " </div></a>";
  550. historyLastId = activity.id;
  551. $("#history-luck-lists").append(historyActivity);
  552. })
  553. }
  554. }, error: function () {
  555. }
  556. })
  557. }
  558. refreshUserInfo();
  559. function refreshUserInfo() {
  560. $.ajax({
  561. url:"/api/user/getCurrentUserInfo",
  562. type:"get",
  563. success:function (data) {
  564. data = eval(data);
  565. if (data.success){
  566. $("#unlogin-mode").hide();
  567. }
  568. },error:function () {}
  569. })
  570. }
  571. </script>
  572. </html>