|
@ -3,10 +3,10 @@ |
|
|
<!-- 添加 --> |
|
|
<!-- 添加 --> |
|
|
<button class="shadow round bg-cyan add-btn iconfont icon-plus" hover-class="cc-active" @tap="openPage('/pages/add-stroke/add-stroke')"></button> |
|
|
<button class="shadow round bg-cyan add-btn iconfont icon-plus" hover-class="cc-active" @tap="openPage('/pages/add-stroke/add-stroke')"></button> |
|
|
<view v-if="tableList && tableList.length>0" class="cu-timeline" :key="index" v-for="(item,index) in tableList"> |
|
|
<view v-if="tableList && tableList.length>0" class="cu-timeline" :key="index" v-for="(item,index) in tableList"> |
|
|
<view class="cu-time">{{ +item.startTime | datefmt('MM-DD') }}</view> |
|
|
<view class="cu-time">{{ +item.startTime | formatDate }}</view> |
|
|
<view class="cu-item cuIcon-timefill text-blue"> |
|
|
<view class="cu-item cuIcon-timefill text-blue"> |
|
|
<view class="content shadow-blur bg-blue light"> |
|
|
<view class="content shadow-blur bg-blue light"> |
|
|
{{ +item.startTime | datefmt('MM月DD日') }} -- {{ +item.endTime | datefmt('MM月DD日') }} |
|
|
{{ +item.startTime | formatDate }} 至 {{ +item.endTime | formatDate }} |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="cu-item cuIcon-tagfill text-green"> |
|
|
<view class="cu-item cuIcon-tagfill text-green"> |
|
@ -35,6 +35,9 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
|
|
|
import { |
|
|
|
|
|
formatDate |
|
|
|
|
|
} from 'common/script/filters'; |
|
|
import { |
|
|
import { |
|
|
showToast |
|
|
showToast |
|
|
} from 'common/script/util'; |
|
|
} from 'common/script/util'; |
|
@ -80,6 +83,14 @@ |
|
|
|
|
|
|
|
|
computed: mapState('user', ['token']), |
|
|
computed: mapState('user', ['token']), |
|
|
|
|
|
|
|
|
|
|
|
// 时间戳转化日期 |
|
|
|
|
|
filters: { |
|
|
|
|
|
formatDate(time) { |
|
|
|
|
|
var data = new Date(time); |
|
|
|
|
|
return formatDate(data, 'MM-dd'); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
onLoad() { |
|
|
onLoad() { |
|
|
const startTime = +this.$moment() |
|
|
const startTime = +this.$moment() |
|
|
.startOf('year') |
|
|
.startOf('year') |
|
@ -108,12 +119,16 @@ |
|
|
msg, |
|
|
msg, |
|
|
data |
|
|
data |
|
|
} = res.data; |
|
|
} = res.data; |
|
|
|
|
|
|
|
|
if (success && code === 200) { |
|
|
if (success && code === 200) { |
|
|
this.success = true; |
|
|
this.success = true; |
|
|
this.tableList = data; |
|
|
this.tableList = data; |
|
|
|
|
|
|
|
|
|
|
|
const fff = this.$moment(1583683200000).format('YY-MM-DD') |
|
|
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: msg || '获取健康打卡记录成功', |
|
|
title: msg || '查询行程失败', |
|
|
icon: 'none' |
|
|
icon: 'none' |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
@ -121,7 +136,7 @@ |
|
|
console.log('error: ', error); |
|
|
console.log('error: ', error); |
|
|
if (error.msg) { |
|
|
if (error.msg) { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: error.msg || '获取健康打卡记录失败', |
|
|
title: error.msg || '查询行程失败', |
|
|
icon: 'none' |
|
|
icon: 'none' |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|