卡片、报告接口对接

This commit is contained in:
qiaocl 2024-05-29 16:35:45 +08:00
parent d19b762e58
commit 5861c3f4dd
127 changed files with 33155 additions and 14848 deletions

View File

@ -15,7 +15,7 @@
"type" : "uniCloud" "type" : "uniCloud"
}, },
{ {
"playground" : "custom", "playground" : "standard",
"type" : "uni-app:app-ios" "type" : "uni-app:app-ios"
} }
] ]

138
App.vue
View File

@ -14,137 +14,11 @@
<style lang="scss"> <style lang="scss">
/*每个页面公共css */ /*每个页面公共css */
@import url("@/uni.scss"); /* #ifndef APP-NVUE */
@import url("@/assets/common.scss"); @import "/uni.scss";
@import url("@/assets/iconfont.css"); @import "/assets/common.scss";
@import url("@/assets/iconfont-weapp-icon.css"); @import "/assets/iconfont.css";
@import "/assets/iconfont-weapp-icon.css";
.wrapper { /* #endif*/
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 999;
.bg {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.4);
z-index: 99;
}
.edit {
width: 15rem;
height: auto;
background: #fff;
border-radius: 10px;
padding: 15px;
position: relative;
top: 15%;
margin: auto;
z-index: 99999;
overflow: hidden;
.title {
text-align: center;
width: 100%;
color: #333;
font-size: 18px;
font-weight: bold;
}
.editem {
position: relative;
display: flex;
font-size: 14px;
border-radius: 10px;
margin-top: 15px;
height: 40px;
justify-content: space-between;
background: #eee;
padding: 0px 10px;
align-items: center;
.radioimg {
font-size: 22px;
color: $btncolor;
}
.radio {
width: 50%;
text-align: right;
display: flex;
justify-content: center;
align-items: center;
}
.name {
width: 4rem;
color: #333;
}
.right {
width: 60%;
height: 40px;
line-height: 40px;
text-align: right;
display: flex;
justify-content: flex-end;
input {
margin-right: 10px;
height: 40px;
line-height: 40px;
text-align: left;
}
picker {
width: 100%;
text-align: left;
}
.uni-input {
position: absolute;
right: 30px;
top: 0;
left: 0;
height: 40px;
line-height: 40px;
text-align: right;
z-index: 9999;
}
}
.value {
position: relative;
z-index: 999;
width: 3rem;
text-align: center;
float: left;
margin-right: 10px;
}
.iconfont {
margin-left: 10px;
float: right;
display: flex;
}
}
.tips {
font-size: 0.75rem;
color: #999;
text-align: center;
margin-top: 15px;
margin-bottom: 20px;
display: flex;
}
}
}
</style> </style>

View File

@ -1,7 +1,8 @@
*{
body,html,* {
font-family: "Microsoft YaHei"; font-family: "Microsoft YaHei";
font-size: 28rpx; }
page{
font-size: 14px;
} }
.text_l{ .text_l{
text-align: left; text-align: left;
@ -24,6 +25,12 @@
.c999{ .c999{
color: #999 !important; color: #999 !important;
} }
.cyello{
color: #FEC407 !important;
}
.cblue{
color: #477EFF !important;
}
.size12 { .size12 {
font-size: 24rpx !important font-size: 24rpx !important
} }
@ -41,6 +48,9 @@
.size20 { .size20 {
font-size: 40rpx !important font-size: 40rpx !important
} }
.size26{
font-size: 52rpx !important
}
.mt-5 { .mt-5 {
margin-top: 5px !important; margin-top: 5px !important;
@ -81,9 +91,6 @@
margin-left: 15px !important; margin-left: 15px !important;
} }
.bold {
font-weight: bold;
}
.bold { .bold {
font-weight: bold; font-weight: bold;
} }
@ -112,8 +119,8 @@
} }
.nolist { .nolist {
margin-top: 40%;
padding: 15px; padding: 15px;
width: 100%;
text-align: center; text-align: center;
image { image {
@ -126,6 +133,7 @@
width: 100%; width: 100%;
margin-top: 15px; margin-top: 15px;
text-align: center; text-align: center;
color: #999;
} }
} }
@ -182,12 +190,135 @@
background-color: rgba(0, 0, 0, 0.4); background-color: rgba(0, 0, 0, 0.4);
z-index: 99; z-index: 99;
} }
// 左侧
.wrapper_box {
width: 220px;
background-color: #fff;
z-index: 1000;
position: absolute;
height: 100vh;
.top {
width: 100%;
height: 90px;
color: #fff;
text-align: center;
background: $maincolor;
.image1 {
width: 50px;
height: 50px;
margin: auto;
border-radius: 50%;
margin-bottom: 16rpx;
}
view {
width: 100%;
display: block;
text-align: center;
margin: auto;
}
}
.drawerList {
position: relative;
top: 0;
left: 0;
flex-direction: column;
flex: 1;
justify-content: flex-end;
margin-bottom: 20rpx;
width: 220px;
height: calc(100vh - 100px);
overflow-y: scroll;
.drawerList_item {
background: #f7f7f7;
margin: 10px;
padding: 8px 8px 0;
border-radius: 10px;
display: flex;
justify-content: space-between;
.image1 {
width: 45px;
height: 45px;
border-radius: 50%;
margin-right: 10px;
}
.overflow {
font-size: 27rpx;
color: #333;
}
.right {
width: 70%;
.dangqian {
font-size: 20rpx;
color: #fff;
padding: 1px 5px;
background-color: $textcolor;
text-align: center;
width: auto;
margin-left: 10px;
width: auto;
display: inline-block;
float: right;
height: 15px;
line-height: 15px;
border-radius: 3px;
}
.toggle {
background-color: #999;
}
}
.info {
height: 30px;
line-height: 30px;
view {
float: left;
margin-right: 10px;
font-size: 12px;
color: #999;
}
}
.name {
width: 100%;
display: flex;
justify-content: space-between;
.overflow {
width: 60%;
}
}
}
.add {
margin: 15px;
background: $btncolor;
color: #fff;
height: 30px;
text-align: center;
font-size: 28px;
line-height: 30px;
border-radius: 20px;
}
}
}
// 弹框
// 信息
.edit { .edit {
width: 15rem; width: 15rem;
height: auto; height: auto;
background: #fff; background: #eee;
border-radius: 10px; border-radius: 10px;
padding: 15px; padding: 15px;
position: relative; position: relative;
@ -212,7 +343,7 @@
margin-top: 15px; margin-top: 15px;
height: 40px; height: 40px;
justify-content: space-between; justify-content: space-between;
background: #eee; background: #fff;
padding: 0px 10px; padding: 0px 10px;
align-items: center; align-items: center;
@ -294,201 +425,378 @@
} }
} }
} }
.header {
// 报告页
.myinfoPage {
width: 100%; width: 100%;
background: #fff; height: 240rpx;
margin-top: 10px; background: $maincolor;
padding-bottom: 15px;
border-radius: 10px;
.box1 {
display: flex;
flex-wrap: wrap;
border-radius: 10px;
font-size: 14px;
position: relative;
margin: 0px 15px 0;
padding-bottom: 10px;
.list {
width: 100%;
display: flex;
justify-content: space-between;
color: #666;
padding: 0;
line-height: 50px;
align-items: center;
flex-wrap: wrap;
image,
.t-icon {
width: 18px !important;
height: 18px;
border: 2px solid #c7c7c7;
background-color: #c7c7c7;
border-radius: 50%;
margin-right: 5px;
}
.block {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
color: #666;
position: relative;
.level,
.val {
width: 25%;
}
.name {
width: 40%;
display: flex;
align-items: center;
}
.icon {
width: 20px;
text-align: right;
display: flex;
image { image {
width: 100%;
height: 100%;
border-radius: 50%;
}
.top {
margin: 0 10px;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #fff;
border-radius: 10px;
padding:10px 15px;
min-height: 170rpx;
.headimg {
width: 55px;
height: 55px;
}
.toggle {
width: 20px; width: 20px;
height: 20px; height: 20px;
} }
} }
}
.desc { .add {
line-height: 20px; border: 1px #dfdfdf dashed;
text-align: left; font-size: 28px;
width: calc(100% - 20px); font-weight: 500;
height: auto; width: 35px;
border-radius: 5px;
font-size: 12px;
color: #999;
padding: 10px;
background: #f7f7f7;
}
}
.statuevue {
height: 35px; height: 35px;
position: relative; line-height: 35px;
width: 100%; border-radius: 10px;
margin: 20px auto 10px; text-align: center;
}
}
// 趋势
.TrendPage {
padding: 10px 0;
margin-bottom: 15px;
border-radius: 10px;
background-color: #f7f7f7;
.bi { .listC {
width: 100%;
padding: 15px;
display: flex;
align-items: center;
justify-content: space-around;
view {
position: relative;
}
.active:after {
content: "";
height: 3px;
width: 100%;
position: absolute;
bottom: -5px;
left: 0;
border-radius: 5px;
background: $maincolor;
}
}
.box {
width: calc(100% - 20px);
background-color: #fff;
margin: 10px;
border-radius: 15px;
}
.boxTime {
width: calc(100% - 20px);
border-radius: 10px;
padding: 10px;
text-align: center;
.style {
background: $maincolor;
color: #fff;
}
.iconfont {
font-size: 14px;
color: #666;
}
}
.boxLine {
padding: 0;
display: flex;
flex-wrap: wrap;
border-radius: 10px;
justify-content: space-between;
.line {
clear: both;
width: 100%;
height: 250px;
background-color: #fff;
border-radius: 0 0 10px 10px;
}
}
}
//
.gridList {
padding: 0;
display: flex;
flex-wrap: wrap;
margin: 15px;
width: calc(100%- 30px);
justify-content: space-between;
.info {
width: 100%;
display: flex;
margin-top: 15px;
justify-content: space-between;
.item {
color: #fff;
width: 47.5%;
height: 50px;
background: $maincolor;
text-align: center;
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
text {
width: 30px;
height: 30px;
border-radius: 50%;
margin-right: 10px;
display: inline-block;
background-color: #fff;
}
}
}
.data {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
color: #666;
margin-top: 15px;
width: 100%;
.item {
width: 47.5%;
text-align: center;
font-size: 14px;
line-height: 30px;
background: #fff;
padding: 10px 0;
border-radius: 15px;
margin-bottom: 15px;
display: flex;
align-items: center;
justify-content: center;
}
.val {
display: flex;
align-items: center;
font-size: 20px;
font-weight: 700;
justify-content: center;
color: #666;
text {
font-size: 14px;
font-weight: 500;
display: block;
margin-top: 3px;
margin-left: 3px;
}
}
.image{
width: 40px;
height: 40px;
border-radius: 50%;
image {
width: 70%;
height: 70%;
margin: 15%;
}
}
.name {
display: flex;
align-items: center;
justify-content: center;
color: #999;
}
}
}
//
.skiptop {
background: $maincolor;
border-radius: 10px;
margin: 0 15px 10px;
font-size: 14px;
padding: 25px 10px;
color: #fff;
.status {
margin-bottom: 25px;
text {
width: auto;
color: #333;
background-color: #fff;
border-radius: 15px;
padding: 5px 10px;
}
}
.item {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
width: auto;
text {
display: block;
width: 100%;
text-align: center;
margin-top: 15px;
}
}
}
// 首页卡片
.indexCarList {
.box {
margin: 15px 10px 0;
padding: 15px 10px 10px;
background-color: #fff;
width: calc(100% - 40px);
display: flex;
border-radius: 10px;
}
.card {
flex-wrap: wrap;
.title {
width: 100%;
color: #666;
display: flex;
padding-bottom: 5px;
align-items: center;
justify-content: space-between;
text {
font-size: 18px;
font-weight: bold;
margin-right: 10px;
color: #333;
}
}
.item {
padding: 15px 0;
display: flex;
flex-wrap: wrap;
text-align: center;
.weight {
width: 100%;
text {
font-size: 24px !important;
font-weight: bold;
display: inline-block;
}
}
.standardBtn {
width: 40px;
padding: 3px 8px;
border-radius: 8px;
text-align: center;
color: #fff;
font-size: 14px;
background-color: $btncolor;
}
}
.target {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 10px; padding-top: 10px;
font-size: 14px;
color: $textcolor;
border-top: 1px solid #f7f7f7;
.peobox { .targetBtn {
position: absolute; width: auto;
right: 0; height: 30px;
top: -1px; line-height: 30px;
color: #fff;
border-radius: 10px;
padding: 0 10px;
background: $maincolor;
}
}
.xx { .item2 {
width: 5px; width: 50%;
height: 5px; display: flex;
border-radius: 50%; flex-wrap: wrap;
background: #fff; margin: 15px 0;
position: absolute;
z-index: 9; .name {
border: 2px solid #1b2086; display: inline-block;
top: 9px; width: 100%;
}
}
}
.small {
width: calc(50% - 40px);
float: left;
margin-bottom: 15px;
.title {
.name {
display: flex;
flex-wrap: wrap;
text {
width: 80%;
margin-bottom: 5px;
display: inline-block;
} }
} }
} }
.item { .item {
position: relative;
margin: 0;
flex: 1;
height: 5px;
color: #666;
font-size: 12px;
.span1 {
width: 100%;
text-align: center;
position: absolute;
top: -23px;
}
.span {
margin-top: 8px;
position: absolute;
right: -8px;
}
}
}
}
.yuanxing {
display: inline-block;
background: #f19601;
width: 8px;
height: 12px;
margin-right: 5px;
font-size: 32rpx;
}
.btnf {
font-size: 13px;
border-radius: 5px;
height: 22px;
margin: 0 10px 0 0;
line-height: 22px;
color: #fff;
font-weight: 400;
width: 44px !important;
text-align: center !important;
float: right;
}
.tivon {
display: flex;
justify-content: center; justify-content: center;
align-content: center;
align-items: center;
.bianji {
width: 20px;
height: 20px;
margin-left: 5px;
} }
} }
.box1 :last-child.list { .setcard {
.val { width: calc(100% - 20px);
width: 25% !important;
}
}
.kcalClass {
width: 100%;
text-align: center; text-align: center;
font-size: 16px; height: 40px;
line-height: 55px; line-height: 40px;
margin: -20px auto; margin: 10px;
border-radius: 10px;
color: $textcolor;
background-color: #fff;
}
} }
.yichang { // 报告页
background: #ffe4be;
color: #ff4239;
padding: 5px;
text-align: center;
border-radius: 5px;
margin: 0 15px 10px;
}
}
//选择对比 //选择对比
.calendar{ .calendar{
background: #f7f7f7; background: #f7f7f7;
@ -496,6 +804,7 @@
.box { .box {
margin-bottom: 305px; margin-bottom: 305px;
padding-bottom: 210px;
} }
.list { .list {
@ -586,6 +895,7 @@
.btn { .btn {
width: auto; width: auto;
margin: 10px 0 0; margin: 10px 0 0;
background: $maincolor;
} }
.list { .list {
@ -625,7 +935,7 @@
position: absolute; position: absolute;
width: 30px; width: 30px;
height: 30px; height: 30px;
background: $greencolor; background: #fea82d;
border-radius: 50%; border-radius: 50%;
line-height: 27px; line-height: 27px;
text-align: center; text-align: center;
@ -638,7 +948,7 @@
.btn.active { .btn.active {
border: none; border: none;
color: #333 !important; color: #333 !important;
background-color: #DFDFDF !important; background: #dfdfdf !important;
display: block; display: block;
border-radius: 10px; border-radius: 10px;
} }
@ -647,13 +957,14 @@
// 对比详情 // 对比详情
.pkconp { .pkconp {
background: #f7f7f7; background: #f7f7f7;
padding: 15px 0;
min-height: 100vh; min-height: 100vh;
.header { .headerTop {
text-align: center; text-align: center;
background: #fff; background: #fff;
padding: 15px 15px 10px; padding: 15px 15px 10px;
margin: 15px; margin:0 15px;
border-radius: 10px 10px 0 0; border-radius: 10px 10px 0 0;
display: flex; display: flex;
align-items: center; align-items: center;
@ -670,22 +981,17 @@
margin-right: 15px; margin-right: 15px;
} }
.pkclass { .right{
position: absolute; width: calc(100% - 70px);
background: linear-gradient(to right, #ff99ae, #ffb2c2);
right: 15px;
padding: 0px 10px;
border-radius: 10px;
color: #fff;
height: 30px;
line-height: 30px;
font-size: 14px;
} }
.top { .top {
width: 100%;
display: flex; display: flex;
height: 30px;
line-height: 30px;
color: #999; color: #999;
margin-top: 10px; margin-top: 15px;
} }
} }
@ -695,7 +1001,7 @@
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
padding: 15px 0; padding-top: 15px;
margin: 15px; margin: 15px;
border-radius: 0 0 10px 10px; border-radius: 0 0 10px 10px;
@ -731,13 +1037,13 @@
justify-content: space-between; justify-content: space-between;
view { view {
width: 22%; width: 25%;
text-align: center; text-align: center;
} }
.name { // .name {
width: 33%; // width: 30%;
} // }
} }
.li { .li {
@ -750,7 +1056,7 @@
width: 100%; width: 100%;
.name { .name {
width: 33%; width: 25%;
display: flex; display: flex;
align-items: center; align-items: center;
@ -762,7 +1068,7 @@
} }
.num { .num {
width: 22%; width: 25%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -775,7 +1081,7 @@
.f, .f,
.f0 { .f0 {
width: 22%; width: 25%;
text-align: center; text-align: center;
text { text {
@ -797,13 +1103,38 @@
.time { .time {
border-top: 1px solid #f0f0f0; border-top: 1px solid #f0f0f0;
width: 100%; width: 100%;
padding: 15px 15px 0; height: 40px;
margin-top: 5px; line-height: 40px;
padding:0 10px;
display: flex; display: flex;
align-items: center;
justify-content: space-between; justify-content: space-between;
.yuanxing { view {
float: left; height: 40px;
line-height: 40px;
display: flex;
align-items: center;
}
}
.boxTime{
background: #fff;
margin: 15px;
display: flex;
border-radius: 10px;
flex-wrap: wrap;
align-items: center;
padding:0 10px;
height: 50px;
line-height: 50px;
justify-content: space-between;
view {
height: 50px;
line-height: 50px;
display: flex;
align-items: center;
} }
} }
} }

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,9 @@
/* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */ /* 在线链接服务仅供平台体验和调试使用,平台不承诺服务的稳定性,企业客户需下载字体包自行发布使用并做好备份。 */
@font-face { @font-face {
font-family: 'iconfont'; /* Project id 4167504 */ font-family: 'iconfont'; /* Project id 4480141 */
src: src: url('https://at.alicdn.com/t/c/font_4480141_hz0q93zw76b.woff2?t=1711354474072') format('woff2'),
url('https://at.alicdn.com/t/c/font_4167504_bg5bsdomfp.woff2?t=1704421191438') format('woff2'), url('https://at.alicdn.com/t/c/font_4480141_hz0q93zw76b.woff?t=1711354474072') format('woff'),
url('https://at.alicdn.com/t/c/font_4167504_bg5bsdomfp.woff?t=1704421191438') format('woff'), url('https://at.alicdn.com/t/c/font_4480141_hz0q93zw76b.ttf?t=1711354474072') format('truetype');
url('https://at.alicdn.com/t/c/font_4167504_bg5bsdomfp.ttf?t=1704421191438') format('truetype');
} }
.iconfont { .iconfont {
@ -15,44 +14,320 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-beibu:before { .icon-wodechengji:before {
content: "\e611"; content: "\e61d";
} }
.icon-yaotunbizice:before { .icon-three_val:before {
content: "\e684"; content: "\e604";
} }
.icon-xiongwaike:before { .icon-two_val:before {
content: "\e67e"; content: "\e605";
} }
.icon-fat:before { .icon-one_val:before {
content: "\e606";
}
.icon-average_val:before {
content: "\e609";
}
.icon-jump_kcal:before {
content: "\e7b4";
}
.icon-jump_time:before {
content: "\e659";
}
.icon-jump_num:before {
content: "\e790";
}
.icon-bmi:before {
content: "\e785";
}
.icon-quanxian:before {
content: "\100cb";
}
.icon-lishijilu2:before {
content: "\100cc";
}
.icon-xinyongka:before {
content: "\100cd";
}
.icon-ziliao:before {
content: "\100ce";
}
.icon-shenfenxinxi:before {
content: "\e656";
}
.icon-feihuoliangx:before {
content: "\e68c";
}
.icon-tiaoshengx:before {
content: "\e68d";
}
.icon-shenti:before {
content: "\e7c7";
}
.icon-quxian:before {
content: "\e600";
}
.icon-jihuo:before {
content: "\e603";
}
.icon-lishijilu1:before {
content: "\1012e";
}
.icon-wulianjie:before {
content: "\e64e";
}
.icon-renshiduibifenxi:before {
content: "\e62e";
}
.icon-huihanduibi:before {
content: "\e822";
}
.icon-jinxiaoduibi:before {
content: "\e6b1";
}
.icon-lishishuju:before {
content: "\e601";
}
.icon-moxingduibi-huang:before {
content: "\e61b";
}
.icon-jilu:before {
content: "\e6df";
}
.icon-shujuquxian:before {
content: "\e614";
}
.icon-lishi:before {
content: "\ecdd";
}
.icon-jilu1:before {
content: "\10110";
}
.icon-lishijilu:before {
content: "\e62f";
}
.icon-duibifenxi:before {
content: "\e7bd";
}
.icon-pinggufenxi-copy:before {
content: "\1024b";
}
.icon-shouye-copy:before {
content: "\1024f";
}
.icon-wode-copy:before {
content: "\1024d";
}
.icon-pinggufenxi-copy-copy:before {
content: "\1024e";
}
.icon-wode:before {
content: "\e635";
}
.icon-shouye:before {
content: "\e660";
}
.icon-shijian-mianxing-0:before {
content: "\e6a2";
}
.icon-kehuguanli:before {
content: "\e6a4";
}
.icon-qiapianjihuo:before {
content: "\e669";
}
.icon-kapian:before {
content: "\e608";
}
.icon-kapiananniu:before {
content: "\e6de";
}
.icon-xiangmuchaxun-chakanshebei:before {
content: "\e655";
}
.icon-shebeishu:before {
content: "\e66a";
}
.icon-lishihenji:before {
content: "\e612";
}
.icon-qiehuan1:before {
content: "\e61a";
}
.icon-tishi6:before {
content: "\e619";
}
.icon-bianji:before {
content: "\e607";
}
.icon-caidan:before {
content: "\e624";
}
.icon-xiaoxi:before {
content: "\e654";
}
.icon-add-circle:before {
content: "\e664";
}
.icon-ashbin:before {
content: "\e665";
}
.icon-chart-bar:before {
content: "\e667";
}
.icon-close:before {
content: "\e668";
}
.icon-error:before {
content: "\e670";
}
.icon-menu:before {
content: "\e677";
}
.icon-minus-circle:before {
content: "\e678";
}
.icon-modular:before {
content: "\e679";
}
.icon-notification:before {
content: "\e67a";
}
.icon-prompt:before {
content: "\e67b";
}
.icon-success:before {
content: "\e67f";
}
.icon-add-bold:before {
content: "\e685";
}
.icon-arrow-left-bold:before {
content: "\e686";
}
.icon-arrow-up-bold:before {
content: "\e687";
}
.icon-arrow-down-bold:before {
content: "\e688";
}
.icon-age:before {
content: "\10250";
}
.icon-arrow-right-bold:before {
content: "\e689";
}
.icon-user-filling:before {
content: "\e68b";
}
.icon-body_level:before {
content: "\e63d"; content: "\e63d";
} }
.icon-lbm:before { .icon-baogao1:before {
content: "\e62a"; content: "\e620";
} }
.icon-fat_r:before { .icon-fat_r:before {
content: "\e62c"; content: "\e62d";
}
.icon-hengxian:before {
content: "\e657";
} }
.icon-fat_w:before { .icon-fat_w:before {
content: "\e78e"; content: "\e78e";
} }
.icon-jiantou_xiangxia:before {
content: "\eb0a";
}
.icon-jiantou_xiangshang:before {
content: "\eb0b";
}
.icon-bone:before { .icon-bone:before {
content: "\e610"; content: "\e610";
} }
.icon-weight:before { .icon-un_fat_w_weight:before {
content: "\e60a"; content: "\e6b7";
} }
.icon-bmi:before { .icon-biaozhunhua:before {
content: "\e785"; content: "\e60b";
} }
.icon-cellin:before { .icon-cellin:before {
@ -60,27 +335,39 @@
} }
.icon-kcal:before { .icon-kcal:before {
content: "\e607";
}
.icon-visceral:before {
content: "\e60b";
}
.icon-muscle:before {
content: "\e60c"; content: "\e60c";
} }
.icon-body:before { .icon-visceral:before {
content: "\e639"; content: "\e60d";
}
.icon-muscle:before {
content: "\e60e";
}
.icon-body_type:before {
content: "\e638";
}
.icon-zanwushuju:before {
content: "\e611";
} }
.icon-water:before { .icon-water:before {
content: "\e651"; content: "\e651";
} }
.icon-age:before { .icon-weight:before {
content: "\e60f"; content: "\e616";
}
.icon-sharpicons_checklist:before {
content: "\e804";
}
.icon-shejiguifan:before {
content: "\e640";
} }
.icon-muscleval:before { .icon-muscleval:before {
@ -92,10 +379,10 @@
} }
.icon-proteinval:before { .icon-proteinval:before {
content: "\e605"; content: "\e60f";
} }
.icon-bodyage:before { .icon-body_age:before {
content: "\e6b2"; content: "\e6b2";
} }
@ -107,6 +394,14 @@
content: "\e6eb"; content: "\e6eb";
} }
.icon-shang:before {
content: "\e68a";
}
.icon-xia:before {
content: "\e798";
}
.icon-sfrval:before { .icon-sfrval:before {
content: "\e652"; content: "\e652";
} }
@ -115,6 +410,10 @@
content: "\e617"; content: "\e617";
} }
.icon-waterper:before {
content: "\e692";
}
.icon-skeletalmuscle:before { .icon-skeletalmuscle:before {
content: "\e6af"; content: "\e6af";
} }
@ -123,375 +422,31 @@
content: "\e61c"; content: "\e61c";
} }
.icon-yiqingjia-:before { .icon-kongradio:before {
content: "\e6a4";
}
.icon-yidongjie:before {
content: "\e632";
}
.icon-zu:before {
content: "\e630";
}
.icon-yidaodian:before {
content: "\e6d2";
}
.icon-weidaodian:before {
content: "\e6d4";
}
.icon-yiwancheng:before {
content: "\e68c";
}
.icon-icon-test-copy:before {
content: "\fbdf";
}
.icon-icon-test:before {
content: "\e664";
}
.icon-icon-test1:before {
content: "\e668";
}
.icon-icon-test1-copy:before {
content: "\fbe0";
}
.icon-huangguan:before {
content: "\e61a";
}
.icon-huangguan1:before {
content: "\e682";
}
.icon-zanwushuju:before {
content: "\e606";
}
.icon-hexiao1:before {
content: "\e85b";
}
.icon-huiyuankabao:before {
content: "\e63b";
}
.icon-huizonganniu1:before {
content: "\e604";
}
.icon-yunying-zhuandian:before {
content: "\e609";
}
.icon-erweima:before {
content: "\e7cb";
}
.icon-fuzerenbaobiao:before {
content: "\e626";
}
.icon-shaixuan2:before {
content: "\e647";
}
.icon-zhihanghuizong:before {
content: "\e60e";
}
.icon-paihangbang:before {
content: "\ed68";
}
.icon-huiyuan_cika:before {
content: "\e624";
}
.icon-huiyuanzhongxin-shouye:before {
content: "\e66d";
}
.icon-biaoshi:before {
content: "\e60d";
}
.icon-huiyuanka:before {
content: "\e618";
}
.icon-shishiyujing-changgui:before {
content: "\e62f";
}
.icon-yujing1:before {
content: "\e69d";
}
.icon-yujingshezhi:before {
content: "\e602"; content: "\e602";
} }
.icon-tongpai1:before { .icon-radio:before {
content: "\e7c8"; content: "\e653";
}
.icon-lilunzhongliang:before {
content: "\e759";
}
.icon-huiyuan:before {
content: "\e8b1";
}
.icon-loudoutu-junyun:before {
content: "\e6d3";
}
.icon-yinpai:before {
content: "\e600";
}
.icon-zhuandian:before {
content: "\e608";
}
.icon-kechengzhouqi:before {
content: "\e601";
}
.icon-qingjia:before {
content: "\e7d8";
}
.icon-disanming1:before {
content: "\e64a";
}
.icon-jianzhishoushen:before {
content: "\e6b3";
}
.icon-diyiming:before {
content: "\e603";
}
.icon-diyiming1:before {
content: "\e613";
}
.icon-a-zu8272:before {
content: "\e619";
}
.icon-adduser:before {
content: "\e7ae";
}
.icon-shang:before {
content: "\fbde";
}
.icon-chuangzuo:before {
content: "\e8ad";
}
.icon-nan:before {
content: "\e8b3";
} }
.icon-nv:before { .icon-nv:before {
content: "\e8b4"; content: "\e7a5";
} }
.icon-wodeguanzhu:before { .icon-qiehuan:before {
content: "\e8bc"; content: "\e66f";
} }
.icon-chuangzuo1:before { .icon-nan:before {
content: "\e8ca"; content: "\1024a";
} }
.icon-meh:before { .icon-zanwu1:before {
content: "\e677"; content: "\e78d";
} }
.icon-meh-filling:before { .icon-xiazai41:before {
content: "\e68b"; content: "\e618";
}
.icon-sorting:before {
content: "\e68d";
}
.icon-fubu:before {
content: "\e81f";
}
.icon-a-dingwei2:before {
content: "\e61e";
}
.icon-bianji:before {
content: "\e622";
}
.icon-xiala:before {
content: "\e623";
}
.icon-error:before {
content: "\e839";
}
.icon-delete-fill:before {
content: "\e83a";
}
.icon-calendar:before {
content: "\e83b";
}
.icon-cry-fill:before {
content: "\e83c";
}
.icon-error-fill:before {
content: "\e83d";
}
.icon-favorites-fill:before {
content: "\e83e";
}
.icon-calendar-fill:before {
content: "\e83f";
}
.icon-favorites:before {
content: "\e840";
}
.icon-down:before {
content: "\e841";
}
.icon-close:before {
content: "\e842";
}
.icon-delete:before {
content: "\e843";
}
.icon-follow:before {
content: "\e844";
}
.icon-follow-fill:before {
content: "\e845";
}
.icon-left:before {
content: "\e846";
}
.icon-info-fill:before {
content: "\e847";
}
.icon-info:before {
content: "\e848";
}
.icon-location-fill:before {
content: "\e849";
}
.icon-right:before {
content: "\e84a";
}
.icon-selected:before {
content: "\e84b";
}
.icon-remind-fill:before {
content: "\e84c";
}
.icon-return:before {
content: "\e84d";
}
.icon-search:before {
content: "\e84e";
}
.icon-scan:before {
content: "\e84f";
}
.icon-smile-fill:before {
content: "\e850";
}
.icon-settings-fill:before {
content: "\e851";
}
.icon-up:before {
content: "\e852";
}
.icon-warning-fill:before {
content: "\e853";
}
.icon-phone-fill:before {
content: "\e85f";
}
.icon-phone:before {
content: "\e860";
}
.icon-quick-fill:before {
content: "\e863";
}
.icon-quick:before {
content: "\e864";
}
.icon-abdomen:before {
content: "\e670";
}
.icon-lower-leg:before {
content: "\e671";
}
.icon-ram:before {
content: "\e672";
}
.icon-datui:before {
content: "\e638";
}
.icon-yujing:before {
content: "\e726";
}
.icon-jisuanqi:before {
content: "\fbdd";
} }

View File

@ -1,7 +1,30 @@
{ {
"selectllist": [{ "selectllist": [{
"id": "1", "id": "1",
"key": "Weight",
"disabled": true,
"size": "big", "size": "big",
"name": "身体数据",
"time": "2024/2/29",
"detailurl": "/pages/weight/weight",
"Tutorialurl": "Weight",
"height": "176.00",
"heightUnit": "CM",
"Hstandardtext": "达标",
"Hstandardcolor": "#4DA2CA",
"Weight": "76",
"WeightUnit": "KG",
"Wstandardtext": "达标",
"Wstandardcolor": "#4DA2CA",
"BMI": "176",
"BMIUnit": "",
"BMIstandardtext": "达标",
"Bstandardcolor": "#4DA2CA"
}, {
"id": "2",
"size": "big",
"key": "Skip",
"disabled": true,
"unit": "个", "unit": "个",
"name": "跳绳数据", "name": "跳绳数据",
"time": "2024/2/29", "time": "2024/2/29",
@ -10,9 +33,21 @@
"averagecnt": "48", "averagecnt": "48",
"kcal": "4250", "kcal": "4250",
"detailurl": "/pages/skipping/skipping", "detailurl": "/pages/skipping/skipping",
"Tutorialurl": "", "Tutorialurl": "Skip",
"standardtext": "达标", "standardtext": "达标",
"standardcolor": "#4DA2CA" "standardcolor": "#4DA2CA"
}, {
"id": "3",
"disabled": true,
"key": "Lung",
"size": "small",
"name": "肺活量",
"unit": "ml",
"time": "2024/2/29",
"detailurl": "/pages/lung/lung",
"Tutorialurl": "Lung",
"standardtext": "达标",
"standardcolor": "#EC808D"
}], }],
"addlist": [{ "addlist": [{
"id": "2", "id": "2",
@ -392,5 +427,32 @@
"sfrlevel": "异常", "sfrlevel": "异常",
"bodylevel": "标准肌肉型" "bodylevel": "标准肌肉型"
} }
} },
"familayList": [{
"name": "栗子",
"headimg": "https://ijt.pcxbc.com/image/adult_female.png",
"headimgsrc": null,
"sex": 2,
"birthday": "1995-12-02",
"age": "28岁",
"height": 163.00,
"weight": 50.23,
"lastresulttime": "2024/04/17 11:14",
"type": 1,
"code": "",
"id": "08db6332-e76a-4e3e-842c-b88a405f5178"
}, {
"name": "橙子🍊",
"headimg": "https://ijt.pcxbc.com/image/child_female.png",
"headimgsrc": null,
"sex": 2,
"birthday": "2014-11-02",
"age": "9岁",
"height": 0.00,
"weight": 0.00,
"lastresulttime": "",
"type": 2,
"code": "",
"id": "08db6333-a5fa-48d8-82ab-44583a614434"
}]
} }

117
components/drawer.vue Normal file
View File

@ -0,0 +1,117 @@
<template>
<view class="wrapper" v-if="isDrawe">
<view class="bg" @click="clear"></view>
<view class="wrapper_box">
<view class="top">
<image class="headimage mt-10" v-if="userinfo.head_pic" :src="userinfo.head_pic"></image>
<view class="overflow">{{userinfo.nickname}}</view>
</view>
<view class="drawerList">
<view class="drawerList_item" v-for="(item, index) in List" :key="index" @click="toggle(item)"
v-if="List.length">
<image v-if="item.head_pic" :src="item.head_pic" class="image1"></image>
<view class="right">
<view class="name">
<view class="overflow">
{{item.nickname}}
</view>
<view class="dangqian" v-if="item.id == userinfo.id">当前</view>
</view>
<view class="info">
<view>{{item.gender==1?'男':'女'}}</view>
<view>{{item.birthday}}</view>
</view>
</view>
</view>
<view class="add" @click="addInfo()">
+
</view>
</view>
</view>
</view>
</template>
<script>
import model from "@/tools/model.js";
import {
mapState
} from "vuex";
export default {
data() {
return {};
},
computed: {
...mapState(["user", "familayList", "isDrawe"]),
userinfo() {
return this.user
},
List() {
return this.familayList
},
},
methods: {
//
toggle(val) {
let that = this
uni.setStorageSync('userid', val.id)
that.$store.dispatch("getUserInfo", {
aud_id: val.id
});
that.$store.dispatch("getCardList", {
aud_id: val.id
})
that.$store.commit("changeDrawe", false);
},
//
addInfo() {
uni.navigateTo({
url: "/pages/index/userInfo"
})
},
clear() {
this.$store.commit("changeDrawe", false);
},
}
}
</script>
<style lang="scss" scoped>
.wrapper {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 999;
.bg {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.4);
z-index: 99;
}
}
.headimage {
width: 50px;
height: 50px;
margin: auto;
border-radius: 50%;
margin-bottom: 16rpx;
}
@keyframes wrapper_box {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(0%);
}
}
</style>

View File

@ -0,0 +1,98 @@
<template>
<view>
<view class="header">
<view class="top" v-if="userList.length">
<view class="headimg">
<image :src="user.head_pic"></image>
</view>
<view class="info">
<view class="size20 bold">{{user.nickname}}</view>
<view class="mt-5">年龄{{user.age}}</view>
<view>{{$t("index.birthday")}}{{user.birthday}}</view>
</view>
<text class="t-icon t-icon-qiehuan1" @click="$store.commit('changeDrawe', true)" v-if="isLeft"></text>
</view>
<view class="top" v-else @click="handleAddUser">
<view class="info">
暂无成员请先添加~
</view>
<view class="add">
+
</view>
</view>
</view>
<!-- 地区 -->
<view class="area" v-if="isArea">
<view>
<text>当前地区标准</text>
<text>北京</text>
</view>
</view>
<!-- 切换成员 -->
<drawer></drawer>
</view>
</template>
<script>
import {
mapState
} from "vuex";
import drawer from "@/components/drawer.vue"
export default {
name: "headerIndex",
components: {
drawer
},
props: {
isArea: {
type: Boolean,
default: true
},
isLeft: {
type: Boolean,
default: true
},
},
data() {
return {};
},
computed: {
...mapState(["user", "familayList"]),
userList() {
return this.familayList
}
},
methods: {
//
handleAddUser() {
uni.navigateTo({
url: "/pages/index/userInfo"
})
},
}
}
</script>
<style lang="scss" scoped>
.info {
display: flex;
flex-wrap: wrap;
margin-left: 15px;
width: calc(100% - 70px);
view {
width: 100%;
}
}
.area {
margin: 15px 10px 0;
padding: 15px 10px 10px;
background-color: #fff;
width: calc(100% - 40px);
display: flex;
border-radius: 10px;
justify-content: space-between;
}
</style>

View File

@ -0,0 +1,137 @@
<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">
<uni-datetime-picker type="datetime" @change="changeLog" :border="false" :end="endDate"
:clear-icon='false' :hide-second='true' />
</view>
</view>
<view class="">
<view class="editem">
<view class="name">第一次</view>
<view class="right">
<input type="digit" v-model="number1" placeholder="请输入">ml
</view>
</view>
<view class="editem">
<view class="name">第二次</view>
<view class="right">
<input type="digit" v-model="number2" placeholder="请输入">ml
</view>
</view>
<view class="editem">
<view class="name">第三次</view>
<view class="right">
<input type="digit" v-model="number3" placeholder="请输入">ml
</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 {
regTime: "",
number1: '',
number2: "",
number3: ""
}
},
computed: {
...mapState(["user"]),
endDate() {
return this.$tools.getDate("start")
},
},
methods: {
//
handleTarget() {
let that = this
if (!that.regTime) {
that.$tools.msg("请选择测量日期")
return
}
if (!that.number1) {
that.$tools.msg("请输入第一次吸气值")
return
}
if (!that.number2) {
that.$tools.msg("请输入第二次吸气值")
return
}
if (!that.number3) {
that.$tools.msg("请输入第三次吸气值")
return
}
that.$model.getLungmeasure({
aud_id: uni.getStorageSync('userid'),
time: that.regTime,
one: that.number1,
two: that.number2,
three: that.number3
}).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("getLungResult", {
aud_id: uni.getStorageSync('userid')
})
this.regTime = ""
this.number1 = ""
this.number2 = ""
this.number3 = ""
})
},
//
changeLog(e) {
this.regTime = e
},
onTap() {
this.regTime = ""
this.number1 = ""
this.number2 = ""
this.number3 = ""
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>

View File

@ -0,0 +1,49 @@
<template>
<view v-if="isRecord">
<recordWeight v-if="rtype==2"></recordWeight>
<skipAdd v-if="rtype==6"></skipAdd>
<lungAdd v-if="rtype==8"></lungAdd>
</view>
</template>
<script>
import recordWeight from './weightAdd.vue';
import skipAdd from "./skipAdd.vue"
import lungAdd from "./lungAdd.vue"
import {
mapState
} from "vuex";
export default {
props: {
rtype: {},
},
components: {
skipAdd,
lungAdd,
recordWeight
},
data() {
return {}
},
computed: {
...mapState(["isRecord"]),
},
methods: {
}
}
</script>
<style scoped lang="scss">
.btn {
width: 40%;
float: right;
margin-top: 15px;
background: $maincolor !important;
}
.close {
background: #dfdfdf !important;
float: left;
}
</style>

View File

@ -0,0 +1,137 @@
<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">
<uni-datetime-picker type="datetime" @change="changeLog" :border="false" :end="endDate"
:clear-icon='false' :hide-second='true' />
</view>
</view>
<view class="">
<view class="editem">
<view class="name">时长</view>
<view class="right">
<picker mode="multiSelector" :range="timeList" :value="timesTndex" @change="bindTimeChange">
<view>{{time_m?time_m:'请选择'}}{{time_s?time_s:''}}</view>
</picker>
</view>
</view>
<view class="editem">
<view class="name">个数</view>
<view class="right">
<input type="digit" v-model="number" placeholder="请输入">
</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 {
regTime: "",
number: '',
timeList: [],
time_m: "",
time_s: "",
timesTndex: [0, 0]
}
},
computed: {
...mapState(["user"]),
endDate() {
return this.$tools.getDate("start")
},
startDate() {
return this.$tools.GetDateStr(-90);
},
},
mounted() {
this.timeList = this.$tools.gethms()
},
methods: {
bindTimeChange(e) {
let m = e.target.value[0]
let s = e.target.value[1]
this.timesTndex = e.target.value
this.time_m = this.timeList[0][m]
this.time_s = this.timeList[1][s]
},
//
handleTarget() {
let that = this
if (!that.regTime) {
that.$tools.msg("请选择测量日期")
return
}
if (!that.number) {
that.$tools.msg("请输入跳绳个数")
return
}
that.$model.getskipmeasure({
aud_id: uni.getStorageSync('userid'),
r_time: that.regTime,
num: that.number,
time_m: that.time_m.substring(0, 2),
time_s: that.time_s.substring(0, 2),
type: "free",
}).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("getSkipResult", {
aud_id: uni.getStorageSync('userid'),
})
that.regTime = ""
that.weight = ""
})
},
//
changeLog(e) {
this.regTime = e
},
onTap() {
this.regTime = ""
this.weight = ""
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>

View File

@ -0,0 +1,131 @@
<template>
<view class="wrapper wrapperbg">
<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">
<uni-datetime-picker type="datetime" @change="changeLog" :border="false" :end="endDate"
:clear-icon='false' :hide-second='true' />
</view>
</view>
<view class="">
<view class="editem">
<view class="name">身高</view>
<view class="right">
<input type="digit" v-model="height" placeholder="请输入身高" />cm
</view>
</view>
<view class="editem">
<view class="name">体重</view>
<view class="right">
<input type="number" v-model="weight" placeholder="请输入体重">kg
</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 {
regTime: "",
weight: "",
height: ''
}
},
computed: {
...mapState(["user", "isWeight"]),
endDate() {
return this.$tools.getDate("start")
},
startDate() {
return this.$tools.GetDateStr(-90);
},
},
methods: {
//
handleTarget() {
let that = this
if (!that.regTime) {
that.$tools.msg("请选择测量日期")
return
}
if (!that.height) {
that.$tools.msg("请输入测量身高")
return
}
if (!that.weight) {
that.$tools.msg("请输入测量体重")
return
}
that.$model.getinsertmeasure({
aud_id: uni.getStorageSync('userid'),
time: that.regTime,
weight: that.weight,
height: that.height,
}).then(res => {
if (res.code != 0) return
that.$tools.msg(res.msg)
that.$store.commit("changeRecord", false);
that.$store.dispatch("getResult", {
aud_id: uni.getStorageSync('userid')
})
that.$store.dispatch("getUserInfo", {
aud_id: uni.getStorageSync('userid')
})
that.$store.dispatch("GetBodyTrendList", {
aud_id: uni.getStorageSync('userid'),
s_time: that.startDate,
e_time: that.endDate
})
that.regTime = ""
that.weight = ""
that.height = ""
})
},
//
changeLog(e) {
this.regTime = e
},
onTap() {
this.regTime = ""
this.weight = ""
this.height = ""
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>

View File

@ -115,7 +115,7 @@
let weekText = ['日', '一', '二', '三', '四', '五', '六']; let weekText = ['日', '一', '二', '三', '四', '五', '六'];
let formatWeek = '星期' + weekText[week]; let formatWeek = '星期' + weekText[week];
let today = { let today = {
date: y + '-' + this.formatNum(m + 1) + '-' + this.formatNum(d), date: y + '/' + this.formatNum(m + 1) + '/' + this.formatNum(d),
week: formatWeek week: formatWeek
}; };
return today; return today;
@ -196,7 +196,7 @@
isMarkDay(y, m, d) { isMarkDay(y, m, d) {
let flag = false; let flag = false;
for (let i = 0; i < this.markDays.length; i++) { for (let i = 0; i < this.markDays.length; i++) {
let dy = `${y}-${m}-${d}`; let dy = `${y}/${m}/${d}`;
if (this.markDays[i] == dy) { if (this.markDays[i] == dy) {
flag = true; flag = true;
break; break;
@ -205,7 +205,7 @@
return flag; return flag;
}, },
isToday(y, m, d) { isToday(y, m, d) {
let checkD = y + '-' + m + '-' + d; let checkD = y + '/' + m + '/' + d;
let today = this.getToday().date; let today = this.getToday().date;
if (checkD == today) { if (checkD == today) {
return true; return true;
@ -228,7 +228,7 @@
}, },
// //
selectOne(i, event) { selectOne(i, event) {
let date = `${i.year}-${i.month}-${i.date}`; let date = `${i.year}/${i.month}/${i.date}`;
let selectD = new Date(date).getTime(); let selectD = new Date(date).getTime();
let curTime = new Date().getTime(); let curTime = new Date().getTime();
let week = new Date(date).getDay(); let week = new Date(date).getDay();

View File

@ -0,0 +1,138 @@
<template>
<view v-if="isSlider" class="wrapper">
<view class="bg" @click="onTap">
<view class="edit" @click.stop>
<view class="title">分数占比设置</view>
<view class="editem">
<view class="left">身体指数</view>
<view class="right">
<slider @change="sliderChange" value="10" show-value block-size="12" block-color="#007aff">
</slider>
</view>
</view>
<view class="editem">
<view class="left">1分钟跳绳</view>
<view class="right">
<slider @change="sliderChange($event,2)" value="40" show-value block-size="12"
block-color="#007aff"></slider>
</view>
</view>
<view class="editem">
<view class="left">肺活量</view>
<view class="right">
<slider @change="sliderChange" value="60" show-value block-size="12" block-color="#007aff">
</slider>
</view>
</view>
<view class="tips">
*所有项目评分占比和为100%
</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 {
regTime: "",
number1: '',
number2: "",
number3: ""
}
},
computed: {
...mapState(["user", "isSlider"]),
},
methods: {
//
handleTarget() {
let that = this
if (!that.regTime) {
that.$tools.msg("请选择测量日期")
return
}
if (!that.weight) {
that.$tools.msg("请输入测量体重")
return
}
that.$model.getinsertmeasure({
familyid: that.user.familyid,
time: that.regTime,
weight: that.weight,
}).then(res => {
if (res.code != 0) return
that.$tools.msg(res.msg)
that.$store.commit("changeSlider", false);
that.$store.dispatch("getResult", {
birthday: that.user.birthday,
familyid: that.user.familyid,
height: that.user.height,
sex: that.user.sex,
})
that.$store.dispatch("getUserInfo", {
familyid: that.user.familyid,
})
that.$emit("getList", this.startDate, this.endDate)
that.regTime = ""
that.weight = ""
})
},
//
sliderChange(event, ind) {
console.log('value 发生变化:', e.detail.value, ind)
},
onTap() {
this.regTime = ""
this.number1 = ""
this.number2 = ""
this.number3 = ""
this.$store.commit("changeSlider", false);
},
}
}
</script>
<style scoped lang="scss">
.edit {
width: 75%;
padding: 15px;
.editem {
padding: 0 !important;
background: #fff !important;
.right {
width: 72% !important;
}
/deep/slider {
width: 100%;
padding: 0 !important;
margin: 0 !important;
}
}
}
.btn {
width: 40%;
float: right;
margin-top: 15px;
background: $maincolor !important;
}
.edit {
top: 20%
}
.close {
background: #dfdfdf !important;
float: left;
}
</style>

View File

@ -1,15 +1,13 @@
<template> <template>
<view v-if="isFirst" class="wrapper"> <view v-if="isFirst" class="wrapper wrapperbg">
<view class="bg" @click="onTap"> <view class="bg" @click="onTap">
<view class="edit" @click.stop> <view class="edit" @click.stop>
<view class="title">初始体重</view> <view class="title">{{type==1?'目标体重':'初始体重'}}</view>
<view class="editem" @click="hideKeyboard"> <view class="editem" @click="hideKeyboard" v-if="type!=1">
<view class="name">日期</view> <view class="name">日期</view>
<view class="right"> <view class="right">
<picker mode="date" :value="regTime?regTime:user.firstresulttime" :end="endDate" @change="bindDateChange"> <uni-datetime-picker type="date" @change="changeLog" :border="false" :end="endDate"
<view class="text">{{regTime?regTime:user.firstresulttime?user.firstresulttime:"请选择"}} :clear-icon='false' :hide-second='false' />
</view>
</picker>
</view> </view>
</view> </view>
<view class="editem"> <view class="editem">
@ -30,6 +28,9 @@
mapState mapState
} from "vuex"; } from "vuex";
export default { export default {
props: {
type: {}
},
data() { data() {
return { return {
regTime: "", regTime: "",
@ -46,7 +47,7 @@
// //
handleTarget() { handleTarget() {
let that = this let that = this
if (!that.user.firstresulttime) { if (that.type != 1 && !that.regTime) {
that.$tools.msg("请选择测量日期") that.$tools.msg("请选择测量日期")
return return
} }
@ -55,15 +56,17 @@
return return
} }
that.$model.getfirstweight({ that.$model.getfirstweight({
familyid: that.user.familyid, aud_id: that.user.id,
time: that.regTime ? that.regTime : that.user.firstresulttime, time: that.type == 1 ? '' : that.regTime ? that.regTime : that.user.firstresulttime,
weight: that.weight, weight: that.weight,
type: that.type
}).then(res => { }).then(res => {
that.$tools.msg(res.message) console.log("目标,", res)
that.$tools.msg(res.msg)
if (res.code == 0) { if (res.code == 0) {
that.$store.commit("changeFirst", false); that.$store.commit("changeFirst", false);
that.$store.dispatch("getUserInfo", { that.$store.commit('changeUser', {
familyid: that.user.familyid, target_current: res.data
}) })
that.regTime = "" that.regTime = ""
that.weight = "" that.weight = ""
@ -71,8 +74,8 @@
}) })
}, },
// //
bindDateChange(e) { changeLog(e) {
this.regTime = e.target.value this.regTime = e
}, },
onTap() { onTap() {
this.weight = "" this.weight = ""
@ -87,135 +90,6 @@
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.wrapper {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 999;
.bg {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.4);
z-index: 99;
}
.edit {
width: 15rem;
height: auto;
background: #fff;
border-radius: 10px;
padding: 15px;
position: relative;
top: 15%;
margin: auto;
z-index: 99999;
overflow: hidden;
.title {
text-align: center;
width: 100%;
color: #333;
font-size: 18px;
font-weight: bold;
}
.editem {
position: relative;
display: flex;
font-size: 14px;
border-radius: 10px;
margin-top: 15px;
height: 40px;
justify-content: space-between;
background: #eee;
padding: 0px 10px;
align-items: center;
.radioimg {
font-size: 22px;
color: $btncolor;
}
.radio {
width: 50%;
text-align: right;
display: flex;
justify-content: center;
align-items: center;
}
.name {
width: 4rem;
color: #333;
}
.right {
width: 60%;
height: 40px;
line-height: 40px;
text-align: right;
display: flex;
justify-content: flex-end;
input {
margin-right: 10px;
height: 40px;
line-height: 40px;
text-align: left;
}
picker {
width: 100%;
text-align: left;
}
.uni-input {
position: absolute;
right: 30px;
top: 0;
left: 0;
height: 40px;
line-height: 40px;
text-align: right;
z-index: 9999;
}
}
.value {
position: relative;
z-index: 999;
width: 3rem;
text-align: center;
float: left;
margin-right: 10px;
}
.iconfont {
margin-left: 10px;
float: right;
display: flex;
}
}
.tips {
font-size: 0.75rem;
color: #999;
text-align: center;
margin-top: 15px;
margin-bottom: 20px;
display: flex;
}
}
}
.btn { .btn {
width: 40%; width: 40%;
float: right; float: right;
@ -228,7 +102,8 @@
} }
.close { .close {
background: #dfdfdf !important; background: #fff !important;
float: left; float: left;
color: #333;
} }
</style> </style>

View File

@ -1,242 +0,0 @@
<template>
<view v-if="isRecord" 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 mode="date" :value="regTime" :end="endDate" @change="bindDateChange">
<view class="text">{{regTime?regTime:"请选择"}}</view>
</picker>
</view>
</view>
<view class="editem">
<view class="left">体重</view>
<view class="right">
<input v-model="weight" type="digit" placeholder="请输入" />kg
</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 {
regTime: "",
weight: "",
}
},
computed: {
...mapState(["user", "isRecord"]),
endDate() {
return this.$tools.getDate("start")
},
startDate() {
return this.$tools.GetDateStr(-90);
},
},
methods: {
//
handleTarget() {
let that = this
if (!that.regTime) {
that.$tools.msg("请选择测量日期")
return
}
if (!that.weight) {
that.$tools.msg("请输入测量体重")
return
}
that.$model.getinsertmeasure({
familyid: that.user.familyid,
time: that.regTime,
weight: that.weight,
}).then(res => {
if (res.code != 0) return
that.$tools.msg(res.message)
that.$store.commit("changeRecord", false);
that.$store.dispatch("getResult", {
birthday: that.user.birthday,
familyid: that.user.familyid,
height: that.user.height,
sex: that.user.sex,
})
that.$store.dispatch("getUserInfo", {
familyid: that.user.familyid,
})
that.$emit("getList", this.startDate, this.endDate)
that.regTime = ""
that.weight = ""
})
},
//
bindDateChange(e) {
this.regTime = e.target.value
},
onTap() {
this.regTime = ""
this.weight = ""
this.$store.commit("changeRecord", false);
},
hideKeyboard() {
uni.hideKeyboard()
},
}
}
</script>
<style scoped lang="scss">
.wrapper {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 999;
.bg {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.4);
z-index: 99;
}
.edit {
width: 15rem;
height: auto;
background: #fff;
border-radius: 10px;
padding: 15px;
position: relative;
top: 15%;
margin: auto;
z-index: 99999;
overflow: hidden;
.title {
text-align: center;
width: 100%;
color: #333;
font-size: 18px;
font-weight: bold;
}
.editem {
position: relative;
display: flex;
font-size: 14px;
border-radius: 10px;
margin-top: 15px;
height: 40px;
justify-content: space-between;
background: #eee;
padding: 0px 10px;
align-items: center;
.radioimg {
font-size: 22px;
color: $btncolor;
}
.radio {
width: 50%;
text-align: right;
display: flex;
justify-content: center;
align-items: center;
}
.name {
width: 4rem;
color: #333;
}
.right {
width: 60%;
height: 40px;
line-height: 40px;
text-align: right;
display: flex;
justify-content: flex-end;
input {
margin-right: 10px;
height: 40px;
line-height: 40px;
text-align: left;
}
picker {
width: 100%;
text-align: left;
}
.uni-input {
position: absolute;
right: 30px;
top: 0;
left: 0;
height: 40px;
line-height: 40px;
text-align: right;
z-index: 9999;
}
}
.value {
position: relative;
z-index: 999;
width: 3rem;
text-align: center;
float: left;
margin-right: 10px;
}
.iconfont {
margin-left: 10px;
float: right;
display: flex;
}
}
.tips {
font-size: 0.75rem;
color: #999;
text-align: center;
margin-top: 15px;
margin-bottom: 20px;
display: flex;
}
}
}
.btn {
width: 40%;
float: right;
margin-top: 15px;
background: $maincolor !important;
}
.edit {
top: 20%
}
.close {
background: #dfdfdf !important;
float: left;
}
</style>

View File

@ -47,7 +47,7 @@
weight: that.inputvalue, weight: that.inputvalue,
}).then(res => { }).then(res => {
if (res.code != 0) return if (res.code != 0) return
that.$tools.msg(res.message) that.$tools.msg(res.msg)
that.$store.commit("changeTarget", false); that.$store.commit("changeTarget", false);
that.$store.dispatch("getUserInfo", { that.$store.dispatch("getUserInfo", {
familyid: that.user.familyid, familyid: that.user.familyid,

View File

@ -1,5 +1,5 @@
{ {
"name" : "examTeamApp", "name" : "青测",
"appid" : "__UNI__E0E1A21", "appid" : "__UNI__E0E1A21",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",
@ -44,10 +44,13 @@
] ]
}, },
/* ios */ /* ios */
"ios" : {}, "ios" : {
"dSYMs" : false
},
/* SDK */ /* SDK */
"sdkConfigs" : { "sdkConfigs" : {
"share" : {} "share" : {},
"ad" : {}
} }
} }
}, },
@ -73,5 +76,6 @@
"uniStatistics" : { "uniStatistics" : {
"enable" : false "enable" : false
}, },
"vueVersion" : "2" "vueVersion" : "2",
"locale" : "zh-Hans"
} }

View File

@ -10,16 +10,6 @@
} }
} }
} }
}, {
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #477EFF, #39D9C9)"
}
}
}
}, },
{ {
"path": "pages/index/userInfo", "path": "pages/index/userInfo",
@ -45,7 +35,7 @@
} }
}, },
{ {
"path": "pages/weight/weight", "path": "pages/body/body",
"style": { "style": {
"navigationBarTitleText": "身体数据", "navigationBarTitleText": "身体数据",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
@ -56,19 +46,6 @@
} }
} }
}, },
{
"path": "pages/weight/components/report",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #477EFF, #39D9C9)"
}
}
}
},
{ {
"path": "pages/history/history", "path": "pages/history/history",
"style": { "style": {
@ -109,18 +86,28 @@
"path": "pages/compk/pkdetail", "path": "pages/compk/pkdetail",
"style": { "style": {
"navigationBarTitleText": "对比详情", "navigationBarTitleText": "对比详情",
"enablePullDownRefresh": false "enablePullDownRefresh": false,
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #477EFF, #39D9C9)"
}
}
} }
}, },
{ {
"path": "pages/skipping/skipping", "path": "pages/skip/skip",
"style": { "style": {
"navigationBarTitleText": "跳绳数据", "navigationBarTitleText": "跳绳数据",
"enablePullDownRefresh": false "enablePullDownRefresh": false,
"app-plus": {
"titleNView": {
"backgroundImage": "#000000"
}
}
} }
}, },
{ {
"path": "pages/charts/charts", "path": "pages/skip/charts",
"style": { "style": {
"navigationBarTitleText": "运动曲线", "navigationBarTitleText": "运动曲线",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
@ -130,27 +117,145 @@
} }
} }
} }
},
{
"path": "pages/vitalcapacity/vitalcapacity",
"style": {
"navigationBarTitleText": "肺活量数据",
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": {
"backgroundImage": "#000000"
}
}
}
},
{
"path": "pages/vitalcapacity/charts",
"style": {
"navigationBarTitleText": "运动曲线",
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #477EFF, #39D9C9)"
}
}
}
},
{
"path": "pages/me/me",
"style": {
"navigationBarTitleText": "我的",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #477EFF, #39D9C9)"
}
}
}
}, {
"path": "pages/me/manage",
"style": {
"navigationBarTitleText": "成员管理",
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #477EFF, #39D9C9)"
}
}
}
},
{
"path": "pages/score/score",
"style": {
"navigationBarTitleText": "分数评估",
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #477EFF, #39D9C9)"
}
}
}
}, {
"path": "pages/score/history",
"style": {
"navigationBarTitleText": "估分历史",
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #477EFF, #39D9C9)"
}
}
}
}, {
"path": "pages/score/report",
"style": {
"navigationBarTitleText": "估分报告",
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #477EFF, #39D9C9)"
}
}
}
},
{
"path": "pages/login/forgetPassword",
"style": {
"navigationBarTitleText": "密码",
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": {
"backgroundImage": "linear-gradient(to right, #477EFF, #39D9C9)"
}
}
}
},
{
"path": "pages/login/login",
"style": {
"navigationBarTitleText": "登录",
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
} }
], ],
"globalStyle": { "globalStyle": {
"navigationBarTextStyle": "black", "navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app", "navigationBarTitleText": "",
"navigationBarBackgroundColor": "#F8F8F8", "navigationBarBackgroundColor": "#fff",
"backgroundColor": "#F8F8F8" "backgroundColor": "#fff"
}, },
"uniIdRouter": {}, //
"condition": { // "tabBar": {
"current": 0, //(list ) "color": "#333",
"selectedColor": "#477EFF",
"backgroundColor": "#fff",
"list": [{ "list": [{
"name": "首页", // "pagePath": "pages/index/index",
"path": "pages/index/index", // "iconPath": "static/shou.png",
"query": "" //onLoad "selectedIconPath": "static/shou2.png",
"text": "首页"
}, },
{ {
"name": "登录", // "pagePath": "pages/score/score",
"path": "pages/login/login", // "iconPath": "static/ping.png",
"query": "" //onLoad "selectedIconPath": "static/ping2.png",
"text": "估分"
},
{
"pagePath": "pages/me/me",
"iconPath": "static/wo.png",
"selectedIconPath": "static/wo2.png",
"text": "我的"
} }
] ]
} },
"uniIdRouter": {}
// "condition": { //
// "current": 0, //(list )
// "list": [{
// "name": "首页", //
// "path": "pages/index/index", //
// "query": "" //onLoad
// }]
// }
} }

