123
This commit is contained in:
parent
057092a023
commit
d267101341
|
|
@ -0,0 +1,173 @@
|
||||||
|
<template>
|
||||||
|
<view class="wrapper">
|
||||||
|
<view class="bg" @click="onTap">
|
||||||
|
<view class="edit" @click.stop>
|
||||||
|
<view class="title">手动记录</view>
|
||||||
|
<view class="editem" @click="hideKeyboard">
|
||||||
|
<view class="left">项目</view>
|
||||||
|
<view class="right">
|
||||||
|
<picker :range="list" :value="lableTndex" @change="bindLableChange">
|
||||||
|
<view class="uni-input">{{name?name:'请选择'}}</view>
|
||||||
|
<icon class="iconfont icon-arrow-down-bold"></icon>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- -->
|
||||||
|
<view class="editem" @click="hideKeyboard">
|
||||||
|
<view class="left">日期</view>
|
||||||
|
<view class="right">
|
||||||
|
<picker mode="date" :end="endDate" @change="changeLog" fields="time">
|
||||||
|
<view class="uni-input">{{regTime?regTime:'请选择'}}</view>
|
||||||
|
<icon class="iconfont icon-arrow-down-bold"></icon>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="">
|
||||||
|
<view class="editem">
|
||||||
|
<view class="name">时长</view>
|
||||||
|
<view class="right">
|
||||||
|
<picker mode="multiSelector" :range="timeList" :value="timesTndex" @change="bindTimeChange">
|
||||||
|
<view class="size16">{{time_m?time_m+':':'请选择'}}{{time_s?time_s:''}}</view>
|
||||||
|
</picker>
|
||||||
|
<uni-icons type="bottom" class="ml-15 c666"></uni-icons>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="btn close" @click="onTap()">取消</view>
|
||||||
|
<view class="btn" @click="handleTarget">确定</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
mapState
|
||||||
|
} from "vuex";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
name: "",
|
||||||
|
regTime: "",
|
||||||
|
number: '',
|
||||||
|
timeList: [],
|
||||||
|
time_m: "",
|
||||||
|
time_s: "",
|
||||||
|
timesTndex: [1, 0],
|
||||||
|
lableTndex: 0,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
type: {},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["labelList"]),
|
||||||
|
list() {
|
||||||
|
let that = this
|
||||||
|
let list = []
|
||||||
|
that.labelList.forEach(ite => {
|
||||||
|
if (ite.acd_id == that.type) {
|
||||||
|
list = ite.list
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return list
|
||||||
|
},
|
||||||
|
endDate() {
|
||||||
|
return this.$tools.getDate("start")
|
||||||
|
},
|
||||||
|
startDate() {
|
||||||
|
return this.$tools.GetDateStr(-90);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.timeList = this.$tools.gethms()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
bindTimeChange(e) {
|
||||||
|
let that = this
|
||||||
|
let m = e.target.value[0]
|
||||||
|
let s = e.target.value[1]
|
||||||
|
that.timesTndex = e.target.value
|
||||||
|
let time_m = Number(that.timeList[0][m].substring(0, 2)) * 60
|
||||||
|
let time_s = Number(that.timeList[1][s].substring(0, 2))
|
||||||
|
if (Number(time_m + time_s) < 30) {
|
||||||
|
that.time_m = '00'
|
||||||
|
that.time_s = '30'
|
||||||
|
} else {
|
||||||
|
that.time_m = that.timeList[0][m].substring(0, 2)
|
||||||
|
that.time_s = that.timeList[1][s].substring(0, 2)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 手动记录
|
||||||
|
handleTarget() {
|
||||||
|
let that = this
|
||||||
|
if (!that.name) {
|
||||||
|
that.$tools.msg("请选择测量项目")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!that.regTime) {
|
||||||
|
that.$tools.msg("请选择日期")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!that.time_m || !that.time_s) {
|
||||||
|
that.$tools.msg("请输入时长")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
that.$model.getpublicmeasure({
|
||||||
|
acd_id: that.type,
|
||||||
|
name: that.name,
|
||||||
|
record_time: that.regTime,
|
||||||
|
data: that.time_m + ':' + that.time_s,
|
||||||
|
aud_id: uni.getStorageSync('userid')
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code != 0) return
|
||||||
|
that.$tools.msg(res.msg)
|
||||||
|
that.$store.commit("changeRecord", false);
|
||||||
|
that.$store.dispatch("getUserInfo", {
|
||||||
|
aud_id: uni.getStorageSync('userid'),
|
||||||
|
})
|
||||||
|
that.$store.dispatch("getPublicContent", {
|
||||||
|
acd_id: that.acd_id,
|
||||||
|
aud_id: uni.getStorageSync('userid')
|
||||||
|
})
|
||||||
|
that.regTime = ""
|
||||||
|
})
|
||||||
|
},
|
||||||
|
bindLableChange(e) {
|
||||||
|
let that = this
|
||||||
|
that.name = that.list[e.detail.value]
|
||||||
|
},
|
||||||
|
//
|
||||||
|
changeLog(e) {
|
||||||
|
this.regTime = e.detail.value
|
||||||
|
},
|
||||||
|
onTap() {
|
||||||
|
this.regTime = ""
|
||||||
|
this.name = ""
|
||||||
|
this.$store.commit("changeRecord", false);
|
||||||
|
},
|
||||||
|
hideKeyboard() {
|
||||||
|
uni.hideKeyboard()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.btn {
|
||||||
|
width: 40%;
|
||||||
|
float: right;
|
||||||
|
margin-top: 15px;
|
||||||
|
background: $maincolor !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit {
|
||||||
|
top: 20%
|
||||||
|
}
|
||||||
|
|
||||||
|
.close {
|
||||||
|
background: #fff !important;
|
||||||
|
float: left;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,396 @@
|
||||||
|
<template>
|
||||||
|
<view class="content ">
|
||||||
|
<view class="tabbar">
|
||||||
|
<scroll-view class="scroll-menu" scroll-x="true" style="white-space: nowrap;">
|
||||||
|
<view v-for="(item,index) in labelList" :class="[active==index?'active':'']"
|
||||||
|
@click="handleActive(item,index)">
|
||||||
|
<text>{{item}}</text>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
<!-- -->
|
||||||
|
<view class="desc">
|
||||||
|
<view class="statuevue">
|
||||||
|
<view class="bi">
|
||||||
|
<view class="peobox" :style="'left:'+offset+'%'">
|
||||||
|
<view class="xx"></view>
|
||||||
|
</view>
|
||||||
|
<view class="item" v-for="(ite,ind) in lineList" :key="ind" :style="{backgroundColor:ite.color}">
|
||||||
|
<view class="span1">{{ite.text}}</view>
|
||||||
|
<view class="span" v-if="ind<lineList.length-1">{{ite.max_val}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- -->
|
||||||
|
<view v-for="(ite,ind) in label_data" v-if="active == ind">
|
||||||
|
<view class="info">
|
||||||
|
<view class="left">
|
||||||
|
<view class="left_view">
|
||||||
|
<view class="title">{{ite.this_time_title}}:</view>
|
||||||
|
<view class="val">
|
||||||
|
<text class="yello"></text>
|
||||||
|
{{ite.this_time_value?ite.this_time_value:'-'}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="left_view">
|
||||||
|
<view class="title">{{ite.today_time_title}}:</view>
|
||||||
|
<view class="val">
|
||||||
|
<text class="yello"></text>
|
||||||
|
{{ite.today_time_value?ite.today_time_value:'-'}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="left_view">
|
||||||
|
<view class="title"></view>
|
||||||
|
<view class="val">
|
||||||
|
<text class="blues yello"></text>
|
||||||
|
{{ite.today_times?ite.today_times:'-'}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="left_view">
|
||||||
|
<view class="title">{{ite.all_time_title}}:</view>
|
||||||
|
<view class="val">
|
||||||
|
<text class="yello"></text>
|
||||||
|
{{ite.all_time_value?ite.all_time_value:'-'}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="left_view">
|
||||||
|
<view class="title"></view>
|
||||||
|
<view class="val">
|
||||||
|
<text class="blues yello"></text>
|
||||||
|
{{ite.all_times?ite.all_times:'-'}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="right">
|
||||||
|
<view class="title bold">训练成绩为</view>
|
||||||
|
<view class="charts">
|
||||||
|
<qiun-data-charts type="arcbar" :chartData="chartData" />
|
||||||
|
<view class="name">{{ite.score?ite.score:'-'}}</view>
|
||||||
|
</view>
|
||||||
|
<view class="standard" v-if="ite.standard">
|
||||||
|
<text :style="{backgroundColor:ite.color}">{{ite.standard}}</text>
|
||||||
|
</view>
|
||||||
|
<view v-if="ite.max_score" class="size12 c999"> 总成绩为{{ite.max_score}}分</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 说明 -->
|
||||||
|
<view class="info describe" v-if="ite.describe">
|
||||||
|
{{ite.describe}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- -->
|
||||||
|
<view class="gridList">
|
||||||
|
<view class="data">
|
||||||
|
<view class="item" @click="navTo('/pages/PublicCards/charts?acd_id='+acd_id)">
|
||||||
|
<view class="image">
|
||||||
|
<image src="@/static/charts.png"></image>
|
||||||
|
</view>
|
||||||
|
<view class="name">运动曲线</view>
|
||||||
|
</view>
|
||||||
|
<view class="item" @click="navTo('/pages/PublicCards/history?acd_id='+acd_id)">
|
||||||
|
<view class="image">
|
||||||
|
<image src="@/static/add.png"></image>
|
||||||
|
</view>
|
||||||
|
<view class="name">历史记录</view>
|
||||||
|
</view>
|
||||||
|
<view class="item" @click="navTo('/pages/PublicCards/contrast?acd_id='+acd_id)">
|
||||||
|
<view class="image">
|
||||||
|
<image src="@/static/pk.png"></image>
|
||||||
|
</view>
|
||||||
|
<view class="name">数据对比</view>
|
||||||
|
</view>
|
||||||
|
<view class="item" @click="$store.commit('changeRecord',true)">
|
||||||
|
<view class="image">
|
||||||
|
<image src="@/static/history.png"></image>
|
||||||
|
</view>
|
||||||
|
<view class="name">添加记录</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 手动记录 -->
|
||||||
|
<record :rtype='acd_id'></record>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
mapState
|
||||||
|
} from "vuex";
|
||||||
|
import record from '@/element/manuallyAdd/record.vue';
|
||||||
|
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue';
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
active: 0,
|
||||||
|
acd_id: 10,
|
||||||
|
lineList: [],
|
||||||
|
label_data: [],
|
||||||
|
offset: 0,
|
||||||
|
labelName: "",
|
||||||
|
chartData: {
|
||||||
|
series: [{
|
||||||
|
name: "正确率",
|
||||||
|
color: "#4687F9",
|
||||||
|
data: 0.8
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
record,
|
||||||
|
qiunDataCharts
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["PublicContent"]),
|
||||||
|
labelList() {
|
||||||
|
let that = this
|
||||||
|
if (that.PublicContent) {
|
||||||
|
that.labelName = that.PublicContent.label_list[0]
|
||||||
|
that.lineList = that.PublicContent.line_list
|
||||||
|
that.label_data = that.PublicContent.label_data
|
||||||
|
that.offset = that.PublicContent.label_data[0].offset
|
||||||
|
}
|
||||||
|
return that.PublicContent ? that.PublicContent.label_list : []
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
let that = this
|
||||||
|
that.acd_id = options.acd_id
|
||||||
|
that.$store.dispatch("getPublicContent", {
|
||||||
|
acd_id: that.acd_id,
|
||||||
|
aud_id: uni.getStorageSync('userid')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleActive(ite, ind) {
|
||||||
|
let that = this
|
||||||
|
that.active = ind
|
||||||
|
that.labelName = ite
|
||||||
|
that.offset = that.label_data[ind].offset
|
||||||
|
},
|
||||||
|
// 历史数据删除时重新加载接口
|
||||||
|
reload() {
|
||||||
|
let that = this
|
||||||
|
console.log('返回历史页', that.acd_id)
|
||||||
|
this.$nextTick(() => {
|
||||||
|
that.$store.dispatch("getPublicContent", {
|
||||||
|
acd_id: that.acd_id,
|
||||||
|
aud_id: uni.getStorageSync('userid')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
navTo(url) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: url
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.content {
|
||||||
|
width: calc(100% - 30px);
|
||||||
|
min-height: calc(100vh - 80px);
|
||||||
|
padding: 65px 15px 15px;
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabbar {
|
||||||
|
display: flex;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 999;
|
||||||
|
justify-content: space-between;
|
||||||
|
border-bottom: 1px solid #f7f7f7;
|
||||||
|
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
.scroll-menu {
|
||||||
|
width: 100%;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
|
view {
|
||||||
|
height: 55px;
|
||||||
|
line-height: 55px;
|
||||||
|
display: inline-block;
|
||||||
|
min-width: 100px;
|
||||||
|
margin: 0 10px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.active {
|
||||||
|
color: $maincolor;
|
||||||
|
font-weight: bold;
|
||||||
|
border-bottom: 2px solid $maincolor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc {
|
||||||
|
padding: 15px;
|
||||||
|
text-align: left;
|
||||||
|
width: calc(100%-20px);
|
||||||
|
height: auto;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #999;
|
||||||
|
margin-top: 15px;
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
|
||||||
|
.statuevue {
|
||||||
|
height: 35px;
|
||||||
|
position: relative;
|
||||||
|
width: 100% !important;
|
||||||
|
margin: 20px auto 10px;
|
||||||
|
|
||||||
|
.bi {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: auto;
|
||||||
|
padding-top: 10px;
|
||||||
|
|
||||||
|
.peobox {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
top: -1px;
|
||||||
|
|
||||||
|
.xx {
|
||||||
|
width: 5px;
|
||||||
|
height: 5px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #fff;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 9;
|
||||||
|
border: 2px solid #1b2086;
|
||||||
|
top: 9px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
position: relative;
|
||||||
|
margin: 0;
|
||||||
|
flex: 1;
|
||||||
|
height: 5px;
|
||||||
|
color: #666;
|
||||||
|
font-size: 30rpx;
|
||||||
|
|
||||||
|
.span1 {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
position: absolute;
|
||||||
|
top: -23px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.span {
|
||||||
|
margin-top: 8px;
|
||||||
|
position: absolute;
|
||||||
|
right: -8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.describe {
|
||||||
|
color: #666;
|
||||||
|
font-size: 28rpx;
|
||||||
|
line-height: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 15px;
|
||||||
|
margin-top: 15px;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
width: calc(100% - 280rpx);
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
.left_view {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
width: 80px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
width: 260rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.charts {
|
||||||
|
width: 260upx;
|
||||||
|
height: 260upx;
|
||||||
|
margin: 10px 0;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 56rpx;
|
||||||
|
color: #4687F9;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.standard {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: -3px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
|
||||||
|
text {
|
||||||
|
width: 100px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 14px;
|
||||||
|
padding: 2px 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.yello {
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 5px;
|
||||||
|
background-color: $btncolor;
|
||||||
|
}
|
||||||
|
|
||||||
|
.blues {
|
||||||
|
background-color: $maincolor;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gridList {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,202 @@
|
||||||
|
<template>
|
||||||
|
<view class="TrendPage">
|
||||||
|
<view class="charts">
|
||||||
|
<!-- 时间选择 -->
|
||||||
|
<view class="boxTime">
|
||||||
|
<view class="one">
|
||||||
|
<picker mode="date" :end="endDate" @change="handStartTimeH" fields="time"
|
||||||
|
:value="startTime?startTime:startDate">
|
||||||
|
<view class="uni-input mr-10">{{startTime?startTime:startDate}}</view>
|
||||||
|
<icon class="iconfont icon-arrow-down-bold"></icon>
|
||||||
|
</picker>
|
||||||
|
<view class="center">~</view>
|
||||||
|
<picker mode="date" :end="endDate" @change="handEndTimeH" fields="time"
|
||||||
|
:value="endTime?endTime:endDate">
|
||||||
|
<view class="uni-input mr-10">{{endTime?endTime:endDate}}</view>
|
||||||
|
<icon class="iconfont icon-arrow-down-bold"></icon>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 曲线图 -->
|
||||||
|
<view class="box">
|
||||||
|
<view class="boxLine">
|
||||||
|
<view class="line" v-for="(item,index) in weightList">
|
||||||
|
<view v-if="item.line.categories.length" class="mt-15 mb-15">
|
||||||
|
<qiunDataCharts type="area" :chartData="item.line" :canvas2d="true" :canvasId="'1025'+ index"
|
||||||
|
:cHeight="400" :cWidth="720" :animation="false"
|
||||||
|
:opts="{enableScroll:true,xAxis:{scrollShow:false,itemCount:3}}" :ontouch="true" />
|
||||||
|
</view>
|
||||||
|
<view class="nolist" v-else>
|
||||||
|
<image src="../../static/none.png"></image>
|
||||||
|
<text>暂无数据,请手动添加~</text>
|
||||||
|
</view>
|
||||||
|
<view class="title">
|
||||||
|
<text :style="{'backgroundColor':item.line.series[0].color}"></text>
|
||||||
|
{{item.title}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
mapState
|
||||||
|
} from "vuex";
|
||||||
|
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue';
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
qiunDataCharts,
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["labelList"]),
|
||||||
|
endDate() {
|
||||||
|
return this.$tools.getDate("start")
|
||||||
|
},
|
||||||
|
startDate() {
|
||||||
|
return this.$tools.GetDateStr(-90);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
name: "",
|
||||||
|
list: [],
|
||||||
|
acd_id: 0,
|
||||||
|
handTrue: true,
|
||||||
|
active: 0,
|
||||||
|
startTime: "",
|
||||||
|
endTime: "",
|
||||||
|
weightList: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
let that = this
|
||||||
|
that.active = 0
|
||||||
|
that.acd_id = options.acd_id
|
||||||
|
that.time = that.startDate
|
||||||
|
that.labelList.forEach(ite => {
|
||||||
|
if (ite.acd_id == that.acd_id) {
|
||||||
|
that.list = ite.list
|
||||||
|
that.name = that.list[0]
|
||||||
|
return
|
||||||
|
}
|
||||||
|
})
|
||||||
|
that.handlePublicTrendList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
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
|
||||||
|
that.handlePublicTrendList()
|
||||||
|
},
|
||||||
|
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
|
||||||
|
that.handlePublicTrendList()
|
||||||
|
},
|
||||||
|
handlePublicTrendList() {
|
||||||
|
let that = this
|
||||||
|
that.$model.getPublicTrendList({
|
||||||
|
aud_id: uni.getStorageSync('userid'),
|
||||||
|
acd_id: that.acd_id,
|
||||||
|
s_time: that.startTime ? that.startTime : that.startDate,
|
||||||
|
e_time: that.endTime ? that.endTime : that.endDate
|
||||||
|
}).then(res => {
|
||||||
|
// 公共曲线
|
||||||
|
if (res.code == 0) {
|
||||||
|
that.weightList = res.data
|
||||||
|
}
|
||||||
|
console.log("公共曲线", that.weightList)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
navTo(url) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: url
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.TrendPage {
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxTime {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 10px 10px 0 0;
|
||||||
|
|
||||||
|
.one {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
line-height: 25px;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.center {
|
||||||
|
width: 10%;
|
||||||
|
margin: 0 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
picker {
|
||||||
|
width: 50%;
|
||||||
|
border: none;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
color: #333333;
|
||||||
|
font-size: 36rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.line {
|
||||||
|
padding-top: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
color: #999;
|
||||||
|
font-size: 14PX;
|
||||||
|
margin-top: 15px;
|
||||||
|
|
||||||
|
text {
|
||||||
|
width: 15px;
|
||||||
|
height: 10px;
|
||||||
|
margin-right: 5px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,256 @@
|
||||||
|
<template>
|
||||||
|
<view class="content">
|
||||||
|
<view class="tabbar">
|
||||||
|
<scroll-view class="scroll-menu" scroll-x="true" style="white-space: nowrap;">
|
||||||
|
<view v-for="(item,index) in labellist" :class="[active==index?'active':'']"
|
||||||
|
@click="handleActive(item,index)">
|
||||||
|
<text>{{item}}</text>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
<view class=" calendar">
|
||||||
|
<!-- 日历 -->
|
||||||
|
<ren-calendar ref='ren' :markDays='markDays' @onDayClick='onDayClick' @onMonthClickPre='onMonthClickPre'
|
||||||
|
v-if="isShow">
|
||||||
|
</ren-calendar>
|
||||||
|
<!-- -->
|
||||||
|
<view class="box" v-if="infoList.length">
|
||||||
|
<view class="list" v-for="(item,index) in infoList" :key="index" @click="addMemberTags(item.id,item)">
|
||||||
|
<view class="item">
|
||||||
|
<view class="check">
|
||||||
|
<uni-icons :type="isActive.indexOf(item.id)!=-1?'checkbox-filled':'circle'" size="22"
|
||||||
|
:color="isActive.indexOf(item.id)!=-1?'#FEC407':'#dfdfdf'"></uni-icons>
|
||||||
|
</view>
|
||||||
|
<view>{{item.v1}}<text>{{item.v1_name}}</text></view>
|
||||||
|
<view v-if="item.v2">{{item.v2}}<text>{{item.v2_name}}</text></view>
|
||||||
|
<view v-if="item.v3">{{item.v3}}<text>{{item.v3_name}}</text></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- -->
|
||||||
|
<view class="bottom">
|
||||||
|
<view class="list" v-for="(ite,ind) in ActiveDays" :key="ind" v-if="isActive"
|
||||||
|
@click="addMemberTags(ite.id,ite)">
|
||||||
|
<view class="item borderRadius">
|
||||||
|
<view class="time">{{ite.r_t}}</view>
|
||||||
|
<view>{{ite.v1}}<text>{{ite.v1_name}}</text></view>
|
||||||
|
<view v-if="ite.v2">{{ite.v2}}<text>{{ite.v2_name}}</text></view>
|
||||||
|
<view v-if="ite.v3">{{ite.v3}}<text>{{ite.v3_name}}</text></view>
|
||||||
|
<view class="check">
|
||||||
|
<uni-icons type="clear" size="22" color="#999"></uni-icons>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="pkclass" v-if="length==2">vs</view>
|
||||||
|
<!-- <view :class="{'active':length!=2}" class="btn" @click="handlePK">对比</view> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import RenCalendar from '@/element/ren-calendar/ren-calendar.vue';
|
||||||
|
import {
|
||||||
|
mapState
|
||||||
|
} from "vuex";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
markDays: [],
|
||||||
|
infoList: [],
|
||||||
|
list: [],
|
||||||
|
isActive: [],
|
||||||
|
ActiveDays: [],
|
||||||
|
token: null,
|
||||||
|
startM: null,
|
||||||
|
endM: null,
|
||||||
|
isShow: true,
|
||||||
|
acd_id: "",
|
||||||
|
active: 0,
|
||||||
|
labelName: "",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
RenCalendar,
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user", "TrendPk", "labelList"]),
|
||||||
|
labellist() {
|
||||||
|
let that = this
|
||||||
|
let list = []
|
||||||
|
that.labelList.forEach(ite => {
|
||||||
|
if (ite.acd_id == that.acd_id) {
|
||||||
|
list = ite.list
|
||||||
|
that.labelName = ite.list[0]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return list
|
||||||
|
},
|
||||||
|
length() {
|
||||||
|
return this.isActive.length
|
||||||
|
},
|
||||||
|
endDate() {
|
||||||
|
return this.$tools.getDate("start")
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onLoad(optoins) {
|
||||||
|
let that = this
|
||||||
|
that.acd_id = optoins.acd_id
|
||||||
|
that.startM = that.$tools.getDate("m").substring(0, 10)
|
||||||
|
that.endM = that.$tools.getDate("m").substring(11, 21)
|
||||||
|
that.markDays = []
|
||||||
|
that.list = []
|
||||||
|
that.isActive = []
|
||||||
|
that.ActiveDays = []
|
||||||
|
that.$nextTick(() => {
|
||||||
|
that.isShow = true
|
||||||
|
that.getList(that.startM, that.endM)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getList(start, end) {
|
||||||
|
let that = this
|
||||||
|
that.$model.getPublicResultdiff({
|
||||||
|
aud_id: uni.getStorageSync('userid'),
|
||||||
|
acd_id: that.acd_id,
|
||||||
|
s_time: start,
|
||||||
|
e_time: end,
|
||||||
|
name: that.labelName
|
||||||
|
}).then(res => {
|
||||||
|
if (res) {
|
||||||
|
that.markDays = res.Dlist
|
||||||
|
that.list = res.data
|
||||||
|
for (var i = 0; i < res.data.length; i++) {
|
||||||
|
if (Date.parse(that.endDate) == Date.parse(res.data[i].r_t)) {
|
||||||
|
that.infoList.push(res.data[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log("对比", res, )
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onMonthClickPre(data) {
|
||||||
|
console.log("onMonthClickPre", data)
|
||||||
|
let that = this
|
||||||
|
let start = data.substring(0, 10)
|
||||||
|
let end = data.substring(11, 21)
|
||||||
|
that.infoList = []
|
||||||
|
that.markDays = []
|
||||||
|
that.list = []
|
||||||
|
that.getList(start, end)
|
||||||
|
},
|
||||||
|
onDayClick(data) {
|
||||||
|
let that = this
|
||||||
|
this.infoList = []
|
||||||
|
for (var i = 0; i < that.list.length; i++) {
|
||||||
|
if (Date.parse(data.date) == Date.parse(that.list[i].r_t)) { //includes 检测数组是否有某个值
|
||||||
|
this.infoList.push(that.list[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
addMemberTags(index, item) {
|
||||||
|
var that = this;
|
||||||
|
console.log("addMemberTags", index, item)
|
||||||
|
if (that.isActive.indexOf(index) == -1) {
|
||||||
|
that.isActive.push(index);
|
||||||
|
that.ActiveDays.push(item);
|
||||||
|
} else {
|
||||||
|
that.isActive.splice(that.isActive.indexOf(index), 1);
|
||||||
|
that.ActiveDays.splice(that.ActiveDays.indexOf(item), 1);
|
||||||
|
}
|
||||||
|
if (that.isActive.length > 2) {
|
||||||
|
that.isActive.splice(0, 1)
|
||||||
|
that.ActiveDays.splice(0, 1);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handlePK() {
|
||||||
|
let that = this
|
||||||
|
if (that.isActive.length != 2) {
|
||||||
|
that.$tools.msg("请先选择数据!")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let info = {}
|
||||||
|
info.type = that.acd_id
|
||||||
|
info.before_id = that.isActive[0]
|
||||||
|
info.after_id = that.isActive[1]
|
||||||
|
console.log("1111", info, that.isActive)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/compk/pkdetail?info=" + JSON.stringify(info)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleActive(ite, ind) {
|
||||||
|
let that = this
|
||||||
|
that.active = ind
|
||||||
|
that.labelName = ite
|
||||||
|
that.startM = that.$tools.getDate("m").substring(0, 10)
|
||||||
|
that.endM = that.$tools.getDate("m").substring(11, 21)
|
||||||
|
that.list = []
|
||||||
|
that.infoList = []
|
||||||
|
that.markDays = []
|
||||||
|
that.isActive = []
|
||||||
|
that.ActiveDays = []
|
||||||
|
that.$nextTick(() => {
|
||||||
|
that.isShow = true
|
||||||
|
that.getList(that.startM, that.endM)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.calendar {
|
||||||
|
padding-top: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/.calendar-wrapper {
|
||||||
|
margin: 15px;
|
||||||
|
|
||||||
|
.header {
|
||||||
|
background-color: #fff;
|
||||||
|
color: $maincolor;
|
||||||
|
border-radius: 10px 10px 0 0;
|
||||||
|
}
|
||||||
|
/deep/uni-icons {
|
||||||
|
color: $maincolor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
font-size: 30rpx !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabbar {
|
||||||
|
display: flex;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 999;
|
||||||
|
justify-content: space-between;
|
||||||
|
border-bottom: 1px solid #f7f7f7;
|
||||||
|
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
.scroll-menu {
|
||||||
|
width: 100%;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
|
view {
|
||||||
|
height: 55px;
|
||||||
|
line-height: 55px;
|
||||||
|
display: inline-block;
|
||||||
|
min-width: 100px;
|
||||||
|
margin: 0 10px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.active {
|
||||||
|
color: $maincolor;
|
||||||
|
font-weight: bold;
|
||||||
|
border-bottom: 2px solid $maincolor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,272 @@
|
||||||
|
<template>
|
||||||
|
<view class="common">
|
||||||
|
<view class="tabbar">
|
||||||
|
<scroll-view class="scroll-menu" scroll-x="true" style="white-space: nowrap;">
|
||||||
|
<view v-for="(item,index) in labellist" :class="[active==index?'active':'']"
|
||||||
|
@click="handleActive(item,index)">
|
||||||
|
<text>{{item}}</text>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
<view class="history">
|
||||||
|
<uni-swipe-action>
|
||||||
|
<uni-swipe-action-item :right-options="item.options" v-for="(item, index) in ranklist" :key="index"
|
||||||
|
@click="swipeClick($event, index)">
|
||||||
|
<view class='list'>
|
||||||
|
<view class="item">
|
||||||
|
<view class="time">
|
||||||
|
<icon class="t-icon t-icon-shijian-mianxing-0"></icon>
|
||||||
|
<text>{{item.record_time}}</text>
|
||||||
|
</view>
|
||||||
|
<view>{{item.v1}}<text>{{item.v1_name}}</text></view>
|
||||||
|
<view>{{item.v2}}<text>{{item.v2_name}}</text></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</uni-swipe-action-item>
|
||||||
|
</uni-swipe-action>
|
||||||
|
<view class="endtext" v-if="!lastPage || page >= lastPage">—— 到底了,看看别的吧 ——</view>
|
||||||
|
</view>
|
||||||
|
<view class="nolist" v-if="!lastPage">
|
||||||
|
<image src="../../static/none.png"></image>
|
||||||
|
<text>暂无数据</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
mapState
|
||||||
|
} from "vuex";
|
||||||
|
export default {
|
||||||
|
computed: {
|
||||||
|
...mapState(['user', 'labelList']),
|
||||||
|
labellist() {
|
||||||
|
let that = this
|
||||||
|
let list = []
|
||||||
|
that.labelList.forEach(ite => {
|
||||||
|
if (ite.acd_id == that.acd_id) {
|
||||||
|
list = ite.list
|
||||||
|
that.labelName = ite.list[0]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return list
|
||||||
|
},
|
||||||
|
endDate() {
|
||||||
|
return this.$tools.getDate("start")
|
||||||
|
},
|
||||||
|
startDate() {
|
||||||
|
return this.$tools.GetDateStr(-90);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
ranklist: [],
|
||||||
|
page: 1,
|
||||||
|
isDelete: false,
|
||||||
|
lastPage: '',
|
||||||
|
acd_id: "",
|
||||||
|
active: 0,
|
||||||
|
labelName: "",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
let that = this
|
||||||
|
that.acd_id = options.acd_id
|
||||||
|
that.$nextTick(() => {
|
||||||
|
that.getList()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onUnload() {
|
||||||
|
console.log('关闭页面');
|
||||||
|
let that = this
|
||||||
|
var pages = getCurrentPages();
|
||||||
|
var Page = pages[pages.length - 1]; //当前页
|
||||||
|
var prevPage = pages[pages.length - 2];
|
||||||
|
if (that.isDelete) { //确定要返回到相应页面,在触发
|
||||||
|
prevPage.$vm.reload()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
let that = this
|
||||||
|
console.log("onReachBottom", this.lastPage)
|
||||||
|
if (!this.lastPage || this.page >= this.lastPage) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '没有更多数据!',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.page++
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
swipeClick(e, index) {
|
||||||
|
let that = this
|
||||||
|
let id = that.ranklist[index].id
|
||||||
|
uni.showModal({
|
||||||
|
title: '友情提示',
|
||||||
|
content: '是否删除当前测量记录?',
|
||||||
|
success: function(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
that.$model.getPublicHistoryDel({
|
||||||
|
id: id,
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code != 0) {
|
||||||
|
that.$tools.msg(res.msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
that.ranklist.splice(index, 1)
|
||||||
|
that.$store.dispatch("getUserInfo", {
|
||||||
|
aud_id: uni.getStorageSync('userid')
|
||||||
|
})
|
||||||
|
that.isDelete = true
|
||||||
|
that.$tools.msg("删除成功")
|
||||||
|
})
|
||||||
|
} else if (res.cancel) {
|
||||||
|
that.$tools.msg("您已取消操作!");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getList() {
|
||||||
|
let that = this
|
||||||
|
that.$model.getPublicHistory({
|
||||||
|
aud_id: uni.getStorageSync('userid'),
|
||||||
|
acd_id: that.acd_id,
|
||||||
|
page: that.page,
|
||||||
|
name: that.labelName
|
||||||
|
}).then((res) => {
|
||||||
|
console.log("历史记录", res)
|
||||||
|
if (res.code != 0) return
|
||||||
|
let options = [{
|
||||||
|
text: '删除',
|
||||||
|
style: {
|
||||||
|
backgroundColor: '#dd524d'
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
res.data.rows.forEach(item => {
|
||||||
|
item.options = options
|
||||||
|
})
|
||||||
|
this.ranklist = this.ranklist.concat(res.data.rows)
|
||||||
|
this.lastPage = res.data.totalpage
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleActive(ite, ind) {
|
||||||
|
let that = this
|
||||||
|
that.active = ind
|
||||||
|
that.labelName = ite
|
||||||
|
that.page = 1
|
||||||
|
that.ranklist = []
|
||||||
|
that.lastPage = ""
|
||||||
|
that.getList()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped="scoped" lang="scss">
|
||||||
|
.common {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 100.5vh; // 重点
|
||||||
|
overflow-y: scroll;
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabbar {
|
||||||
|
display: flex;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 999;
|
||||||
|
justify-content: space-between;
|
||||||
|
border-bottom: 1px solid #f7f7f7;
|
||||||
|
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
.scroll-menu {
|
||||||
|
width: 100%;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
|
view {
|
||||||
|
height: 55px;
|
||||||
|
line-height: 55px;
|
||||||
|
display: inline-block;
|
||||||
|
min-width: 100px;
|
||||||
|
margin: 0 10px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.active {
|
||||||
|
color: $maincolor;
|
||||||
|
font-weight: bold;
|
||||||
|
border-bottom: 2px solid $maincolor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.history {
|
||||||
|
width: calc(100% - 30px);
|
||||||
|
height: auto;
|
||||||
|
margin: 70px 15px 0;
|
||||||
|
padding-bottom: 40px;
|
||||||
|
|
||||||
|
.list {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 12px;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
width: calc(100% - 20px);
|
||||||
|
height: auto;
|
||||||
|
background: #fff;
|
||||||
|
padding: 10px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
border-radius: 10px;
|
||||||
|
align-items: center;
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 30rpx !important;
|
||||||
|
|
||||||
|
text {
|
||||||
|
width: 100%;
|
||||||
|
display: block;
|
||||||
|
color: #666;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 28rpx;
|
||||||
|
}
|
||||||
|
view {
|
||||||
|
width: 28%;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.time {
|
||||||
|
width: 44% !important;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #666;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
icon {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
text {
|
||||||
|
width: 100%;
|
||||||
|
font-size: 30rpx;
|
||||||
|
margin-top: 3px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,156 @@
|
||||||
|
<template>
|
||||||
|
<view class="content pkconp">
|
||||||
|
<view class="headerTop">
|
||||||
|
<view class="left">
|
||||||
|
<image :src="memInfo.headimg" class="image1"></image>
|
||||||
|
</view>
|
||||||
|
<view class="right">
|
||||||
|
<view class="name">{{memInfo.name?memInfo.name:memInfo.nickname}}</view>
|
||||||
|
<view class="top">
|
||||||
|
<view>性别:{{memInfo.gender=='0'?'未知':memInfo.gender=='1'?'男':'女'}}</view>
|
||||||
|
<view class="ml-15">年龄:{{user.age}}岁</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="box" v-if="acd_id==2">
|
||||||
|
<view class="item">
|
||||||
|
<view>{{memInfo.day?memInfo.day:'0'}}</view>
|
||||||
|
<text>时间(天)</text>
|
||||||
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<view>{{memInfo.weightdiff?Math.abs(memInfo.weightdiff):0}}</view>
|
||||||
|
<text v-if="Number(memInfo.weightdiff)>0">增重(kg)</text>
|
||||||
|
<text v-else>减重(kg)</text>
|
||||||
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<view>{{memInfo.fat_wdiff?Math.abs(memInfo.fat_wdiff):0}}</view>
|
||||||
|
<text v-if="Number(memInfo.fat_wdiff)>0">增脂(kg)</text>
|
||||||
|
<text v-else>减脂(kg)</text>
|
||||||
|
</view>
|
||||||
|
<view class="time">
|
||||||
|
<view>
|
||||||
|
<uni-icons class="t-icon t-icon-shijian-mianxing-0"></uni-icons>{{memInfo.time}}
|
||||||
|
</view>数据变化
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="boxTime" v-else>
|
||||||
|
<view class=" mt-10 mb-10">
|
||||||
|
<uni-icons class="t-icon t-icon-shijian-mianxing-0 mr-10 size18"></uni-icons>
|
||||||
|
{{memInfo.time}}
|
||||||
|
</view>
|
||||||
|
数据变化
|
||||||
|
</view>
|
||||||
|
<view class="control">
|
||||||
|
<!-- 名称 -->
|
||||||
|
<view class="title">
|
||||||
|
<view class="name"></view>
|
||||||
|
<view>趋势</view>
|
||||||
|
<view>之前</view>
|
||||||
|
<view>之后</view>
|
||||||
|
</view>
|
||||||
|
<view v-for="(ite,ind) in listStr" :key="ind" class="li">
|
||||||
|
<view class="name">
|
||||||
|
<text>{{ite.title}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="num">
|
||||||
|
<text
|
||||||
|
v-if="ite.diffval!=0||ite.diffval=='0.00'||ite.diffval=='00:00:00'">{{acd_id!=6?Math.abs(ite.diffval):ite.diffval}}</text>
|
||||||
|
<icon class="t-icon t-icon-shang" v-if="Number(ite.diffval)>0"></icon>
|
||||||
|
<icon class="t-icon t-icon-xia" v-if="Number(ite.diffval)<0"></icon>
|
||||||
|
<icon class="t-icon t-icon-hengxian"
|
||||||
|
v-if="!ite.diffval||ite.diffval=='0.00'||ite.diffval=='00:00:00'"></icon>
|
||||||
|
</view>
|
||||||
|
<view class="f">
|
||||||
|
<view>{{ite.firstresult?ite.firstresult.value:'-'}}</view>
|
||||||
|
<text>{{ite.firstresult.level}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="f">
|
||||||
|
<view>{{ite.secondresult?ite.secondresult.value:'-'}}</view>
|
||||||
|
<text>{{ite.secondresult.level}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
mapState
|
||||||
|
} from "vuex";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
onLoad(options) {
|
||||||
|
let that = this
|
||||||
|
// 导航栏颜色
|
||||||
|
console.log("options", options)
|
||||||
|
if (options.info) {
|
||||||
|
let info = JSON.parse(options.info)
|
||||||
|
that.acd_id = info.type
|
||||||
|
that.handleSharepic(JSON.parse(options.info))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user", "appTheme"]),
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleSharepic(info) {
|
||||||
|
let that = this
|
||||||
|
that.$model.getresultcontrast({
|
||||||
|
type: info.type,
|
||||||
|
before_id: info.before_id,
|
||||||
|
after_id: info.after_id,
|
||||||
|
}).then(res => {
|
||||||
|
console.log("res", res)
|
||||||
|
if (res.code != 0) {
|
||||||
|
this.$tools.msg(res.msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res.data.list.forEach(ite => {
|
||||||
|
if (ite.firstresult && ite.firstresult.name == 'weight') {
|
||||||
|
res.data.weightdiff = ite.diffval
|
||||||
|
}
|
||||||
|
if (ite.firstresult && ite.firstresult.name == 'fat_w') {
|
||||||
|
res.data.fat_wdiff = ite.diffval
|
||||||
|
}
|
||||||
|
if (ite.firstresult || ite.secondresult) {
|
||||||
|
ite.name = ite.firstresult ? ite.firstresult.name : ite.secondresult.name
|
||||||
|
ite.title = ite.firstresult ? ite.firstresult.title : ite.secondresult.title
|
||||||
|
}
|
||||||
|
})
|
||||||
|
that.memInfo = res.data
|
||||||
|
that.listStr = res.data.list
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
memInfo: {},
|
||||||
|
listStr: [],
|
||||||
|
acd_id: "",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.age {
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
padding: 3px;
|
||||||
|
margin-right: 7px;
|
||||||
|
background-color: #aaa;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.t-icon-hengxian {
|
||||||
|
height: 2px;
|
||||||
|
width: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue