123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
- <title>捐赠步数</title>
- <link type="text/css" rel="stylesheet"
- href="<?php echo RESOURCE_SITE_URL; ?>/mobile/talk/css/weui.css?<?php echo bonus_version(); ?>"/>
- <link rel="stylesheet"
- href="https://cdn.bootcss.com/jquery-weui/1.2.0/css/jquery-weui.min.css?<?php echo bonus_version(); ?>">
- <link type="text/css" rel="stylesheet"
- href="<?php echo RESOURCE_SITE_URL; ?>/mobile/talk/css/homepage.css?<?php echo bonus_version(); ?>"/>
- <style type="text/css">
- html, body {
- background: #ffffff;
- font-family: PingFang SC, Hiragino Sans GB, Microsoft YaHei, 微软雅黑, Arial, sans-serif;
- }
- .sport_echarts {
- margin: 0 auto;
- }
- #mine_steps {
- background: url("<?php echo RESOURCE_SITE_URL; ?>/mobile/talk/images/echarts_bg.png") no-repeat;
- background-size: 100% 100%;
- }
- .group_name h3 {
- margin-top: 7px;
- }
- .weui-cell__hd img {
- width: 40px;
- height: 40px;
- }
- h3.title {
- font-size: 15px;
- margin-left: 20px;
- margin-top: 10px;
- }
- .weui-btn_primary {
- background: #2B2B2B;
- }
- .week_total {
- font-size: 12px;
- font-weight: 400;
- color: #666666;
- }
- .sport_echarts {
- position: relative;
- }
- .today_num {
- position: absolute;
- right: 20px;
- top: 10px;
- font-size: 15px;
- font-weight: 600;
- color: #ffffff;
- z-index: 10;
- }
- .question_mark {
- width: 14px;
- height: 14px;
- vertical-align: bottom;
- margin-left: 5px;
- }
- .rules {
- position: absolute;
- right: 10px;
- bottom: 30px;
- font-size: 12px;
- }
- .group_info {
- position: relative;
- }
- </style>
- </head>
- <body>
- <div class="cover">
- <img src="<?php echo RESOURCE_SITE_URL; ?>/mobile/talk/images/cover.png" alt="cover">
- </div>
- <div class="group_top">
- <div class="group_info">
- <div class="group_avatar">
- <img src="<?php echo $output['avatar'] ?>" class='g_avatar' alt="group_avatar">
- </div>
- <div class="group_name">
- <h3><?php echo $output['nickname'] ?></h3>
- <div class="rules">
- <p>捐赠规则<img class="question_mark" src="<?php echo RESOURCE_SITE_URL; ?>/mobile/talk/images/question_mark.png"></p>
- </div>
- </div>
- </div>
- </div>
- <div class="sport_echarts">
- <div class="today_num"></div>
- <div class="mine_steps" id="mine_steps"></div>
- </div>
- <h3 class="title">步数捐赠至</h3>
- <div class="group_list">
- <div class="weui-cells">
- <?php
- foreach ($output['room_steps'] as $room) {
- echo "<div class=\"weui-cell\">
- <div class=\"weui-cell__hd\">
- <img src=\"{$room['avatar']}\">
- </div>
- <div class=\"weui-cell__bd\">
- <p>{$room['name']}</p>
- <p class='week_total'>本周累计步数:{$room['steps']}</p>
- </div>
- <div class=\"weui-cell__ft\">
- <a href=\"javascript:void(0)\" data-roomId=\"".$room['room_id']."\" class=\"weui-btn weui-btn_mini weui-btn_primary donate\">选择</a>
- </div>
- </div>";
- }
- ?>
- </div>
- </div>
- <script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js?<?php echo bonus_version(); ?>"></script>
- <script src="https://cdn.bootcss.com/jquery-weui/1.2.0/js/jquery-weui.min.js?<?php echo bonus_version(); ?>"></script>
- <script src="<?php echo RESOURCE_SITE_URL; ?>/mobile/comm/fastclick.js?<?php echo bonus_version(); ?>"></script>
- <script src="<?php echo RESOURCE_SITE_URL; ?>/mobile/comm/echarts.simple.min.js?<?php echo bonus_version(); ?>"></script>
- <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL; ?>/mobile/comm/new_bridge.js?<?php echo bonus_version(); ?>"></script>
- <script type="text/javascript">
- $(function () {
- var bridge = new Bridge();
- var app_steps = 0;
- var jsInit = {
- action:"read_steps"
- };
- bridge.call_native_handler('on_native_click', JSON.stringify(jsInit),function(res){
- var datas = JSON.parse(res);
- $('.today_num').text("步数:"+datas.now);
- app_steps = datas.now;
- });
-
- var set_echarts_size = function(){
- var docmentWidth = $(document).width();
- var echartsWidth= docmentWidth-(docmentWidth*0.2);
- var echartsHigth = echartsWidth*9/16;
- $('#mine_steps').css({width:echartsWidth+"px",height:echartsHigth+"px"});
- $('.sport_echarts').css({width:echartsWidth+"px",height:echartsHigth+"px"});
- };
- set_echarts_size();
- var dateList = <?php echo json_encode($output['charts']['date'])?>;
- var stepsList =<?php echo json_encode($output['charts']['steps'])?>;
- var month = "<?php echo $output['charts']['month']; ?>";
- var mySportEcharts = echarts.init(document.getElementById('mine_steps'));
- var option = {
- xAxis: {
- nameGap:"-5",
- nameLocation:'start',
- name:month,
- type: 'category',
- data: dateList,
- axisLine: {
- show: false,
- onZero: false
- },
- axisTick: {
- show: false,
- interval:2
- }
- },
- yAxis: {
- show: false
- },
- series: [{
- data: stepsList,
- type: 'line',
- itemStyle: {
- normal: {
- color: '#fff',
- lineStyle: {
- color: '#fff'
- }
- }
- }
- }],
- textStyle: {
- color: "#fff"
- }
- };
- mySportEcharts.setOption(option);
- $('.donate').on('click',function(){
- var room_id = $(this).attr('data-roomId');
- $.confirm({
- title: '步数捐赠',
- text: '确定将您的步数捐赠到该群?',
- onOK: function () {
- $.get("/mobile/index.php",{
- op:'donate_steps',
- act:'member_talk',
- client_type:'ajax',
- steps:app_steps,
- room_id:room_id
- },function(res){
- var datas = JSON.parse(res);
- if(datas.code != 200) {
- $.toast(datas.message,1000);
- return;
- }
- var jsInit = {
- action:"step_callback",
- params: {
- stepCount:app_steps,
- }
- };
- bridge.call_native_handler('on_native_click', JSON.stringify(jsInit),function(res){
- var datas = JSON.parse(res);
- });
- $.alert("您为该群贡献了"+datas.datas.amount+"元基金", "捐献成功",function(){
- window.location.reload();
- });
- });
- }
- });
- });
- });
- </script>
- </body>
- </html>
|