View File

@ -4,36 +4,59 @@
<view class="tabbar"> <view class="tabbar">
<view @click="active=1" :class="[active==1?'active':'']">报告</view> <view @click="active=1" :class="[active==1?'active':'']">报告</view>
<view @click="active=2" :class="[active==2?'active':'']">曲线</view> <view @click="active=2" :class="[active==2?'active':'']">曲线</view>
<!-- <view @click="active=3" :class="[active==3?'active':'']">记录</view> -->
</view> </view>
<!--报告 --> <!--报告 -->
<view v-if="active==1"> <view v-if="active==1">
<report></report> <report :acd_id="acd_id"></report>
</view> </view>
<!-- 曲线 --> <!-- 曲线 -->
<view v-if="active==2"> <view v-if="active==2">
<charts></charts> <charts :acd_id="acd_id"></charts>
</view>
<!-- 记录 -->
<view v-if="active==3">
<contrast></contrast>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import {
mapState
} from "vuex";
import report from "./components/report.vue" import report from "./components/report.vue"
import charts from "./components/charts.vue" import charts from "./components/charts.vue"
export default { export default {
data() { data() {
return { return {
active: 1 active: 1,
acd_id: "",
} }
}, },
computed: {
...mapState(['user']),
endDate() {
return this.$tools.getDate("start")
},
startDate() {
return this.$tools.GetDateStr(-90);
},
},
components: { components: {
report, report,
charts charts
}, },
onShow() {
let that = this
that.$store.dispatch("getResult", {
aud_id: uni.getStorageSync('userid')
})
that.$store.dispatch("GetBodyTrendList", {
aud_id: uni.getStorageSync('userid'),
s_time: that.startDate,
e_time: that.endDate
})
},
onLoad(options) {
let that = this
that.acd_id = options.acd_id
},
methods: { methods: {
} }
@ -70,5 +93,4 @@
background: $maincolor; background: $maincolor;
} }
} }
</style> </style>

View File

@ -0,0 +1,267 @@
<template>
<view>
<view class="TrendPage">
<!-- 时间选择 -->
<view class="boxTime">
<view class="one">
<picker mode="date" class="f-l" :value="startTime?startTime:startDate" @change="handStartTimeH">
<view class="uni-input">{{startTime?startTime:startDate}}
<uni-icons class="iconfont icon-arrow-down-bold"></uni-icons>
</view>
</picker>
<view>~</view>
<picker mode="date" :end="endDate" class="f-r" :value="endDate" @change="handEndTimeH">
<view class="uni-input"> {{endTime?endTime:endDate}}
<uni-icons class="iconfont icon-arrow-down-bold"></uni-icons>
</view>
</picker>
</view>
</view>
<!-- 曲线图 -->
<view class="box" v-if="weightList.length">
<view class="listC">
<view :class="{active2:index==active1}" class="name" v-for="(item,index) in weightList" :key="index"
@click="showbox(index)">
{{item.title}}
</view>
</view>
<view class="blockC">
<view v-if="handTrue">
<qiunDataCharts type="area" :chartData="lineData" :canvas2d="true" canvasId="charts09"
:cHeight="480" :cWidth="680" :animation="false"
:opts="{enableScroll:true,xAxis:{scrollShow:false,itemCount:3}}" :ontouch="true" />
</view>
</view>
</view>
<view class="box" v-else>
<view class="nolist">
<image src="@/static/none.png"></image>
<text>暂无数据请手动添加~</text>
</view>
</view>
</view>
<!-- 目标-->
<view class="gridList">
<view class="info">
<view class="item" @click="navTo('/pages/history/history?acd_id='+acd_id)">
<text class="t-icon-lishi t-icon"></text>
<view>历史记录</view>
</view>
<view class="item" @click="navTo('/pages/compk/contrast?acd_id='+acd_id)">
<text class="t-icon-renshiduibifenxi t-icon"></text>
<view>数据对比</view>
</view>
</view>
<view class="data">
<view class="item" @click="handleClick(1)">
<view class="val">{{userInfo.target_current?userInfo.target_current.target_weight:0}}<text>kg</text>
</view>
<view class="name">目标体重<uni-icons class="iconfont icon-bianji" color="#FEC407"></uni-icons>
</view>
</view>
<view class="item">
<view class="val">
{{userInfo.target_current?Math.abs(userInfo.target_current.cumulative_weight):0}}<text>kg</text>
</view>
<view class="name" v-if="Number(userInfo.target_current.cumulative_weight)>0">累计增重</view>
<view class="name" v-else>累计减重</view>
</view>
<view class="item" @click="handleClick(2)">
<view class="val">
{{userInfo.target_current?userInfo.target_current.initial_weight:0}}<text>kg</text>
</view>
<view class="name">初始体重<uni-icons class="iconfont icon-bianji" color="#FEC407"></uni-icons>
</view>
</view>
<view class="item">
<view class="val">
{{userInfo.target_current?userInfo.target_current.cumulative_day:0}}<text></text>
</view>
<view class="name">减重天数</view>
</view>
</view>
</view>
<!-- 初始 -->
<firstweight :type="ind"></firstweight>
</view>
</template>
<script>
import {
mapState
} from "vuex";
import firstweight from '@/components/target/firstweight.vue';
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue';
export default {
components: {
firstweight,
qiunDataCharts,
},
props: {
acd_id: ""
},
computed: {
...mapState(["user", "Trend"]),
weightList() {
return this.Trend
},
userInfo() {
return this.user
},
endDate() {
return this.$tools.getDate("start")
},
startDate() {
return this.$tools.GetDateStr(-90);
},
},
mounted() {
let that = this
that.showbox(0)
},
methods: {
showbox(index) {
let that = this
that.handTrue = false
this.$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.target.value) > Date.parse(that.endTime)) {
that.$tools.msg("请选择正确的时间")
return
}
} else {
if (Date.parse(e.target.value) > Date.parse(that.endDate)) {
that.$tools.msg("请选择正确的时间")
return
}
}
that.startTime = e.target.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.target.value) < Date.parse(that.startTime)) {
that.$tools.msg("请选择正确的时间")
return
}
} else {
if (Date.parse(e.target.value) < Date.parse(that.startDate)) {
that.$tools.msg("请选择正确的时间")
return
}
}
that.endTime = e.target.value
let startTime = that.startTime ? that.startTime : that.startDate
that.$store.dispatch("GetBodyTrendList", {
aud_id: that.user.id,
s_time: startTime,
e_time: that.endTime
})
that.showbox(0)
},
handleClick(ind) {
this.ind = ind
this.$store.commit("changeFirst", true);
},
navTo(url) {
uni.navigateTo({
url: url
})
}
},
data() {
return {
ind: 0,
active1: 0,
startTime: "",
endTime: "",
lineData: {},
handTrue: true,
};
}
}
</script>
<style lang="scss" scoped>
.boxTime {
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
border-radius: 10px 10px 0 0;
.one {
width: 80%;
display: flex;
line-height: 25px;
justify-content: space-between;
align-items: center;
}
}
.box {
width: 100%;
padding: 0;
margin: 0;
display: flex;
flex-wrap: wrap;
border-radius: 0 0 10px 10px;
justify-content: space-between;
.listC {
background-color: #fff;
.name {
width: 20%;
padding: 0 15px;
font-size: 14px;
text-align: center;
border-radius: 5px;
height: 30px;
line-height: 30px;
}
.active2 {
color: #fff;
background: $maincolor;
}
}
.blockC {
clear: both;
width: 100%;
height: 250px;
background-color: #fff;
border-radius: 0 0 10px 10px;
padding-bottom: 15px;
}
}
.gridList {
margin: 0px !important;
width: 100% !important;
.data {
.item {
display: block !important
}
}
}
</style>

View File

@ -0,0 +1,428 @@
<template>
<view class="">
<view class="nolist" v-if="!info">
<image src="@/static/none.png"></image>
<text>暂无数据请手动添加~</text>
</view>
<view class="box" v-if="info&&info.top_list.length">
<view class="time">{{info?info.record_time:''}}</view>
<view class="item2">
<view class="item2_data" v-for="(item,index) in info.top_list" @click="handleToggleTop(item)">
<view class="data ">
<view class="c666 mb-5">{{item.name}}</view>
<view><text>{{item.value}}</text>{{item.unit}}</view>
</view>
</view>
<view class="myinfoPage" v-if="infoListTop">
<view class="desc">
<view v-if="infoListTop.desc" class="ming">{{infoListTop.desc}}</view>
<view :class="[infoListTop.list.length?'statuevue':'']" v-if="infoListTop.list">
<view class="bi">
<view :style="'left:'+infoListTop.offset+'%'" class="peobox">
<view class="xx"></view>
</view>
<view class="item" v-for="(ite , ind) in infoListTop.list" :key="ind"
:style="{backgroundColor:ite.color}">
<view class="span1">{{ite.text}}</view>
<view class="span" v-if="ind<infoListTop.list.length-1">{{ite.max_val}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- -->
<view class="box2" v-if="info">
<view>身体得分{{info?info.score_value:0}}</view>
<view>身体类型{{info?info.body_type_value:'无'}}</view>
</view>
<!-- -->
<view class="info">
<view class="item" @click="$store.commit('changeRecord', true)">
<text class="t-icon-jilu1 t-icon"></text>
<view>手动记录</view>
</view>
<view class="item" @click="$tools.msg('开发中,敬请期待!')">
<text class="t-icon-wulianjie t-icon"></text>
<view>连接设备</view>
</view>
</view>
<!-- -->
<view class="bold mt-10" v-if="info&&info.bottom_list">其他数据</view>
<view class="myinfoPage" v-if="info&&info.bottom_list">
<view class="box1">
<uni-collapse accordion>
<uni-collapse-item class="list" v-for="(item,index) in info.bottom_list" :key="index">
<template v-slot:title>
<uni-list-item class="block">
<view class="name">
<icon class="t-icon iconfont" :class="'t-icon-'+item.key_name"></icon>
{{item.name}}
</view>
<view class="val" v-if="item.title=='肥胖等级'||item.title=='体型'"> - </view>
<view class="val" v-else>{{item.value?item.value:'0'}}{{item.unit}}</view>
<view class="level">
<view class="btnf"
:style="{backgroundColor:(item.standard=='异常'?'#FFF':item.color)}"
:class="[item.standard=='异常'?'btnC':'']">
{{item.standard=='异常'?'-':item.standard}}
</view>
</view>
</uni-list-item>
</template>
<view class="desc">
<view v-if="item.desc" class="ming">{{item.desc}}</view>
<view :class="[item.list.length?'statuevue':'']" v-if="item.list">
<view class="bi" v-if="item.title!='基础代谢'">
<view :style="'left:'+item.offset+'%'" class="peobox">
<view class="xx"></view>
</view>
<view class="item" v-for="(ite , ind) in item.list" :key="ind"
:style="{backgroundColor:ite.color}">
<view class="span1">{{ite.text}}</view>
<view class="span" v-if="ind<item.list.length-1">{{ite.max_val}}</view>
</view>
</view>
<view v-else>
<view class="kcalClass" v-if="item.list&&item.list.length">
标准值:{{item.list[0].max_val}}kcal
</view>
</view>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
<view class="tips c999 ml-15">
<uni-icons type="info-filled" color="red"></uni-icons>
此测量数据仅供参考不可代替医学专业测试
</view>
</view>
<!-- 手动记录 -->
<record :rtype="acd_id"></record>
</view>
</template>
<script>
import {
mapState
} from "vuex";
import record from '@/components/manuallyAdd/record.vue';
export default {
data() {
return {
infoList: [],
infoListTop:{}
}
},
props: {
acd_id: ""
},
components: {
record
},
computed: {
...mapState(["MeasureResult"]),
info() {
let that = this
that.infoListTop = that.MeasureResult ? that.MeasureResult.top_list[0] : {}
return that.MeasureResult
},
},
mounted() {},
methods: {
navTo(url) {
uni.navigateTo({
url: url
})
},
handleToggleTop(item) {
this.infoListTop = item
}
}
}
</script>
<style scoped lang="scss">
.box {
padding: 10px;
background-color: #fff;
border-radius: 10px;
margin-bottom: 10px;
.time {
color: #999;
padding-bottom: 15px;
width: 100%;
}
.item2 {
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.item2_data {
width: 33%;
.data {
width: 100%;
text-align: center;
border-right: 1PX solid #f7f7f7;
}
text {
font-size: 20px !important;
font-weight: bold;
}
}
}
}
.box2 {
height: 50px;
line-height: 50px;
border-radius: 10px;
display: flex;
padding: 0 10px;
justify-content: space-between;
margin-bottom: 10px;
background-color: #fff;
}
.info {
width: 100%;
display: flex;
justify-content: space-between;
.item {
color: #fff;
width: 45%;
height: 50px;
background: $maincolor;
text-align: center;
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
text {
width: 30px;
height: 30px;
border-radius: 50%;
margin-right: 10px;
display: inline-block;
background-color: #fff;
}
}
}
.myinfoPage {
width: 100%;
background: #fff;
margin-top: 10px;
padding-bottom: 15px;
border-radius: 10px;
.box1 {
display: flex;
flex-wrap: wrap;
border-radius: 10px;
font-size: 14px;
position: relative;
margin: 0px 15px 0;
padding-bottom: 10px;
.list {
width: 100%;
color: #666;
padding: 0;
line-height: 50px;
// display: flex;
// justify-content: space-between;
// align-items: center;
// flex-wrap: wrap;
image,
.t-icon {
width: 18px !important;
height: 18px;
border: 2px solid #c7c7c7;
background-color: #c7c7c7;
border-radius: 50%;
margin-right: 5px;
}
.block {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
color: #666;
position: relative;
.level,
.val {
width: 25%;
}
.name {
width: 40%;
display: flex;
align-items: center;
}
.icon {
width: 20px;
text-align: right;
display: flex;
image {
width: 20px;
height: 20px;
}
}
}
}
}
}
.desc {
line-height: 20px;
text-align: left;
width: calc(100%-20px);
height: auto;
border-radius: 5px;
font-size: 12px;
color: #999;
padding: 10px;
background: #f7f7f7;
.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: 12px;
.span1 {
width: 100%;
text-align: center;
position: absolute;
top: -23px;
}
.span {
margin-top: 8px;
position: absolute;
right: -8px;
}
}
}
}
.yuanxing {
display: inline-block;
background: #f19601;
width: 8px;
height: 12px;
margin-right: 5px;
font-size: 32rpx;
}
.btnf {
font-size: 13px;
border-radius: 5px;
height: 22px;
margin: 0 10px 0 0;
line-height: 22px;
color: #fff;
font-weight: 400;
width: 44px !important;
text-align: center !important;
float: right;
}
.tivon {
display: flex;
justify-content: center;
align-content: center;
align-items: center;
.bianji {
width: 20px;
height: 20px;
margin-left: 5px;
}
}
.box1 :last-child.list {
.val {
width: 25% !important;
}
}
.kcalClass {
width: 100%;
text-align: center;
font-size: 16px;
line-height: 55px;
margin: -20px auto;
}
.yichang {
background: #ffe4be;
color: #ff4239;
padding: 5px;
text-align: center;
border-radius: 5px;
margin: 0 15px 10px;
}
/deep/.uni-collapse-item {
width: 100% !important;
}
/deep/.uni-collapse-item__title-arrow {
margin-right: 0 !important;
}
/deep/.uni-collapse-item__wrap-content.uni-collapse-item--border {
border-bottom-width: 0
}
</style>

