列表丢数据问题修改
This commit is contained in:
parent
85e7a0b34b
commit
50f264d684
|
|
@ -1,5 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<z-paging ref="paging" v-model="dataList" @query="queryList" usePageScroll>
|
<view class="">
|
||||||
|
|
||||||
|
|
||||||
<tm-nav-bar left-icon="arrow-left" :title="desc? getNameByKey(desc) : getNameByKey(type)" @clickLeft="back" />
|
<tm-nav-bar left-icon="arrow-left" :title="desc? getNameByKey(desc) : getNameByKey(type)" @clickLeft="back" />
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="over" style="margin-top: 30rpx" @click="flag = !flag">
|
<view class="over" style="margin-top: 30rpx" @click="flag = !flag">
|
||||||
|
|
@ -9,11 +11,12 @@
|
||||||
<view class="time" v-show="flag">
|
<view class="time" v-show="flag">
|
||||||
<punch-calendar @switchMonth="switchMonth" @chooseDay="chooseDay" :errorList="errorList" :successList="successList" ref="calendar"></punch-calendar>
|
<punch-calendar @switchMonth="switchMonth" @chooseDay="chooseDay" :errorList="errorList" :successList="successList" ref="calendar"></punch-calendar>
|
||||||
</view>
|
</view>
|
||||||
<view class="list" v-if="dataList.length">
|
<view class="list" v-for="(item, index) in dataList" :key="index">
|
||||||
<view class="row" v-for="(item, index) in dataList" :key="index" >
|
<view class="row" >
|
||||||
<view class="data">
|
<view class="data">
|
||||||
<image src="https://img.agrimedia.cn/apptest/%E6%89%8B%E8%A1%A8-%E7%BA%BF%E6%80%A73-0.png" mode="widthFix"></image>
|
<image src="https://img.agrimedia.cn/apptest/%E6%89%8B%E8%A1%A8-%E7%BA%BF%E6%80%A73-0.png" mode="widthFix"></image>
|
||||||
<view v-if="type == 'step'">
|
<view v-if="type == 'step'">
|
||||||
|
123
|
||||||
<!-- 疲劳:{{item.data_msg.wear}} -->
|
<!-- 疲劳:{{item.data_msg.wear}} -->
|
||||||
运动量:{{item.data_msg.stepCount}}
|
运动量:{{item.data_msg.stepCount}}
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -61,7 +64,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</z-paging>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
@ -116,6 +119,7 @@
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.type = e.type;
|
this.type = e.type;
|
||||||
this.desc = e.desc||'';
|
this.desc = e.desc||'';
|
||||||
|
this.queryList()
|
||||||
},
|
},
|
||||||
|
|
||||||
onShow(e) {
|
onShow(e) {
|
||||||
|
|
@ -138,29 +142,18 @@
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
getArrMaxValue,
|
getArrMaxValue,
|
||||||
queryList(pageNo, pageSize) {
|
queryList() {
|
||||||
this.$store.dispatch('api/getDeviceListDays', {
|
this.$store.dispatch('api/getDeviceListDays', {
|
||||||
type: this.type,
|
type: (this.type == 'step'?'step_split':this.type),
|
||||||
|
// type: (this.type),
|
||||||
device_real_time: this.time,
|
device_real_time: this.time,
|
||||||
device_id:this.getActiceDevice.device_id
|
device_id:this.getActiceDevice.device_id
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
let arrData = []
|
// let arrData = res.data.filter((v) => {
|
||||||
let a = res.data.filter((v) => {
|
// return v.data_msg.stepCount > 0
|
||||||
return v.data_msg.stepCount > 0;
|
// })
|
||||||
if(this.type == 'step'){
|
// let arrData = []
|
||||||
|
|
||||||
// if(v.data_msg.stepCount > 0){
|
|
||||||
// console.log(v)
|
|
||||||
// return v;
|
|
||||||
|
|
||||||
// // arrData = [...arrData,v]
|
|
||||||
// // console.log(arrData)
|
|
||||||
// }
|
|
||||||
}else{
|
|
||||||
return v;
|
|
||||||
// arrData.push(v)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// res.data.map((v,i) => {
|
// res.data.map((v,i) => {
|
||||||
// if(this.type == 'step'){
|
// if(this.type == 'step'){
|
||||||
// if(v.data_msg.stepCount > 0){
|
// if(v.data_msg.stepCount > 0){
|
||||||
|
|
@ -173,9 +166,9 @@
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// })
|
// })
|
||||||
// // arrData = [...arrData,11]
|
// console.log(arrData,'end')
|
||||||
console.log(a)
|
// this.$refs.paging.completeByTotal(res.data,res.last_page);
|
||||||
this.$refs.paging.completeByTotal(arrData,res.last_page);
|
this.dataList = res.data
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -190,7 +183,8 @@
|
||||||
// 点击某一天
|
// 点击某一天
|
||||||
chooseDay(val) {
|
chooseDay(val) {
|
||||||
this.time = val.year + '-' + val.month + '-' + val.day;
|
this.time = val.year + '-' + val.month + '-' + val.day;
|
||||||
this.$refs.paging.reload();
|
this.queryList()
|
||||||
|
// this.$refs.paging.reload();
|
||||||
},
|
},
|
||||||
|
|
||||||
back() {
|
back() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue