steps_detail.php 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
  6. <title>我的运动</title>
  7. <link type="text/css" rel="stylesheet"
  8. href="<?php echo RESOURCE_SITE_URL; ?>/mobile/talk/css/weui.css?<?php echo bonus_version(); ?>"/>
  9. <link rel="stylesheet"
  10. href="<?php echo RESOURCE_SITE_URL; ?>/mobile/talk/css/jquery-weui.min.css?<?php echo bonus_version(); ?>">
  11. <link type="text/css" rel="stylesheet"
  12. href="<?php echo RESOURCE_SITE_URL; ?>/mobile/talk/css/homepage.css?<?php echo bonus_version(); ?>"/>
  13. <style type="text/css">
  14. html, body {
  15. background: #ffffff;
  16. font-family: PingFang SC, Hiragino Sans GB, Microsoft YaHei, 微软雅黑, Arial, sans-serif;
  17. }
  18. .sport_echarts {
  19. margin: 0 auto;
  20. }
  21. #mine_steps {
  22. background: url("<?php echo RESOURCE_SITE_URL; ?>/mobile/talk/images/echarts_bg.png") no-repeat;
  23. background-size: 100% 100%;
  24. }
  25. .group_name h3 {
  26. margin-top: 7px;
  27. }
  28. .weui-cell__hd img {
  29. width: 50px;
  30. height: 50px;
  31. }
  32. .group_list .weui-cell__hd img {
  33. border-radius: 5px;
  34. margin-right: 10px;
  35. }
  36. .group_list .weui-cell__ft .weui-btn_mini {
  37. display: block;
  38. font-size: 13px;
  39. line-height: 16px;
  40. padding: 5px 10px;
  41. font-weight: bold;
  42. }
  43. .title {
  44. overflow: hidden;
  45. }
  46. .title h3{
  47. font-size: 15px;
  48. margin-left: 15px;
  49. margin-top: 10px;
  50. }
  51. .title span {
  52. font-size: 12px;
  53. font-weight: 400;
  54. color: #333333;
  55. margin-right: 15px;
  56. margin-top: 12px;
  57. }
  58. .weui-btn_primary {
  59. background: #2B2B2B;
  60. }
  61. .week_total {
  62. font-size: 12px;
  63. font-weight: 400;
  64. color: #666666;
  65. }
  66. .sport_echarts {
  67. position: relative;
  68. }
  69. .today_num,.month {
  70. position: absolute;
  71. right: 15px;
  72. top: 10px;
  73. font-size: 15px;
  74. font-weight: 600;
  75. color: #ffffff;
  76. z-index: 10;
  77. }
  78. .month {
  79. left: 15px;
  80. }
  81. .question_mark {
  82. width: 14px;
  83. height: 14px;
  84. vertical-align: bottom;
  85. margin-left: 5px;
  86. }
  87. .rules {
  88. position: absolute;
  89. right: 15px;
  90. bottom: 30px;
  91. font-size: 12px;
  92. }
  93. .group_info {
  94. position: relative;
  95. }
  96. </style>
  97. </head>
  98. <body>
  99. <div class="cover">
  100. <img src="<?php echo RESOURCE_SITE_URL; ?>/mobile/talk/images/cover.png" alt="cover">
  101. </div>
  102. <div class="group_top">
  103. <div class="group_info">
  104. <div class="group_avatar">
  105. <img src="<?php echo $output['avatar'] ?>" class='g_avatar' alt="group_avatar">
  106. </div>
  107. <div class="group_name">
  108. <h3><?php echo $output['nickname'] ?></h3>
  109. <div class="rules">
  110. <a class="donation" href="<?php echo "xmmz://p.lrlz.com/web/web?title=捐赠规则&url=".urlencode('https://passport.lrlz.com/hfive/new_panda_rules/donationRules.html')?>">
  111. <p>捐赠规则<img class="question_mark" src="<?php echo RESOURCE_SITE_URL; ?>/mobile/talk/images/question_mark.png"></p>
  112. </a>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. <div class="sport_echarts">
  118. <div class="month"><?php echo $output['charts']['month'] ?></div>
  119. <div class="today_num"></div>
  120. <div class="mine_steps" id="mine_steps"></div>
  121. </div>
  122. <div class="title">
  123. <h3 style="float: left;">步数捐赠至</h3>
  124. <span style="float:right;"></span>
  125. </div>
  126. <div class="group_list">
  127. <div class="weui-cells">
  128. <?php
  129. foreach ($output['room_steps'] as $room) {
  130. if($room['level'] > 0) {
  131. $level = '<span class="certification_logo2"></span>';
  132. }else{
  133. $level = '';
  134. }
  135. echo "<div class=\"weui-cell\">
  136. <div class=\"weui-cell__hd\">
  137. <img src=\"{$room['avatar']}\">
  138. </div>
  139. <div class=\"weui-cell__bd\">
  140. <p>{$room['name']}{$level}</p>
  141. <p class='week_total'>本周累计步数:{$room['steps']}</p>
  142. </div>
  143. <div class=\"weui-cell__ft\">
  144. <a href=\"javascript:void(0)\" data-roomId=\"".$room['room_id']."\" class=\"weui-btn weui-btn_mini donate\" style='background-color: #000'>选择</a>
  145. </div>
  146. </div>";
  147. }
  148. ?>
  149. </div>
  150. </div>
  151. <script src="<?php echo RESOURCE_SITE_URL; ?>/mobile/comm/jquery-1.11.0.min.js?<?php echo bonus_version(); ?>"></script>
  152. <script src="<?php echo RESOURCE_SITE_URL; ?>/mobile/talk/js/jquery-weui.min.js?<?php echo bonus_version(); ?>"></script>
  153. <script src="<?php echo RESOURCE_SITE_URL; ?>/mobile/comm/fastclick.js?<?php echo bonus_version(); ?>"></script>
  154. <script src="<?php echo RESOURCE_SITE_URL; ?>/mobile/comm/echarts.simple.min.js?<?php echo bonus_version(); ?>"></script>
  155. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/mobile/comm/new_bridge.js?<?php echo bonus_version(); ?>"></script>
  156. <script type="text/javascript">
  157. $(function () {
  158. var bridge = new Bridge();
  159. var app_steps = 0;
  160. var jsInit = {
  161. action:"read_steps"
  162. };
  163. bridge.call_native_handler('on_native_click', JSON.stringify(jsInit),function(res){
  164. var datas = JSON.parse(res);
  165. $('.today_num').text("步数:"+datas.now);
  166. var donate_rate = <?php echo $output['donate_rate']; ?>;
  167. var money =parseInt(datas.now / donate_rate * 100 + 0.5) / 100;
  168. $('.title span').text("可兑换"+money+"元");
  169. app_steps = datas.now;
  170. });
  171. var set_echarts_size = function(){
  172. var docmentWidth = $(document).width();
  173. var echartsWidth= docmentWidth-(docmentWidth*0.2);
  174. var echartsHigth = echartsWidth*9/16;
  175. $('#mine_steps').css({width:echartsWidth+"px",height:echartsHigth+"px"});
  176. $('.sport_echarts').css({width:echartsWidth+"px",height:echartsHigth+"px"});
  177. };
  178. set_echarts_size();
  179. var dateList = <?php echo json_encode($output['charts']['date'])?>;
  180. var stepsList =<?php echo json_encode($output['charts']['steps'])?>;
  181. var month = "<?php echo $output['charts']['month']; ?>";
  182. // dateList[0] = month + dateList[0];
  183. // var dateList = ['13', '14', '15', '16', '17', '18', '19'];
  184. // var stepsList = [12345, 123414, 9075, 3789, 800, 7856, 126777];
  185. var mySportEcharts = echarts.init(document.getElementById('mine_steps'));
  186. var option = {
  187. grid: {
  188. left: 10,
  189. right: 10
  190. },
  191. xAxis: {
  192. // nameGap:0,
  193. // nameLocation:'start',
  194. // name:month,
  195. offset: 24,
  196. // type: 'category',
  197. data: dateList,
  198. // splitNumber: 7,
  199. axisLine: {
  200. show: false,
  201. // onZero: false
  202. },
  203. axisTick: {
  204. show: false,
  205. // interval:2
  206. }
  207. },
  208. yAxis: {
  209. show: false
  210. },
  211. series: [{
  212. data: stepsList,
  213. type: 'line',
  214. itemStyle: {
  215. normal: {
  216. color: '#fff',
  217. lineStyle: {
  218. color: '#fff'
  219. }
  220. }
  221. }
  222. }],
  223. textStyle: {
  224. color: "#fff"
  225. }
  226. };
  227. mySportEcharts.setOption(option);
  228. $('.donate').on('click',function(){
  229. var room_id = $(this).attr('data-roomId');
  230. if(app_steps <= 0) {
  231. $.alert("目前没有可捐赠的步数 赶紧动一动吧");
  232. return;
  233. }
  234. $.confirm({
  235. title: '步数捐赠',
  236. text: '确定将您的步数捐赠到该群?',
  237. onOK: function () {
  238. $.get("/mobile/index.php",{
  239. op:'donate_steps',
  240. act:'member_talk',
  241. client_type:'ajax',
  242. steps:app_steps,
  243. room_id:room_id
  244. },function(res){
  245. var datas = JSON.parse(res);
  246. if(datas.code != 200) {
  247. $.toast(datas.message,1000);
  248. return;
  249. }
  250. var jsInit = {
  251. action:"step_callback",
  252. params: {
  253. stepCount:app_steps,
  254. }
  255. };
  256. bridge.call_native_handler('on_native_click', JSON.stringify(jsInit),function(res){
  257. var datas = JSON.parse(res);
  258. });
  259. $.alert("您为该群贡献了"+datas.datas.amount+"元基金", "捐献成功",function(){
  260. window.location.reload();
  261. });
  262. });
  263. }
  264. });
  265. });
  266. });
  267. </script>
  268. </body>
  269. </html>