View File

@ -9,15 +9,9 @@
<view class="box"> <view class="box">
<view class="tips">长按拖拽可调整卡片位置</view> <view class="tips">长按拖拽可调整卡片位置</view>
<view class="list"> <view class="list">
<view class="item"> <view class="item" v-for="(item,index) in cardList.user">
<view class="info"> <uni-icons type="minus-filled" size="18" color="#FF6D66" @click="deleteCard(item,index)"
<text></text> v-if="item.id!=2"></uni-icons>
<view>身体数据</view>
</view>
</view>
<view class="item" v-for="(item,index) in selectllist">
<uni-icons type="minus-filled" size="18" color="#FF6D66"
@click="deleteCard(item,index)"></uni-icons>
<view class="info"> <view class="info">
<text></text> <text></text>
<view>{{item.name}}</view> <view>{{item.name}}</view>
@ -29,7 +23,7 @@
<view class="box"> <view class="box">
<view class="tips2 tips">可添加的卡片</view> <view class="tips2 tips">可添加的卡片</view>
<view class="list"> <view class="list">
<view class="item" v-for="(item,index) in addlist"> <view class="item" v-for="(item,index) in cardList.all">
<uni-icons type="plus-filled" size="18" color="#05BD79" @click="addCard(item,index)"></uni-icons> <uni-icons type="plus-filled" size="18" color="#05BD79" @click="addCard(item,index)"></uni-icons>
<view class="info"> <view class="info">
<text></text> <text></text>
@ -43,30 +37,54 @@
</template> </template>
<script> <script>
import {
mapState
} from "vuex";
export default { export default {
data() { data() {
return { return {}
selectllist: [], // },
addlist: [], // onLoad() {},
computed: {
...mapState(["cardList", 'user']),
list() {
return this.cardList
} }
}, },
onLoad() {
this.selectllist = this.$json.selectllist
this.addlist = this.$json.addlist
},
methods: { methods: {
handleGradeList() {
let that = this
let list = []
that.cardList.user.forEach(ite => {
list.push(ite.id)
})
that.$model.getCardAllOrder({
aud_id: that.user.id,
card_order: list.join(",")
}).then(res => {
if (res.code != 0) {
that.$tools.msg(res.msg)
return
}
that.$store.dispatch('getUserInfo', {
aud_id: that.user.id
})
}).catch(err => {})
},
// //
deleteCard(item, index) { deleteCard(item, index) {
let that = this let that = this
that.selectllist.splice(index, 1) that.cardList.user.splice(index, 1)
that.addlist.push(item) that.cardList.all.push(item)
that.handleGradeList()
}, },
// //
addCard(item, index) { addCard(item, index) {
let that = this let that = this
that.addlist.splice(index, 1) that.cardList.all.splice(index, 1)
that.selectllist.push(item) that.cardList.user.push(item)
that.handleGradeList()
}, },
} }
} }

View File

@ -1,292 +0,0 @@
<template>
<view class="TrendPage">
<view class="listC">
<view @click="active=1" :class="[active==1?'active':'']">当天</view>
<view @click="active=2" :class="[active==2?'active':'']">月度</view>
<view @click="active=3" :class="[active==3?'active':'']">年度</view>
</view>
<!-- 时间选择 -->
<view class="boxTime">
<picker mode="date" class="f-l" :value="startDate" @change="handStartTimeH">
<view class="uni-input">{{startDate}}
<uni-icons type="right"></uni-icons>
</view>
</picker>
</view>
<!-- 曲线图 -->
<view class="box">
<view class="blockC" v-for="(item,index) in weightList">
<view>
<qiunDataCharts type="area" :chartData="item.Line" :canvas2d="true" canvasId="charts09"
:cHeight="480" :cWidth="680" :animation="false"
:opts="{enableScroll:true,xAxis:{scrollShow:false,itemCount:3}}" :ontouch="true" />
</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(["user", "Trend"]),
userInfo: function() {
return this.user
},
endDate() {
return this.$tools.getDate("start")
},
startDate() {
return this.$tools.GetDateStr(-90);
},
},
mounted() {
let that = this
this.active = 1
// that.getList(this.startDate, this.endDate)
},
methods: {
getList(start, end) {
console.log("fanhui", start, end)
let that = this
that.$model.getTrendList({
familyid: uni.getStorageSync('familyid'),
starttime: start,
endtime: end,
}).then(res => {
if (res) {
for (var i = 0; i < that.weightList.length; i++) {
that.weightList[i].Line = res[that.weightList[i].key];
}
that.showbox(0)
}
})
},
showbox(index) {
let that = this
that.handTrue = false
this.$nextTick(function() {
that.handTrue = true
that.lineData = that.weightList[index].Line
})
that.active1 = index
},
//
handStartTimeH(e) {
let that = this
if (this.endTime) {
if (Date.parse(e.target.value) > Date.parse(this.endTime)) {
this.$tools.msg("请选择正确的时间")
return
}
} else {
if (Date.parse(e.target.value) > Date.parse(this.endDate)) {
this.$tools.msg("请选择正确的时间")
return
}
}
this.startTime = e.target.value
let endtime = that.endTime ? that.endTime : that.endDate
this.getList(that.startTime, endtime)
},
navTo(url) {
uni.navigateTo({
url: url
})
}
},
data() {
return {
lineData: null,
weight: "",
token: null,
handTrue: true,
active: 1,
weightList: [{
title: '跳绳个数',
key: 'weight',
showCon: false,
Line: {
"categories": [],
"series": [{
"color": "#fb7b92",
"name": "体重",
"data": []
}]
},
},
{
title: '跳绳时长',
key: 'bmi',
Line: {
"categories": [],
"series": [{
"color": "#6bb0fe",
"name": "bmi",
"data": []
}]
},
}, {
title: '消耗卡路里',
key: 'muscle',
showCon: false,
Line: {
"categories": [],
"series": [{
"color": "#ff9f40",
"name": "肌肉率",
"data": []
}]
},
}
],
};
}
}
</script>
<style lang="scss" scoped>
.TrendPage {
padding: 10px 0;
margin-bottom: 15px;
border-radius: 10px;
background-color: #f7f7f7;
.listC {
width: 100%;
padding: 15px;
display: flex;
align-items: center;
justify-content: space-around;
view {
position: relative;
}
.active:after {
content: "";
height: 3px;
width: 100%;
position: absolute;
bottom: -5px;
left: 0;
border-radius: 5px;
background: $maincolor;
}
}
.boxTime {
width: calc(100% - 20px);
display: flex;
justify-content: space-between;
align-items: center;
background-color: #fff;
border-radius: 10px;
padding: 10px;
}
.box {
padding: 0;
display: flex;
flex-wrap: wrap;
border-radius: 10px;
justify-content: space-between;
}
.blockC {
clear: both;
width: 100%;
height: 250px;
background-color: #fff;
border-radius: 0 0 10px 10px;
}
.info {
width: 100%;
display: flex;
margin-top: 20px;
justify-content: space-between;
.item {
color: #fff;
width: 47.5%;
height: 50px;
background: $maincolor;
text-align: center;
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
text {
width: 30px;
height: 30px;
border-radius: 50%;
margin-right: 10px;
display: inline-block;
background-color: #fff;
}
}
}
.data {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
color: #666;
margin-top: 15px;
width: 100%;
.item {
width: 47.5%;
text-align: center;
font-size: 14px;
line-height: 30px;
background: #fff;
padding: 5px 0;
border-radius: 15px;
margin-bottom: 15px;
}
.val {
display: flex;
align-items: center;
font-size: 20px;
font-weight: 700;
justify-content: center;
color: #666;
text {
font-size: 14px;
font-weight: 500;
display: block;
margin-top: 3px;
margin-left: 3px;
}
}
.name {
display: flex;
align-items: center;
justify-content: center;
color: #999;
}
}
}
.boxList {
background-color: #fff;
border-radius: 10px;
.list {
margin: 10px;
}
}
</style>

View File

@ -8,15 +8,14 @@
<!-- --> <!-- -->
<view class="box" v-if="infoList.length"> <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="list" v-for="(item,index) in infoList" :key="index" @click="addMemberTags(item.id,item)">
<!-- 成人 -->
<view class="item"> <view class="item">
<view class="check"> <view class="check">
<text class="iconfont" <uni-icons :type="isActive.indexOf(item.id)!=-1?'checkbox-filled':'circle'" size="22"
:class="isActive.indexOf(item.id)!=-1?'icon-radio':'icon-kongradio'"></text> :color="isActive.indexOf(item.id)!=-1?'#FEC407':'#dfdfdf'"></uni-icons>
</view> </view>
<view>{{item.height}}<text>身高</text></view> <view>{{item.v1}}<text>{{item.v1_name}}</text></view>
<view>{{item.weight}}<text>体重</text></view> <view v-if="item.v2">{{item.v2}}<text>{{item.v2_name}}</text></view>
<view>{{item.bmi}}<text>BMI</text></view> <view v-if="item.v3">{{item.v3}}<text>{{item.v3_name}}</text></view>
</view> </view>
</view> </view>
</view> </view>
@ -25,17 +24,17 @@
<view class="list" v-for="(ite,ind) in ActiveDays" :key="ind" v-if="isActive" <view class="list" v-for="(ite,ind) in ActiveDays" :key="ind" v-if="isActive"
@click="addMemberTags(ite.id,ite)"> @click="addMemberTags(ite.id,ite)">
<view class="item borderRadius"> <view class="item borderRadius">
<view class="time">{{ite.createtime}}</view> <view class="time">{{ite.r_t}}</view>
<view>{{ite.height}}<text>身高</text></view> <view>{{ite.v1}}<text>{{ite.v1_name}}</text></view>
<view>{{ite.weight}}<text>体重</text></view> <view v-if="ite.v2">{{ite.v2}}<text>{{ite.v2_name}}</text></view>
<view>{{ite.bmi}}<text>BMI</text></view> <view v-if="ite.v3">{{ite.v3}}<text>{{ite.v3_name}}</text></view>
<view class="check"> <view class="check">
<icon class="iconfont icon-quxiao"></icon> <uni-icons type="clear" size="22" color="#999"></uni-icons>
</view> </view>
</view> </view>
</view> </view>
<view class="pkclass" v-if="length==2">vs</view> <view class="pkclass" v-if="length==2">vs</view>
<view :class="{'active':length!=2}" class="btn" @click="handlePK">减脂对比</view> <view :class="{'active':length!=2}" class="btn" @click="handlePK">对比</view>
</view> </view>
</view> </view>
</view> </view>
@ -47,6 +46,20 @@
mapState mapState
} from "vuex"; } from "vuex";
export default { export default {
data() {
return {
markDays: [],
infoList: [],
list: [],
isActive: [],
ActiveDays: [],
token: null,
startM: null,
endM: null,
isShow: true,
acd_id: ""
}
},
components: { components: {
RenCalendar, RenCalendar,
}, },
@ -59,39 +72,38 @@
return this.$tools.getDate("start") return this.$tools.getDate("start")
}, },
}, },
onLoad() { onLoad(optoins) {
this.token = uni.getStorageSync("token")
},
onShow() {
let that = this let that = this
that.acd_id = optoins.acd_id
that.startM = that.$tools.getDate("m").substring(0, 10) that.startM = that.$tools.getDate("m").substring(0, 10)
that.endM = that.$tools.getDate("m").substring(11, 21) that.endM = that.$tools.getDate("m").substring(11, 21)
that.infoList = this.$json.contrastList
that.markDays = [] that.markDays = []
that.list = [] that.list = []
that.isActive = [] that.isActive = []
that.ActiveDays = [] that.ActiveDays = []
// this.$nextTick(() => { this.$nextTick(() => {
// that.isShow = true that.isShow = true
// that.getList(that.startM, that.endM) that.getList(that.startM, that.endM)
// }) })
}, },
methods: { methods: {
getList(start, end) { getList(start, end) {
let that = this let that = this
that.$model.GetTrendList({ that.$model.getresultdiff({
familyid: uni.getStorageSync('familyid'), aud_id: uni.getStorageSync('userid'),
starttime: start, s_time: start,
endtime: end, e_time: end,
type: that.acd_id
}).then(res => { }).then(res => {
if (res) { if (res) {
that.markDays = res.pkList.Dlist that.markDays = res.pkList.Dlist
that.list = res.pkList.list that.list = res.pkList.list
for (var i = 0; i < res.pkList.list.length; i++) { for (var i = 0; i < res.pkList.list.length; i++) {
if (Date.parse(that.endDate) == Date.parse(res.pkList.list[i].createtime)) { if (Date.parse(that.endDate) == Date.parse(res.pkList.list[i].r_t)) {
that.infoList.push(res.pkList.list[i]); that.infoList.push(res.pkList.list[i]);
} }
} }
console.log("对比", that.infoList)
} }
}) })
}, },
@ -109,7 +121,7 @@
let that = this let that = this
this.infoList = [] this.infoList = []
for (var i = 0; i < that.list.length; i++) { for (var i = 0; i < that.list.length; i++) {
if (Date.parse(data.date) == Date.parse(that.list[i].createtime)) { //includes if (Date.parse(data.date) == Date.parse(that.list[i].r_t)) { //includes
this.infoList.push(that.list[i]); this.infoList.push(that.list[i]);
} }
} }
@ -132,189 +144,23 @@
}, },
handlePK() { handlePK() {
let that = this let that = this
// if (that.isActive.length != 2) { if (that.isActive.length != 2) {
// that.$tools.msg("") that.$tools.msg("请先选择数据!")
// return return
// } }
let info = {} let info = {}
// info.familyid = uni.getStorageSync('familyid') info.type = that.acd_id
// info.firstId = that.isActive[0] info.before_id = that.isActive[0]
// info.secondId = that.isActive[1] info.after_id = that.isActive[1]
console.log("1111") console.log("1111", info, that.isActive)
uni.navigateTo({ uni.navigateTo({
url: "/pages/weight/pkdetail?info=" + JSON.stringify(info) url: "/pages/compk/pkdetail?info=" + JSON.stringify(info)
}) })
}, },
}, },
data() {
return {
markDays: [],
infoList: [],
list: [],
isActive: [],
ActiveDays: [],
token: null,
startM: null,
endM: null,
isShow: true,
}
},
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.calendar {
background: #f7f7f7;
min-height: 100vh;
.box {
margin-bottom: 305px;
}
.list {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin: 15px;
align-items: center;
.item {
width: 100%;
height: auto;
background: #fff;
display: flex;
height: 40px;
justify-content: space-between;
padding: 10px 15px;
border-radius: 10px;
align-items: center;
text-align: center;
font-size: 16px;
font-weight: 700;
view {
width: 32%;
}
image {
width: 25px;
height: 25px;
}
text {
width: 100%;
font-size: 12px;
display: block;
color: #666;
text-align: center;
font-weight: 400;
}
.check {
width: 35px !important;
.icon-kongradio {
font-size: 22px;
color: #999;
}
.icon-radio {
font-size: 22px;
color: #FCA82D;
}
}
}
}
.time {
width: 100%;
font-size: 14px;
color: #666;
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
text {
font-size: 14px;
margin-top: 3px;
}
}
.bottom {
margin: 0;
width: auto;
position: fixed;
left: 0px;
right: 0px;
bottom: 0px;
z-index: 9;
padding: 0 10px 10px;
background: #fff;
border-radius: 0;
border-top: 1px solid #dfdfdf;
.btn {
width: auto;
margin: 10px 0 0;
background: $maincolor;
}
.list {
margin: 10px 0;
height: 120rpx;
position: relative;
.item {
background: #F7F7F7;
}
.time {
float: left;
text-align: center;
justify-content: center;
color: #fea82d;
font-weight: 700;
width: 35%;
}
.check {
position: absolute;
right: -5px;
top: -5px;
width: 25px;
.icon-quxiao {
font-size: 20px;
color: #999;
}
}
}
}
.pkclass {
position: absolute;
width: 30px;
height: 30px;
background: #fea82d;
border-radius: 50%;
line-height: 27px;
text-align: center;
color: #fff;
font-size: 19px;
left: 30px;
top: 120rpx;
}
.btn.active {
border: none;
color: #333 !important;
background: #dfdfdf !important;
display: block;
border-radius: 10px;
}
}
</style> </style>

View File

@ -1,39 +1,45 @@
<template> <template>
<view class="content pkconp"> <view class="content pkconp">
<view class="header"> <view class="headerTop">
<view class="left"> <view class="left">
<image :src="memInfo.headimg" class="image1"></image> <image :src="memInfo.headimg" class="image1"></image>
</view> </view>
<view class="right"> <view class="right">
<view class="name">{{memInfo.name?memInfo.name:memInfo.nickname}}</view> <view class="name">{{memInfo.name?memInfo.name:memInfo.nickname}}</view>
<view class="top"> <view class="top">
<view class="age">性别{{memInfo.sex==0?'未知':memInfo.sex==1?'男':'女'}}</view> <view>性别{{memInfo.gender=='0'?'未知':memInfo.gender=='1'?'男':'女'}}</view>
<view>年龄{{user.age}}</view> <view>年龄{{user.age}}</view>
</view> </view>
</view> </view>
<!-- <button class="pkclass" @click="handleImage">保存图片</button> -->
</view> </view>
<view class="box"> <view class="box" v-if="acd_id==2">
<view class="item"> <view class="item">
<view>{{memInfo.day?memInfo.day:'0'}}</view> <view>{{memInfo.day?memInfo.day:'0'}}</view>
<text>时间()</text> <text>时间()</text>
</view> </view>
<view class="item"> <view class="item">
<view>{{Math.abs(memInfo.weightdiff)}}</view> <view>{{memInfo.weightdiff?Math.abs(memInfo.weightdiff):0}}</view>
<text v-if="Number(memInfo.weightdiff)>0">增重(kg)</text> <text v-if="Number(memInfo.weightdiff)>0">增重(kg)</text>
<text v-else>减重(kg)</text> <text v-else>减重(kg)</text>
</view> </view>
<view class="item"> <view class="item">
<view>{{Math.abs(memInfo.fat_wdiff)}}</view> <view>{{memInfo.fat_wdiff?Math.abs(memInfo.fat_wdiff):0}}</view>
<text v-if="Number(memInfo.fat_wdiff)>0">增脂(kg)</text> <text v-if="Number(memInfo.fat_wdiff)>0">增脂(kg)</text>
<text v-else>减脂(kg)</text> <text v-else>减脂(kg)</text>
</view> </view>
<view class="time"> <view class="time">
<view> <view>
<icon class="yuanxing"></icon>{{memInfo.time}} <uni-icons class="t-icon t-icon-shijian-mianxing-0"></uni-icons>{{memInfo.time}}
</view>数据变化 </view>数据变化
</view> </view>
</view> </view>
<view class="boxTime" v-else>
<view class="">
<uni-icons class="t-icon t-icon-shijian-mianxing-0"></uni-icons>
{{memInfo.time}}
</view>
数据变化
</view>
<view class="control"> <view class="control">
<!-- 名称 --> <!-- 名称 -->
<view class="title"> <view class="title">
@ -44,33 +50,26 @@
</view> </view>
<view v-for="(ite,ind) in listStr" :key="ind" class="li"> <view v-for="(ite,ind) in listStr" :key="ind" class="li">
<view class="name"> <view class="name">
<view class="icon"> <!-- <view class="icon">
<view class="t-icon" :class="'t-icon-'+ite.key"></view> <view class="t-icon" :class="'t-icon-'+ite.name"></view>
</view> </view> -->
<text>{{ite.title}}</text> <text>{{ite.title}}</text>
</view> </view>
<view class="num" v-if="ite.title=='体型'||ite.title=='肥胖等级'"> <view class="num">
<view class="t-icon t-icon-hengxian"></view> <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>
<view class="num" v-else> <view class="f">
{{ite.num}} <view>{{ite.firstresult?ite.firstresult.value:'-'}}</view>
<text class="t-icon t-icon-shang" v-if="ite.vs=='1'"></text> <text>{{ite.firstresult.level}}</text>
<text class="t-icon t-icon-xia" v-if="ite.vs=='-1'"></text>
<text class="t-icon t-icon-hengxian" v-if="!ite.vs||ite.vs=='0'||ite.num=='0.00'"></text>
</view> </view>
<view class="f0" v-if="ite.title=='体型'||ite.title=='肥胖等级'"> <view class="f">
<text>{{ite.fevaluation}}</text> <view>{{ite.secondresult?ite.secondresult.value:'-'}}</view>
</view> <text>{{ite.secondresult.level}}</text>
<view class="f" v-else>
<view>{{ite.fvalue}}</view>
<text v-if="ite.fevaluation">{{ite.fevaluation}}</text>
</view>
<view class="f0" v-if="ite.title=='体型'||ite.title=='肥胖等级'">
<text>{{ite.sevaluation}}</text>
</view>
<view class="f" v-else>
<view>{{ite.svalue}}</view>
<text v-if="ite.fevaluation">{{ite.sevaluation}}</text>
</view> </view>
</view> </view>
</view> </view>
@ -87,239 +86,56 @@
let that = this let that = this
// //
console.log("options", options) console.log("options", options)
that.memInfo = that.$json.contrastDetail if (options.info) {
// if (options.info) { let info = JSON.parse(options.info)
// that.infoID = JSON.parse(options.info) that.acd_id = info.type
// that.handleSharepic(that.infoID) that.handleSharepic(JSON.parse(options.info))
// } }
}, },
computed: { computed: {
...mapState(["user", "appTheme"]), ...mapState(["user", "appTheme"]),
}, },
methods: { methods: {
handleSharepic(id) { handleSharepic(info) {
let that = this let that = this
that.$model.getresultdiff({ that.$model.getresultcontrast({
familyid: id.familyid, type: info.type,
firstId: id.firstId, before_id: info.before_id,
secondId: id.secondId, after_id: info.after_id,
}).then(res => { }).then(res => {
console.log("res", res) console.log("res", res)
if (res.code != 0) { if (res.code != 0) {
this.$tools.msg(res.message) this.$tools.msg(res.msg)
return return
} }
that.handleInfoList(res.data) 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
}) })
},
handleInfoList(data) {
let that = this
that.memInfo = data
let listStr = that.weightInfo.infoList(data.firstresult)
let str = that.memInfo.secondresult
for (var i = 0; i < listStr.length; i++) {
listStr[i].svalue = str[listStr[i].key];
let num = listStr[i].svalue - listStr[i].fvalue
if (num < 0) {
listStr[i].vs = '-1'
} else if (num > 0) {
listStr[i].vs = '1'
} else {
listStr[i].vs = '0'
}
listStr[i].num = Math.abs(num).toFixed(2)
if (str[listStr[i].level]) {
listStr[i].sevaluation = str[listStr[i].level];
}
console.log("listStr[i].title", listStr[i].title)
// if (listStr[i].title == "") {
// if (listStr[i].svalue > Number(str.standardweight)) {
// listStr[i].sevaluation = ""
// } else if (listStr[i].svalue < Number(str.standardweight)) {
// listStr[i].sevaluation = ""
// } else {
// listStr[i][i].sevaluation = ""
// }
// }
}
that.listStr = listStr
console.log("listStr[i]", that.memInfo, listStr)
}, },
}, },
data() { data() {
return { return {
infoID: {},
memInfo: {}, memInfo: {},
listStr: [], listStr: [],
acd_id: "",
} }
}, },
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.pkconp {
background: #f7f7f7;
min-height: 100vh;
.header {
text-align: center;
background: #fff;
padding: 15px 15px 10px;
margin: 15px;
border-radius: 10px 10px 0 0;
display: flex;
align-items: center;
position: relative;
.name {
text-align: left;
}
image {
width: 55px;
height: 55px;
border-radius: 50%;
margin-right: 15px;
}
.pkclass {
position: absolute;
background: linear-gradient(to right, #ff99ae, #ffb2c2);
right: 15px;
padding: 0px 10px;
border-radius: 10px;
color: #fff;
height: 30px;
line-height: 30px;
font-size: 14px;
}
.top {
display: flex;
color: #999;
margin-top: 10px;
}
}
.box {
background: #ffff;
display: flex;
flex-wrap: wrap;
justify-content: space-around;
align-items: center;
padding: 15px 0;
margin: 15px;
border-radius: 0 0 10px 10px;
.item {
text-align: center;
color: #999;
width: 33.3%;
line-height: 26px;
border-right: 1px solid #f7f7f7;
box-sizing: border-box;
view {
font-size: 20px;
font-weight: 700;
color: #666;
}
}
}
.control {
background: #fff;
margin: 15px;
display: flex;
border: 1px solid #F0F0F0;
border-radius: 10px;
flex-wrap: wrap;
justify-content: space-between;
.title {
width: 100%;
margin: 10px;
display: flex;
justify-content: space-between;
view {
width: 22%;
text-align: center;
}
.name {
width: 33%;
}
}
.li {
display: flex;
margin: 0 10px;
justify-content: space-between;
height: 54px;
border-top: 1px solid #eee;
align-items: center;
width: 100%;
.name {
width: 33%;
display: flex;
align-items: center;
image {
width: 20px;
height: 20px;
margin-right: 5px;
}
}
.num {
width: 22%;
display: flex;
align-items: center;
justify-content: center;
image {
width: 40rpx;
height: 40rpx;
}
}
.f,
.f0 {
width: 22%;
text-align: center;
text {
display: block;
width: 100%;
color: #999999;
font-size: 11px;
}
}
.f0 {
text {
font-size: 12px;
}
}
}
}
.time {
border-top: 1px solid #f0f0f0;
width: 100%;
padding: 15px 15px 0;
margin-top: 5px;
display: flex;
justify-content: space-between;
.yuanxing {
float: left;
}
}
}
.age { .age {
margin-right: 20px; margin-right: 20px;
} }
@ -337,6 +153,7 @@
} }
.t-icon-hengxian { .t-icon-hengxian {
height: 4px !important; height: 2px;
width: 10px;
} }
</style> </style>

View File

@ -3,15 +3,22 @@
<view class="history"> <view class="history">
<view class="list" v-for="(item, index) in ranklist" :key="index" @click="clickItemMethod(item)"> <view class="list" v-for="(item, index) in ranklist" :key="index" @click="clickItemMethod(item)">
<uni-swipe-action> <uni-swipe-action>
<uni-swipe-action-item :right-options="item.options" @click="swipeClick($event, index)"> <uni-swipe-action-item :right-options="item.options" @click="swipeClick($event, index)"
<view class="item"> :disabled='type=="edit"?true:false'>
<view class="time"> <view class="time">
{{item.createtime}} <icon class="t-icon t-icon-shijian-mianxing-0"></icon>
<text>{{item.record_time}}</text>
</view> </view>
<view>{{item.weight}}<text>体重</text></view> <view class="item">
<view>{{item.bmi}}<text>BMI</text></view> <view>{{item.v1}}<text>{{item.v1_name}}</text></view>
<view>{{item.fat_r}}<text>脂肪率</text></view> <view v-if="item.v2">{{item.v2}}<text>{{item.v2_name}}</text></view>
<uni-icons type="right"></uni-icons> <view v-if="item.v3">{{item.v3}}<text>{{item.v3_name}}</text></view>
<view class="check" v-if="type=='edit'" @click.stop>
<uni-icons :type="isActive==item.id?'checkbox-filled':'circle'" size="22"
:color="isActive==item.id?'#FEC407':'#dfdfdf'"
@click="handleEdit(item.id)"></uni-icons>
</view>
<uni-icons type="right" v-if="type!='edit'&&acd_id!=6"></uni-icons>
</view> </view>
</uni-swipe-action-item> </uni-swipe-action-item>
</uni-swipe-action> </uni-swipe-action>
@ -19,7 +26,8 @@
<view class="endtext" v-if="!lastPage || page >= lastPage"> 到底了看看别的吧 </view> <view class="endtext" v-if="!lastPage || page >= lastPage"> 到底了看看别的吧 </view>
</view> </view>
<view class="nolist" v-if="!lastPage"> <view class="nolist" v-if="!lastPage">
<uni-icons class="iconfont icon-zanwu1"></uni-icons> <image src="@/static/none.png"></image>
<text>暂无数据</text>
</view> </view>
</view> </view>
</template> </template>
@ -30,47 +38,28 @@
} from "vuex"; } from "vuex";
export default { export default {
computed: { computed: {
...mapState(['user', "appTheme"]), ...mapState(['user']),
endDate() {
return this.$tools.getDate("start")
},
startDate() {
return this.$tools.GetDateStr(-90);
},
}, },
data() { data() {
return { return {
options: [{
text: '取消',
style: {
backgroundColor: '#007aff'
}
}, {
text: '确认',
style: {
backgroundColor: '#dd524d'
}
}],
list: [
"测量时间",
"体重",
"BMI",
"操作",
],
ranklist: [], ranklist: [],
page: 1, page: 1,
type: "add",
lastPage: 1, lastPage: 1,
type: null, isActive: null,
id: null, acd_id: ""
} }
}, },
mounted() { onLoad(options) {
let that = this let that = this
let list = this.$json.historylist that.acd_id = options.acd_id
let options = [{ that.getList()
text: '删除',
style: {
backgroundColor: '#dd524d'
}
}]
list.forEach(item => {
item.options = options
})
this.ranklist = this.ranklist.concat(list)
}, },
onReachBottom() { onReachBottom() {
let that = this let that = this
@ -96,22 +85,16 @@
if (res.confirm) { if (res.confirm) {
that.$model.gethistorydelete({ that.$model.gethistorydelete({
id: id, id: id,
type: that.acd_id,
}).then((res) => { }).then((res) => {
if (res.code != 0) { if (res.code != 0) {
that.$tools.msg(res.message) that.$tools.msg(res.msg)
return return
} }
that.ranklist.splice(index, 1) that.ranklist.splice(index, 1)
that.$store.dispatch("getUserInfo", { that.$store.dispatch("getUserInfo", {
familyid: that.user.familyid, aud_id: uni.getStorageSync('userid')
}) })
that.$store.dispatch("getResult", {
birthday: that.user.birthday,
familyid: that.user.familyid,
height: that.user.height,
sex: that.user.sex,
})
that.$tools.msg("删除成功") that.$tools.msg("删除成功")
}) })
} else if (res.cancel) { } else if (res.cancel) {
@ -121,26 +104,38 @@
}) })
}, },
clickItemMethod(item) { clickItemMethod(item) {
let that = this
if (that.acd_id == "6") return
uni.navigateTo({ uni.navigateTo({
url: "/pages/history/historyDetail?index=" + JSON.stringify(item) url: "/pages/history/historyDetail?type=" + that.acd_id + '&id=' + item.id
}) })
}, },
getList(page) { getList(page) {
let that = this let that = this
that.$model.getHistoryList({ that.$model.gethistory({
familyId: that.user.familyid, aud_id: uni.getStorageSync('userid'),
pageNo: page, type: that.acd_id,
pageSize: 10 page: that.page,
}).then((res) => { }).then((res) => {
console.log("历史记录", res) console.log("历史记录", res)
if (res.code != 0) return if (res.code != 0) return
let options = [{
text: '删除',
style: {
backgroundColor: '#dd524d'
}
}]
res.data.rows.forEach(item => { res.data.rows.forEach(item => {
item.slide_x = 0 item.options = options
}) })
this.ranklist = this.ranklist.concat(res.data.rows) this.ranklist = this.ranklist.concat(res.data.rows)
this.lastPage = res.data.totalpage this.lastPage = res.data.totalpage
}) })
}, },
handleEdit(id) {
this.isActive = id
},
} }
} }
</script> </script>
@ -161,6 +156,7 @@
.list { .list {
width: 100%; width: 100%;
margin-bottom: 12px; margin-bottom: 12px;
position: relative;
.item { .item {
width: calc(100% - 20px); width: calc(100% - 20px);
@ -171,7 +167,6 @@
justify-content: space-between; justify-content: space-between;
border-radius: 10px; border-radius: 10px;
align-items: center; align-items: center;
text-align: center;
font-weight: 700; font-weight: 700;
line-height: 50rpx; line-height: 50rpx;
font-size: 18px !important; font-size: 18px !important;
@ -181,17 +176,31 @@
color: #666; color: #666;
text-align: center; text-align: center;
font-weight: 500; font-weight: 500;
font-size: 14px; font-size: 28rpx;
} }
} }
.time { .time {
font-size: 28rpx;
color: #666; color: #666;
width: 35%; display: flex;
align-items: center;
justify-content: center;
width: 100%;
icon {
width: 40rpx;
height: 40rpx;
margin-right: 5px;
}
text {
font-size: 28rpx;
margin-top: 3px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
font-size: 14px; }
} }
} }
} }

View File

