123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8"/>
- <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0"/>
- <title>足迹</title>
- <link rel="stylesheet" href="http://res.wx.qq.com/open/libs/weui/1.0.0/weui.min.css"/>
- <style>
- body{
- background-color: #fba000;
- padding: 15px;
- }
- .page__hd {
- padding: 10px;
- }
- .page__desc {
- margin-top: 5px;
- color: #888;
- text-align: left;
- font-size: 14px;
- padding-left:20px;
- }
- .wrapper{
- background-color: #fff;
- border-radius: 8px;
- padding: 10px 0px;
- }
- .bottom__padding{
- padding-bottom: 80px;
- }
- .style-btn2{
- background-color: #fff!important;
- color: #fba000!important;
- border: 1px solid #fba000;
- }
- .page_foot_ft{
- color: #fff!important;
- }
- .weui-pl{
- padding: 10px 45px!important;
- }
- .weui-label{
- color: #fba000;
- }
- .weui-cell{
- padding-left: 45px;
- }
- .weui-cell:before{
- border-top:0px!important;
- border-bottom: 1px solid #d9d9d9;
- left:0;
- }
- .weui-cells:before{
- border-top:0px!important;
- }
- .weui-btn:after{
- border:0px!important;
- }
- .weui-footer{
- color:#fff;
- }
- .porl{
- position: relative;
- height: 24px;
- }
- .updateFile{
- position: absolute;;
- opacity: 0;
- left: 0px;
- top: 0px;
- width: 100%;
- }
- .ft_orange{
- color: #fba000;
- }
- .ft_white {
- color: #fff;
- }
- .weui-form-preview__item{
- min-height: 28px;
- }
- .mine-form-btn{
- width: 80%;
- margin: 10px auto;
- background-color: #15a202;
- text-align: center;
- color: #fff;
- border-radius: 10px;
- }
- .weui-form-preview__hd:after{
- border-bottom:0px!important;
- }
- .weui-form-preview:before{
- border-top: 0px!important;
- }
- .weui-form-preview__ft:after{
- border-top: 0!important;
- }
- .weui-form-preview:after{
- border-bottom: 0px!important;
- }
- .weui-panel:after{
- border-bottom: 0px!important;
- }
- .weui-form-preview__hd .weui-form-preview__value{
- font-size: 16px;
- }
- .weui-form-preview__item{
- border-bottom: 1px solid #d9d9d9;
- }
- .weui-form-preview__value{
- overflow: inherit;
- }
- .weui-panel:before{
- border-top: 0px!important;
- }
- </style>
- </head>
- <body ontouchstart>
- <div class="weui-panel__hd ft_white">历史游玩记录,共2条</div>
- <div class="wrapper">
- <div class="weui-panel weui-panel_access">
-
-
- <div class="weui-panel__bd">
- <div class="weui-form-preview">
-
- <div class="weui-form-preview__bd">
- <div class="weui-form-preview__item">
- <label class="weui-form-preview__label ft_orange">日期</label>
- <em name="start_time" class="weui-form-preview__value">2017-11-11 11:14:43</em>
- </div>
- <div class="weui-form-preview__item">
- <label class="weui-form-preview__label ft_orange">地点</label>
- <span class="weui-form-preview__value">中央公园</span>
- </div>
- <div class="weui-form-preview__item">
- <label class="weui-form-preview__label ft_orange">获得金币</label>
- <span class="weui-form-preview__value">12</span>
- </div>
- <div class="weui-form-preview__item">
- <label class="weui-form-preview__label ft_orange">获得蘑菇</label>
- <span class="weui-form-preview__value">93</span>
- </div>
- <div class="weui-form-preview__item">
- <label class="weui-form-preview__label ft_orange">游玩时长</label>
- <span name="end_time" class="weui-form-preview__value">26:57</span>
- </div>
- </div>
- <div class="weui-form-preview__ft">
- <a class="mine-form-btn" href="/cust/round/l4IsWUWKJkUzyxdk8O9.htm">查看详情</a>
- </div>
- </div>
- <br/>
- <div class="weui-form-preview">
-
- <div class="weui-form-preview__bd">
- <div class="weui-form-preview__item">
- <label class="weui-form-preview__label ft_orange">日期</label>
- <em name="start_time" class="weui-form-preview__value">2017-11-11 11:14:43</em>
- </div>
- <div class="weui-form-preview__item">
- <label class="weui-form-preview__label ft_orange">地点</label>
- <span class="weui-form-preview__value">中央公园</span>
- </div>
- <div class="weui-form-preview__item">
- <label class="weui-form-preview__label ft_orange">获得金币</label>
- <span class="weui-form-preview__value">12</span>
- </div>
- <div class="weui-form-preview__item">
- <label class="weui-form-preview__label ft_orange">获得蘑菇</label>
- <span class="weui-form-preview__value">93</span>
- </div>
- <div class="weui-form-preview__item">
- <label class="weui-form-preview__label ft_orange">游玩时长</label>
- <span name="end_time" class="weui-form-preview__value">26:57</span>
- </div>
- </div>
- <div class="weui-form-preview__ft">
- <a class="mine-form-btn" href="/cust/round/l4IsWUWKJkUzyxdk8O9.htm">查看详情</a>
- </div>
- </div>
- <br/>
- </div>
- </div>
- </div>
- </div>
- <script src="https://res.wx.qq.com/open/libs/weuijs/1.0.0/weui.min.js"></script>
- <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
- </body>
- </html>
- <script type="text/javascript">
- $(document).ready(function () {
- var now = parserDate('2017-11-11 05:27:47');
- $('[name="start_time"]').each(function () {
- var $this = $(this);
- $this.html(getTD($this.html(), now));
- });
- });
- var weekArray = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
- function getTD(timeStr, timeNow) {
- getTimeDesc(parserDate(timeStr), timeNow);
- }
- function getTimeDesc(timeBefore, timeAfter) {
- var date3 = timeAfter.getTime() - timeBefore.getTime();
- var days = Math.floor(date3 / (24 * 3600 * 1000));
- if (days < 1) {
- //当天以内
- var hours = Math.floor(date3 / (3600 * 1000));
- if (hours < 1) {
- //一个小时以内
- return "刚刚";
- }
- return timeBefore.getHours() + "点" + timeBefore.getMinutes() + "分";
- } else if (days < 3) {
- if (days < 2) {
- return "昨天 " + timeBefore.getHours() + "点";
- }
- return "前天 " + timeBefore.getHours() + "点";
- } else if (days < 7) {
- //这个星期内
- return weekArray[timeBefore.getDay()] + " " + timeBefore.getHours() + "点";
- } else if (days < 30) {
- //这个月以内
- return timeBefore.getMonth() + "月" + timeBefore.getDate() + "日 " + timeBefore.getHours() + "点";
- }
- return timeBefore.format("yyyy-MM-dd hh:mm");
- }
- function numts(value) {
- if (isNaN(value) || value === undefined || value == '-') {
- return '-';
- }
- var theTime = parseInt(value);// 秒
- if (isNaN(theTime)) {
- return '-';
- }
- if (value < 0) {
- return '超时!'
- }
- var theTime1 = 0;// 分
- var theTime2 = 0;// 小时
- // alert(theTime);
- if (theTime > 60) {
- theTime1 = parseInt(theTime / 60);
- theTime = parseInt(theTime % 60);
- // alert(theTime1+"-"+theTime);
- if (theTime1 > 60) {
- theTime2 = parseInt(theTime1 / 60);
- theTime1 = parseInt(theTime1 % 60);
- }
- }
- var result = padZero(parseInt(theTime));
- if (theTime1 > 0) {
- result = padZero(parseInt(theTime1)) + ":" + result;
- } else {
- result = "00:" + result;
- }
- if (theTime2 > 0) {
- result = padZero(parseInt(theTime2)) + ":" + result;
- }
- return result;
- }
- var parserDate = function (date) {
- var t = Date.parse(date);
- if (!isNaN(t)) {
- return new Date(Date.parse(date.replace(/-/g, "/")));
- } else {
- return new Date();
- }
- };
- function padZero(num) {
- if (!isNaN(num)) {
- if (num.toString().length < 2) {
- return "0" + num
- } else {
- return num
- }
- }
- return "00"
- }
- Date.prototype.format = function (fmt) {
- var o = {
- "M+": this.getMonth() + 1, //月份
- "d+": this.getDate(), //日
- "h+": this.getHours(), //小时
- "m+": this.getMinutes(), //分
- "s+": this.getSeconds(), //秒
- "q+": Math.floor((this.getMonth() + 3) / 3), //季度
- "S": this.getMilliseconds() //毫秒
- };
- if (/(y+)/.test(fmt)) {
- fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
- }
- for (var k in o) {
- if (new RegExp("(" + k + ")").test(fmt)) {
- fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
- }
- }
- return fmt;
- }
- </script>
|