146 lines
3.1 KiB
Vue
146 lines
3.1 KiB
Vue
|
|
<template>
|
||
|
|
<view class="content ">
|
||
|
|
</view>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
import {
|
||
|
|
mapState
|
||
|
|
} from "vuex";
|
||
|
|
export default {
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
fields: "",
|
||
|
|
active: 1,
|
||
|
|
acd_id: 2,
|
||
|
|
ind: 0,
|
||
|
|
active1: 0,
|
||
|
|
startTime: "",
|
||
|
|
endTime: "",
|
||
|
|
lineData: {},
|
||
|
|
handTrue: true,
|
||
|
|
}
|
||
|
|
},
|
||
|
|
computed: {
|
||
|
|
...mapState(['user', "MeasureResult", "Trend"]),
|
||
|
|
weightList() {
|
||
|
|
let that = this
|
||
|
|
that.showbox(0)
|
||
|
|
return that.Trend
|
||
|
|
},
|
||
|
|
userInfo() {
|
||
|
|
return this.MeasureResult
|
||
|
|
},
|
||
|
|
endDate() {
|
||
|
|
return this.$tools.getDate("start")
|
||
|
|
},
|
||
|
|
startDate() {
|
||
|
|
return this.$tools.GetDateStr(-90);
|
||
|
|
},
|
||
|
|
},
|
||
|
|
components: {
|
||
|
|
},
|
||
|
|
onLoad(options) {
|
||
|
|
let that = this
|
||
|
|
that.acd_id = options.acd_id
|
||
|
|
that.$store.dispatch("GetBodyTrendList", {
|
||
|
|
aud_id: uni.getStorageSync('userid'),
|
||
|
|
s_time: that.startDate,
|
||
|
|
e_time: that.endDate
|
||
|
|
})
|
||
|
|
// #ifdef APP-PLUS
|
||
|
|
that.fields = "time"
|
||
|
|
// #endif
|
||
|
|
// #ifndef APP-PLUS
|
||
|
|
that.fields = "day"
|
||
|
|
// #endif
|
||
|
|
},
|
||
|
|
// 下拉刷新
|
||
|
|
onPullDownRefresh() {
|
||
|
|
let that = this
|
||
|
|
that.$store.dispatch("GetBodyTrendList", {
|
||
|
|
aud_id: uni.getStorageSync('userid'),
|
||
|
|
s_time: that.startDate,
|
||
|
|
e_time: that.endDate
|
||
|
|
})
|
||
|
|
setTimeout(() => {
|
||
|
|
uni.stopPullDownRefresh()
|
||
|
|
}, 1000);
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
showbox(index) {
|
||
|
|
let that = this
|
||
|
|
that.handTrue = false
|
||
|
|
that.$nextTick(function() {
|
||
|
|
that.handTrue = true
|
||
|
|
that.lineData = that.weightList.length ? that.weightList[index].line : {}
|
||
|
|
})
|
||
|
|
that.active1 = index
|
||
|
|
},
|
||
|
|
//开始
|
||
|
|
handStartTimeH(e) {
|
||
|
|
let that = this
|
||
|
|
if (that.endTime) {
|
||
|
|
if (Date.parse(e.detail.value) > Date.parse(that.endTime)) {
|
||
|
|
that.$tools.msg("请选择正确的时间")
|
||
|
|
return
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
if (Date.parse(e.detail.value) > Date.parse(that.endDate)) {
|
||
|
|
that.$tools.msg("请选择正确的时间")
|
||
|
|
return
|
||
|
|
}
|
||
|
|
}
|
||
|
|
that.startTime = e.detail.value
|
||
|
|
let endtime = that.endTime ? that.endTime : that.endDate
|
||
|
|
that.$store.dispatch("GetBodyTrendList", {
|
||
|
|
aud_id: that.user.id,
|
||
|
|
s_time: that.startTime,
|
||
|
|
e_time: that.endTime ? that.endTime : that.endDate
|
||
|
|
})
|
||
|
|
that.showbox(0)
|
||
|
|
},
|
||
|
|
// 结束
|
||
|
|
handEndTimeH(e) {
|
||
|
|
let that = this
|
||
|
|
if (that.startTime) {
|
||
|
|
if (Date.parse(e.detail.value) < Date.parse(that.startTime)) {
|
||
|
|
that.$tools.msg("请选择正确的时间")
|
||
|
|
return
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
if (Date.parse(e.detail.value) < Date.parse(that.startDate)) {
|
||
|
|
that.$tools.msg("请选择正确的时间")
|
||
|
|
return
|
||
|
|
}
|
||
|
|
}
|
||
|
|
that.endTime = e.detail.value
|
||
|
|
let startTime = that.startTime ? that.startTime : that.startDate
|
||
|
|
that.$store.dispatch("GetBodyTrendList", {
|
||
|
|
aud_id: uni.getStorageSync('userid'),
|
||
|
|
s_time: startTime,
|
||
|
|
e_time: that.endTime
|
||
|
|
})
|
||
|
|
that.showbox(0)
|
||
|
|
},
|
||
|
|
handleClick(ind) {
|
||
|
|
let that = this
|
||
|
|
if (!uni.getStorageSync('token')) {
|
||
|
|
that.$tools.msg("登录后查看更多!")
|
||
|
|
return
|
||
|
|
}
|
||
|
|
this.ind = ind
|
||
|
|
this.$store.commit("changeFirst", true);
|
||
|
|
},
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<style scoped lang="scss">
|
||
|
|
@import "@/scss/body.scss";
|
||
|
|
|
||
|
|
.listC {
|
||
|
|
margin: 0;
|
||
|
|
width: 100%;
|
||
|
|
}
|
||
|
|
</style>
|