@ -2,177 +2,13 @@
<view> <view>
<view class="box"> <view class="box">
<view class="form lanBox"> <view class="form lanBox">
<view class="lan border-bottom"> <view class="lan border-bottom" v-for="(item,index) in ranklist">
<view class="left"> <view class="left">
<view class="view"> <view class="view">
<view class="t-icon t-icon-height1"></view> <view class="t-icon" :class="'t-icon-'+item.key_name"></view>
</view>身高 </view>{{item.name}}
</view> </view>
<view class="right">{{memInfo.height?memInfo.height:"0"}}cm</view> <view class="right">{{item.value?item.value:"0"}}{{item.unit}}</view>
</view>
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-weight"></view>
</view>体重
</view>
<view class="right">{{memInfo.weight?memInfo.weight:"0"}}kg</view>
</view>
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-bodyage"></view>
</view>年龄
</view>
<view class="right">{{memInfo.age?memInfo.age:"0岁"}}</view>
</view>
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-bmi"></view>
</view>BMI
</view>
<view class="right">{{memInfo.bmi?memInfo.bmi:"0"}}</view>
</view>
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-fat_w"></view>
</view>脂肪量
</view>
<view class="right">{{memInfo.fat_w?memInfo.fat_w:"0"}}%</view>
</view>
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-fat_r"></view>
</view>脂肪率
</view>
<view class="right">{{memInfo.fat_r?memInfo.fat_r:"0"}}%</view>
</view>
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-muscleval"></view>
</view>肌肉量
</view>
<view class="right">{{memInfo.muscleval?memInfo.muscleval:"0"}}kg</view>
</view>
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-muscle"></view>
</view>肌肉率
</view>
<view class="right">{{memInfo.muscle?memInfo.muscle:"0"}}%</view>
</view>
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-proteinval"></view>
</view>蛋白量
</view>
<view class="right">{{memInfo.proteinval?memInfo.proteinval:'0'}}kg</view>
</view>
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-protein"></view>
</view>蛋白率
</view>
<view class="right">{{memInfo.protein?memInfo.protein:"0"}}%</view>
</view>
<!-- -->
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-water"></view>
</view>水分
</view>
<view class="right">{{memInfo.water?memInfo.water:"0"}}</view>
</view>
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-bone"></view>
</view>骨重
</view>
<view class="right">{{memInfo.bone?memInfo.bone:"0"}}kg</view>
</view>
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-visceral"></view>
</view>内脏指数
</view>
<view class="right">{{memInfo.visceral?memInfo.visceral:"0"}}</view>
</view>
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-sfr"></view>
</view>皮下脂肪
</view>
<view class="right">{{memInfo.sfr?memInfo.sfr:"0"}}%</view>
</view>
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-kcal"></view>
</view>基础代谢率
</view>
<view class="right">{{memInfo.kcal?memInfo.kcal:'0'}}kcal</view>
</view>
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-lbm"></view>
</view>去脂体重
</view>
<view class="right">{{memInfo.lbm?memInfo.lbm:"0"}}kg</view>
</view>
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-bodyage"></view>
</view>体龄
</view>
<view class="right">{{memInfo.bodyage?memInfo.bodyage:"-"}}</view>
</view>
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-fatlevel"></view>
</view>肥胖等级
</view>
<view class="right">{{memInfo.fatlevel?memInfo.fatlevel:'0'}}</view>
</view>
<!-- -->
<view class="lan border-bottom">
<view class="left">
<view class="view">
<view class="t-icon t-icon-body"></view>
</view>体型
</view>
<view class="right">{{memInfo.body?memInfo.body:'0'}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -186,21 +22,35 @@
export default { export default {
data() { data() {
return { return {
list: {}, id: "",
memInfo: {} type: "",
ranklist: []
}; };
}, },
computed: { computed: {
...mapState(["appTheme"]) ...mapState([])
}, },
onLoad(options) { onLoad(options) {
// //
let info = options.index let that = this
let memInfo = JSON.parse(info) that.id = options.id
this.memInfo = memInfo that.type = options.type
// this.list = this.weightInfo.infoList(memInfo) that.getList()
// console.log(this.list) },
methods: {
getList() {
let that = this
that.$model.gethistorydetail({
id: that.id,
type: that.type,
}).then((res) => {
console.log("历史记录详情", res)
this.ranklist = res.data
})
},
} }
}; };
</script> </script>

View File

@ -1,112 +1,38 @@
<template> <template>
<view class="content"> <view class="content indexCarList">
<!-- 头部 --> <!-- 头部 -->
<view class="header"> <headerIndex></headerIndex>
<view class="top" v-if="token">
<view class="headimg">
<image src="../../static/logo.png"></image>
</view>
<view class="info">
<view class="size20 bold">小白</view>
<view class="mt-5">{{$t("index.age")}}16</view>
<view>{{$t("index.birthday")}}2008年1月24日</view>
</view>
<icon class="iconfont icon-qiehuan1"></icon>
</view>
<view class="top" v-else>
<view class="headimg">
<image src="../../static/logo.png"></image>
</view>
<view class="info">
暂无成员请先添加~
</view>
<view class="add" @click="handleAddUser">
+
</view>
</view>
</view>
<!-- 地区 -->
<view class="area box">
<view>
<text>{{$t("index.region")}}</text>
<text>北京</text>
</view>
<!-- <icon class="iconfont icon-arrow-right-bold size20"></icon> -->
</view>
<!-- 身体数据 -->
<view class="card box" @click="navTo('/pages/weight/weight')">
<view class="title border-bottom">
<view class="name"><text>身体数据</text>2024/03/25</view>
<icon class="iconfont icon-arrow-right-bold size20"></icon>
</view>
<view class="item title">
<view>
<text>身高</text>
<view class="weight"><text>176</text>cm</view>
<view class="standardBtn">标准</view>
</view>
<view>
<text>体重</text>
<view class="weight"><text>76</text>kg</view>
<view class="standardBtn">标准</view>
</view>
<view>
<text>BMI</text>
<view class="weight"><text>26</text></view>
<view class="standardBtn">标准</view>
</view>
</view>
<view class="target">
<view class="left">
<icon class="iconfont icon-notification"></icon>
身体是一切的基础
</view>
<view class="targetBtn">手动记录</view>
</view>
</view>
<!-- 卡片数据 --> <!-- 卡片数据 -->
<view class="list"> <view class="list">
<view v-for="(ite,ind) in selectllist" @click="navTo(ite.detailurl)"> <view v-for="(item,index) in user.card_data_list">
<!-- 大标签 --> <!-- 标题 -->
<view class="card box" v-if="ite.size=='big'"> <view class="card box">
<view class="title border-bottom"> <view class="title border-bottom" @click="handlerReport(item)">
<view class="name"><text>{{ite.name}}</text>{{ite.time}}</view> <view class="name"><text>{{item.card_name}}</text>{{item.record_time}}</view>
<icon class="iconfont icon-arrow-right-bold size20"></icon> <uni-icons type="right" size="20" v-if="item.inside_data[0].value"></uni-icons>
</view> </view>
<view class="item title"> <!-- 内容 -->
<view class="item2"> <view class="item title"
<text class="name">用时</text> :style="{'justifyContent':item.inside_data.length>2?'space-between':'center'}">
<view class="weight"><text>{{ite.taketime?ite.taketime:'------'}}</text></view> <view v-for="(ite,ind) in item.inside_data" :class="[item.inside_data.length>3?'item2':'']">
</view> <view class="name">{{ite.name}}</view>
<view class="item2"> <view class="weight"><text>{{ite.value?ite.value:'-'}}</text>{{ite.unit}}</view>
<text class="name">本次次数</text> <view class="standardBtn" v-if="ite.standard" :style="{'backgroundColor':ite.color}">
<view class="weight"><text>{{ite.cnt?ite.cnt:'-'}}</text>{{ite.unit}}</view> {{ite.standard}}
<view class="standardBtn" :style="{'backgroundColor':ite.standardcolor}"
v-if="ite.standardtext">
{{ite.standardtext}}
</view> </view>
</view> </view>
</view> </view>
<view class="item title"> <!-- 手动记录 -->
<view class="item2"> <view class="target" @click.stop>
<text class="name">平均成绩</text>
<view class="weight"><text>{{ite.averagecnt?ite.averagecnt:'-'}}</text>{{ite.unit}}</view>
</view>
<view class="item2">
<text class="name">卡路里</text>
<view class="weight"><text>{{ite.kcal?ite.kcal:'-'}}</text>kcal</view>
</view>
</view>
<view class="target">
<view class="left"> <view class="left">
<icon class="iconfont icon-notification"></icon> <!-- <icon class="iconfont icon-notification"></icon>
{{ite.name}}教程 {{ite.name}}教程 -->
</view> </view>
<view class="targetBtn">手动记录</view> <view class="targetBtn" @click="handlerRecord(item.acd_id)">手动记录</view>
</view> </view>
</view> </view>
<!-- 小标签 --> <!-- 小标签 -->
<view class="card box small" v-if="ite.size=='small'"> <!-- <view class=" card box small" v-if="ite.size=='small'">
<view class="title border-bottom"> <view class="title border-bottom">
<view class="name"><text>{{ite.name}}</text>{{ite.time}}</view> <view class="name"><text>{{ite.name}}</text>{{ite.time}}</view>
<icon class="iconfont icon-arrow-right-bold size20"></icon> <icon class="iconfont icon-arrow-right-bold size20"></icon>
@ -128,26 +54,39 @@
</view> </view>
<view class="targetBtn">手动记录</view> <view class="targetBtn">手动记录</view>
</view> </view>
</view> </view> -->
</view> </view>
</view> </view>
<!-- 设置数据卡片 --> <!-- 设置数据卡片 -->
<view class="setcard" @click="handleCard"> <view class="setcard" @click="handleCard">
设置数据页卡片 设置数据页卡片
</view> </view>
<!-- 手动 -->
<record :rtype="rtype"></record>
</view> </view>
</template> </template>
<script> <script>
import {
mapState
} from "vuex";
import headerIndex from "@/components/headerIndex.vue"
import record from '@/components/manuallyAdd/record.vue';
export default { export default {
data() { data() {
return { return {
token: null, rtype: 0
selectllist: []
} }
}, },
components: {
record,
headerIndex
},
computed: {
...mapState(["user"]),
},
onLoad() { onLoad() {
this.selectllist = this.$json.selectllist let that = this
let systemInfo = uni.getSystemInfoSync(); let systemInfo = uni.getSystemInfoSync();
this.isAndroid = systemInfo.platform.toLowerCase() === 'android'; this.isAndroid = systemInfo.platform.toLowerCase() === 'android';
uni.onLocaleChange((e) => { uni.onLocaleChange((e) => {
@ -165,19 +104,30 @@
this.$i18n.locale = e.code; this.$i18n.locale = e.code;
} }
}) })
that.handleUserList()
}, },
methods: { methods: {
// //
handleLogin() { handleUserList() {
uni.navigateTo({ let that = this
url: "/pages/login/login" that.$model.getUserList({
type: 2
}).then(res => {
console.log("用户列表", res)
if (res.code != 0) {
that.$tools.msg(res.msg)
return
}
that.$store.commit('changeFamilay', res.data)
if (res.data.length) {
that.$store.dispatch('getUserInfo', {
aud_id:uni.getStorageSync('userid')?uni.getStorageSync('userid'): res.data[0].id
}) })
}, that.$store.dispatch("getCardList", {
// aud_id:uni.getStorageSync('userid')?uni.getStorageSync('userid'): res.data[0].id
handleAddUser() {
uni.navigateTo({
url: "/pages/index/userInfo"
}) })
}
}).catch(err => {})
}, },
// //
handleCard() { handleCard() {
@ -185,6 +135,17 @@
url: "/pages/card/card" url: "/pages/card/card"
}) })
}, },
//
handlerReport(item) {
uni.navigateTo({
url: "/pages/" + item.card_key + '/' + item.card_key + "?acd_id=" + item.acd_id
})
},
//
handlerRecord(id) {
this.rtype = id
this.$store.commit('changeRecord', true)
},
navTo(url) { navTo(url) {
console.log("url", url) console.log("url", url)
uni.navigateTo({ uni.navigateTo({
@ -197,192 +158,8 @@
<style lang="scss" scoped> <style lang="scss" scoped>
.content { .content {
// display: flex;
// flex-direction: column;
// align-items: center;
// justify-content: center;
min-height: 100vh; min-height: 100vh;
padding-bottom: 15px;
background-color: #f7f7f7; background-color: #f7f7f7;
} }
.header {
width: 100%;
height: 280rpx;
padding-top: 20px;
background: $maincolor;
image {
width: 100%;
height: 100%;
border-radius: 50%;
}
.top {
margin: 0 10px;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #fff;
border-radius: 10px;
padding: 15px;
min-height: 170rpx;
.headimg {
width: 55px;
height: 55px;
}
.toggle {
width: 20px;
height: 20px;
}
}
.add {
border: 1px #dfdfdf dashed;
font-size: 28px;
font-weight: 500;
width: 35px;
height: 35px;
line-height: 35px;
border-radius: 10px;
text-align: center;
}
}
.box {
margin: 15px 10px 0;
padding: 15px 10px 10px;
background-color: #fff;
width: calc(100% - 40px);
display: flex;
border-radius: 10px;
}
.area {
justify-content: space-between;
}
.card {
flex-wrap: wrap;
.title {
width: 100%;
color: #666;
display: flex;
padding-bottom: 5px;
align-items: center;
justify-content: space-between;
text {
font-size: 18px;
font-weight: bold;
margin-right: 10px;
color: #333;
}
}
.item {
padding: 15px 0;
display: flex;
flex-wrap: wrap;
text-align: center;
text {
font-size: 14px;
font-weight: 500;
margin-right: 0;
}
.weight {
width: 100%;
text {
font-size: 24px !important;
font-weight: bold;
margin: 8px 0;
display: inline-block;
}
}
.standardBtn {
width: 40px;
padding: 3px 8px;
border-radius: 8px;
text-align: center;
color: #fff;
font-size: 14px;
background-color: $btncolor;
}
}
.target {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
padding-top: 10px;
font-size: 14px;
color: $textcolor;
border-top: 1px solid #f7f7f7;
.targetBtn {
width: auto;
height: 30px;
line-height: 30px;
color: #fff;
border-radius: 10px;
padding: 0 10px;
background: $maincolor;
}
}
.item2 {
width: 40%;
display: flex;
flex-wrap: wrap;
justify-content: center;
.name {
display: inline-block;
width: 100%;
}
}
}
.small {
width: calc(50% - 40px);
float: left;
margin-bottom: 15px;
.title {
.name {
display: flex;
flex-wrap: wrap;
text {
width: 80%;
margin-bottom: 5px;
display: inline-block;
}
}
}
.item {
justify-content: center;
}
}
.setcard {
width: calc(100% - 20px);
text-align: center;
height: 40px;
line-height: 40px;
margin: 10px 15px;
border-radius: 10px;
color: $textcolor;
background-color: #fff;
}
</style> </style>

View File

@ -4,20 +4,20 @@
<view class="headbox"> <view class="headbox">
<view class="touxiang"> <view class="touxiang">
<image v-if="headimg" :src="headimg" class="headimage" /> <image v-if="headimg" :src="headimg" class="headimage" />
<icon v-else class="t-icon t-icon-touxiang headimage" @click="handleUpImg"></icon> <icon v-else class="iconfont icon-user-filling headimage" @click="handleUpImg"></icon>
</view> </view>
</view> </view>
<view class="lan border-bottom"> <view class="lan border-bottom">
<view class="left">姓名</view> <view class="left">姓名</view>
<view class="right"> <view class="right">
<input name="name" type="text" v-model="name" placeholder="请输入姓名" /> <input name="name" type="text" v-model="memInfo.nickname" placeholder="请输入姓名" />
</view> </view>
</view> </view>
<view class="lan border-bottom"> <view class="lan border-bottom">
<view class="left">性别</view> <view class="left">性别</view>
<view class="right"> <view class="right">
<picker mode="selector" :range="sexItem" @change="onsexArr"> <picker mode="selector" :range="sexItem" @change="onsexArr">
<view class="uni-input">{{sex==0?'请选择':sex==1?'男':'女'}}</view> <view class="uni-input">{{memInfo.gender==0?'请选择':memInfo.gender==1?'男':'女'}}</view>
<icon class="iconfont icon-arrow-down-bold"></icon> <icon class="iconfont icon-arrow-down-bold"></icon>
</picker> </picker>
</view> </view>
@ -25,8 +25,9 @@
<view class="lan border-bottom"> <view class="lan border-bottom">
<view class="left">出生日期</view> <view class="left">出生日期</view>
<view class="right"> <view class="right">
<picker class="picker" mode="date" :end="startDate" :value="birthday" @change="bindDateChange"> <picker class="picker" mode="date" :end="startDate" :value="memInfo.birthday"
<view class="uni-input">{{birthday?birthday:"请选择"}}</view> @change="bindDateChange">
<view class="uni-input">{{memInfo.birthday?memInfo.birthday:"请选择"}}</view>
<icon class="iconfont icon-arrow-down-bold"></icon> <icon class="iconfont icon-arrow-down-bold"></icon>
</picker> </picker>
</view> </view>
@ -34,14 +35,16 @@
<view class="lan border-bottom"> <view class="lan border-bottom">
<view class="left">所在年级</view> <view class="left">所在年级</view>
<view class="right"> <view class="right">
<input name="name" type="text" v-model="name" placeholder="请输入所在年级" /> <picker mode="selector" :range="gradeList" :value="index" range-key="name" @change="changegType">
<view class="uni-input">{{gradeList[index]?gradeList[index].name:"请选择"}}</view>
<icon class="iconfont icon-arrow-down-bold"></icon>
</picker>
</view> </view>
</view> </view>
</view> </view>
<view class="btn" @click="confirmInfo">提交</view> <view class="btn" @click="confirmInfo">提交</view>
</view> </view>
</template> </template>
<script> <script>
import { import {
mapState mapState
@ -49,18 +52,24 @@
export default { export default {
data() { data() {
return { return {
isEdit: false,
sexItem: [ sexItem: [
"男", "男",
"女" "女"
], ],
sex: 0, memInfo: {
name: null,
headimg: "",
birthday: "", birthday: "",
gender: 0,
nickname: "",
grade: ""
},
headimg: "",
index: 0,
gradeList: []
}; };
}, },
computed: { computed: {
...mapState(["user"]), ...mapState(["user", "familayList"]),
userInfo() { userInfo() {
return this.user return this.user
}, },
@ -73,47 +82,77 @@
for (var i = 3; i <= 80; i++) { for (var i = 3; i <= 80; i++) {
agedata.push(i); agedata.push(i);
} }
this.name = this.userInfo.nickname ? this.userInfo.nickname : this.userInfo.name if (options.info) {
this.memInfo = JSON.parse(options.info)
this.isEdit = true
}
this.handleGradeList()
}, },
methods: { methods: {
handleGradeList() {
let that = this
that.$model.getGradeList({}).then(res => {
console.log("年级列表", res)
if (res.code != 0) {
that.$tools.msg(res.msg)
return
}
that.gradeList = res.data
}).catch(err => {})
},
// //
confirmInfo() { confirmInfo() {
let that = this let that = this
if (!this.name) { if (!that.memInfo.nickname) {
this.$tools.msg("请输入姓名") that.$tools.msg("请输入姓名")
return; return;
} }
if (!this.sex) { if (!that.memInfo.gender) {
this.$tools.msg("请选择性别") that.$tools.msg("请选择性别")
return; return;
} }
if (!this.birthday) { if (!that.memInfo.birthday) {
this.$tools.msg("请选择出生日期") that.$tools.msg("请选择出生日期")
return; return;
} }
if (!that.memInfo.grade) {
that.$model.getsubmit({ that.$tools.msg("请选择所在年级")
name: this.name, return;
sex: this.sex, }
birthday: this.birthday, let https = that.isEdit ? that.$model.getEditUser(that.memInfo) : that.$model.getAddUser(that.memInfo)
}).then(res => { return https.then(res => {
console.log("成功", res)
if (res.code == 0) { if (res.code == 0) {
that.$tools.msg("提交成功"); that.$tools.msg("提交成功");
uni.reLaunch({ that.$store.dispatch("getFamilyList", {
url: "/pages/index/index" type: 2
}) })
//
if (that.memInfo.id = uni.getStorageSync('userid')) {
that.$store.dispatch("getUserInfo", {
aud_id: uni.getStorageSync('userid')
})
}
uni.navigateBack({
delta: 1
});
} else { } else {
that.$tools.msg(res.message); that.$tools.msg(res.msg);
} }
}); });
}, },
// //
bindDateChange(e) { bindDateChange(e) {
this.birthday = e.target.value this.memInfo.birthday = e.target.value
}, },
// //
onsexArr(e) { onsexArr(e) {
this.sex = this.sexItem[e.target.value] == "男" ? 1 : 2 this.memInfo.gender = this.sexItem[e.target.value] == "男" ? 1 : 2
},
//
changegType(e) {
this.index = e.detail.value
this.memInfo.grade = this.gradeList[e.target.value].id
}, },
handleUpImg() { handleUpImg() {
let that = this let that = this
@ -164,7 +203,7 @@
.headbox { .headbox {
height: 85px; height: 85px;
padding-top: 15px; padding-top: 15px;
border-radius: 0 0 10px 10px; border-radius: 0 0 5px 5px;
background: $maincolor; background: $maincolor;
} }
@ -176,6 +215,7 @@
border-radius: 50%; border-radius: 50%;
font-size: 70px; font-size: 70px;
margin: auto; margin: auto;
color: #fff;
} }
.lan { .lan {

67
pages/login/detail.vue Normal file
View File

@ -0,0 +1,67 @@
<template>
<view class="content">
<view>
<view class="title">{{content.title}}</view>
<view class="time">发布时间{{content.createtime}}</view>
</view>
</view>
</template>
<script>
import {
mapState
} from "vuex";
export default {
data() {
return {
content: "",
url: null
}
},
components: {
},
computed: {
...mapState(["user", "appTheme"]),
},
onLoad(option) { },
methods: {
getOrderDetail(orderno) {
this.$model.GetAdListDetail({
id: orderno
}).then(res => {
if (res.code != 0) return
this.content = res.data
console.log("资讯详情", res)
});
},
preview(src, e) {
// do something
},
navigate(href, e) {
// do something
}
}
}
</script>
<style scoped>
.content {
padding: 30rpx;
}
.title {
width: 100%;
margin-bottom: 15px;
text-align: left;
font-size: 18px;
font-weight: bold;
}
.time {
width: 100%;
text-align: left;
margin-bottom: 15px;
color: #666;
}
</style>

View File

@ -0,0 +1,315 @@
<template>
<view class="content">
<view class="bg"></view>
<view class="login">
<view class="editem">
<view class="item">
<view class="text">手机号/邮箱</view>
<view class="input">
<input v-model="phone" placeholder="" />
</view>
</view>
<view class="item ">
<view class="text">验证码</view>
<view class="input yanzhengma">
<input class="uni-input" v-model="code" />
<button class="code" type="none" @click="handleCode" v-model="code"
:disabled="disabled">{{second<60 ? second+'S后重发':$t("login.sendcode")}}
</button>
</view>
</view>
<view class="item">
<view class="text">密码</view>
<view class="input">
<input class="uni-input" v-model="password" />
</view>
</view>
<view class="item">
<view class="text">确认密码</view>
<view class="input">
<input class="uni-input" v-model="password2" />
</view>
</view>
</view>
<view class="xieyi">
<checkbox-group @change="checkboxChange" class="group">
<label>
<checkbox :value="1" style="transform:scale(0.7)" />{{$t("login.agreement")}}
<text @click="handlexieyi" @click.stop>{{$t("login.agreementContnt")}}</text>
</label>
</checkbox-group>
</view>
<view class="btnlogin" @click="handleTelLogin">确认</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
phone: "",
code: "",
password: "",
password2: "",
disabled: false,
second: 60,
value: 0,
type: ""
}
},
onLoad(options) {
this.type = options.type //1
},
methods: {
checkboxChange(e) {
this.value = e.detail.value.length ? e.detail.value[0] : "0"
},
//
handleTelLogin() {
let that = this
let phoneType = that.phone.indexOf("@") !== -1
console.log("phoneType", phoneType)
if (that.value == 0) {
that.$tools.msg("请先确认勾选协议")
return
}
if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) {
that.$tools.msg("请输入正确的手机号")
return
}
if (phoneType && !(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) {
that.$tools.msg("请输入正确的邮箱")
return
}
if (!that.code) {
that.$tools.msg("请填写验证码")
return
}
if (!that.password) {
that.$tools.msg("请填写密码")
return
}
if (!that.password2) {
that.$tools.msg("请确认密码")
return
}
if (that.password2 != that.password) {
that.$tools.msg("请确认两次密码填写一致")
return
}
let account = {
data: that.phone,
password: that.password,
c_password: that.password2,
code: that.code
}
let https = that.type == 'register' ? that.$model.getregister(account) : that.$model.getResetPassword(
account)
return https.then(res => {
console.log("注册", res)
if (res.code != 0) {
that.$tools.msg(res.msg)
return
}
uni.setStorageSync('token', res.data.token)
uni.setStorageSync('aan_id', res.data.aan_id)
setTimeout(function() {
uni.switchTab({
url: "/pages/index/index"
})
}, 2000)
}).catch(err => {})
},
//
handleCode() {
let that = this
if (!that.phone) {
that.$tools.msg(that.$t("login.phonetip"))
return
}
if (!(/^1[3456789]\d{9}$/.test(that.phone))) {
that.$tools.msg(that.$t("login.phonetipsTwo"))
return
}
//
that.$model.getSendCode({
data: that.phone,
type: that.type
}).then(res => {
console.log(res)
if (res.code != 0) {
that.$tools.msg(res.msg)
return
}
that.disabled = true
let interval = setInterval(() => {
--that.second
}, 1000)
setTimeout(() => {
clearInterval(interval)
that.disabled = false
that.second = 60
}, 60000)
}).catch(err => {})
},
handlexieyi() {
uni.navigateTo({
url: "/pages/index/index"
})
}
}
}
</script>
<style scoped lang="scss">
.content {
width: 100%;
height: 100vh;
// display: flex;
// flex-direction: column;
// align-items: center;
// justify-content: center;
}
.bg {
position: absolute;
top: 0;
width: 100%;
height: 50vh;
z-index: 9;
// background: $maincolor;
}
.login {
width: calc(100% - 30px);
height: auto;
background: #fff;
border-radius: 10px;
padding: 15px;
background-color: #fff;
z-index: 99;
// position: relative;
// margin-left: calc(10% - 40px);
// box-shadow: 0px 1px 5px 2px #dfe2e1fc;
.title {
text-align: left;
color: #333;
font-size: 40rpx;
font-weight: bold;
margin-bottom: 15px;
}
.editem {
position: relative;
display: flex;
align-items: center;
font-size: 28rpx;
justify-content: space-between;
flex-wrap: wrap;
.item {
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 15px;
.text {
width: 80px;
height: 40px;
line-height: 40px;
font-size: 14px;
}
.input {
width: calc(100% - 100px);
height: 35px;
line-height: 35px;
display: flex;
position: relative;
border: #dfdfdf 1px solid;
border-radius: 5px;
padding: 0 10px;
background-color: #f7f7f7;
}
input {
height: 40px;
line-height: 40px;
position: absolute;
left: 10px;
right: 0px;
z-index: 88;
font-size: 14px;
}
.yanzhengma {
input {
right: 120px;
font-size: 28rpx;
}
}
}
.code {
width: 110px;
background: #dfdfdf;
font-size: 12px;
margin: 0;
line-height: 40px;
border-radius: 5px;
text-align: center;
position: absolute;
right: 0px;
top: 0px;
bottom: 0;
z-index: 99;
}
.forget {
width: 80px;
background: #fff;
color: $textcolor;
}
}
.btngroup {
width: 100%;
height: 35px;
line-height: 35px;
display: flex;
justify-content: center;
text {
display: block;
color: $textcolor;
}
}
.btnlogin {
width: 100%;
margin: 15px 0;
height: 42px;
line-height: 42px;
background: $btncolor;
font-weight: 700;
border-radius: 15px;
text-align: center;
color: #fff !important;
}
}
.xieyi {
font-size: 12px;
color: $textcolor;
text {
border-bottom: 1px solid $textcolor;
}
}
</style>

View File

@ -3,14 +3,18 @@
<view class="bg"></view> <view class="bg"></view>
<view class="login box_shadow"> <view class="login box_shadow">
<view class="title">{{$t("login.title")}}</view> <view class="title">{{$t("login.title")}}</view>
<view class="toggle cblue" @click="handleToggle">
<uni-icons class="iconfont icon-qiehuan cblue mr-5"></uni-icons>
</view>
<view class="editem"> <view class="editem">
<view class="item"> <view class="item">
<view class="text">{{$t("login.phone")}}</view> <view class="text">手机号/邮箱</view>
<view class="input"> <view class="input">
<input v-model="phone" placeholder="" /> <input v-model="phone" placeholder="" />
</view> </view>
</view> </view>
<view class="item "> <!-- 验证码登录 -->
<view class="item " v-if="isCode">
<view class="text">{{$t("login.code")}}</view> <view class="text">{{$t("login.code")}}</view>
<view class="input yanzhengma"> <view class="input yanzhengma">
<input class="uni-input" v-model="code" /> <input class="uni-input" v-model="code" />
@ -18,14 +22,16 @@
:disabled="disabled">{{second<60 ? second+'S后重发':$t("login.sendcode")}} :disabled="disabled">{{second<60 ? second+'S后重发':$t("login.sendcode")}}
</button> </button>
</view> </view>
</view>
<!-- 密码登录 -->
<view class="item " v-else>
<view class="text">密码</view>
<view class="input yanzhengma">
<input class="uni-input" v-model="password" />
<text class="forget code" @click="handlePassword('reset_password')">忘记密码</text>
</view> </view>
</view> </view>
<view class="btngroup">
<text>{{$t("login.ForgotPassword")}}</text>
<text>{{$t("login.register")}}</text>
</view> </view>
<view class="btnlogin" @click="handleTelLogin">{{$t("login.btn")}}</view>
<view class="xieyi"> <view class="xieyi">
<checkbox-group @change="checkboxChange" class="group"> <checkbox-group @change="checkboxChange" class="group">
<label> <label>
@ -34,6 +40,10 @@
</label> </label>
</checkbox-group> </checkbox-group>
</view> </view>
<view class="btnlogin" @click="handleTelLogin">{{$t("login.btn")}}</view>
<view class="btngroup" @click="handlePassword('register')">
<text>{{$t("login.register")}}</text>
</view>
</view> </view>
</view> </view>
@ -45,9 +55,11 @@
return { return {
phone: "", phone: "",
code: "", code: "",
password: "",
disabled: false, disabled: false,
second: 60, second: 60,
value: 0, value: 0,
isCode: true,
} }
}, },
methods: { methods: {
@ -57,38 +69,45 @@
// //
handleTelLogin() { handleTelLogin() {
let that = this let that = this
if (this.value == 0) { let phoneType = that.phone.indexOf("@") !== -1
that.$tools.msg(that.$t("login.valtips")) console.log("phoneType", phoneType)
if (that.value == 0) {
that.$tools.msg("请先确认勾选协议")
return return
} }
if (!this.phone) { if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) {
that.$tools.msg(that.$t("login.phonetip")) that.$tools.msg("请输入正确的手机号")
return return
} }
if (!(/^1[3456789]\d{9}$/.test(that.phone))) { if (phoneType && !(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) {
that.$tools.msg(that.$t("login.phonetipsTwo")) that.$tools.msg("请输入正确的邮箱")
return return
} }
if (!that.code) { if (that.isCode && !that.code) {
that.$tools.msg(that.$t("login.codeTips")) that.$tools.msg(that.$t("login.codeTips"))
return return
} }
this.$model.getRegister({ if (!that.isCode && !that.password) {
code: that.code, that.$tools.msg('请输入正确密码')
phone: that.phone, return
sessionId: uni.getStorageSync('sessionid'), }
this.$model.getonlogin({
data: that.phone,
validate_data: that.isCode ? that.code : that.password,
validate_type: that.isCode ? 'code' : 'password'
}).then(res => { }).then(res => {
console.log("data", res.data)
if (res.code != 0) { if (res.code != 0) {
that.$tools.msg(res.message) that.$tools.msg(res.msg)
return return
} }
uni.setStorageSync('token', res.data.token) uni.setStorageSync('token', res.data.token)
uni.setStorageSync('iswxphone', res.data.iswxphone) uni.setStorageSync('aan_id', res.data.aan_id)
uni.setStorageSync('refreshtoken', res.data.refreshtoken) setTimeout(function() {
uni.setStorageSync('sessionid', res.data.sessionid)
uni.reLaunch({ uni.reLaunch({
url: "/pages/index/index" url: "/pages/index/index"
}) })
}, 3000)
}).catch(err => {}) }).catch(err => {})
}, },
// //
@ -104,11 +123,12 @@
} }
// //
that.$model.getSendCode({ that.$model.getSendCode({
phone: that.phone data: that.phone,
type: "login"
}).then(res => { }).then(res => {
console.log(res) console.log(res)
if (res.code != 0) { if (res.code != 0) {
that.$tools.msg(res.message) that.$tools.msg(res.msg)
return return
} }
that.disabled = true that.disabled = true
@ -122,6 +142,15 @@
}, 60000) }, 60000)
}).catch(err => {}) }).catch(err => {})
}, },
handleToggle() {
this.phone = ""
this.isCode = !this.isCode
},
handlePassword(text) {
uni.navigateTo({
url: "/pages/login/forgetPassword?type=" + text
})
},
handlexieyi() { handlexieyi() {
uni.navigateTo({ uni.navigateTo({
url: "/pages/index/index" url: "/pages/index/index"
@ -147,17 +176,18 @@
width: 100%; width: 100%;
height: 50vh; height: 50vh;
z-index: 9; z-index: 9;
background : linear-gradient(to top, #477EFF 40%, #39D9C9); background: $maincolor;
} }
.login { .login {
width: 70%; width: 75%;
height: auto; height: auto;
background: #fff; background: #fff;
border-radius: 10px; border-radius: 10px;
padding: 20px; padding: 10px 15px;
background-color: #fff; background-color: #fff;
z-index: 99; z-index: 99;
position: relative;
margin-left: calc(10% - 40px); margin-left: calc(10% - 40px);
box-shadow: 0px 1px 5px 2px #dfe2e1fc; box-shadow: 0px 1px 5px 2px #dfe2e1fc;
@ -169,6 +199,12 @@
margin-bottom: 15px; margin-bottom: 15px;
} }
.toggle {
position: absolute;
right: 15px;
top: 20px;
}
.editem { .editem {
position: relative; position: relative;
display: flex; display: flex;
@ -184,22 +220,22 @@
.text { .text {
font-size: 14px; font-size: 14px;
margin-bottom: 15px; margin-bottom: 10px;
} }
.input { .input {
height: 40px; height: 35px;
line-height: 40px; line-height: 35px;
display: flex; display: flex;
position: relative; position: relative;
border: #dfdfdf 1px solid; border: #dfdfdf 1px solid;
border-radius: 10px;
padding: 0 10px; padding: 0 10px;
border-radius: 5px;
} }
input { input {
height: 45px; height: 40px;
line-height: 45px; line-height: 40px;
position: absolute; position: absolute;
left: 10px; left: 10px;
right: 0px; right: 0px;
@ -220,7 +256,7 @@
background: #dfdfdf; background: #dfdfdf;
font-size: 12px; font-size: 12px;
margin: 0; margin: 0;
line-height: 45px; line-height: 40px;
border-radius: 5px; border-radius: 5px;
text-align: center; text-align: center;
position: absolute; position: absolute;
@ -229,6 +265,12 @@
bottom: 0; bottom: 0;
z-index: 99; z-index: 99;
} }
.forget {
width: 80px;
background: #fff;
color: $textcolor;
}
} }
.btngroup { .btngroup {
@ -236,7 +278,7 @@
height: 35px; height: 35px;
line-height: 35px; line-height: 35px;
display: flex; display: flex;
justify-content: space-between; justify-content: center;
text { text {
display: block; display: block;
@ -258,8 +300,7 @@
} }
.xieyi { .xieyi {
font-size: 14px; font-size: 12px;
margin-top: 15px;
color: $textcolor; color: $textcolor;
text { text {

22
pages/login/register.vue Normal file
View File

@ -0,0 +1,22 @@
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
methods: {
}
}
</script>
<style>
</style>

168
pages/me/manage.vue Normal file
View File

@ -0,0 +1,168 @@
<template>
<view class="common">
<view class="add" @click="handleAddUser">
<icon class="iconfont icon-tianjia"></icon>添加成员
</view>
<view class="box" v-if="familayList.lenght!=0">
<view class="list" v-for="(item ,index) in familayList" :key="index">
<view class="left">
<image :src="item.head_pic" class="image1" />
<view class="name">
<view class="title">
{{item.nickname}}
</view>
<view class="title2">
<text>{{item.gender==1?'男':'女'}}</text>
<text>{{item.birthday}}</text>
</view>
</view>
</view>
<view class="right">
<view class="edit" @click="editorInfo(item)">编辑</view>
<view class="edit del" @click="handleDeldet(item.id,index)">删除</view>
</view>
</view>
</view>
<view v-else>
没有数据了
</view>
</view>
</template>
<script>
import {
mapState
} from "vuex";
export default {
data() {
return {
visible: false,
ranklist: [],
}
},
computed: {
...mapState(["familayList", "user"])
},
onLoad() {},
methods: {
//
handleDeldet(id, ind) {
let that = this
uni.showModal({
title: '友情提示',
content: '确定删除该成员吗',
success: function(res) {
if (res.confirm) {
that.$model.getDelUser({
id: id,
}).then(res => {
if (res.code != 0) return
that.$tools.msg("删除成功!");
that.familayList.splice(ind, 1)
that.$store.commit('changeFamilay', that.familayList)
})
} else if (res.cancel) {
that.$tools.msg("您已取消删除!");
}
}
});
},
//
editorInfo(item) {
uni.navigateTo({
url: "/pages/index/userInfo?info=" + JSON.stringify(item)
})
},
//
handleAddUser() {
uni.navigateTo({
url: "/pages/index/userInfo"
})
},
}
}
</script>
<style scoped="scoped" lang="scss">
.common {
padding: 15px;
background-color: #f7f7f7;
min-height: calc(100vh - 30px);
}
.add {
width: 100%;
height: 30px;
line-height: 30px;
font-size: 14px;
margin-bottom: 10px;
color: #fff;
border-radius: 15px;
display: flex;
justify-content: center;
background: $btncolor;
}
.list {
width: auto;
background: #fff;
display: flex;
border-radius: 10px;
margin-bottom: 15px;
padding: 5px 15px;
font-size: 14px;
align-items: center;
justify-content: space-between;
.image1 {
width: 55px;
height: 55px;
border-radius: 50%;
margin-right: 15px;
}
}
.left {
width: 75%;
display: flex;
align-items: center;
.title {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.title2 {
margin-top: 10px;
font-size: 12px;
color: #999;
text {
margin-right: 10px;
}
}
}
.right {
width: 25%;
float: right;
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
.edit {
width: 50px;
padding: 5px 0;
border-radius: 5px;
color: $textcolor;
text-align: center;
}
.del {
color: $btncolor;
margin-top: 5px
}
}
</style>

127
pages/me/me.vue Normal file
View File

@ -0,0 +1,127 @@
<template>
<view class="content">
<!-- 头部 -->
<headerIndex :isArea="false" :isLeft="false"></headerIndex>
<!-- -->
<view class="wxlist borderRadius">
<view class="list" @click="navTo('/pages/me/manage')">
<view class="item border-bottom">
<view class="left">
<view class="name">用户管理</view>
</view>
<view class="right">
<uni-icons type="right"></uni-icons>
</view>
</view>
</view>
<!-- <view class="list" @click="navTo('/pages/card/card')">
<view class="item border-bottom">
<view class="left">
<view class="name">卡片管理</view>
</view>
<view class="right">
<uni-icons type="right"></uni-icons>
</view>
</view>
</view> -->
<view class="list" @click="navTo('/pages/score/history')">
<view class="item border-bottom">
<view class="left">
<view class="name">估分历史</view>
</view>
<view class="right">
<uni-icons type="right"></uni-icons>
</view>
</view>
</view>
<view class="list" @click="navTo('/pages/login/forgetPassword')">
<view class="item border-bottom">
<view class="left">
<view class="name">重置密码</view>
</view>
<view class="right">
<uni-icons type="right"></uni-icons>
</view>
</view>
</view>
</view>
<view class="btn mb-15" v-if="token" @click="handleOutLogin">退出登录</view>
</view>
</template>
<script>
import headerIndex from "@/components/headerIndex.vue"
export default {
data() {
return {
token: ""
}
},
components: {
headerIndex
},
onLoad() {
this.token = uni.getStorageSync('token')
},
methods: {
handleOutLogin() {
let that = this
uni.showModal({
title: '友情提示',
content: '是否退出登录?',
success: function(res) {
if (res.confirm) {
that.$model.getloginOut({}).then((res) => {
if (res.code != 0) return
console.log('确定退出', res)
uni.clearStorageSync()
uni.reLaunch({
url: "/pages/login/login"
})
})
} else if (res.cancel) {
that.$tools.msg("您已取消操作!");
}
},
})
},
navTo(url) {
uni.navigateTo({
url
})
},
}
}
</script>
<style scoped lang="scss">
.wxlist {
height: auto;
overflow: hidden;
position: relative;
margin: 0 15px;
background: #fff;
border-radius: 10px;
.item {
width: auto;
font-size: 14px;
line-height: 45px;
height: 45px;
display: flex;
justify-content: space-between;
align-items: center;
.left {
display: flex;
align-items: center;
}
}
}
.btn {
width: auto;
background: $btncolor;
margin: 50px 15px 0 15px;
}
</style>

191
pages/score/history.vue Normal file
View File

@ -0,0 +1,191 @@
<template>
<view class="common">
<view class="history">
<view class="list" v-for="(item, index) in ranklist" :key="index" @click="clickItemMethod(item)">
<view class="item">
<view class="time">
<icon class="t-icon t-icon-shijian-mianxing-0"></icon>
{{item.createtime}}
</view>
<view class="number">
75
<uni-icons type="right"></uni-icons>
</view>
</view>
</view>
<view class="endtext" v-if="!lastPage || page >= lastPage"> 到底了看看别的吧 </view>
</view>
<view class="nolist" v-if="!lastPage">
<uni-icons class="iconfont icon-zanwu1"></uni-icons>
</view>
</view>
</template>
<script>
import {
mapState
} from "vuex";
export default {
computed: {
...mapState(['user', "appTheme"]),
},
data() {
return {
options: [{
text: '取消',
style: {
backgroundColor: '#007aff'
}
}, {
text: '确认',
style: {
backgroundColor: '#dd524d'
}
}],
list: [
"测量时间",
"体重",
"BMI",
"操作",
],
ranklist: [],
page: 1,
lastPage: 1,
type: null,
id: null,
}
},
mounted() {
let that = this
let list = this.$json.historylist
let options = [{
text: '删除',
style: {
backgroundColor: '#dd524d'
}
}]
list.forEach(item => {
item.options = options
})
this.ranklist = this.ranklist.concat(list)
},
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(this.page)
},
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.gethistorydelete({
id: id,
}).then((res) => {
if (res.code != 0) {
that.$tools.msg(res.msg)
return
}
that.ranklist.splice(index, 1)
that.$store.dispatch("getUserInfo", {
familyid: that.user.familyid,
})
that.$store.dispatch("getResult", {
birthday: that.user.birthday,
familyid: that.user.familyid,
height: that.user.height,
sex: that.user.sex,
})
that.$tools.msg("删除成功")
})
} else if (res.cancel) {
that.$tools.msg("您已取消操作!");
}
},
})
},
clickItemMethod(item) {
uni.navigateTo({
url: "/pages/score/report?id=" + JSON.stringify(item.id)
})
},
getList(page) {
let that = this
that.$model.getHistoryList({
familyId: that.user.familyid,
pageNo: page,
pageSize: 10
}).then((res) => {
console.log("历史记录", res)
if (res.code != 0) return
res.data.rows.forEach(item => {
item.slide_x = 0
})
this.ranklist = this.ranklist.concat(res.data.rows)
this.lastPage = res.data.totalpage
})
},
}
}
</script>
<style scoped="scoped" lang="scss">
.common {
width: 100%;
min-height: 100.5vh; //
overflow-y: scroll;
background-color: #f7f7f7;
}
.history {
width: calc(100% - 30px);
height: auto;
margin: 15px 15px 0;
padding-bottom: 40px;
.list {
width: 100%;
background: #fff;
border-radius: 10px;
margin-bottom: 12px;
.item {
width: calc(100% - 20px);
display: flex;
justify-content: space-between;
font-weight: 700;
line-height: 50rpx;
padding: 10px;
font-size: 18px !important;
}
.time {
font-size: 28rpx;
color: #666;
width: 70%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
icon {
width: 40rpx;
height: 40rpx;
margin-right: 8px;
}
}
}
}
</style>

166
pages/score/report.vue Normal file
View File

@ -0,0 +1,166 @@
<template>
<view class="content">
<!-- 估分 -->
<view class="box">
<view class="title bold">本次估分成绩为</view>
<view class="charts">
<qiun-data-charts type="arcbar" :opts="opts" :chartData="chartData" />
</view>
<view class="time text_c">2024年5月10日14:01:38</view>
</view>
<!-- -->
<view class="indexCarList">
<view v-for="(ite,ind) in selectllist">
<!-- 大标签 -->
<view class="card box">
<view class="title border-bottom" @click="handleHistory(ite.key)">
<view class="name"><text>{{ite.name}}</text></view>
<view>小计得分<text class="cblue">85</text></view>
</view>
<!-- 身体数据 -->
<view class="item title" v-if="ite.name=='身体数据'">
<view>
<text>身高</text>
<view class="weight"><text>176</text>cm</view>
<view class="standardBtn">标准</view>
</view>
<view>
<text>体重</text>
<view class="weight"><text>76</text>kg</view>
<view class="standardBtn">标准</view>
</view>
<view>
<text>BMI</text>
<view class="weight"><text>26</text></view>
<view class="standardBtn">标准</view>
</view>
</view>
<!-- 其他数据 -->
<view class="item title" style="justifyContent:center" v-else>
<view class="item2">
<text class="name">本次数据</text>
<view class="weight"><text>{{ite.cnt?ite.cnt:'-'}}</text>{{ite.unit}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue';
export default {
data() {
return {
opts: {
title: {
name: "75",
fontSize: 35,
color: "#4687F9"
},
},
chartData: {
series: [{
name: "正确率",
color: "#4687F9",
data: 0.75
}]
},
rtype: "",
}
},
components: {
qiunDataCharts
},
onLoad() {
this.selectllist = this.$json.selectllist
},
methods: {
//
handlerRecord(name) {
this.rtype = name
this.$store.commit('changeRecord', true)
},
//
handleHistory(key) {
console.log("1111", key)
uni.navigateTo({
url: "/pages/history/history?type=edit&key=" + key
})
},
navTo(url) {
uni.navigateTo({
url: url
})
},
}
}
</script>
<style scoped lang="scss">
.content {
min-height: 100vh;
padding-bottom: 15px;
background-color: #f7f7f7;
}
.box {
margin: 0 10px 0;
padding: 15px 10px 10px;
background-color: #fff;
width: calc(100% - 40px);
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
border-radius: 10px;
position: relative;
}
.btn {
width: auto;
color: #fff;
padding: 2px 10px;
border-radius: 10px;
margin: 0 auto;
background: $maincolor;
}
.zhan {
position: absolute;
right: 10px;
top: 10px;
color: #fff;
padding: 10px;
border-radius: 10px;
background: $maincolor;
}
.item {
padding-bottom: 0 !important;
position: relative;
.iconfont {
position: absolute;
bottom: 15px;
right: 15px;
font-size: 22px;
color: $btncolor;
}
}
.charts {
width: 100%;
height: 150px;
margin: 15px 0;
}
.gfbtn {
width: calc(100% - 40px);
margin-top: 20px;
margin-bottom: 20px;
}
</style>

256
pages/score/score.vue Normal file
View File

@ -0,0 +1,256 @@
<template>
<view class="content">
<!-- 头部 -->
<headerIndex></headerIndex>
<!-- 估分 -->
<view class="box">
<view class="charts">
<qiun-data-charts type="arcbar" :opts="opts" :chartData="chartData" />
</view>
<view class="groupBtn">
<view class="btn" @click="navTo('/pages/score/history')">估分历史</view>
<view class="btn" @click="$store.commit('changeSlider',true)">分数占比</view>
</view>
</view>
<!-- -->
<view class="indexCarList">
<view v-for="(ite,ind) in selectllist">
<!-- 大标签 -->
<view class="card box">
<view class="title border-bottom">
<view class="name" @click="handleEdit(ind)">
<view class="text">{{ite.name}}</view>
</view>
<view class="right">
<uni-icons type="plus" size="22" @click="handleHistory(ite.key)"></uni-icons>
</view>
</view>
<!-- 身体数据 -->
<view class="item title item1" v-if="ite.name=='身体数据'">
<view class="ite">
<view class="mb-10">
身高(cm)
</view>
<view class="weight">
<text v-if="ite.disabled">{{ite.height?ite.height:0}}</text>
<input v-else type="digit" v-model="ite.height" confirm-type="done"
@blur="handleBlur($event,ind)" />
</view>
</view>
<view class="ite">
<view class="mb-10">
体重(kg)
</view>
<view class="weight">
<text v-if="ite.disabled">{{ite.Weight?ite.Weight:0}}</text>
<input v-else type="digit" v-model="ite.Weight" confirm-type="done"
@blur="handleBlur($event,ind)" />
</view>
</view>
<view class="ite">
<view class="mb-10">BMI</view>
<view class="weight">
<text v-if="ite.disabled">{{ite.BMI?ite.BMI:0}}</text>
<input v-else type="digit" v-model="ite.BMI" confirm-type="done"
@blur="handleBlur($event,ind)" />
<uni-icons class="iconfont icon-bianji" color="#FEC407"
@click="handleEdit(ind)"></uni-icons>
</view>
</view>
</view>
<!-- 其他数据 -->
<view class="item title" style="justifyContent:center" v-else>
<view class="item2">
<view class="name">本次数据({{ite.unit}})</view>
<view class="weight">
<text v-if="ite.disabled">{{ite.cnt?ite.cnt:0}}</text>
<input v-else type="digit" v-model="ite.cnt" confirm-type="done"
@blur="handleBlur($event,ind)" placeholder="请输入" />
<uni-icons class="iconfont icon-bianji" color="#FEC407"
@click="handleEdit(ind)"></uni-icons>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="gfbtn btn">开始估分</view>
<!-- 占比 -->
<record :rtype='rtype'></record>
<uslider></uslider>
</view>
</template>
<script>
import uslider from "@/components/slider-fraction.vue";
import headerIndex from "@/components/headerIndex.vue";
import record from '@/components/manuallyAdd/record.vue';
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue';
import {
nextTick
} from "vue";
export default {
data() {
return {
opts: {
title: {
name: "75",
fontSize: 35,
color: "#4687F9"
},
},
chartData: {
series: [{
name: "正确率",
color: "#4687F9",
data: 0.75
}]
},
rtype: "",
isRefresh: true,
}
},
components: {
uslider,
record,
headerIndex,
qiunDataCharts
},
onLoad() {
this.selectllist = this.$json.selectllist
},
methods: {
//
handlerRecord(name) {
this.rtype = name
this.$store.commit('changeRecord', true)
},
//
handleHistory(key) {
console.log("1111", key)
uni.navigateTo({
url: "/pages/history/history?type=edit&key=" + key
})
},
//
handleBlur(value, ind) {
let that = this
that.selectllist[ind].disabled = true
this.$forceUpdate()
},
//
handleEdit(ind) {
let that = this
that.selectllist[ind].disabled = false
this.$forceUpdate()
},
navTo(url) {
uni.navigateTo({
url: url
})
},
}
}
</script>
<style scoped lang="scss">
.content {
min-height: 100vh;
padding-bottom: 15px;
background-color: #f7f7f7;
}
.box {
margin: 15px 10px 0;
padding: 15px 10px 10px;
background-color: #fff;
width: calc(100% - 40px);
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
border-radius: 10px;
position: relative;
.groupBtn {
width: 100%;
}
}
.btn {
width: auto;
color: #fff;
padding: 2px 10px;
border-radius: 10px;
margin: 0 auto;
background: $maincolor;
}
.item {
padding-bottom: 0 !important;
position: relative;
.weight {
width: 40%;
display: flex;
justify-content: center;
align-items: center;
/deep/input {
width: 100%;
margin-right: 10px;
text-align: center;
font-weight: bold;
font-size: 22px;
border-bottom: 1px solid #dfdfdf;
}
}
.iconfont {
position: absolute;
bottom: 0px;
right: 0px;
color: $btncolor;
}
}
.ite {
width: 33% !important;
text-align: center;
.weight {
width: 100% !important;
}
}
.name {
width: 50%;
display: flex;
justify-content: left;
align-items: center;
.text {
font-size: 18px;
font-weight: bold;
margin-right: 10px;
color: #333;
}
}
.right {
width: 50%;
text-align: right;
}
.charts {
width: 100%;
height: 150px;
}
.gfbtn {
width: calc(100% - 40px);
margin-top: 20px;
}
</style>

104
pages/skip/charts.vue Normal file
View File

@ -0,0 +1,104 @@
<template>
<view class="TrendPage">
<view class="listC">
<view @click="handleActive(1)" :class="[active==1?'active':'']">当天</view>
<view @click="handleActive(2)" :class="[active==2?'active':'']">月度</view>
<view @click="handleActive(3)" :class="[active==3?'active':'']">年度</view>
</view>
<view class="box">
<!-- 时间选择 -->
<view class="boxTime">
<picker mode="date" class="f-l" :value="startDate" @change="handStartTimeH"
:fields="active==1?'day':active==2?'month':'year'">
<view class="uni-input">{{time}}<uni-icons type="bottom"></uni-icons></view>
</picker>
</view>
<!-- 曲线图 -->
<view class="boxLine">
<view class="line" v-for="(item,index) in weightList">
<view v-if="item.line.categories.length">
<qiunDataCharts type="column" :chartData="item.line" :canvas2d="true" :canvasId="item.id"
:cHeight="480" :cWidth="680" :animation="false"
:opts="{enableScroll:true,xAxis:{scrollShow:false,itemCount:3}}" :ontouch="true" />
</view>
<view class="line" v-else>
<view class="nolist">
<image src="@/static/none.png"></image>
<text>暂无数据请手动添加~</text>
</view>
</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(["user"]),
userInfo: function() {
return this.user
},
startDate() {
return this.$tools.getDate("start")
},
},
onLoad() {
let that = this
this.active = 1
this.time = this.startDate
that.getList()
},
methods: {
getList() {
let that = this
that.$model.getSkipTrendList({
aud_id: uni.getStorageSync('userid'),
time: that.time,
}).then(res => {
console.log("跳绳曲线", res.data)
that.weightList = res.data
})
},
handleActive(ite) {
let that = this
that.handTrue = false
that.time = ite == 1 ? this.startDate : ite == 2 ? this.$tools.getDate("month") : this.$tools.getDate(
"year")
that.getList()
that.$nextTick(function() {
that.handTrue = true
})
that.active = ite
},
handStartTimeH(e) {
let that = this
that.time = e.target.value
that.getList()
},
navTo(url) {
uni.navigateTo({
url: url
})
}
},
data() {
return {
weightList: [],
handTrue: true,
active: 1,
time: "",
};
}
}
</script>
<style lang="scss" scoped>
</style>

258
pages/skip/skip.vue Normal file
View File

@ -0,0 +1,258 @@
<template>
<view class="content skipping">
<!-- -->
<view class="skiptop">
<!-- <view class="status"><text>设备连接</text></view> -->
<view class="item">
<view class="item-ite">今日个数<text>{{info?info.today_jump_num:'--'}}</text></view>
<view class="item-ite">今日时长<text>{{info?info.today_jump_time:'--'}}</text></view>
<view class="item-ite">卡路里/kcal<text>{{info?info.today_jump_kcal:'--'}}</text></view>
</view>
</view>
<!-- -->
<!-- <view class="tabbar">
<view @click="active=1" :class="[active==1?'active':'']">自由训练</view>
<view @click="active=2" :class="[active==2?'active':'']">定时训练</view>
<view @click="active=3" :class="[active==3?'active':'']">定数训练</view>
</view> -->
<!--自由训练 -->
<view class="box1 box" v-if="active==1">
<view class="time">{{info?info.last_record_time:'--'}}</view>
<view class="item">
<text class="item-ite">个数</text>
<text class="bold">{{info?info.last_jump_num:'--'}}</text>
</view>
<view class="item">
<text class="item-ite">本次时长</text>
<text class="bold">{{info?info.last_jump_time:'--'}}</text>
</view>
<view class="item">
<text class="item-ite">消耗卡路里</text>
<text class="bold">{{info?info.last_jump_kcal:'--'}}</text>
</view>
</view>
<!--定时训练 -->
<view class="box1 box" v-if="active==2">
<view class="time">2024/03/25</view>
<view class="item">
<view class="item-set">
<picker mode="multiSelector" :range="timeList" :value="timesTndex" @change="bindTimeChange">
<view class="size26">{{timeList[0][timesTndex[0]]}}{{timeList[1][timesTndex[1]]}}</view>
</picker>
<uni-icons class="iconfont icon-bianji" color="#FEC407" size="20"></uni-icons>
</view>
<text class="tips">调整目标</text>
</view>
<view class="item">
<text class="item-ite">本次个数</text>
<text>--</text>
</view>
<view class="item">
<text class="item-ite">消耗卡路里</text>
<text>--</text>
</view>
</view>
<!--定数训练 -->
<view class="box1 box" v-if="active==3">
<view class="time">2024/03/25</view>
<view class="item">
<view class="item-set">
<input type="digit" v-model='weight' confirm-type="done" @blur="handleBlur" />
<uni-icons class="iconfont icon-bianji" color="#FEC407" size="20"></uni-icons>
</view>
<text class="tips">调整目标</text>
</view>
<view class="item">
<text class="item-ite">本次时长</text>
<text>--</text>
</view>
<view class="item">
<text class="item-ite">消耗卡路里</text>
<text>--</text>
</view>
</view>
<!-- -->
<view class="gridList">
<view class="data">
<view class="item" @click="navTo('/pages/skip/charts')">
<view class="image">
<image src="../../static/charts.png"></image>
</view>
<view class="name">运动曲线</view>
</view>
<view class="item" @click="navTo('/pages/history/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/compk/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 '@/components/manuallyAdd/record.vue';
export default {
data() {
return {
active: 1,
acd_id: 6,
isEdit: false,
weight: 500,
timeList: [],
timesTndex: [0, 0]
}
},
components: {
record
},
computed: {
...mapState(["MeasureSkip"]),
info() {
return this.MeasureSkip
}
},
onLoad(options) {
let that = this
that.acd_id = options.acd_id
},
onShow() {
let that = this
that.$store.dispatch("getSkipResult", {
aud_id: uni.getStorageSync('userid')
})
},
mounted() {
this.timeList = this.$tools.gethms()
},
methods: {
bindTimeChange(e) {
console.log("picker携带值", e.target.vaule)
this.timesTndex = e.target.vaule
},
navTo(url) {
uni.navigateTo({
url: url
})
},
}
}
</script>
<style lang="scss" scoped>
.content {
width: 100%;
padding-top: 15px;
min-height: 100vh;
background-color: #F5F6FA;
}
.tabbar {
width: 100%;
margin-top: 20px;
margin-bottom: 20px;
display: flex;
align-items: center;
justify-content: space-around;
view {
position: relative;
}
.active:after {
content: "";
height: 3px;
width: 100%;
position: absolute;
bottom: -8px;
left: 0;
border-radius: 5px;
background: $maincolor;
}
}
.box1 {
background-color: #fff;
padding: 10px !important;
color: #999;
margin: 15px;
border-radius: 10px;
width: calc(100%- 30px);
.time {
width: 100%;
font-size: 14px;
margin-bottom: 20px;
}
.item {
width: 100%;
color: #333;
font-size: 22px;
text-align: center;
margin-bottom: 30px;
text {
display: block;
}
.item-ite {
font-size: 16px;
margin-bottom: 5px;
width: 100%;
}
.item-set {
width: 50%;
display: flex;
align-items: center;
height: 45px;
line-height: 45px;
font-size: 30px;
margin-bottom: 5px;
background-color: #f7f7f7;
justify-content: center;
margin: auto;
position: relative;
/deep/input {
font-size: 30px;
height: 45px;
line-height: 45px;
}
.uni-icons {
position: absolute;
right: 5px;
bottom: -5px;
}
}
.tips {
font-size: 12px;
color: #999;
margin-top: 10px;
}
}
}
</style>

View File

@ -1,163 +0,0 @@
<template>
<view class="content">
<!-- -->
<view class="top">
<view class="status"><text>设备连接</text></view>
<view class="item">
<view class="item-ite">今日个数<text>--</text></view>
<view class="item-ite">今日时长<text>--</text></view>
<view class="item-ite">卡路里/kcal<text>--</text></view>
</view>
</view>
<!-- -->
<view class="tabbar">
<view @click="active=1" :class="[active==1?'active':'']">自由训练</view>
<view @click="active=2" :class="[active==2?'active':'']">定时训练</view>
<view @click="active=3" :class="[active==3?'active':'']">定数训练</view>
</view>
<!-- -->
<view class="box"></view>
<!-- -->
<view class="box">
<view class="data">
<view class="item" @click="navTo('/pages/charts/charts?type=t')">
<view class="val"></view>
<view class="name">运动曲线</view>
</view>
<view class="item" @click="navTo('/pages/history/history?type=t')">
<view class="val"></view>
<view class="name">历史记录</view>
</view>
<view class="item" @click="navTo('/pages/compk/contrast?type=t')">
<view class="val"></view>
<view class="name">数据对比</view>
</view>
<view class="item" @click="navTo('/pages/compk/contrast')">
<view class="val"></view>
<view class="name">添加记录</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
active: 1
}
},
methods: {
navTo(url) {
uni.navigateTo({
url: url
})
}
}
}
</script>
<style lang="scss" scoped>
.content {
width: 100%;
min-height: 100vh;
background-color: #F5F6FA;
}
.top {
background: $maincolor;
border-radius: 10px;
margin: 10px 15px;
font-size: 14px;
padding: 15px 10px;
color: #fff;
.status {
margin-bottom: 25px;
text {
width: auto;
color: #333;
background-color: #fff;
border-radius: 15px;
padding: 5px 10px;
}
}
.item {
display: flex;
justify-content: space-between;
text {
display: block;
width: 100%;
text-align: center;
margin-top: 15px;
}
}
}
.tabbar {
width: 100%;
margin: 15px 0;
display: flex;
align-items: center;
justify-content: space-around;
view {
position: relative;
}
.active:after {
content: "";
height: 3px;
width: 100%;
position: absolute;
bottom: -8px;
left: 0;
border-radius: 5px;
background: $maincolor;
}
}
.box {
padding: 0;
display: flex;
flex-wrap: wrap;
border-radius: 10px;
margin: 15px;
width: calc(100%- 30px);
justify-content: space-between;
.data {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
margin-top: 20px;
width: 100%;
.item {
width: 47.5%;
font-size: 14px;
background: #fff;
padding: 10px 0;
border-radius: 15px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 15px;
}
.val {
width: 40px;
height: 40px;
border-radius: 50%;
margin-right: 10px;
background-color: #F5F6FA;
}
}
}
</style>

View File

@ -0,0 +1,104 @@
<template>
<view class="TrendPage">
<view class="listC">
<view @click="handleActive(1)" :class="[active==1?'active':'']">当天</view>
<view @click="handleActive(2)" :class="[active==2?'active':'']">月度</view>
<view @click="handleActive(3)" :class="[active==3?'active':'']">年度</view>
</view>
<view class="box">
<!-- 时间选择 -->
<view class="boxTime">
<picker mode="date" class="f-l" :value="startDate" @change="handStartTimeH"
:fields="active==1?'day':active==2?'month':'year'">
<view class="uni-input">{{time}}<uni-icons type="bottom"></uni-icons></view>
</picker>
</view>
<!-- 曲线图 -->
<view class="boxLine">
<view class="line" v-for="(item,index) in weightList">
<view v-if="item.line.categories.length">
<qiunDataCharts type="column" :chartData="item.line" :canvas2d="true" :canvasId="item.id"
:cHeight="480" :cWidth="680" :animation="false"
:opts="{enableScroll:true,xAxis:{scrollShow:false,itemCount:3}}" :ontouch="true" />
</view>
<view class="line" v-else>
<view class="nolist">
<image src="@/static/none.png"></image>
<text>暂无数据请手动添加~</text>
</view>
</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(["user"]),
userInfo: function() {
return this.user
},
startDate() {
return this.$tools.getDate("start")
},
},
onLoad() {
let that = this
this.active = 1
this.time = this.startDate
that.getList()
},
methods: {
getList() {
let that = this
that.$model.getLungTrendList({
aud_id: uni.getStorageSync('userid'),
time: that.time,
}).then(res => {
console.log("肺活量曲线", res.data)
that.weightList = res.data
})
},
handleActive(ite) {
let that = this
that.handTrue = false
that.time = ite == 1 ? this.startDate : ite == 2 ? this.$tools.getDate("month") : this.$tools.getDate(
"year")
that.getList()
that.$nextTick(function() {
that.handTrue = true
})
that.active = ite
},
handStartTimeH(e) {
let that = this
that.time = e.target.value
that.getList()
},
navTo(url) {
uni.navigateTo({
url: url
})
}
},
data() {
return {
weightList: [],
handTrue: true,
active: 1,
time: "",
};
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,284 @@
<template>
<view class="content">
<!-- -->
<view class="skiptop">
<!-- <view class="status"><text>设备连接</text></view> -->
<view class="item">
<view class="item-ite">平均吸气肺活量<text>{{info?info.average:'--'}}</text></view>
<view class="item-ite">吸气速度<text>--</text></view>
<view class="item-ite">是否达标<text>{{info?info.level:'--'}}</text></view>
</view>
</view>
<!--自由训练 -->
<view class="box1" v-if="info">
<view class="time">{{info?info.time:'--'}}</view>
<view class="item">
<view class="image">
<image src="../../static/bae.png" mode="widthFix"></image>
</view>
<view class="center">
<view class="level"></view>
<view class="level level-bg" :style="{'top':Number(100 - info.offset)+'%'}"></view>
<view class="level-item">
<view class="ite" v-for="(ite,ind) in info.list">{{ite}}</view>
</view>
</view>
</view>
<view class="val">
<text>{{info.average}}</text>
吸气肺活量平均值
</view>
</view>
<view class="nolist" v-else>
<image src="@/static/none.png"></image>
<text>暂无数据请手动添加~</text>
</view>
<!-- -->
<view class="gridList">
<view class="data">
<view class="item" @click="navTo('/pages/vitalcapacity/charts')">
<view class="image">
<image src="../../static/charts.png"></image>
</view>
<view class="name">运动曲线</view>
</view>
<view class="item" @click="navTo('/pages/history/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/compk/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 '@/components/manuallyAdd/record.vue';
export default {
data() {
return {}
},
components: {
record
},
computed: {
...mapState(["MeasureLung"]),
info() {
console.log("11111",this.MeasureLung)
return this.MeasureLung
}
},
onLoad(options) {
let that = this
that.acd_id = options.acd_id
},
onShow() {
let that = this
that.$store.dispatch("getLungResult", {
aud_id: uni.getStorageSync('userid')
})
},
methods: {
navTo(url) {
uni.navigateTo({
url: url
})
},
}
}
</script>
<style lang="scss" scoped>
.content {
width: 100%;
padding-top: 10px;
min-height: 100vh;
background-color: #000;
}
.top {
background: $maincolor;
border-radius: 10px;
margin: 0 15px 10px;
font-size: 14px;
padding: 15px 10px;
color: #fff;
.status {
margin-bottom: 25px;
text {
width: auto;
color: #333;
background-color: #fff;
border-radius: 15px;
padding: 5px 10px;
}
}
.item {
display: flex;
justify-content: space-between;
text {
display: block;
width: 100%;
text-align: center;
margin-top: 15px;
}
}
}
.box1 {
color: #fff;
margin: 15px;
width: calc(100%- 30px);
.time {
width: 100%;
font-size: 14px;
margin-bottom: 20px;
}
.item {
width: 100%;
font-size: 14px;
padding: 10px 0;
border-radius: 15px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 15px;
position: relative;
.image {
width: 80%;
image {
width: 100%;
}
}
.center {
top: -10px;
bottom: 20px;
position: absolute;
width: 55px;
margin: auto;
text-align: center;
background-color: #333;
border-radius: 10px;
z-index: 9;
}
.level-bg {
position: absolute;
width: 55px;
margin: auto;
text-align: center;
background-color: #4d6c7b;
border-radius: 0 0 10px 10px;
bottom: 0px;
z-index: 19;
}
.level-item {
width: 55px;
height: 100%;
position: absolute;
z-index: 99;
:last-child {
border-bottom: none;
}
}
.ite {
margin: 0 5px;
width: calc(100% - 10px);
height: 40px;
line-height: 40px;
font-size: 12px;
color: #fff;
z-index: 99;
border-bottom: 1px solid #999;
}
}
.val {
width: 100%;
text-align: center;
margin: 20px 0;
color: #fff;
font-size: 14px;
text {
display: block;
color: #39D9C9 !important;
font-size: 32px;
margin-bottom: 10px;
}
}
}
.box {
padding: 0;
display: flex;
flex-wrap: wrap;
border-radius: 10px;
margin: 15px;
width: calc(100%- 30px);
justify-content: space-between;
.data {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
width: 100%;
}
.item {
width: 47.5%;
font-size: 14px;
background: #fff;
padding: 10px 0;
border-radius: 15px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 15px;
}
.val {
width: 40px;
height: 40px;
border-radius: 50%;
image {
width: 70%;
height: 70%;
}
}
}
</style>

View File

@ -1,486 +0,0 @@
<template>
<view class="TrendPage">
<!-- 时间选择 -->
<view class="boxTime">
<view class="one">
<picker mode="date" class="f-l" :value="startTime?startTime:startDate" @change="handStartTimeH">
<view class="uni-input">{{startTime?startTime:startDate}}
<uni-icons type="down"></uni-icons>
</view>
</picker>
<view>~</view>
<picker mode="date" :end="endDate" class="f-r" :value="endDate" @change="handEndTimeH">
<view class="uni-input"> {{endTime?endTime:endDate}}
<uni-icons type="down"></uni-icons>
</view>
</picker>
</view>
</view>
<!-- 曲线图 -->
<view class="box">
<view class="listC">
<view :class="{active:index==active1}" class="name" v-for="(item,index) in weightList" :key="index"
@click="showbox(index)">
{{item.title}}
</view>
</view>
<view class="blockC">
<view v-if="lineData&&lineData.categories.length&&handTrue">
<qiunDataCharts type="area" :chartData="lineData" :canvas2d="true" canvasId="charts09"
:cHeight="480" :cWidth="680" :animation="false"
:opts="{enableScroll:true,xAxis:{scrollShow:false,itemCount:3}}" :ontouch="true" />
</view>
<view class="nolist" v-else>
<uni-icons class="iconfont icon-zanwu"></uni-icons>
</view>
</view>
</view>
<!-- 目标-->
<view class="box">
<view class="info">
<view class="item" @click="navTo('/pages/history/history?type=w')">
<text></text>
<view>历史记录</view>
</view>
<view class="item" @click="navTo('/pages/compk/contrast?type=w')">
<text></text>
<view>数据对比</view>
</view>
</view>
<view class="data">
<view class="item" @click="handleClick(0)">
<view class="val">{{userInfo.targetweight?userInfo.targetweight:0}}<text>kg</text></view>
<view class="name">目标体重<uni-icons class="iconfont icon-bianji" color="#FEC407"></uni-icons></view>
</view>
<view class="item">
<view class="val">{{userInfo.totalweight?Math.abs(userInfo.totalweight):0}}<text>kg</text>
</view>
<view class="name" v-if="Number(userInfo.totalweight)<0">累计增重</view>
<view class="name" v-else>累计减重</view>
</view>
<view class="item" @click="handleClick(1)">
<view class="val">{{userInfo.firstweight?userInfo.firstweight:0}}<text>kg</text>
</view>
<view class="name">初始体重<uni-icons class="iconfont icon-bianji" color="#FEC407"></uni-icons>
</view>
</view>
<view class="item">
<view class="val">{{userInfo.day?userInfo.day:0}}<text></text></view>
<view class="name">减重天数</view>
</view>
</view>
</view>
<!-- 初始 -->
<firstweight></firstweight>
<!-- 目标 -->
<targetWeight></targetWeight>
</view>
</template>
<script>
import {
mapState
} from "vuex";
import targetWeight from '@/components/target/targetWeight.vue';
import firstweight from '@/components/target/firstweight.vue';
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue';
export default {
components: {
targetWeight,
firstweight,
qiunDataCharts,
},
computed: {
...mapState(["user", "Trend", "appTheme"]),
userInfo: function() {
return this.user
},
endDate() {
return this.$tools.getDate("start")
},
startDate() {
return this.$tools.GetDateStr(-90);
},
},
mounted() {
let that = this
this.active = 0
let list = this.$json.TrendList
let cidata = {
weight: {
categories: [],
series: [{
color: "#ff9f40",
name: "体重",
data: [],
}]
},
bmi: {
categories: [],
series: [{
name: "bmi",
color: "#5ba7ff",
data: [],
}]
},
muscle: {
categories: [],
series: [{
color: "#ff7f91",
name: "肌肉",
data: [],
}]
},
fat_r: {
categories: [],
series: [{
color: "#3fcba7",
name: "脂肪",
data: [],
}]
}
}
for (var i = 0; i < list.length; i++) {
cidata.weight.categories.push(list[i].time);
cidata.bmi.categories.push(list[i].time);
cidata.muscle.categories.push(list[i].time);
cidata.fat_r.categories.push(list[i].time);
cidata.weight.series.forEach(item => {
item.data.push(list[i].weight)
})
cidata.bmi.series.forEach(item => {
item.data.push(list[i].bmi)
})
cidata.muscle.series.forEach(item => {
item.data.push(list[i].muscle)
})
cidata.fat_r.series.forEach(item => {
item.data.push(list[i].fat_r)
})
}
for (var i = 0; i < that.weightList.length; i++) {
that.weightList[i].Line = cidata[that.weightList[i].key];
}
that.showbox(0)
console.log("222", cidata, that.weightList)
// that.getList(this.startDate, this.endDate)
},
methods: {
getList(start, end) {
console.log("fanhui", start, end)
let that = this
that.$model.getTrendList({
familyid: uni.getStorageSync('familyid'),
starttime: start,
endtime: end,
}).then(res => {
if (res) {
for (var i = 0; i < that.weightList.length; i++) {
that.weightList[i].Line = res[that.weightList[i].key];
}
that.showbox(0)
}
})
},
showbox(index) {
let that = this
that.handTrue = false
this.$nextTick(function() {
that.handTrue = true
that.lineData = that.weightList[index].Line
})
that.active1 = index
},
//
handStartTimeH(e) {
let that = this
if (this.endTime) {
if (Date.parse(e.target.value) > Date.parse(this.endTime)) {
this.$tools.msg("请选择正确的时间")
return
}
} else {
if (Date.parse(e.target.value) > Date.parse(this.endDate)) {
this.$tools.msg("请选择正确的时间")
return
}
}
this.startTime = e.target.value
let endtime = that.endTime ? that.endTime : that.endDate
this.getList(that.startTime, endtime)
},
//
handEndTimeH(e) {
let that = this
if (this.startTime) {
if (Date.parse(e.target.value) < Date.parse(this.startTime)) {
this.$tools.msg("请选择正确的时间")
return
}
} else {
if (Date.parse(e.target.value) < Date.parse(this.startDate)) {
this.$tools.msg("请选择正确的时间")
return
}
}
this.endTime = e.target.value
let startTime = that.startTime ? that.startTime : that.startDate
this.getList(startTime, this.endTime)
},
handleClick(ind) {
if (ind == 0) {
this.$store.commit("changeTarget", true);
return
}
if (ind == 1) {
this.$store.commit("changeFirst", true);
return
}
},
navTo(url) {
uni.navigateTo({
url: url
})
}
},
data() {
return {
lineData: null,
type: null,
active1: 0,
weight: "",
startTime: "",
endTime: "",
active: 0,
token: null,
handTrue: true,
TrendList: [],
weightList: [{
title: '体重',
key: 'weight',
showCon: false,
Line: {
"categories": [],
"series": [{
"color": "#fb7b92",
"name": "体重",
"data": []
}]
},
},
{
title: 'BMI',
key: 'bmi',
Line: {
"categories": [],
"series": [{
"color": "#6bb0fe",
"name": "bmi",
"data": []
}]
},
}, {
title: '肌肉',
key: 'muscle',
showCon: false,
Line: {
"categories": [],
"series": [{
"color": "#ff9f40",
"name": "肌肉率",
"data": []
}]
},
},
{
title: '脂肪',
key: 'fat_r',
showCon: false,
Line: {
"categories": [],
"series": [{
"color": "#3fcba7",
"name": "脂肪率",
"data": []
}]
},
}
],
};
}
}
</script>
<style lang="scss" scoped>
.TrendPage {
padding: 10px 0;
margin-bottom: 15px;
border-radius: 10px;
background-color: #f7f7f7;
.boxTime {
width: calc(100% - 20px);
display: flex;
justify-content: space-between;
align-items: center;
background-color: #fff;
border-radius: 10px;
padding: 10px;
.one {
width: 80%;
display: flex;
line-height: 25px;
justify-content: space-between;
align-items: center;
}
.tow {
color: $textcolor;
padding: 0 5px;
font-size: 12px;
height: 25px;
line-height: 25px;
border-radius: 10px;
}
.style {
background: $maincolor;
color: #fff;
}
.iconfont {
font-size: 14px;
color: #666;
}
}
.listC {
width: 100%;
display: flex;
padding: 10px;
margin-top: 10px;
align-items: center;
background-color: #fff;
border-radius: 10px 10px 0 0;
justify-content: space-between;
.name {
width: 25%;
padding: 0 15px;
font-size: 14px;
text-align: center;
border-radius: 5px;
height: 30px;
line-height: 30px;
}
.active {
font-size: 14px;
border-radius: 5px;
color: #fff;
background: $maincolor;
}
}
.box {
padding: 0;
display: flex;
flex-wrap: wrap;
border-radius: 10px;
justify-content: space-between;
}
.blockC {
clear: both;
width: 100%;
height: 250px;
background-color: #fff;
border-radius: 0 0 10px 10px;
}
.info {
width: 100%;
display: flex;
margin-top: 20px;
justify-content: space-between;
.item {
color: #fff;
width: 47.5%;
height: 50px;
background: $maincolor;
text-align: center;
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
text {
width: 30px;
height: 30px;
border-radius: 50%;
margin-right: 10px;
display: inline-block;
background-color: #fff;
}
}
}
.data {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
color: #666;
margin-top: 15px;
width: 100%;
.item {
width: 47.5%;
text-align: center;
font-size: 14px;
line-height: 30px;
background: #fff;
padding: 5px 0;
border-radius: 15px;
margin-bottom: 15px;
}
.val {
display: flex;
align-items: center;
font-size: 20px;
font-weight: 700;
justify-content: center;
color: #666;
text {
font-size: 14px;
font-weight: 500;
display: block;
margin-top: 3px;
margin-left: 3px;
}
}
.name {
display: flex;
align-items: center;
justify-content: center;
color: #999;
}
}
}
.boxList {
background-color: #fff;
border-radius: 10px;
.list {
margin: 10px;
}
}
</style>

View File

@ -1,397 +0,0 @@
<template>
<view class="">
<view class="box">
<view class="time">2024年3月25日16:23:42</view>
<view class="item">
<view class="data borderR">
<view class="c666 mb-5">体重</view>
<view><text>45.3</text>kg</view>
</view>
<view class="data borderR">
<view class="c666 mb-5">身高</view>
<view><text>160.2</text>CM</view>
</view>
<view class="data">
<view class="c666 mb-5">BMI</view>
<view><text>23.6</text></view>
</view>
</view>
</view>
<!-- -->
<view class="box">
<view>身体得分91</view>
<view>身体类型标准</view>
</view>
<!-- -->
<view class="info">
<view class="item">
<text></text>
<view>手动记录</view>
</view>
<view class="item">
<text></text>
<view>连接设备</view>
</view>
</view>
<!-- -->
<view class="bold mt-10">其他数据</view>
<view class="myinfoPage">
<view class="box1">
<uni-collapse accordion>
<uni-collapse-item class="list" v-for="(item,index) in infoList" :key="index">
<template v-slot:title>
<uni-list-item class="block">
<view class="name">
<icon class="t-icon iconfont" :class="'t-icon-'+item.name"></icon>
{{item.title}}
</view>
<view class="val" v-if="item.title=='肥胖等级'||item.title=='体型'"> - </view>
<view class="val" v-else>{{item.value?item.value:'0'}}{{item.unit}}</view>
<view class="level">
<view class="btnf" :style="{backgroundColor:(item.level=='异常'?'#FFF':item.color)}"
:class="[item.level=='异常'?'btnC':'']">{{item.level=='异常'?'-':item.level}}
</view>
</view>
</uni-list-item>
</template>
<view class="desc">
<view v-if="item.desc" class="ming">{{item.desc}}</view>
<view class="scale" v-if="item.ishasscale">本次评分{{item.scale}}</view>
<view :class="[item.list.length?'statuevue':'']" v-if="item.list">
<view class="bi" v-if="item.title!='基础代谢'">
<view :style="'left:'+item.offset+'%'" class="peobox">
<view class="xx"></view>
</view>
<view class="item" v-for="(ite , ind) in item.list" :key="ind"
:style="{backgroundColor:ite.color}">
<view class="span1">{{ite.text}}</view>
<view class="span" v-if="ind<item.list.length-1">{{ite.maxvalue}}</view>
</view>
</view>
<view v-else>
<view class="kcalClass" v-if="item.list&&item.list.length">
标准值:{{item.list[0].maxvalue}}kcal
</view>
</view>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
<view class="tips c999 ml-15">
<uni-icons type="info-filled" color="red"></uni-icons>
此测量数据仅供参考不可代替医学专业测试
</view>
</view>
<view class="nolist">
<icon class="iconfont icon-zanwu"></icon>
</view>
</view>
</template>
<script>
export default {
data() {
return {
infoList: []
}
},
mounted() {
this.infoList = this.$json.infoList
console.log("infolist", this.infoList)
},
methods: {
handleToggle(index) {
let that = this
if (!that.MeasureResult) return
let str = this.weightInfo.infoList(that.MeasureResult).slice(1, 14)
for (var i = 0; i < str.length; i++) {
if (i == index) {
if (index == 0 && str[0].showCon == false) {
str[0].showCon = true
} else {
str[i].showCon = !str[i].showCon
}
} else {
str[i].showCon = false
}
}
that.infoList = this.weightInfo.infoList(that.MeasureResult).slice(1, 14)
},
navTo(url) {
uni.navigateTo({
url: url
})
}
}
}
</script>
<style scoped lang="scss">
.box {
padding: 10px;
background-color: #fff;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
margin-bottom: 10px;
.time {
color: #999;
padding-bottom: 15px;
width: 100%;
}
.item {
width: 100%;
display: flex;
justify-content: space-around;
.data {
width: 33%;
text-align: center;
}
text {
font-size: 20px !important;
font-weight: bold;
}
}
}
.info {
width: 100%;
display: flex;
justify-content: space-between;
.item {
color: #fff;
width: 45%;
height: 50px;
background: $maincolor;
text-align: center;
border-radius: 10px;
display: flex;
justify-content: center;
align-items: center;
text {
width: 30px;
height: 30px;
border-radius: 50%;
margin-right: 10px;
display: inline-block;
background-color: #fff;
}
}
}
.myinfoPage {
width: 100%;
background: #fff;
margin-top: 10px;
padding-bottom: 15px;
border-radius: 10px;
.box1 {
display: flex;
flex-wrap: wrap;
border-radius: 10px;
font-size: 14px;
position: relative;
margin: 0px 15px 0;
padding-bottom: 10px;
.list {
width: 100%;
display: flex;
justify-content: space-between;
color: #666;
padding: 0;
line-height: 50px;
align-items: center;
flex-wrap: wrap;
image,
.t-icon {
width: 18px !important;
height: 18px;
border: 2px solid #c7c7c7;
background-color: #c7c7c7;
border-radius: 50%;
margin-right: 5px;
}
.block {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
color: #666;
position: relative;
.level,
.val {
width: 25%;
}
.name {
width: 40%;
display: flex;
align-items: center;
}
.icon {
width: 20px;
text-align: right;
display: flex;
image {
width: 20px;
height: 20px;
}
}
}
.desc {
line-height: 20px;
text-align: left;
width: calc(100% - 20px);
height: auto;
border-radius: 5px;
font-size: 12px;
color: #999;
padding: 10px;
background: #f7f7f7;
}
}
.statuevue {
height: 35px;
position: relative;
width: 100%;
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: 12px;
.span1 {
width: 100%;
text-align: center;
position: absolute;
top: -23px;
}
.span {
margin-top: 8px;
position: absolute;
right: -8px;
}
}
}
}
.yuanxing {
display: inline-block;
background: #f19601;
width: 8px;
height: 12px;
margin-right: 5px;
font-size: 32rpx;
}
.btnf {
font-size: 13px;
border-radius: 5px;
height: 22px;
margin: 0 10px 0 0;
line-height: 22px;
color: #fff;
font-weight: 400;
width: 44px !important;
text-align: center !important;
float: right;
}
.tivon {
display: flex;
justify-content: center;
align-content: center;
align-items: center;
.bianji {
width: 20px;
height: 20px;
margin-left: 5px;
}
}
.box1 :last-child.list {
.val {
width: 25% !important;
}
}
.kcalClass {
width: 100%;
text-align: center;
font-size: 16px;
line-height: 55px;
margin: -20px auto;
}
.yichang {
background: #ffe4be;
color: #ff4239;
padding: 5px;
text-align: center;
border-radius: 5px;
margin: 0 15px 10px;
}
}
/deep/.uni-collapse-item {
width: 100% !important;
}
/deep/.uni-collapse-item__title-arrow {
margin-right: 0 !important;
}
/deep/.uni-collapse-item__wrap-content.uni-collapse-item--border {
border-bottom-width: 0
}
</style>

BIN
static/add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
static/bae.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
static/charts.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
static/history.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
static/none.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
static/ping.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
static/ping2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
static/pk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

BIN
static/shou.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
static/shou2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

BIN
static/wo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
static/wo2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -8,13 +8,95 @@ export default {
}, },
account) { account) {
return model.getUserInfo(account).then(res => { return model.getUserInfo(account).then(res => {
commit('changeUser', res.data) console.log("用户信息", res.data)
if (!res.data.height || !res.data.mage || !res.data.birthday) { if (res.code != 0) {
uni.redirectTo({ that.$tools.msg(res.msg)
url: `/pageTwo/login/userinfo`
})
return return
} }
commit('changeUser', res.data)
}); });
},
// 成员列表
getFamilyList({
commit
},
account) {
return model.getUserList(account).then(res => {
if (res.code != 0) {
that.$tools.msg(res.msg)
return
}
commit('changeFamilay', res.data)
});
},
// 获取所有卡片
getCardList({
commit
},
account) {
return model.getCardAllList(account).then(res => {
console.log("卡片列表", res.data)
commit('changeCardList', res.data)
})
},
// 身体数据
getResult({ //报告
commit
}, account) {
return model.getResult(account).then((res) => {
console.log("报告", res)
if (res.code == 0) {
commit('changeMeasureResult', res.data)
} else {
commit('changeMeasureResult', null)
}
})
},
// 跳绳数据
getSkipResult({ //报告
commit
}, account) {
return model.getSkipResult(account).then((res) => {
console.log("跳绳报告", res)
if (res.code == 0) {
commit('changeMeasureSkip', res.data)
} else {
commit('changeMeasureSkip', null)
}
})
},
// 肺活量
getLungResult({ //报告
commit
}, account) {
return model.getLungResult(account).then((res) => {
console.log("肺活量报告", res)
if (res.code == 0) {
commit('changeMeasureLung', res.data)
} else {
commit('changeMeasureLung', null)
}
})
},
GetBodyTrendList({ //趋势
commit
}, account) {
return model.getTrendList(account).then((res) => {
console.log("趋势", res)
commit('changeTrend', res.data)
})
},
gethistoryList({ // 获取历史记录
commit
}, account) {
return model.getHistoryList(account).then((res) => {
if (res.data && res.data.items) {
commit('changehistoryList', res.data.items)
} else {
commit('changehistoryList', null)
}
})
} }
} }

