steps_detail.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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="https://cdn.bootcss.com/jquery-weui/1.2.0/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: 40px;
  30. height: 40px;
  31. }
  32. h3.title {
  33. font-size: 15px;
  34. margin-left: 20px;
  35. margin-top: 10px;
  36. }
  37. .weui-btn_primary {
  38. background: #2B2B2B;
  39. }
  40. .week_total {
  41. font-size: 12px;
  42. font-weight: 400;
  43. color: #666666;
  44. }
  45. .sport_echarts {
  46. position: relative;
  47. }
  48. .today_num {
  49. position: absolute;
  50. right: 20px;
  51. top: 10px;
  52. font-size: 15px;
  53. font-weight: 600;
  54. color: #ffffff;
  55. z-index: 10;
  56. }
  57. .question_mark {
  58. width: 14px;
  59. height: 14px;
  60. vertical-align: bottom;
  61. margin-left: 5px;
  62. }
  63. .rules {
  64. position: absolute;
  65. right: 10px;
  66. bottom: 30px;
  67. font-size: 12px;
  68. }
  69. .group_info {
  70. position: relative;
  71. }
  72. </style>
  73. </head>
  74. <body>
  75. <div class="cover">
  76. <img src="<?php echo RESOURCE_SITE_URL; ?>/mobile/talk/images/cover.png" alt="cover">
  77. </div>
  78. <div class="group_top">
  79. <div class="group_info">
  80. <div class="group_avatar">
  81. <img src="<?php echo $output['avatar'] ?>" class='g_avatar' alt="group_avatar">
  82. </div>
  83. <div class="group_name">
  84. <h3><?php echo $output['nickname'] ?></h3>
  85. <div class="rules">
  86. <p>捐赠规则<img class="question_mark" src="<?php echo RESOURCE_SITE_URL; ?>/mobile/talk/images/question_mark.png"></p>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <div class="sport_echarts">
  92. <div class="today_num"></div>
  93. <div class="mine_steps" id="mine_steps"></div>
  94. </div>
  95. <h3 class="title">步数捐赠至</h3>
  96. <div class="group_list">
  97. <div class="weui-cells">
  98. <?php
  99. foreach ($output['room_steps'] as $room) {
  100. echo "<div class=\"weui-cell\">
  101. <div class=\"weui-cell__hd\">
  102. <img src=\"{$room['avatar']}\">
  103. </div>
  104. <div class=\"weui-cell__bd\">
  105. <p>{$room['name']}</p>
  106. <p class='week_total'>本周累计步数:{$room['steps']}</p>
  107. </div>
  108. <div class=\"weui-cell__ft\">
  109. <a href=\"javascript:void(0)\" data-roomId=\"".$room['room_id']."\" class=\"weui-btn weui-btn_mini weui-btn_primary donate\">选择</a>
  110. </div>
  111. </div>";
  112. }
  113. ?>
  114. </div>
  115. </div>
  116. <script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js?<?php echo bonus_version(); ?>"></script>
  117. <script src="https://cdn.bootcss.com/jquery-weui/1.2.0/js/jquery-weui.min.js?<?php echo bonus_version(); ?>"></script>
  118. <script src="<?php echo RESOURCE_SITE_URL; ?>/mobile/comm/fastclick.js?<?php echo bonus_version(); ?>"></script>
  119. <script src="<?php echo RESOURCE_SITE_URL; ?>/mobile/comm/echarts.simple.min.js?<?php echo bonus_version(); ?>"></script>
  120. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/mobile/comm/new_bridge.js?<?php echo bonus_version(); ?>"></script>
  121. <script type="text/javascript">
  122. $(function () {
  123. var bridge = new Bridge();
  124. var app_steps = 0;
  125. var jsInit = {
  126. action:"read_steps"
  127. };
  128. bridge.call_native_handler('on_native_click', JSON.stringify(jsInit),function(res){
  129. var datas = JSON.parse(res);
  130. $('.today_num').text("步数:"+datas.now);
  131. app_steps = datas.now;
  132. });
  133. var set_echarts_size = function(){
  134. var docmentWidth = $(document).width();
  135. var echartsWidth= docmentWidth-(docmentWidth*0.2);
  136. var echartsHigth = echartsWidth*9/16;
  137. $('#mine_steps').css({width:echartsWidth+"px",height:echartsHigth+"px"});
  138. $('.sport_echarts').css({width:echartsWidth+"px",height:echartsHigth+"px"});
  139. };
  140. set_echarts_size();
  141. var dateList = <?php echo json_encode($output['charts']['date'])?>;
  142. var stepsList =<?php echo json_encode($output['charts']['steps'])?>;
  143. var month = "<?php echo $output['charts']['month']; ?>";
  144. var mySportEcharts = echarts.init(document.getElementById('mine_steps'));
  145. var option = {
  146. xAxis: {
  147. nameGap:"-5",
  148. nameLocation:'start',
  149. name:month,
  150. type: 'category',
  151. data: dateList,
  152. axisLine: {
  153. show: false,
  154. onZero: false
  155. },
  156. axisTick: {
  157. show: false,
  158. interval:2
  159. }
  160. },
  161. yAxis: {
  162. show: false
  163. },
  164. series: [{
  165. data: stepsList,
  166. type: 'line',
  167. itemStyle: {
  168. normal: {
  169. color: '#fff',
  170. lineStyle: {
  171. color: '#fff'
  172. }
  173. }
  174. }
  175. }],
  176. textStyle: {
  177. color: "#fff"
  178. }
  179. };
  180. mySportEcharts.setOption(option);
  181. $('.donate').on('click',function(){
  182. var room_id = $(this).attr('data-roomId');
  183. $.confirm({
  184. title: '步数捐赠',
  185. text: '确定将您的步数捐赠到该群?',
  186. onOK: function () {
  187. $.get("/mobile/index.php",{
  188. op:'donate_steps',
  189. act:'member_talk',
  190. client_type:'ajax',
  191. steps:app_steps,
  192. room_id:room_id
  193. },function(res){
  194. var datas = JSON.parse(res);
  195. if(datas.code != 200) {
  196. $.toast(datas.message,1000);
  197. return;
  198. }
  199. var jsInit = {
  200. action:"step_callback",
  201. params: {
  202. stepCount:app_steps,
  203. }
  204. };
  205. bridge.call_native_handler('on_native_click', JSON.stringify(jsInit),function(res){
  206. var datas = JSON.parse(res);
  207. });
  208. $.alert("您为该群贡献了"+datas.datas.amount+"元基金", "捐献成功",function(){
  209. window.location.reload();
  210. });
  211. });
  212. }
  213. });
  214. });
  215. });
  216. </script>
  217. </body>
  218. </html>