events_infos.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. <style>
  2. .button {
  3. cursor: pointer;
  4. }
  5. </style>
  6. <{if $type == 'share'}>
  7. <link rel="stylesheet" type="text/css" href="<{$web_cfg.cdn}>/haili/css/detail.css" />
  8. <section class="profile">
  9. <section class="avatar">
  10. <img src="<{$userSourceInfo.headimgurl}>">
  11. <span><{$userSourceInfo.nickname}></span>
  12. </section>
  13. <dl class="card">
  14. <dd>参与活动 <{$info.events_name}>,邀请您来加油!</dd>
  15. <dt><img src="<{$info.img_url}>"></dt>
  16. </dl>
  17. <section class="button-wrapper">
  18. <{if $uid == $source_user}>
  19. <a class="button yaoqing" node-type="share">邀请好友助力!</a>
  20. <{else}>
  21. <a class="button" href="javascript:;" onclick="help();">为好友助力!</a>
  22. <a class="button" href="<{$thisUrl}>">我也要参加!</a>
  23. <{/if}>
  24. </section>
  25. <section class="friends">
  26. <p>已助力好友<span><{$helpDataTotal}></span>人</p>
  27. <{if $helpData}>
  28. <ul>
  29. <{foreach from=$helpData item=v}>
  30. <li><img src="<{$v.headimgurl}>"></li>
  31. <{/foreach}>
  32. </ul>
  33. <{/if}>
  34. </section>
  35. </section>
  36. <section class="applycont">
  37. <{if $info.operationt_tips}>
  38. <h2><{$info.operationt_tips}></h2>
  39. <{/if}>
  40. <section class="summary">
  41. <{$info.events_rules}>
  42. </section>
  43. </section>
  44. <{if $focusData}>
  45. <section class="recommend">
  46. <ul>
  47. <{foreach from=$focusData item=v}>
  48. <li><a href="<{$v.link}>"><img src="<{$v.pic}>"></a></li>
  49. <{/foreach}>
  50. </ul>
  51. </section>
  52. <{/if}>
  53. <{if $ad}>
  54. <section class="ad">
  55. <h2><span>广告</span></h2>
  56. <{$ad}>
  57. </section>
  58. <{/if}>
  59. <script>
  60. share_url = '<{$info.thisUrl}>/share?events_id=<{$info.id}>&help_id=<{$help_id}>&help_session=<{$help_session}>&source_user=<{$source_user}>';
  61. function help()
  62. {
  63. var url = '<{$web_cfg.domain}>/?c=UserHelp&a=apply';
  64. $.getJSON(url, {events_id:'<{$info.id}>', help_id:'<{$help_id}>', help_session:'<{$help_session}>', source_user:'<{$source_user}>'}, function(t)
  65. {
  66. if (t.ok) {
  67. toast('助力成功!', false);
  68. } else {
  69. toast(t.msg, 1);
  70. }
  71. });
  72. }
  73. ;(function($){
  74. $('body').on('click','[node-type="share"]',function(){
  75. if(navigator.userAgent.toLocaleLowerCase().indexOf('micromessenger') >-1){
  76. $('body').append(`<section class="layer" id="sharelayer" style="display:block;">
  77. <section class="shareguide">
  78. <img src="http://circlecdn.mrhi.cn/haili/images/8eaa4804.shareguide.png">
  79. </section>
  80. </section>`)
  81. $('#sharelayer').on('click',function(){
  82. $(this).remove();
  83. })
  84. }
  85. })
  86. })(Zepto)
  87. </script>
  88. <script type="text/javascript" src="<{$web_cfg.cdn}>/haili/js/detail.js"></script>
  89. <{elseif $type == 'prize'}>
  90. <{if $userEventsData}>
  91. <section id="tab2" class="tabcont" style="display:block;">
  92. <section class="userlist">
  93. <ul id="lazyLoad">
  94. <{foreach from=$userEventsData item=v}>
  95. <li><img src="<{$web_cfg.cdn}>/public/static/img/bg_alpha.png" data-ks-lazyload="<{$v.user.headimgurl}>" width="80" height="80"><span>用户 <{$v.user.mobile}> 在 <{$v.user.cdate}> 获得 <{$v.user.events}> <{$v.user.ext}>。</span></li>
  96. <{/foreach}>
  97. </ul>
  98. </section>
  99. </section>
  100. <div class="clear"></div>
  101. <div class="loading">
  102. <img
  103. id="loadPage"
  104. src="<{$web_cfg.cdn}>/public/static/img/loading.gif"
  105. data-ks-lazyload="<{$web_cfg.cdn}>/public/static/img/loading.gif"
  106. data-request-url="<{$info.thisUrl}>/prize?ajax=ajax"
  107. data-page="2"
  108. data-totals="<{$userEventsDataTotals}>"
  109. style="width:0px;"
  110. />
  111. <div class="loader-inner ball-pulse">
  112. <div></div><div></div><div></div><div></div><div></div><div></div>
  113. </div>
  114. </div>
  115. <script>
  116. KISSY.use('node, io, gallery/datalazyload/2.0/index', function (S, Node, IO, Datalazyload) {
  117. var lock = false;
  118. new Datalazyload({
  119. load: function(el){
  120. el = '#loadPage';
  121. if (lock) return false;
  122. lock = true;
  123. var requesrUrl = $(el).data('request-url');
  124. var page = Number($(el).data('page'));
  125. var totals = Number($(el).data('totals'));
  126. if (!requesrUrl) {
  127. return false;
  128. }
  129. if (page > totals) {
  130. $('.loading').hide();
  131. return false;
  132. }
  133. IO.get(
  134. requesrUrl
  135. , {page: page}
  136. , function (data) {
  137. if (data.ok) {
  138. var next_page = page + 1;
  139. $('#loadPage').data('page', next_page);
  140. $("#lazyLoad").append(data.msg);
  141. lock = false;
  142. $('.loading').hide();
  143. new Datalazyload();
  144. if (next_page > totals) {
  145. $('.up_icon').hide();
  146. }
  147. }
  148. }
  149. , 'json'
  150. );
  151. }
  152. });
  153. });
  154. //有产品列表时添加整体body背景色
  155. $(body).addClass("bg_white");
  156. </script>
  157. <{/if}>
  158. <{elseif $type == 'help'}>
  159. <{if $helpData}>
  160. <section id="tab4" class="tabcont" style="display:block;">
  161. <section class="zhulilist">
  162. <ul id="lazyLoad">
  163. <{foreach from=$helpData item=v}>
  164. <li>
  165. <div>
  166. <{if $userDatas[$v.uid].headimgurl}>
  167. <img src="<{$web_cfg.cdn}>/public/static/img/bg_alpha.png" data-ks-lazyload="<{$userDatas[$v.uid].headimgurl}>" />
  168. <{else}>
  169. <img src="<{$web_cfg.cdn}>/public/static/img/bg_alpha.png" data-ks-lazyload="http://news.mydrivers.com/Img/20110518/04481549.png" />
  170. <{/if}><span><{if $userDatas[$v.uid].nickname}><{$userDatas[$v.uid].nickname}><{else}>游客<{/if}></span>
  171. </div>
  172. <div><span>助力值<{$v.num}></span></div>
  173. </li>
  174. <{/foreach}>
  175. </ul>
  176. </section>
  177. </section>
  178. <div class="clear"></div>
  179. <div class="loading">
  180. <img
  181. id="loadPage"
  182. src="<{$web_cfg.cdn}>/public/static/img/loading.gif"
  183. data-ks-lazyload="<{$web_cfg.cdn}>/public/static/img/loading.gif"
  184. data-request-url="<{$info.thisUrl}>/help?ajax=ajax"
  185. data-page="2"
  186. data-totals="<{$helpDataTotals}>"
  187. style="width:0px;"
  188. />
  189. <div class="loader-inner ball-pulse">
  190. <div></div><div></div><div></div><div></div><div></div><div></div>
  191. </div>
  192. </div>
  193. <script>
  194. KISSY.use('node, io, gallery/datalazyload/2.0/index', function (S, Node, IO, Datalazyload) {
  195. var lock = false;
  196. new Datalazyload({
  197. load: function(el){
  198. el = '#loadPage';
  199. if (lock) return false;
  200. lock = true;
  201. var requesrUrl = $(el).data('request-url');
  202. var page = Number($(el).data('page'));
  203. var totals = Number($(el).data('totals'));
  204. if (!requesrUrl) {
  205. return false;
  206. }
  207. if (page > totals) {
  208. $('.loading').hide();
  209. return false;
  210. }
  211. IO.get(
  212. requesrUrl
  213. , {page: page}
  214. , function (data) {
  215. if (data.ok) {
  216. var next_page = page + 1;
  217. $('#loadPage').data('page', next_page);
  218. $("#lazyLoad").append(data.msg);
  219. lock = false;
  220. $('.loading').hide();
  221. new Datalazyload();
  222. if (next_page > totals) {
  223. $('.up_icon').hide();
  224. }
  225. }
  226. }
  227. , 'json'
  228. );
  229. }
  230. });
  231. });
  232. //有产品列表时添加整体body背景色
  233. $(body).addClass("bg_white");
  234. </script>
  235. <{/if}>
  236. <{elseif $type == 'feedback'}>
  237. <{if $fdData}>
  238. <section id="tab3" class="tabcont" style="display:block;">
  239. <section class="commentlist">
  240. <ul id="lazyLoad">
  241. <{foreach from=$fdData item=v}>
  242. <li>
  243. <img src="<{$v.user.headimgurl}>">
  244. <div class="dt">
  245. <span><{$v.user.mobile}> 的用户 <{$v.user.cdate}> 评价了 <{$v.user.events}>活动:</span>
  246. <{if $v.pic[0]}>
  247. <div class="imgs">
  248. <{foreach from=$v.pic item=v1}>
  249. <img src="<{$v1}>">
  250. <{/foreach}>
  251. </div>
  252. <{/if}>
  253. <p><{$v.content}></p>
  254. </div>
  255. </li>
  256. <{/foreach}>
  257. </ul>
  258. </section>
  259. </section>
  260. <div class="clear"></div>
  261. <div class="loading">
  262. <img
  263. id="loadPage"
  264. src="<{$web_cfg.cdn}>/public/static/img/loading.gif"
  265. data-ks-lazyload="<{$web_cfg.cdn}>/public/static/img/loading.gif"
  266. data-request-url="<{$info.thisUrl}>/feedback?ajax=ajax"
  267. data-page="2"
  268. data-totals="<{$fdDataTotals}>"
  269. style="width:0px;"
  270. />
  271. <div class="loader-inner ball-pulse">
  272. <div></div><div></div><div></div><div></div><div></div><div></div>
  273. </div>
  274. </div>
  275. <script>
  276. KISSY.use('node, io, gallery/datalazyload/2.0/index', function (S, Node, IO, Datalazyload) {
  277. var lock = false;
  278. new Datalazyload({
  279. load: function(el){
  280. el = '#loadPage';
  281. if (lock) return false;
  282. lock = true;
  283. var requesrUrl = $(el).data('request-url');
  284. var page = Number($(el).data('page'));
  285. var totals = Number($(el).data('totals'));
  286. if (!requesrUrl) {
  287. return false;
  288. }
  289. if (page > totals) {
  290. $('.loading').hide();
  291. return false;
  292. }
  293. IO.get(
  294. requesrUrl
  295. , {page: page}
  296. , function (data) {
  297. if (data.ok) {
  298. var next_page = page + 1;
  299. $('#loadPage').data('page', next_page);
  300. $("#lazyLoad").append(data.msg);
  301. lock = false;
  302. //new Datalazyload();
  303. if (next_page > totals) {
  304. $('.up_icon').hide();
  305. }
  306. }
  307. }
  308. , 'json'
  309. );
  310. }
  311. });
  312. });
  313. //有产品列表时添加整体body背景色
  314. $(body).addClass("bg_white");
  315. </script>
  316. <{/if}>
  317. <{else}>
  318. <section id="tab1" class="tabcont" style="display:block;">
  319. <section class="cardcont">
  320. <dl class="card">
  321. <dd><span class="time"><em class="icon-time"></em>剩余<{$info.rday}>天</span><span>参与<{$info.user_total}>人</span></dd>
  322. </dl>
  323. <section class="article">
  324. <{$info.events_tips}>
  325. </section>
  326. <{if $info.type == 1}>
  327. <!--抽奖loading begin-->
  328. <div class="luck_loading" id="luck_loading">
  329. <div class="luck_load_icon">
  330. <div class="loading_img"></div>
  331. </div>
  332. </div>
  333. <!--抽奖loading end-->
  334. <!--抽奖结果 begin-->
  335. <div class="luck_result" id="luck_result">
  336. <div><img src="<{$web_cfg.cdn}>/public/static/img/error_icon.png"></div>
  337. <div>未中奖,感谢参与</div>
  338. </div>
  339. <!--抽奖结果 end-->
  340. <section class="button-wrapper luck_show" id="luck_show">
  341. <a class="button" id="award_btn">开始抽奖</a>
  342. </section>
  343. <{/if}>
  344. <{if $info.type != 1}>
  345. <{if $info.share_button == 2 || $info.buy_button == 2}>
  346. <section class="button-wrapper">
  347. <{if $info.share_button == 2 && $info.type == 4}>
  348. <a class="button share_buttons" node-type="share" href="<{$info.thisUrl}>/share"><{$info.share_button_tips}></a>
  349. <{elseif $info.share_button == 2}>
  350. <a class="button share_button" node-type="share"><{$info.share_button_tips}></a>
  351. <{/if}>
  352. <{if $info.buy_button == 2}>
  353. <a class="button buy_button" data-weixin="<{$info.buy_button_link}>" data-app="<{$info.buy_button_app}>" href="<{$info.buy_button_link}>"><{$info.buy_button_tips}></a>
  354. <{/if}>
  355. </section>
  356. <{/if}>
  357. <{/if}>
  358. </section>
  359. <section class="applycont">
  360. <{if $info.type == 4 || $info.type == 6 || $info.type == 7}>
  361. <{if $info.events_hd_tips}>
  362. <h2><{$info.events_hd_tips}></h2>
  363. <{/if}>
  364. <{include file="events_forms_template_new.html"}>
  365. <{elseif $info.type == 1}>
  366. <{include file="events_turntable_content.html"}>
  367. <{elseif $info.type == 11}>
  368. <{include file="events_survey_content.html"}>
  369. <{elseif $info.type == 5}>
  370. <{include file="events_vote_content.html"}>
  371. <{/if}>
  372. </section>
  373. <section class="applycont">
  374. <{if $info.operationt_tips}>
  375. <h2><{$info.operationt_tips}></h2>
  376. <{/if}>
  377. <section class="summary">
  378. <{$info.events_rules}>
  379. </section>
  380. </section>
  381. <{if $focusData}>
  382. <section class="recommend">
  383. <ul>
  384. <{foreach from=$focusData item=v}>
  385. <li><a href="<{$v.link}>"><img src="<{$v.pic}>"></a></li>
  386. <{/foreach}>
  387. </ul>
  388. </section>
  389. <{/if}>
  390. <{if $ad}>
  391. <section class="ad">
  392. <h2><span>广告</span></h2>
  393. <{$ad}>
  394. </section>
  395. <{/if}>
  396. </section>
  397. <{/if}>
  398. <{if $info.type == 4 && $info.yaoqing}>
  399. <section class="layer" id="layerbox" style="display:none;">
  400. <section class="loginbox">
  401. <h3>申请成功!</h3>
  402. <p><{$info.yaoqing}></p>
  403. <section class="button-wrapper">
  404. <a class="button" href="<{$info.thisUrl}>/share"><{$info.share_button_tips}></a>
  405. </section>
  406. </section>
  407. </section>
  408. <{/if}>
  409. <section class="layer" <{if $info.end == 2 && $info.login != 2 && !$userData && $info.type != 4}>style="display:block"<{/if}>>
  410. <section class="loginbox">
  411. <h3>活动已结束!</h3>
  412. <p>感谢您的关注,期待您参与我们的其他活动</p>
  413. <section class="button-wrapper">
  414. <a class="button border" href="<{$listUrl}>">找找其他福利</a>
  415. <a class="button" href="<{$giftsUrl}>">查看我的奖品</a>
  416. </section>
  417. </section>
  418. </section>
  419. <section class="layer" id="loginbox" style="display:none;">
  420. <section class="loginbox">
  421. <h3>您还没有登录</h3>
  422. <p>请登录后再参与福利活动</p>
  423. <section class="button-wrapper">
  424. <a class="button border" href="<{$listUrl}>">找找其他福利</a>
  425. <{if $applogin && $applogin == 1}>
  426. <a class="button" href="javascript:;" onclick="istoken('<{$loginUrl}>', 1);" style="cursor:pointer;">马上登录</a>
  427. <{else}>
  428. <a class="button" id="loginyes" href="<{$loginUrl}>">马上登录</a>
  429. <{/if}>
  430. </section>
  431. </section>
  432. </section>
  433. <{if $info.login == 2}>
  434. <script>
  435. $(function()
  436. {
  437. loadLogin();
  438. })
  439. </script>
  440. <{/if}>