View File

@ -6,63 +6,43 @@ export default new Vuex.Store({
// state: 存储基本数据 // state: 存储基本数据
state: { state: {
user: { user: {
id: "",
headimg: null, headimg: null,
name: "",
nickname: "", nickname: "",
targetweight: 0, //目标体重
firstweight: 0, //初始体重
weight: 0,
birthday: "", birthday: "",
height: 0, gender: 0,
age: "0",
sex: 0, sex: 0,
familyid: 0, card_data_list: [],
mage: "", target_current: {}
firstresulttime: ""
}, },
MeasureResult: {}, MeasureSkip: null,
isedit: false, MeasureResult: null,
isDrawe: false, MeasureLung: null,
isConnected: false,
isBluetoothTyle: false,
configBox: {},
familayList: [], familayList: [],
historyList: [], historyList: [],
Banner: [], cardList: {
Trend: {}, user: [],
TrendPk: {}, all: []
isTarget: false, },
isFirst: false, Trend: [],
isRecord: false, isDrawe: false, //左侧弹框
isLogin: false, isedit: false, //信息弹框
isLogout: true, isTarget: false, //目标体重
appTheme: '', isFirst: false, //初始体重
devHomePram: {} isRecord: false, //手动记录
isSlider: false, //分数占比
}, },
// mutations: Store中更改state数据状态的唯一方法(必须是同步函数) // mutations: Store中更改state数据状态的唯一方法(必须是同步函数)
mutations: { mutations: {
toggleColor(state, color) {
state.appTheme = color
},
/* 用户信息 */ /* 用户信息 */
changeUser(state, newData) { changeUser(state, newData) {
if (newData.familyid) { uni.setStorageSync('userid', newData.id)
uni.setStorageSync('familyid', newData.familyid);
}
if (newData.birthday) {
uni.setStorageSync('birthday', newData.birthday);
}
if (newData.height) {
uni.setStorageSync('height', newData.height);
}
if (newData.sex) {
uni.setStorageSync('sex', newData.sex);
}
Object.assign(state.user, newData) Object.assign(state.user, newData)
}, },
//登录弹框 // 卡片列表
changeUserLogin(state, newData) { changeCardList(state, newData) {
state.isLogin = newData state.cardList = newData
}, },
//历史记录 //历史记录
changehistoryList(state, newData) { changehistoryList(state, newData) {
@ -72,6 +52,15 @@ export default new Vuex.Store({
changeMeasureResult(state, newData) { changeMeasureResult(state, newData) {
state.MeasureResult = newData state.MeasureResult = newData
}, },
// 跳绳数据
changeMeasureSkip(state, newData) {
state.MeasureSkip = newData
},
// 肺活量
changeMeasureLung(state, newData) {
state.MeasureLung = newData
},
// 信息弹框 // 信息弹框
changeEdit(state, newData) { changeEdit(state, newData) {
state.isedit = newData state.isedit = newData
@ -88,6 +77,10 @@ export default new Vuex.Store({
changeRecord(state, newData) { changeRecord(state, newData) {
state.isRecord = newData state.isRecord = newData
}, },
// 分数占比
changeSlider(state, newData) {
state.isSlider = newData
},
// 左侧菜单弹框 // 左侧菜单弹框
changeDrawe(state, newData) { changeDrawe(state, newData) {
state.isDrawe = newData state.isDrawe = newData
@ -96,57 +89,10 @@ export default new Vuex.Store({
changeFamilay(state, newData) { changeFamilay(state, newData) {
state.familayList = newData state.familayList = newData
}, },
//蓝牙状态
changeBluetooth(state, newData) {
state.isBluetoothTyle = newData
},
// 蓝牙连接状态
changeConnected(state, newData) {
state.isConnected = newData
},
//趋势 //趋势
changeTrend(state, newData) { changeTrend(state, newData) {
state.Trend = newData state.Trend = newData
},
//对比
changeTrendPk(state, newData) {
state.TrendPk = newData
},
// banner
changeBanner(state, newData) {
state.Banner = newData
},
//配置详情
changeConfig(state, newData) {
state.configBox = newData
},
// 退出登录
changeLogout(state, newData) {
if (newData == false) {
state.user = {
headimg: null,
nickname: "",
name: "",
targetweight: 0, //目标体重
firstweight: 0, //初始体重
weight: 0,
birthday: "",
height: 0,
age: 0,
sex: 0,
familyid: 0,
firstresulttime: ""
} }
state.Trend = null
state.historyList = null
state.devTypeList = null
}
state.isLogout = newData
},
changeDevType(state, newData) {
state.devHomePram = newData
}
}, },
// 模块化vuex // 模块化vuex
modules: {}, modules: {},

View File

@ -1,14 +1,14 @@
import tools from '@/tools/tools.js' import tools from '@/tools/tools.js'
import store from '../store' import store from '../store'
let baseUrl = "" let baseUrl = "http://tc.pcxbc.com"
const httpRequest = (url, method = "get", data) => { const httpRequest = (url, method = "get", data) => {
data.token = uni.getStorageSync('token')
data.aan_id = uni.getStorageSync('aan_id')
let httpDefaultOpts = { let httpDefaultOpts = {
url: baseUrl + url, url: baseUrl + url,
data: data, data: data,
method: method, method: method,
header: { header: {
'Authorization': "Bearer " + uni.getStorageSync('token'),
'X-Authorization': "Bearer " + uni.getStorageSync('refreshtoken'),
'X-Requested-With': 'XMLHttpRequest', 'X-Requested-With': 'XMLHttpRequest',
'content-type': 'application/json;charset=UTF-8', 'content-type': 'application/json;charset=UTF-8',
}, },
@ -17,11 +17,11 @@ const httpRequest = (url, method = "get", data) => {
uni.request(httpDefaultOpts).then( uni.request(httpDefaultOpts).then(
(res) => { (res) => {
uni.hideLoading() uni.hideLoading()
if (res[1].data.code == 401) { console.log("request", url, res, data)
if (res[1].data.code == 20001) {
uni.clearStorageSync() uni.clearStorageSync()
uni.setStorageSync('token', null) uni.setStorageSync('token', null)
uni.setStorageSync('refreshtoken', null) uni.setStorageSync('aan_id', null)
tools.msg(res[1].data.message)
setTimeout(function() { setTimeout(function() {
uni.reLaunch({ uni.reLaunch({
url: "/pages/login/login" url: "/pages/login/login"
@ -30,7 +30,7 @@ const httpRequest = (url, method = "get", data) => {
return return
} }
if (res[1].statusCode != 200) { if (res[1].statusCode != 200) {
tools.msg(res[1].data.message) tools.msg(res[1].data.msg)
return return
} }
resolve(res[1].data) resolve(res[1].data)
@ -46,12 +46,10 @@ const httpRequest = (url, method = "get", data) => {
}; };
const get = (url, data) => { const get = (url, data) => {
// data.appid = config.appid
return httpRequest(url, 'get', data) return httpRequest(url, 'get', data)
} }
const post = (url, data) => { const post = (url, data) => {
// data.appid = config.appid
return httpRequest(url, 'post', data) return httpRequest(url, 'post', data)
} }
export default { export default {

View File

@ -2,404 +2,162 @@ import http from './https.js'
import tools from './tools.js' import tools from './tools.js'
import store from '@/store' import store from '@/store'
export default { export default {
// 门店账户管理 // 登录
onlogin(param) { // 根据openid快捷登录 getonlogin(param) { // 登录
return http.post("/api/shop/user/onlogin", param).then(res => { return http.post("/login_action", param).then(res => {
return res
})
},
getlogin(param) { // 账号登录
return http.post("/api/shop/user/login", param).then(res => {
return res
})
},
getloginOut(param) { // 退出登录
return http.post("/api/shop/user/loginout", param).then(res => {
return res
})
},
getShopChange(param) { //门店切换
return http.post("/api/shop/user/change", param).then(res => {
return res
})
},
getUserShopList(param) { //绑定的门店列表
return http.post("/api/shop/user/shoplist", param).then(res => {
return res return res
}) })
}, },
getSendCode(param) { // 验证码 getSendCode(param) { // 验证码
return http.post("/api/shop/user/sendcode", param).then(res => { return http.post("/send_phone_email_code", param).then(res => {
return res return res
}) })
}, },
getinfo(param) { // 获取用户资料 getregister(param) { // 注册
return http.post("/api/shop/user/info", param).then(res => { return http.post("/register_action", param).then(res => {
return res return res
}) })
}, },
// 公告列表 getResetPassword(param) { // 重置密码
getnoticelist(param) { return http.post("/reset_password", param).then(res => {
return http.post("/api/shop/notice/list", param).then(res => {
return res return res
}) })
}, },
// 门店会员管理 getloginOut(param) { // 退出登录
getServeList(param) { //今日服务信息 return http.post("/user_quit_account", param).then(res => {
return http.post("/api/shop/member/serve/list", param).then(res => {
return res return res
}) })
}, },
getBodyandproductList(param) { //产品和身体部位列表 // 首页
return http.post("/api/shop/member/bodyandproduct/list", param).then(res => { getUserInfo(param) { // 成员详情
return http.post("/get_user_data_information", param).then(res => {
return res return res
}) })
}, },
getServeCompletebody(param) { //身体服务完成 getUserList(param) { // 成员列表
return http.post("/api/shop/member/serve/completebody", param).then(res => { return http.post("/get_user_card_list", param).then(res => {
return res return res
}) })
}, },
getServeAddbody(param) { //添加身体服务记录 getDelUser(param) { // 删除成员
return http.post("/api/shop/member/serve/addbody", param).then(res => { return http.post("/del_user_data", param).then(res => {
return res return res
}) })
}, },
getAddOrder(param) { //增加塑形订单 getEditUser(param) { // 修改成员资料
return http.post("/api/shop/member/addorder", param).then(res => { return http.post("/update_user_data", param).then(res => {
return res return res
}) })
}, },
getEditOrder(param) { //编辑塑形订单 getAddUser(param) { // 添加成员
return http.post("/api/shop/member/editorder", param).then(res => { return http.post("/create_user_data", param).then(res => {
return res return res
}) })
}, },
getOrderList(param) { //塑形订单列表 getGradeList(param) { // 获取年级列表
return http.post("/api/shop/member/orderlist", param).then(res => { return http.post("/get_grade_list", param).then(res => {
return res return res
}) })
}, },
getServeComplete(param) { //服务完成 getCardAllList(param) { // 获取所有卡片
return http.post("/api/shop/member/serve/complete", param).then(res => { return http.post("/get_card_all_list", param).then(res => {
return res return res
}) })
}, },
getServeSubmit(param) { //用户提交服务记录 getCardAllOrder(param) { // 保存卡片顺序
return http.post("/api/shop/member/serve/submit", param).then(res => { return http.post("/save_user_card_order", param).then(res => {
return res return res
}) })
}, },
getMemberApply(param) { //增加会员 // 身体数据卡片
return http.post("/api/shop/member/apply", param).then(res => { getfirstweight(param) { //修改初始体重
return http.post("/card_modify_weight", param).then(res => {
return res return res
}) })
}, },
getMemberEdit(param) { //编辑会员 getinsertmeasure(param) { //手动记录
return http.post("/api/shop/member/edit", param).then(res => { return http.post('/card_manual_recording', param).then(res => {
return res return res
}) })
}, },
getMemberTodayList(param) { //获取今日会员列表 getResult(param) { //获取测量报告
return http.post("/api/shop/member/todaylist", param).then(res => { return http.post("/card_data_detailed", param).then(res => {
return res return res
}) })
}, },
getMemberList(param) { //获取所有会员列表 getTrendList(param) { //趋势
return http.post("/api/shop/member/list", param).then(res => { return http.post("/card_curve_chart", param).then(res => {
return res return res
}) })
}, },
getMemberInfo(param) { //会员资料详情 // 跳绳
return http.post("/api/shop/member/info", param).then(res => { getSkipResult(param) { //获取测量报告
return http.post("/skip_today_data", param).then(res => {
return res return res
}) })
}, },
getMemberTrendlist(param) { //会员体重趋势列表 getskipmeasure(param) { //手动记录
return http.post("/api/shop/member/trendlist", param).then(res => { return http.post('/skip_manual_recording', param).then(res => {
return res
})
},
getSkipTrendList(param) { //趋势
return http.post("/skip_curve_chart", param).then(res => {
return res
})
},
// 肺活量
getLungResult(param) { //获取测量报告
return http.post("/vitalcapacity_data_report", param).then(res => {
return res
})
},
getLungmeasure(param) { //手动记录
return http.post('/vitalcapacity_save_record_data', param).then(res => {
return res
})
},
getLungTrendList(param) { //趋势
return http.post("/vitalcapacity_curve_chart", param).then(res => {
return res
})
},
// 公共
gethistory(param) { //历史记录
return http.post("/get_all_record_data_page", param).then(res => {
return res
})
},
gethistorydetail(param) { //历史记录详情
return http.post("/get_all_record_detailed_information", param).then(res => {
return res
})
},
gethistorydelete(param) { //删除历史记录
return http.post("/card_del_record_data", param).then(res => {
return res
})
},
getresultdiff(param) { //记录对比
return http.post("/get_all_record_data_group", param).then(res => {
if (res.code == 0) { if (res.code == 0) {
let list = res.data let pkList = {
let weight = { list: [],
categories: [], Dlist: []
series: [{
data: [],
}]
} }
for (var i = 0; i < list.length; i++) { for (var i = 0; i < res.data.length; i++) {
weight.categories.push(list[i].time); pkList.list.push(res.data[i])
weight.series.forEach(item => { if (!pkList.Dlist.includes(res.data[i].r_t)) { //includes 检测数组是否有某个值
item.data.push(list[i].weight) pkList.Dlist.push(res.data[i].r_t);
})
} }
res.data.list = weight
} }
res.pkList = pkList
}
return res return res
}) })
}, },
getMemberMoveshop(param) { //会员转店 getresultcontrast(param) { //对比详情
return http.post("/api/shop/member/moveshop", param).then(res => { return http.post("/get_all_card_data_contrast", param).then(res => {
return res
})
},
getMoveshopSetstatus(param) { //转店处理
return http.post("/api/shop/member/moveshop/setstatus", param).then(res => {
return res
})
},
getMoveshopList(param) { //会员转店记录
return http.post("/api/shop/member/moveshop/list", param).then(res => {
return res
})
},
getMoveshopInfo(param) { //会员转店记录详情
return http.post("/api/shop/member/moveshop/info", param).then(res => {
return res
})
},
getMemberAfk(param) { //会员请假
return http.post("/api/shop/member/afk", param).then(res => {
return res
})
},
getMemberAfkList(param) { //会员请假列表
return http.post("/api/shop/member/afk/list", param).then(res => {
return res
})
},
getMemberAfkDelete(param) { //会员请假记录删除
return http.post("/api/shop/member/afk/delete", param).then(res => {
return res
})
},
getMemberCalcstand(param) { //标准体重计算
return http.post("/api/shop/member/calcstand", param).then(res => {
return res
})
},
getMemberRankList(param) { //排行榜列表
return http.post("/api/shop/member/rank/list", param).then(res => {
return res
})
},
getMemberGenimg(param) { //生成排行榜图片
return http.post("/api/shop/member/rank/img", param).then(res => {
return res
})
},
getMemberSubscribe(param) { //关注会员
return http.post("/api/shop/member/subscribe", param).then(res => {
return res
})
},
getMemberUnsubscribe(param) { //取关会员
return http.post("/api/shop/member/unsubscribe", param).then(res => {
return res
})
},
getMemberFreeze(param) { //账户冻结
return http.post("/api/shop/member/freeze", param).then(res => {
return res
})
},
getMemberThaw(param) { //账户解冻
return http.post("/api/shop/member/thaw", param).then(res => {
return res
})
},
getAddweight(param) { //今日体重记录
return http.post("/api/shop/member/addweight", param).then(res => {
return res
})
},
getTolslist(param) { //3+1流失顾客列表
return http.post("/api/shop/member/tolslist", param).then(res => {
return res
})
},
//门店服务管理
getProductAdd(param) { //为会员添加产品
return http.post("/api/shop/member/product/add", param).then(res => {
return res
})
},
getProductbatchadd(param) { //为会员批量添加产品
return http.post("/api/shop/member/product/batchadd", param).then(res => {
return res
})
},
getProductrPagelist(param) { //会员使用的产品列表
return http.post("/api/shop/member/product/page", param).then(res => {
return res
})
},
getProductlist(param) { //会员可使用的产品列表
return http.post("/api/shop/member/product/list", param).then(res => {
return res
})
},
getProductresultlist(param) { //会员指定产品使用记录
return http.post("/api/shop/member/product/resultlist", param).then(res => {
return res
})
},
getAddOrder(param) { //增加塑形订单
return http.post("/api/shop/member/addorder", param).then(res => {
return res
})
},
getEditorder(param) { //编辑塑形订单
return http.post("/api/shop/member/editorder", param).then(res => {
return res
})
},
getDeleteOrder(param) { //删除塑型订单
return http.post("/api/shop/member/deleteorder", param).then(res => {
return res
})
},
getEndorder(param) { //结束塑型订单
return http.post("/api/shop/member/endorder", param).then(res => {
return res
})
},
getOrderlist(param) { //塑型订单列表
return http.post("/api/shop/member/orderlist", param).then(res => {
return res
})
},
getOrderdetail(param) { //塑型订单详情
return http.post("/api/shop/member/orderdetail", param).then(res => {
return res
})
},
getOldtonew(param) { //老转新
return http.post("/api/shop/member/oldtonew", param).then(res => {
return res
})
},
getcalccycle(param) { //周期计算
return http.post("/api/shop/member/calccycle", param).then(res => {
return res
})
},
getBodyInfo(param) { //今日身体服务信息
return http.post("/api/shop/member/body/info", param).then(res => {
return res
})
},
getBodySubmit(param) { //提交身体服务记录
return http.post("/api/shop/member/body/submit", param).then(res => {
return res
})
},
getBodyList(param) { //身体塑形服务记录列表
return http.post("/api/shop/member/body/list", param).then(res => {
return res
})
},
// 门店信息
getShopConfinfo(param) { //获取门店配置详情
return http.post("/api/shop/confinfo", param).then(res => {
return res
})
},
getShopList(param) { //门店列表
return http.post("/api/shop/list", param).then(res => {
return res
})
},
getShopUserList(param) { //门店店员列表
return http.post("/api/shop/user/list", param).then(res => {
return res
})
},
getPosList(param) { //门店职位列表
return http.post("/api/shop/poslist", param).then(res => {
return res
})
},
getFlowList(param) { //门店流水表
return http.post("/api/report/flowlist", param).then(res => {
return res
})
},
getPatrList(param) { //顾客阶段减重汇总列表
return http.post("/api/report/partlist", param).then(res => {
return res
})
},
getDayList(param) { //每日减重汇总列表
return http.post("/api/report/daylist", param).then(res => {
return res
})
},
getClerkList(param) { //员工服务统计
return http.post("/api/report/clerklist", param).then(res => {
return res
})
},
getClerkServeList(param) { //员工服务统计详情
return http.post("/api/report/clerkservelist", param).then(res => {
return res
})
},
getResultList(param) { //减重记录
return http.post("/api/report/resultlist", param).then(res => {
return res
})
},
getResultListByDay(param) { //根据天数进行汇总
return http.post("/api/report/listbyday", param).then(res => {
return res
})
},
getResultListWeight(param) { //历史减重记录
return http.post("/api/report/weighthislist", param).then(res => {
return res
})
},
// 设备管理
getDeviceList(param) { //设备列表
return http.post("/api/shop/device/list", param).then(res => {
return res
})
},
getDownloadimg(param) { //下载设备门店二维码
return http.post("/api/shop/device/downloadimg", param).then(res => {
return res
})
},
// 数据预警
getMemberAlertinfo(param) { //预警统计数据
return http.post("/api/shop/member/alertinfo", param).then(res => {
return res
})
},
getMemberZclist(param) { //涨秤会员列表
return http.post("/api/shop/member/zclist", param).then(res => {
return res
})
},
getMemberAlllist(param) { //门店请假列表
return http.post("/api/shop/member/afk/alllist", param).then(res => {
return res
})
},
getMemberSubscribelist(param) { //关注会员列表
return http.post("/api/shop/member/subscribelist", param).then(res => {
return res
})
},
getMemberdbfzlist(param) { //复涨会员列表
return http.post("/api/shop/member/dbfzlist", param).then(res => {
return res return res
}) })
}, },

View File

@ -1,17 +1,16 @@
import $store from '@/store' import $store from '@/store'
export default { export default {
msg, msg,
gethms,
str2hex, str2hex,
hex2str, hex2str,
ab2hex, ab2hex,
inArray, inArray,
getAge,
getTime,
getDate,
getMonth, getMonth,
getDate,
GetDateStr, GetDateStr,
PrefixZero, PrefixZero,
getBluetoothAdapter validatePhoneEmail,
} }
// 2进制位数不足补0 // 2进制位数不足补0
function PrefixZero(num, n) { function PrefixZero(num, n) {
@ -34,6 +33,18 @@ function inArray(arr, key, val) {
return -1; return -1;
} }
function validatePhoneEmail(input) {
const phoneRegex = /^(\+?\d{1,4})?[-\s.]?\(?(\d{3})\)?[-\s.]?(\d{3})[-\s.]?(\d{4})$/;
const emailRegex = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
const isPhone = phoneRegex.test(input);
const isEmail = emailRegex.test(input);
return {
isPhone,
isEmail
};
}
function msg(str) { function msg(str) {
uni.showToast({ uni.showToast({
title: str, title: str,
@ -63,173 +74,22 @@ function str2hex(str) {
return encoder.encode(str) return encoder.encode(str)
} }
function getBluetoothAdapter(err) { // 跳绳分秒时间选择
if (err.errMsg == "openBluetoothAdapter:fail auth denied" || err.errMsg === function gethms(type) {
"openBluetoothAdapter:fail auth deny" || var mindata = []
err.errMsg === "openBluetoothAdapter:fail authorize no response" var secondData = []
) { let timeList = []
uni.showModal({ for (var i = 1; i <= 59; i++) {
title: "提示", i = i > 9 ? i : '0' + i
content: "需要您授权使用手机蓝牙", mindata.push(i + '分');
showCancel: false,
success(modalSuccess) {
uni.openSetting({
success(settingdata) {
if (settingdata.authSetting["scope.bluetooth"]) {
uni.openBluetoothAdapter({
success: e => {
uni.showToast({
title: "获取权限成功,请继续去测量",
icon: "none"
})
$store.commit("changeBluetooth", true);
},
fail: err => {
uni.showToast({
title: "请打开手机蓝牙",
icon: "none",
duration: 1000,
})
console.log('初始化蓝牙失败:' + err.errMsg);
} }
}); for (var i = 0; i <= 59; i++) {
} else { i = i > 9 ? i : '0' + i
uni.showToast({ secondData.push(i + '秒');
title: "获取权限失败,将无法使用手机蓝牙进行测量",
icon: "none"
})
} }
} timeList[0] = mindata
}) timeList[1] = secondData
} return timeList
})
} else {
uni.showToast({
title: "请打开手机蓝牙",
icon: "none",
duration: 1000,
})
}
}
function getDate(type) {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
month = month > 9 ? month : '0' + month;;
day = day > 9 ? day : '0' + day;
if (type === 'tow') {
year = year - 2;
return `${year}-${month}-${day}`;
}
if (type === 'start') {
year = year;
return `${year}-${month}-${day}`;
}
if (type === 'end') {
year = year + 60;
return `${year}-${month}-${day}`;
}
if (type == "m") {
if (month == "01" || month == "03" || month == "05" || month == "07" || month == "08" || month == "10" ||
month == "12") {
return year + "/" + month + "/01" + "~" + year + "/" + month + "/31";
} else if (month == "02") {
if ((year % 4 == 0 && year % 100 != 0) || (year % 100 == 0 && year % 400 == 0)) {
return year + "/" + month + "/01" + "~" + year + "/" + month + "/29";
} else {
return year + "/" + month + "/01" + "~" + year + "/" + month + "/28";
};
} else {
return year + "/" + month + "/01" + "~" + year + "/" + month + "/30";
};
}
}
function GetDateStr(AddDayCount) {
var dd = new Date();
dd.setDate(dd.getDate() + AddDayCount); //获取AddDayCount天后的日期
var y = dd.getFullYear();
var m = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1); //获取当前月份的日期不足10补0
var d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate(); //获取当前几号不足10补0
return y + "-" + m + "-" + d;
}
// 获取当前日期
function getTime() {
var date = new Date()
var todate =
((date.getMonth() + 1) < 10 ? ('0' + (date.getMonth() + 1)) : date.getMonth() +
1) + '月' + (date.getDate() < 10 ? ('0' + date.getDate()) : date.getDate() + '日')
return todate
}
// 根据出生日期获取年龄
function getAge(str) {
var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})/);
if (r == null) return false;
var d = new Date(r[1], r[3] - 1, r[4]);
var returnStr = "输入的日期格式错误!";
if (d.getFullYear() == r[1] && (d.getMonth() + 1) == r[3] && d.getDate() == r[4]) {
var date = new Date();
var yearNow = date.getFullYear();
var monthNow = date.getMonth() + 1;
var dayNow = date.getDate();
var largeMonths = [1, 3, 5, 7, 8, 10, 12], //大月, 用于计算天,只在年月都为零时,天数有效
lastMonth = monthNow - 1 > 0 ? monthNow - 1 : 12, // 上一个月的月份
isLeapYear = false, // 是否是闰年
daysOFMonth = 0; // 当前日期的上一个月多少天
if ((yearNow % 4 === 0 && yearNow % 100 !== 0) || yearNow % 400 === 0) { // 是否闰年, 用于计算天,只在年月都为零时,天数有效
isLeapYear = true;
}
if (largeMonths.indexOf(lastMonth) > -1) {
daysOFMonth = 31;
} else if (lastMonth === 2) {
if (isLeapYear) {
daysOFMonth = 29;
} else {
daysOFMonth = 28;
}
} else {
daysOFMonth = 30;
}
var Y = yearNow - parseInt(r[1]);
var M = monthNow - parseInt(r[3]);
var D = dayNow - parseInt(r[4]);
if (D < 0) {
D = D + daysOFMonth; //借一个月
M--;
}
if (M < 0) { // 借一年 12个月
Y--;
M = M + 12; //
}
if (Y < 0) {
returnStr = "出生日期有误!";
} else if (Y === 0) {
if (M === 0) {
returnStr = D + "天";
} else {
returnStr = M + "个月";
}
} else {
if (M === 0) {
returnStr = Y + "岁";
} else {
returnStr = Y + "岁" + M + "个月";
}
}
}
return returnStr;
} }
function getMonth(dates, months) { function getMonth(dates, months) {
@ -265,3 +125,55 @@ function getMonth(dates, months) {
return year + '/' + month + "/01" + "~" + year + "/" + month + "/30"; return year + '/' + month + "/01" + "~" + year + "/" + month + "/30";
}; };
}; };
function getDate(type) {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
if (type === 'tow') {
year = year - 2;
return `${year}/${month}/${day}`;
}
if (type === 'start') {
year = year;
return `${year}/${month}/${day}`;
}
if (type === 'end') {
year = year + 60;
return `${year}/${month}/${day}`;
}
if (type === 'year') {
year = year;
return `${year}`;
}
if (type === 'month') {
year = year;
return `${year}/${month}`;
}
if (type == "m") {
if (month == "01" || month == "03" || month == "05" || month == "07" || month == "08" || month == "10" ||
month == "12") {
return year + "/" + month + "/01" + "~" + year + "/" + month + "/31";
} else if (month == "02") {
if ((year % 4 == 0 && year % 100 != 0) || (year % 100 == 0 && year % 400 == 0)) {
return year + "/" + month + "/01" + "~" + year + "/" + month + "/29";
} else {
return year + "/" + month + "/01" + "~" + year + "/" + month + "/28";
};
} else {
return year + "/" + month + "/01" + "~" + year + "/" + month + "/30";
};
}
}
//获取AddDayCount天后的日期
function GetDateStr(AddDayCount) {
var dd = new Date();
dd.setDate(dd.getDate() + AddDayCount);
var y = dd.getFullYear();
var m = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1); //获取当前月份的日期不足10补0
var d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate(); //获取当前几号不足10补0
return y + "/" + m + "/" + d;
}

View File

@ -13,7 +13,6 @@
*/ */
/* 颜色变量 */ /* 颜色变量 */
/* 行为相关颜色 */ /* 行为相关颜色 */
$uni-color-primary: #007aff; $uni-color-primary: #007aff;
$uni-color-success: #4cd964; $uni-color-success: #4cd964;

View File

@ -236,21 +236,21 @@ const cfu = {
"type": "arcbar", "type": "arcbar",
"color": color, "color": color,
"title": { "title": {
"name": "百分比", "name": "",
"fontSize": 25, "fontSize": 25,
"color": "#00FF00" "color": "#00FF00"
}, },
"subtitle": { "subtitle": {
"name": "默认标题", "name": "",
"fontSize": 15, "fontSize": 15,
"color": "#666666" "color": "#666666"
}, },
"extra": { "extra": {
"arcbar": { "arcbar": {
"type": "default", "type": "circle",
"width": 12, "width": 12,
"backgroundColor": "#E9E9E9", "backgroundColor": "#E9E9E9",
"startAngle": 0.75, "startAngle": 1.5,
"endAngle": 0.25, "endAngle": 0.25,
"gap": 2 "gap": 2
} }
@ -337,11 +337,14 @@ const cfu = {
"disableGrid": true, "disableGrid": true,
}, },
"yAxis": { "yAxis": {
"gridType": "dash",
"disableGrid": true,
"gridColor": '#ffffff',
"data": [{ "data": [{
"min": 0 "min": 0
}] }]
}, },
"legend": {},
"extra": { "extra": {
"column": { "column": {
"type": "group", "type": "group",

View File

@ -0,0 +1,160 @@
## 2.2.342024-04-24
- 新增 日期点击事件,在点击日期时会触发该事件。
## 2.2.332024-04-15
- 修复 抖音小程序事件传递失效bug
## 2.2.322024-02-20
- 修复 日历的close事件触发异常的bug [详情](https://github.com/dcloudio/uni-ui/issues/844)
## 2.2.312024-02-20
- 修复 h5平台 右边日历的月份默认+1的bug [详情](https://github.com/dcloudio/uni-ui/issues/841)
## 2.2.302024-01-31
- 修复 隐藏“秒”时在IOS15及以下版本时出现 结束时间在开始时间之前 的bug [详情](https://github.com/dcloudio/uni-ui/issues/788)
## 2.2.292024-01-20
- 新增 show事件弹窗弹出时触发该事件 [详情](https://github.com/dcloudio/uni-app/issues/4694)
## 2.2.282024-01-18
- 去除 noChange事件当进行日期范围选择时若只选了一天则开始结束日期都为同一天 [详情](https://github.com/dcloudio/uni-ui/issues/815)
## 2.2.272024-01-10
- 优化 增加noChange事件当进行日期范围选择时若有空值则触发该事件 [详情](https://github.com/dcloudio/uni-ui/issues/815)
## 2.2.262024-01-08
- 修复 字节小程序时间选择范围器失效问题 [详情](https://github.com/dcloudio/uni-ui/issues/834)
## 2.2.252023-10-18
- 修复 PC端初次修改时间开始时间未更新的Bug [详情](https://github.com/dcloudio/uni-ui/issues/737)
## 2.2.242023-06-02
- 修复 部分情况修改时间开始、结束时间显示异常的Bug [详情](https://ask.dcloud.net.cn/question/171146)
- 优化 当前月可以选择上月、下月的日期的Bug
## 2.2.232023-05-02
- 修复 部分情况修改时间开始时间未更新的Bug [详情](https://github.com/dcloudio/uni-ui/issues/737)
- 修复 部分平台及设备第一次点击无法显示弹框的Bug
- 修复 ios 日期格式未补零显示及使用异常的Bug [详情](https://ask.dcloud.net.cn/question/162979)
## 2.2.222023-03-30
- 修复 日历 picker 修改年月后自动选中当月1日的Bug [详情](https://ask.dcloud.net.cn/question/165937)
- 修复 小程序端 低版本 ios NaN的Bug [详情](https://ask.dcloud.net.cn/question/162979)
## 2.2.212023-02-20
- 修复 firefox 浏览器显示区域点击无法拉起日历弹框的Bug [详情](https://ask.dcloud.net.cn/question/163362)
## 2.2.202023-02-17
- 优化 值为空依然选中当天问题
- 优化 提供 default-value 属性支持配置选择器打开时默认显示的时间
- 优化 非范围选择未选择日期时间,点击确认按钮选中当前日期时间
- 优化 字节小程序日期时间范围选择底部日期换行的Bug
## 2.2.192023-02-09
- 修复 2.2.18 引起范围选择配置 end 选择无效的Bug [详情](https://github.com/dcloudio/uni-ui/issues/686)
## 2.2.182023-02-08
- 修复 移动端范围选择change事件触发异常的Bug [详情](https://github.com/dcloudio/uni-ui/issues/684)
- 优化 PC端输入日期格式错误时返回当前日期时间
- 优化 PC端输入日期时间超出 start、end 限制的Bug
- 优化 移动端日期时间范围用法时间展示不完整问题
## 2.2.172023-02-04
- 修复 小程序端绑定 Date 类型报错的Bug [详情](https://github.com/dcloudio/uni-ui/issues/679)
- 修复 vue3 time-picker 无法显示绑定时分秒的Bug
## 2.2.162023-02-02
- 修复 字节小程序报错的Bug
## 2.2.152023-02-02
- 修复 某些情况切换月份错误的Bug
## 2.2.142023-01-30
- 修复 某些情况切换月份错误的Bug [详情](https://ask.dcloud.net.cn/question/162033)
## 2.2.132023-01-10
- 修复 多次加载组件造成内存占用的Bug
## 2.2.122022-12-01
- 修复 vue3 下 i18n 国际化初始值不正确的Bug
## 2.2.112022-09-19
- 修复 支付宝小程序样式错乱的Bug [详情](https://github.com/dcloudio/uni-app/issues/3861)
## 2.2.102022-09-19
- 修复 反向选择日期范围日期显示异常的Bug [详情](https://ask.dcloud.net.cn/question/153401?item_id=212892&rf=false)
## 2.2.92022-09-16
- 可以使用 uni-scss 控制主题色
## 2.2.82022-09-08
- 修复 close事件无效的Bug
## 2.2.72022-09-05
- 修复 移动端 maskClick 无效的Bug [详情](https://ask.dcloud.net.cn/question/140824)
## 2.2.62022-06-30
- 优化 组件样式调整了组件图标大小、高度、颜色等与uni-ui风格保持一致
## 2.2.52022-06-24
- 修复 日历顶部年月及底部确认未国际化的Bug
## 2.2.42022-03-31
- 修复 Vue3 下动态赋值,单选类型未响应的Bug
## 2.2.32022-03-28
- 修复 Vue3 下动态赋值未响应的Bug
## 2.2.22021-12-10
- 修复 clear-icon 属性在小程序平台不生效的Bug
## 2.2.12021-12-10
- 修复 日期范围选在小程序平台必须多点击一次才能取消选中状态的Bug
## 2.2.02021-11-19
- 优化 组件UI并提供设计资源 [详情](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移 [https://uniapp.dcloud.io/component/uniui/uni-datetime-picker](https://uniapp.dcloud.io/component/uniui/uni-datetime-picker)
## 2.1.52021-11-09
- 新增 提供组件设计资源,组件样式调整
## 2.1.42021-09-10
- 修复 hide-second 在移动端的Bug
- 修复 单选赋默认值时赋值日期未高亮的Bug
- 修复 赋默认值时移动端未正确显示时间的Bug
## 2.1.32021-09-09
- 新增 hide-second 属性,支持只使用时分,隐藏秒
## 2.1.22021-09-03
- 优化 取消选中时(范围选)直接开始下一次选择, 避免多点一次
- 优化 移动端支持清除按钮,同时支持通过 ref 调用组件的 clear 方法
- 优化 调整字号大小,美化日历界面
- 修复 因国际化导致的 placeholder 失效的Bug
## 2.1.12021-08-24
- 新增 支持国际化
- 优化 范围选择器在 pc 端过宽的问题
## 2.1.02021-08-09
- 新增 适配 vue3
## 2.0.192021-08-09
- 新增 支持作为 uni-forms 子组件相关功能
- 修复 在 uni-forms 中使用时,选择时间报 NAN 错误的Bug
## 2.0.182021-08-05
- 修复 type 属性动态赋值无效的Bug
- 修复 ‘确认’按钮被 tabbar 遮盖 bug
- 修复 组件未赋值时范围选左、右日历相同的Bug
## 2.0.172021-08-04
- 修复 范围选未正确显示当前值的Bug
- 修复 h5 平台(移动端)报错 'cale' of undefined 的Bug
## 2.0.162021-07-21
- 新增 return-type 属性支持返回 date 日期对象
## 2.0.152021-07-14
- 修复 单选日期类型初始赋值后不在当前日历的Bug
- 新增 clearIcon 属性,显示框的清空按钮可配置显示隐藏(仅 pc 有效)
- 优化 移动端移除显示框的清空按钮,无实际用途
## 2.0.142021-07-14
- 修复 组件赋值为空界面未更新的Bug
- 修复 start 和 end 不能动态赋值的Bug
- 修复 范围选类型用户选择后再次选择右侧日历结束日期显示不正确的Bug
## 2.0.132021-07-08
- 修复 范围选择不能动态赋值的Bug
## 2.0.122021-07-08
- 修复 范围选择的初始时间在一个月内时造成无法选择的bug
## 2.0.112021-07-08
- 优化 弹出层在超出视窗边缘定位不准确的问题
## 2.0.102021-07-08
- 修复 范围起始点样式的背景色与今日样式的字体前景色融合导致日期字体看不清的Bug
- 优化 弹出层在超出视窗边缘被遮盖的问题
## 2.0.92021-07-07
- 新增 maskClick 事件
- 修复 特殊情况日历 rpx 布局错误的Bugrpx -> px
- 修复 范围选择时清空返回值不合理的bug['', ''] -> []
## 2.0.82021-07-07
- 新增 日期时间显示框支持插槽
## 2.0.72021-07-01
- 优化 添加 uni-icons 依赖
## 2.0.62021-05-22
- 修复 图标在小程序上不显示的Bug
- 优化 重命名引用组件,避免潜在组件命名冲突
## 2.0.52021-05-20
- 优化 代码目录扁平化
## 2.0.42021-05-12
- 新增 组件示例地址
## 2.0.32021-05-10
- 修复 ios 下不识别 '-' 日期格式的Bug
- 优化 pc 下弹出层添加边框和阴影
## 2.0.22021-05-08
- 修复 在 admin 中获取弹出层定位错误的bug
## 2.0.12021-05-08
- 修复 type 属性向下兼容,默认值从 date 变更为 datetime
## 2.0.02021-04-30
- 支持日历形式的日期+时间的范围选择
> 注意此版本不向后兼容不再支持单独时间选择type=time及相关的 hide-second 属性(时间选可使用内置组件 picker
## 1.0.62021-03-18
- 新增 hide-second 属性,时间支持仅选择时、分
- 修复 选择跟显示的日期不一样的Bug
- 修复 chang事件触发2次的Bug
- 修复 分、秒 end 范围错误的Bug
- 优化 更好的 nvue 适配

View File

@ -0,0 +1,177 @@
<template>
<view class="uni-calendar-item__weeks-box" :class="{
'uni-calendar-item--disable':weeks.disable,
'uni-calendar-item--before-checked-x':weeks.beforeMultiple,
'uni-calendar-item--multiple': weeks.multiple,
'uni-calendar-item--after-checked-x':weeks.afterMultiple,
}" @click="choiceDate(weeks)" @mouseenter="handleMousemove(weeks)">
<view class="uni-calendar-item__weeks-box-item" :class="{
'uni-calendar-item--checked':calendar.fullDate === weeks.fullDate && (calendar.userChecked || !checkHover),
'uni-calendar-item--checked-range-text': checkHover,
'uni-calendar-item--before-checked':weeks.beforeMultiple,
'uni-calendar-item--multiple': weeks.multiple,
'uni-calendar-item--after-checked':weeks.afterMultiple,
'uni-calendar-item--disable':weeks.disable,
}">
<text v-if="selected && weeks.extraInfo" class="uni-calendar-item__weeks-box-circle"></text>
<text class="uni-calendar-item__weeks-box-text uni-calendar-item__weeks-box-text-disable uni-calendar-item--checked-text">{{weeks.date}}</text>
</view>
<view :class="{'uni-calendar-item--today': weeks.isToday}"></view>
</view>
</template>
<script>
export default {
props: {
weeks: {
type: Object,
default () {
return {}
}
},
calendar: {
type: Object,
default: () => {
return {}
}
},
selected: {
type: Array,
default: () => {
return []
}
},
checkHover: {
type: Boolean,
default: false
}
},
methods: {
choiceDate(weeks) {
this.$emit('change', weeks)
},
handleMousemove(weeks) {
this.$emit('handleMouse', weeks)
}
}
}
</script>
<style lang="scss" >
$uni-primary: #007aff !default;
.uni-calendar-item__weeks-box {
flex: 1;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
justify-content: center;
align-items: center;
margin: 1px 0;
position: relative;
}
.uni-calendar-item__weeks-box-text {
font-size: 14px;
// font-family: Lato-Bold, Lato;
font-weight: bold;
color: darken($color: $uni-primary, $amount: 40%);
}
.uni-calendar-item__weeks-box-item {
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
justify-content: center;
align-items: center;
width: 40px;
height: 40px;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
.uni-calendar-item__weeks-box-circle {
position: absolute;
top: 5px;
right: 5px;
width: 8px;
height: 8px;
border-radius: 8px;
background-color: #dd524d;
}
.uni-calendar-item__weeks-box .uni-calendar-item--disable {
cursor: default;
}
.uni-calendar-item--disable .uni-calendar-item__weeks-box-text-disable {
color: #D1D1D1;
}
.uni-calendar-item--today {
position: absolute;
top: 10px;
right: 17%;
background-color: #dd524d;
width:6px;
height: 6px;
border-radius: 50%;
}
.uni-calendar-item--extra {
color: #dd524d;
opacity: 0.8;
}
.uni-calendar-item__weeks-box .uni-calendar-item--checked {
background-color: $uni-primary;
border-radius: 50%;
box-sizing: border-box;
border: 3px solid #fff;
}
.uni-calendar-item--checked .uni-calendar-item--checked-text {
color: #fff;
}
.uni-calendar-item--multiple .uni-calendar-item--checked-range-text {
color: #333;
}
.uni-calendar-item--multiple {
background-color: #F6F7FC;
// color: #fff;
}
.uni-calendar-item--multiple .uni-calendar-item--before-checked,
.uni-calendar-item--multiple .uni-calendar-item--after-checked {
background-color: $uni-primary;
border-radius: 50%;
box-sizing: border-box;
border: 3px solid #F6F7FC;
}
.uni-calendar-item--before-checked .uni-calendar-item--checked-text,
.uni-calendar-item--after-checked .uni-calendar-item--checked-text {
color: #fff;
}
.uni-calendar-item--before-checked-x {
border-top-left-radius: 50px;
border-bottom-left-radius: 50px;
box-sizing: border-box;
background-color: #F6F7FC;
}
.uni-calendar-item--after-checked-x {
border-top-right-radius: 50px;
border-bottom-right-radius: 50px;
background-color: #F6F7FC;
}
</style>

View File

@ -0,0 +1,958 @@
<template>
<view class="uni-calendar" @mouseleave="leaveCale">
<view v-if="!insert && show" class="uni-calendar__mask" :class="{'uni-calendar--mask-show':aniMaskShow}"
@click="maskClick"></view>
<view v-if="insert || show" class="uni-calendar__content"
:class="{'uni-calendar--fixed':!insert,'uni-calendar--ani-show':aniMaskShow, 'uni-calendar__content-mobile': aniMaskShow}">
<view class="uni-calendar__header" :class="{'uni-calendar__header-mobile' :!insert}">
<view class="uni-calendar__header-btn-box" @click.stop="changeMonth('pre')">
<view class="uni-calendar__header-btn uni-calendar--left"></view>
</view>
<picker mode="date" :value="date" fields="month" @change="bindDateChange">
<text
class="uni-calendar__header-text">{{ (nowDate.year||'') + yearText + ( nowDate.month||'') + monthText}}</text>
</picker>
<view class="uni-calendar__header-btn-box" @click.stop="changeMonth('next')">
<view class="uni-calendar__header-btn uni-calendar--right"></view>
</view>
<view v-if="!insert" class="dialog-close" @click="close">
<view class="dialog-close-plus" data-id="close"></view>
<view class="dialog-close-plus dialog-close-rotate" data-id="close"></view>
</view>
</view>
<view class="uni-calendar__box">
<view v-if="showMonth" class="uni-calendar__box-bg">
<text class="uni-calendar__box-bg-text">{{nowDate.month}}</text>
</view>
<view class="uni-calendar__weeks" style="padding-bottom: 7px;">
<view class="uni-calendar__weeks-day">
<text class="uni-calendar__weeks-day-text">{{SUNText}}</text>
</view>
<view class="uni-calendar__weeks-day">
<text class="uni-calendar__weeks-day-text">{{MONText}}</text>
</view>
<view class="uni-calendar__weeks-day">
<text class="uni-calendar__weeks-day-text">{{TUEText}}</text>
</view>
<view class="uni-calendar__weeks-day">
<text class="uni-calendar__weeks-day-text">{{WEDText}}</text>
</view>
<view class="uni-calendar__weeks-day">
<text class="uni-calendar__weeks-day-text">{{THUText}}</text>
</view>
<view class="uni-calendar__weeks-day">
<text class="uni-calendar__weeks-day-text">{{FRIText}}</text>
</view>
<view class="uni-calendar__weeks-day">
<text class="uni-calendar__weeks-day-text">{{SATText}}</text>
</view>
</view>
<view class="uni-calendar__weeks" v-for="(item,weekIndex) in weeks" :key="weekIndex">
<view class="uni-calendar__weeks-item" v-for="(weeks,weeksIndex) in item" :key="weeksIndex">
<calendar-item class="uni-calendar-item--hook" :weeks="weeks" :calendar="calendar"
:selected="selected" :checkHover="range" @change="choiceDate" @handleMouse="handleMouse">
</calendar-item>
</view>
</view>
</view>
<view v-if="!insert && !range && hasTime" class="uni-date-changed uni-calendar--fixed-top"
style="padding: 0 80px;">
<view class="uni-date-changed--time-date">{{tempSingleDate ? tempSingleDate : selectDateText}}</view>
<time-picker type="time" :start="timepickerStartTime" :end="timepickerEndTime" v-model="time"
:disabled="!tempSingleDate" :border="false" :hide-second="hideSecond" class="time-picker-style">
</time-picker>
</view>
<view v-if="!insert && range && hasTime" class="uni-date-changed uni-calendar--fixed-top">
<view class="uni-date-changed--time-start">
<view class="uni-date-changed--time-date">{{tempRange.before ? tempRange.before : startDateText}}
</view>
<time-picker type="time" :start="timepickerStartTime" v-model="timeRange.startTime" :border="false"
:hide-second="hideSecond" :disabled="!tempRange.before" class="time-picker-style">
</time-picker>
</view>
<view style="line-height: 50px;">
<uni-icons type="arrowthinright" color="#999"></uni-icons>
</view>
<view class="uni-date-changed--time-end">
<view class="uni-date-changed--time-date">{{tempRange.after ? tempRange.after : endDateText}}</view>
<time-picker type="time" :end="timepickerEndTime" v-model="timeRange.endTime" :border="false"
:hide-second="hideSecond" :disabled="!tempRange.after" class="time-picker-style">
</time-picker>
</view>
</view>
<view v-if="!insert" class="uni-date-changed uni-date-btn--ok">
<view class="uni-datetime-picker--btn" @click="confirm">{{confirmText}}</view>
</view>
</view>
</view>
</template>
<script>
import {
Calendar,
getDate,
getTime
} from './util.js';
import calendarItem from './calendar-item.vue'
import timePicker from './time-picker.vue'
import {
initVueI18n
} from '@dcloudio/uni-i18n'
import i18nMessages from './i18n/index.js'
const {
t
} = initVueI18n(i18nMessages)
/**
* Calendar 日历
* @description 日历组件可以查看日期选择任意范围内的日期打点操作常用场景如酒店日期预订火车机票选择购买日期上下班打卡等
* @tutorial https://ext.dcloud.net.cn/plugin?id=56
* @property {String} date 自定义当前时间默认为今天
* @property {String} startDate 日期选择范围-开始日期
* @property {String} endDate 日期选择范围-结束日期
* @property {Boolean} range 范围选择
* @property {Boolean} insert = [true|false] 插入模式,默认为false
* @value true 弹窗模式
* @value false 插入模式
* @property {Boolean} clearDate = [true|false] 弹窗模式是否清空上次选择内容
* @property {Array} selected 打点期待格式[{date: '2019-06-27', info: '签到', data: { custom: '自定义信息', name: '自定义消息头',xxx:xxx... }}]
* @property {Boolean} showMonth 是否选择月份为背景
* @property {[String} defaultValue 选择器打开时默认显示的时间
* @event {Function} change 日期改变`insert :ture` 时生效
* @event {Function} confirm 确认选择`insert :false` 时生效
* @event {Function} monthSwitch 切换月份时触发
* @example <uni-calendar :insert="true" :start-date="'2019-3-2'":end-date="'2019-5-20'"@change="change" />
*/
export default {
components: {
calendarItem,
timePicker
},
props: {
date: {
type: String,
default: ''
},
defTime: {
type: [String, Object],
default: ''
},
selectableTimes: {
type: [Object],
default () {
return {}
}
},
selected: {
type: Array,
default () {
return []
}
},
startDate: {
type: String,
default: ''
},
endDate: {
type: String,
default: ''
},
startPlaceholder: {
type: String,
default: ''
},
endPlaceholder: {
type: String,
default: ''
},
range: {
type: Boolean,
default: false
},
hasTime: {
type: Boolean,
default: false
},
insert: {
type: Boolean,
default: true
},
showMonth: {
type: Boolean,
default: true
},
clearDate: {
type: Boolean,
default: true
},
checkHover: {
type: Boolean,
default: true
},
hideSecond: {
type: [Boolean],
default: false
},
pleStatus: {
type: Object,
default () {
return {
before: '',
after: '',
data: [],
fulldate: ''
}
}
},
defaultValue: {
type: [String, Object, Array],
default: ''
}
},
data() {
return {
show: false,
weeks: [],
calendar: {},
nowDate: {},
aniMaskShow: false,
firstEnter: true,
time: '',
timeRange: {
startTime: '',
endTime: ''
},
tempSingleDate: '',
tempRange: {
before: '',
after: ''
},
isPhone: false
}
},
watch: {
date: {
immediate: true,
handler(newVal) {
if (!this.range) {
this.tempSingleDate = newVal
setTimeout(() => {
this.init(newVal)
}, 100)
}
}
},
defTime: {
immediate: true,
handler(newVal) {
if (!this.range) {
this.time = newVal
} else {
this.timeRange.startTime = newVal.start
this.timeRange.endTime = newVal.end
}
}
},
startDate(val) {
// watch created
if (!this.cale) {
return
}
this.cale.setStartDate(val)
this.cale.setDate(this.nowDate.fullDate)
this.weeks = this.cale.weeks
},
endDate(val) {
// watch created
if (!this.cale) {
return
}
this.cale.setEndDate(val)
this.cale.setDate(this.nowDate.fullDate)
this.weeks = this.cale.weeks
},
selected(newVal) {
// watch created
if (!this.cale) {
return
}
this.cale.setSelectInfo(this.nowDate.fullDate, newVal)
this.weeks = this.cale.weeks
},
pleStatus: {
immediate: true,
handler(newVal) {
const {
before,
after,
fulldate,
which
} = newVal
this.tempRange.before = before
this.tempRange.after = after
setTimeout(() => {
if (fulldate) {
this.cale.setHoverMultiple(fulldate)
if (before && after) {
this.cale.lastHover = true
if (this.rangeWithinMonth(after, before)) return
this.setDate(before)
} else {
this.cale.setMultiple(fulldate)
this.setDate(this.nowDate.fullDate)
this.calendar.fullDate = ''
this.cale.lastHover = false
}
} else {
// watch created
if (!this.cale) {
return
}
this.cale.setDefaultMultiple(before, after)
if (which === 'left' && before) {
this.setDate(before)
this.weeks = this.cale.weeks
} else if (after) {
this.setDate(after)
this.weeks = this.cale.weeks
}
this.cale.lastHover = true
}
}, 16)
}
}
},
computed: {
timepickerStartTime() {
const activeDate = this.range ? this.tempRange.before : this.calendar.fullDate
return activeDate === this.startDate ? this.selectableTimes.start : ''
},
timepickerEndTime() {
const activeDate = this.range ? this.tempRange.after : this.calendar.fullDate
return activeDate === this.endDate ? this.selectableTimes.end : ''
},
/**
* for i18n
*/
selectDateText() {
return t("uni-datetime-picker.selectDate")
},
startDateText() {
return this.startPlaceholder || t("uni-datetime-picker.startDate")
},
endDateText() {
return this.endPlaceholder || t("uni-datetime-picker.endDate")
},
okText() {
return t("uni-datetime-picker.ok")
},
yearText() {
return t("uni-datetime-picker.year")
},
monthText() {
return t("uni-datetime-picker.month")
},
MONText() {
return t("uni-calender.MON")
},
TUEText() {
return t("uni-calender.TUE")
},
WEDText() {
return t("uni-calender.WED")
},
THUText() {
return t("uni-calender.THU")
},
FRIText() {
return t("uni-calender.FRI")
},
SATText() {
return t("uni-calender.SAT")
},
SUNText() {
return t("uni-calender.SUN")
},
confirmText() {
return t("uni-calender.confirm")
},
},
created() {
//
this.cale = new Calendar({
selected: this.selected,
startDate: this.startDate,
endDate: this.endDate,
range: this.range,
})
//
this.init(this.date)
},
mounted() {
if (typeof navigator !== "undefined") {
this.isPhone = navigator.userAgent.toLowerCase().indexOf('mobile') !== -1
return
}
const {
windowWidth
} = uni.getSystemInfoSync()
this.isPhone = windowWidth <= 500
},
methods: {
leaveCale() {
this.firstEnter = true
},
handleMouse(weeks) {
if (weeks.disable) return
if (this.cale.lastHover) return
let {
before,
after
} = this.cale.multipleStatus
if (!before) return
this.calendar = weeks
//
this.cale.setHoverMultiple(this.calendar.fullDate)
this.weeks = this.cale.weeks
// hover
if (this.firstEnter) {
this.$emit('firstEnterCale', this.cale.multipleStatus)
this.firstEnter = false
}
},
rangeWithinMonth(A, B) {
const [yearA, monthA] = A.split('-')
const [yearB, monthB] = B.split('-')
return yearA === yearB && monthA === monthB
},
//
maskClick() {
this.close()
this.$emit('maskClose')
},
clearCalender() {
if (this.range) {
this.timeRange.startTime = ''
this.timeRange.endTime = ''
this.tempRange.before = ''
this.tempRange.after = ''
this.cale.multipleStatus.before = ''
this.cale.multipleStatus.after = ''
this.cale.multipleStatus.data = []
this.cale.lastHover = false
} else {
this.time = ''
this.tempSingleDate = ''
}
this.calendar.fullDate = ''
this.setDate(new Date())
},
bindDateChange(e) {
const value = e.detail.value + '-1'
this.setDate(value)
},
/**
* 初始化日期显示
* @param {Object} date
*/
init(date) {
// watch created
if (!this.cale) {
return
}
this.cale.setDate(date || new Date())
this.weeks = this.cale.weeks
this.nowDate = this.cale.getInfo(date)
this.calendar = {
...this.nowDate
}
if (!date) {
// date
this.calendar.fullDate = ''
if (this.defaultValue && !this.range) {
//
const defaultDate = new Date(this.defaultValue)
const fullDate = getDate(defaultDate)
const year = defaultDate.getFullYear()
const month = defaultDate.getMonth() + 1
const date = defaultDate.getDate()
const day = defaultDate.getDay()
this.calendar = {
fullDate,
year,
month,
date,
day
},
this.tempSingleDate = fullDate
this.time = getTime(defaultDate, this.hideSecond)
}
}
},
/**
* 打开日历弹窗
*/
open() {
//
if (this.clearDate && !this.insert) {
this.cale.cleanMultipleStatus()
this.init(this.date)
}
this.show = true
this.$nextTick(() => {
setTimeout(() => {
this.aniMaskShow = true
}, 50)
})
},
/**
* 关闭日历弹窗
*/
close() {
this.aniMaskShow = false
this.$nextTick(() => {
setTimeout(() => {
this.show = false
this.$emit('close')
}, 300)
})
},
/**
* 确认按钮
*/
confirm() {
this.setEmit('confirm')
this.close()
},
/**
* 变化触发
*/
change() {
if (!this.insert) return
this.setEmit('change')
},
/**
* 选择月份触发
*/
monthSwitch() {
let {
year,
month
} = this.nowDate
this.$emit('monthSwitch', {
year,
month: Number(month)
})
},
/**
* 派发事件
* @param {Object} name
*/
setEmit(name) {
if (!this.range) {
if (!this.calendar.fullDate) {
this.calendar = this.cale.getInfo(new Date())
this.tempSingleDate = this.calendar.fullDate
}
if (this.hasTime && !this.time) {
this.time = getTime(new Date(), this.hideSecond)
}
}
let {
year,
month,
date,
fullDate,
extraInfo
} = this.calendar
this.$emit(name, {
range: this.cale.multipleStatus,
year,
month,
date,
time: this.time,
timeRange: this.timeRange,
fulldate: fullDate,
extraInfo: extraInfo || {}
})
},
/**
* 选择天触发
* @param {Object} weeks
*/
choiceDate(weeks) {
if (weeks.disable) return
this.calendar = weeks
this.calendar.userChecked = true
//
this.cale.setMultiple(this.calendar.fullDate, true)
this.weeks = this.cale.weeks
this.tempSingleDate = this.calendar.fullDate
const beforeDate = new Date(this.cale.multipleStatus.before).getTime()
const afterDate = new Date(this.cale.multipleStatus.after).getTime()
// before after PC
if (beforeDate > afterDate && afterDate && !this.isPhone) {
this.tempRange.before = this.cale.multipleStatus.after
this.tempRange.after = this.cale.multipleStatus.before
} else {
this.tempRange.before = this.cale.multipleStatus.before
this.tempRange.after = this.cale.multipleStatus.after
}
this.change()
},
changeMonth(type) {
let newDate
if (type === 'pre') {
newDate = this.cale.getPreMonthObj(this.nowDate.fullDate).fullDate
} else if (type === 'next') {
newDate = this.cale.getNextMonthObj(this.nowDate.fullDate).fullDate
}
this.setDate(newDate)
this.monthSwitch()
},
/**
* 设置日期
* @param {Object} date
*/
setDate(date) {
this.cale.setDate(date)
this.weeks = this.cale.weeks
this.nowDate = this.cale.getInfo(date)
}
}
}
</script>
<style lang="scss">
$uni-primary: #007aff !default;
.uni-calendar {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
}
.uni-calendar__mask {
position: fixed;
bottom: 0;
top: 0;
left: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.4);
transition-property: opacity;
transition-duration: 0.3s;
opacity: 0;
/* #ifndef APP-NVUE */
z-index: 99;
/* #endif */
}
.uni-calendar--mask-show {
opacity: 1
}
.uni-calendar--fixed {
position: fixed;
bottom: calc(var(--window-bottom));
left: 0;
right: 0;
transition-property: transform;
transition-duration: 0.3s;
transform: translateY(460px);
/* #ifndef APP-NVUE */
z-index: 99;
/* #endif */
}
.uni-calendar--ani-show {
transform: translateY(0);
}
.uni-calendar__content {
background-color: #fff;
}
.uni-calendar__content-mobile {
border-top-left-radius: 10px;
border-top-right-radius: 10px;
box-shadow: 0px 0px 5px 3px rgba(0, 0, 0, 0.1);
}
.uni-calendar__header {
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
// justify-content: center;
justify-content: space-between;
align-items: center;
height: 50px;
picker {
text-align: center !important;
width: calc(100% - 180px) !important;
}
}
.uni-calendar__header-mobile {
padding: 5px;
padding-bottom: 0;
}
.uni-calendar--fixed-top {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: space-between;
border-top-color: rgba(0, 0, 0, 0.4);
border-top-style: solid;
border-top-width: 1px;
}
.uni-calendar--fixed-width {
width: 50px;
}
.uni-calendar__backtoday {
position: absolute;
right: 0;
top: 25rpx;
padding: 0 5px;
padding-left: 10px;
height: 25px;
line-height: 25px;
font-size: 12px;
border-top-left-radius: 25px;
border-bottom-left-radius: 25px;
color: #fff;
background-color: #f1f1f1;
}
.uni-calendar__header-text {
text-align: center;
width: 100px;
font-size: 15px;
color: #666;
}
.uni-calendar__button-text {
text-align: center;
width: 100px;
font-size: 14px;
color: $uni-primary;
/* #ifndef APP-NVUE */
letter-spacing: 3px;
/* #endif */
}
.uni-calendar__header-btn-box {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
justify-content: center;
width: 50px;
height: 50px;
}
.uni-calendar__header-btn {
width: 9px;
height: 9px;
border-left-color: #808080;
border-left-style: solid;
border-left-width: 1px;
border-top-color: #555555;
border-top-style: solid;
border-top-width: 1px;
}
.uni-calendar--left {
transform: rotate(-45deg);
}
.uni-calendar--right {
transform: rotate(135deg);
}
.uni-calendar__weeks {
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
}
.uni-calendar__weeks-item {
flex: 1;
}
.uni-calendar__weeks-day {
flex: 1;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
justify-content: center;
align-items: center;
height: 40px;
border-bottom-color: #F5F5F5;
border-bottom-style: solid;
border-bottom-width: 1px;
}
.uni-calendar__weeks-day-text {
font-size: 12px;
color: #B2B2B2;
}
.uni-calendar__box {
position: relative;
// padding: 0 10px;
padding-bottom: 7px;
}
.uni-calendar__box-bg {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.uni-calendar__box-bg-text {
font-size: 200px;
font-weight: bold;
color: #999;
opacity: 0.1;
text-align: center;
/* #ifndef APP-NVUE */
line-height: 1;
/* #endif */
}
.uni-date-changed {
padding: 0 10px;
// line-height: 50px;
text-align: center;
color: #333;
border-top-color: #DCDCDC;
;
border-top-style: solid;
border-top-width: 1px;
flex: 1;
}
.uni-date-btn--ok {
padding: 20px 15px;
}
.uni-date-changed--time-start {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
align-items: center;
}
.uni-date-changed--time-end {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
align-items: center;
}
.uni-date-changed--time-date {
color: #999;
line-height: 50px;
/* #ifdef MP-TOUTIAO */
font-size: 16px;
/* #endif */
margin-right: 5px;
// opacity: 0.6;
}
.time-picker-style {
// width: 62px;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
justify-content: center;
align-items: center
}
.mr-10 {
margin-right: 10px;
}
.dialog-close {
position: absolute;
top: 0;
right: 50px;
bottom: 0;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
width: 50px;
justify-content: center;
// padding: 0 50px;
margin-top:5px;
}
.dialog-close-plus {
width: 16px;
height: 2px;
background-color: #737987;
border-radius: 2px;
transform: rotate(45deg);
}
.dialog-close-rotate {
position: absolute;
transform: rotate(-45deg);
}
.uni-datetime-picker--btn {
border-radius: 100px;
height: 40px;
line-height: 40px;
background-color: $uni-primary;
color: #fff;
font-size: 16px;
letter-spacing: 2px;
}
/* #ifndef APP-NVUE */
.uni-datetime-picker--btn:active {
opacity: 0.7;
}
/* #endif */
</style>

View File

@ -0,0 +1,22 @@
{
"uni-datetime-picker.selectDate": "select date",
"uni-datetime-picker.selectTime": "select time",
"uni-datetime-picker.selectDateTime": "select date and time",
"uni-datetime-picker.startDate": "start date",
"uni-datetime-picker.endDate": "end date",
"uni-datetime-picker.startTime": "start time",
"uni-datetime-picker.endTime": "end time",
"uni-datetime-picker.ok": "ok",
"uni-datetime-picker.clear": "clear",
"uni-datetime-picker.cancel": "cancel",
"uni-datetime-picker.year": "-",
"uni-datetime-picker.month": "",
"uni-calender.MON": "MON",
"uni-calender.TUE": "TUE",
"uni-calender.WED": "WED",
"uni-calender.THU": "THU",
"uni-calender.FRI": "FRI",
"uni-calender.SAT": "SAT",
"uni-calender.SUN": "SUN",
"uni-calender.confirm": "confirm"
}

View File

@ -0,0 +1,8 @@
import en from './en.json'
import zhHans from './zh-Hans.json'
import zhHant from './zh-Hant.json'
export default {
en,
'zh-Hans': zhHans,
'zh-Hant': zhHant
}

View File

@ -0,0 +1,22 @@
{
"uni-datetime-picker.selectDate": "选择日期",
"uni-datetime-picker.selectTime": "选择时间",
"uni-datetime-picker.selectDateTime": "选择日期时间",
"uni-datetime-picker.startDate": "开始日期",
"uni-datetime-picker.endDate": "结束日期",
"uni-datetime-picker.startTime": "开始时间",
"uni-datetime-picker.endTime": "结束时间",
"uni-datetime-picker.ok": "确定",
"uni-datetime-picker.clear": "清除",
"uni-datetime-picker.cancel": "取消",
"uni-datetime-picker.year": "年",
"uni-datetime-picker.month": "月",
"uni-calender.SUN": "日",
"uni-calender.MON": "一",
"uni-calender.TUE": "二",
"uni-calender.WED": "三",
"uni-calender.THU": "四",
"uni-calender.FRI": "五",
"uni-calender.SAT": "六",
"uni-calender.confirm": "确认"
}

View File

@ -0,0 +1,22 @@
{
"uni-datetime-picker.selectDate": "選擇日期",
"uni-datetime-picker.selectTime": "選擇時間",
"uni-datetime-picker.selectDateTime": "選擇日期時間",
"uni-datetime-picker.startDate": "開始日期",
"uni-datetime-picker.endDate": "結束日期",
"uni-datetime-picker.startTime": "開始时间",
"uni-datetime-picker.endTime": "結束时间",
"uni-datetime-picker.ok": "確定",
"uni-datetime-picker.clear": "清除",
"uni-datetime-picker.cancel": "取消",
"uni-datetime-picker.year": "年",
"uni-datetime-picker.month": "月",
"uni-calender.SUN": "日",
"uni-calender.MON": "一",
"uni-calender.TUE": "二",
"uni-calender.WED": "三",
"uni-calender.THU": "四",
"uni-calender.FRI": "五",
"uni-calender.SAT": "六",
"uni-calender.confirm": "確認"
}

View File

@ -0,0 +1,934 @@
<template>
<view class="uni-datetime-picker">
<view @click="initTimePicker">
<slot>
<view class="uni-datetime-picker-timebox-pointer"
:class="{'uni-datetime-picker-disabled': disabled, 'uni-datetime-picker-timebox': border}">
<text class="uni-datetime-picker-text">{{time}}</text>
<view v-if="!time" class="uni-datetime-picker-time">
<text class="uni-datetime-picker-text">{{selectTimeText}}</text>
</view>
</view>
</slot>
</view>
<view v-if="visible" id="mask" class="uni-datetime-picker-mask" @click="tiggerTimePicker"></view>
<view v-if="visible" class="uni-datetime-picker-popup" :class="[dateShow && timeShow ? '' : 'fix-nvue-height']"
:style="fixNvueBug">
<view class="uni-title">
<text class="uni-datetime-picker-text">{{selectTimeText}}</text>
</view>
<view v-if="dateShow" class="uni-datetime-picker__container-box">
<picker-view class="uni-datetime-picker-view" :indicator-style="indicatorStyle" :value="ymd"
@change="bindDateChange">
<picker-view-column>
<view class="uni-datetime-picker-item" v-for="(item,index) in years" :key="index">
<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
</view>
</picker-view-column>
<picker-view-column>
<view class="uni-datetime-picker-item" v-for="(item,index) in months" :key="index">
<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
</view>
</picker-view-column>
<picker-view-column>
<view class="uni-datetime-picker-item" v-for="(item,index) in days" :key="index">
<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
</view>
</picker-view-column>
</picker-view>
<!-- 兼容 nvue 不支持伪类 -->
<text class="uni-datetime-picker-sign sign-left">-</text>
<text class="uni-datetime-picker-sign sign-right">-</text>
</view>
<view v-if="timeShow" class="uni-datetime-picker__container-box">
<picker-view class="uni-datetime-picker-view" :class="[hideSecond ? 'time-hide-second' : '']"
:indicator-style="indicatorStyle" :value="hms" @change="bindTimeChange">
<picker-view-column>
<view class="uni-datetime-picker-item" v-for="(item,index) in hours" :key="index">
<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
</view>
</picker-view-column>
<picker-view-column>
<view class="uni-datetime-picker-item" v-for="(item,index) in minutes" :key="index">
<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
</view>
</picker-view-column>
<picker-view-column v-if="!hideSecond">
<view class="uni-datetime-picker-item" v-for="(item,index) in seconds" :key="index">
<text class="uni-datetime-picker-item">{{lessThanTen(item)}}</text>
</view>
</picker-view-column>
</picker-view>
<!-- 兼容 nvue 不支持伪类 -->
<text class="uni-datetime-picker-sign" :class="[hideSecond ? 'sign-center' : 'sign-left']">:</text>
<text v-if="!hideSecond" class="uni-datetime-picker-sign sign-right">:</text>
</view>
<view class="uni-datetime-picker-btn">
<view @click="clearTime">
<text class="uni-datetime-picker-btn-text">{{clearText}}</text>
</view>
<view class="uni-datetime-picker-btn-group">
<view class="uni-datetime-picker-cancel" @click="tiggerTimePicker">
<text class="uni-datetime-picker-btn-text">{{cancelText}}</text>
</view>
<view @click="setTime">
<text class="uni-datetime-picker-btn-text">{{okText}}</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { initVueI18n } from '@dcloudio/uni-i18n'
import i18nMessages from './i18n/index.js'
const { t } = initVueI18n(i18nMessages)
import { fixIosDateFormat } from './util'
/**
* DatetimePicker 时间选择器
* @description 可以同时选择日期和时间的选择器
* @tutorial https://ext.dcloud.net.cn/plugin?id=xxx
* @property {String} type = [datetime | date | time] 显示模式
* @property {Boolean} multiple = [true|false] 是否多选
* @property {String|Number} value 默认值
* @property {String|Number} start 起始日期或时间
* @property {String|Number} end 起始日期或时间
* @property {String} return-type = [timestamp | string]
* @event {Function} change 选中发生变化触发
*/
export default {
name: 'UniDatetimePicker',
data() {
return {
indicatorStyle: `height: 50px;`,
visible: false,
fixNvueBug: {},
dateShow: true,
timeShow: true,
title: '日期和时间',
//
time: '',
//
year: 1920,
month: 0,
day: 0,
hour: 0,
minute: 0,
second: 0,
//
startYear: 1920,
startMonth: 1,
startDay: 1,
startHour: 0,
startMinute: 0,
startSecond: 0,
//
endYear: 2120,
endMonth: 12,
endDay: 31,
endHour: 23,
endMinute: 59,
endSecond: 59,
}
},
props: {
type: {
type: String,
default: 'datetime'
},
value: {
type: [String, Number],
default: ''
},
modelValue: {
type: [String, Number],
default: ''
},
start: {
type: [Number, String],
default: ''
},
end: {
type: [Number, String],
default: ''
},
returnType: {
type: String,
default: 'string'
},
disabled: {
type: [Boolean, String],
default: false
},
border: {
type: [Boolean, String],
default: true
},
hideSecond: {
type: [Boolean, String],
default: false
}
},
watch: {
// #ifndef VUE3
value: {
handler(newVal) {
if (newVal) {
this.parseValue(fixIosDateFormat(newVal))
this.initTime(false)
} else {
this.time = ''
this.parseValue(Date.now())
}
},
immediate: true
},
// #endif
// #ifdef VUE3
modelValue: {
handler(newVal) {
if (newVal) {
this.parseValue(fixIosDateFormat(newVal))
this.initTime(false)
} else {
this.time = ''
this.parseValue(Date.now())
}
},
immediate: true
},
// #endif
type: {
handler(newValue) {
if (newValue === 'date') {
this.dateShow = true
this.timeShow = false
this.title = '日期'
} else if (newValue === 'time') {
this.dateShow = false
this.timeShow = true
this.title = '时间'
} else {
this.dateShow = true
this.timeShow = true
this.title = '日期和时间'
}
},
immediate: true
},
start: {
handler(newVal) {
this.parseDatetimeRange(fixIosDateFormat(newVal), 'start')
},
immediate: true
},
end: {
handler(newVal) {
this.parseDatetimeRange(fixIosDateFormat(newVal), 'end')
},
immediate: true
},
//
months(newVal) {
this.checkValue('month', this.month, newVal)
},
days(newVal) {
this.checkValue('day', this.day, newVal)
},
hours(newVal) {
this.checkValue('hour', this.hour, newVal)
},
minutes(newVal) {
this.checkValue('minute', this.minute, newVal)
},
seconds(newVal) {
this.checkValue('second', this.second, newVal)
}
},
computed: {
//
years() {
return this.getCurrentRange('year')
},
months() {
return this.getCurrentRange('month')
},
days() {
return this.getCurrentRange('day')
},
hours() {
return this.getCurrentRange('hour')
},
minutes() {
return this.getCurrentRange('minute')
},
seconds() {
return this.getCurrentRange('second')
},
// picker
ymd() {
return [this.year - this.minYear, this.month - this.minMonth, this.day - this.minDay]
},
hms() {
return [this.hour - this.minHour, this.minute - this.minMinute, this.second - this.minSecond]
},
// date start
currentDateIsStart() {
return this.year === this.startYear && this.month === this.startMonth && this.day === this.startDay
},
// date end
currentDateIsEnd() {
return this.year === this.endYear && this.month === this.endMonth && this.day === this.endDay
},
//
minYear() {
return this.startYear
},
maxYear() {
return this.endYear
},
minMonth() {
if (this.year === this.startYear) {
return this.startMonth
} else {
return 1
}
},
maxMonth() {
if (this.year === this.endYear) {
return this.endMonth
} else {
return 12
}
},
minDay() {
if (this.year === this.startYear && this.month === this.startMonth) {
return this.startDay
} else {
return 1
}
},
maxDay() {
if (this.year === this.endYear && this.month === this.endMonth) {
return this.endDay
} else {
return this.daysInMonth(this.year, this.month)
}
},
minHour() {
if (this.type === 'datetime') {
if (this.currentDateIsStart) {
return this.startHour
} else {
return 0
}
}
if (this.type === 'time') {
return this.startHour
}
},
maxHour() {
if (this.type === 'datetime') {
if (this.currentDateIsEnd) {
return this.endHour
} else {
return 23
}
}
if (this.type === 'time') {
return this.endHour
}
},
minMinute() {
if (this.type === 'datetime') {
if (this.currentDateIsStart && this.hour === this.startHour) {
return this.startMinute
} else {
return 0
}
}
if (this.type === 'time') {
if (this.hour === this.startHour) {
return this.startMinute
} else {
return 0
}
}
},
maxMinute() {
if (this.type === 'datetime') {
if (this.currentDateIsEnd && this.hour === this.endHour) {
return this.endMinute
} else {
return 59
}
}
if (this.type === 'time') {
if (this.hour === this.endHour) {
return this.endMinute
} else {
return 59
}
}
},
minSecond() {
if (this.type === 'datetime') {
if (this.currentDateIsStart && this.hour === this.startHour && this.minute === this.startMinute) {
return this.startSecond
} else {
return 0
}
}
if (this.type === 'time') {
if (this.hour === this.startHour && this.minute === this.startMinute) {
return this.startSecond
} else {
return 0
}
}
},
maxSecond() {
if (this.type === 'datetime') {
if (this.currentDateIsEnd && this.hour === this.endHour && this.minute === this.endMinute) {
return this.endSecond
} else {
return 59
}
}
if (this.type === 'time') {
if (this.hour === this.endHour && this.minute === this.endMinute) {
return this.endSecond
} else {
return 59
}
}
},
/**
* for i18n
*/
selectTimeText() {
return t("uni-datetime-picker.selectTime")
},
okText() {
return t("uni-datetime-picker.ok")
},
clearText() {
return t("uni-datetime-picker.clear")
},
cancelText() {
return t("uni-datetime-picker.cancel")
}
},
mounted() {
// #ifdef APP-NVUE
const res = uni.getSystemInfoSync();
this.fixNvueBug = {
top: res.windowHeight / 2,
left: res.windowWidth / 2
}
// #endif
},
methods: {
/**
* @param {Object} item
* 小于 10 在前面加个 0
*/
lessThanTen(item) {
return item < 10 ? '0' + item : item
},
/**
* 解析时分秒字符串例如00:00:00
* @param {String} timeString
*/
parseTimeType(timeString) {
if (timeString) {
let timeArr = timeString.split(':')
this.hour = Number(timeArr[0])
this.minute = Number(timeArr[1])
this.second = Number(timeArr[2])
}
},
/**
* 解析选择器初始值类型可以是字符串时间戳例如2000-10-02'08:30:00' 1610695109000
* @param {String | Number} datetime
*/
initPickerValue(datetime) {
let defaultValue = null
if (datetime) {
defaultValue = this.compareValueWithStartAndEnd(datetime, this.start, this.end)
} else {
defaultValue = Date.now()
defaultValue = this.compareValueWithStartAndEnd(defaultValue, this.start, this.end)
}
this.parseValue(defaultValue)
},
/**
* 初始值规则
* - 用户设置初始值 value
* - 设置了起始时间 start终止时间 end start < value < end初始值为 value 否则初始值为 start
* - 只设置了起始时间 start start < value初始值为 value否则初始值为 start
* - 只设置了终止时间 end value < end初始值为 value否则初始值为 end
* - 无起始终止时间则初始值为 value
* - 无初始值 value则初始值为当前本地时间 Date.now()
* @param {Object} value
* @param {Object} dateBase
*/
compareValueWithStartAndEnd(value, start, end) {
let winner = null
value = this.superTimeStamp(value)
start = this.superTimeStamp(start)
end = this.superTimeStamp(end)
if (start && end) {
if (value < start) {
winner = new Date(start)
} else if (value > end) {
winner = new Date(end)
} else {
winner = new Date(value)
}
} else if (start && !end) {
winner = start <= value ? new Date(value) : new Date(start)
} else if (!start && end) {
winner = value <= end ? new Date(value) : new Date(end)
} else {
winner = new Date(value)
}
return winner
},
/**
* 转换为可比较的时间戳接受日期时分秒时间戳
* @param {Object} value
*/
superTimeStamp(value) {
let dateBase = ''
if (this.type === 'time' && value && typeof value === 'string') {
const now = new Date()
const year = now.getFullYear()
const month = now.getMonth() + 1
const day = now.getDate()
dateBase = year + '/' + month + '/' + day + ' '
}
if (Number(value)) {
value = parseInt(value)
dateBase = 0
}
return this.createTimeStamp(dateBase + value)
},
/**
* 解析默认值 value字符串时间戳
* @param {Object} defaultTime
*/
parseValue(value) {
if (!value) {
return
}
if (this.type === 'time' && typeof value === "string") {
this.parseTimeType(value)
} else {
let defaultDate = null
defaultDate = new Date(value)
if (this.type !== 'time') {
this.year = defaultDate.getFullYear()
this.month = defaultDate.getMonth() + 1
this.day = defaultDate.getDate()
}
if (this.type !== 'date') {
this.hour = defaultDate.getHours()
this.minute = defaultDate.getMinutes()
this.second = defaultDate.getSeconds()
}
}
if (this.hideSecond) {
this.second = 0
}
},
/**
* 解析可选择时间范围 startend年月日字符串时间戳
* @param {Object} defaultTime
*/
parseDatetimeRange(point, pointType) {
//
if (!point) {
if (pointType === 'start') {
this.startYear = 1920
this.startMonth = 1
this.startDay = 1
this.startHour = 0
this.startMinute = 0
this.startSecond = 0
}
if (pointType === 'end') {
this.endYear = 2120
this.endMonth = 12
this.endDay = 31
this.endHour = 23
this.endMinute = 59
this.endSecond = 59
}
return
}
if (this.type === 'time') {
const pointArr = point.split(':')
this[pointType + 'Hour'] = Number(pointArr[0])
this[pointType + 'Minute'] = Number(pointArr[1])
this[pointType + 'Second'] = Number(pointArr[2])
} else {
if (!point) {
pointType === 'start' ? this.startYear = this.year - 60 : this.endYear = this.year + 60
return
}
if (Number(point)) {
point = parseInt(point)
}
// datetime end ,
const hasTime = /[0-9]:[0-9]/
if (this.type === 'datetime' && pointType === 'end' && typeof point === 'string' && !hasTime.test(
point)) {
point = point + ' 23:59:59'
}
const pointDate = new Date(point)
this[pointType + 'Year'] = pointDate.getFullYear()
this[pointType + 'Month'] = pointDate.getMonth() + 1
this[pointType + 'Day'] = pointDate.getDate()
if (this.type === 'datetime') {
this[pointType + 'Hour'] = pointDate.getHours()
this[pointType + 'Minute'] = pointDate.getMinutes()
this[pointType + 'Second'] = pointDate.getSeconds()
}
}
},
//
getCurrentRange(value) {
const range = []
for (let i = this['min' + this.capitalize(value)]; i <= this['max' + this.capitalize(value)]; i++) {
range.push(i)
}
return range
},
//
capitalize(str) {
return str.charAt(0).toUpperCase() + str.slice(1)
},
//
checkValue(name, value, values) {
if (values.indexOf(value) === -1) {
this[name] = values[0]
}
},
//
daysInMonth(year, month) { // Use 1 for January, 2 for February, etc.
return new Date(year, month, 0).getDate();
},
// iOSsafari
fixIosDateFormat(value) {
if (typeof value === 'string') {
value = value.replace(/-/g, '/')
}
return value
},
/**
* 生成时间戳
* @param {Object} time
*/
createTimeStamp(time) {
if (!time) return
if (typeof time === "number") {
return time
} else {
time = time.replace(/-/g, '/')
if (this.type === 'date') {
time = time + ' ' + '00:00:00'
}
return Date.parse(time)
}
},
/**
* 生成日期或时间的字符串
*/
createDomSting() {
const yymmdd = this.year +
'-' +
this.lessThanTen(this.month) +
'-' +
this.lessThanTen(this.day)
let hhmmss = this.lessThanTen(this.hour) +
':' +
this.lessThanTen(this.minute)
if (!this.hideSecond) {
hhmmss = hhmmss + ':' + this.lessThanTen(this.second)
}
if (this.type === 'date') {
return yymmdd
} else if (this.type === 'time') {
return hhmmss
} else {
return yymmdd + ' ' + hhmmss
}
},
/**
* 初始化返回值并抛出 change 事件
*/
initTime(emit = true) {
this.time = this.createDomSting()
if (!emit) return
if (this.returnType === 'timestamp' && this.type !== 'time') {
this.$emit('change', this.createTimeStamp(this.time))
this.$emit('input', this.createTimeStamp(this.time))
this.$emit('update:modelValue', this.createTimeStamp(this.time))
} else {
this.$emit('change', this.time)
this.$emit('input', this.time)
this.$emit('update:modelValue', this.time)
}
},
/**
* 用户选择日期或时间更新 data
* @param {Object} e
*/
bindDateChange(e) {
const val = e.detail.value
this.year = this.years[val[0]]
this.month = this.months[val[1]]
this.day = this.days[val[2]]
},
bindTimeChange(e) {
const val = e.detail.value
this.hour = this.hours[val[0]]
this.minute = this.minutes[val[1]]
this.second = this.seconds[val[2]]
},
/**
* 初始化弹出层
*/
initTimePicker() {
if (this.disabled) return
const value = fixIosDateFormat(this.time)
this.initPickerValue(value)
this.visible = !this.visible
},
/**
* 触发或关闭弹框
*/
tiggerTimePicker(e) {
this.visible = !this.visible
},
/**
* 用户点击清空按钮清空当前值
*/
clearTime() {
this.time = ''
this.$emit('change', this.time)
this.$emit('input', this.time)
this.$emit('update:modelValue', this.time)
this.tiggerTimePicker()
},
/**
* 用户点击确定按钮
*/
setTime() {
this.initTime()
this.tiggerTimePicker()
}
}
}
</script>
<style lang="scss">
$uni-primary: #007aff !default;
.uni-datetime-picker {
/* #ifndef APP-NVUE */
/* width: 100%; */
/* #endif */
}
.uni-datetime-picker-view {
height: 130px;
width: 270px;
/* #ifndef APP-NVUE */
cursor: pointer;
/* #endif */
}
.uni-datetime-picker-item {
height: 50px;
line-height: 50px;
text-align: center;
font-size: 14px;
}
.uni-datetime-picker-btn {
margin-top: 60px;
/* #ifndef APP-NVUE */
display: flex;
cursor: pointer;
/* #endif */
flex-direction: row;
justify-content: space-between;
}
.uni-datetime-picker-btn-text {
font-size: 14px;
color: $uni-primary;
}
.uni-datetime-picker-btn-group {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
}
.uni-datetime-picker-cancel {
margin-right: 30px;
}
.uni-datetime-picker-mask {
position: fixed;
bottom: 0px;
top: 0px;
left: 0px;
right: 0px;
background-color: rgba(0, 0, 0, 0.4);
transition-duration: 0.3s;
z-index: 998;
}
.uni-datetime-picker-popup {
border-radius: 8px;
padding: 30px;
width: 270px;
/* #ifdef APP-NVUE */
height: 500px;
/* #endif */
/* #ifdef APP-NVUE */
width: 330px;
/* #endif */
background-color: #fff;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
transition-duration: 0.3s;
z-index: 999;
}
.fix-nvue-height {
/* #ifdef APP-NVUE */
height: 330px;
/* #endif */
}
.uni-datetime-picker-time {
color: grey;
}
.uni-datetime-picker-column {
height: 50px;
}
.uni-datetime-picker-timebox {
border: 1px solid #E5E5E5;
border-radius: 5px;
padding: 7px 10px;
/* #ifndef APP-NVUE */
box-sizing: border-box;
cursor: pointer;
/* #endif */
}
.uni-datetime-picker-timebox-pointer {
/* #ifndef APP-NVUE */
cursor: pointer;
/* #endif */
}
.uni-datetime-picker-disabled {
opacity: 0.4;
/* #ifdef H5 */
cursor: not-allowed !important;
/* #endif */
}
.uni-datetime-picker-text {
font-size: 14px;
line-height: 50px
}
.uni-datetime-picker-sign {
position: absolute;
top: 45px;
/* 减掉 10px 的元素高度兼容nvue */
color: #999;
/* #ifdef APP-NVUE */
font-size: 16px;
/* #endif */
}
.sign-left {
left: 86px;
}
.sign-right {
right: 86px;
}
.sign-center {
left: 135px;
}
.uni-datetime-picker__container-box {
position: relative;
display: flex;
align-items: center;
justify-content: center;
margin-top: 40px;
}
.time-hide-second {
width: 180px;
}
</style>

View File

@ -0,0 +1,421 @@
class Calendar {
constructor({
selected,
startDate,
endDate,
range,
} = {}) {
// 当前日期
this.date = this.getDateObj(new Date()) // 当前初入日期
// 打点信息
this.selected = selected || [];
// 起始时间
this.startDate = startDate
// 终止时间
this.endDate = endDate
// 是否范围选择
this.range = range
// 多选状态
this.cleanMultipleStatus()
// 每周日期
this.weeks = {}
this.lastHover = false
}
/**
* 设置日期
* @param {Object} date
*/
setDate(date) {
const selectDate = this.getDateObj(date)
this.getWeeks(selectDate.fullDate)
}
/**
* 清理多选状态
*/
cleanMultipleStatus() {
this.multipleStatus = {
before: '',
after: '',
data: []
}
}
setStartDate(startDate) {
this.startDate = startDate
}
setEndDate(endDate) {
this.endDate = endDate
}
getPreMonthObj(date) {
date = fixIosDateFormat(date)
date = new Date(date)
const oldMonth = date.getMonth()
date.setMonth(oldMonth - 1)
const newMonth = date.getMonth()
if (oldMonth !== 0 && newMonth - oldMonth === 0) {
date.setMonth(newMonth - 1)
}
return this.getDateObj(date)
}
getNextMonthObj(date) {
date = fixIosDateFormat(date)
date = new Date(date)
const oldMonth = date.getMonth()
date.setMonth(oldMonth + 1)
const newMonth = date.getMonth()
if (newMonth - oldMonth > 1) {
date.setMonth(newMonth - 1)
}
return this.getDateObj(date)
}
/**
* 获取指定格式Date对象
*/
getDateObj(date) {
date = fixIosDateFormat(date)
date = new Date(date)
return {
fullDate: getDate(date),
year: date.getFullYear(),
month: addZero(date.getMonth() + 1),
date: addZero(date.getDate()),
day: date.getDay()
}
}
/**
* 获取上一个月日期集合
*/
getPreMonthDays(amount, dateObj) {
const result = []
for (let i = amount - 1; i >= 0; i--) {
const month = dateObj.month - 1
result.push({
date: new Date(dateObj.year, month, -i).getDate(),
month,
disable: true
})
}
return result
}
/**
* 获取本月日期集合
*/
getCurrentMonthDays(amount, dateObj) {
const result = []
const fullDate = this.date.fullDate
for (let i = 1; i <= amount; i++) {
const currentDate = `${dateObj.year}-${dateObj.month}-${addZero(i)}`
const isToday = fullDate === currentDate
// 获取打点信息
const info = this.selected && this.selected.find((item) => {
if (this.dateEqual(currentDate, item.date)) {
return item
}
})
// 日期禁用
let disableBefore = true
let disableAfter = true
if (this.startDate) {
disableBefore = dateCompare(this.startDate, currentDate)
}
if (this.endDate) {
disableAfter = dateCompare(currentDate, this.endDate)
}
let multiples = this.multipleStatus.data
let multiplesStatus = -1
if (this.range && multiples) {
multiplesStatus = multiples.findIndex((item) => {
return this.dateEqual(item, currentDate)
})
}
const checked = multiplesStatus !== -1
result.push({
fullDate: currentDate,
year: dateObj.year,
date: i,
multiple: this.range ? checked : false,
beforeMultiple: this.isLogicBefore(currentDate, this.multipleStatus.before, this.multipleStatus.after),
afterMultiple: this.isLogicAfter(currentDate, this.multipleStatus.before, this.multipleStatus.after),
month: dateObj.month,
disable: (this.startDate && !dateCompare(this.startDate, currentDate)) || (this.endDate && !dateCompare(
currentDate, this.endDate)),
isToday,
userChecked: false,
extraInfo: info
})
}
return result
}
/**
* 获取下一个月日期集合
*/
_getNextMonthDays(amount, dateObj) {
const result = []
const month = dateObj.month + 1
for (let i = 1; i <= amount; i++) {
result.push({
date: i,
month,
disable: true
})
}
return result
}
/**
* 获取当前日期详情
* @param {Object} date
*/
getInfo(date) {
if (!date) {
date = new Date()
}
return this.calendar.find(item => item.fullDate === this.getDateObj(date).fullDate)
}
/**
* 比较时间是否相等
*/
dateEqual(before, after) {
before = new Date(fixIosDateFormat(before))
after = new Date(fixIosDateFormat(after))
return before.valueOf() === after.valueOf()
}
/**
* 比较真实起始日期
*/
isLogicBefore(currentDate, before, after) {
let logicBefore = before
if (before && after) {
logicBefore = dateCompare(before, after) ? before : after
}
return this.dateEqual(logicBefore, currentDate)
}
isLogicAfter(currentDate, before, after) {
let logicAfter = after
if (before && after) {
logicAfter = dateCompare(before, after) ? after : before
}
return this.dateEqual(logicAfter, currentDate)
}
/**
* 获取日期范围内所有日期
* @param {Object} begin
* @param {Object} end
*/
geDateAll(begin, end) {
var arr = []
var ab = begin.split('-')
var ae = end.split('-')
var db = new Date()
db.setFullYear(ab[0], ab[1] - 1, ab[2])
var de = new Date()
de.setFullYear(ae[0], ae[1] - 1, ae[2])
var unixDb = db.getTime() - 24 * 60 * 60 * 1000
var unixDe = de.getTime() - 24 * 60 * 60 * 1000
for (var k = unixDb; k <= unixDe;) {
k = k + 24 * 60 * 60 * 1000
arr.push(this.getDateObj(new Date(parseInt(k))).fullDate)
}
return arr
}
/**
* 获取多选状态
*/
setMultiple(fullDate) {
if (!this.range) return
let {
before,
after
} = this.multipleStatus
if (before && after) {
if (!this.lastHover) {
this.lastHover = true
return
}
this.multipleStatus.before = fullDate
this.multipleStatus.after = ''
this.multipleStatus.data = []
this.multipleStatus.fulldate = ''
this.lastHover = false
} else {
if (!before) {
this.multipleStatus.before = fullDate
this.multipleStatus.after = undefined;
this.lastHover = false
} else {
this.multipleStatus.after = fullDate
if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus
.after);
} else {
this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus
.before);
}
this.lastHover = true
}
}
this.getWeeks(fullDate)
}
/**
* 鼠标 hover 更新多选状态
*/
setHoverMultiple(fullDate) {
//抖音小程序点击会触发hover事件需要避免一下
// #ifndef MP-TOUTIAO
if (!this.range || this.lastHover) return
const {
before
} = this.multipleStatus
if (!before) {
this.multipleStatus.before = fullDate
} else {
this.multipleStatus.after = fullDate
if (dateCompare(this.multipleStatus.before, this.multipleStatus.after)) {
this.multipleStatus.data = this.geDateAll(this.multipleStatus.before, this.multipleStatus.after);
} else {
this.multipleStatus.data = this.geDateAll(this.multipleStatus.after, this.multipleStatus.before);
}
}
this.getWeeks(fullDate)
// #endif
}
/**
* 更新默认值多选状态
*/
setDefaultMultiple(before, after) {
this.multipleStatus.before = before
this.multipleStatus.after = after
if (before && after) {
if (dateCompare(before, after)) {
this.multipleStatus.data = this.geDateAll(before, after);
this.getWeeks(after)
} else {
this.multipleStatus.data = this.geDateAll(after, before);
this.getWeeks(before)
}
}
}
/**
* 获取每周数据
* @param {Object} dateData
*/
getWeeks(dateData) {
const {
year,
month,
} = this.getDateObj(dateData)
const preMonthDayAmount = new Date(year, month - 1, 1).getDay()
const preMonthDays = this.getPreMonthDays(preMonthDayAmount, this.getDateObj(dateData))
const currentMonthDayAmount = new Date(year, month, 0).getDate()
const currentMonthDays = this.getCurrentMonthDays(currentMonthDayAmount, this.getDateObj(dateData))
const nextMonthDayAmount = 42 - preMonthDayAmount - currentMonthDayAmount
const nextMonthDays = this._getNextMonthDays(nextMonthDayAmount, this.getDateObj(dateData))
const calendarDays = [...preMonthDays, ...currentMonthDays, ...nextMonthDays]
const weeks = new Array(6)
for (let i = 0; i < calendarDays.length; i++) {
const index = Math.floor(i / 7)
if (!weeks[index]) {
weeks[index] = new Array(7)
}
weeks[index][i % 7] = calendarDays[i]
}
this.calendar = calendarDays
this.weeks = weeks
}
}
function getDateTime(date, hideSecond) {
return `${getDate(date)} ${getTime(date, hideSecond)}`
}
function getDate(date) {
date = fixIosDateFormat(date)
date = new Date(date)
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
return `${year}-${addZero(month)}-${addZero(day)}`
}
function getTime(date, hideSecond) {
date = fixIosDateFormat(date)
date = new Date(date)
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
return hideSecond ? `${addZero(hour)}:${addZero(minute)}` : `${addZero(hour)}:${addZero(minute)}:${addZero(second)}`
}
function addZero(num) {
if (num < 10) {
num = `0${num}`
}
return num
}
function getDefaultSecond(hideSecond) {
return hideSecond ? '00:00' : '00:00:00'
}
function dateCompare(startDate, endDate) {
startDate = new Date(fixIosDateFormat(startDate))
endDate = new Date(fixIosDateFormat(endDate))
return startDate <= endDate
}
function checkDate(date) {
const dateReg = /((19|20)\d{2})(-|\/)\d{1,2}(-|\/)\d{1,2}/g
return date.match(dateReg)
}
//ios低版本15及以下无法匹配 没有 ’秒‘ 时的情况,所以需要在末尾 秒 加上 问号
const dateTimeReg = /^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])( [0-5]?[0-9]:[0-5]?[0-9](:[0-5]?[0-9])?)?$/;
function fixIosDateFormat(value) {
if (typeof value === 'string' && dateTimeReg.test(value)) {
value = value.replace(/-/g, '/')
}
return value
}
export {
Calendar,
getDateTime,
getDate,
getTime,
addZero,
getDefaultSecond,
dateCompare,
checkDate,
fixIosDateFormat
}

View File

@ -0,0 +1,88 @@
{
"id": "uni-datetime-picker",
"displayName": "uni-datetime-picker 日期选择器",
"version": "2.2.34",
"description": "uni-datetime-picker 日期时间选择器,支持日历,支持范围选择",
"keywords": [
"uni-datetime-picker",
"uni-ui",
"uniui",
"日期时间选择器",
"日期时间"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
"type": "component-vue"
},
"uni_modules": {
"dependencies": [
"uni-scss",
"uni-icons"
],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y",
"alipay": "n"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "n"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}

View File

@ -0,0 +1,21 @@
> `重要通知:组件升级更新 2.0.0 后,支持日期+时间范围选择,组件 ui 将使用日历选择日期ui 变化较大,同时支持 PC 和 移动端。此版本不向后兼容不再支持单独的时间选择type=time及相关的 hide-second 属性(时间选可使用内置组件 picker。若仍需使用旧版本可在插件市场下载*非uni_modules版本*,旧版本将不再维护`
## DatetimePicker 时间选择器
> **组件名uni-datetime-picker**
> 代码块: `uDatetimePicker`
该组件的优势是,支持**时间戳**输入和输出(起始时间、终止时间也支持时间戳),可**同时选择**日期和时间。
若只是需要单独选择日期和时间,不需要时间戳输入和输出,可使用原生的 picker 组件。
**_点击 picker 默认值规则_**
- 若设置初始值 value, 会显示在 picker 显示框中
- 若无初始值 value则初始值 value 为当前本地时间 Date.now() 但不会显示在 picker 显示框中
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-datetime-picker)
#### 如使用过程中有任何问题或者您对uni-ui有一些好的建议欢迎加入 uni-ui 交流群871950839

17
unpackage/cache/appleConfig.ini vendored Normal file
View File

@ -0,0 +1,17 @@
[appleAppid]
appleAppid=api.zztc.pcxbc
[iosStyle]
iosStyle=
[universalLinks]
universalLinks=
spaceid=
[universalLinks_qq]
universalLinks_qq=
spaceid_qq=
[universalLinks_weibo]
universalLinks_weibo=
spaceid_weibo=

3
unpackage/cache/certdataios vendored Normal file
View File

@ -0,0 +1,3 @@
iosProfile=C:\Users\gh\WPS Cloud Files\appuploader_win_latest\ios描述文件.mobileprovision
ioscertFile=C:\Users\gh\WPS Cloud Files\appuploader_win_latest\ios开发证书.p12
ioscertPassword=e7l98mrpB0Uj4WWFn9y0Mg==

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<script>
var __UniViewStartTime__ = Date.now();
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title>View</title>
<link rel="stylesheet" href="view.css" />
</head>
<body>
<div id="app"></div>
<script src="__uniappes6.js"></script>
<script src="view.umd.min.js"></script>
<script src="app-view.js"></script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
(function(e){function r(r){for(var n,l,i=r[0],p=r[1],a=r[2],c=0,s=[];c<i.length;c++)l=i[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in p)Object.prototype.hasOwnProperty.call(p,n)&&(e[n]=p[n]);f&&f(r);while(s.length)s.shift()();return u.push.apply(u,a||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var p=t[i];0!==o[p]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={"app-config":0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e["default"]}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var i=this["webpackJsonp"]=this["webpackJsonp"]||[],p=i.push.bind(i);i.push=r,i=i.slice();for(var a=0;a<i.length;a++)r(i[a]);var f=p;t()})([]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__E0E1A21","name":"examTeamApp","version":{"name":"1.0.0","code":"100"},"description":"","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"Bluetooth":{},"Camera":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"dark","background":"#F8F8F8"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"]},"apple":{"dSYMs":false},"plugins":{"share":{},"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"safearea":{"background":"#fff","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"3.99","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#333","selectedColor":"#477EFF","backgroundColor":"#fff","list":[{"pagePath":"pages/index/index","iconPath":"static/shou.png","selectedIconPath":"static/shou2.png","text":"首页"},{"pagePath":"pages/score/score","iconPath":"static/ping.png","selectedIconPath":"static/ping2.png","text":"估分"},{"pagePath":"pages/me/me","iconPath":"static/wo.png","selectedIconPath":"static/wo2.png","text":"我的"}],"borderStyle":"rgba(0,0,0,0.4)","height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"},"fallbackLocale":"en"}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Some files were not shown because too many files have changed in this diff Show More