sign.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. {extend name="layout/layout" /}
  2. {block name="title"}个人中心{/block}
  3. {block name="css"}
  4. <!-- 这里引入css -->
  5. <link href="{:asset('/css/frontend/common.css')}" rel="stylesheet" type="text/css">
  6. <link href="{:asset('/css/frontend/classify.css')}" rel="stylesheet" type="text/css">
  7. <link href="{:asset('/css/frontend/common_tips.css')}" rel="stylesheet" type="text/css">
  8. <style type="text/css">
  9. .s_main{
  10. overflow: hidden;
  11. background-color: #fff;
  12. }
  13. .s_img{
  14. overflow: hidden;
  15. margin: .5rem auto .2rem;
  16. width: 1.43rem;
  17. height: 1.43rem;
  18. }
  19. .s_img img{
  20. display: block;
  21. width: 100%;
  22. height: 100%;
  23. }
  24. .s_main h1{
  25. height: .36rem;
  26. color: #0a347e;
  27. font-size: .21rem;
  28. text-align: center;
  29. line-height: .36rem;
  30. }
  31. .s_main strong{
  32. display: block;
  33. overflow: hidden;
  34. height: .36rem;
  35. font-size: .15rem;
  36. color: #5e6a94;
  37. text-align: center;
  38. line-height: .36rem;
  39. }
  40. .s_main strong span{
  41. display: inline;
  42. font-size: .15rem;
  43. color: #f63566;
  44. }
  45. .content_null_but_box a{
  46. height: .36rem;
  47. font-size: .16rem;
  48. line-height: .36rem;
  49. }
  50. .s_main .s_main_over{
  51. background-color: #f63566;
  52. }
  53. .s_fixed_box{
  54. display: none;
  55. padding-top: 2.6rem;
  56. position: fixed;
  57. left: 0;
  58. top: 0;
  59. right: 0;
  60. bottom: 0;
  61. z-index: 1000;
  62. background: rgba(0,0,0,.8) url({:asset('/img/frontend/icon/icon_28.png')}) no-repeat center 1.46rem;
  63. background-size: 1.87rem 1.17rem;
  64. }
  65. .s_fixed_box strong,
  66. .s_fixed_box em{
  67. display: block;
  68. text-align: center;
  69. font-weight: normal;
  70. }
  71. .s_fixed_box strong{
  72. font-size: .24rem;
  73. color: #ff4b4b;
  74. line-height: .32rem;
  75. }
  76. .s_fixed_box em{
  77. font-size: .15rem;
  78. color: #77a4ff;
  79. line-height: .24rem;
  80. }
  81. .s_fixed_box em span{
  82. display: inline;
  83. color: #ff4b4b;
  84. }
  85. .s_fixed_box a{
  86. margin: .4rem auto 0;
  87. display: block;
  88. width: 2.1rem;
  89. height: .36rem;
  90. border: 1px solid #fff;
  91. border-radius: .36rem;
  92. font-size: .16rem;
  93. color: #fff;
  94. text-align: center;
  95. line-height: .36rem;
  96. }
  97. .content_null_but_box a{
  98. width:2.58rem;
  99. height: .36rem;
  100. font-size: .16rem;
  101. line-height: .36rem;
  102. }
  103. .content_null_but_box a.sign_0 {display:block;}
  104. .content_null_but_box a.sign_1 {display:none;}
  105. .is_sign .content_null_but_box a.sign_0 {display:none;}
  106. .is_sign .content_null_but_box a.sign_1 {display:block;}
  107. </style>
  108. {/block}
  109. {block name="zepto"}
  110. <!-- 这是zepto插件 -->
  111. {/block}
  112. {block name="menu_title"}个人中心{/block}
  113. {block name="main"}
  114. <!-- 这是正文 -->
  115. <div class="body_sytle">
  116. <div class="s_main{if condition="$isSign"} is_sign {/if}">
  117. <div class="s_img"><img src="{:asset('/img/frontend/icon/icon_27.png')}" /></div>
  118. <h1 class="j_h1">签到送礼</h1>
  119. <!--<strong class="j_site">每日签到可获得<span>{$site.kandian_sign}书币</span>奖励</strong>-->
  120. <strong>连续签到<span>7</span>天合计得<span>350</span>个书币,本签到为累积签到</strong>
  121. <strong>用户若中途中断签到,签到记录自动从新开始</strong>
  122. <div class="content_null_but_box j_sign_btn">
  123. <a class="sign_1" id="toIndex" href="javascript:;">今日已签到,继续阅读</a>
  124. <a class="sign_0" id="sign" href="javascript:;">签到领书币</a>
  125. </div>
  126. </div>
  127. </div>
  128. <!--<div class="s_fixed_box">
  129. <strong>恭喜您</strong>
  130. <em>签到成功</em>
  131. <em>获得<span id="coinNum">{$site.kandian_sign}书币</span>奖励</em>
  132. <a href="javascript:;">去看书</a>
  133. </div>-->
  134. {/block}
  135. {block name="footer"}
  136. <!-- 这里引入底部footer -->
  137. {/block}
  138. {block name="js"}
  139. <!-- 这里引入js -->
  140. <script>
  141. var loadSuccess = false;
  142. var jumpUrl = '';
  143. $.ajax({
  144. type: "POST",
  145. url: "/api/index/checkTips",
  146. data: {'position_name': 'sign'},
  147. async: false, //顺序执行
  148. success: function (data) {
  149. if (data.err == 0){
  150. if (data.show_tips) {
  151. $(".common_tips_but img").attr("src", data.tips_img);
  152. loadSuccess = true;
  153. jumpUrl = data.jump_url;
  154. }
  155. }else{
  156. consoleMain(data.msg);
  157. }
  158. }
  159. });
  160. var isClick = false;
  161. $('#sign').click(function(){
  162. if(isClick){
  163. return false;
  164. }
  165. isClick = true;
  166. $.post('/api/user/signcontinuous',{},function(data){
  167. if (data.err == 0){
  168. $('.j_h1').text('签到成功');
  169. $('.j_site').html('恭喜您获得<span>'+data.kandian+'书币</span>奖励');
  170. $('.j_sign_btn').html('<a class="sign_0" href="/index/user/recent">去看书</a>');
  171. /*$('#coinNum').html(data.kandian+'书币');
  172. $('.s_fixed_box').show();
  173. $('#sign').hide();
  174. $('#toIndex').show();*/
  175. }else{
  176. isClick = false;
  177. consoleMain(data.msg);
  178. }
  179. })
  180. });
  181. $('#toIndex').click(function(){
  182. window.location.href = '/index/user/recent';
  183. });
  184. $(".s_fixed_box a").click(function () {
  185. $(".s_fixed_box").hide();
  186. if (loadSuccess) {
  187. //uv
  188. cpslog([701, {map:{pop_tips: 'sign'}}])
  189. $(".common_tips_box").show();
  190. } else {
  191. window.location.href = '/index/user/recent';
  192. }
  193. });
  194. //写cookie
  195. function apiSetCache(key)
  196. {
  197. $.ajax({
  198. type: "POST",
  199. url: "/api/index/setTipsCache",
  200. data: {'position_name': key},
  201. async: false, //顺序执行
  202. success: function (data) {
  203. if (data.err == 0){
  204. }else{
  205. consoleMain(data.msg);
  206. }
  207. }
  208. });
  209. }
  210. </script>
  211. {/block}