新锐动+厨房秤
122
App.vue
|
|
@ -1,5 +1,4 @@
|
||||||
<script>
|
<script>
|
||||||
let platform = ""
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {}
|
return {}
|
||||||
|
|
@ -8,35 +7,21 @@
|
||||||
let that = this
|
let that = this
|
||||||
// 返回的是apk包信息
|
// 返回的是apk包信息
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
uni.getSystemInfo({
|
if (uni.getSystemInfoSync().platform === 'ios') { // ios首次安装没有网络
|
||||||
success(e) {
|
|
||||||
platform = e.platform
|
|
||||||
that.$store.commit('changePhoneInfo', {
|
|
||||||
platform: e.platform
|
|
||||||
})
|
|
||||||
console.log("getSystemInfo", e.platform)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
if (platform === 'ios') { // ios首次安装没有网络
|
|
||||||
uni.onNetworkStatusChange(function(res) {
|
uni.onNetworkStatusChange(function(res) {
|
||||||
if (res.isConnected == true) {
|
if (res.isConnected == true) {
|
||||||
that.handleCityList()
|
|
||||||
that.handleCooperationUrl()
|
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pageTwo/login/login'
|
url: '/pageTwo/login/login'
|
||||||
})
|
})
|
||||||
console.log("有网络连接", res.isConnected)
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
that.checkForUpdates()
|
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
// 版本更新
|
// 版本更新
|
||||||
that.handleCityList()
|
|
||||||
that.handleCooperationUrl()
|
|
||||||
that.updataWeiXin()
|
that.updataWeiXin()
|
||||||
// #endif
|
// #endif
|
||||||
|
// that.handleConfigInfo()
|
||||||
console.log('App Launch')
|
console.log('App Launch')
|
||||||
},
|
},
|
||||||
onShow: function() {
|
onShow: function() {
|
||||||
|
|
@ -51,93 +36,19 @@
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 版本信息监测
|
// 公共信息
|
||||||
checkForUpdates() {
|
handleConfigInfo() {
|
||||||
let that = this
|
let that = this
|
||||||
plus.runtime.getProperty(plus.runtime.appid, function(info) {
|
// 线上版本及登录状态
|
||||||
uni.setStorageSync('VERSION', info.version)
|
that.$model.getHomeConfig({}).then(res => {
|
||||||
that.$store.commit('changePhoneInfo', {
|
that.$store.commit('changeConfigInfo', res.data)
|
||||||
info: info
|
that.$tools.handleCancelUpdate(res.data.login_status.code)
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
plus.runtime.getProperty(plus.runtime.appid, function(info) {
|
||||||
|
that.$tools.handleoginversion(info.version, res.data.version_msg.version) //版本信息
|
||||||
})
|
})
|
||||||
console.log("当前应用版本号", info)
|
|
||||||
that.handleCityList()
|
|
||||||
that.handleCooperationUrl()
|
|
||||||
that.handleoginversion(info)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 版本信息
|
|
||||||
handleoginversion(info) {
|
|
||||||
let that = this
|
|
||||||
that.$model.getloginversion({}).then(res => {
|
|
||||||
console.log("是否登录及版本号", res)
|
|
||||||
that.handleCancelUpdate(res.code)
|
|
||||||
|
|
||||||
// #ifdef APP-PLUS||APP
|
|
||||||
let currentVersion = info.version;
|
|
||||||
let latestVersion = res.data.version
|
|
||||||
that.$store.commit('changePhoneInfo', {
|
|
||||||
versionUrl: res.data
|
|
||||||
})
|
|
||||||
// 比对版本号
|
|
||||||
let version = that.$tools.compareVersions(currentVersion, latestVersion)
|
|
||||||
if (version == -1) { // 0版本号相通,1,:第一个版本号大于第二个版本号,-1:第一个版本号小于第二个版本号
|
|
||||||
uni.showModal({
|
|
||||||
title: '发现新版本',
|
|
||||||
content: '检查到新版本' + res.data.version + ',是否更新?',
|
|
||||||
success: (modalRes) => {
|
|
||||||
if (modalRes.confirm) { //确定更新
|
|
||||||
if (platform === 'android') { //安卓更新
|
|
||||||
uni.setStorageSync('VERSION', res.data.version)
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/my/about"
|
|
||||||
})
|
|
||||||
} else { //ios跳转
|
|
||||||
plus.runtime.launchApplication({
|
|
||||||
action: `itms-apps://itunes.apple.com/cn/app/id6654906497?mt=8`
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
that.$tools.msg("稍后可在'关于我们'内更新程序!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// #endif
|
// #endif
|
||||||
})
|
|
||||||
},
|
|
||||||
// 取消更新
|
|
||||||
handleCancelUpdate(code) {
|
|
||||||
let that = this
|
|
||||||
if (code == 0) {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: "/pages/home/home?type=1"
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: '/pageTwo/login/login'
|
|
||||||
})
|
|
||||||
}, 500);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 地区
|
|
||||||
handleCityList() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getGradeList({}).then((res) => {
|
|
||||||
// console.log("|全部地区", res.data)
|
|
||||||
if (res.code != 0) return
|
|
||||||
that.$store.commit('changeCityList', res.data.area_list)
|
|
||||||
that.$store.commit('changeGradeList', res.data.grade_list)
|
|
||||||
that.$store.commit('changeIdentityList', res.data.identity_list)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 合作服务
|
|
||||||
handleCooperationUrl() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getCooperationUrl({}).then((res) => {
|
|
||||||
// console.log("合作服务", res.data)
|
|
||||||
if (res.code != 0) return
|
|
||||||
this.$store.commit("changeCooperationUrl", res.data);
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 微信小程序更新
|
// 微信小程序更新
|
||||||
|
|
@ -175,9 +86,18 @@
|
||||||
/*每个页面公共css */
|
/*每个页面公共css */
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
@import "/uni.scss";
|
@import "/uni.scss";
|
||||||
|
@import "/scss/food.scss";
|
||||||
@import "/scss/common.scss";
|
@import "/scss/common.scss";
|
||||||
@import "/scss/iconfont.css";
|
@import "/scss/iconfont.css";
|
||||||
@import "/scss/iconfont-weapp-icon.css";
|
@import "/scss/iconfont-weapp-icon.css";
|
||||||
|
|
||||||
/* #endif*/
|
/* #endif*/
|
||||||
|
|
||||||
|
.content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
min-height: 100vh;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -54,9 +54,7 @@
|
||||||
let that = this
|
let that = this
|
||||||
uni.setStorageSync('userid', val.id)
|
uni.setStorageSync('userid', val.id)
|
||||||
uni.setStorageSync('gender', val.gender)
|
uni.setStorageSync('gender', val.gender)
|
||||||
that.$store.dispatch("getUserInfo", {
|
that.$store.commit('changeUser', val)
|
||||||
aud_id: val.id
|
|
||||||
});
|
|
||||||
that.$store.dispatch("getResult", {
|
that.$store.dispatch("getResult", {
|
||||||
aud_id: val.id
|
aud_id: val.id
|
||||||
})
|
})
|
||||||
|
|
@ -117,7 +115,6 @@
|
||||||
margin: auto;
|
margin: auto;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
margin-bottom: 16rpx;
|
margin-bottom: 16rpx;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dangqian {
|
.dangqian {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
<text class="mr-10">性别:{{info.gender==1?'男':info.gender==2?'女':'未知'}}</text>
|
<text class="mr-10">性别:{{info.gender==1?'男':info.gender==2?'女':'未知'}}</text>
|
||||||
<text class="ml-10">年龄:{{info.age}}岁</text>
|
<text class="ml-10">年龄:{{info.age}}岁</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-5" v-if="info.measure_model==1">当前地区:{{info.address}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
<text class="t-icon t-icon-qiehuan1" @click="$store.commit('changeDrawe', true)" v-if="isLeft"></text>
|
<text class="t-icon t-icon-qiehuan1" @click="$store.commit('changeDrawe', true)" v-if="isLeft"></text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -79,7 +78,7 @@
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user", "familayList", "cityList"]),
|
...mapState(["user", "familayList", "configInfo"]),
|
||||||
info() {
|
info() {
|
||||||
return this.user
|
return this.user
|
||||||
},
|
},
|
||||||
|
|
@ -151,9 +150,9 @@
|
||||||
// 地区
|
// 地区
|
||||||
handleCityList() {
|
handleCityList() {
|
||||||
let that = this
|
let that = this
|
||||||
if (that.cityList.length) {
|
if ( that.configInfo.area_list.length) {
|
||||||
if (that.user.address != '') {
|
if (that.user.address != '') {
|
||||||
that.province = that.cityList
|
that.province = that.configInfo.area_list
|
||||||
let str = that.user.address.split(',')[0]
|
let str = that.user.address.split(',')[0]
|
||||||
var Index0 = that.province.findIndex((profile) => profile.name == str);
|
var Index0 = that.province.findIndex((profile) => profile.name == str);
|
||||||
that.value[0] = Index0
|
that.value[0] = Index0
|
||||||
|
|
@ -161,7 +160,7 @@
|
||||||
that.city = that.province[Index0].list
|
that.city = that.province[Index0].list
|
||||||
} else {
|
} else {
|
||||||
that.value = [2, 0]
|
that.value = [2, 0]
|
||||||
that.city = that.cityList[2].list
|
that.city = that.configInfo.area_list[2].list
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,121 +0,0 @@
|
||||||
<template>
|
|
||||||
<view v-if="isFirst" class="wrapper wrapperbg">
|
|
||||||
<view class="bg" @click="onTap">
|
|
||||||
<view class="edit" @click.stop>
|
|
||||||
<view class="title">{{type==1?'目标体重':'初始体重'}}</view>
|
|
||||||
<view class="editem" @click="hideKeyboard" v-if="type!=1">
|
|
||||||
<view class="name">日期</view>
|
|
||||||
<view class="right">
|
|
||||||
<picker mode="date" :end="endDate" @change="changeLog" :fields="fields">
|
|
||||||
<view class="uni-input">{{regTime?regTime:'请选择'}}</view>
|
|
||||||
<icon class="iconfont icon-arrow-down-bold"></icon>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="editem">
|
|
||||||
<view class="name">体重</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 {
|
|
||||||
props: {
|
|
||||||
type: {}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
regTime: "",
|
|
||||||
weight: "",
|
|
||||||
fields: "",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["user", "isFirst"]),
|
|
||||||
endDate() {
|
|
||||||
return this.$tools.getDate("start")
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
let that = this
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
that.fields = "time"
|
|
||||||
// #endif
|
|
||||||
// #ifndef APP-PLUS
|
|
||||||
that.fields = "day"
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 初始体重
|
|
||||||
handleTarget() {
|
|
||||||
let that = this
|
|
||||||
if (that.type != 1 && !that.regTime) {
|
|
||||||
that.$tools.msg("请选择测量日期")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!that.weight) {
|
|
||||||
that.$tools.msg("请输入测量体重")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
that.$model.getfirstweight({
|
|
||||||
aud_id: that.user.id,
|
|
||||||
time: that.type == 1 ? '' : that.regTime ? that.regTime : that.user.firstresulttime,
|
|
||||||
weight: that.weight,
|
|
||||||
type: that.type
|
|
||||||
}).then(res => {
|
|
||||||
console.log("目标,", res)
|
|
||||||
that.$tools.msg(res.msg)
|
|
||||||
if (res.code == 0) {
|
|
||||||
that.$store.commit("changeFirst", false);
|
|
||||||
that.$store.commit('changeMeasureResult', {
|
|
||||||
target_current: res.data
|
|
||||||
})
|
|
||||||
that.regTime = ""
|
|
||||||
that.weight = ""
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//
|
|
||||||
changeLog(e) {
|
|
||||||
this.regTime = e.detail.value
|
|
||||||
},
|
|
||||||
onTap() {
|
|
||||||
this.weight = ""
|
|
||||||
this.regTime = ""
|
|
||||||
this.$store.commit("changeFirst", 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>
|
|
||||||
|
|
@ -1,210 +0,0 @@
|
||||||
<template>
|
|
||||||
<view v-if="isTarget" 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">
|
|
||||||
<input class="text" type="digit" placeholder="请输入" v-model="inputvalue" />kg
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="btn close" @click="onTap()">取消</view>
|
|
||||||
<view class="btn" @click="handleWeight">确定</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
inputvalue: "",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["user", "isTarget"]),
|
|
||||||
startDate() {
|
|
||||||
return this.$tools.getDate('start');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 目标体重
|
|
||||||
handleWeight() {
|
|
||||||
let that = this
|
|
||||||
console.log("startDate", that.startDate)
|
|
||||||
if (!that.inputvalue) {
|
|
||||||
that.$tools.msg("请输入目标体重")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
that.$model.setTarget({
|
|
||||||
familyid: that.user.familyid,
|
|
||||||
time: that.startDate,
|
|
||||||
weight: that.inputvalue,
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code != 0) return
|
|
||||||
that.$tools.msg(res.msg)
|
|
||||||
that.$store.commit("changeTarget", false);
|
|
||||||
that.$store.dispatch("getUserInfo", {
|
|
||||||
familyid: that.user.familyid,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onTap() {
|
|
||||||
this.inputvalue = ""
|
|
||||||
this.$store.commit("changeTarget", false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</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: 36rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.editem {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
font-size: 32rpx;
|
|
||||||
border-radius: 10px;
|
|
||||||
margin-top: 15px;
|
|
||||||
height: 40px;
|
|
||||||
justify-content: space-between;
|
|
||||||
background: #eee;
|
|
||||||
padding: 0px 10px;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.radioimg {
|
|
||||||
font-size: 44rpx;
|
|
||||||
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:28rpx;
|
|
||||||
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>
|
|
||||||
11
main.js
|
|
@ -5,20 +5,23 @@ Vue.prototype.$store = store;
|
||||||
// 公共js
|
// 公共js
|
||||||
import tools from '@/toolJs/tools.js'
|
import tools from '@/toolJs/tools.js'
|
||||||
Vue.prototype.$tools = tools;
|
Vue.prototype.$tools = tools;
|
||||||
// 蓝牙js
|
|
||||||
import Bluetooth from '@/toolJs/Bluetooth.js'
|
|
||||||
Vue.prototype.$Bluetooth = Bluetooth;
|
|
||||||
//请求
|
//请求
|
||||||
import http from '@/toolJs/https.js'
|
import http from '@/toolJs/https.js'
|
||||||
Vue.prototype.$http = http;
|
Vue.prototype.$http = http;
|
||||||
//接口
|
//接口
|
||||||
import model from '@/toolJs/model.js'
|
import model from '@/toolJs/model.js'
|
||||||
Vue.prototype.$model = model;
|
Vue.prototype.$model = model;
|
||||||
|
// 蓝牙js
|
||||||
|
import useBluetooth from "@/toolJs/Bluetooth.js";
|
||||||
|
Vue.prototype.$ble = useBluetooth;
|
||||||
//模拟数据
|
//模拟数据
|
||||||
import video from '@/video.json'
|
import video from '@/video.json'
|
||||||
Vue.prototype.$video = video;
|
Vue.prototype.$video = video;
|
||||||
|
|
||||||
|
//模拟数据
|
||||||
|
import json from '@/content.json'
|
||||||
|
Vue.prototype.$json = json;
|
||||||
|
|
||||||
// #ifndef VUE3
|
// #ifndef VUE3
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
|
|
|
||||||
325
manifest.json
|
|
@ -1,157 +1,172 @@
|
||||||
{
|
{
|
||||||
"name" : "Reedaw",
|
"name": "Reedaw",
|
||||||
"appid" : "__UNI__20604F1",
|
"appid": "__UNI__20604F1",
|
||||||
"description" : "面向儿童青少年的健康体质测量APP",
|
"description": "面向儿童青少年的健康体质测量APP",
|
||||||
"versionName" : "1.3.4",
|
"versionName": "1.3.4",
|
||||||
"versionCode" : 134,
|
"versionCode": 134,
|
||||||
"transformPx" : false,
|
"transformPx": false,
|
||||||
/* 5+App特有相关 */
|
"sassImplementationName": "node-sass",
|
||||||
"app-plus" : {
|
/* 5+App特有相关 */
|
||||||
"usingComponents" : true,
|
"app-plus": {
|
||||||
"nvueStyleCompiler" : "uni-app",
|
"usingComponents": true,
|
||||||
"compilerVersion" : 3,
|
"nvueStyleCompiler": "uni-app",
|
||||||
"splashscreen" : {
|
"compilerVersion": 3,
|
||||||
"alwaysShowBeforeRender" : true,
|
"splashscreen": {
|
||||||
"waiting" : true,
|
"alwaysShowBeforeRender": true,
|
||||||
"autoclose" : true,
|
"waiting": true,
|
||||||
"delay" : 0
|
"autoclose": true,
|
||||||
},
|
"delay": 0
|
||||||
"template" : "index.html",
|
},
|
||||||
/* 模块配置 */
|
"template": "index.html",
|
||||||
"modules" : {
|
/* 模块配置 */
|
||||||
"Bluetooth" : {}
|
"modules": {
|
||||||
},
|
"Bluetooth": {}
|
||||||
"compattible" : {
|
},
|
||||||
"ignoreVersion" : true // true 表示忽略版本检查提示
|
"compattible": {
|
||||||
},
|
"ignoreVersion": true // true 表示忽略版本检查提示
|
||||||
/* 应用发布信息 */
|
},
|
||||||
"distribute" : {
|
/* 应用发布信息 */
|
||||||
/* android打包配置 */
|
"distribute": {
|
||||||
"android" : {
|
/* android打包配置 */
|
||||||
"permissions" : [
|
"android": {
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
"permissions": [
|
||||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
],
|
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||||
"abiFilters" : [ "arm64-v8a", "x86" ]
|
],
|
||||||
},
|
"abiFilters": ["arm64-v8a", "x86"]
|
||||||
/* ios打包配置 */
|
},
|
||||||
"ios" : {
|
/* ios打包配置 */
|
||||||
"dSYMs" : false,
|
"ios": {
|
||||||
"idfa" : false,
|
"dSYMs": false,
|
||||||
"privacyDescription" : {
|
"idfa": false,
|
||||||
"NSBluetoothAlwaysUsageDescription" : "需要蓝牙权限来连接设备",
|
"privacyDescription": {
|
||||||
"NSBluetoothPeripheralUsageDescription" : "使用蓝牙与外设通信"
|
"NSBluetoothAlwaysUsageDescription": "需要蓝牙权限来连接设备",
|
||||||
}
|
"NSBluetoothPeripheralUsageDescription": "使用蓝牙与外设通信"
|
||||||
},
|
}
|
||||||
/* SDK配置 */
|
},
|
||||||
"sdkConfigs" : {
|
/* SDK配置 */
|
||||||
"share" : {},
|
"sdkConfigs": {
|
||||||
"ad" : {},
|
"share": {},
|
||||||
"geolocation" : {
|
"ad": {},
|
||||||
"system" : {
|
"geolocation": {
|
||||||
"__platform__" : [ "ios" ]
|
"system": {
|
||||||
}
|
"__platform__": ["ios"]
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"icons" : {
|
},
|
||||||
"android" : {
|
"icons": {
|
||||||
"hdpi" : "unpackage/res/icons/72x72.png",
|
"android": {
|
||||||
"xhdpi" : "unpackage/res/icons/96x96.png",
|
"hdpi": "unpackage/res/icons/72x72.png",
|
||||||
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
"xhdpi": "unpackage/res/icons/96x96.png",
|
||||||
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
"xxhdpi": "unpackage/res/icons/144x144.png",
|
||||||
},
|
"xxxhdpi": "unpackage/res/icons/192x192.png"
|
||||||
"ios" : {
|
},
|
||||||
"appstore" : "unpackage/res/icons/1024x1024.png",
|
"ios": {
|
||||||
"ipad" : {
|
"appstore": "unpackage/res/icons/1024x1024.png",
|
||||||
"app" : "unpackage/res/icons/76x76.png",
|
"ipad": {
|
||||||
"app@2x" : "unpackage/res/icons/152x152.png",
|
"app": "unpackage/res/icons/76x76.png",
|
||||||
"notification" : "unpackage/res/icons/20x20.png",
|
"app@2x": "unpackage/res/icons/152x152.png",
|
||||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
"notification": "unpackage/res/icons/20x20.png",
|
||||||
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||||
"settings" : "unpackage/res/icons/29x29.png",
|
"proapp@2x": "unpackage/res/icons/167x167.png",
|
||||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
"settings": "unpackage/res/icons/29x29.png",
|
||||||
"spotlight" : "unpackage/res/icons/40x40.png",
|
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||||
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
"spotlight": "unpackage/res/icons/40x40.png",
|
||||||
},
|
"spotlight@2x": "unpackage/res/icons/80x80.png"
|
||||||
"iphone" : {
|
},
|
||||||
"app@2x" : "unpackage/res/icons/120x120.png",
|
"iphone": {
|
||||||
"app@3x" : "unpackage/res/icons/180x180.png",
|
"app@2x": "unpackage/res/icons/120x120.png",
|
||||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
"app@3x": "unpackage/res/icons/180x180.png",
|
||||||
"notification@3x" : "unpackage/res/icons/60x60.png",
|
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
"notification@3x": "unpackage/res/icons/60x60.png",
|
||||||
"settings@3x" : "unpackage/res/icons/87x87.png",
|
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||||
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
"settings@3x": "unpackage/res/icons/87x87.png",
|
||||||
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
"spotlight@2x": "unpackage/res/icons/80x80.png",
|
||||||
}
|
"spotlight@3x": "unpackage/res/icons/120x120.png"
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"splashscreen" : {
|
},
|
||||||
"androidStyle" : "common",
|
"splashscreen": {
|
||||||
"android" : {
|
"androidStyle": "common",
|
||||||
"hdpi" : "static/logo.png",
|
"android": {
|
||||||
"xhdpi" : "static/logo.png",
|
"hdpi": "static/logo.png",
|
||||||
"xxhdpi" : "static/logo.png"
|
"xhdpi": "static/logo.png",
|
||||||
},
|
"xxhdpi": "static/logo.png"
|
||||||
"useOriginalMsgbox" : true
|
},
|
||||||
}
|
"useOriginalMsgbox": true
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
"permissions" : {
|
},
|
||||||
"Android" : [
|
"permissions": {
|
||||||
{
|
"Android": [{
|
||||||
"name" : "android.permission.READ_EXTERNAL_STORAGE",
|
"name": "android.permission.READ_EXTERNAL_STORAGE",
|
||||||
"desc" : "读取外部存储"
|
"desc": "读取外部存储"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name" : "android.permission.WRITE_EXTERNAL_STORAGE",
|
"name": "android.permission.WRITE_EXTERNAL_STORAGE",
|
||||||
"desc" : "写入外部存储"
|
"desc": "写入外部存储"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
/* 快应用特有相关 */
|
/* 快应用特有相关 */
|
||||||
"quickapp" : {},
|
"quickapp": {},
|
||||||
/* 小程序特有相关 */
|
/* 小程序特有相关 */
|
||||||
"mp-weixin" : {
|
"mp-weixin": {
|
||||||
"appid" : "wx9c0b7a436ada6d1e",
|
"appid": "wx1f32af4f93c913f6",
|
||||||
"setting" : {
|
"setting": {
|
||||||
"urlCheck" : false,
|
"urlCheck": false,
|
||||||
"postcss" : true,
|
"postcss": true,
|
||||||
"minified" : true
|
"es6" : true,
|
||||||
},
|
"minified": true
|
||||||
"usingComponents" : true
|
},
|
||||||
},
|
"usingComponents": true,
|
||||||
"mp-alipay" : {
|
// 开启分包优化
|
||||||
"usingComponents" : true
|
"optimization": {
|
||||||
},
|
"Package8s": true
|
||||||
"mp-baidu" : {
|
},
|
||||||
"usingComponents" : true
|
"plugins": {
|
||||||
},
|
"sdkPlugin": {
|
||||||
"mp-toutiao" : {
|
//这里是引用的插件名称 地图路线规划
|
||||||
"usingComponents" : true
|
"version": "2.4.0", //插件版本
|
||||||
},
|
"provider": "wx17e93aad47cdae1a" //插件appid
|
||||||
"uniStatistics" : {
|
},
|
||||||
"enable" : false,
|
"WechatSI": {
|
||||||
"version" : "2"
|
"version": "0.3.6",
|
||||||
},
|
"provider": "wx069ba97219f66d99"
|
||||||
"vueVersion" : "2",
|
}
|
||||||
"locale" : "zh-Hans",
|
}
|
||||||
"h5" : {
|
},
|
||||||
"template" : "index.html"
|
"mp-alipay": {
|
||||||
},
|
"usingComponents": true
|
||||||
"fallbackLocale" : "zh-Hans"
|
},
|
||||||
|
"mp-baidu": {
|
||||||
|
"usingComponents": true
|
||||||
|
},
|
||||||
|
"mp-toutiao": {
|
||||||
|
"usingComponents": true
|
||||||
|
},
|
||||||
|
"uniStatistics": {
|
||||||
|
"enable": false,
|
||||||
|
"version": "2"
|
||||||
|
},
|
||||||
|
"vueVersion": "2",
|
||||||
|
"locale": "zh-Hans",
|
||||||
|
"h5": {
|
||||||
|
"template": "index.html"
|
||||||
|
},
|
||||||
|
"fallbackLocale": "zh-Hans"
|
||||||
}
|
}
|
||||||
/* SDK配置 */
|
/* SDK配置 */
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "examTeamApp",
|
"name": "ReedawFoodApp",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
|
|
|
||||||
|
|
@ -1,212 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="TrendPage">
|
|
||||||
<view class="charts">
|
|
||||||
<!-- 时间选择 -->
|
|
||||||
<view class="boxTime">
|
|
||||||
<view class="one">
|
|
||||||
<picker mode="date" :end="endDate" @change="handStartTimeH" :fields="fields"
|
|
||||||
:value="startTime?startTime:startDate">
|
|
||||||
<view class="uni-input mr-10">{{startTime?startTime:startDate}}
|
|
||||||
<icon class="iconfont icon-arrow-down-bold"></icon>
|
|
||||||
</view>
|
|
||||||
</picker>
|
|
||||||
<view class="center">~</view>
|
|
||||||
<picker mode="date" :end="endDate" @change="handEndTimeH" :fields="fields"
|
|
||||||
:value="endTime?endTime:endDate">
|
|
||||||
<view class="uni-input mr-10">{{endTime?endTime:endDate}}
|
|
||||||
<icon class="iconfont icon-arrow-down-bold"></icon>
|
|
||||||
</view>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 曲线图 -->
|
|
||||||
<view class="box">
|
|
||||||
<view class="boxLine">
|
|
||||||
<view class="line" v-for="(item,index) in weightList">
|
|
||||||
<view v-if="item.line.categories.length" class="mt-15 mb-15">
|
|
||||||
<qiunDataCharts type="column" :chartData="item.line" :canvas2d="true" :canvasId="item.id"
|
|
||||||
:Width="340" :Height="250" :animation="false"
|
|
||||||
:opts="{enableScroll:true,xAxis:{scrollShow:false,itemCount:3}}" :ontouch="true" />
|
|
||||||
</view>
|
|
||||||
<view v-else>
|
|
||||||
<view class="nolist">
|
|
||||||
<image src="../../static/none.png"></image>
|
|
||||||
<text>暂无数据,请手动添加~</text>
|
|
||||||
</view>
|
|
||||||
<view class="title">
|
|
||||||
{{item.title}}
|
|
||||||
</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(["labelList"]),
|
|
||||||
endDate() {
|
|
||||||
return this.$tools.getDate("start")
|
|
||||||
},
|
|
||||||
startDate() {
|
|
||||||
return this.$tools.GetDateStr(-90);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
name: "",
|
|
||||||
list: [],
|
|
||||||
acd_id: 0,
|
|
||||||
handTrue: true,
|
|
||||||
active: 0,
|
|
||||||
startTime: "",
|
|
||||||
endTime: "",
|
|
||||||
fields: "",
|
|
||||||
weightList: [],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
let that = this
|
|
||||||
that.active = 0
|
|
||||||
that.acd_id = options.acd_id
|
|
||||||
that.time = that.startDate
|
|
||||||
that.labelList.forEach(ite => {
|
|
||||||
if (ite.acd_id == that.acd_id) {
|
|
||||||
that.list = ite.list
|
|
||||||
that.name = that.list[0]
|
|
||||||
return
|
|
||||||
}
|
|
||||||
})
|
|
||||||
that.handlePublicTrendList()
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
that.fields = "time"
|
|
||||||
// #endif
|
|
||||||
// #ifndef APP-PLUS
|
|
||||||
that.fields = "day"
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handStartTimeH(e) {
|
|
||||||
let that = this
|
|
||||||
if (that.endTime) {
|
|
||||||
if (Date.parse(e.detail.value) > Date.parse(that.endTime)) {
|
|
||||||
that.$tools.msg("请选择正确的时间")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (Date.parse(e.detail.value) > Date.parse(that.endDate)) {
|
|
||||||
that.$tools.msg("请选择正确的时间")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
that.startTime = e.detail.value
|
|
||||||
that.handlePublicTrendList()
|
|
||||||
},
|
|
||||||
handEndTimeH(e) {
|
|
||||||
let that = this
|
|
||||||
if (that.startTime) {
|
|
||||||
if (Date.parse(e.detail.value) < Date.parse(that.startTime)) {
|
|
||||||
that.$tools.msg("请选择正确的时间")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (Date.parse(e.detail.value) < Date.parse(that.startDate)) {
|
|
||||||
that.$tools.msg("请选择正确的时间")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
that.endTime = e.detail.value
|
|
||||||
that.handlePublicTrendList()
|
|
||||||
},
|
|
||||||
handlePublicTrendList() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getPublicTrendList({
|
|
||||||
aud_id: uni.getStorageSync('userid'),
|
|
||||||
acd_id: that.acd_id,
|
|
||||||
s_time: that.startTime ? that.startTime : that.startDate,
|
|
||||||
e_time: that.endTime ? that.endTime : that.endDate
|
|
||||||
}).then(res => {
|
|
||||||
// 公共曲线
|
|
||||||
if (res.code == 0) {
|
|
||||||
that.weightList = res.data
|
|
||||||
}
|
|
||||||
console.log("公共曲线", that.weightList)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
navTo(url) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: url
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.TrendPage {
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.boxTime {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 10px 10px 0 0;
|
|
||||||
|
|
||||||
.one {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
line-height: 25px;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.center {
|
|
||||||
width: 10%;
|
|
||||||
margin: 0 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
picker {
|
|
||||||
width: 50%;
|
|
||||||
border: none;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
color: #333333;
|
|
||||||
font-size: 36rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.line {
|
|
||||||
padding-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
color: #999;
|
|
||||||
font-size: 14PX;
|
|
||||||
margin-top: 15px;
|
|
||||||
|
|
||||||
text {
|
|
||||||
width: 15px;
|
|
||||||
height: 10px;
|
|
||||||
margin-right: 5px;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,255 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<view class="tabbar">
|
|
||||||
<scroll-view class="scroll-menu" scroll-x="true" style="white-space: nowrap;">
|
|
||||||
<view v-for="(item,index) in labellist" :class="[active==index?'active':'']"
|
|
||||||
@click="handleActive(item,index)">
|
|
||||||
<text>{{item}}</text>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
<view class=" calendar">
|
|
||||||
<!-- 日历 -->
|
|
||||||
<ren-calendar ref='ren' :markDays='markDays' @onDayClick='onDayClick' @onMonthClickPre='onMonthClickPre'
|
|
||||||
v-if="isShow">
|
|
||||||
</ren-calendar>
|
|
||||||
<!-- -->
|
|
||||||
<view class="box" v-if="infoList.length">
|
|
||||||
<view class="list" v-for="(item,index) in infoList" :key="index" @click="addMemberTags(item.id,item)">
|
|
||||||
<view class="item">
|
|
||||||
<view class="check">
|
|
||||||
<uni-icons :type="isActive.indexOf(item.id)!=-1?'checkbox-filled':'circle'" size="22"
|
|
||||||
:color="isActive.indexOf(item.id)!=-1?'#FEC407':'#dfdfdf'"></uni-icons>
|
|
||||||
</view>
|
|
||||||
<view>{{item.v1}}<text>{{item.v1_name}}</text></view>
|
|
||||||
<view v-if="item.v2">{{item.v2}}<text>{{item.v2_name}}</text></view>
|
|
||||||
<view v-if="item.v3">{{item.v3}}<text>{{item.v3_name}}</text></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- -->
|
|
||||||
<view class="bottom">
|
|
||||||
<view class="list" v-for="(ite,ind) in ActiveDays" :key="ind" v-if="isActive"
|
|
||||||
@click="addMemberTags(ite.id,ite)">
|
|
||||||
<view class="item borderRadius">
|
|
||||||
<view class="time">{{ite.r_t}}</view>
|
|
||||||
<view>{{ite.v1}}<text>{{ite.v1_name}}</text></view>
|
|
||||||
<view v-if="ite.v2">{{ite.v2}}<text>{{ite.v2_name}}</text></view>
|
|
||||||
<view v-if="ite.v3">{{ite.v3}}<text>{{ite.v3_name}}</text></view>
|
|
||||||
<view class="check">
|
|
||||||
<uni-icons type="clear" size="22" color="#999"></uni-icons>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="pkclass" v-if="length==2">vs</view>
|
|
||||||
<!-- <view :class="{'active':length!=2}" class="btn" @click="handlePK">对比</view> -->
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import RenCalendar from '@/element/ren-calendar/ren-calendar.vue';
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
markDays: [],
|
|
||||||
infoList: [],
|
|
||||||
list: [],
|
|
||||||
isActive: [],
|
|
||||||
ActiveDays: [],
|
|
||||||
startM: null,
|
|
||||||
endM: null,
|
|
||||||
isShow: true,
|
|
||||||
acd_id: "",
|
|
||||||
active: 0,
|
|
||||||
labelName: "",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
RenCalendar,
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["user", "TrendPk", "labelList"]),
|
|
||||||
labellist() {
|
|
||||||
let that = this
|
|
||||||
let list = []
|
|
||||||
that.labelList.forEach(ite => {
|
|
||||||
if (ite.acd_id == that.acd_id) {
|
|
||||||
list = ite.list
|
|
||||||
that.labelName = ite.list[0]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return list
|
|
||||||
},
|
|
||||||
length() {
|
|
||||||
return this.isActive.length
|
|
||||||
},
|
|
||||||
endDate() {
|
|
||||||
return this.$tools.getDate("start")
|
|
||||||
},
|
|
||||||
},
|
|
||||||
onLoad(optoins) {
|
|
||||||
let that = this
|
|
||||||
that.acd_id = optoins.acd_id
|
|
||||||
that.startM = that.$tools.getDate("m").substring(0, 10)
|
|
||||||
that.endM = that.$tools.getDate("m").substring(11, 21)
|
|
||||||
that.markDays = []
|
|
||||||
that.list = []
|
|
||||||
that.isActive = []
|
|
||||||
that.ActiveDays = []
|
|
||||||
that.$nextTick(() => {
|
|
||||||
that.isShow = true
|
|
||||||
that.getList(that.startM, that.endM)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getList(start, end) {
|
|
||||||
let that = this
|
|
||||||
that.$model.getPublicResultdiff({
|
|
||||||
aud_id: uni.getStorageSync('userid'),
|
|
||||||
acd_id: that.acd_id,
|
|
||||||
s_time: start,
|
|
||||||
e_time: end,
|
|
||||||
name: that.labelName
|
|
||||||
}).then(res => {
|
|
||||||
if (res) {
|
|
||||||
that.markDays = res.Dlist
|
|
||||||
that.list = res.data
|
|
||||||
for (var i = 0; i < res.data.length; i++) {
|
|
||||||
if (Date.parse(that.endDate) == Date.parse(res.data[i].r_t)) {
|
|
||||||
that.infoList.push(res.data[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log("对比", res, )
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onMonthClickPre(data) {
|
|
||||||
console.log("onMonthClickPre", data)
|
|
||||||
let that = this
|
|
||||||
let start = data.substring(0, 10)
|
|
||||||
let end = data.substring(11, 21)
|
|
||||||
that.infoList = []
|
|
||||||
that.markDays = []
|
|
||||||
that.list = []
|
|
||||||
that.getList(start, end)
|
|
||||||
},
|
|
||||||
onDayClick(data) {
|
|
||||||
let that = this
|
|
||||||
this.infoList = []
|
|
||||||
for (var i = 0; i < that.list.length; i++) {
|
|
||||||
if (Date.parse(data.date) == Date.parse(that.list[i].r_t)) { //includes 检测数组是否有某个值
|
|
||||||
this.infoList.push(that.list[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
addMemberTags(index, item) {
|
|
||||||
var that = this;
|
|
||||||
console.log("addMemberTags", index, item)
|
|
||||||
if (that.isActive.indexOf(index) == -1) {
|
|
||||||
that.isActive.push(index);
|
|
||||||
that.ActiveDays.push(item);
|
|
||||||
} else {
|
|
||||||
that.isActive.splice(that.isActive.indexOf(index), 1);
|
|
||||||
that.ActiveDays.splice(that.ActiveDays.indexOf(item), 1);
|
|
||||||
}
|
|
||||||
if (that.isActive.length > 2) {
|
|
||||||
that.isActive.splice(0, 1)
|
|
||||||
that.ActiveDays.splice(0, 1);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handlePK() {
|
|
||||||
let that = this
|
|
||||||
if (that.isActive.length != 2) {
|
|
||||||
that.$tools.msg("请先选择数据!")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let info = {}
|
|
||||||
info.type = that.acd_id
|
|
||||||
info.before_id = that.isActive[0]
|
|
||||||
info.after_id = that.isActive[1]
|
|
||||||
console.log("1111", info, that.isActive)
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/compk/pkdetail?info=" + JSON.stringify(info)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleActive(ite, ind) {
|
|
||||||
let that = this
|
|
||||||
that.active = ind
|
|
||||||
that.labelName = ite
|
|
||||||
that.startM = that.$tools.getDate("m").substring(0, 10)
|
|
||||||
that.endM = that.$tools.getDate("m").substring(11, 21)
|
|
||||||
that.list = []
|
|
||||||
that.infoList = []
|
|
||||||
that.markDays = []
|
|
||||||
that.isActive = []
|
|
||||||
that.ActiveDays = []
|
|
||||||
that.$nextTick(() => {
|
|
||||||
that.isShow = true
|
|
||||||
that.getList(that.startM, that.endM)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.calendar {
|
|
||||||
padding-top: 60px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/deep/.calendar-wrapper {
|
|
||||||
margin: 15px;
|
|
||||||
|
|
||||||
.header {
|
|
||||||
background-color: #fff;
|
|
||||||
color: $maincolor;
|
|
||||||
border-radius: 10px 10px 0 0;
|
|
||||||
}
|
|
||||||
/deep/uni-icons {
|
|
||||||
color: $maincolor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
font-size: 30rpx !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabbar {
|
|
||||||
display: flex;
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
z-index: 999;
|
|
||||||
justify-content: space-between;
|
|
||||||
border-bottom: 1px solid #f7f7f7;
|
|
||||||
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
|
|
||||||
background-color: #fff;
|
|
||||||
|
|
||||||
.scroll-menu {
|
|
||||||
width: 100%;
|
|
||||||
white-space: nowrap;
|
|
||||||
|
|
||||||
view {
|
|
||||||
height: 55px;
|
|
||||||
line-height: 55px;
|
|
||||||
display: inline-block;
|
|
||||||
min-width: 100px;
|
|
||||||
margin: 0 10px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.active {
|
|
||||||
color: $maincolor;
|
|
||||||
font-weight: bold;
|
|
||||||
border-bottom: 2px solid $maincolor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,272 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="common">
|
|
||||||
<view class="tabbar">
|
|
||||||
<scroll-view class="scroll-menu" scroll-x="true" style="white-space: nowrap;">
|
|
||||||
<view v-for="(item,index) in labellist" :class="[active==index?'active':'']"
|
|
||||||
@click="handleActive(item,index)">
|
|
||||||
<text>{{item}}</text>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
<view class="history">
|
|
||||||
<uni-swipe-action>
|
|
||||||
<uni-swipe-action-item :right-options="item.options" v-for="(item, index) in ranklist" :key="index"
|
|
||||||
@click="swipeClick($event, index)">
|
|
||||||
<view class='list'>
|
|
||||||
<view class="item">
|
|
||||||
<view class="time">
|
|
||||||
<icon class="t-icon t-icon-shijian-mianxing-0"></icon>
|
|
||||||
<text>{{item.record_time}}</text>
|
|
||||||
</view>
|
|
||||||
<view>{{item.v1}}<text>{{item.v1_name}}</text></view>
|
|
||||||
<view>{{item.v2}}<text>{{item.v2_name}}</text></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</uni-swipe-action-item>
|
|
||||||
</uni-swipe-action>
|
|
||||||
<view class="endtext" v-if="!lastPage || page >= lastPage">—— 到底了,看看别的吧 ——</view>
|
|
||||||
</view>
|
|
||||||
<view class="nolist" v-if="!lastPage">
|
|
||||||
<image src="../../static/none.png"></image>
|
|
||||||
<text>暂无数据</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
|
||||||
computed: {
|
|
||||||
...mapState(['user', 'labelList']),
|
|
||||||
labellist() {
|
|
||||||
let that = this
|
|
||||||
let list = []
|
|
||||||
that.labelList.forEach(ite => {
|
|
||||||
if (ite.acd_id == that.acd_id) {
|
|
||||||
list = ite.list
|
|
||||||
that.labelName = ite.list[0]
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return list
|
|
||||||
},
|
|
||||||
endDate() {
|
|
||||||
return this.$tools.getDate("start")
|
|
||||||
},
|
|
||||||
startDate() {
|
|
||||||
return this.$tools.GetDateStr(-90);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
ranklist: [],
|
|
||||||
page: 1,
|
|
||||||
isDelete: false,
|
|
||||||
lastPage: '',
|
|
||||||
acd_id: "",
|
|
||||||
active: 0,
|
|
||||||
labelName: "",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
let that = this
|
|
||||||
that.acd_id = options.acd_id
|
|
||||||
that.$nextTick(() => {
|
|
||||||
that.getList()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onUnload() {
|
|
||||||
console.log('关闭页面');
|
|
||||||
let that = this
|
|
||||||
var pages = getCurrentPages();
|
|
||||||
var Page = pages[pages.length - 1]; //当前页
|
|
||||||
var prevPage = pages[pages.length - 2];
|
|
||||||
if (that.isDelete) { //确定要返回到相应页面,在触发
|
|
||||||
prevPage.$vm.reload()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onReachBottom() {
|
|
||||||
let that = this
|
|
||||||
console.log("onReachBottom", this.lastPage)
|
|
||||||
if (!this.lastPage || this.page >= this.lastPage) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '没有更多数据!',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.page++
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
swipeClick(e, index) {
|
|
||||||
let that = this
|
|
||||||
let id = that.ranklist[index].id
|
|
||||||
uni.showModal({
|
|
||||||
title: '友情提示',
|
|
||||||
content: '是否删除当前测量记录?',
|
|
||||||
success: function(res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
that.$model.getPublicHistoryDel({
|
|
||||||
id: id,
|
|
||||||
}).then((res) => {
|
|
||||||
if (res.code != 0) {
|
|
||||||
that.$tools.msg(res.msg)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
that.ranklist.splice(index, 1)
|
|
||||||
that.$store.dispatch("getUserInfo", {
|
|
||||||
aud_id: uni.getStorageSync('userid')
|
|
||||||
})
|
|
||||||
that.isDelete = true
|
|
||||||
that.$tools.msg("删除成功")
|
|
||||||
})
|
|
||||||
} else if (res.cancel) {
|
|
||||||
that.$tools.msg("您已取消操作!");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getList() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getPublicHistory({
|
|
||||||
aud_id: uni.getStorageSync('userid'),
|
|
||||||
acd_id: that.acd_id,
|
|
||||||
page: that.page,
|
|
||||||
name: that.labelName
|
|
||||||
}).then((res) => {
|
|
||||||
console.log("历史记录", res)
|
|
||||||
if (res.code != 0) return
|
|
||||||
let options = [{
|
|
||||||
text: '删除',
|
|
||||||
style: {
|
|
||||||
backgroundColor: '#dd524d'
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
res.data.rows.forEach(item => {
|
|
||||||
item.options = options
|
|
||||||
})
|
|
||||||
this.ranklist = this.ranklist.concat(res.data.rows)
|
|
||||||
this.lastPage = res.data.totalpage
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleActive(ite, ind) {
|
|
||||||
let that = this
|
|
||||||
that.active = ind
|
|
||||||
that.labelName = ite
|
|
||||||
that.page = 1
|
|
||||||
that.ranklist = []
|
|
||||||
that.lastPage = ""
|
|
||||||
that.getList()
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style scoped="scoped" lang="scss">
|
|
||||||
.common {
|
|
||||||
width: 100%;
|
|
||||||
min-height: 100.5vh; // 重点
|
|
||||||
overflow-y: scroll;
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabbar {
|
|
||||||
display: flex;
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
z-index: 999;
|
|
||||||
justify-content: space-between;
|
|
||||||
border-bottom: 1px solid #f7f7f7;
|
|
||||||
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
|
|
||||||
background-color: #fff;
|
|
||||||
|
|
||||||
.scroll-menu {
|
|
||||||
width: 100%;
|
|
||||||
white-space: nowrap;
|
|
||||||
|
|
||||||
view {
|
|
||||||
height: 55px;
|
|
||||||
line-height: 55px;
|
|
||||||
display: inline-block;
|
|
||||||
min-width: 100px;
|
|
||||||
margin: 0 10px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.active {
|
|
||||||
color: $maincolor;
|
|
||||||
font-weight: bold;
|
|
||||||
border-bottom: 2px solid $maincolor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.history {
|
|
||||||
width: calc(100% - 30px);
|
|
||||||
height: auto;
|
|
||||||
margin: 70px 15px 0;
|
|
||||||
padding-bottom: 40px;
|
|
||||||
|
|
||||||
.list {
|
|
||||||
width: 100%;
|
|
||||||
margin-top: 12px;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.item {
|
|
||||||
width: calc(100% - 20px);
|
|
||||||
height: auto;
|
|
||||||
background: #fff;
|
|
||||||
padding: 10px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
border-radius: 10px;
|
|
||||||
align-items: center;
|
|
||||||
font-weight: 700;
|
|
||||||
font-size: 30rpx !important;
|
|
||||||
|
|
||||||
text {
|
|
||||||
width: 100%;
|
|
||||||
display: block;
|
|
||||||
color: #666;
|
|
||||||
text-align: center;
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
view {
|
|
||||||
width: 28%;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.time {
|
|
||||||
width: 44% !important;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #666;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
icon {
|
|
||||||
width: 40rpx;
|
|
||||||
height: 40rpx;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
width: 100%;
|
|
||||||
font-size: 30rpx;
|
|
||||||
margin-top: 3px;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,156 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content pkconp">
|
|
||||||
<view class="headerTop">
|
|
||||||
<view class="left">
|
|
||||||
<image :src="memInfo.headimg" class="image1"></image>
|
|
||||||
</view>
|
|
||||||
<view class="right">
|
|
||||||
<view class="name">{{memInfo.name?memInfo.name:memInfo.nickname}}</view>
|
|
||||||
<view class="top">
|
|
||||||
<view>性别:{{memInfo.gender=='0'?'未知':memInfo.gender=='1'?'男':'女'}}</view>
|
|
||||||
<view class="ml-15">年龄:{{user.age}}岁</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="box" v-if="acd_id==2">
|
|
||||||
<view class="item">
|
|
||||||
<view>{{memInfo.day?memInfo.day:'0'}}</view>
|
|
||||||
<text>时间(天)</text>
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<view>{{memInfo.weightdiff?Math.abs(memInfo.weightdiff):0}}</view>
|
|
||||||
<text v-if="Number(memInfo.weightdiff)>0">增重(kg)</text>
|
|
||||||
<text v-else>减重(kg)</text>
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<view>{{memInfo.fat_wdiff?Math.abs(memInfo.fat_wdiff):0}}</view>
|
|
||||||
<text v-if="Number(memInfo.fat_wdiff)>0">增脂(kg)</text>
|
|
||||||
<text v-else>减脂(kg)</text>
|
|
||||||
</view>
|
|
||||||
<view class="time">
|
|
||||||
<view>
|
|
||||||
<uni-icons class="t-icon t-icon-shijian-mianxing-0"></uni-icons>{{memInfo.time}}
|
|
||||||
</view>数据变化
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="boxTime" v-else>
|
|
||||||
<view class=" mt-10 mb-10">
|
|
||||||
<uni-icons class="t-icon t-icon-shijian-mianxing-0 mr-10 size18"></uni-icons>
|
|
||||||
{{memInfo.time}}
|
|
||||||
</view>
|
|
||||||
数据变化
|
|
||||||
</view>
|
|
||||||
<view class="control">
|
|
||||||
<!-- 名称 -->
|
|
||||||
<view class="title">
|
|
||||||
<view class="name"></view>
|
|
||||||
<view>趋势</view>
|
|
||||||
<view>之前</view>
|
|
||||||
<view>之后</view>
|
|
||||||
</view>
|
|
||||||
<view v-for="(ite,ind) in listStr" :key="ind" class="li">
|
|
||||||
<view class="name">
|
|
||||||
<text>{{ite.title}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="num">
|
|
||||||
<text
|
|
||||||
v-if="ite.diffval!=0||ite.diffval=='0.00'||ite.diffval=='00:00:00'">{{acd_id!=6?Math.abs(ite.diffval):ite.diffval}}</text>
|
|
||||||
<icon class="t-icon t-icon-shang" v-if="Number(ite.diffval)>0"></icon>
|
|
||||||
<icon class="t-icon t-icon-xia" v-if="Number(ite.diffval)<0"></icon>
|
|
||||||
<icon class="t-icon t-icon-hengxian"
|
|
||||||
v-if="!ite.diffval||ite.diffval=='0.00'||ite.diffval=='00:00:00'"></icon>
|
|
||||||
</view>
|
|
||||||
<view class="f">
|
|
||||||
<view>{{ite.firstresult?ite.firstresult.value:'-'}}</view>
|
|
||||||
<text>{{ite.firstresult.level}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="f">
|
|
||||||
<view>{{ite.secondresult?ite.secondresult.value:'-'}}</view>
|
|
||||||
<text>{{ite.secondresult.level}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
onLoad(options) {
|
|
||||||
let that = this
|
|
||||||
// 导航栏颜色
|
|
||||||
console.log("options", options)
|
|
||||||
if (options.info) {
|
|
||||||
let info = JSON.parse(options.info)
|
|
||||||
that.acd_id = info.type
|
|
||||||
that.handleSharepic(JSON.parse(options.info))
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["user", "appTheme"]),
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleSharepic(info) {
|
|
||||||
let that = this
|
|
||||||
that.$model.getresultcontrast({
|
|
||||||
type: info.type,
|
|
||||||
before_id: info.before_id,
|
|
||||||
after_id: info.after_id,
|
|
||||||
}).then(res => {
|
|
||||||
console.log("res", res)
|
|
||||||
if (res.code != 0) {
|
|
||||||
this.$tools.msg(res.msg)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
res.data.list.forEach(ite => {
|
|
||||||
if (ite.firstresult && ite.firstresult.name == 'weight') {
|
|
||||||
res.data.weightdiff = ite.diffval
|
|
||||||
}
|
|
||||||
if (ite.firstresult && ite.firstresult.name == 'fat_w') {
|
|
||||||
res.data.fat_wdiff = ite.diffval
|
|
||||||
}
|
|
||||||
if (ite.firstresult || ite.secondresult) {
|
|
||||||
ite.name = ite.firstresult ? ite.firstresult.name : ite.secondresult.name
|
|
||||||
ite.title = ite.firstresult ? ite.firstresult.title : ite.secondresult.title
|
|
||||||
}
|
|
||||||
})
|
|
||||||
that.memInfo = res.data
|
|
||||||
that.listStr = res.data.list
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
memInfo: {},
|
|
||||||
listStr: [],
|
|
||||||
acd_id: "",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.age {
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon {
|
|
||||||
width: 18px;
|
|
||||||
height: 18px;
|
|
||||||
padding: 3px;
|
|
||||||
margin-right: 7px;
|
|
||||||
background-color: #aaa;
|
|
||||||
border-radius: 50%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.t-icon-hengxian {
|
|
||||||
height: 2px;
|
|
||||||
width: 10px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,75 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<view class="list">
|
|
||||||
<view class="item" v-for="(item,index) in list" @click="handlebinging(item)">
|
|
||||||
<image :src="item.pic"></image>
|
|
||||||
<view class="name">{{item.name}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
list: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
this.handleUserDeviceList()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleUserDeviceList() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getDeviceList({}).then(res => {
|
|
||||||
if (res.code != 0) {
|
|
||||||
that.$tools.msg(res.msg)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
that.list = res.data.list
|
|
||||||
}).catch(err => {})
|
|
||||||
},
|
|
||||||
handlebinging(item) {
|
|
||||||
console.log("item", item)
|
|
||||||
uni.redirectTo({
|
|
||||||
url: "/pageTwo/business/search?id=" + item.id
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.list {
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
|
|
||||||
.item {
|
|
||||||
width: 33.3%;
|
|
||||||
padding-top: 8px;
|
|
||||||
display: flex;
|
|
||||||
float: left;
|
|
||||||
flex-direction: column;
|
|
||||||
box-sizing: border-box;
|
|
||||||
justify-content: center;
|
|
||||||
border-right: 1px solid #dfdfdf;
|
|
||||||
border-bottom: 1px solid #dfdfdf;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 60px;
|
|
||||||
height: 60px;
|
|
||||||
margin: 0 auto 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.name {
|
|
||||||
width: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-align: center;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,152 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<view class="add" @click="handleAddDevice()">添加设备</view>
|
|
||||||
<view class="list">
|
|
||||||
<view class="item" v-for="(item,index) in list" @click="handleunbind(item,index)">
|
|
||||||
<view class="left">
|
|
||||||
<image :src="item.pic"></image>
|
|
||||||
<view class="name">
|
|
||||||
<text>{{item.name}}</text>
|
|
||||||
<text>{{item.bind_time}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="bing">解绑</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
// list: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["user", "userDeviceList"]),
|
|
||||||
list() {
|
|
||||||
return this.userDeviceList
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
let that = this
|
|
||||||
that.$store.dispatch('getUserDeviceList')
|
|
||||||
},
|
|
||||||
onPullDownRefresh() {
|
|
||||||
let that = this
|
|
||||||
that.$store.dispatch('getUserDeviceList')
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.stopPullDownRefresh()
|
|
||||||
}, 1000);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleunbind(item, index) {
|
|
||||||
let that = this
|
|
||||||
uni.showModal({
|
|
||||||
title: '友情提示',
|
|
||||||
content: '是否解绑该设备?',
|
|
||||||
success: function(res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
that.$model.getUnbinding({
|
|
||||||
id: item.id
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code != 0) {
|
|
||||||
that.$tools.msg(res.msg)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
that.$tools.msg("操作成功")
|
|
||||||
that.list.splice(index, 1)
|
|
||||||
that.$store.dispatch('getUserInfo', {
|
|
||||||
aud_id: uni.getStorageSync('userid')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
} else if (res.cancel) {
|
|
||||||
that.$tools.msg("您已取消操作!");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleAddDevice() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/business/addDevice"
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.content {
|
|
||||||
font-size: 32rpx;
|
|
||||||
padding: 15px;
|
|
||||||
background-color: #F5F6FA;
|
|
||||||
min-height: calc(100vh - 30px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.add {
|
|
||||||
width: 100%;
|
|
||||||
height: 35px;
|
|
||||||
line-height: 35px;
|
|
||||||
font-size: 32rpx;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 15px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
background: $btncolor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list {
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
|
|
||||||
.item {
|
|
||||||
width: calc(100% - 20px);
|
|
||||||
padding: 5px 10px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
border-radius: 10px;
|
|
||||||
background-color: #fff;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
|
|
||||||
.left {
|
|
||||||
width: 80%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 50px;
|
|
||||||
height: 50px;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.name {
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
text {
|
|
||||||
width: 100%;
|
|
||||||
display: block;
|
|
||||||
text-align: left;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.bing {
|
|
||||||
width: auto;
|
|
||||||
float: right;
|
|
||||||
background-color: #dfdfdf;
|
|
||||||
border-radius: 10px;
|
|
||||||
padding: 5px 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,297 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="container">
|
|
||||||
<view class="tips">请在设备开机状态下,搜索设备</view>
|
|
||||||
<view class="item" @click="openBluetoothAdapter">开始搜索设备</view>
|
|
||||||
<view class="devices_summary">已发现 {{devices.length}} 个设备:</view>
|
|
||||||
<view>
|
|
||||||
<scroll-view class="device_list" scroll-y scroll-with-animation v-if="popup">
|
|
||||||
<view v-for="(item,index) in devices" :key="index" @tap="createBLEConnection(item)" class="device_item">
|
|
||||||
<view>
|
|
||||||
<text>{{item.localName ||item.name}}</text>
|
|
||||||
</view>
|
|
||||||
<view>mac地址:{{item.macAddr || item.deviceId}}</view>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
<view class="tishi">
|
|
||||||
<view class="text">
|
|
||||||
<icon class="t-icon t-icon-tishi"></icon> 设备绑定流程说明
|
|
||||||
</view>
|
|
||||||
<view class="dv">
|
|
||||||
<text>1、打开手机蓝牙和位置信息</text>
|
|
||||||
<text>2、ios系统需打开设置—>应用—>微信里的蓝牙权限</text>
|
|
||||||
<text>3、设备亮屏状态下搜索蓝牙</text>
|
|
||||||
<text>4、选择蓝牙进行绑定</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
let that;
|
|
||||||
let myTime;
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
macAddr: "",
|
|
||||||
code: "",
|
|
||||||
deviceId: "",
|
|
||||||
popup: false,
|
|
||||||
devices: [],
|
|
||||||
id: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["user", "isConnected", "isBluetoothTyle"]),
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
that = this
|
|
||||||
that.id = options.id
|
|
||||||
that.$Bluetooth.onBLEConnectionStateChange()
|
|
||||||
uni.onBluetoothAdapterStateChange(function(res) {
|
|
||||||
that.$store.commit("changeBluetooth", res.available);
|
|
||||||
})
|
|
||||||
console.log("搜索")
|
|
||||||
},
|
|
||||||
onUnload() {
|
|
||||||
console.log("onUnload")
|
|
||||||
let that = this
|
|
||||||
if (!that.Unload) {
|
|
||||||
uni.hideLoading()
|
|
||||||
that.$Bluetooth.closeBluetoothAdapter() // 断开蓝牙模块
|
|
||||||
that.$Bluetooth.stopBluetoothDevicesDiscovery() // 取消蓝牙搜索
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 初始化蓝牙
|
|
||||||
openBluetoothAdapter() {
|
|
||||||
let that = this
|
|
||||||
uni.openBluetoothAdapter({
|
|
||||||
success: e => {
|
|
||||||
console.log("蓝牙初始化成功")
|
|
||||||
that.startBluetoothDeviceDiscovery()
|
|
||||||
},
|
|
||||||
fail: e => {
|
|
||||||
console.log('初始化蓝牙失败:' + e.errMsg);
|
|
||||||
that.$Bluetooth.getBluetoothAdapter(e)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 开始搜寻附近的蓝牙外围设备
|
|
||||||
startBluetoothDeviceDiscovery() {
|
|
||||||
let that = this
|
|
||||||
uni.startBluetoothDevicesDiscovery({
|
|
||||||
allowDuplicatesKey: true, //是否允许重复上报同一设备
|
|
||||||
success: res => {
|
|
||||||
that.onBluetoothDeviceFound();
|
|
||||||
},
|
|
||||||
fail: res => {}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 发现外围设备
|
|
||||||
*/
|
|
||||||
onBluetoothDeviceFound() {
|
|
||||||
var that = this;
|
|
||||||
const foundDevices = []
|
|
||||||
wx.showLoading({
|
|
||||||
title: '设备搜索中',
|
|
||||||
})
|
|
||||||
uni.onBluetoothDeviceFound(res => {
|
|
||||||
res.devices.forEach(device => {
|
|
||||||
if (device.name.indexOf("YPC") != -1) {
|
|
||||||
clearTimeout(myTime);
|
|
||||||
let buff = device.name.slice(7, 19)
|
|
||||||
device.macAddr = that.$Bluetooth.str2Num(buff)
|
|
||||||
device.deviceId = that.$Bluetooth.str2Num(buff)
|
|
||||||
that.handleDevice(device)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (device.name.indexOf("G02") != -1) {
|
|
||||||
clearTimeout(myTime);
|
|
||||||
let buff = device.advertisData.slice(3, 9)
|
|
||||||
device.mac = new Uint8Array(buff) // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
|
|
||||||
let tempMac = Array.from(device.mac)
|
|
||||||
tempMac.reverse()
|
|
||||||
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
|
|
||||||
that.handleDevice(device)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (device.name.indexOf("Yihejia_Lung") != -1) {
|
|
||||||
console.log("肺活量", device, '04:0D:84:48:E0:9B')
|
|
||||||
device.macAddr = device.deviceId
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.handleDevice(device)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
that.handleMyTime()
|
|
||||||
},
|
|
||||||
handleDevice(device) {
|
|
||||||
let that = this
|
|
||||||
const foundDevices = that.devices
|
|
||||||
const idx = that.$tools.inArray(foundDevices, "deviceId", device.deviceId)
|
|
||||||
that.deviceId = device.deviceId;
|
|
||||||
if (idx === -1) {
|
|
||||||
that.devices.push(device);
|
|
||||||
} else {
|
|
||||||
that.devices[idx] = device
|
|
||||||
}
|
|
||||||
that.popup = true
|
|
||||||
},
|
|
||||||
handleMyTime() {
|
|
||||||
var that = this;
|
|
||||||
myTime = setTimeout(function() {
|
|
||||||
if (!that.devices.length) {
|
|
||||||
that.islink = -1
|
|
||||||
that.$tools.showModal("没有查找到设备")
|
|
||||||
}
|
|
||||||
uni.hideLoading()
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.$Bluetooth.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
|
||||||
}, 15000);
|
|
||||||
},
|
|
||||||
// 连接蓝牙
|
|
||||||
createBLEConnection(e) {
|
|
||||||
let that = this;
|
|
||||||
that.$Bluetooth.stopBluetoothDevicesDiscovery()
|
|
||||||
that.macAddr = e.macAddr
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: '是否绑定该设备?',
|
|
||||||
cancelText: "取消",
|
|
||||||
confirmText: "确定",
|
|
||||||
success: (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
that.getActive()
|
|
||||||
} else {
|
|
||||||
that.$tools.msg("您已取消操作")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getActive() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getBinding({
|
|
||||||
device_id: that.id,
|
|
||||||
device_mac: that.macAddr
|
|
||||||
}).then(res => {
|
|
||||||
that.$Bluetooth.closeBluetoothAdapter()
|
|
||||||
that.devices = []
|
|
||||||
if (res.code == 0) {
|
|
||||||
that.$tools.msg('绑定成功!')
|
|
||||||
that.$store.dispatch('getUserDeviceList')
|
|
||||||
that.$store.dispatch('getUserInfo', {
|
|
||||||
aud_id: uni.getStorageSync('userid')
|
|
||||||
})
|
|
||||||
setTimeout(function() {
|
|
||||||
uni.switchTab({
|
|
||||||
url: "/pages/home/home"
|
|
||||||
})
|
|
||||||
}, 500)
|
|
||||||
} else {
|
|
||||||
that.$tools.msg(res.msg)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.content {
|
|
||||||
min-height: calc(100vh - 66px);
|
|
||||||
padding: 0;
|
|
||||||
border-top: 66px solid #F9FAFC;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tishi {
|
|
||||||
width: 100%;
|
|
||||||
font-size: 28rpx;
|
|
||||||
line-height: 25px;
|
|
||||||
font-weight: bold;
|
|
||||||
position: absolute;
|
|
||||||
bottom: 20px;
|
|
||||||
padding-left: 15px;
|
|
||||||
|
|
||||||
.text {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
icon {
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #999;
|
|
||||||
width: 100%;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
width: 70%;
|
|
||||||
height: 40px;
|
|
||||||
line-height: 38px;
|
|
||||||
text-align: center;
|
|
||||||
background: #f7f7f7;
|
|
||||||
border: 1px solid #dfdfdf;
|
|
||||||
font-weight: bold;
|
|
||||||
margin: auto;
|
|
||||||
border-radius: 15px;
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.devices_summary {
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
line-height: 40px;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 36rpx;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device_list {
|
|
||||||
flex: 1;
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
max-height: 340px;
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
position: absolute;
|
|
||||||
bottom: 160px;
|
|
||||||
top: 170px;
|
|
||||||
|
|
||||||
.device_item {
|
|
||||||
font-size: 32rpx;
|
|
||||||
padding: 7px 10px;
|
|
||||||
color: #999;
|
|
||||||
border-bottom: 1px solid #dfdfdf;
|
|
||||||
|
|
||||||
text {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 28rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #666;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tips {
|
|
||||||
font-size: 28rpx;
|
|
||||||
text-align: center;
|
|
||||||
color: #e83a1e;
|
|
||||||
background: #f7e4c8;
|
|
||||||
padding: 5px 0;
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -4,10 +4,16 @@
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<!-- <view class="tips">长按拖拽可调整卡片位置</view> -->
|
<!-- <view class="tips">长按拖拽可调整卡片位置</view> -->
|
||||||
<view class="list">
|
<view class="list">
|
||||||
<view class="item" v-for="(item,index) in cardList.user" @click="deleteCard(item,index)">
|
<view class="item" v-for="(item,index) in cardList.chosen_fixed">
|
||||||
|
<view class="info">
|
||||||
|
<image :src="item.icon"></image>
|
||||||
|
<view>{{item.name}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="item" v-for="(item,index) in cardList.chosen_yes" @click="deleteCard(item,index)">
|
||||||
<uni-icons type="minus-filled" size="18" color="#FF6D66" v-if="item.id!=2"></uni-icons>
|
<uni-icons type="minus-filled" size="18" color="#FF6D66" v-if="item.id!=2"></uni-icons>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<image :src="item.pic"></image>
|
<image :src="item.icon"></image>
|
||||||
<view>{{item.name}}</view>
|
<view>{{item.name}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -17,10 +23,10 @@
|
||||||
<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 cardList.all" @click="addCard(item,index)">
|
<view class="item" v-for="(item,index) in cardList.chosen_no" @click="addCard(item,index)">
|
||||||
<uni-icons type="plus-filled" size="18" color="#05BD79"></uni-icons>
|
<uni-icons type="plus-filled" size="18" color="#05BD79"></uni-icons>
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<image :src="item.pic"></image>
|
<image :src="item.icon"></image>
|
||||||
<view>{{item.name}}</view>
|
<view>{{item.name}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -39,71 +45,52 @@
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
cardList: {
|
// cardList: {
|
||||||
user: [],
|
// chosen_no: [],
|
||||||
all: []
|
// chosen_yes: [],
|
||||||
},
|
// chosen_fixed: []
|
||||||
|
// },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
|
||||||
let that = this
|
|
||||||
that.handleCardList()
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['user']),
|
...mapState(['user', "CardList"]),
|
||||||
|
cardList() {
|
||||||
|
return this.CardList
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取所有卡片
|
|
||||||
handleCardList() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getCardAllList({
|
|
||||||
aud_id: that.user.id
|
|
||||||
}).then(res => {
|
|
||||||
console.log("卡片列表", res.data)
|
|
||||||
if (res.code != 0) {
|
|
||||||
that.$tools.msg(res.msg)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
that.cardList = res.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleGradeList() {
|
handleGradeList() {
|
||||||
let that = this
|
let that = this
|
||||||
let list = []
|
let list = []
|
||||||
that.cardList.user.forEach(ite => {
|
that.cardList.chosen_yes.forEach(ite => {
|
||||||
list.push(ite.id)
|
list.push(ite.id)
|
||||||
})
|
})
|
||||||
that.$model.getCardAllOrder({
|
that.$model.getCardAllOrder({
|
||||||
aud_id: that.user.id,
|
aud_id: that.user.aud_id,
|
||||||
card_order: list.join(",")
|
card_list: list.join(",")
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code != 0) {
|
if (res.code != 0) {
|
||||||
that.$tools.msg(res.msg)
|
that.$tools.msg(res.msg)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
that.$store.dispatch('getUserInfo', {
|
that.$store.dispatch("getCardAllList", {
|
||||||
aud_id: that.user.id
|
aud_id: that.user.aud_id,
|
||||||
})
|
|
||||||
uni.switchTab({
|
|
||||||
url: "/pages/home/home"
|
|
||||||
})
|
})
|
||||||
|
uni.navigateBack()
|
||||||
}).catch(err => {})
|
}).catch(err => {})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 删除已选择卡片
|
// 删除已选择卡片
|
||||||
deleteCard(item, index) {
|
deleteCard(item, index) {
|
||||||
let that = this
|
let that = this
|
||||||
if (item.id == 2) return
|
that.cardList.chosen_yes.splice(index, 1)
|
||||||
that.cardList.user.splice(index, 1)
|
that.cardList.chosen_no.push(item)
|
||||||
that.cardList.all.push(item)
|
|
||||||
// that.handleGradeList()
|
|
||||||
},
|
},
|
||||||
// 添加已有的卡片
|
// 添加已有的卡片
|
||||||
addCard(item, index) {
|
addCard(item, index) {
|
||||||
let that = this
|
let that = this
|
||||||
that.cardList.all.splice(index, 1)
|
that.cardList.chosen_no.splice(index, 1)
|
||||||
that.cardList.user.push(item)
|
that.cardList.chosen_yes.push(item)
|
||||||
// that.handleGradeList()
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -116,6 +103,10 @@
|
||||||
background-color: #F5F6FA;
|
background-color: #F5F6FA;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
|
|
||||||
|
.box {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.tips {
|
.tips {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
|
|
@ -136,7 +127,7 @@
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
width: 45%;
|
width: 47%;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
@ -171,7 +162,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
width: auto;
|
width: calc(100% - 30px);
|
||||||
margin: 40px 15px 0;
|
margin: 40px 15px 0;
|
||||||
background: $btncolor !important;
|
background: $btncolor !important;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,15 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class=" calendar">
|
<view class="tagList">
|
||||||
|
<scroll-view class="scroll-view_H" scroll-x="true">
|
||||||
|
<text class="scroll-view-item_H" v-for="(ite,ind) in publicRecordInfo"
|
||||||
|
@click="handlePageScrollTo(ite.id,ind)" :class="[ind == index?'active':'']">
|
||||||
|
{{ite.name}}
|
||||||
|
</text>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="calendar">
|
||||||
<!-- 日历 -->
|
<!-- 日历 -->
|
||||||
<ren-calendar ref='ren' :markDays='markDays' @onDayClick='onDayClick' @onMonthClickPre='onMonthClickPre'
|
<ren-calendar ref='ren' :markDays='markDays' @onDayClick='onDayClick' @onMonthClickPre='onMonthClickPre'
|
||||||
v-if="isShow">
|
v-if="isShow">
|
||||||
|
|
@ -56,43 +65,56 @@
|
||||||
startM: null,
|
startM: null,
|
||||||
endM: null,
|
endM: null,
|
||||||
isShow: true,
|
isShow: true,
|
||||||
acd_id: ""
|
index: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
RenCalendar,
|
RenCalendar,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user", "TrendPk", "appTheme"]),
|
...mapState(["user", "PublicRecord"]),
|
||||||
length() {
|
length() {
|
||||||
return this.isActive.length
|
return this.isActive.length
|
||||||
},
|
},
|
||||||
endDate() {
|
endDate() {
|
||||||
return this.$tools.getDate("start")
|
return this.$tools.getDate("start")
|
||||||
},
|
},
|
||||||
|
publicRecordInfo() {
|
||||||
|
let that = this
|
||||||
|
return that.PublicRecord
|
||||||
|
},
|
||||||
},
|
},
|
||||||
onLoad(optoins) {
|
onLoad() {
|
||||||
let that = this
|
let that = this
|
||||||
that.acd_id = optoins.acd_id
|
that.handlonLoad()
|
||||||
that.startM = that.$tools.getDate("m").substring(0, 10)
|
|
||||||
that.endM = that.$tools.getDate("m").substring(11, 21)
|
|
||||||
that.markDays = []
|
|
||||||
that.list = []
|
|
||||||
that.isActive = []
|
|
||||||
that.ActiveDays = []
|
|
||||||
this.$nextTick(() => {
|
|
||||||
that.isShow = true
|
|
||||||
that.getList(that.startM, that.endM)
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
handlePageScrollTo(id, ind) {
|
||||||
|
let that = this
|
||||||
|
that.index = ind
|
||||||
|
that.handlonLoad()
|
||||||
|
},
|
||||||
|
handlonLoad() {
|
||||||
|
let that = this
|
||||||
|
that.startM = that.$tools.getDate("m").substring(0, 10)
|
||||||
|
that.endM = that.$tools.getDate("m").substring(11, 21)
|
||||||
|
that.markDays = []
|
||||||
|
that.list = []
|
||||||
|
that.infoList = []
|
||||||
|
that.isActive = []
|
||||||
|
that.ActiveDays = []
|
||||||
|
that.$nextTick(() => {
|
||||||
|
that.isShow = true
|
||||||
|
that.getList(that.startM, that.endM)
|
||||||
|
})
|
||||||
|
},
|
||||||
getList(start, end) {
|
getList(start, end) {
|
||||||
let that = this
|
let that = this
|
||||||
that.$model.getresultdiff({
|
that.$model.getresultdiff({
|
||||||
aud_id: uni.getStorageSync('userid'),
|
aud_id: that.user.aud_id,
|
||||||
s_time: start,
|
s_time: start,
|
||||||
e_time: end,
|
e_time: end,
|
||||||
type: that.acd_id
|
type: that.publicRecordInfo[that.index].key_word
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res) {
|
if (res) {
|
||||||
that.markDays = res.Dlist
|
that.markDays = res.Dlist
|
||||||
|
|
@ -102,7 +124,7 @@
|
||||||
that.infoList.push(res.data[i])
|
that.infoList.push(res.data[i])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log("对比", res,)
|
console.log("对比", res, )
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -148,9 +170,9 @@
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let info = {}
|
let info = {}
|
||||||
info.type = that.acd_id
|
|
||||||
info.before_id = that.isActive[0]
|
info.before_id = that.isActive[0]
|
||||||
info.after_id = that.isActive[1]
|
info.after_id = that.isActive[1]
|
||||||
|
info.type = that.publicRecordInfo[that.index].key_word
|
||||||
console.log("1111", info, that.isActive)
|
console.log("1111", info, that.isActive)
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pageTwo/compk/pkdetail?info=" + JSON.stringify(info)
|
url: "/pageTwo/compk/pkdetail?info=" + JSON.stringify(info)
|
||||||
|
|
@ -162,4 +184,41 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.tagList {
|
||||||
|
width: 100%;
|
||||||
|
height: 45px;
|
||||||
|
line-height: 45px;
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
z-index: 999;
|
||||||
|
|
||||||
|
.active {
|
||||||
|
color: $maincolor;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-view_H {
|
||||||
|
white-space: nowrap;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.scroll-view-item_H {
|
||||||
|
display: inline-block;
|
||||||
|
height: 45rpx;
|
||||||
|
line-height: 45rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
text {
|
||||||
|
color: #666;
|
||||||
|
padding: 0 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.calendar{
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -53,10 +53,9 @@
|
||||||
<text>{{ite.title}}</text>
|
<text>{{ite.title}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="num">
|
<view class="num">
|
||||||
<text
|
<text>{{ite.diffval}}</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-xia" v-if="ite.diffval.includes('-')"></icon>
|
||||||
<icon class="t-icon t-icon-shang" v-if="Number(ite.diffval)>0"></icon>
|
<icon class="t-icon t-icon-shang" v-else></icon>
|
||||||
<icon class="t-icon t-icon-xia" v-if="Number(ite.diffval)<0"></icon>
|
|
||||||
<icon class="t-icon t-icon-hengxian"
|
<icon class="t-icon t-icon-hengxian"
|
||||||
v-if="!ite.diffval||ite.diffval=='0.00'||ite.diffval=='00:00:00'"></icon>
|
v-if="!ite.diffval||ite.diffval=='0.00'||ite.diffval=='00:00:00'"></icon>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -82,15 +81,13 @@
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
// 导航栏颜色
|
// 导航栏颜色
|
||||||
console.log("options", options)
|
|
||||||
if (options.info) {
|
if (options.info) {
|
||||||
let info = JSON.parse(options.info)
|
let info = JSON.parse(options.info)
|
||||||
that.acd_id = info.type
|
|
||||||
that.handleSharepic(JSON.parse(options.info))
|
that.handleSharepic(JSON.parse(options.info))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user", "appTheme"]),
|
...mapState(["user"]),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSharepic(info) {
|
handleSharepic(info) {
|
||||||
|
|
@ -99,6 +96,7 @@
|
||||||
type: info.type,
|
type: info.type,
|
||||||
before_id: info.before_id,
|
before_id: info.before_id,
|
||||||
after_id: info.after_id,
|
after_id: info.after_id,
|
||||||
|
type: info.type
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log("res", res)
|
console.log("res", res)
|
||||||
if (res.code != 0) {
|
if (res.code != 0) {
|
||||||
|
|
@ -137,6 +135,15 @@
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.headerTop {
|
||||||
|
width: calc(100% - 60px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxTime {
|
||||||
|
margin-bottom: 0;
|
||||||
|
width: calc(100% - 50px);
|
||||||
|
}
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
width: 18px;
|
width: 18px;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="weightPages">
|
<view class="weightPages">
|
||||||
<view class="content ">
|
<view class="content ">
|
||||||
<view class="status">{{textLink}}</view>
|
<view class="status">{{UseBlueConfig.BleConnectMsg}}</view>
|
||||||
<view class="quan">
|
<view class="quan">
|
||||||
<view>
|
<view>
|
||||||
<text class="weight">{{weight?weight:'0.00'}}</text>{{unit}}
|
<text class="weight">{{weight?weight:'0.00'}}</text>{{unit}}
|
||||||
|
|
@ -43,7 +43,6 @@
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
let myTime;
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -53,15 +52,12 @@
|
||||||
weight: "",
|
weight: "",
|
||||||
height: "",
|
height: "",
|
||||||
unit: "kg",
|
unit: "kg",
|
||||||
Unload: false,
|
|
||||||
isHeight: false,
|
isHeight: false,
|
||||||
isSave: true, //保存按钮是否显示
|
isSave: true, //保存按钮是否显示
|
||||||
deviceId: "",
|
deviceId: "",
|
||||||
serviceId: "",
|
serviceId: "",
|
||||||
write: "",
|
write: "",
|
||||||
notify: "",
|
notify: "",
|
||||||
islink: 0, //0连接中,1成功,-1失败
|
|
||||||
textLink: "",
|
|
||||||
isFinished: false, //是否锁定数据
|
isFinished: false, //是否锁定数据
|
||||||
devicesList: [],
|
devicesList: [],
|
||||||
IsLing: false, //是否点击清零按钮
|
IsLing: false, //是否点击清零按钮
|
||||||
|
|
@ -69,19 +65,14 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user", "isConnected", "isBluetoothTyle"]),
|
...mapState(["user", "UseBlueConfig"]),
|
||||||
userInfo() {
|
userInfo() {
|
||||||
return this.user
|
return this.user
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onUnload: function() {
|
onUnload: function() {
|
||||||
let that = this
|
let that = this
|
||||||
if (!that.Unload) {
|
that.useBluetooth.clearBluetoothStatus()
|
||||||
clearTimeout(myTime)
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
console.log("页面返回onUnload")
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
|
|
@ -89,25 +80,21 @@
|
||||||
that.height = that.userInfo.height
|
that.height = that.userInfo.height
|
||||||
that.head = that.userInfo.head_data
|
that.head = that.userInfo.head_data
|
||||||
that.deviceId = options.deviceId
|
that.deviceId = options.deviceId
|
||||||
that.createBLEConnection()
|
that.useBluetooth.createBLEConnection("FFF0")
|
||||||
that.$Bluetooth.onBLEConnectionStateChange()
|
that.useBluetooth.onBLEConnectionStateChange()
|
||||||
uni.onBluetoothAdapterStateChange(function(res) {
|
that.useBluetooth.onBluetoothAdapterStateChange()
|
||||||
that.$store.commit("changeBluetooth", res.available);
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
isConnected: function() {
|
'UseBlueConfig.isUseConnect'() {
|
||||||
let that = this
|
let that = this
|
||||||
if (!that.isConnected) {
|
if (!that.UseBlueConfig.isUseConnect) {
|
||||||
let text = '测量过程中已与设备连接中断,请重新连接设备再开始测量'
|
that.$tools.showModal('蓝牙连接已断开,请重新连接后测量')
|
||||||
that.$tools.showModal(text)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isBluetoothTyle: function() {
|
'UseBlueConfig.serviceId'() {
|
||||||
let that = this
|
let that = this
|
||||||
if (!that.isBluetoothTyle) {
|
if (that.UseBlueConfig.serviceId) {
|
||||||
let text = '蓝牙已关闭,请重新打开蓝牙后再开始测量'
|
that.getBLEDeviceCharacteristics(that.UseBlueConfig.serviceId)
|
||||||
that.$tools.showModal(text)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isFinished: function() {
|
isFinished: function() {
|
||||||
|
|
@ -125,50 +112,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 连接蓝牙
|
|
||||||
createBLEConnection() {
|
|
||||||
let that = this;
|
|
||||||
uni.createBLEConnection({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: res => {
|
|
||||||
that.textLink = "蓝牙连接中"
|
|
||||||
setTimeout(function() {
|
|
||||||
that.getBLEDeviceServices()
|
|
||||||
}, 1000)
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
that.textLink = "设备连接失败,返回首页重新连接"
|
|
||||||
console.log("设备连接失败,请重新连接", res, that.deviceId);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 获取设备的UUID
|
|
||||||
*/
|
|
||||||
getBLEDeviceServices() {
|
|
||||||
let serviceList = [];
|
|
||||||
let that = this;
|
|
||||||
uni.getBLEDeviceServices({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: res => {
|
|
||||||
console.log("获取设备的UUID成功", res)
|
|
||||||
serviceList = res.services;
|
|
||||||
for (let i = 0; i < serviceList.length; i++) {
|
|
||||||
let service = serviceList[i];
|
|
||||||
if (service.uuid.indexOf("FFF0") != -1) {
|
|
||||||
that.serviceId = service.uuid;
|
|
||||||
that.getBLEDeviceCharacteristics();
|
|
||||||
console.log("设备的FFF0的serviceId: " + that.serviceId);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
that.textLink = "设备连接失败,返回首页重新连接"
|
|
||||||
console.log('获取设备的UUID失败:', res)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
* 获取指定服务的特征值
|
* 获取指定服务的特征值
|
||||||
*/
|
*/
|
||||||
|
|
@ -188,7 +131,9 @@
|
||||||
that.writeBLECharacteristicValue("A6020500076A") // 清零
|
that.writeBLECharacteristicValue("A6020500076A") // 清零
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
that.textLink = "蓝牙连接成功,请开始测量"
|
that.$store.commit("getIsUseBluetooth", {
|
||||||
|
BleConnectMsg: "蓝牙连接成功,请开始测量",
|
||||||
|
});
|
||||||
uni.notifyBLECharacteristicValueChange({
|
uni.notifyBLECharacteristicValueChange({
|
||||||
deviceId: that.deviceId,
|
deviceId: that.deviceId,
|
||||||
serviceId: that.serviceId,
|
serviceId: that.serviceId,
|
||||||
|
|
@ -351,14 +296,13 @@
|
||||||
} else {
|
} else {
|
||||||
that.$tools.msg("测量失败")
|
that.$tools.msg("测量失败")
|
||||||
}
|
}
|
||||||
that.Unload = true
|
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: "/pages/home/home"
|
url: "/pages/body/body"
|
||||||
})
|
})
|
||||||
setTimeout(function() {
|
// setTimeout(function() {
|
||||||
that.closeBLEConnection()
|
// that.closeBLEConnection()
|
||||||
that.closeBluetoothAdapter()
|
// that.closeBluetoothAdapter()
|
||||||
}, 200)
|
// }, 200)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//重新测量
|
//重新测量
|
||||||
|
|
@ -380,59 +324,12 @@
|
||||||
icon: "none"
|
icon: "none"
|
||||||
})
|
})
|
||||||
console.log("重置", that.typeInfo, that.weight)
|
console.log("重置", that.typeInfo, that.weight)
|
||||||
// setTimeout(function() {
|
|
||||||
// that.isHeight = false
|
|
||||||
// that.isFinished = false
|
|
||||||
// uni.hideLoading()
|
|
||||||
// }, 1200)
|
|
||||||
},
|
},
|
||||||
fail: res => {
|
fail: res => {
|
||||||
console.log("下发指令失败", res);
|
console.log("下发指令失败", res);
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* 停止搜索蓝牙设备
|
|
||||||
*/
|
|
||||||
stopBluetoothDevicesDiscovery() {
|
|
||||||
uni.stopBluetoothDevicesDiscovery({
|
|
||||||
success: e => {
|
|
||||||
console.log("停止搜索蓝牙设备", e)
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 监听蓝牙连接状态
|
|
||||||
onBLEConnectionStateChange() {
|
|
||||||
let that = this
|
|
||||||
uni.onBLEConnectionStateChange(function(res) {
|
|
||||||
console.log("监听蓝牙连接状态", res.connected)
|
|
||||||
that.$store.commit("changeConnected", res.connected);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 断开蓝牙模块
|
|
||||||
*/
|
|
||||||
closeBluetoothAdapter() {
|
|
||||||
let that = this;
|
|
||||||
uni.closeBluetoothAdapter({
|
|
||||||
success: res => {
|
|
||||||
console.log('蓝牙模块关闭成功');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 断开蓝牙连接
|
|
||||||
*/
|
|
||||||
closeBLEConnection() {
|
|
||||||
var that = this;
|
|
||||||
uni.closeBLEConnection({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: res => {
|
|
||||||
console.log('断开蓝牙连接成功');
|
|
||||||
that.$store.commit("changeConnected", false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="weightPages">
|
<view class="weightPages">
|
||||||
<view class="content ">
|
<view class="content ">
|
||||||
<view class="status">{{textLink}}</view>
|
<view class="status">{{UseBlueConfig.BleConnectMsg}}</view>
|
||||||
<view class="text">{{text}}</view>
|
<view class="text">{{text}}</view>
|
||||||
<view class="image">
|
<view class="image">
|
||||||
<image src="/pageTwo/static/HC.png" class="image3"></image>
|
<image src="/pageTwo/static/HC.png" class="image3"></image>
|
||||||
|
|
@ -51,103 +51,50 @@
|
||||||
isHeight: false,
|
isHeight: false,
|
||||||
isConnection: 0,
|
isConnection: 0,
|
||||||
isdevice: false,
|
isdevice: false,
|
||||||
textLink: ""
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user", "isConnected", "isBluetoothTyle"]),
|
...mapState(["user", "UseBlueConfig"]),
|
||||||
userInfo() {
|
userInfo() {
|
||||||
return this.user
|
return this.user
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onUnload: function() {
|
onUnload: function() {
|
||||||
let that = this
|
let that = this
|
||||||
if (!that.Unload) {
|
that.useBluetooth.clearBluetoothStatus()
|
||||||
clearTimeout(myTime)
|
console.log("页面返回onUnload")
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
console.log("页面返回onUnload")
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
that.weight = that.userInfo.weight
|
that.weight = that.userInfo.weight
|
||||||
that.deviceId = options.deviceId
|
that.deviceId = options.deviceId
|
||||||
that.createBLEConnection()
|
that.useBluetooth.createBLEConnection("FFF0")
|
||||||
that.onBLEConnectionStateChange()
|
that.useBluetooth.onBLEConnectionStateChange()
|
||||||
uni.onBluetoothAdapterStateChange(function(res) {
|
that.useBluetooth.onBluetoothAdapterStateChange()
|
||||||
that.$store.commit("changeBluetooth", res.available);
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
isConnected: function() {
|
'UseBlueConfig.isUseConnect'() {
|
||||||
let that = this
|
let that = this
|
||||||
if (!that.isConnected) {
|
if (!that.UseBlueConfig.isUseConnect) {
|
||||||
let text = '测量过程中已与设备连接中断,请重新连接设备再开始测量'
|
that.$tools.showModal('蓝牙连接已断开,请重新连接后测量')
|
||||||
that.$tools.showModal(text)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isBluetoothTyle: function() {
|
'UseBlueConfig.serviceId'() {
|
||||||
let that = this
|
let that = this
|
||||||
if (!that.isBluetoothTyle) {
|
if (that.UseBlueConfig.serviceId) {
|
||||||
let text = '蓝牙已关闭,请重新打开蓝牙后再开始测量'
|
that.getBLEDeviceCharacteristics(that.UseBlueConfig.serviceId)
|
||||||
that.$tools.showModal(text)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 连接蓝牙
|
|
||||||
createBLEConnection() {
|
|
||||||
let that = this;
|
|
||||||
uni.createBLEConnection({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: res => {
|
|
||||||
that.textLink = "蓝牙连接中"
|
|
||||||
setTimeout(function() {
|
|
||||||
that.getBLEDeviceServices()
|
|
||||||
}, 1000)
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
that.textLink = "设备连接失败,返回首页重新连接"
|
|
||||||
console.log("设备连接失败,请重新连接", res, that.deviceId);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 获取设备的UUID
|
|
||||||
*/
|
|
||||||
getBLEDeviceServices() {
|
|
||||||
let serviceList = [];
|
|
||||||
let that = this;
|
|
||||||
uni.getBLEDeviceServices({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: res => {
|
|
||||||
console.log("获取设备的UUID成功", res, that.deviceId)
|
|
||||||
serviceList = res.services;
|
|
||||||
for (let i = 0; i < serviceList.length; i++) {
|
|
||||||
let service = serviceList[i];
|
|
||||||
if (service.uuid.indexOf("FFF0") != -1) {
|
|
||||||
that.serviceId = service.uuid;
|
|
||||||
that.getBLEDeviceCharacteristics();
|
|
||||||
console.log("设备的FFE0的serviceId: " + that.serviceId);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
that.textLink = "设备连接失败,返回首页重新连接"
|
|
||||||
console.log('获取设备的UUID失败:', res)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
* 获取指定服务的特征值
|
* 获取指定服务的特征值
|
||||||
*/
|
*/
|
||||||
getBLEDeviceCharacteristics() {
|
getBLEDeviceCharacteristics(serviceId) {
|
||||||
let that = this;
|
let that = this;
|
||||||
uni.getBLEDeviceCharacteristics({
|
uni.getBLEDeviceCharacteristics({
|
||||||
deviceId: that.deviceId,
|
deviceId: that.deviceId,
|
||||||
serviceId: that.serviceId,
|
serviceId: serviceId,
|
||||||
success: res => {
|
success: res => {
|
||||||
// * 读read: true, //,写write: true, //,通知notify: true
|
// * 读read: true, //,写write: true, //,通知notify: true
|
||||||
for (let i = 0; i < res.characteristics.length; i++) {
|
for (let i = 0; i < res.characteristics.length; i++) {
|
||||||
|
|
@ -158,20 +105,22 @@
|
||||||
that.write = item.uuid
|
that.write = item.uuid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
that.textLink = "蓝牙连接成功,请开始测量"
|
that.$store.commit("getIsUseBluetooth", {
|
||||||
|
BleConnectMsg: "蓝牙连接成功,请开始测量",
|
||||||
|
});
|
||||||
uni.notifyBLECharacteristicValueChange({
|
uni.notifyBLECharacteristicValueChange({
|
||||||
deviceId: that.deviceId,
|
deviceId: that.deviceId,
|
||||||
serviceId: that.serviceId,
|
serviceId: serviceId,
|
||||||
characteristicId: that.notify,
|
characteristicId: that.notify,
|
||||||
state: true,
|
state: true,
|
||||||
})
|
})
|
||||||
uni.notifyBLECharacteristicValueChange({
|
uni.notifyBLECharacteristicValueChange({
|
||||||
deviceId: that.deviceId,
|
deviceId: that.deviceId,
|
||||||
serviceId: that.serviceId,
|
serviceId: serviceId,
|
||||||
characteristicId: that.write,
|
characteristicId: that.write,
|
||||||
state: true,
|
state: true,
|
||||||
})
|
})
|
||||||
that.notifyBLECharacteristicValue()
|
that.notifyBLECharacteristicValue(serviceId)
|
||||||
},
|
},
|
||||||
fail: res => {
|
fail: res => {
|
||||||
console.log('获取特征值失败:', JSON.stringify(res))
|
console.log('获取特征值失败:', JSON.stringify(res))
|
||||||
|
|
@ -179,12 +128,12 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 接收蓝牙数据
|
// 接收蓝牙数据
|
||||||
notifyBLECharacteristicValue() {
|
notifyBLECharacteristicValue(serviceId) {
|
||||||
let that = this;
|
let that = this;
|
||||||
uni.notifyBLECharacteristicValueChange({
|
uni.notifyBLECharacteristicValueChange({
|
||||||
state: true, // 启用 notify 功能
|
state: true, // 启用 notify 功能
|
||||||
deviceId: that.deviceId,
|
deviceId: that.deviceId,
|
||||||
serviceId: that.serviceId,
|
serviceId: serviceId,
|
||||||
characteristicId: that.notify,
|
characteristicId: that.notify,
|
||||||
success(res) {
|
success(res) {
|
||||||
uni.onBLECharacteristicValueChange(function(res) {
|
uni.onBLECharacteristicValueChange(function(res) {
|
||||||
|
|
@ -243,7 +192,6 @@
|
||||||
} else {
|
} else {
|
||||||
height = that.height2
|
height = that.height2
|
||||||
}
|
}
|
||||||
console.log("提交身高", height)
|
|
||||||
that.$model.getmeasurefunit({
|
that.$model.getmeasurefunit({
|
||||||
adc: 0,
|
adc: 0,
|
||||||
weight: that.weight,
|
weight: that.weight,
|
||||||
|
|
@ -251,82 +199,26 @@
|
||||||
aud_id: that.userInfo.id
|
aud_id: that.userInfo.id
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
that.isHeight = false
|
that.isHeight = false
|
||||||
|
console.log("报告", res)
|
||||||
|
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
that.$store.dispatch("getResult", {
|
// that.$store.dispatch('getUserInfo', {
|
||||||
aud_id: uni.getStorageSync('userid')
|
// aud_id: uni.getStorageSync('userid')
|
||||||
})
|
// })
|
||||||
that.$store.dispatch('getUserInfo', {
|
|
||||||
aud_id: uni.getStorageSync('userid')
|
|
||||||
})
|
|
||||||
that.$tools.msg("测量成功")
|
that.$tools.msg("测量成功")
|
||||||
} else {
|
} else {
|
||||||
that.$tools.msg("测量失败")
|
that.$tools.msg("测量失败")
|
||||||
}
|
}
|
||||||
that.Unload = true
|
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: "/pages/home/home"
|
url: "/pages/body/body"
|
||||||
})
|
})
|
||||||
setTimeout(function() {
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
}, 500)
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleHeight() {
|
handleHeight() {
|
||||||
let that = this
|
let that = this
|
||||||
that.height = ""
|
|
||||||
that.text = ""
|
that.text = ""
|
||||||
|
that.height = ""
|
||||||
that.isHeight = false
|
that.isHeight = false
|
||||||
// let j = Number(2 + 3).toString(16)
|
|
||||||
// let str = "5A0203" + j.substr(j.length - 2, 2)
|
|
||||||
// let buf = new Uint8Array(str.match(/[\da-f]{2}/gi).map(function(h) {
|
|
||||||
// return parseInt(h, 16)
|
|
||||||
// }))
|
|
||||||
// uni.writeBLECharacteristicValue({
|
|
||||||
// deviceId: that.deviceId,
|
|
||||||
// serviceId: that.serviceId,
|
|
||||||
// characteristicId: that.write,
|
|
||||||
// value: buf.buffer,
|
|
||||||
// success: res => {
|
|
||||||
|
|
||||||
// console.log('下发指令成功', res.errMsg)
|
|
||||||
// },
|
|
||||||
// fail: res => {
|
|
||||||
// console.log("下发指令失败", res);
|
|
||||||
// },
|
|
||||||
// })
|
|
||||||
},
|
|
||||||
// 监听蓝牙连接状态
|
|
||||||
onBLEConnectionStateChange() {
|
|
||||||
let that = this
|
|
||||||
uni.onBLEConnectionStateChange(function(res) {
|
|
||||||
console.log("监听蓝牙连接状态", res.connected)
|
|
||||||
that.$store.commit("changeConnected", res.connected);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 断开蓝牙模块
|
|
||||||
*/
|
|
||||||
closeBluetoothAdapter() {
|
|
||||||
let that = this;
|
|
||||||
uni.closeBluetoothAdapter({
|
|
||||||
success: res => {
|
|
||||||
console.log('蓝牙模块关闭成功');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 断开蓝牙连接
|
|
||||||
*/
|
|
||||||
closeBLEConnection() {
|
|
||||||
var that = this;
|
|
||||||
uni.closeBLEConnection({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: res => {
|
|
||||||
console.log('断开蓝牙连接成功');
|
|
||||||
that.$store.commit("changeConnected", false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,10 +44,7 @@
|
||||||
height: "",
|
height: "",
|
||||||
deviceId: "",
|
deviceId: "",
|
||||||
unit: "kg",
|
unit: "kg",
|
||||||
Unload: false,
|
|
||||||
isHeight: false,
|
isHeight: false,
|
||||||
isConnection: 0,
|
|
||||||
isdevice: false,
|
|
||||||
stopblue: true,
|
stopblue: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -59,14 +56,7 @@
|
||||||
},
|
},
|
||||||
onUnload: function() {
|
onUnload: function() {
|
||||||
let that = this
|
let that = this
|
||||||
if (!that.Unload) {
|
that.useBluetooth.clearBluetoothStatus()
|
||||||
clearTimeout(myTime)
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
|
||||||
let pages = getCurrentPages();
|
|
||||||
pages[pages.length - 2].$vm.getBlereload();
|
|
||||||
console.log("页面返回onUnload", pages, pages[pages.length - 2])
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
|
|
@ -74,7 +64,7 @@
|
||||||
that.stopblue = true
|
that.stopblue = true
|
||||||
that.deviceId = options.deviceId
|
that.deviceId = options.deviceId
|
||||||
that.height = that.user.height
|
that.height = that.user.height
|
||||||
that.onBluetoothDeviceFound()
|
uni.onBluetoothDeviceFound(handleDeviceFound)
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
stopblue: function() {
|
stopblue: function() {
|
||||||
|
|
@ -89,74 +79,48 @@
|
||||||
/**
|
/**
|
||||||
* 发现外围设备
|
* 发现外围设备
|
||||||
*/
|
*/
|
||||||
onBluetoothDeviceFound() {
|
onBluetoothDeviceFound(res) {
|
||||||
var that = this;
|
var that = this;
|
||||||
uni.onBluetoothDeviceFound(res => {
|
res.devices.forEach(device => {
|
||||||
res.devices.forEach(device => {
|
device.advertisData = device.advertisData ? device.advertisData : ''
|
||||||
device.advertisData = device.advertisData ? device.advertisData : ''
|
if (device.name.toLowerCase().indexOf("pcl") !== -1 && device.deviceId.indexOf(that
|
||||||
if (device.name.indexOf("PCL") !== -1 && device.deviceId.indexOf(that.deviceId) !=
|
.deviceId) != -1) {
|
||||||
-1) {
|
let value = that.$tools.ab2hex(device.advertisData, "")
|
||||||
clearTimeout(myTime);
|
let data = parseInt(value.substring(4, 8), 16)
|
||||||
let value = that.$tools.ab2hex(device.advertisData, "")
|
let msg = parseInt(value.substring(16, 18), 16).toString(2)
|
||||||
let data = parseInt(value.substring(4, 8), 16)
|
let type = msg.substring(5, 6) //0实时,1稳定
|
||||||
let msg = parseInt(value.substring(16, 18), 16).toString(2)
|
let num = msg.substring(3, 5) //小数点
|
||||||
let type = msg.substring(5, 6) //0实时,1稳定
|
let dw = msg.substring(1, 3) //单位
|
||||||
let num = msg.substring(3, 5) //小数点
|
if (dw == "01") {
|
||||||
let dw = msg.substring(1, 3) //单位
|
that.unit = "斤"
|
||||||
if (dw == "01") {
|
}
|
||||||
that.unit = "斤"
|
if (dw == "10") {
|
||||||
}
|
that.unit = "lb"
|
||||||
|
}
|
||||||
|
if (num == "00") {
|
||||||
|
data = data / 10
|
||||||
|
}
|
||||||
|
if (num == "10") {
|
||||||
if (dw == "10") {
|
if (dw == "10") {
|
||||||
that.unit = "lb"
|
that.unit = "lb"
|
||||||
}
|
|
||||||
if (num == "00") {
|
|
||||||
data = data / 10
|
data = data / 10
|
||||||
|
} else {
|
||||||
|
data = data / 100
|
||||||
}
|
}
|
||||||
if (num == "10") {
|
|
||||||
if (dw == "10") {
|
|
||||||
that.unit = "lb"
|
|
||||||
data = data / 10
|
|
||||||
} else {
|
|
||||||
data = data / 100
|
|
||||||
}
|
|
||||||
}
|
|
||||||
that.text = "您的实时体重是:" + data + that.unit
|
|
||||||
if (type == "1") {
|
|
||||||
that.text = "您的稳定体重是:" + data + that.unit
|
|
||||||
that.imp = parseInt(value.substring(8, 12), 16) / 10
|
|
||||||
that.deviceId = device.deviceId
|
|
||||||
that.weight = data
|
|
||||||
that.stopblue = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
})
|
that.text = "您的实时体重是:" + data + that.unit
|
||||||
});
|
if (type == "1") {
|
||||||
// that.handleMyTime()
|
that.text = "您的稳定体重是:" + data + that.unit
|
||||||
},
|
that.imp = parseInt(value.substring(8, 12), 16) / 10
|
||||||
handleMyTime() {
|
that.deviceId = device.deviceId
|
||||||
var that = this;
|
that.weight = data
|
||||||
myTime = setTimeout(function() {
|
that.stopblue = false
|
||||||
if (!that.macAddr) {
|
that.useBluetooth.stopSearchBluetooth() //取消蓝牙搜索
|
||||||
clearTimeout(myTime);
|
return
|
||||||
that.text = ""
|
}
|
||||||
that.Unload = true
|
return;
|
||||||
that.isHeight = false
|
|
||||||
that.startBluetoothDeviceDiscovery()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
}
|
}
|
||||||
}, 30000);
|
})
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 停止搜索蓝牙设备
|
|
||||||
*/
|
|
||||||
stopBluetoothDevicesDiscovery() {
|
|
||||||
uni.stopBluetoothDevicesDiscovery({
|
|
||||||
success: e => {
|
|
||||||
console.log("停止搜索蓝牙设备", e)
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
// 保存测量结果
|
// 保存测量结果
|
||||||
handleGetMeasure() {
|
handleGetMeasure() {
|
||||||
|
|
@ -184,13 +148,9 @@
|
||||||
} else {
|
} else {
|
||||||
that.$tools.msg("测量失败")
|
that.$tools.msg("测量失败")
|
||||||
}
|
}
|
||||||
that.Unload = true
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
|
||||||
let pages = getCurrentPages();
|
|
||||||
pages[pages.length - 2].$vm.getBlereload();
|
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: "/pages/home/home"
|
url: "/pages/body/body"
|
||||||
})
|
})
|
||||||
}, 200)
|
}, 200)
|
||||||
})
|
})
|
||||||
|
|
@ -199,24 +159,14 @@
|
||||||
handleBack() {
|
handleBack() {
|
||||||
let that = this
|
let that = this
|
||||||
that.text = ""
|
that.text = ""
|
||||||
that.Unload = true
|
that.$store.commit("getIsUseBluetooth", {
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
isBleLink: true,
|
||||||
let pages = getCurrentPages();
|
BleBodyMsg: "开始测量",
|
||||||
console.log("页面返回onUnload", pages, pages[pages.length - 2])
|
isUseConnect: false,
|
||||||
pages[pages.length - 2].$vm.getBlereload();
|
});
|
||||||
|
that.useBluetooth.stopSearchBluetooth() //取消蓝牙搜索
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: "/pages/home/home"
|
url: "/pages/body/body"
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 断开蓝牙模块
|
|
||||||
*/
|
|
||||||
closeBluetoothAdapter() {
|
|
||||||
let that = this;
|
|
||||||
uni.closeBluetoothAdapter({
|
|
||||||
success: res => {
|
|
||||||
console.log('蓝牙模块关闭成功');
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -44,10 +44,7 @@
|
||||||
height: "",
|
height: "",
|
||||||
deviceId: "",
|
deviceId: "",
|
||||||
unit: "kg",
|
unit: "kg",
|
||||||
Unload: false,
|
|
||||||
isHeight: false,
|
isHeight: false,
|
||||||
isConnection: 0,
|
|
||||||
isdevice: false,
|
|
||||||
stopblue: false,
|
stopblue: false,
|
||||||
typeInfo: -1
|
typeInfo: -1
|
||||||
}
|
}
|
||||||
|
|
@ -60,34 +57,24 @@
|
||||||
},
|
},
|
||||||
onUnload: function() {
|
onUnload: function() {
|
||||||
let that = this
|
let that = this
|
||||||
if (!that.Unload) {
|
that.useBluetooth.clearBluetoothStatus()
|
||||||
clearTimeout(myTime)
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
|
||||||
let pages = getCurrentPages();
|
|
||||||
pages[pages.length - 2].$vm.getBlereload();
|
|
||||||
console.log("页面返回onUnload", pages, pages[pages.length - 2])
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
that.text = ""
|
that.text = ""
|
||||||
that.typeInfo = -1
|
that.typeInfo = -1
|
||||||
that.stopblue = false
|
|
||||||
that.deviceId = options.deviceId
|
that.deviceId = options.deviceId
|
||||||
that.height = that.user.height
|
that.height = that.user.height
|
||||||
that.onBluetoothDeviceFound()
|
uni.onBluetoothDeviceFound(handleDeviceFound)
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
stopblue: function() {
|
stopblue: function() {
|
||||||
let that = this
|
let that = this
|
||||||
if (!that.stopblue) {
|
if (!that.stopblue) {
|
||||||
clearTimeout(myTime);
|
|
||||||
that.isHeight = false
|
that.isHeight = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (that.stopblue && that.typeInfo == 1) {
|
if (that.stopblue && that.typeInfo == 1) {
|
||||||
clearTimeout(myTime);
|
|
||||||
that.isHeight = true
|
that.isHeight = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -96,80 +83,54 @@
|
||||||
/**
|
/**
|
||||||
* 发现外围设备
|
* 发现外围设备
|
||||||
*/
|
*/
|
||||||
onBluetoothDeviceFound() {
|
onBluetoothDeviceFound(res) {
|
||||||
var that = this;
|
var that = this;
|
||||||
uni.onBluetoothDeviceFound(res => {
|
res.devices.forEach(device => {
|
||||||
res.devices.forEach(device => {
|
device.advertisData = device.advertisData ? device.advertisData : ''
|
||||||
device.advertisData = device.advertisData ? device.advertisData : ''
|
let value = that.$tools.ab2hex(device.advertisData, "")
|
||||||
let value = that.$tools.ab2hex(device.advertisData, "")
|
let type = value.substring(0, 2)
|
||||||
let type = value.substring(0, 2)
|
if (type.toLowerCase() == 'c0') {
|
||||||
if (type.toLowerCase() == 'c0') {
|
let msg = parseInt(value.substring(16, 18), 16).toString(2)
|
||||||
clearTimeout(myTime);
|
let type = msg.substring(0, 1) //类型 0体重,1体脂
|
||||||
let msg = parseInt(value.substring(16, 18), 16).toString(2)
|
let unit = msg.substring(1, 3) //单位
|
||||||
let type = msg.substring(0, 1) //类型 0体重,1体脂
|
let num = msg.substring(3, 5) //小数点
|
||||||
let unit = msg.substring(1, 3) //单位
|
let weight = parseInt(value.substring(4, 8), 16)
|
||||||
let num = msg.substring(3, 5) //小数点
|
let status = msg.substring(5, 6) //0实时,1稳定
|
||||||
let weight = parseInt(value.substring(4, 8), 16)
|
console.log("value", value, "状态:", status, "类型:", type, )
|
||||||
let status = msg.substring(5, 6) //0实时,1稳定
|
console.log('体重:', weight, "小数点:", num, "单位:", unit)
|
||||||
console.log("value", value, "状态:", status, "类型:", type, )
|
if (unit == "10") {
|
||||||
console.log('体重:', weight, "小数点:", num, "单位:", unit)
|
that.unit = "lb"
|
||||||
|
}
|
||||||
|
if (num == "00") {
|
||||||
|
weight = weight / 10
|
||||||
|
}
|
||||||
|
if (num == "10") {
|
||||||
if (unit == "10") {
|
if (unit == "10") {
|
||||||
that.unit = "lb"
|
that.unit = "lb"
|
||||||
}
|
|
||||||
if (num == "00") {
|
|
||||||
weight = weight / 10
|
weight = weight / 10
|
||||||
|
} else {
|
||||||
|
weight = weight / 100
|
||||||
}
|
}
|
||||||
if (num == "10") {
|
|
||||||
if (unit == "10") {
|
|
||||||
that.unit = "lb"
|
|
||||||
weight = weight / 10
|
|
||||||
} else {
|
|
||||||
weight = weight / 100
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (status == "0") {
|
|
||||||
that.typeInfo = 0
|
|
||||||
that.stopblue = false
|
|
||||||
that.text = "您的实时体重是:" + weight + that.unit
|
|
||||||
}
|
|
||||||
if (status == "1") {
|
|
||||||
if (type == '1') {
|
|
||||||
that.imp = parseInt(value.substring(8, 12), 16) / 10
|
|
||||||
}
|
|
||||||
that.typeInfo = 1
|
|
||||||
that.text = "您的稳定体重是:" + weight + that.unit
|
|
||||||
that.weight = weight
|
|
||||||
that.stopblue = true
|
|
||||||
console.log("测量完成", that.weight)
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
})
|
if (status == "0") {
|
||||||
});
|
that.typeInfo = 0
|
||||||
// that.handleMyTime()
|
that.stopblue = false
|
||||||
},
|
that.text = "您的实时体重是:" + weight + that.unit
|
||||||
handleMyTime() {
|
}
|
||||||
var that = this;
|
if (status == "1") {
|
||||||
myTime = setTimeout(function() {
|
if (type == '1') {
|
||||||
if (!that.macAddr) {
|
that.imp = parseInt(value.substring(8, 12), 16) / 10
|
||||||
clearTimeout(myTime);
|
}
|
||||||
that.text = ""
|
that.typeInfo = 1
|
||||||
that.Unload = true
|
that.text = "您的稳定体重是:" + weight + that.unit
|
||||||
that.isHeight = false
|
that.weight = weight
|
||||||
that.startBluetoothDeviceDiscovery()
|
that.stopblue = true
|
||||||
that.closeBluetoothAdapter()
|
that.useBluetooth.stopSearchBluetooth() //取消蓝牙搜索
|
||||||
|
console.log("测量完成", that.weight)
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}, 30000);
|
})
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 停止搜索蓝牙设备
|
|
||||||
*/
|
|
||||||
stopBluetoothDevicesDiscovery() {
|
|
||||||
uni.stopBluetoothDevicesDiscovery({
|
|
||||||
success: e => {
|
|
||||||
console.log("停止搜索蓝牙设备", e)
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
// 保存测量结果
|
// 保存测量结果
|
||||||
handleGetMeasure() {
|
handleGetMeasure() {
|
||||||
|
|
@ -197,13 +158,9 @@
|
||||||
} else {
|
} else {
|
||||||
that.$tools.msg("测量失败")
|
that.$tools.msg("测量失败")
|
||||||
}
|
}
|
||||||
that.Unload = true
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
|
||||||
let pages = getCurrentPages();
|
|
||||||
pages[pages.length - 2].$vm.getBlereload();
|
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: "/pages/home/home"
|
url: "/pages/body/body"
|
||||||
})
|
})
|
||||||
}, 200)
|
}, 200)
|
||||||
})
|
})
|
||||||
|
|
@ -212,24 +169,14 @@
|
||||||
handleBack() {
|
handleBack() {
|
||||||
let that = this
|
let that = this
|
||||||
that.text = ""
|
that.text = ""
|
||||||
that.Unload = true
|
that.$store.commit("getIsUseBluetooth", {
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
isBleLink: true,
|
||||||
let pages = getCurrentPages();
|
BleBodyMsg: "开始测量",
|
||||||
console.log("页面返回onUnload", pages, pages[pages.length - 2])
|
isUseConnect: false,
|
||||||
pages[pages.length - 2].$vm.getBlereload();
|
});
|
||||||
|
that.useBluetooth.stopSearchBluetooth() //取消蓝牙搜索
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: "/pages/home/home"
|
url: "/pages/body/body"
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 断开蓝牙模块
|
|
||||||
*/
|
|
||||||
closeBluetoothAdapter() {
|
|
||||||
let that = this;
|
|
||||||
uni.closeBluetoothAdapter({
|
|
||||||
success: res => {
|
|
||||||
console.log('蓝牙模块关闭成功');
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -44,10 +44,7 @@
|
||||||
height: "",
|
height: "",
|
||||||
deviceId: "",
|
deviceId: "",
|
||||||
unit: "kg",
|
unit: "kg",
|
||||||
Unload: false,
|
|
||||||
isHeight: false,
|
isHeight: false,
|
||||||
isConnection: 0,
|
|
||||||
isdevice: false,
|
|
||||||
stopblue: false,
|
stopblue: false,
|
||||||
typeInfo: -1,
|
typeInfo: -1,
|
||||||
}
|
}
|
||||||
|
|
@ -60,14 +57,7 @@
|
||||||
},
|
},
|
||||||
onUnload: function() {
|
onUnload: function() {
|
||||||
let that = this
|
let that = this
|
||||||
if (!that.Unload) {
|
that.useBluetooth.clearBluetoothStatus()
|
||||||
clearTimeout(myTime)
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
|
||||||
let pages = getCurrentPages();
|
|
||||||
pages[pages.length - 2].$vm.getBlereload();
|
|
||||||
console.log("页面返回onUnload", pages, pages[pages.length - 2])
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
|
|
@ -76,18 +66,16 @@
|
||||||
that.stopblue = false
|
that.stopblue = false
|
||||||
that.deviceId = options.deviceId
|
that.deviceId = options.deviceId
|
||||||
that.height = that.user.height
|
that.height = that.user.height
|
||||||
that.onBluetoothDeviceFound()
|
uni.onBluetoothDeviceFound(handleDeviceFound)
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
stopblue: function() {
|
stopblue: function() {
|
||||||
let that = this
|
let that = this
|
||||||
if (!that.stopblue) {
|
if (!that.stopblue) {
|
||||||
clearTimeout(myTime);
|
|
||||||
that.isHeight = false
|
that.isHeight = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (that.stopblue && that.typeInfo == '1') {
|
if (that.stopblue && that.typeInfo == '1') {
|
||||||
clearTimeout(myTime);
|
|
||||||
that.isHeight = true
|
that.isHeight = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -96,59 +84,34 @@
|
||||||
/**
|
/**
|
||||||
* 发现外围设备
|
* 发现外围设备
|
||||||
*/
|
*/
|
||||||
onBluetoothDeviceFound() {
|
onBluetoothDeviceFound(res) {
|
||||||
var that = this;
|
var that = this;
|
||||||
uni.onBluetoothDeviceFound(res => {
|
res.devices.forEach(device => {
|
||||||
res.devices.forEach(device => {
|
device.advertisData = device.advertisData ? device.advertisData : ''
|
||||||
device.advertisData = device.advertisData ? device.advertisData : ''
|
if (device.name.toLowerCase().indexOf("da") !== -1) {
|
||||||
if (device.name.toLowerCase().indexOf("da") !== -1) {
|
|
||||||
clearTimeout(myTime);
|
|
||||||
let value = that.$tools.ab2hex(device.advertisData, "")
|
|
||||||
let type = value.substring(0, 1) //d测量,e锁定
|
|
||||||
let type2 = value.substring(1, 2) //0~9体脂,A~F体重
|
|
||||||
let weight = parseInt(value.substring(2, 6), 16) / 100
|
|
||||||
console.log("VALUE", value, type, isNaN(type2), weight)
|
|
||||||
if (type == "d") {
|
|
||||||
that.typeInfo = 0
|
|
||||||
that.stopblue = false
|
|
||||||
that.text = "您的实时体重是:" + weight + 'kg'
|
|
||||||
}
|
|
||||||
if (type == "e") {
|
|
||||||
that.typeInfo = 1
|
|
||||||
that.text = "您的稳定体重是:" + weight + 'kg'
|
|
||||||
that.imp = !isNaN(type2) ? parseInt(value.substring(6, 10), 16) : ''
|
|
||||||
that.weight = weight
|
|
||||||
that.stopblue = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
// that.handleMyTime()
|
|
||||||
},
|
|
||||||
handleMyTime() {
|
|
||||||
var that = this;
|
|
||||||
myTime = setTimeout(function() {
|
|
||||||
if (!that.macAddr) {
|
|
||||||
clearTimeout(myTime);
|
clearTimeout(myTime);
|
||||||
that.text = ""
|
let value = that.$tools.ab2hex(device.advertisData, "")
|
||||||
that.Unload = true
|
let type = value.substring(0, 1) //d测量,e锁定
|
||||||
that.isHeight = false
|
let type2 = value.substring(1, 2) //0~9体脂,A~F体重
|
||||||
that.startBluetoothDeviceDiscovery()
|
let weight = parseInt(value.substring(2, 6), 16) / 100
|
||||||
that.closeBluetoothAdapter()
|
console.log("VALUE", value, type, isNaN(type2), weight)
|
||||||
|
if (type == "d") {
|
||||||
|
that.typeInfo = 0
|
||||||
|
that.stopblue = false
|
||||||
|
that.text = "您的实时体重是:" + weight + 'kg'
|
||||||
|
}
|
||||||
|
if (type == "e") {
|
||||||
|
that.typeInfo = 1
|
||||||
|
that.text = "您的稳定体重是:" + weight + 'kg'
|
||||||
|
that.imp = !isNaN(type2) ? parseInt(value.substring(6, 10), 16) : ''
|
||||||
|
that.weight = weight
|
||||||
|
that.stopblue = true
|
||||||
|
that.useBluetooth.stopSearchBluetooth() //取消蓝牙搜索
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}, 30000);
|
})
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 停止搜索蓝牙设备
|
|
||||||
*/
|
|
||||||
stopBluetoothDevicesDiscovery() {
|
|
||||||
uni.stopBluetoothDevicesDiscovery({
|
|
||||||
success: e => {
|
|
||||||
console.log("停止搜索蓝牙设备", e)
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
// 保存测量结果
|
// 保存测量结果
|
||||||
handleGetMeasure() {
|
handleGetMeasure() {
|
||||||
|
|
@ -176,13 +139,9 @@
|
||||||
} else {
|
} else {
|
||||||
that.$tools.msg("测量失败")
|
that.$tools.msg("测量失败")
|
||||||
}
|
}
|
||||||
that.Unload = true
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
|
||||||
let pages = getCurrentPages();
|
|
||||||
pages[pages.length - 2].$vm.getBlereload();
|
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: "/pages/home/home"
|
url: "/pages/body/body"
|
||||||
})
|
})
|
||||||
}, 200)
|
}, 200)
|
||||||
})
|
})
|
||||||
|
|
@ -191,24 +150,14 @@
|
||||||
handleBack() {
|
handleBack() {
|
||||||
let that = this
|
let that = this
|
||||||
that.text = ""
|
that.text = ""
|
||||||
that.Unload = true
|
that.$store.commit("getIsUseBluetooth", {
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
isBleLink: true,
|
||||||
let pages = getCurrentPages();
|
BleBodyMsg: "开始测量",
|
||||||
console.log("页面返回onUnload", pages, pages[pages.length - 2])
|
isUseConnect: false,
|
||||||
pages[pages.length - 2].$vm.getBlereload();
|
});
|
||||||
|
that.useBluetooth.stopSearchBluetooth() //取消蓝牙搜索
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: "/pages/home/home"
|
url: "/pages/body/body"
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 断开蓝牙模块
|
|
||||||
*/
|
|
||||||
closeBluetoothAdapter() {
|
|
||||||
let that = this;
|
|
||||||
uni.closeBluetoothAdapter({
|
|
||||||
success: res => {
|
|
||||||
console.log('蓝牙模块关闭成功');
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -102,10 +102,8 @@
|
||||||
averageS: "", //平均流速
|
averageS: "", //平均流速
|
||||||
text: 0, //实时
|
text: 0, //实时
|
||||||
LiuS: "", //流速
|
LiuS: "", //流速
|
||||||
macAddr: "",
|
|
||||||
serviceId: "",
|
serviceId: "",
|
||||||
deviceId: "",
|
deviceId: "",
|
||||||
Unload: false,
|
|
||||||
notify: "",
|
notify: "",
|
||||||
write: "",
|
write: "",
|
||||||
second: 5, //倒计时
|
second: 5, //倒计时
|
||||||
|
|
@ -115,7 +113,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user", "isConnected", "isBluetoothTyle", "lungLevel"]),
|
...mapState(["user", "UseBlueConfig", "lungLevel"]),
|
||||||
info() {
|
info() {
|
||||||
return this.user
|
return this.user
|
||||||
},
|
},
|
||||||
|
|
@ -133,37 +131,29 @@
|
||||||
},
|
},
|
||||||
onUnload: function() {
|
onUnload: function() {
|
||||||
let that = this
|
let that = this
|
||||||
if (!that.Unload) {
|
that.useBluetooth.clearBluetoothStatus()
|
||||||
clearTimeout(myTime)
|
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
console.log("页面返回onUnload")
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
if (options && options.deviceId) {
|
if (options && options.deviceId) {
|
||||||
that.deviceId = options.deviceId
|
that.deviceId = options.deviceId
|
||||||
that.openBluetoothAdapter()
|
|
||||||
}
|
}
|
||||||
that.openBluetoothAdapter()
|
that.useBluetooth.createBLEConnection("FFE0")
|
||||||
that.onBLEConnectionStateChange()
|
that.useBluetooth.onBLEConnectionStateChange()
|
||||||
uni.onBluetoothAdapterStateChange(function(res) {
|
that.useBluetooth.onBluetoothAdapterStateChange()
|
||||||
that.$store.commit("changeBluetooth", res.available);
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
isConnected: function() {
|
'UseBlueConfig.isUseConnect'() {
|
||||||
let that = this
|
let that = this
|
||||||
if (!that.isConnected) {
|
if (!that.UseBlueConfig.isUseConnect) {
|
||||||
that.handleBack()
|
that.$tools.showModal('蓝牙连接已断开,请重新连接后测量')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isBluetoothTyle: function() {
|
'UseBlueConfig.serviceId'() {
|
||||||
let that = this
|
let that = this
|
||||||
if (!that.isBluetoothTyle) {
|
if (that.UseBlueConfig.serviceId) {
|
||||||
that.handleBack()
|
that.serviceId = that.UseBlueConfig.serviceId
|
||||||
|
that.getBLEDeviceCharacteristics()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
second: function() {
|
second: function() {
|
||||||
|
|
@ -179,7 +169,6 @@
|
||||||
// 是否结束测量
|
// 是否结束测量
|
||||||
isEnd: function() {
|
isEnd: function() {
|
||||||
let that = this
|
let that = this
|
||||||
console.log("结束测量", that.isEnd)
|
|
||||||
if (that.isEnd) {
|
if (that.isEnd) {
|
||||||
console.log("结束测量2", that.isEnd)
|
console.log("结束测量2", that.isEnd)
|
||||||
that.isstart = false
|
that.isstart = false
|
||||||
|
|
@ -197,115 +186,6 @@
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 重新连接
|
|
||||||
openBluetoothAdapter() {
|
|
||||||
let that = this
|
|
||||||
cnt = 0
|
|
||||||
count = 0;
|
|
||||||
lastValue = null;
|
|
||||||
that.isEnd = false
|
|
||||||
that.text = 0
|
|
||||||
that.number1 = 0
|
|
||||||
that.number2 = 0
|
|
||||||
that.number3 = 0
|
|
||||||
that.level1 = ""
|
|
||||||
that.level2 = ""
|
|
||||||
that.level3 = ""
|
|
||||||
that.average = "" //平均
|
|
||||||
that.LiuS = "" //流速
|
|
||||||
that.second = 5 //倒计时
|
|
||||||
that.standard = "" //标准
|
|
||||||
that.offset = 0 //
|
|
||||||
uni.openBluetoothAdapter({
|
|
||||||
success: e => {
|
|
||||||
console.log("初始化设备")
|
|
||||||
that.startBluetoothDeviceDiscovery()
|
|
||||||
},
|
|
||||||
fail: e => {
|
|
||||||
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 开始搜寻附近的蓝牙外围设备
|
|
||||||
startBluetoothDeviceDiscovery() {
|
|
||||||
let that = this
|
|
||||||
uni.startBluetoothDevicesDiscovery({
|
|
||||||
allowDuplicatesKey: true,
|
|
||||||
success: res => {
|
|
||||||
console.log("开始搜索")
|
|
||||||
that.onBluetoothDeviceFound();
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 发现外围设备
|
|
||||||
*/
|
|
||||||
onBluetoothDeviceFound() {
|
|
||||||
var that = this;
|
|
||||||
uni.onBluetoothDeviceFound(res => {
|
|
||||||
res.devices.forEach(device => {
|
|
||||||
if (!device.name && !device.localName) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (device.name.indexOf('Yihejia_Lung') != -1) {
|
|
||||||
clearTimeout(myTime);
|
|
||||||
device.macAddr = device.deviceId
|
|
||||||
if (device.deviceId.indexOf(that.deviceId) != -1) {
|
|
||||||
that.stopBluetoothDevicesDiscovery()
|
|
||||||
that.createBLEConnection()
|
|
||||||
console.log("that.deviceId", that.deviceId, device.deviceId)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
that.handleMyTime()
|
|
||||||
},
|
|
||||||
// 连接蓝牙
|
|
||||||
createBLEConnection() {
|
|
||||||
let that = this;
|
|
||||||
uni.createBLEConnection({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: res => {
|
|
||||||
that.countdown()
|
|
||||||
setTimeout(function() {
|
|
||||||
that.getBLEDeviceServices()
|
|
||||||
}, 1500)
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
console.log("设备连接失败,请重新连接", res);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 获取设备的UUID
|
|
||||||
*/
|
|
||||||
getBLEDeviceServices() {
|
|
||||||
let serviceList = [];
|
|
||||||
let that = this;
|
|
||||||
uni.getBLEDeviceServices({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: res => {
|
|
||||||
console.log("获取设备的UUID成功", res)
|
|
||||||
serviceList = res.services;
|
|
||||||
for (let i = 0; i < serviceList.length; i++) {
|
|
||||||
let service = serviceList[i];
|
|
||||||
if (service.uuid.indexOf("FFE0") != -1) {
|
|
||||||
that.serviceId = service.uuid;
|
|
||||||
that.getBLEDeviceCharacteristics();
|
|
||||||
console.log("设备的FFE0的serviceId: " + that.serviceId);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
console.log('获取设备的UUID失败:', res)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
* 获取指定服务的特征值
|
* 获取指定服务的特征值
|
||||||
*/
|
*/
|
||||||
|
|
@ -437,17 +317,6 @@
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleMyTime() {
|
|
||||||
var that = this;
|
|
||||||
myTime = setTimeout(function() {
|
|
||||||
if (!that.macAddr) {
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.Unload = true
|
|
||||||
that.startBluetoothDeviceDiscovery()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
}
|
|
||||||
}, 30000);
|
|
||||||
},
|
|
||||||
// 等级
|
// 等级
|
||||||
handlelenver(value) {
|
handlelenver(value) {
|
||||||
let that = this
|
let that = this
|
||||||
|
|
@ -467,31 +336,6 @@
|
||||||
number = value / (that.list[0].max_val - that.list[length - 1].min_val) * 100
|
number = value / (that.list[0].max_val - that.list[length - 1].min_val) * 100
|
||||||
return number.toFixed(0)
|
return number.toFixed(0)
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* 停止搜索蓝牙设备
|
|
||||||
*/
|
|
||||||
stopBluetoothDevicesDiscovery() {
|
|
||||||
uni.stopBluetoothDevicesDiscovery({
|
|
||||||
success: e => {
|
|
||||||
console.log("停止搜索蓝牙设备", e)
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 监听蓝牙连接状态
|
|
||||||
onBLEConnectionStateChange() {
|
|
||||||
let that = this
|
|
||||||
uni.onBLEConnectionStateChange(function(res) {
|
|
||||||
console.log("监听蓝牙连接状态", res.connected)
|
|
||||||
if (!res.connected) {
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.Unload = true
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
}
|
|
||||||
that.$store.commit("changeConnected", res.connected);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 保存测量结果
|
// 保存测量结果
|
||||||
handleGetMeasure() {
|
handleGetMeasure() {
|
||||||
let that = this
|
let that = this
|
||||||
|
|
@ -510,30 +354,13 @@
|
||||||
aud_id: uni.getStorageSync('userid')
|
aud_id: uni.getStorageSync('userid')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
that.Unload = true
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: "/pages/home/home"
|
url: "/pages/home/home"
|
||||||
})
|
})
|
||||||
}, 200)
|
}, 200)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//
|
|
||||||
handleBack(ind) {
|
|
||||||
let that = this
|
|
||||||
that.text = ""
|
|
||||||
that.Unload = true
|
|
||||||
that.stopBluetoothDevicesDiscovery()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
that.closeBLEConnection()
|
|
||||||
if (ind == 1) {
|
|
||||||
uni.switchTab({
|
|
||||||
url: "/pages/home/home"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 5秒倒计时
|
// 5秒倒计时
|
||||||
countdown() {
|
countdown() {
|
||||||
let that = this
|
let that = this
|
||||||
|
|
@ -547,29 +374,6 @@
|
||||||
that.second = 0
|
that.second = 0
|
||||||
}, 5000)
|
}, 5000)
|
||||||
},
|
},
|
||||||
/**
|
|
||||||
* 断开蓝牙模块
|
|
||||||
*/
|
|
||||||
closeBluetoothAdapter() {
|
|
||||||
let that = this;
|
|
||||||
uni.closeBluetoothAdapter({
|
|
||||||
success: res => {
|
|
||||||
console.log('蓝牙模块关闭成功');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 断开蓝牙连接
|
|
||||||
*/
|
|
||||||
closeBLEConnection() {
|
|
||||||
var that = this;
|
|
||||||
uni.closeBLEConnection({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: res => {
|
|
||||||
console.log('断开蓝牙连接成功');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="common">
|
<view class="common">
|
||||||
|
<view class="tagList">
|
||||||
|
<scroll-view class="scroll-view_H" scroll-x="true">
|
||||||
|
<text class="scroll-view-item_H" v-for="(ite,ind) in publicRecordInfo"
|
||||||
|
@click="handlePageScrollTo(ite.id,ind)" :class="[ind == index?'active':'']">
|
||||||
|
{{ite.name}}
|
||||||
|
</text>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
<view class="history" v-if="ranklist.length">
|
<view class="history" v-if="ranklist.length">
|
||||||
<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>
|
||||||
|
|
@ -19,7 +27,7 @@
|
||||||
</view>
|
</view>
|
||||||
<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="!ranklist.length||!lastPage">
|
<view class="nolist" v-if="!lastPage">
|
||||||
<image src="../../static/none.png"></image>
|
<image src="../../static/none.png"></image>
|
||||||
<text>暂无数据</text>
|
<text>暂无数据</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -32,39 +40,26 @@
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['user']),
|
...mapState(['user', 'PublicRecord']),
|
||||||
endDate() {
|
publicRecordInfo() {
|
||||||
return this.$tools.getDate("start")
|
let that = this
|
||||||
},
|
return that.PublicRecord
|
||||||
startDate() {
|
|
||||||
return this.$tools.GetDateStr(-90);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
ranklist: [],
|
ranklist: [],
|
||||||
page: 1,
|
page: 1,
|
||||||
isDelete: false,
|
index: 0,
|
||||||
lastPage: '',
|
lastPage: '',
|
||||||
isActive: null,
|
active: 0,
|
||||||
acd_id: "",
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad() {
|
||||||
let that = this
|
let that = this
|
||||||
that.acd_id = options.acd_id
|
that.$nextTick(() => {
|
||||||
that.getList()
|
that.getList()
|
||||||
console.log("options", options)
|
})
|
||||||
},
|
|
||||||
onUnload() {
|
|
||||||
console.log('关闭页面');
|
|
||||||
let that = this
|
|
||||||
var pages = getCurrentPages();
|
|
||||||
var Page = pages[pages.length - 1]; //当前页
|
|
||||||
var prevPage = pages[pages.length - 2];
|
|
||||||
if (that.isDelete) { //确定要返回到相应页面,在触发
|
|
||||||
prevPage.$vm.reload()
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
let that = this
|
let that = this
|
||||||
|
|
@ -77,7 +72,7 @@
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.page++
|
this.page++
|
||||||
this.getList(this.page)
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
swipeClick(e, index) {
|
swipeClick(e, index) {
|
||||||
|
|
@ -88,28 +83,15 @@
|
||||||
content: '是否删除当前测量记录?',
|
content: '是否删除当前测量记录?',
|
||||||
success: function(res) {
|
success: function(res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
that.$model.gethistorydelete({
|
that.$model.getPublicHistoryDel({
|
||||||
id: id,
|
id: id,
|
||||||
type: that.acd_id,
|
type: that.publicRecordInfo[that.index].key_word,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.code != 0) {
|
if (res.code != 0) {
|
||||||
that.$tools.msg(res.msg)
|
that.$tools.msg(res.msg)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
that.ranklist.splice(index, 1)
|
that.ranklist.splice(index, 1)
|
||||||
if (that.user.measure_model == "1") {
|
|
||||||
that.$store.dispatch("getUserInfo", {
|
|
||||||
aud_id: uni.getStorageSync('userid')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (that.acd_id == 2) {
|
|
||||||
that.$store.dispatch("getResult", {
|
|
||||||
aud_id: uni.getStorageSync('userid')
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
that.isDelete = true
|
|
||||||
}
|
|
||||||
|
|
||||||
that.$tools.msg("删除成功")
|
that.$tools.msg("删除成功")
|
||||||
})
|
})
|
||||||
} else if (res.cancel) {
|
} else if (res.cancel) {
|
||||||
|
|
@ -118,19 +100,29 @@
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
handlePageScrollTo(id, ind) {
|
||||||
|
let that = this
|
||||||
|
that.index = ind
|
||||||
|
that.active = 1
|
||||||
|
that.ranklist = []
|
||||||
|
that.page = 1
|
||||||
|
that.lastPage = ''
|
||||||
|
that.getList()
|
||||||
|
},
|
||||||
clickItemMethod(item) {
|
clickItemMethod(item) {
|
||||||
let that = this
|
let that = this
|
||||||
if (that.acd_id == "6") return
|
if (item.is_have_details == 'no') return
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pageTwo/history/historyDetail?type=" + that.acd_id + '&id=' + item.id
|
url: "/pageTwo/history/historyDetail?id=" + item.id + "&type=" + that.publicRecordInfo[that
|
||||||
|
.index].key_word
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getList(page) {
|
getList() {
|
||||||
let that = this
|
let that = this
|
||||||
that.$model.gethistory({
|
that.$model.getPublicHistory({
|
||||||
aud_id: uni.getStorageSync('userid'),
|
aud_id: that.user.aud_id,
|
||||||
type: that.acd_id,
|
|
||||||
page: that.page,
|
page: that.page,
|
||||||
|
type: that.publicRecordInfo[that.index].key_word,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log("历史记录", res)
|
console.log("历史记录", res)
|
||||||
if (res.code != 0) return
|
if (res.code != 0) return
|
||||||
|
|
@ -147,10 +139,6 @@
|
||||||
this.lastPage = res.data.totalpage
|
this.lastPage = res.data.totalpage
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleEdit(id) {
|
|
||||||
let that = this
|
|
||||||
that.isActive = that.isActive == id ? null : id
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -162,10 +150,44 @@
|
||||||
background-color: #f7f7f7;
|
background-color: #f7f7f7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tagList {
|
||||||
|
width: 100%;
|
||||||
|
height: 45px;
|
||||||
|
line-height: 45px;
|
||||||
|
background: #fff;
|
||||||
|
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
z-index: 999;
|
||||||
|
|
||||||
|
.active {
|
||||||
|
color: $maincolor;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scroll-view_H {
|
||||||
|
white-space: nowrap;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.scroll-view-item_H {
|
||||||
|
display: inline-block;
|
||||||
|
height: 45rpx;
|
||||||
|
line-height: 45rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
text {
|
||||||
|
color: #666;
|
||||||
|
padding: 0 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.history {
|
.history {
|
||||||
width: calc(100% - 30px);
|
width: calc(100% - 30px);
|
||||||
height: auto;
|
height: auto;
|
||||||
margin: 15px 15px 0;
|
margin: 50px 15px 0;
|
||||||
padding-bottom: 40px;
|
padding-bottom: 40px;
|
||||||
|
|
||||||
.list {
|
.list {
|
||||||
|
|
@ -177,46 +199,45 @@
|
||||||
width: calc(100% - 20px);
|
width: calc(100% - 20px);
|
||||||
height: auto;
|
height: auto;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 6px 10px;
|
padding: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
line-height: 50rpx;
|
font-size: 30rpx !important;
|
||||||
font-size: 36rpx !important;
|
|
||||||
|
|
||||||
text {
|
text {
|
||||||
|
width: 100%;
|
||||||
display: block;
|
display: block;
|
||||||
color: #666;
|
color: #666;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
view {
|
||||||
|
width: 28%;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.time {
|
.time {
|
||||||
|
width: 100%;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #666;
|
color: #666;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 100%;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
|
|
||||||
icon {
|
icon {
|
||||||
width: 40rpx;
|
width: 40rpx;
|
||||||
height: 40rpx;
|
height: 40rpx;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
text {
|
|
||||||
font-size: 32rpx;
|
|
||||||
margin-top: 3px;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@
|
||||||
<view class="lan border-bottom" v-for="(item,index) in ranklist">
|
<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" :class="'t-icon-'+item.key_name" v-if="item.key_name!='score'&&item.key_name!='head_circumference'"></view>
|
<view class="t-icon" :class="'t-icon-'+item.key_name"
|
||||||
|
v-if="item.key_name!='score'&&item.key_name!='head_circumference'"></view>
|
||||||
<view class="score" v-if="item.key_name=='score'">A</view>
|
<view class="score" v-if="item.key_name=='score'">A</view>
|
||||||
<image src="../../static/head.png" v-if="item.key_name=='head_circumference'"></image>
|
<image src="../../static/head.png" v-if="item.key_name=='head_circumference'"></image>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -34,7 +35,6 @@
|
||||||
// ...mapState([])
|
// ...mapState([])
|
||||||
// },
|
// },
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
// 导航栏颜色
|
|
||||||
let that = this
|
let that = this
|
||||||
that.id = options.id
|
that.id = options.id
|
||||||
that.type = options.type
|
that.type = options.type
|
||||||
|
|
@ -43,9 +43,9 @@
|
||||||
methods: {
|
methods: {
|
||||||
getList() {
|
getList() {
|
||||||
let that = this
|
let that = this
|
||||||
that.$model.gethistorydetail({
|
that.$model.getPublicHistoryDetail({
|
||||||
id: that.id,
|
id: that.id,
|
||||||
type: that.type,
|
type: that.type
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log("历史记录详情", res)
|
console.log("历史记录详情", res)
|
||||||
this.ranklist = res.data
|
this.ranklist = res.data
|
||||||
|
|
|
||||||
|
|
@ -1,339 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<view class="editem">
|
|
||||||
<view class="name">身高</view>
|
|
||||||
<view class="right">
|
|
||||||
<input type="digit" v-model="PostData.height" placeholder="请输入身高"
|
|
||||||
placeholder-style="font-size:13px;color:#666" />cm
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="edit">
|
|
||||||
<view class="editem">
|
|
||||||
<view class="name">体重</view>
|
|
||||||
<view class="right">
|
|
||||||
<input type="digit" v-model="PostData.weight" placeholder="请输入体重"
|
|
||||||
placeholder-style="font-size:13px;color:#666" />kg
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="editem">
|
|
||||||
<view class="name">性别</view>
|
|
||||||
<view class="right radio2">
|
|
||||||
<view class="radio">
|
|
||||||
<uni-icons :type="PostData.sex==1?'checkbox-filled':'circle'" @click="PostData.sex=1" size="24"
|
|
||||||
:color="PostData.sex==1?'#fea606':'#dfdfdf'"></uni-icons>男
|
|
||||||
</view>
|
|
||||||
<view class="radio ml-15">
|
|
||||||
<uni-icons :type="PostData.sex==2?'checkbox-filled':'circle'" @click="PostData.sex=2" size="24"
|
|
||||||
:color="PostData.sex==2?'#fea606':'#dfdfdf'"></uni-icons>女
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="editem">
|
|
||||||
<view class="name">出生日期</view>
|
|
||||||
<view class="right">
|
|
||||||
<picker mode="date" :value="PostData.birthday" :end="endDate" @change="bindDateChange"
|
|
||||||
:fields="fields">
|
|
||||||
<view class="text">{{PostData.birthday?PostData.birthday:"请选择出生日期"}}</view>
|
|
||||||
<icon class="iconfont icon-arrow-down-bold"></icon>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="box_con mb-15" v-if="iscalced">
|
|
||||||
<view class="BMIlist">
|
|
||||||
<view class="block">
|
|
||||||
<view class="name">
|
|
||||||
BMI
|
|
||||||
</view>
|
|
||||||
<view class="val">
|
|
||||||
{{resdata.bmi?resdata.bmi:'0'}}
|
|
||||||
</view>
|
|
||||||
<view class="btnf" :style="{backgroundColor:resdata.bmilevelcolor}">
|
|
||||||
{{resdata.bmilevel}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="desc">
|
|
||||||
<view class="statuevue">
|
|
||||||
<view class="bi">
|
|
||||||
<view :style="'left:'+resdata.offset+'%'" class="peobox">
|
|
||||||
<view class="xx"></view>
|
|
||||||
</view>
|
|
||||||
<view class="item" v-for="(ite , ind) in resdata.bmilevellist" :key="ind"
|
|
||||||
:style="{backgroundColor:ite.color}">
|
|
||||||
<view class="span1">{{ite.text}}</view>
|
|
||||||
<view class="span" v-if="ind<resdata.bmilevellist.length-1">{{ite.max_val}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="tip">
|
|
||||||
BMI是身体质量指数,是目前国际上常用的衡量人体胖瘦程度以及是否健康的一个标准
|
|
||||||
</view>
|
|
||||||
<view class="btn mt-20" @click="submit"> 立即计算</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
//提交的数据
|
|
||||||
PostData: {
|
|
||||||
weight: '',
|
|
||||||
height: '',
|
|
||||||
sex: 0,
|
|
||||||
birthday: null
|
|
||||||
},
|
|
||||||
resdata: {
|
|
||||||
bmi: 0,
|
|
||||||
bmilevel: '',
|
|
||||||
bmilevelcolor: '',
|
|
||||||
bmilevellist: [],
|
|
||||||
offset: ""
|
|
||||||
},
|
|
||||||
//性别
|
|
||||||
sexItem: [
|
|
||||||
"男",
|
|
||||||
"女"
|
|
||||||
],
|
|
||||||
leftval: 0,
|
|
||||||
iscalced: false,
|
|
||||||
fields: "",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
endDate() {
|
|
||||||
return this.$tools.getDate("start")
|
|
||||||
},
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
let that = this
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
that.fields = "time"
|
|
||||||
// #endif
|
|
||||||
// #ifndef APP-PLUS
|
|
||||||
that.fields = "day"
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
//性别选择
|
|
||||||
onsexArr(e) {
|
|
||||||
this.PostData.sex = this.sexItem[e.target.value] == "男" ? 1 : 2
|
|
||||||
},
|
|
||||||
//年龄选择
|
|
||||||
bindDateChange(e) {
|
|
||||||
this.PostData.birthday = e.target.value
|
|
||||||
},
|
|
||||||
hideKeyboard() {
|
|
||||||
console.log("隐藏软键盘")
|
|
||||||
uni.hideKeyboard()
|
|
||||||
},
|
|
||||||
//bmi计算
|
|
||||||
submit() {
|
|
||||||
var that = this;
|
|
||||||
if (!that.PostData.weight) {
|
|
||||||
this.$tools.msg("请输入体重")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!that.PostData.height) {
|
|
||||||
this.$tools.msg("请输入身高")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!that.PostData.sex) {
|
|
||||||
this.$tools.msg("请选择性别")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!that.PostData.birthday) {
|
|
||||||
this.$tools.msg("请选择年龄")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
that.$model.calcbmi(that.PostData).then(res => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.resdata = res.data;
|
|
||||||
this.iscalced = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.content {
|
|
||||||
padding: 15px;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tip {
|
|
||||||
font-size: 24rpx;
|
|
||||||
color: #999;
|
|
||||||
line-height: 22px
|
|
||||||
}
|
|
||||||
|
|
||||||
.editem {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 28rpx;
|
|
||||||
border-radius: 20px;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
justify-content: space-between;
|
|
||||||
background: #eee;
|
|
||||||
padding-left: 15px;
|
|
||||||
|
|
||||||
.name {
|
|
||||||
width: 30%;
|
|
||||||
float: left;
|
|
||||||
height: 40px;
|
|
||||||
line-height: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.right {
|
|
||||||
width: 58%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding-right: 15px;
|
|
||||||
height: 38px;
|
|
||||||
line-height: 38px;
|
|
||||||
|
|
||||||
.radio2 {
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.radio {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
height: 40px;
|
|
||||||
line-height: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text,
|
|
||||||
/deep/input {
|
|
||||||
position: absolute;
|
|
||||||
right: 15px;
|
|
||||||
top: 0;
|
|
||||||
left: 40%;
|
|
||||||
z-index: 9999;
|
|
||||||
color: #666;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
/deep/input {
|
|
||||||
padding-left: 0px;
|
|
||||||
margin-top: 0px;
|
|
||||||
font-size:30rpx !important;
|
|
||||||
height: 38px;
|
|
||||||
line-height: 38px;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
margin-top: 20px;
|
|
||||||
background-color: $maincolor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.box_con {
|
|
||||||
margin-top: 15px;
|
|
||||||
padding: 10px 15px 15px;
|
|
||||||
border-radius: 10px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
box-shadow: 0px 0px 5px 0px #c3c3c3;
|
|
||||||
font-size: 26rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.desc {
|
|
||||||
line-height: 20px;
|
|
||||||
text-align: left;
|
|
||||||
width: calc(100%-20px);
|
|
||||||
height: auto;
|
|
||||||
border-radius: 5px;
|
|
||||||
font-size: 30rpx;
|
|
||||||
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;
|
|
||||||
z-index: 999;
|
|
||||||
|
|
||||||
.xx {
|
|
||||||
width: 5px;
|
|
||||||
height: 5px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: #fff;
|
|
||||||
position: absolute;
|
|
||||||
z-index: 9;
|
|
||||||
border: 2px solid #1b2086;
|
|
||||||
top: 9px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
position: relative;
|
|
||||||
margin: 0;
|
|
||||||
flex: 1;
|
|
||||||
height: 5px;
|
|
||||||
color: #666;
|
|
||||||
font-size: 30rpx;
|
|
||||||
|
|
||||||
.span1 {
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
position: absolute;
|
|
||||||
top: -23px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.span {
|
|
||||||
margin-top: 8px;
|
|
||||||
position: absolute;
|
|
||||||
right: -8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.block {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btnf {
|
|
||||||
background-color: #ff5656;
|
|
||||||
padding: 3px 8px;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.yuanxing {
|
|
||||||
display: inline-block;
|
|
||||||
background: #f19601;
|
|
||||||
width: 8px;
|
|
||||||
height: 12px;
|
|
||||||
margin-right: 5px;
|
|
||||||
font-size: 36rpx;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,300 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<view class="top">
|
|
||||||
<text>成年身高预测</text>
|
|
||||||
为保证数据准确定,请认真填写真实信息
|
|
||||||
</view>
|
|
||||||
<view class="table">
|
|
||||||
<view class="tr">
|
|
||||||
<view class="text">性别</view>
|
|
||||||
<view class="td">
|
|
||||||
<view class="radio">
|
|
||||||
<uni-icons :type="sex==1?'checkbox-filled':'circle'" @click="sex=1" size="24"
|
|
||||||
:color="sex==1?'#fea606':'#dfdfdf'"></uni-icons>男
|
|
||||||
</view>
|
|
||||||
<view class="radio ml-10">
|
|
||||||
<uni-icons :type="sex==2?'checkbox-filled':'circle'" @click="sex=2" size="24"
|
|
||||||
:color="sex==2?'#fea606':'#dfdfdf'"></uni-icons>女
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="tr">
|
|
||||||
<view class="text">出生日期</view>
|
|
||||||
<view class="td">
|
|
||||||
<picker mode="date" :end="endDate" @change="maskClick" :value="birthday?birthday:endDate"
|
|
||||||
:fields="fields">
|
|
||||||
<view class="uni-input">
|
|
||||||
{{birthday?birthday:'请选择'}}
|
|
||||||
<icon class="iconfont icon-arrow-down-bold"></icon>
|
|
||||||
</view>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="tr">
|
|
||||||
<view class="text">爸爸身高</view>
|
|
||||||
<view class="td">
|
|
||||||
<input class="input" type="digit" v-model="dadheight " placeholder="请输入">cm
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="tr">
|
|
||||||
<view class="text">妈妈身高</view>
|
|
||||||
<view class="td">
|
|
||||||
<input class="input" type="digit" v-model="momheight" placeholder="请输入">cm
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="table table2">
|
|
||||||
<view class="text">当前标准身高</view>
|
|
||||||
<view class="text">成年身高预测</view>
|
|
||||||
<view class="td">
|
|
||||||
<text>{{geneticheight}}</text>cm
|
|
||||||
</view>
|
|
||||||
<view class="td">
|
|
||||||
<text>{{adultheight}}</text>
|
|
||||||
<text class="text2" v-if="errorvalue">±{{errorvalue}}</text> cm
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="btn mb-15" @click="handleClick">立即计算</view>
|
|
||||||
<!-- <button open-type="share" class="share">
|
|
||||||
<icon class="t-icon t-icon-fenxiang"></icon>分享朋友测一测
|
|
||||||
</button> -->
|
|
||||||
<view class="title mt-20">
|
|
||||||
<view class="h5">如果当前实际身高﹤当前标准身高</view>
|
|
||||||
<view class="con">孩子后天生长环境不利长高。请从饮食、睡眠、运动、情绪等方面排查。加强后天因素管理,让孩子处于最佳长高状态。</view>
|
|
||||||
<view class="h5">如果当前实际身高﹥当前标准身高</view>
|
|
||||||
<view class="con">孩子后天生长环境有利长高。请继续保持,加强后天因素管理,孩子成年可比标准高10cm以上。</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
sex: 1,
|
|
||||||
errorvalue: 0,
|
|
||||||
adultheight: 0,
|
|
||||||
geneticheight: 0,
|
|
||||||
dadheight: "",
|
|
||||||
momheight: "",
|
|
||||||
birthday: "",
|
|
||||||
fields: "",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["user"]),
|
|
||||||
endDate() {
|
|
||||||
return this.$tools.getDate("start")
|
|
||||||
},
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
let that = this
|
|
||||||
// uni.showShareMenu({
|
|
||||||
// withShareTicket: true,
|
|
||||||
// menus: ["shareAppMessage"]
|
|
||||||
// })
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
that.fields = "time"
|
|
||||||
// #endif
|
|
||||||
// #ifndef APP-PLUS
|
|
||||||
that.fields = "day"
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
// onShareAppMessage(res) {
|
|
||||||
// let that = this
|
|
||||||
// return {
|
|
||||||
// title: '快来测测你的孩子能长多高?',
|
|
||||||
// path: '/pageTwo/share/shareHeight',
|
|
||||||
// imageUrl: '../../static/share1.jpg',
|
|
||||||
// success: function(res) {
|
|
||||||
// console.log("分享到朋友成功")
|
|
||||||
// },
|
|
||||||
// fail: function(res) {
|
|
||||||
// console.log("分享到朋友失败")
|
|
||||||
// },
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
methods: {
|
|
||||||
handleClick() {
|
|
||||||
let that = this
|
|
||||||
if (!that.dadheight) {
|
|
||||||
that.$tools.msg("请输入爸爸身高!");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!that.momheight) {
|
|
||||||
that.$tools.msg("请输入妈妈身高!");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
uni.showLoading({
|
|
||||||
title: '计算中'
|
|
||||||
});
|
|
||||||
that.$model.GetPredictheight({
|
|
||||||
dadHeight: that.dadheight,
|
|
||||||
momHeight: that.momheight,
|
|
||||||
birthday: that.birthday,
|
|
||||||
sex: that.sex,
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code != 0) return
|
|
||||||
setTimeout(function() {
|
|
||||||
uni.hideLoading();
|
|
||||||
}, 1000);
|
|
||||||
that.adultheight = res.data.adultheight
|
|
||||||
that.geneticheight = res.data.geneticheight
|
|
||||||
that.errorvalue = res.data.errorvalue
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//确定年龄
|
|
||||||
maskClick(e) {
|
|
||||||
this.birthday = e.detail.value
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.content {
|
|
||||||
padding: 15px 10px;
|
|
||||||
background: #fff;
|
|
||||||
min-height: calc(100vh - 30px);
|
|
||||||
|
|
||||||
.radio {
|
|
||||||
display: flex;
|
|
||||||
height: 34px;
|
|
||||||
line-height: 34px;
|
|
||||||
}
|
|
||||||
|
|
||||||
picker {
|
|
||||||
width: 100%;
|
|
||||||
text-align: right;
|
|
||||||
border: none;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.top {
|
|
||||||
width: 100%;
|
|
||||||
line-height: 30px;
|
|
||||||
font-size: 24rpx;
|
|
||||||
text-align: center;
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
color: #999;
|
|
||||||
|
|
||||||
text {
|
|
||||||
width: 100%;
|
|
||||||
display: block;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 40rpx;
|
|
||||||
color: #333;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.h5 {
|
|
||||||
font-size: 30rpx;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.con {
|
|
||||||
margin-top: 5px;
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
color: #999;
|
|
||||||
line-height: 22px;
|
|
||||||
font-size: 28rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table,
|
|
||||||
.table2 {
|
|
||||||
width: 100%;
|
|
||||||
border: 1px solid #d69231;
|
|
||||||
border-bottom: none;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border-spacing: inherit;
|
|
||||||
font-size: 28rpx;
|
|
||||||
height: auto;
|
|
||||||
overflow: hidden;
|
|
||||||
border-right: none;
|
|
||||||
|
|
||||||
.tr {
|
|
||||||
width: 50%;
|
|
||||||
float: left;
|
|
||||||
|
|
||||||
.text {
|
|
||||||
width: 40%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.td {
|
|
||||||
width: 60%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.text {
|
|
||||||
float: left;
|
|
||||||
height: 35px;
|
|
||||||
line-height: 35px;
|
|
||||||
background: #ffcf85;
|
|
||||||
box-sizing: border-box;
|
|
||||||
border-bottom: 1px solid #d69231;
|
|
||||||
border-right: 1px solid #d69231;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.td {
|
|
||||||
box-sizing: border-box;
|
|
||||||
background: #e4cdac21;
|
|
||||||
display: flex;
|
|
||||||
float: left;
|
|
||||||
height: 35px;
|
|
||||||
line-height: 35px;
|
|
||||||
padding-right: 5px;
|
|
||||||
padding-left: 5px;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
border-bottom: 1px solid #d69231;
|
|
||||||
border-right: 1px solid #d69231;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
|
|
||||||
/deep/input {
|
|
||||||
width: 95%;
|
|
||||||
height: 35px;
|
|
||||||
line-height: 35px;
|
|
||||||
font-size: 30rpx !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.table2 {
|
|
||||||
margin: 50rpx auto;
|
|
||||||
border-right: none;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
.text {
|
|
||||||
width: 50%;
|
|
||||||
border-right: 1px solid #d69231;
|
|
||||||
}
|
|
||||||
|
|
||||||
.td {
|
|
||||||
height: 50px;
|
|
||||||
width: 50%;
|
|
||||||
line-height: 50px;
|
|
||||||
display: inherit;
|
|
||||||
border-right: 1px solid #d69231;
|
|
||||||
|
|
||||||
.text2 {
|
|
||||||
font-size: 36rpx;
|
|
||||||
font-weight: bold
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
margin-top: 20px;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
background-color: $maincolor;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
||||||
<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: 36rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time {
|
|
||||||
width: 100%;
|
|
||||||
text-align: left;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,311 +0,0 @@
|
||||||
<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" type="text"/>
|
|
||||||
</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("from.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: 1,
|
|
||||||
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
|
|
||||||
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)
|
|
||||||
that.$tools.msg("设置成功,进入程序中")
|
|
||||||
setTimeout(function() {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: "/pages/home/home?type=1"
|
|
||||||
})
|
|
||||||
}, 1000)
|
|
||||||
}).catch(err => {})
|
|
||||||
},
|
|
||||||
// 获取验证码
|
|
||||||
handleCode() {
|
|
||||||
let that = this
|
|
||||||
let phoneType = that.phone.indexOf("@") !== -1
|
|
||||||
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
|
|
||||||
}
|
|
||||||
//
|
|
||||||
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() {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</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: 32rpx;
|
|
||||||
justify-content: space-between;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
|
|
||||||
|
|
||||||
.item {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
|
|
||||||
.text {
|
|
||||||
width: 240rpx;
|
|
||||||
height: 40px;
|
|
||||||
line-height: 40px;
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input {
|
|
||||||
width: calc(100% - 240rpx);
|
|
||||||
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:28rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.yanzhengma {
|
|
||||||
input {
|
|
||||||
right: 220rpx;
|
|
||||||
font-size:28rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.code {
|
|
||||||
width: 220rpx;
|
|
||||||
background: #dfdfdf;
|
|
||||||
font-size: 28rpx;
|
|
||||||
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: 32rpx;
|
|
||||||
color: $textcolor;
|
|
||||||
|
|
||||||
text {
|
|
||||||
border-bottom: 1px solid $textcolor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,306 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<view class="bg"></view>
|
|
||||||
<view class="top">
|
|
||||||
<image src="../../static/logo2.png"></image>
|
|
||||||
<text>Reedaw</text>
|
|
||||||
</view>
|
|
||||||
<view class="login box_shadow">
|
|
||||||
<view class="title">登录</view>
|
|
||||||
<view class="toggle cblue" @click="handleToggle">
|
|
||||||
切换登录
|
|
||||||
</view>
|
|
||||||
<view class="editem">
|
|
||||||
<view class="item">
|
|
||||||
<view class="text">手机号/邮箱</view>
|
|
||||||
<view class="input">
|
|
||||||
<input v-model="phone" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 验证码登录 -->
|
|
||||||
<view class="item " v-if="isCode">
|
|
||||||
<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后重发':'获取验证码'}}
|
|
||||||
</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 密码登录 -->
|
|
||||||
<view class="item " v-else>
|
|
||||||
<view class="text">密码</view>
|
|
||||||
<view class="input">
|
|
||||||
<input class="uni-input" v-model="password" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="forget " v-if="!isCode">
|
|
||||||
<text @click="handlePassword('forgetPassword')">忘记密码?</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="xieyi">
|
|
||||||
<checkbox-group @change="checkboxChange" class="group">
|
|
||||||
<label>
|
|
||||||
<checkbox :value="1" style="transform:scale(0.7)" />阅读并同意
|
|
||||||
<!-- <text @click.stop @click="handleUserXieyi" class="blue">《用户协议》</text>和 -->
|
|
||||||
<text @click.stop @click="handlexieyi" class="blue">《隐私协议》</text>
|
|
||||||
</label>
|
|
||||||
</checkbox-group>
|
|
||||||
</view>
|
|
||||||
<view class="btnlogin" @click="handleTelLogin">登录</view>
|
|
||||||
<view class="btngroup" @click="handlePassword('register')">
|
|
||||||
<text>注册</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
|
||||||
<view class="wxbtn">
|
|
||||||
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-if="value==1">
|
|
||||||
<view>
|
|
||||||
<image src="../../static/phone.png"></image>
|
|
||||||
</view>
|
|
||||||
<text>手机号快捷登录</text>
|
|
||||||
</button>
|
|
||||||
<button v-else @click="handleIsTel">
|
|
||||||
<view>
|
|
||||||
<image src="../../static/phone.png"></image>
|
|
||||||
</view>
|
|
||||||
<text>手机号快捷登录</text>
|
|
||||||
</button>
|
|
||||||
</view>
|
|
||||||
<!-- #endif -->
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
phone: "",
|
|
||||||
code: "",
|
|
||||||
password: "",
|
|
||||||
disabled: false,
|
|
||||||
second: 60,
|
|
||||||
value: 0,
|
|
||||||
isCode: true,
|
|
||||||
loginCode: ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
this.login()
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 勾选协议
|
|
||||||
checkboxChange(e) {
|
|
||||||
this.value = e.detail.value.length ? e.detail.value[0] : "0"
|
|
||||||
},
|
|
||||||
// 登录、
|
|
||||||
handleTelLogin() {
|
|
||||||
let that = this
|
|
||||||
let phoneType = that.phone.indexOf("@") !== -1
|
|
||||||
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.isCode && !that.code) {
|
|
||||||
that.$tools.msg("请输入验证码")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!that.isCode && !that.password) {
|
|
||||||
that.$tools.msg('请输入正确密码')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.$model.getonlogin({
|
|
||||||
data: that.phone,
|
|
||||||
validate_data: that.isCode ? that.code : that.password,
|
|
||||||
validate_type: that.isCode ? 'code' : 'password'
|
|
||||||
}).then(res => {
|
|
||||||
console.log("data", res.data)
|
|
||||||
that.$tools.msg(res.msg)
|
|
||||||
if (res.code != 0) return
|
|
||||||
that.$tools.msg("登录成功")
|
|
||||||
uni.setStorageSync('token', res.data.token)
|
|
||||||
uni.setStorageSync('aan_id', res.data.aan_id)
|
|
||||||
setTimeout(function() {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: "/pages/home/home?type=1"
|
|
||||||
})
|
|
||||||
}, 1000)
|
|
||||||
}).catch(err => {})
|
|
||||||
},
|
|
||||||
// 获取验证码
|
|
||||||
handleCode() {
|
|
||||||
let that = this
|
|
||||||
let phoneType = that.phone.indexOf("@") !== -1
|
|
||||||
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
|
|
||||||
}
|
|
||||||
//
|
|
||||||
that.$model.getSendCode({
|
|
||||||
data: that.phone,
|
|
||||||
type: "login"
|
|
||||||
}).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 => {})
|
|
||||||
},
|
|
||||||
//
|
|
||||||
handleIsTel() {
|
|
||||||
if (this.value == 0) {
|
|
||||||
this.$tools.msg("请先确认勾选协议")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 获取code
|
|
||||||
login() {
|
|
||||||
let that = this
|
|
||||||
uni.login({
|
|
||||||
success(res) {
|
|
||||||
if (res.code) {
|
|
||||||
if (res.errMsg = "login:ok") {
|
|
||||||
that.loginCode = res.code
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 授权
|
|
||||||
getPhoneNumber(res) {
|
|
||||||
const that = this
|
|
||||||
if (res.detail.errMsg == 'getPhoneNumber:ok') {
|
|
||||||
this.$model.getRegisterPhone({
|
|
||||||
code: that.loginCode,
|
|
||||||
encryptedData: res.detail.encryptedData,
|
|
||||||
iv: res.detail.iv,
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code != 0) return
|
|
||||||
that.value = 1
|
|
||||||
uni.setStorageSync('token', res.data.token)
|
|
||||||
uni.setStorageSync('aan_id', res.data.aan_id)
|
|
||||||
setTimeout(function() {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: "/pages/home/home?type=1"
|
|
||||||
})
|
|
||||||
}, 1000)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleToggle() {
|
|
||||||
this.phone = ""
|
|
||||||
this.isCode = !this.isCode
|
|
||||||
},
|
|
||||||
handlePassword(text) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/login/forgetPassword?type=" + text
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handlexieyi() {
|
|
||||||
let that = this
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/webview/webview?url=http://tc.pcxbc.com/technology/privacy_index"
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleUserXieyi() {
|
|
||||||
let that = this
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
@import "@/scss/login.scss";
|
|
||||||
|
|
||||||
.content {
|
|
||||||
width: 100%;
|
|
||||||
height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.xieyi {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #999;
|
|
||||||
margin-left: 10px;
|
|
||||||
|
|
||||||
text {
|
|
||||||
color: $maincolor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.href {
|
|
||||||
width: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wxbtn {
|
|
||||||
width: 100%;
|
|
||||||
position: absolute;
|
|
||||||
margin-top: 30px;
|
|
||||||
top: 80%;
|
|
||||||
|
|
||||||
icon {
|
|
||||||
font-size: 25px;
|
|
||||||
color: #28c445;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
text {
|
|
||||||
display: block;
|
|
||||||
// width: 100%;
|
|
||||||
margin-top: 5px;
|
|
||||||
font-size: 12px;
|
|
||||||
// color: #666;
|
|
||||||
text-align: center;
|
|
||||||
border-bottom: 1px solid blue;
|
|
||||||
color: blue;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
line-height: initial;
|
|
||||||
background: #fff;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
padding: 0;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
button::after {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
view {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,125 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content ">
|
|
||||||
<view v-if="list.length" class="tipsList">
|
|
||||||
<view class="list" v-for="(ite,ind) in list" :key="ind" @click="handleDetail">
|
|
||||||
<icon class="iconfont icon-tixing-copy"></icon>
|
|
||||||
<view class="info">
|
|
||||||
<view class="time">
|
|
||||||
<text class="name">{{ite.title}}</text>
|
|
||||||
<text class="date">{{ite.time}}</text>
|
|
||||||
</view>
|
|
||||||
<text class="des">{{ite.content}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="endtext" v-if="!lastPage || page >= lastPage">—— 到底了,看看别的吧 ——</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="nolist" v-if="!lastPage">
|
|
||||||
<image src="../../static/none.png"></image>
|
|
||||||
<text>暂无数据!</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
list: [{
|
|
||||||
title: "驱虫",
|
|
||||||
type: 1,
|
|
||||||
time: "2023/05/15",
|
|
||||||
des: "哈哈哈哈或或或或",
|
|
||||||
static: 1
|
|
||||||
}],
|
|
||||||
page: 1,
|
|
||||||
lastPage: 0,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
let that = this
|
|
||||||
that.page = 1
|
|
||||||
},
|
|
||||||
onReachBottom() {
|
|
||||||
let that = this
|
|
||||||
if (!this.lastPage || this.page >= this.lastPage) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '没有更多数据!',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.page++
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getList(page) {
|
|
||||||
let that = this
|
|
||||||
that.$model.getHistoryList({
|
|
||||||
pageNo: this.page,
|
|
||||||
pageSize: 10,
|
|
||||||
}).then((res) => {
|
|
||||||
if (res.code != 0) return
|
|
||||||
this.list = this.list.concat(res.data.rows)
|
|
||||||
this.lastPage = res.data.totalpage
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleDetail() {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.content {
|
|
||||||
padding: 0 15px;
|
|
||||||
min-height: 100vh;
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list {
|
|
||||||
margin-top: 15px;
|
|
||||||
background-color: #fff !important;
|
|
||||||
|
|
||||||
icon {
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
border: 8px solid #f7f7f7;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
icon::after {
|
|
||||||
content: "";
|
|
||||||
width: 10px;
|
|
||||||
height: 10px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background-color: red;
|
|
||||||
position: absolute;
|
|
||||||
top: 0px;
|
|
||||||
right: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time {
|
|
||||||
display: inline-block;
|
|
||||||
font-weight: bold;
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.name {
|
|
||||||
color: #333;
|
|
||||||
width: 60%;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.date {
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 12px;
|
|
||||||
width: auto;
|
|
||||||
margin-top: 0;
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,195 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<view class="info">
|
|
||||||
<view class="logo">
|
|
||||||
<image src="../../static/logo2.png"></image>
|
|
||||||
<view>Reedaw</view>
|
|
||||||
<text>V{{phoneInfo.info.version}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="list">
|
|
||||||
<view class="item" @click="handleVersion">
|
|
||||||
<view class="left">版本更新</view>
|
|
||||||
<view class="right">
|
|
||||||
<text class="new" v-if="version==-1">新版本{{phoneInfo.versionUrl.version}}</text>
|
|
||||||
<uni-icons type="right"></uni-icons>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<a href="http://tc.pcxbc.com/technology/privacy_index" class="href">
|
|
||||||
<text class="left">隐私协议</text>
|
|
||||||
<uni-icons type="right"></uni-icons>
|
|
||||||
</a>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- <view class="xieyi">
|
|
||||||
<a>《隐私协议》</a>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
let dtask;
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
// 0版本号相通,1,:第一个版本号大于第二个版本号,-1:第一个版本号小于第二个版本号
|
|
||||||
version: 0,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["phoneInfo"]),
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
let that = this
|
|
||||||
if (!that.phoneInfo.versionUrl) {
|
|
||||||
console.log("111")
|
|
||||||
that.handleoginversion()
|
|
||||||
} else {
|
|
||||||
console.log("222")
|
|
||||||
that.version = that.$tools.compareVersions(that.phoneInfo.info.version, that.phoneInfo.versionUrl.version)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onBackPress() {
|
|
||||||
console.log("dtask", dtask)
|
|
||||||
if (dtask != undefined) {
|
|
||||||
dtask.onProgressUpdate((res) => {
|
|
||||||
if (res.progress != 100) {
|
|
||||||
dtask.abort();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleVersion() {
|
|
||||||
let that = this
|
|
||||||
if (that.version == -1) {
|
|
||||||
if (that.phoneInfo.platform === 'android') {
|
|
||||||
uni.setStorageSync('VERSION', that.phoneInfo.versionUrl.version)
|
|
||||||
let showLoading = plus.nativeUI.showWaiting('正在下载')
|
|
||||||
dtask = uni.downloadFile({
|
|
||||||
url: that.phoneInfo.versionUrl.url,
|
|
||||||
success: (downloadRes) => {
|
|
||||||
if (downloadRes.statusCode === 200) {
|
|
||||||
plus.nativeUI.closeWaiting()
|
|
||||||
plus.runtime.install(
|
|
||||||
downloadRes.tempFilePath, {
|
|
||||||
force: false
|
|
||||||
},
|
|
||||||
function() {
|
|
||||||
console.log('install success...');
|
|
||||||
plus.runtime.restart();
|
|
||||||
},
|
|
||||||
function(e) {
|
|
||||||
console.error('install fail...');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: () => {
|
|
||||||
uni.showToast({
|
|
||||||
title: '升级失败',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
dtask.onProgressUpdate((res) => {
|
|
||||||
showLoading.setTitle(" 正在下载" + res.progress + "% ");
|
|
||||||
// console.log('下载进度' + res.progress + '%');
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
plus.runtime.launchApplication({
|
|
||||||
action: `itms-apps://itunes.apple.com/cn/app/id6654906497?mt=8`
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
that.$tools.msg("已经是最新版本了!")
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 版本信息
|
|
||||||
handleoginversion() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getloginversion({}).then(res => {
|
|
||||||
that.version = that.$tools.compareVersions(that.phoneInfo.info.version, res.data.version)
|
|
||||||
that.$store.commit('changePhoneInfo', {
|
|
||||||
versionUrl: res.data
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.content {
|
|
||||||
min-height: calc(100vh - 30px);
|
|
||||||
padding: 15px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo {
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 40rpx;
|
|
||||||
line-height: 35px;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 140rpx;
|
|
||||||
height: 140rpx;
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
display: block;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.list {
|
|
||||||
width: calc(100% - 20px);
|
|
||||||
margin: 50px 0;
|
|
||||||
|
|
||||||
.item {
|
|
||||||
width: 100%;
|
|
||||||
height: 50px;
|
|
||||||
line-height: 50px;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
display: flex;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 10px;
|
|
||||||
padding: 0 10px;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.new {
|
|
||||||
color: #fff;
|
|
||||||
background-color: red;
|
|
||||||
font-size: 32rpx;
|
|
||||||
border-radius: 10px;
|
|
||||||
padding: 3px 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.href {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
color: #000;
|
|
||||||
text-decoration: none;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.xieyi {
|
|
||||||
color: $textcolor;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,231 +0,0 @@
|
||||||
<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">
|
|
||||||
<uni-swipe-action>
|
|
||||||
<uni-swipe-action-item v-for="(item ,index) in familayList" :key="index"
|
|
||||||
:right-options="item.options" @click="handleDeldet($event, index)">
|
|
||||||
<view class="item">
|
|
||||||
<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.age}}岁</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="right" @click.stop>
|
|
||||||
<view class="blueBtn" @click="editorInfo(item)">编辑</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</uni-swipe-action-item>
|
|
||||||
</uni-swipe-action>
|
|
||||||
|
|
||||||
<!-- <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.age}}岁</text>
|
|
||||||
</view>
|
|
||||||
</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() {},
|
|
||||||
onPullDownRefresh() {
|
|
||||||
let that = this
|
|
||||||
that.handleUserList()
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.stopPullDownRefresh()
|
|
||||||
}, 1000);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
//删除
|
|
||||||
handleDeldet(e, ind) {
|
|
||||||
let that = this
|
|
||||||
let id = that.familayList[ind].id
|
|
||||||
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.handleUserList()
|
|
||||||
})
|
|
||||||
} else if (res.cancel) {
|
|
||||||
that.$tools.msg("您已取消删除!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleUserList() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getUserList({
|
|
||||||
type: 2
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code != 0) {
|
|
||||||
that.$tools.msg(res.msg)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
that.$store.commit('changeFamilay', res.data)
|
|
||||||
if (res.data.length) {
|
|
||||||
uni.setStorageSync('userid', res.data[0].id)
|
|
||||||
that.$store.dispatch('getUserInfo', {
|
|
||||||
aud_id: res.data[0].id
|
|
||||||
})
|
|
||||||
that.handlePublicRecord(res.data[0].id)
|
|
||||||
}
|
|
||||||
}).catch(err => {})
|
|
||||||
},
|
|
||||||
// 公共手动记录内容
|
|
||||||
handlePublicRecord(id) {
|
|
||||||
let that = this
|
|
||||||
that.$model.getPublicRecord({
|
|
||||||
aud_id: id
|
|
||||||
}).then(res => {
|
|
||||||
console.log("公共手动记录", res)
|
|
||||||
if (res.code == 0) {
|
|
||||||
that.$store.commit('changePublicRecord', res.data)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//编辑
|
|
||||||
editorInfo(item) {
|
|
||||||
console.log("familayList", this.familayList)
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/my/userInfo?info=" + JSON.stringify(item)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//添加
|
|
||||||
handleAddUser() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/my/userInfo"
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped="scoped" lang="scss">
|
|
||||||
.common {
|
|
||||||
padding: 15px;
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
min-height: calc(100vh - 30px);
|
|
||||||
}
|
|
||||||
|
|
||||||
.add {
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
line-height: 40px;
|
|
||||||
font-size: 32rpx;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 15px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
background: $btncolor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.box {
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
margin: 15px 0;
|
|
||||||
padding-bottom: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list {
|
|
||||||
width: 100%;
|
|
||||||
font-size: 36rpx;
|
|
||||||
|
|
||||||
.item {
|
|
||||||
background: #fff;
|
|
||||||
padding: 10px 15px;
|
|
||||||
width: calc(100% - 30px);
|
|
||||||
border-radius: 10px;
|
|
||||||
margin-top: 15px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.left {
|
|
||||||
width: 75%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.image1 {
|
|
||||||
width: 120rpx;
|
|
||||||
height: 120rpx;
|
|
||||||
border-radius: 50%;
|
|
||||||
margin-right: 15px;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.name {
|
|
||||||
width: calc(100% - 70px);
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 34rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title2 {
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #999;
|
|
||||||
margin-top: 15px;
|
|
||||||
|
|
||||||
text {
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.blueBtn {
|
|
||||||
width: auto;
|
|
||||||
font-size: 32rpx;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,508 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="box">
|
|
||||||
<view class="lanBox">
|
|
||||||
<view class="headbox">
|
|
||||||
<view class="touxiang">
|
|
||||||
<image v-if="headimg" :src="headimg" class="headimage" />
|
|
||||||
<icon v-else class="iconfont icon-user-filling headimage"></icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="lan border-bottom">
|
|
||||||
<view class="left">姓名</view>
|
|
||||||
<view class="right">
|
|
||||||
<input name="name" type="text" v-model="memInfo.nickname" placeholder="请输入姓名" />
|
|
||||||
<uni-icons type="clear" color="#999" v-if="memInfo.nickname" @click="memInfo.nickname=''"
|
|
||||||
size="20"></uni-icons>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="lan border-bottom">
|
|
||||||
<view class="left">性别</view>
|
|
||||||
<view class="right">
|
|
||||||
<view class="radio">
|
|
||||||
<uni-icons :type="memInfo.gender==1?'checkbox-filled':'circle'" @click="memInfo.gender=1"
|
|
||||||
size="24" :color="memInfo.gender==1?'#fea606':'#dfdfdf'"></uni-icons>男
|
|
||||||
</view>
|
|
||||||
<view class="radio ml-15">
|
|
||||||
<uni-icons :type="memInfo.gender==2?'checkbox-filled':'circle'" @click="memInfo.gender=2"
|
|
||||||
size="24" :color="memInfo.gender==2?'#fea606':'#dfdfdf'"></uni-icons>女
|
|
||||||
</view>
|
|
||||||
<!-- <picker mode="selector" :range="sexItem" @change="onsexArr">
|
|
||||||
<view class="uni-input">{{memInfo.gender==0?'请选择':memInfo.gender==1?'男':'女'}}</view>
|
|
||||||
<icon class="iconfont icon-arrow-down-bold"></icon>
|
|
||||||
</picker> -->
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="lan border-bottom">
|
|
||||||
<view class="left">身高</view>
|
|
||||||
<view class="right">
|
|
||||||
<input name="name" class="mr-5" type="digit" v-model="memInfo.height" placeholder="请输入身高" />CM
|
|
||||||
<uni-icons type="clear" color="#999" v-if="memInfo.height" @click="memInfo.height=''"
|
|
||||||
size="20"></uni-icons>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="lan border-bottom">
|
|
||||||
<view class="left">体重</view>
|
|
||||||
<view class="right">
|
|
||||||
<input name="name" type="digit" class="mr-5" v-model="memInfo.weight" placeholder="请输入体重" />KG
|
|
||||||
<uni-icons type="clear" color="#999" v-if="memInfo.weight" @click="memInfo.weight=''"
|
|
||||||
size="20"></uni-icons>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="lan border-bottom">
|
|
||||||
<view class="left">出生日期</view>
|
|
||||||
<view class="right">
|
|
||||||
<picker mode="date" :end="endDate" @change="maskClick"
|
|
||||||
:value="memInfo.birthday?memInfo.birthday:endDate" :fields="fields">
|
|
||||||
<view class="uni-input">{{memInfo.birthday?memInfo.birthday:'请选择'}}</view>
|
|
||||||
<icon class="iconfont icon-arrow-down-bold"></icon>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="lan border-bottom">
|
|
||||||
<view class="left">场景选择</view>
|
|
||||||
<view class="right">
|
|
||||||
<view class="radio">
|
|
||||||
<uni-icons :type="memInfo.measure_model==1?'checkbox-filled':'circle'"
|
|
||||||
@click="handleMeasureModel(1)" size="24"
|
|
||||||
:color="memInfo.measure_model==1?'#fea606':'#dfdfdf'"></uni-icons>体测模式
|
|
||||||
</view>
|
|
||||||
<view class="radio ml-15">
|
|
||||||
<uni-icons :type="memInfo.measure_model==2?'checkbox-filled':'circle'"
|
|
||||||
@click="handleMeasureModel(2)" size="24"
|
|
||||||
:color="memInfo.measure_model==2?'#fea606':'#dfdfdf'"></uni-icons>体脂模式
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="lan border-bottom" v-if="memInfo.measure_model==1">
|
|
||||||
<view class="left">身份信息</view>
|
|
||||||
<view class="right">
|
|
||||||
<picker mode="selector" :range="identityList" :value="identityIndex" range-key="name"
|
|
||||||
@change="changegIdentity">
|
|
||||||
<view class="uni-input">{{identityList[identityIndex]?identityList[identityIndex].name:"请选择"}}
|
|
||||||
</view>
|
|
||||||
<icon class="iconfont icon-arrow-down-bold"></icon>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="lan border-bottom" @click="handleCityList" v-if="memInfo.measure_model==1">
|
|
||||||
<view class="left">所属地区</view>
|
|
||||||
<view class="right">
|
|
||||||
<view class="mr-10">{{memInfo.address?memInfo.address:'请选择'}}</view>
|
|
||||||
<icon class="iconfont icon-arrow-down-bold"></icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="lan border-bottom" v-if="memInfo.measure_model==1">
|
|
||||||
<view class="left">所在年级</view>
|
|
||||||
<view class="right">
|
|
||||||
<picker mode="selector" :range="gradeList" :value="gradeIndex" range-key="name"
|
|
||||||
@change="changegType">
|
|
||||||
<view class="uni-input">{{gradeList[gradeIndex]?gradeList[gradeIndex].name:"请选择"}}</view>
|
|
||||||
<icon class="iconfont icon-arrow-down-bold"></icon>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="btn" @click="confirmInfo">提交</view>
|
|
||||||
<!-- 地区 -->
|
|
||||||
<view v-if="visible" class="visible" @click="visible=false">
|
|
||||||
<view @click.stop class="item">
|
|
||||||
<view class="groupBtn">
|
|
||||||
<view @click="visible=false">取消</view>
|
|
||||||
<view @click="handlesure()" class="sure">确定</view>
|
|
||||||
</view>
|
|
||||||
<picker-view @change="bindChange" :value="value" class="picker-view" :indicator-style="indicatorStyle">
|
|
||||||
<picker-view-column>
|
|
||||||
<view class="item" v-for="(item,index) in province" :key="index">{{item.name}}</view>
|
|
||||||
</picker-view-column>
|
|
||||||
<picker-view-column>
|
|
||||||
<view class="item" v-for="(item,index) in city" :key="index">{{item}}</view>
|
|
||||||
</picker-view-column>
|
|
||||||
</picker-view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
isEdit: false,
|
|
||||||
fields: "",
|
|
||||||
sexItem: [
|
|
||||||
"男",
|
|
||||||
"女"
|
|
||||||
],
|
|
||||||
memInfo: {
|
|
||||||
measure_model: 2,
|
|
||||||
birthday: "",
|
|
||||||
gender: 1,
|
|
||||||
nickname: "",
|
|
||||||
grade: "nothing",
|
|
||||||
height: "",
|
|
||||||
weight: "",
|
|
||||||
address: '',
|
|
||||||
identity_name: "陌生人",
|
|
||||||
identity_id: "P0",
|
|
||||||
},
|
|
||||||
visible: false,
|
|
||||||
province: [], //省
|
|
||||||
city: [], //市
|
|
||||||
area: [], //区
|
|
||||||
value: [2, 0],
|
|
||||||
headimg: "",
|
|
||||||
identityIndex: 0,
|
|
||||||
gradeIndex: 0,
|
|
||||||
indicatorStyle: `height: 45px;`,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["user", "familayList", "cityList", "gradeList", "identityList"]),
|
|
||||||
endDate() {
|
|
||||||
return this.$tools.getDate("start")
|
|
||||||
},
|
|
||||||
startDate() {
|
|
||||||
return this.$tools.GetDateStr(-90);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
let that = this
|
|
||||||
that.handleIdentityList()
|
|
||||||
if (options.info) {
|
|
||||||
let info = JSON.parse(options.info)
|
|
||||||
that.memInfo = info
|
|
||||||
// if (info.measure_model == "1" || info.measure_model == 1) {
|
|
||||||
console.log("that.memInfo ", that.memInfo)
|
|
||||||
that.gradeIndex = that.gradeList.findIndex((profile) => profile.id === that.memInfo.grade);
|
|
||||||
that.memInfo.grade = that.gradeList[that.gradeIndex].id
|
|
||||||
that.identityIndex = that.identityList.findIndex((profile) => profile.id === that.memInfo.identity_id);
|
|
||||||
console.log("1111111111", that.identityList, that.identityIndex)
|
|
||||||
// }
|
|
||||||
that.isEdit = true
|
|
||||||
}
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
that.fields = "time"
|
|
||||||
// #endif
|
|
||||||
// #ifndef APP-PLUS
|
|
||||||
that.fields = "day"
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 提交
|
|
||||||
confirmInfo() {
|
|
||||||
let that = this
|
|
||||||
if (!that.memInfo.nickname) {
|
|
||||||
that.$tools.msg("请输入姓名")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!that.memInfo.height) {
|
|
||||||
that.$tools.msg("请选择身高")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!that.memInfo.weight) {
|
|
||||||
that.$tools.msg("请选择体重")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!that.memInfo.birthday) {
|
|
||||||
that.$tools.msg("请选择出生日期")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (that.memInfo.measure_model == 1 && !that.memInfo.identity_id) {
|
|
||||||
that.$tools.msg("请选择身份信息")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (that.memInfo.measure_model == 1 && !that.memInfo.address) {
|
|
||||||
that.$tools.msg("请选择所属地区")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let https = that.isEdit ? that.$model.getEditUser(that.memInfo) : that.$model.getAddUser(that.memInfo)
|
|
||||||
return https.then(res => {
|
|
||||||
console.log("成功", res)
|
|
||||||
if (res.code == 0) {
|
|
||||||
that.$tools.msg("提交成功");
|
|
||||||
that.handleUserList(res.data.aud_id)
|
|
||||||
} else {
|
|
||||||
that.$tools.msg(res.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleUserList(id) {
|
|
||||||
let that = this
|
|
||||||
that.$model.getUserList({
|
|
||||||
type: 2
|
|
||||||
}).then(res => {
|
|
||||||
console.log("成员列表", res)
|
|
||||||
that.$store.commit('changeFamilay', res.data)
|
|
||||||
let aud_id = ""
|
|
||||||
let pages = getCurrentPages()
|
|
||||||
let prevPage = pages[pages.length - 2]
|
|
||||||
// 修改用户
|
|
||||||
if (that.isEdit && that.memInfo.id == uni.getStorageSync('userid')) {
|
|
||||||
console.log("修改用户")
|
|
||||||
aud_id = uni.getStorageSync('userid')
|
|
||||||
}
|
|
||||||
// 添加用户
|
|
||||||
if (!that.isEdit) {
|
|
||||||
console.log("添加用户")
|
|
||||||
uni.setStorageSync('userid', id)
|
|
||||||
uni.setStorageSync('gender', that.memInfo.gender)
|
|
||||||
aud_id = id
|
|
||||||
}
|
|
||||||
that.handlePublicRecord(aud_id)
|
|
||||||
that.$store.dispatch('getUserInfo', {
|
|
||||||
aud_id: aud_id
|
|
||||||
})
|
|
||||||
that.$store.dispatch("getResult", {
|
|
||||||
aud_id: aud_id
|
|
||||||
})
|
|
||||||
console.log("familayList个数", that.familayList.length)
|
|
||||||
if (!that.isEdit && that.familayList.length == 1) {
|
|
||||||
uni.setStorageSync('isBle', true)
|
|
||||||
uni.switchTab({
|
|
||||||
url: "/pages/home/home"
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
uni.navigateBack()
|
|
||||||
}
|
|
||||||
|
|
||||||
}).catch(err => {})
|
|
||||||
},
|
|
||||||
// 公共手动记录内容
|
|
||||||
handlePublicRecord(id) {
|
|
||||||
let that = this
|
|
||||||
that.$model.getPublicRecord({
|
|
||||||
aud_id: id
|
|
||||||
}).then(res => {
|
|
||||||
console.log("公共手动记录", res)
|
|
||||||
if (res.code == 0) {
|
|
||||||
that.$store.commit('changePublicRecord', res.data)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//确定年龄
|
|
||||||
maskClick(e) {
|
|
||||||
console.log("出生日期", e.detail.value)
|
|
||||||
this.memInfo.birthday = e.detail.value
|
|
||||||
},
|
|
||||||
//确定性别
|
|
||||||
onsexArr(e) {
|
|
||||||
this.memInfo.gender = this.sexItem[e.target.value] == "男" ? 1 : 2
|
|
||||||
},
|
|
||||||
// 年级
|
|
||||||
changegType(e) {
|
|
||||||
this.gradeIndex = e.detail.value
|
|
||||||
this.memInfo.grade = this.gradeList[e.target.value].id
|
|
||||||
},
|
|
||||||
// 身份
|
|
||||||
changegIdentity(e) {
|
|
||||||
let that = this
|
|
||||||
that.identityIndex = e.detail.value
|
|
||||||
that.memInfo.identity_id = that.identityList[e.detail.value].id
|
|
||||||
that.memInfo.identity_name = that.identityList[e.detail.value].name
|
|
||||||
},
|
|
||||||
// 地区
|
|
||||||
bindChange(e) {
|
|
||||||
let that = this
|
|
||||||
if (e.detail.value[0] != that.value[0]) {
|
|
||||||
e.detail.value[1] = 0
|
|
||||||
}
|
|
||||||
that.value = e.detail.value
|
|
||||||
that.city = that.province[that.value[0]].list
|
|
||||||
},
|
|
||||||
handlesure() {
|
|
||||||
let that = this
|
|
||||||
let defaultRegion = [that.province[that.value[0]].name, that.city[that.value[1]]]
|
|
||||||
that.memInfo.address = defaultRegion.join(",");
|
|
||||||
that.visible = false
|
|
||||||
},
|
|
||||||
handleCityList() {
|
|
||||||
let that = this
|
|
||||||
that.province = that.cityList
|
|
||||||
if (that.user.address != '') {
|
|
||||||
let str = that.user.address.split(',')[0]
|
|
||||||
let str2 = that.user.address.split(',')[1]
|
|
||||||
var Index0 = that.cityList.findIndex((profile) => profile.name === str);
|
|
||||||
var Index2 = that.cityList[Index0].list.findIndex((ite) => ite === str2);
|
|
||||||
that.value[0] = Index0
|
|
||||||
that.value[1] = Index2
|
|
||||||
that.city = that.cityList[Index0].list
|
|
||||||
} else {
|
|
||||||
that.value = [2, 0]
|
|
||||||
that.city = that.cityList[2].list
|
|
||||||
}
|
|
||||||
that.visible = true
|
|
||||||
},
|
|
||||||
// 获取年级
|
|
||||||
// handleGradeList() {
|
|
||||||
// let that = this
|
|
||||||
// if (that.isEdit == true) {
|
|
||||||
// that.gradeIndex = that.gradeList.findIndex(ite => ite.id == that.memInfo.grade)
|
|
||||||
// that.memInfo.grade = that.gradeList[that.gradeIndex].id
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// 获取身份
|
|
||||||
handleIdentityList() {
|
|
||||||
let that = this
|
|
||||||
if (that.isEdit == true) {
|
|
||||||
that.identityIndex = that.identityList.findIndex(ite => ite.id == that.memInfo.identity_id)
|
|
||||||
that.memInfo.identity_id = that.identityList[that.identityIndex].id
|
|
||||||
that.memInfo.identity_name = that.identityList[that.identityIndex].name
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 场景选择
|
|
||||||
handleMeasureModel(ind) {
|
|
||||||
let that = this
|
|
||||||
that.memInfo.measure_model = ind
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped="scoped" lang="scss">
|
|
||||||
.box {
|
|
||||||
height: 100vh;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
input {
|
|
||||||
border: none;
|
|
||||||
background: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
.headbox {
|
|
||||||
height: 180rpx;
|
|
||||||
padding-top: 10px;
|
|
||||||
border-radius: 0 0 5px 5px;
|
|
||||||
background: $maincolor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.headimage {
|
|
||||||
display: block;
|
|
||||||
padding-top: 10px;
|
|
||||||
width: 70px;
|
|
||||||
height: 70px;
|
|
||||||
border-radius: 50%;
|
|
||||||
font-size: 140rpx;
|
|
||||||
margin: auto;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lan {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 32rpx;
|
|
||||||
padding: 5px 0;
|
|
||||||
margin: 5px 15px;
|
|
||||||
border-bottom: 1px solid #f7f7f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.left {
|
|
||||||
width: 24%;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.right {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
width: 72%;
|
|
||||||
height: 40px;
|
|
||||||
line-height: 40px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
position: relative;
|
|
||||||
text-align: right;
|
|
||||||
|
|
||||||
.radio {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
picker {
|
|
||||||
width: 100%;
|
|
||||||
text-align: right;
|
|
||||||
border: none;
|
|
||||||
margin-right: 15px;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #333333;
|
|
||||||
}
|
|
||||||
|
|
||||||
/deep/input {
|
|
||||||
height: 35px;
|
|
||||||
padding-top: 1px;
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #333333;
|
|
||||||
margin-right: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
color: #333333;
|
|
||||||
font-size: 32rpx;
|
|
||||||
position: absolute;
|
|
||||||
right: -10px;
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
width: auto;
|
|
||||||
margin: 40px 15px 0;
|
|
||||||
background: $btncolor !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.visible {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
z-index: 9999;
|
|
||||||
background-color: rgba(0, 0, 0, 0.6);
|
|
||||||
|
|
||||||
.groupBtn {
|
|
||||||
height: 50px;
|
|
||||||
line-height: 50px;
|
|
||||||
background-color: #fff;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 0 15px;
|
|
||||||
border-bottom: 1px solid #dfdfdf;
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 45%;
|
|
||||||
z-index: 999;
|
|
||||||
|
|
||||||
view {
|
|
||||||
height: 30px;
|
|
||||||
line-height: 30px;
|
|
||||||
padding: 0 10px;
|
|
||||||
background-color: #dfdfdf;
|
|
||||||
border-radius: 5px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sure {
|
|
||||||
background-color: $textcolor;
|
|
||||||
color: #fff !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.picker-view {
|
|
||||||
width: 100%;
|
|
||||||
height: 45%;
|
|
||||||
bottom: 0;
|
|
||||||
position: absolute;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
line-height: 45px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,100 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content addText">
|
|
||||||
<view class="item">
|
|
||||||
<!-- <view class="name">
|
|
||||||
<view class="text">记录宠物</view>
|
|
||||||
<picker mode="selector" :range="petList" range-key="name" @change="handleList">
|
|
||||||
<view class="uni-input">{{petList[index].name?petList[index].name:'请选择宠物'}}
|
|
||||||
<icon class="iconfont icon-shouqi-xi"></icon>
|
|
||||||
</view>
|
|
||||||
</picker>
|
|
||||||
</view> -->
|
|
||||||
<view class="name">
|
|
||||||
<view class="text">记录时间</view>
|
|
||||||
<view class="example-body">
|
|
||||||
<uni-datetime-picker type="datetime" v-model="recordTime" @change="changeLog" :border="false"
|
|
||||||
:clear-icon='false' :hide-second='true' />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<view class="ji">小记</view>
|
|
||||||
<textarea v-model="content" placeholder="说点什么吧" name="content" maxlength="200" />
|
|
||||||
<view class="length">{{content.length}}/200</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="btn" @click="handleCloseClick">保存</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
index: -1,
|
|
||||||
petId: "",
|
|
||||||
content: '',
|
|
||||||
recordTime: ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["petInfo", "petList"]),
|
|
||||||
start() {
|
|
||||||
return this.$tools.getTime()
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.recordTime = this.$tools.getTime()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 宠物选择
|
|
||||||
handleList(e) {
|
|
||||||
this.index = e.target.value
|
|
||||||
this.petId = this.petList[e.target.value].id
|
|
||||||
},
|
|
||||||
// 记录时间
|
|
||||||
changeLog(e) {
|
|
||||||
this.recordTime = e
|
|
||||||
},
|
|
||||||
// 提交、
|
|
||||||
handleCloseClick() {
|
|
||||||
let that = this
|
|
||||||
// if (!that.petId) {
|
|
||||||
// that.$tools.msg("请选择宠物")
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
if (!that.recordTime) {
|
|
||||||
that.$tools.msg("请选择记录时间")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
that.$model.getNotepadSubmit({
|
|
||||||
petId: uni.getStorageSync('petid'),
|
|
||||||
content: that.content,
|
|
||||||
recordTime: that.recordTime,
|
|
||||||
}).then((res) => {
|
|
||||||
if (res.code != 0) false
|
|
||||||
that.$tools.msg("记录成功!")
|
|
||||||
uni.redirectTo({
|
|
||||||
url: "/pages/notepad/notepad"
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.btn {
|
|
||||||
margin-top: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/deep/.example-body {
|
|
||||||
picker {
|
|
||||||
text-align: center !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,87 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<view class="add" @click="handleAdd" v-if="token">+新增记事</view>
|
|
||||||
<view v-if="list.length" class="tipsList">
|
|
||||||
<view class="tips" v-for="(ite,ind) in list" :key="ind">
|
|
||||||
<view class="title">{{ite.recordtime}}</view>
|
|
||||||
<uni-swipe-action>
|
|
||||||
<uni-swipe-action-item :right-options="ite.options">
|
|
||||||
<view class="list">
|
|
||||||
<icon class="t-icon t-icon-a-ziyuan265"></icon>
|
|
||||||
<view class="info">
|
|
||||||
<view class="time">{{petInfo.name}}</view>
|
|
||||||
<text>记事内容:</text>
|
|
||||||
<text>{{ite.content}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</uni-swipe-action-item>
|
|
||||||
</uni-swipe-action>
|
|
||||||
</view>
|
|
||||||
<view class="endtext" v-if="!lastPage || page >= lastPage">—— 到底了,看看别的吧 ——</view>
|
|
||||||
</view>
|
|
||||||
<view class="nolist mt-15" v-if="!lastPage">
|
|
||||||
<image src="../../static/none.png"></image>
|
|
||||||
<text>暂无数据!</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
token: "",
|
|
||||||
list: [],
|
|
||||||
page: 1,
|
|
||||||
lastPage: 0,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["petList", "petInfo"]),
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
let that = this
|
|
||||||
that.page = 1
|
|
||||||
that.list = []
|
|
||||||
},
|
|
||||||
methods: {}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.add {
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
background: #fff;
|
|
||||||
height: 45px;
|
|
||||||
line-height: 45px;
|
|
||||||
border-radius: 5px;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
padding: 15px
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
// height: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
margin-top: 3px !important;
|
|
||||||
width: auto !important;
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nolist {
|
|
||||||
text {
|
|
||||||
margin: -15px auto 15px !important;
|
|
||||||
width: 100% !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,155 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="common">
|
|
||||||
<!-- 头部 -->
|
|
||||||
<headerIndex :isArea="false"></headerIndex>
|
|
||||||
<!-- -->
|
|
||||||
<view class="history" v-if="ranklist.length">
|
|
||||||
<view class="list" v-for="(item, index) in ranklist" :key="index" @click="clickItemMethod(item.id)">
|
|
||||||
<view class="data">
|
|
||||||
<icon class="t-icon t-icon-shijian-mianxing-0"></icon>
|
|
||||||
{{item.create_time}}
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<view class="time">
|
|
||||||
地区:{{item.address}}
|
|
||||||
</view>
|
|
||||||
<view class="number">
|
|
||||||
{{item.score}}
|
|
||||||
<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">
|
|
||||||
<image src="../../static/none.png"></image>
|
|
||||||
<text>暂无数据</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import headerIndex from "@/element/headerIndex.vue";
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
|
||||||
computed: {
|
|
||||||
...mapState(['user', "appTheme"]),
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
page: 1,
|
|
||||||
ranklist: [],
|
|
||||||
lastPage: "",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
headerIndex
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["user"]),
|
|
||||||
userId() {
|
|
||||||
return this.user.id
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
let that = this
|
|
||||||
that.page = 1
|
|
||||||
that.getList(1)
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
userId() {
|
|
||||||
let that = this
|
|
||||||
that.page = 1
|
|
||||||
that.ranklist = []
|
|
||||||
that.getList(1)
|
|
||||||
console.log("user变了")
|
|
||||||
},
|
|
||||||
},
|
|
||||||
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: {
|
|
||||||
clickItemMethod(id) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/score/report?id=" + id
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getList(page) {
|
|
||||||
let that = this
|
|
||||||
that.$model.getSportshistory({
|
|
||||||
aud_id: uni.getStorageSync('userid'),
|
|
||||||
page: page,
|
|
||||||
}).then((res) => {
|
|
||||||
console.log("历史记录", res)
|
|
||||||
if (res.code != 0) return
|
|
||||||
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%;
|
|
||||||
border-radius: 10px;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
|
|
||||||
.data {
|
|
||||||
width: 100%;
|
|
||||||
justify-content: center;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 36rpx;
|
|
||||||
|
|
||||||
icon {
|
|
||||||
width: 40rpx;
|
|
||||||
height: 40rpx;
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
width: calc(100% - 40rpx);
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
background: #fff;
|
|
||||||
font-weight: 700;
|
|
||||||
line-height: 50rpx;
|
|
||||||
padding: 10px;
|
|
||||||
font-size: 36rpx !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time {
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<view class="time text_c bold">{{create_time}}</view>
|
|
||||||
<!-- 估分 -->
|
|
||||||
<view class="box">
|
|
||||||
<view class="title bold">本次估分成绩为</view>
|
|
||||||
<view class="charts">
|
|
||||||
<qiun-data-charts type="arcbar" :chartData="chartData" :Height="140" :Width="140"/>
|
|
||||||
<view class="name">{{score}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="title bold" v-if="Max_score">该地区体育总成绩为:{{Max_score}}分</view>
|
|
||||||
</view>
|
|
||||||
<!-- -->
|
|
||||||
<view v-for="(item,index) in selectllist">
|
|
||||||
<view class="titleName bold mt-15 ml-15 size16">{{item.name}}</view>
|
|
||||||
<view class="indexCarList">
|
|
||||||
<view class="card" v-for="(ite,ind) in item.list">
|
|
||||||
<view class="title">
|
|
||||||
<view class="name">{{ite.name}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="item3" v-for="(it,id) in ite.list" v-if="ite.list.length>1">
|
|
||||||
<view class="name">{{it.name}}</view>
|
|
||||||
<view class="weight">
|
|
||||||
<view class="input">{{it.value?it.value:'-'}}</view>
|
|
||||||
<view class="cblue bold">{{it.proportion_value?it.proportion_value:'-'}}</view>
|
|
||||||
<view class="cblue bold">{{it.total_score?it.total_score:'-'}}</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 {
|
|
||||||
chartData: {
|
|
||||||
series: [{
|
|
||||||
name: "正确率",
|
|
||||||
color: "#4687F9",
|
|
||||||
data: 0.8
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
score: 0,
|
|
||||||
Max_score: 0,
|
|
||||||
create_time: "",
|
|
||||||
selectllist: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
qiunDataCharts
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
let that = this
|
|
||||||
that.getList(options.id)
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getList(id) {
|
|
||||||
let that = this
|
|
||||||
that.$model.getSportshistorydetail({
|
|
||||||
id: Number(id),
|
|
||||||
}).then((res) => {
|
|
||||||
console.log("历史记录详情", res)
|
|
||||||
if (res.code != 0) return
|
|
||||||
that.selectllist = res.data.list
|
|
||||||
that.score = Number(res.data.score)
|
|
||||||
that.Max_score = res.data.max_score
|
|
||||||
that.create_time = res.data.create_time
|
|
||||||
that.chartData.series[0].data = Number(res.data.score) / Number(that.Max_score)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
@import "@/scss/report.scss";
|
|
||||||
.content {
|
|
||||||
min-height: 100vh;
|
|
||||||
padding-top: 15px;
|
|
||||||
padding-bottom: 15px;
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,209 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<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>
|
|
||||||
<view class="btnlogin" @click="handleTelLogin">确认</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
phone: "",
|
|
||||||
code: "",
|
|
||||||
disabled: false,
|
|
||||||
second: 60,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 登录、
|
|
||||||
handleTelLogin() {
|
|
||||||
let that = this
|
|
||||||
if (!(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) {
|
|
||||||
that.$tools.msg("请输入正确的邮箱")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!that.code) {
|
|
||||||
that.$tools.msg("请填写验证码")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
that.$model.getAccountMsg({
|
|
||||||
data: that.phone,
|
|
||||||
code: that.code,
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code != 0) {
|
|
||||||
that.$tools.msg(res.msg)
|
|
||||||
return
|
|
||||||
} else {
|
|
||||||
that.$tools.msg("设置成功!")
|
|
||||||
that.$store.commit('changeAccountNumber', {
|
|
||||||
my_email: that.phone
|
|
||||||
})
|
|
||||||
uni.redirectTo({
|
|
||||||
url: "/pageTwo/setting/setting"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}).catch(err => {})
|
|
||||||
},
|
|
||||||
// 获取验证码
|
|
||||||
handleCode() {
|
|
||||||
let that = this
|
|
||||||
if (!that.phone) {
|
|
||||||
that.$tools.msg("请输入邮箱")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) {
|
|
||||||
that.$tools.msg("请输入正确的邮箱")
|
|
||||||
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 => {})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.content {
|
|
||||||
width: 100%;
|
|
||||||
height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login {
|
|
||||||
width: calc(100% - 30px);
|
|
||||||
height: auto;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 10px;
|
|
||||||
padding: 15px;
|
|
||||||
background-color: #fff;
|
|
||||||
z-index: 99;
|
|
||||||
|
|
||||||
.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: 32rpx;
|
|
||||||
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: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.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: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.yanzhengma {
|
|
||||||
input {
|
|
||||||
right: 120px;
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.code {
|
|
||||||
width: 110px;
|
|
||||||
background: #dfdfdf;
|
|
||||||
font-size: 32rpx;
|
|
||||||
margin: 0;
|
|
||||||
line-height: 40px;
|
|
||||||
border-radius: 5px;
|
|
||||||
text-align: center;
|
|
||||||
position: absolute;
|
|
||||||
right: 0px;
|
|
||||||
top: 0px;
|
|
||||||
bottom: 0;
|
|
||||||
z-index: 99;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,139 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<view class="login">
|
|
||||||
<view class="editem">
|
|
||||||
<view class="item">
|
|
||||||
<view class="text">密码</view>
|
|
||||||
<view class="input">
|
|
||||||
<input class="uni-input" v-model="password" placeholder="请输入密码"/>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<view class="text">确认密码</view>
|
|
||||||
<view class="input">
|
|
||||||
<input class="uni-input" v-model="password2" placeholder="请输入确认密码"/>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="btnlogin" @click="handleTelLogin">确认</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
password: "",
|
|
||||||
password2: "",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad() {},
|
|
||||||
methods: {
|
|
||||||
// 登录、
|
|
||||||
handleTelLogin() {
|
|
||||||
let that = this
|
|
||||||
if (!that.password) {
|
|
||||||
that.$tools.msg("请填写密码")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!that.password2) {
|
|
||||||
that.$tools.msg("请确认密码")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (that.password2 != that.password) {
|
|
||||||
that.$tools.msg("请确认两次密码填写一致")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
that.$model.getAccountPassword({
|
|
||||||
password: that.password,
|
|
||||||
c_password: that.password2,
|
|
||||||
}).then(res => {
|
|
||||||
console.log("注册", res)
|
|
||||||
if (res.code != 0) {
|
|
||||||
that.$tools.msg(res.msg)
|
|
||||||
} else {
|
|
||||||
that.$tools.msg("密码设置成功")
|
|
||||||
uni.navigateBack()
|
|
||||||
}
|
|
||||||
}).catch(err => {})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.content {
|
|
||||||
width: 100%;
|
|
||||||
height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login {
|
|
||||||
width: calc(100% - 30px);
|
|
||||||
height: auto;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 10px;
|
|
||||||
padding: 15px;
|
|
||||||
background-color: #fff;
|
|
||||||
z-index: 99;
|
|
||||||
|
|
||||||
.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: 32rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.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: 28rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,209 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<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>
|
|
||||||
<view class="btnlogin" @click="handleTelLogin">确认</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
phone: "",
|
|
||||||
code: "",
|
|
||||||
disabled: false,
|
|
||||||
second: 60,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 登录、
|
|
||||||
handleTelLogin() {
|
|
||||||
let that = this
|
|
||||||
if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) {
|
|
||||||
that.$tools.msg("请输入正确的手机号")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!that.code) {
|
|
||||||
that.$tools.msg("请填写验证码")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
that.$model.getAccountMsg({
|
|
||||||
data: that.phone,
|
|
||||||
code: that.code,
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code != 0) {
|
|
||||||
that.$tools.msg(res.msg)
|
|
||||||
return
|
|
||||||
} else {
|
|
||||||
that.$tools.msg("设置成功!")
|
|
||||||
that.$store.commit('changeAccountNumber', {
|
|
||||||
my_tel: that.phone
|
|
||||||
})
|
|
||||||
uni.redirectTo({
|
|
||||||
url: "/pageTwo/setting/setting"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}).catch(err => {})
|
|
||||||
},
|
|
||||||
// 获取验证码
|
|
||||||
handleCode() {
|
|
||||||
let that = this
|
|
||||||
if (!that.phone) {
|
|
||||||
that.$tools.msg("请输入手机号")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) {
|
|
||||||
that.$tools.msg("请输入正确的手机号")
|
|
||||||
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 => {})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.content {
|
|
||||||
width: 100%;
|
|
||||||
height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login {
|
|
||||||
width: calc(100% - 30px);
|
|
||||||
height: auto;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 10px;
|
|
||||||
padding: 15px;
|
|
||||||
background-color: #fff;
|
|
||||||
z-index: 99;
|
|
||||||
|
|
||||||
.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:28rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.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:28rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.yanzhengma {
|
|
||||||
input {
|
|
||||||
right: 120px;
|
|
||||||
font-size: 32rpx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.code {
|
|
||||||
width: 110px;
|
|
||||||
background: #dfdfdf;
|
|
||||||
font-size: 32rpx;
|
|
||||||
margin: 0;
|
|
||||||
line-height: 40px;
|
|
||||||
border-radius: 5px;
|
|
||||||
text-align: center;
|
|
||||||
position: absolute;
|
|
||||||
right: 0px;
|
|
||||||
top: 0px;
|
|
||||||
bottom: 0;
|
|
||||||
z-index: 99;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,159 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<view class="caritem">
|
|
||||||
<view class="text">头像</view>
|
|
||||||
<image :src="user.head_pic" class="image"></image>
|
|
||||||
</view>
|
|
||||||
<view class="caritem">
|
|
||||||
<view class="text">昵称</view>
|
|
||||||
<view class="text_r">
|
|
||||||
<text v-if="!isEdit">{{user.nickname}}</text>
|
|
||||||
<input v-else type="text" v-model='nickname' @blur="handleBlur" />
|
|
||||||
<uni-icons type="compose" color="#FEC407" @click="isEdit=true" class="ml-10" size="22"></uni-icons>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="caritem" @click="navTo('/pageTwo/setting/phone')">
|
|
||||||
<view class="text">手机号</view>
|
|
||||||
<view class="text_r">
|
|
||||||
<text>{{user.my_tel}}</text>
|
|
||||||
<uni-icons type="right"></uni-icons>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="caritem" @click="navTo('/pageTwo/setting/email')">
|
|
||||||
<view class="text">邮箱</view>
|
|
||||||
<view class="text_r">
|
|
||||||
<text>{{user.my_email}}</text>
|
|
||||||
<uni-icons type="right"></uni-icons>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="caritem" @click="navTo('/pageTwo/setting/password')">
|
|
||||||
<view class="text">设置密码</view>
|
|
||||||
<uni-icons type="right"></uni-icons>
|
|
||||||
</view>
|
|
||||||
<view class="btn mb-15" @click="handleOutLogin">删除账号</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
isEdit: false,
|
|
||||||
headimg: null,
|
|
||||||
nickname: ""
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["accountNumber"]),
|
|
||||||
user() {
|
|
||||||
return this.accountNumber
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleOutLogin() {
|
|
||||||
let that = this
|
|
||||||
uni.showModal({
|
|
||||||
title: '友情提示',
|
|
||||||
confirmText: '删除',
|
|
||||||
content: '删除成功后,该账号的所有关联信息将被清空且无法找回,是否删除?',
|
|
||||||
success: function(res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
that.$model.getdeleteAccount({}).then((res) => {
|
|
||||||
if (res.code != 0) return
|
|
||||||
that.$tools.msg("删除成功!");
|
|
||||||
uni.setStorageSync('token', null)
|
|
||||||
uni.setStorageSync('aan_id', null)
|
|
||||||
uni.clearStorageSync()
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: "/pageTwo/login/login"
|
|
||||||
})
|
|
||||||
}, 3000);
|
|
||||||
})
|
|
||||||
} else if (res.cancel) {
|
|
||||||
that.$tools.msg("您已取消操作!");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 修改昵称
|
|
||||||
handleBlur() {
|
|
||||||
let that = this
|
|
||||||
return that.$model.getAccountNickname({
|
|
||||||
nickname: that.nickname,
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code != 0) return
|
|
||||||
that.user.nickname = that.nickname
|
|
||||||
that.$store.commit('changeAccountNumber', {
|
|
||||||
nickname: that.nickname
|
|
||||||
})
|
|
||||||
that.isEdit = false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
navTo(url) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.content {
|
|
||||||
background-color: #F3F4F6;
|
|
||||||
padding: 15px;
|
|
||||||
min-height: 100vh;
|
|
||||||
font-size: 36rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text_r {
|
|
||||||
width: 70%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
|
|
||||||
text {
|
|
||||||
width: calc(100% - 30px);
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
input {
|
|
||||||
width: 80%;
|
|
||||||
border-bottom: 1px solid #dfdfdf;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
width: auto;
|
|
||||||
background: #999;
|
|
||||||
margin: 50px 15px 0 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.caritem {
|
|
||||||
height: 50px;
|
|
||||||
line-height: 50px;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 10px;
|
|
||||||
padding: 0 10px;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.uni-icons {
|
|
||||||
width: 30px;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
<template>
|
|
||||||
<web-view :src="webviewUrl"></web-view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
webviewUrl: ''
|
|
||||||
};
|
|
||||||
},
|
|
||||||
// 页面加载时接收URL参数并解码
|
|
||||||
onLoad(options) {
|
|
||||||
let that = this
|
|
||||||
let token = uni.getStorageSync('token')
|
|
||||||
let url = options.url + '?token=' + token + '&id=' + options.id
|
|
||||||
that.webviewUrl = decodeURIComponent(url);
|
|
||||||
console.log("11111", options, url, this.webviewUrl)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
586
pages.json
|
|
@ -1,47 +1,13 @@
|
||||||
{
|
{
|
||||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||||
{
|
{
|
||||||
"path": "pages/home/home",
|
"path": "pages/index/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
"onReachBottomDistance": 50
|
"onReachBottomDistance": 50
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "pages/skiping/skip",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "跳绳数据",
|
|
||||||
"enablePullDownRefresh": true,
|
|
||||||
"onReachBottomDistance": 50
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/skiping/charts",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "运动曲线",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/lunging/vitalcapacity",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "肺活量数据",
|
|
||||||
"enablePullDownRefresh": true,
|
|
||||||
"onReachBottomDistance": 50,
|
|
||||||
"navigationBarBackgroundColor": "#000000",
|
|
||||||
"backgroundColor": "#000000"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/lunging/charts",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "运动曲线",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "pages/my/me",
|
"path": "pages/my/me",
|
||||||
"style": {
|
"style": {
|
||||||
|
|
@ -52,341 +18,275 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/score/score",
|
"path": "pages/target/target",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "分数评估",
|
"navigationBarTitleText": "趋势"
|
||||||
"enablePullDownRefresh": true,
|
|
||||||
"onReachBottomDistance": 50
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/PublicCards/PublicCards",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "对比详情"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/body/body",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "身体数据",
|
|
||||||
"enablePullDownRefresh": true,
|
|
||||||
"onReachBottomDistance": 50
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/zixun/list",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": ""
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
],
|
],
|
||||||
"subPackages": [{
|
"subPackages": [{
|
||||||
"root": "pageTwo",
|
"root": "body",
|
||||||
"pages": [{
|
"pages": [{
|
||||||
"path": "history/history",
|
"path": "login/forgetPassword",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "历史记录",
|
"navigationBarTitleText": "密码",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "history/historyDetail",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "记录详情",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "compk/contrast",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "数据对比",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "compk/pkdetail",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "对比详情",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "cardList/card",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "卡片设置",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "business/business",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "设备管理",
|
|
||||||
"enablePullDownRefresh": true,
|
|
||||||
"onReachBottomDistance": 50
|
|
||||||
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "business/addDevice",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "设备列表",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "business/search",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "搜索设备",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "score/history",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "估分历史",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "score/report",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "估分报告",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "my/manage",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "成员管理",
|
|
||||||
"enablePullDownRefresh": true,
|
|
||||||
"onReachBottomDistance": 50
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "message/list",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "my/userInfo",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "资料"
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "login/forgetPassword",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "密码",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "login/login",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "登录",
|
|
||||||
"enablePullDownRefresh": false,
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "my/about",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "关于我们",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "setting/setting",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "设置",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "setting/password",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "修改密码",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "setting/email",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "绑定邮箱",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "setting/phone",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "绑定手机号",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "devices/search",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "蓝牙搜索",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "devices/G02",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "测量",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "devices/PCL",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "测量",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"path": "devices/PCV02",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "devices/PCT01",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path" : "devices/B20",
|
|
||||||
"style" :
|
|
||||||
{
|
{
|
||||||
"navigationBarTitleText" : "",
|
"path": "login/login",
|
||||||
"enablePullDownRefresh": false
|
"style": {
|
||||||
}
|
"navigationBarTitleText": "登录",
|
||||||
},
|
"enablePullDownRefresh": false,
|
||||||
{
|
"navigationStyle": "custom"
|
||||||
"path" : "devices/PCL22",
|
}
|
||||||
"style" :
|
}, {
|
||||||
|
"path": "home/body",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "身体数据",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "my/userInfo",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "个人资料",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"navigationBarTitleText" : "",
|
"path": "my/manage",
|
||||||
"enablePullDownRefresh": false
|
"style": {
|
||||||
}
|
"navigationBarTitleText": "成员管理",
|
||||||
},
|
"enablePullDownRefresh": false
|
||||||
{
|
}
|
||||||
"path" : "devices/PCL22S",
|
}, {
|
||||||
"style" :
|
"path": "my/about",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "关于我们",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "setting/setting",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "设置",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "setting/phone",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "手机号绑定",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "setting/email",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "邮箱绑定",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "setting/password",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "密码管理",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"navigationBarTitleText" : "",
|
"path": "history/history",
|
||||||
"enablePullDownRefresh": false
|
"style": {
|
||||||
}
|
"navigationBarTitleText": "测量记录",
|
||||||
},
|
"enablePullDownRefresh": false
|
||||||
{
|
}
|
||||||
"path": "notepad/notepad",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "",
|
"path": "history/historyDetail",
|
||||||
"enablePullDownRefresh": false
|
"style": {
|
||||||
}
|
"navigationBarTitleText": "记录详情",
|
||||||
},
|
"enablePullDownRefresh": false
|
||||||
{
|
}
|
||||||
"path": "notepad/addNotepad",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "",
|
"path": "webview/webview",
|
||||||
"enablePullDownRefresh": false
|
"style": {
|
||||||
}
|
"navigationBarTitleText": "",
|
||||||
},
|
"enablePullDownRefresh": false
|
||||||
{
|
}
|
||||||
"path": "PublicCards/charts",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "运动曲线"
|
"path": "report/report",
|
||||||
}
|
"style": {
|
||||||
},
|
"navigationBarTitleText": "深度分析"
|
||||||
{
|
}
|
||||||
"path": "PublicCards/history",
|
},
|
||||||
"style": {
|
{
|
||||||
"navigationBarTitleText": "历史记录"
|
"path": "curve/curve",
|
||||||
}
|
"style": {
|
||||||
},
|
"navigationBarTitleText": ""
|
||||||
{
|
}
|
||||||
"path": "PublicCards/contrast",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "数据对比"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "PublicCards/pkdetail",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "对比详情"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "home/inheritHeighet",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "身高预测"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"path": "home/bmi",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "BMI测评"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "webview/webview",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
}, {
|
||||||
|
"root": "Food",
|
||||||
|
"pages": [{
|
||||||
|
"path": "count/setting",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "设置",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}, {
|
||||||
]
|
"path": "count/everyMeal",
|
||||||
}],
|
"style": {
|
||||||
|
"navigationBarTitleText": "餐食详情",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
|
||||||
|
}, {
|
||||||
|
"path": "count/everyDay",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "营养分析",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
|
||||||
|
}, {
|
||||||
|
"path": "count/search",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "食材搜索",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "search/search",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "搜索"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "search/list",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "me/menudetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "详情"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "me/mymenu",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": ""
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "me/record",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "饮食记录"
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
"path": "me/recordetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "饮食详情"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"root": "pageTwo",
|
||||||
|
"pages": [{
|
||||||
|
"path": "cardList/card",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "健康工具",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "bmi/bmi",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "bmi测评"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "compk/contrast",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "数据对比"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "compk/pkdetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "对比详情"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "score/score",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "中招估分"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "lunging/vitalcapacity",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "肺活训练"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "skiping/skip",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "智能跳绳"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "inheritHeighet/inheritHeighet",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "遗传身高"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "charts/charts",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "曲线"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "history/history",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "历史记录"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "history/historyDetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "记录详情"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
"navigationBarTextStyle": "white",
|
"navigationBarTextStyle": "white",
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"navigationBarBackgroundColor": "#37cc92",
|
"navigationBarBackgroundColor": "#54d87c",
|
||||||
"backgroundColor": "#fff"
|
"backgroundColor": "#fff"
|
||||||
},
|
},
|
||||||
// 切换导航
|
// 切换导航
|
||||||
"tabBar": {
|
"tabBar": {
|
||||||
"color": "#333",
|
"color": "#333",
|
||||||
"fontSize": "14px",
|
"fontSize": "14px",
|
||||||
"selectedColor": "#37cc92",
|
"selectedColor": "#54d87c",
|
||||||
"backgroundColor": "#fff",
|
"backgroundColor": "#fff",
|
||||||
"list": [{
|
"list": [{
|
||||||
"pagePath": "pages/home/home",
|
"pagePath": "pages/index/index",
|
||||||
"iconPath": "static/shou.png",
|
"iconPath": "static/shou.png",
|
||||||
"selectedIconPath": "static/shou2.png",
|
"selectedIconPath": "static/shou2.png",
|
||||||
"text": "记录"
|
"text": "首页"
|
||||||
},
|
}, {
|
||||||
{
|
"pagePath": "pages/target/target",
|
||||||
"pagePath": "pages/zixun/list",
|
|
||||||
"iconPath": "static/ping.png",
|
"iconPath": "static/ping.png",
|
||||||
"selectedIconPath": "static/ping2.png",
|
"selectedIconPath": "static/ping2.png",
|
||||||
"text": "资讯"
|
"text": "商城"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pagePath": "pages/my/me",
|
"pagePath": "pages/my/me",
|
||||||
|
|
|
||||||
|
|
@ -1,422 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content ">
|
|
||||||
<view class="tabbar">
|
|
||||||
<scroll-view class="scroll-menu" scroll-x="true" style="white-space: nowrap;">
|
|
||||||
<view v-for="(item,index) in labelList" :class="[active==index?'active':'']"
|
|
||||||
@click="handleActive(item,index)">
|
|
||||||
<text>{{item}}</text>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
<!-- -->
|
|
||||||
<view class="desc">
|
|
||||||
<view class="statuevue">
|
|
||||||
<view class="bi">
|
|
||||||
<view class="peobox" :style="'left:'+Number(offset)+'%'">
|
|
||||||
<view class="xx"></view>
|
|
||||||
</view>
|
|
||||||
<view class="item" v-for="(ite,ind) in lineList" :key="ind" :style="{backgroundColor:ite.color}">
|
|
||||||
<view class="span1">{{ite.text}}</view>
|
|
||||||
<view class="span" v-if="ind<lineList.length-1">{{ite.max_val}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- -->
|
|
||||||
<view v-for="(ite,ind) in label_data" v-if="active == ind">
|
|
||||||
<view class="info">
|
|
||||||
<view class="table">
|
|
||||||
<text class="time">{{ite.record_time}}</text>
|
|
||||||
<text class="name2">训练成绩为</text>
|
|
||||||
</view>
|
|
||||||
<view class="left">
|
|
||||||
<view class="left_view">
|
|
||||||
<view class="title">{{ite.this_time_title}}:</view>
|
|
||||||
<view class="val">
|
|
||||||
<text class="yello"></text>
|
|
||||||
{{ite.this_time_value?ite.this_time_value:'-'}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="left_view">
|
|
||||||
<view class="title">{{ite.today_time_title}}:</view>
|
|
||||||
<view class="val">
|
|
||||||
<text class="yello"></text>
|
|
||||||
{{ite.today_time_value?ite.today_time_value:'-'}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="left_view">
|
|
||||||
<view class="title"></view>
|
|
||||||
<view class="val">
|
|
||||||
<text class="blues yello"></text>
|
|
||||||
{{ite.today_times?ite.today_times:'-'}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="left_view">
|
|
||||||
<view class="title">{{ite.all_time_title}}:</view>
|
|
||||||
<view class="val">
|
|
||||||
<text class="yello"></text>
|
|
||||||
{{ite.all_time_value?ite.all_time_value:'-'}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="left_view">
|
|
||||||
<view class="title"></view>
|
|
||||||
<view class="val">
|
|
||||||
<text class="blues yello"></text>
|
|
||||||
{{ite.all_times?ite.all_times:'-'}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="right">
|
|
||||||
<view class="charts">
|
|
||||||
<qiun-data-charts type="arcbar" :chartData="chartData" :Height="130" :Width="130" :canvas2d="true"/>
|
|
||||||
<view class="name">{{ite.score?ite.score:'-'}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="standard" v-if="ite.standard">
|
|
||||||
<text :style="{backgroundColor:ite.color}">{{ite.standard}}</text>
|
|
||||||
</view>
|
|
||||||
<view v-if="ite.max_score" class="size12 c999"> 总成绩为{{ite.max_score}}分</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 说明 -->
|
|
||||||
<view class="info describe" v-if="ite.describe">
|
|
||||||
{{ite.describe}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- -->
|
|
||||||
<view class="gridList">
|
|
||||||
<view class="data">
|
|
||||||
<view class="item" @click="navTo('/pageTwo/PublicCards/charts?acd_id='+acd_id)">
|
|
||||||
<view class="image">
|
|
||||||
<image src="@/static/charts.png"></image>
|
|
||||||
</view>
|
|
||||||
<view class="name">运动曲线</view>
|
|
||||||
</view>
|
|
||||||
<view class="item" @click="navTo('/pageTwo/PublicCards/history?acd_id='+acd_id)">
|
|
||||||
<view class="image">
|
|
||||||
<image src="@/static/add.png"></image>
|
|
||||||
</view>
|
|
||||||
<view class="name">历史记录</view>
|
|
||||||
</view>
|
|
||||||
<view class="item" @click="navTo('/pageTwo/PublicCards/contrast?acd_id='+acd_id)">
|
|
||||||
<view class="image">
|
|
||||||
<image src="@/static/pk.png"></image>
|
|
||||||
</view>
|
|
||||||
<view class="name">数据对比</view>
|
|
||||||
</view>
|
|
||||||
<view class="item" @click="$store.commit('changePublicAdd',true)">
|
|
||||||
<view class="image">
|
|
||||||
<image src="@/static/history.png"></image>
|
|
||||||
</view>
|
|
||||||
<view class="name">添加记录</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 手动记录 -->
|
|
||||||
<publicAdd :rtype='acd_id' :active="active"></publicAdd>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
import publicAdd from '@/element/manuallyAdd/publicAdd.vue';
|
|
||||||
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue';
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
active: 0,
|
|
||||||
acd_id: null,
|
|
||||||
lineList: [],
|
|
||||||
label_data: [],
|
|
||||||
offset: 0,
|
|
||||||
labelName: "",
|
|
||||||
chartData: {
|
|
||||||
series: [{
|
|
||||||
name: "正确率",
|
|
||||||
color: "#4687F9",
|
|
||||||
data: 0
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
publicAdd,
|
|
||||||
qiunDataCharts
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["PublicContent"]),
|
|
||||||
labelList() {
|
|
||||||
let that = this
|
|
||||||
if (that.PublicContent) {
|
|
||||||
that.labelName = that.PublicContent.label_list[that.active]
|
|
||||||
that.lineList = that.PublicContent.line_list
|
|
||||||
that.label_data = that.PublicContent.label_data
|
|
||||||
that.offset = that.PublicContent.label_data[that.active].offset
|
|
||||||
that.chartData.series[0].data = that.PublicContent.label_data[that.active].score.split('分')[0]/that.PublicContent.label_data[that.active].max_score
|
|
||||||
}
|
|
||||||
return that.PublicContent ? that.PublicContent.label_list : []
|
|
||||||
},
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
let that = this
|
|
||||||
that.acd_id = options.acd_id
|
|
||||||
that.$store.dispatch("getPublicContent", {
|
|
||||||
acd_id: that.acd_id,
|
|
||||||
aud_id: uni.getStorageSync('userid')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleActive(ite, ind) {
|
|
||||||
let that = this
|
|
||||||
that.active = ind
|
|
||||||
that.labelName = ite
|
|
||||||
that.offset = that.label_data[ind].offset
|
|
||||||
that.chartData.series[0].data = Number(that.label_data[ind].offset) / 100
|
|
||||||
},
|
|
||||||
// 历史数据删除时重新加载接口
|
|
||||||
reload() {
|
|
||||||
let that = this
|
|
||||||
console.log('返回历史页', that.acd_id)
|
|
||||||
this.$nextTick(() => {
|
|
||||||
that.$store.dispatch("getPublicContent", {
|
|
||||||
acd_id: that.acd_id,
|
|
||||||
aud_id: uni.getStorageSync('userid')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
navTo(url) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: url
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.content {
|
|
||||||
width: calc(100% - 30px);
|
|
||||||
min-height: calc(100vh - 80px);
|
|
||||||
padding: 65px 15px 15px;
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabbar {
|
|
||||||
display: flex;
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
z-index: 999;
|
|
||||||
justify-content: space-between;
|
|
||||||
border-bottom: 1px solid #f7f7f7;
|
|
||||||
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
|
|
||||||
background-color: #fff;
|
|
||||||
|
|
||||||
.scroll-menu {
|
|
||||||
width: 100%;
|
|
||||||
white-space: nowrap;
|
|
||||||
|
|
||||||
view {
|
|
||||||
height: 55px;
|
|
||||||
line-height: 55px;
|
|
||||||
display: inline-block;
|
|
||||||
min-width: 100px;
|
|
||||||
margin: 0 10px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.active {
|
|
||||||
color: $maincolor;
|
|
||||||
font-weight: bold;
|
|
||||||
border-bottom: 2px solid $maincolor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.desc {
|
|
||||||
padding: 15px;
|
|
||||||
text-align: left;
|
|
||||||
width: calc(100%-20px);
|
|
||||||
height: auto;
|
|
||||||
border-radius: 5px;
|
|
||||||
font-size: 30rpx;
|
|
||||||
color: #999;
|
|
||||||
margin-top: 15px;
|
|
||||||
background: #fff;
|
|
||||||
|
|
||||||
|
|
||||||
.statuevue {
|
|
||||||
height: 35px;
|
|
||||||
position: relative;
|
|
||||||
width: 100% !important;
|
|
||||||
margin: 20px auto 10px;
|
|
||||||
|
|
||||||
.bi {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
width: auto;
|
|
||||||
padding-top: 10px;
|
|
||||||
|
|
||||||
.peobox {
|
|
||||||
position: absolute;
|
|
||||||
right: 0;
|
|
||||||
top: -1px;
|
|
||||||
|
|
||||||
.xx {
|
|
||||||
width: 5px;
|
|
||||||
height: 5px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: #fff;
|
|
||||||
position: absolute;
|
|
||||||
z-index: 9;
|
|
||||||
border: 2px solid #1b2086;
|
|
||||||
top: 9px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
position: relative;
|
|
||||||
margin: 0;
|
|
||||||
flex: 1;
|
|
||||||
height: 5px;
|
|
||||||
color: #666;
|
|
||||||
font-size: 30rpx;
|
|
||||||
|
|
||||||
.span1 {
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
position: absolute;
|
|
||||||
top: -23px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.span {
|
|
||||||
margin-top: 8px;
|
|
||||||
position: absolute;
|
|
||||||
right: -8px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.describe {
|
|
||||||
color: #666;
|
|
||||||
font-size: 28rpx;
|
|
||||||
line-height: 25px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 15px;
|
|
||||||
margin-top: 15px;
|
|
||||||
border-radius: 5px;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.table {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
|
|
||||||
.name2 {
|
|
||||||
width: 260rpx;
|
|
||||||
text-align: center;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 36rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.time {
|
|
||||||
width: calc(100% - 260rpx);
|
|
||||||
color: #999;
|
|
||||||
font-size: 32rpx;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.left {
|
|
||||||
width: calc(100% - 280rpx);
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
|
|
||||||
.left_view {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
width: 80px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.right {
|
|
||||||
width: 260rpx;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
.charts {
|
|
||||||
width: 260upx;
|
|
||||||
height: 260upx;
|
|
||||||
margin: 10px 0;
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
z-index: 9;
|
|
||||||
|
|
||||||
.name {
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 56rpx;
|
|
||||||
color: #4687F9;
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.standard {
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
margin-top: 0px;
|
|
||||||
margin-bottom: 8px;
|
|
||||||
|
|
||||||
text {
|
|
||||||
width: 100px;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 2px 10px;
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.yello {
|
|
||||||
width: 8px;
|
|
||||||
height: 8px;
|
|
||||||
border-radius: 50%;
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 5px;
|
|
||||||
background-color: $btncolor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.blues {
|
|
||||||
background-color: $maincolor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.gridList {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,236 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<!-- tabbar -->
|
|
||||||
<!-- 曲线 -->
|
|
||||||
<view class="charts">
|
|
||||||
<view class="TrendPage">
|
|
||||||
<!-- 时间选择 -->
|
|
||||||
<view class="boxTime">
|
|
||||||
<view class="one">
|
|
||||||
<picker mode="date" :end="endDate" @change="handStartTimeH" :fields="fields"
|
|
||||||
:value="startTime?startTime:startDate">
|
|
||||||
<view class="uni-input mr-10">{{startTime?startTime:startDate}}
|
|
||||||
<icon class="iconfont icon-arrow-down-bold"></icon>
|
|
||||||
</view>
|
|
||||||
</picker>
|
|
||||||
<view class="center">~</view>
|
|
||||||
<picker mode="date" :end="endDate" @change="handEndTimeH" :fields="fields"
|
|
||||||
:value="endTime?endTime:endDate">
|
|
||||||
<view class="uni-input mr-10">{{endTime?endTime:endDate}}
|
|
||||||
<icon class="iconfont icon-arrow-down-bold"></icon>
|
|
||||||
</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"
|
|
||||||
:animation="false" :Width="340" :Height="250"
|
|
||||||
: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="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>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
import record from '@/element/manuallyAdd/record.vue';
|
|
||||||
import firstweight from '@/element/target/firstweight.vue';
|
|
||||||
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue'
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
fields: "",
|
|
||||||
active: 1,
|
|
||||||
acd_id: 2,
|
|
||||||
ind: 0,
|
|
||||||
active1: 0,
|
|
||||||
startTime: "",
|
|
||||||
endTime: "",
|
|
||||||
lineData: {},
|
|
||||||
handTrue: true,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(['user', "MeasureResult", "Trend"]),
|
|
||||||
weightList() {
|
|
||||||
let that = this
|
|
||||||
that.showbox(0)
|
|
||||||
return that.Trend
|
|
||||||
},
|
|
||||||
userInfo() {
|
|
||||||
return this.MeasureResult
|
|
||||||
},
|
|
||||||
endDate() {
|
|
||||||
return this.$tools.getDate("start")
|
|
||||||
},
|
|
||||||
startDate() {
|
|
||||||
return this.$tools.GetDateStr(-90);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
record,
|
|
||||||
firstweight,
|
|
||||||
qiunDataCharts,
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
let that = this
|
|
||||||
that.acd_id = options.acd_id
|
|
||||||
that.$store.dispatch("GetBodyTrendList", {
|
|
||||||
aud_id: uni.getStorageSync('userid'),
|
|
||||||
s_time: that.startDate,
|
|
||||||
e_time: that.endDate
|
|
||||||
})
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
that.fields = "time"
|
|
||||||
// #endif
|
|
||||||
// #ifndef APP-PLUS
|
|
||||||
that.fields = "day"
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
// 下拉刷新
|
|
||||||
onPullDownRefresh() {
|
|
||||||
let that = this
|
|
||||||
that.$store.dispatch("GetBodyTrendList", {
|
|
||||||
aud_id: uni.getStorageSync('userid'),
|
|
||||||
s_time: that.startDate,
|
|
||||||
e_time: that.endDate
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.stopPullDownRefresh()
|
|
||||||
}, 1000);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
showbox(index) {
|
|
||||||
let that = this
|
|
||||||
that.handTrue = false
|
|
||||||
that.$nextTick(function() {
|
|
||||||
that.handTrue = true
|
|
||||||
that.lineData = that.weightList.length ? that.weightList[index].line : {}
|
|
||||||
})
|
|
||||||
that.active1 = index
|
|
||||||
},
|
|
||||||
//开始
|
|
||||||
handStartTimeH(e) {
|
|
||||||
let that = this
|
|
||||||
if (that.endTime) {
|
|
||||||
if (Date.parse(e.detail.value) > Date.parse(that.endTime)) {
|
|
||||||
that.$tools.msg("请选择正确的时间")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (Date.parse(e.detail.value) > Date.parse(that.endDate)) {
|
|
||||||
that.$tools.msg("请选择正确的时间")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
that.startTime = e.detail.value
|
|
||||||
let endtime = that.endTime ? that.endTime : that.endDate
|
|
||||||
that.$store.dispatch("GetBodyTrendList", {
|
|
||||||
aud_id: that.user.id,
|
|
||||||
s_time: that.startTime,
|
|
||||||
e_time: that.endTime ? that.endTime : that.endDate
|
|
||||||
})
|
|
||||||
that.showbox(0)
|
|
||||||
},
|
|
||||||
// 结束
|
|
||||||
handEndTimeH(e) {
|
|
||||||
let that = this
|
|
||||||
if (that.startTime) {
|
|
||||||
if (Date.parse(e.detail.value) < Date.parse(that.startTime)) {
|
|
||||||
that.$tools.msg("请选择正确的时间")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (Date.parse(e.detail.value) < Date.parse(that.startDate)) {
|
|
||||||
that.$tools.msg("请选择正确的时间")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
that.endTime = e.detail.value
|
|
||||||
let startTime = that.startTime ? that.startTime : that.startDate
|
|
||||||
that.$store.dispatch("GetBodyTrendList", {
|
|
||||||
aud_id: uni.getStorageSync('userid'),
|
|
||||||
s_time: startTime,
|
|
||||||
e_time: that.endTime
|
|
||||||
})
|
|
||||||
that.showbox(0)
|
|
||||||
},
|
|
||||||
handleClick(ind) {
|
|
||||||
this.ind = ind
|
|
||||||
this.$store.commit("changeFirst", true);
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
@import "@/scss/body.scss";
|
|
||||||
|
|
||||||
.content {
|
|
||||||
padding: 15px;
|
|
||||||
font-size: 32rpx;
|
|
||||||
width: calc(100% - 30px);
|
|
||||||
background-color: #F5F6FA;
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.listC {
|
|
||||||
margin: 0;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,901 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content indexCarList">
|
|
||||||
<!-- 头部 -->
|
|
||||||
<headerIndex :isArea="false" v-if="isShow"></headerIndex>
|
|
||||||
<!-- 蓝牙提示区 -->
|
|
||||||
<view v-if="userList.length">
|
|
||||||
<view class="bleTips" v-if="islink==0">
|
|
||||||
{{textLink}}
|
|
||||||
</view>
|
|
||||||
<view class="bleTips2 bleTips" v-else @click="openBluetoothAdapter">
|
|
||||||
{{textLink}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="notice" v-if="notices.length">
|
|
||||||
<text>公告</text>
|
|
||||||
<!-- -->
|
|
||||||
<swiper class="swiper" vertical="true" autoplay="true">
|
|
||||||
<swiper-item v-for="(item,index) in notices" :key="index" @click="$tools.NewsPtype(item)">
|
|
||||||
<view class='overflow'>{{item.title}}</view>
|
|
||||||
</swiper-item>
|
|
||||||
</swiper>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 工具区 -->
|
|
||||||
<view class="tools_l">
|
|
||||||
<view v-for="(item,index) in toollist" :key="index" class="list" @click="handleTool(index,item.path)">
|
|
||||||
<image :src="item.icon"></image>
|
|
||||||
<view class="text">{{item.title}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- banner -->
|
|
||||||
<view class="f_banner" v-if="banner.length">
|
|
||||||
<swiper class="swiper" indicator-dots="true" autoplay="true">
|
|
||||||
<swiper-item v-for="(image, index) in banner" :key="index" @click="$tools.NewsPtype(image)">
|
|
||||||
<image :src="image.pic" mode="aspectFill" />
|
|
||||||
</swiper-item>
|
|
||||||
</swiper>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 身体数据 -->
|
|
||||||
<view class="report">
|
|
||||||
<view class="bold mt-10 ml-10" v-if="info&&info.top_list.length">身体报告</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" :style="userInfo.stage=='婴儿'?'width:25%':'width:33%'"
|
|
||||||
v-for="(item,index) in info.top_list" @click="handleToggleTop(item,index)">
|
|
||||||
<view class="data" :class="[activeHeight==index?'activeHeight':'']">
|
|
||||||
<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="nolist" v-if="!info">
|
|
||||||
<image src="../../static/none.png"></image>
|
|
||||||
<text>暂无数据,请手动添加~</text>
|
|
||||||
</view>
|
|
||||||
<view class="box2" v-if="info&&info.body_type_value">
|
|
||||||
<view>身体得分:{{info?info.score_value:0}}分</view>
|
|
||||||
<view>身体类型:{{info?info.body_type_value:'无'}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="bold mt-10 ml-10" v-if="info&&info.bottom_list.length">其他数据</view>
|
|
||||||
<view class="ml-10 mr-10" v-if="info&&info.bottom_list.length">
|
|
||||||
<view class="myinfoPage">
|
|
||||||
<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>
|
|
||||||
</view>
|
|
||||||
<!-- 数据参考 -->
|
|
||||||
<view class="tips c999 ml-15 mb-15" v-if="info.literature.length">
|
|
||||||
<text>*数据参考:</text>
|
|
||||||
<text v-for="(item,index) in info.literature" :key="index">
|
|
||||||
{{item}}
|
|
||||||
</text>
|
|
||||||
</view>
|
|
||||||
<view class="tips2 ml-10" v-if="info.bottom_list">
|
|
||||||
<uni-icons type="info-filled" color="red"></uni-icons>
|
|
||||||
此测量数据仅供参考,不可代替医学专业测试!
|
|
||||||
</view>
|
|
||||||
<!-- 成长建议 -->
|
|
||||||
<view v-if="cplist.sleeplist.length||cplist.nutritionlist.length" class="ml-10 mr-10">
|
|
||||||
<view class="bold mt-10">成长建议</view>
|
|
||||||
<view class="jianyi_box">
|
|
||||||
<view class="jianyi">
|
|
||||||
<view @click="proposalnd=1" :class="{active:proposalnd==1}">
|
|
||||||
<image src="../../static/icon4.png"></image>
|
|
||||||
<text>营养</text>
|
|
||||||
</view>
|
|
||||||
<view @click="proposalnd=2" :class="{active:proposalnd==2}">
|
|
||||||
<image src="../../static/icon1.png"></image>
|
|
||||||
<text>睡眠</text>
|
|
||||||
</view>
|
|
||||||
<view @click="proposalnd=3" :class="{active:proposalnd==3}">
|
|
||||||
<image src="../../static/icon3.png"></image>
|
|
||||||
<text>运动</text>
|
|
||||||
</view>
|
|
||||||
<view @click="proposalnd=4" :class="{active:proposalnd==4}">
|
|
||||||
<image src="../../static/icon2.png"></image>
|
|
||||||
<text>情绪</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<view v-if="proposalnd==1&&cplist.nutritionlist.length" class="jianyi-con">
|
|
||||||
<text v-for="(item,index) in cplist.nutritionlist" :key="index">{{item}}</text>
|
|
||||||
</view>
|
|
||||||
<view v-if="proposalnd==2&&cplist.sleeplist.length" class="jianyi-con">
|
|
||||||
<text v-for="(item,index) in cplist.sleeplist" :key="index">{{item}}</text>
|
|
||||||
</view>
|
|
||||||
<view v-if="proposalnd==3&&cplist.sportlist.length" class="jianyi-con">
|
|
||||||
<text v-for="(item,index) in cplist.sportlist" :key="index">{{item}}</text>
|
|
||||||
</view>
|
|
||||||
<view v-if="proposalnd==4&&cplist.moodlist.length" class="jianyi-con">
|
|
||||||
<text v-for="(item,index) in cplist.moodlist" :key="index">{{item}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 卡片 -->
|
|
||||||
<view class="list" v-if="user">
|
|
||||||
<view class="bold mt-10 ml-10" v-if="user.card_data_list.length">卡片数据</view>
|
|
||||||
<view v-for="(item,index) in user.card_data_list">
|
|
||||||
<!-- 标题 -->
|
|
||||||
<view class="card box" @click="handlerReport(item)" :style="{'backgroundColor':item.background_color}">
|
|
||||||
<view class="boxBg">
|
|
||||||
<image :src="item.background_pic"></image>
|
|
||||||
</view>
|
|
||||||
<view class="title border">
|
|
||||||
<view class="name2">{{item.card_name}}</view>
|
|
||||||
<view class="time">
|
|
||||||
{{item.record_time}}
|
|
||||||
<uni-icons type="right" size="20" v-if="item.inside_data[0].value"></uni-icons>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="target item">
|
|
||||||
<view class="bold size16 c666" v-if="item.acd_id!=2">本次数据</view>
|
|
||||||
<view class="bold size14" v-else>
|
|
||||||
<text class="size32">{{item.inside_data[1].value}}</text>
|
|
||||||
{{item.inside_data[1].unit}}
|
|
||||||
</view>
|
|
||||||
<view class="btnGroup">
|
|
||||||
<view class="blueBtn" v-if="item.acd_id==2" @click.stop
|
|
||||||
@click="$Bluetooth.handleDevicesMac(item.device_determine,item.acd_id)">蓝牙连接</view>
|
|
||||||
<view class="blueBtn" v-else-if="item.acd_id==6">蓝牙连接</view>
|
|
||||||
<view v-else></view>
|
|
||||||
<view class="orangeBtn" @click="handlerRecord(item.acd_id)" @click.stop>手动记录</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 内容 -->
|
|
||||||
<view class="item title"
|
|
||||||
:style="{'justifyContent':item.inside_data.length>2?'space-between':'center'}">
|
|
||||||
<view v-for="(ite,ind) in item.inside_data" :class="[item.inside_data.length>3?'item2':'']">
|
|
||||||
<view class="weight"><text>{{ite.value?ite.value:'-'}}</text>{{ite.unit}}</view>
|
|
||||||
<view class="name mt-5" v-if="item.acd_id!=8">{{ite.name}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 设置数据卡片 -->
|
|
||||||
<view class="setcard" @click="handleCard" v-if="userList.length&&user.measure_model==1">
|
|
||||||
设置数据页卡片
|
|
||||||
</view>
|
|
||||||
<!-- 弹框广告 -->
|
|
||||||
<view class="wrapper" v-if="isCoupon">
|
|
||||||
<view class="bg" @click="isCoupon=false">
|
|
||||||
<view class="edit">
|
|
||||||
<swiper class="text" autoplay="true">
|
|
||||||
<swiper-item v-for="(ite,ind) in pop" :key="ind" @click="$tools.NewsPtype(ite)">
|
|
||||||
<image :src="ite.pic" mode="aspectFill" />
|
|
||||||
<view class="bold mt-5">{{ite.title}}</view>
|
|
||||||
</swiper-item>
|
|
||||||
</swiper>
|
|
||||||
<uni-icons type="clear" @click="isCoupon=false" size="40" class="clear"></uni-icons>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <view class="nolist" @click="handleAddUser" :style="{'marginTop':isShow?'150px':'0'}">
|
|
||||||
<image src="../../static/none.png"></image>
|
|
||||||
<text>请先添加成员</text>
|
|
||||||
</view> -->
|
|
||||||
<!-- 手动 -->
|
|
||||||
<record :rtype="rtype"></record>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
let myTime;
|
|
||||||
import headerIndex from "@/element/headerIndex.vue"
|
|
||||||
import record from '@/element/manuallyAdd/record.vue';
|
|
||||||
import {
|
|
||||||
I18nT
|
|
||||||
} from "vue-i18n";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
rtype: 0,
|
|
||||||
transition: 1.6,
|
|
||||||
isShow: true,
|
|
||||||
infoListTop: {},
|
|
||||||
activeHeight: 0,
|
|
||||||
deviceName: "",
|
|
||||||
deviceId: "",
|
|
||||||
serviceId: "",
|
|
||||||
write: "",
|
|
||||||
notify: "",
|
|
||||||
isCoupon: false,
|
|
||||||
notices: [],
|
|
||||||
banner: [],
|
|
||||||
pop: [],
|
|
||||||
devicesList: [],
|
|
||||||
islink: 0, //-1重新连接
|
|
||||||
textLink: "",
|
|
||||||
proposalnd: 1,
|
|
||||||
toollist: [{
|
|
||||||
icon: '/static/q2.png',
|
|
||||||
title: '中招估分',
|
|
||||||
path: "/pages/score/score"
|
|
||||||
}, {
|
|
||||||
icon: '/static/q4.png',
|
|
||||||
title: 'BMI测评',
|
|
||||||
path: "/pageTwo/home/bmi"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: '/static/q6.png',
|
|
||||||
title: '遗传身高',
|
|
||||||
path: "/pageTwo/home/inheritHeighet"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: '/static/q1.png',
|
|
||||||
title: '智能跳绳',
|
|
||||||
path: "/pages/skiping/skip?acd_id=6"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: '/static/q10.png',
|
|
||||||
title: '肺活训练',
|
|
||||||
path: "/pages/lunging/vitalcapacity?acd_id=8"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: '/static/q8.png',
|
|
||||||
title: '历史体重',
|
|
||||||
path: "/pageTwo/history/history?acd_id=2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: '/static/q3.png',
|
|
||||||
title: '减脂对比',
|
|
||||||
path: "/pageTwo/compk/contrast?acd_id=2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: '/static/q5.png',
|
|
||||||
title: '曲线/目标',
|
|
||||||
path: "/pages/body/body?acd_id=2"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: '/static/q7.png',
|
|
||||||
title: '手动记录',
|
|
||||||
path: ""
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: '/static/q9.png',
|
|
||||||
title: '成员管理',
|
|
||||||
path: "/pageTwo/my/manage"
|
|
||||||
},
|
|
||||||
|
|
||||||
],
|
|
||||||
unit: ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
record,
|
|
||||||
headerIndex
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["user", "familayList", 'MeasureResult', "isConnected", "isBluetoothTyle"]),
|
|
||||||
userInfo() {
|
|
||||||
return this.user
|
|
||||||
},
|
|
||||||
userList() {
|
|
||||||
return this.familayList
|
|
||||||
},
|
|
||||||
cplist() {
|
|
||||||
console.log("this.MeasureResult.cplist", this.MeasureResult.cplist)
|
|
||||||
return this.MeasureResult.cplist
|
|
||||||
},
|
|
||||||
info() {
|
|
||||||
let that = this
|
|
||||||
that.infoListTop = that.MeasureResult.top_list[0] ? that.MeasureResult.top_list[0] : {}
|
|
||||||
that.activeHeight = 0
|
|
||||||
return that.MeasureResult
|
|
||||||
},
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
let that = this
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
if (options && options.type == 1) {
|
|
||||||
that.handleUserList()
|
|
||||||
that.handleBannerList()
|
|
||||||
}
|
|
||||||
// #endif
|
|
||||||
// #ifndef APP-PLUS
|
|
||||||
that.handleoginversion()
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
uni.onBluetoothAdapterStateChange(function(res) {
|
|
||||||
that.$store.commit("changeBluetooth", res.available);
|
|
||||||
})
|
|
||||||
that.onBLEConnectionStateChange()
|
|
||||||
},
|
|
||||||
onPullDownRefresh() {
|
|
||||||
let that = this
|
|
||||||
that.isShow = true
|
|
||||||
that.handleUserList()
|
|
||||||
that.onBLEConnectionStateChange()
|
|
||||||
uni.stopPullDownRefresh()
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
isConnected: function() {
|
|
||||||
let that = this
|
|
||||||
console.log("isConnected", that.isConnected)
|
|
||||||
if (!that.isConnected) {
|
|
||||||
that.textLink = "开始连接"
|
|
||||||
that.islink = -1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
isBluetoothTyle: function() {
|
|
||||||
let that = this
|
|
||||||
console.log("isBluetoothTyle", that.isBluetoothTyle)
|
|
||||||
if (!that.isBluetoothTyle) {
|
|
||||||
that.textLink = "开始连接"
|
|
||||||
that.islink = -1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
let that = this
|
|
||||||
console.log("onShow", uni.getStorageSync('isBle'))
|
|
||||||
uni.onBluetoothAdapterStateChange(function(res) {
|
|
||||||
that.$store.commit("changeBluetooth", res.available);
|
|
||||||
})
|
|
||||||
if (uni.getStorageSync('isBle') && uni.getStorageSync('isBle') == true) {
|
|
||||||
that.openBluetoothAdapter()
|
|
||||||
uni.setStorageSync('isBle', false)
|
|
||||||
console.log("首次添加玩用户后初始化蓝牙", uni.getStorageSync('isBle'))
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 是否登录
|
|
||||||
handleoginversion() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getloginversion({}).then(res => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
that.handleUserList()
|
|
||||||
that.handleBannerList()
|
|
||||||
} else {
|
|
||||||
uni.setStorageSync('token', null)
|
|
||||||
uni.setStorageSync('aan_id', null)
|
|
||||||
uni.clearStorageSync()
|
|
||||||
uni.reLaunch({
|
|
||||||
url: "/pageTwo/login/login"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
// 成员列表
|
|
||||||
handleUserList() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getUserList({
|
|
||||||
type: 2
|
|
||||||
}).then(res => {
|
|
||||||
that.isShow = true
|
|
||||||
console.log("用户列表", res, uni.getStorageSync('userid'))
|
|
||||||
if (res.code != 0) {
|
|
||||||
that.$tools.msg(res.msg)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
that.$store.commit('changeFamilay', res.data)
|
|
||||||
if (res.data.length) {
|
|
||||||
let userid = ""
|
|
||||||
if (uni.getStorageSync('userid')) {
|
|
||||||
let found = res.data.find(e => e.id == uni.getStorageSync('userid'));
|
|
||||||
if (found !== undefined) {
|
|
||||||
userid = found.id
|
|
||||||
} else {
|
|
||||||
userid = res.data[0].id
|
|
||||||
uni.setStorageSync('userid', res.data[0].id)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
userid = res.data[0].id
|
|
||||||
uni.setStorageSync('userid', res.data[0].id)
|
|
||||||
}
|
|
||||||
console.log("正确userid", userid)
|
|
||||||
that.$store.dispatch('getUserInfo', {
|
|
||||||
aud_id: userid
|
|
||||||
})
|
|
||||||
that.$store.dispatch("getResult", {
|
|
||||||
aud_id: userid
|
|
||||||
})
|
|
||||||
that.handleLabelList(userid)
|
|
||||||
that.handlePublicRecord(userid)
|
|
||||||
that.openBluetoothAdapter()
|
|
||||||
}
|
|
||||||
}).catch(err => {})
|
|
||||||
},
|
|
||||||
// 公共卡片列表
|
|
||||||
handleLabelList(id) {
|
|
||||||
let that = this
|
|
||||||
that.$model.getLabelList({
|
|
||||||
aud_id: id
|
|
||||||
}).then(res => {
|
|
||||||
console.log("公共卡片项目", res)
|
|
||||||
if (res.code == 0) {
|
|
||||||
that.$store.commit('changeLabelList', res.data)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 公共手动记录内容
|
|
||||||
handlePublicRecord(id) {
|
|
||||||
let that = this
|
|
||||||
that.$model.getPublicRecord({
|
|
||||||
aud_id: id
|
|
||||||
}).then(res => {
|
|
||||||
console.log("公共手动记录", res)
|
|
||||||
if (res.code == 0) {
|
|
||||||
that.$store.commit('changePublicRecord', res.data)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// banner
|
|
||||||
handleBannerList() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getBannerList({}).then(res => {
|
|
||||||
if (res.code != 0) {
|
|
||||||
that.$tools.msg(res.msg)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
that.notices = res.data.notice
|
|
||||||
that.banner = res.data.banner
|
|
||||||
that.pop = res.data.pop
|
|
||||||
that.isCoupon = res.data.pop.length ? true : false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
detail(ite) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/webview/webview?id=" + ite.id + '&url=' + ite.jump_url
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 设置数据页卡片
|
|
||||||
handleCard() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/cardList/card"
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleTool(ind, path) {
|
|
||||||
let that = this
|
|
||||||
if (ind == 8) {
|
|
||||||
that.handlerRecord(2)
|
|
||||||
} else {
|
|
||||||
that.navTo(path)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 报告页
|
|
||||||
handlerReport(item) {
|
|
||||||
console.log("item", item)
|
|
||||||
let device = item.device_determine ? 1 : 0
|
|
||||||
uni.navigateTo({
|
|
||||||
url: item.page_url_report + "?acd_id=" + item.acd_id + '&device=' + device
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 手动添加
|
|
||||||
handlerRecord(id) {
|
|
||||||
this.rtype = id
|
|
||||||
this.$store.commit('changeRecord', true)
|
|
||||||
},
|
|
||||||
// 添加成员
|
|
||||||
handleAddUser() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/my/userInfo"
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleToggleTop(item, index) {
|
|
||||||
this.infoListTop = item
|
|
||||||
this.activeHeight = index
|
|
||||||
},
|
|
||||||
navTo(url) {
|
|
||||||
console.log("url", url)
|
|
||||||
uni.navigateTo({
|
|
||||||
url: url
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 初始化蓝牙
|
|
||||||
openBluetoothAdapter() {
|
|
||||||
let that = this
|
|
||||||
that.devicesList = []
|
|
||||||
uni.openBluetoothAdapter({
|
|
||||||
success: e => {
|
|
||||||
that.islink = 0
|
|
||||||
that.textLink = "蓝牙搜索中"
|
|
||||||
console.log("蓝牙初始化成功")
|
|
||||||
that.startBluetoothDeviceDiscovery()
|
|
||||||
},
|
|
||||||
fail: err => {
|
|
||||||
that.islink = -1
|
|
||||||
that.textLink = that.$tools.getBluetoothAdapter(err)
|
|
||||||
console.log('初始化蓝牙失败:' + err);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 开始搜寻附近的蓝牙外围设备
|
|
||||||
startBluetoothDeviceDiscovery() {
|
|
||||||
let that = this
|
|
||||||
uni.startBluetoothDevicesDiscovery({
|
|
||||||
allowDuplicatesKey: true, //是否允许重复上报同一设备
|
|
||||||
interval: 200,
|
|
||||||
success: res => {
|
|
||||||
console.log("搜索设备")
|
|
||||||
that.onBluetoothDeviceFound();
|
|
||||||
},
|
|
||||||
fail: res => {}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 发现外围设备
|
|
||||||
*/
|
|
||||||
onBluetoothDeviceFound() {
|
|
||||||
var that = this;
|
|
||||||
uni.onBluetoothDeviceFound(res => {
|
|
||||||
res.devices.forEach(device => {
|
|
||||||
console.log("name",device.name)
|
|
||||||
if (!device.name && !device.localName) {
|
|
||||||
device.advertisData = device.advertisData ? device.advertisData : ''
|
|
||||||
let value = that.$tools.ab2hex(device.advertisData, "")
|
|
||||||
let type = value.substring(0, 2)
|
|
||||||
let id = value.substring(12, 16)
|
|
||||||
if (type.toLowerCase() == 'c0') {
|
|
||||||
console.log(value, "id", id)
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.deviceName = "c00002"
|
|
||||||
device.deviceId = device.deviceId
|
|
||||||
that.handleDevice(device)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (device.name.indexOf("G02") != -1) {
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.deviceId = device.deviceId;
|
|
||||||
that.$Bluetooth.stopBluetoothDevicesDiscovery()
|
|
||||||
that.handleDevice(device)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (device.name.indexOf("Chipsea_BLE") != -1) {
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.deviceId = device.deviceId;
|
|
||||||
that.$Bluetooth.stopBluetoothDevicesDiscovery()
|
|
||||||
that.handleDevice(device)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (device.name.indexOf('YPC') != -1) {
|
|
||||||
clearTimeout(myTime);
|
|
||||||
device.deviceId = device.deviceId
|
|
||||||
that.$Bluetooth.stopBluetoothDevicesDiscovery()
|
|
||||||
that.handleDevice(device)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (device.name.toLowerCase().indexOf('da') != -1) {
|
|
||||||
clearTimeout(myTime);
|
|
||||||
device.deviceId = device.deviceId
|
|
||||||
that.handleDevice(device)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (device.name.toLowerCase().indexOf('pcl') != -1 || (device.localName && device
|
|
||||||
.localName.toLowerCase().indexOf('pcl') != -1)) {
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.deviceName = device.name
|
|
||||||
that.deviceId = device.deviceId;
|
|
||||||
that.handleDevice(device)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
that.handleMyTime()
|
|
||||||
},
|
|
||||||
handleDevice(device) {
|
|
||||||
let that = this
|
|
||||||
const foundDevices = that.devicesList
|
|
||||||
const idx = that.$tools.inArray(foundDevices, "deviceId", device.deviceId)
|
|
||||||
console.log("1111111", device.name)
|
|
||||||
if (idx === -1) {
|
|
||||||
// 体脂秤
|
|
||||||
if (device.name.toLowerCase().indexOf("pcl") != -1) {
|
|
||||||
that.devicesList.push(device)
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/devices/PCL?deviceId=" + device.deviceId
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 思迈德协议,假阻抗,体脂秤
|
|
||||||
if (that.deviceName == "c00002") {
|
|
||||||
that.devicesList.push(device)
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/devices/PCL22?deviceId=" + device.deviceId
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 思迈德协议,假阻抗,体脂秤
|
|
||||||
if (device.name.toLowerCase() == "da") {
|
|
||||||
that.devicesList.push(device)
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/devices/PCL22S?deviceId=" + device.deviceId
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 身高仪
|
|
||||||
if (device.name.indexOf("G02") != -1) {
|
|
||||||
that.devicesList.push(device)
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/devices/G02?deviceId=" + device.deviceId
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 跳绳
|
|
||||||
if (device.name.indexOf("YPC") != -1) {
|
|
||||||
that.devicesList.push(device)
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/skiping/skip?deviceId=" + device.deviceId
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 婴儿秤
|
|
||||||
if (device.name.indexOf("Chipsea_BLE") != -1) {
|
|
||||||
that.devicesList.push(device)
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/devices/B20?deviceId=" + device.deviceId
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleMyTime() {
|
|
||||||
var that = this;
|
|
||||||
myTime = setTimeout(function() {
|
|
||||||
if (!that.devicesList.length) {
|
|
||||||
that.islink = -1
|
|
||||||
that.textLink = "未搜索到有效设备,重新搜索"
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.$Bluetooth.stopBluetoothDevicesDiscovery()
|
|
||||||
}
|
|
||||||
}, 50000);
|
|
||||||
},
|
|
||||||
// 从广播秤返回后更改蓝牙状态
|
|
||||||
getBlereload() {
|
|
||||||
let that = this
|
|
||||||
that.islink = -1
|
|
||||||
that.textLink = "重新测量"
|
|
||||||
},
|
|
||||||
// 监听蓝牙连接状态
|
|
||||||
onBLEConnectionStateChange() {
|
|
||||||
let that = this
|
|
||||||
uni.onBLEConnectionStateChange(function(res) {
|
|
||||||
console.log("监听蓝牙连接状态", res.connected)
|
|
||||||
that.$store.commit("changeConnected", res.connected);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 断开蓝牙模块
|
|
||||||
*/
|
|
||||||
closeBluetoothAdapter() {
|
|
||||||
let that = this;
|
|
||||||
uni.closeBluetoothAdapter({
|
|
||||||
success: res => {
|
|
||||||
console.log('蓝牙模块关闭成功');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 断开蓝牙连接
|
|
||||||
*/
|
|
||||||
closeBLEConnection() {
|
|
||||||
var that = this;
|
|
||||||
uni.closeBLEConnection({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: res => {
|
|
||||||
console.log('断开蓝牙连接成功');
|
|
||||||
that.$store.commit("changeConnected", false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
@import "@/scss/body.scss";
|
|
||||||
|
|
||||||
/deep/.header {
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.top {
|
|
||||||
color: #fff;
|
|
||||||
background: $maincolor ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/deep/.cityList {
|
|
||||||
margin-top: -36px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list {
|
|
||||||
margin-top: 0rpx;
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.blueBtn {
|
|
||||||
color: #fff;
|
|
||||||
padding: 5px !important;
|
|
||||||
background-color: #2397f1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.orangeBtn {
|
|
||||||
color: #fff;
|
|
||||||
padding: 5px !important;
|
|
||||||
background-color: #FF974C;
|
|
||||||
}
|
|
||||||
|
|
||||||
.border {
|
|
||||||
border-bottom: 1px solid #f7f7f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.target {
|
|
||||||
height: 40px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
position: relative;
|
|
||||||
z-index: 99;
|
|
||||||
|
|
||||||
.bold {
|
|
||||||
width: 45%;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btnGroup {
|
|
||||||
width: 50%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
position: relative;
|
|
||||||
z-index: 99;
|
|
||||||
}
|
|
||||||
|
|
||||||
.size32 {
|
|
||||||
font-size: 80rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card {
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.boxBg {
|
|
||||||
width: 250rpx;
|
|
||||||
height: 215rpx;
|
|
||||||
position: absolute;
|
|
||||||
right: 15px;
|
|
||||||
z-index: 9;
|
|
||||||
bottom: -50rpx;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.content {
|
|
||||||
min-height: 100vh;
|
|
||||||
padding-bottom: 15px;
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bleTips {
|
|
||||||
height: 35px;
|
|
||||||
line-height: 35px;
|
|
||||||
margin: 15px 10px 10px;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 10px;
|
|
||||||
text-align: center;
|
|
||||||
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bleTips2 {
|
|
||||||
background: #fea606;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 工具
|
|
||||||
.tools_l {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
padding-top: 15px;
|
|
||||||
background: #fff;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.list {
|
|
||||||
width: 20%;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 14px;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
|
|
||||||
.text {
|
|
||||||
margin-top: 5px;
|
|
||||||
color: #666;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 35px;
|
|
||||||
height: 35px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.activeHeight {
|
|
||||||
padding-bottom: 10px;
|
|
||||||
border-bottom: 2px solid $maincolor;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,102 +0,0 @@
|
||||||
<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="'lung'+index"
|
|
||||||
:Width="340" :Height="250" :animation="false"
|
|
||||||
:opts="{enableScroll:true,xAxis:{scrollShow:false,itemCount:3}}" :ontouch="true" />
|
|
||||||
</view>
|
|
||||||
<view class="nolist" v-else>
|
|
||||||
<image src="../../static/none.png"></image>
|
|
||||||
<text>暂无数据,请手动添加~</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</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>
|
|
||||||
|
|
@ -1,130 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<!-- -->
|
|
||||||
<view class="skiptop">
|
|
||||||
<!-- <view class="status" @click="$Bluetooth.handleDevicesMac(isdevice,acd_id)"><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">
|
|
||||||
<view class="time">{{info?info.time:''}}</view>
|
|
||||||
<!-- <view class="LiuS">吸气速度 <text class="cgreen ml-5">{{info?info.flow_val:'--'}}L/min</text></view> -->
|
|
||||||
<view class="item">
|
|
||||||
<view class="image">
|
|
||||||
<image src="../../static/bae.png" mode="widthFix"></image>
|
|
||||||
</view>
|
|
||||||
<view class="center mt-15">
|
|
||||||
<view class="level"></view>
|
|
||||||
<view class="level level-bg" :style="{'top':info?Number(100 - info.offset)+'%':'100%'}"></view>
|
|
||||||
<view class="level-item" v-if="info">
|
|
||||||
<view class="ite" v-for="(ite,ind) in info.list" :style="{'height':100/info.list.length+'%'}">
|
|
||||||
{{ite.text}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="val" v-if="info">
|
|
||||||
<text>{{info.average}}</text>
|
|
||||||
吸气肺活量平均值
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- -->
|
|
||||||
<view class="gridList">
|
|
||||||
<view class="data">
|
|
||||||
<view class="item" @click="navTo('/pages/lunging/charts')">
|
|
||||||
<view class="image">
|
|
||||||
<image src="../../static/charts.png"></image>
|
|
||||||
</view>
|
|
||||||
<view class="name">运动曲线</view>
|
|
||||||
</view>
|
|
||||||
<view class="item" @click="navTo('/pageTwo/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('/pageTwo/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 '@/element/manuallyAdd/record.vue';
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
LiuS: 0,
|
|
||||||
acd_id: 8,
|
|
||||||
isdevice: true,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
record
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["MeasureLung"]),
|
|
||||||
info() {
|
|
||||||
return this.MeasureLung
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
let that = this
|
|
||||||
that.acd_id = options.acd_id
|
|
||||||
that.isdevice = options.device
|
|
||||||
that.$store.dispatch("getLungResult", {
|
|
||||||
aud_id: uni.getStorageSync('userid')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onPullDownRefresh() {
|
|
||||||
let that = this
|
|
||||||
that.$store.dispatch("getLungResult", {
|
|
||||||
aud_id: uni.getStorageSync('userid')
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.stopPullDownRefresh()
|
|
||||||
}, 1000);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 历史数据删除时重新加载接口
|
|
||||||
reload() {
|
|
||||||
let that = this
|
|
||||||
console.log('重新加载');
|
|
||||||
this.$nextTick(() => {
|
|
||||||
that.$store.dispatch("getLungResult", {
|
|
||||||
aud_id: uni.getStorageSync('userid')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
navTo(url) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: url
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
@import "@/scss/lunging.scss";
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,16 +1,19 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<!-- 头部 -->
|
<!-- 头部 -->
|
||||||
<view class="top" @click="navTo('/pageTwo/setting/setting')">
|
<view class="top" v-if="token" @click="navTo('/pageTwo/setting/setting')">
|
||||||
<view class="headimg">
|
<view class="headimg">
|
||||||
<image :src="user.head_pic" class="image"></image>
|
<image :src="user.head_pic" class="image"></image>
|
||||||
<view class="size20 bold">{{user.nickname}}</view>
|
<view class="size20 bold">{{user.nickname}}</view>
|
||||||
</view>
|
</view>
|
||||||
<text class="t-icon t-icon-arrow-right-bold"></text>
|
<text class="t-icon t-icon-arrow-right-bold"></text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="top" v-else @click="handleLogin">
|
||||||
|
登录后查看更多
|
||||||
|
</view>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<view class="wxlist borderRadius">
|
<view class="wxlist borderRadius">
|
||||||
<view class="list" @click="navTo('/pageTwo/my/manage')">
|
<view class="list" @click="navTo('/body/my/manage')">
|
||||||
<view class="item border-bottom">
|
<view class="item border-bottom">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="name">成员管理</view>
|
<view class="name">成员管理</view>
|
||||||
|
|
@ -20,20 +23,31 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list" @click="navTo('/pageTwo/business/business')">
|
|
||||||
|
<view class="list" @click="navTo('/body/history/history')">
|
||||||
<view class="item border-bottom">
|
<view class="item border-bottom">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="name">设备管理</view>
|
<view class="name">测量记录</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<uni-icons type="right"></uni-icons>
|
<uni-icons type="right"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list" @click="navTo('/pageTwo/score/history')">
|
<view class="list" @click="navTo('/Food/me/mymenu?pageName=我的收藏')">
|
||||||
<view class="item border-bottom">
|
<view class="item border-bottom">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="name">估分历史</view>
|
<view class="name">我的收藏</view>
|
||||||
|
</view>
|
||||||
|
<view class="right">
|
||||||
|
<uni-icons type="right"></uni-icons>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="list" @click="navTo('/Food/me/record')">
|
||||||
|
<view class="item border-bottom">
|
||||||
|
<view class="left">
|
||||||
|
<view class="name">饮食记录</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<uni-icons type="right"></uni-icons>
|
<uni-icons type="right"></uni-icons>
|
||||||
|
|
@ -41,7 +55,7 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- #ifdef APP-PLUS -->
|
<!-- #ifdef APP-PLUS -->
|
||||||
<view class="list" @click="navTo('/pageTwo/my/about')">
|
<view class="list" @click="navTo('/body/my/about')">
|
||||||
<view class="item border-bottom">
|
<view class="item border-bottom">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="name">关于我们</view>
|
<view class="name">关于我们</view>
|
||||||
|
|
@ -53,7 +67,7 @@
|
||||||
</view>
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<view class="list" v-for="(ite,ind) in CooperationUrl" :key="ind">
|
<view class="list" v-for="(ite,ind) in CooperationUrl" :key="ind">
|
||||||
<view class="item border-bottom" @click="navTo('/pageTwo/webview/webview?url=' + ite.url)">
|
<view class="item border-bottom" @click="navTo('/body/webview/webview?url=' + ite.url)">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="name">{{ite.title}}</view>
|
<view class="name">{{ite.title}}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -83,7 +97,7 @@
|
||||||
headerIndex
|
headerIndex
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["accountNumber", "familayList", "CooperationUrl"]),
|
...mapState(["accountNumber", "familayList", "CooperationUrl",]),
|
||||||
nickname() {
|
nickname() {
|
||||||
return this.accountNumber.nickname
|
return this.accountNumber.nickname
|
||||||
},
|
},
|
||||||
|
|
@ -137,7 +151,7 @@
|
||||||
uni.setStorageSync('aan_id', null)
|
uni.setStorageSync('aan_id', null)
|
||||||
uni.clearStorageSync()
|
uni.clearStorageSync()
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: "/pageTwo/login/login"
|
url: "/body/login/login"
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else if (res.cancel) {
|
} else if (res.cancel) {
|
||||||
|
|
@ -146,7 +160,18 @@
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
handleLogin() {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: "/body/login/login"
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
navTo(url) {
|
navTo(url) {
|
||||||
|
let that = this
|
||||||
|
if (!that.token) {
|
||||||
|
that.$tools.msg("登录后查看更多!")
|
||||||
|
return
|
||||||
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url
|
url
|
||||||
})
|
})
|
||||||
|
|
@ -163,6 +188,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.top {
|
.top {
|
||||||
|
width: calc(100% - 20px);
|
||||||
height: auto;
|
height: auto;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
|
@ -193,20 +219,22 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.wxlist {
|
.wxlist {
|
||||||
|
width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
margin-top: 15px;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 10px;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
width: auto;
|
width: auto;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
line-height: 45px;
|
line-height: 50px;
|
||||||
height: 45px;
|
height: 50px;
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-top: 15px;
|
|
||||||
background: #fff;
|
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
border-radius: 10px;
|
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
|
@ -226,8 +254,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
width: auto;
|
width: 100%;
|
||||||
background: $btncolor;
|
background: $btncolor;
|
||||||
margin: 50px 15px 0 15px;
|
margin: 50px 0px 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,541 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<!-- 头部 -->
|
|
||||||
<headerIndex @getAciveCity="getAciveCity" v-if="!isRefresh"></headerIndex>
|
|
||||||
<!-- 估分 -->
|
|
||||||
<view class="box">
|
|
||||||
<view class="title bold">本次估分成绩为</view>
|
|
||||||
<view class="charts mt-15">
|
|
||||||
<qiun-data-charts type="arcbar" :chartData="chartData" :Height="140" :Width="140" :canvas2d="true" />
|
|
||||||
<view class="name">{{score?score:'--'}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="btn history" @click="navTo('/pageTwo/score/history')">估分历史</view>
|
|
||||||
<view class="title bold Max_score" v-if="Max_score">该地区体育总成绩为:{{Max_score}}分</view>
|
|
||||||
|
|
||||||
<view class="Lastdata" @click="getList(1)">上次数据</view>
|
|
||||||
</view>
|
|
||||||
<!-- -->
|
|
||||||
<view v-if="selectllist.length">
|
|
||||||
<view v-for="(item,index) in selectllist">
|
|
||||||
<view class="titleName bold mt-15 ml-15 size16">{{item.name}}</view>
|
|
||||||
<view class="indexCarList">
|
|
||||||
<view class="card" v-for="(ite,ind) in item.list">
|
|
||||||
<view class="title">
|
|
||||||
<view class="name ">{{ite.name}}</view>
|
|
||||||
<!-- <view class="right" v-if="ite.is_choice!=0&&!isresult" @click="handleHistory(ite)">选择项目
|
|
||||||
</view> -->
|
|
||||||
</view>
|
|
||||||
<!-- 列表 -->
|
|
||||||
<view class="item3" v-for="(it,ik) in ite.list" :key="ik" v-if="!isresult">
|
|
||||||
<!-- 单选 -->
|
|
||||||
<uni-icons :type="it.choice_state==1?'circle-filled':'circle'"
|
|
||||||
:color="it.choice_state==1?'#FEC407':'#dfdfdf'" size="22"
|
|
||||||
v-if="Number(ite.is_choice)>=1" @click="handleActiveState(ite,it,ik)"></uni-icons>
|
|
||||||
|
|
||||||
|
|
||||||
<view class="name" @click="handleTips(it.describe)">
|
|
||||||
<text>{{it.name}}</text>
|
|
||||||
<uni-icons type="info" color="#f0ad4e" size="20" v-if="it.describe"></uni-icons>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="weight">
|
|
||||||
<view class="input">
|
|
||||||
<!-- 整数类型 -->
|
|
||||||
<input type="number" v-model="it.value" confirm-type="done" placeholder="请输入"
|
|
||||||
v-if="it.type ==1" :style="{'color':it.inputStyle}"
|
|
||||||
@input="changeDisabled(it)" />
|
|
||||||
<!-- 小数类型 -->
|
|
||||||
<input type="digit" v-model="it.value" confirm-type="done" placeholder="请输入"
|
|
||||||
maxlength="4" v-else-if="it.type ==2||it.type ==3"
|
|
||||||
:style="{'color':it.inputStyle}" @input="changeDisabled(it)" />
|
|
||||||
<!-- 分秒类型 -->
|
|
||||||
<picker mode="multiSelector" :range="timeList" @change="bindTimeChange($event,it)"
|
|
||||||
v-else-if="it.type ==4" :style="{'color':it.inputStyle}"
|
|
||||||
@input="changeDisabled(it)">
|
|
||||||
<view>{{it.value?it.value:'请选择'}}</view>
|
|
||||||
<uni-icons type="down" color="#999" size="20" class="down"></uni-icons>
|
|
||||||
</picker>
|
|
||||||
<uni-icons type="clear" color="#999" v-if="it.value &&it.type !='4'"
|
|
||||||
@click="handleValue(it)" size="24" class="uni-icons"></uni-icons>
|
|
||||||
</view>
|
|
||||||
<text :style="{'color':it.inputStyle}" @input="changeDisabled(it)">{{it.unit}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 结果展示 -->
|
|
||||||
<view class="result item3" v-for="(ita,idx) in ite.list" :key="idx"
|
|
||||||
v-if="isresult&&ite.list.length>1">
|
|
||||||
<view class="name">{{ita.name}}</view>
|
|
||||||
<view class="weight">
|
|
||||||
<view style="width: 40%;">{{ita.value?ita.value:'-'}}</view>
|
|
||||||
<view class="cblue bold">{{ita.proportion_value?ita.proportion_value:'-'}}</view>
|
|
||||||
<view class="cblue bold">{{ita.total_score?ita.total_score:'-'}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="gfbtn" v-if="isSports" @click="handleNewScore()">重新估分</view>
|
|
||||||
<view class="gfbtn" @click="handlescore()" v-else>开始估分</view>
|
|
||||||
</view>
|
|
||||||
<!-- -->
|
|
||||||
<view class="nolist" v-else>
|
|
||||||
<image src="../../static/none.png"></image>
|
|
||||||
<text>{{msg}}</text>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 占比 -->
|
|
||||||
<uslider></uslider>
|
|
||||||
<!-- 弹框 -->
|
|
||||||
<view class="wrapper" v-if="isDrawe">
|
|
||||||
<view class="bg" @click="onTap"></view>
|
|
||||||
|
|
||||||
<!-- 单选 -->
|
|
||||||
<view class="edit" @click.stop>
|
|
||||||
<view class="title">请选择<text class="choice">({{List.length}}选{{choice}})</text></view>
|
|
||||||
<view class="item" v-for="(item, index) in List" :key="index" @click="toggle(item)">
|
|
||||||
<!-- d单选 -->
|
|
||||||
<uni-icons :type="isActive.name==item.name?'circle-filled':'circle'" size="22"
|
|
||||||
:color="isActive.name==item.name?'#FEC407':'#dfdfdf'" v-if="choice==1"></uni-icons>
|
|
||||||
|
|
||||||
<!-- 多选 -->
|
|
||||||
<uni-icons :type="isActiveNameList.indexOf(item.name)!=-1?'checkbox-filled':'circle'" size="22"
|
|
||||||
:color="isActiveNameList.indexOf(item.name)!=-1?'#FEC407':'#dfdfdf'"
|
|
||||||
v-if="choice>1"></uni-icons>
|
|
||||||
|
|
||||||
<view class="name">
|
|
||||||
<view class="overflow">
|
|
||||||
{{item.name}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="btn close" @click="onTap">取消</view>
|
|
||||||
<view class="btn" @click="handleTarget">确定</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- -->
|
|
||||||
<!-- #ifndef APP-PLUS -->
|
|
||||||
<view class="uni-stat-tooltip" v-if="isTips">
|
|
||||||
{{tips}}
|
|
||||||
</view>
|
|
||||||
<!-- #endif -->
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import uslider from "@/element/slider-fraction.vue";
|
|
||||||
import headerIndex from "@/element/headerIndex.vue";
|
|
||||||
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue';
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
tips: "",
|
|
||||||
isTips: false,
|
|
||||||
chartData: {
|
|
||||||
series: [{
|
|
||||||
name: "正确率",
|
|
||||||
color: "#4687F9",
|
|
||||||
data: 0.8
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
sportsList: [],
|
|
||||||
List: [],
|
|
||||||
score: 0,
|
|
||||||
Max_score: 0,
|
|
||||||
isDrawe: false,
|
|
||||||
selectllist: [],
|
|
||||||
isActive: {},
|
|
||||||
isActiveList: [],
|
|
||||||
isActiveNameList: [],
|
|
||||||
region_list: {},
|
|
||||||
timeList: [],
|
|
||||||
timesTndex: [0, 0],
|
|
||||||
isSports: false,
|
|
||||||
msg: "暂无信息",
|
|
||||||
address: "",
|
|
||||||
isresult: false,
|
|
||||||
choice: 0,
|
|
||||||
isRefresh: false,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["user", "familayList"]),
|
|
||||||
userAddress() {
|
|
||||||
return this.user.address
|
|
||||||
},
|
|
||||||
userId() {
|
|
||||||
return this.user.id
|
|
||||||
},
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
uslider,
|
|
||||||
headerIndex,
|
|
||||||
qiunDataCharts
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
let that = this
|
|
||||||
that.score = 0
|
|
||||||
that.tips = ""
|
|
||||||
that.isTips = false
|
|
||||||
that.selectllist = []
|
|
||||||
that.sportsList = []
|
|
||||||
that.timeList = that.$tools.gethms()
|
|
||||||
if (that.familayList.length) {
|
|
||||||
that.address = that.user.address
|
|
||||||
that.getList(0)
|
|
||||||
}
|
|
||||||
console.log("onLoad")
|
|
||||||
},
|
|
||||||
onPullDownRefresh() {
|
|
||||||
let that = this
|
|
||||||
that.tips = ""
|
|
||||||
that.isTips = false
|
|
||||||
that.score = 0
|
|
||||||
that.choice = 0
|
|
||||||
that.Max_score = 0
|
|
||||||
that.selectllist = []
|
|
||||||
that.sportsList = []
|
|
||||||
that.isRefresh = true
|
|
||||||
that.timeList = that.$tools.gethms()
|
|
||||||
if (that.familayList.length) {
|
|
||||||
that.address = that.user.address
|
|
||||||
that.getList(0)
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
that.isRefresh = false
|
|
||||||
uni.stopPullDownRefresh()
|
|
||||||
}, 200);
|
|
||||||
console.log("刷新")
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
let that = this
|
|
||||||
// that.isresult = false
|
|
||||||
// that.isSports = false
|
|
||||||
that.tips = ""
|
|
||||||
that.isTips = false
|
|
||||||
if (!that.familayList.length) {
|
|
||||||
that.score = 0
|
|
||||||
that.Max_score = 0
|
|
||||||
that.selectllist = []
|
|
||||||
that.sportsList = []
|
|
||||||
that.isActiveList = []
|
|
||||||
that.isActiveNameList = []
|
|
||||||
that.chartData.series[0].data = 0.8
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
isTips() {
|
|
||||||
let that = this
|
|
||||||
if (that.isTips) {
|
|
||||||
setTimeout(() => {
|
|
||||||
that.isTips = false
|
|
||||||
}, 4000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getAciveCity(item) {
|
|
||||||
console.log("item", item)
|
|
||||||
let that = this
|
|
||||||
that.address = item
|
|
||||||
that.score = 0
|
|
||||||
that.isresult = false
|
|
||||||
that.selectllist = []
|
|
||||||
that.sportsList = []
|
|
||||||
that.isActiveList = []
|
|
||||||
that.isActiveNameList = []
|
|
||||||
that.getList(0)
|
|
||||||
},
|
|
||||||
//
|
|
||||||
getList(ind) {
|
|
||||||
let that = this
|
|
||||||
that.isresult = false
|
|
||||||
that.isSports = false
|
|
||||||
that.$model.getSportsListAll({
|
|
||||||
gender: uni.getStorageSync('gender'),
|
|
||||||
parameter_data: that.address,
|
|
||||||
aud_id: uni.getStorageSync('userid'),
|
|
||||||
choice_last_time: ind
|
|
||||||
}).then((res) => {
|
|
||||||
console.log("全部项目", res)
|
|
||||||
if (res.code != 0) {
|
|
||||||
that.msg = res.msg
|
|
||||||
return
|
|
||||||
}
|
|
||||||
res.data.forEach(item => {
|
|
||||||
item.list.forEach(list => {
|
|
||||||
list.list.forEach(val => {
|
|
||||||
val.inputStyle = "#999"
|
|
||||||
if (list.is_choice == 2 && val.choice_state == 1) {
|
|
||||||
that.isActiveList.push(val.name)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
that.score = 0
|
|
||||||
that.Max_score = 0
|
|
||||||
that.selectllist = res.data
|
|
||||||
that.chartData.series[0].data = 0.8
|
|
||||||
that.tips = ""
|
|
||||||
that.isTips = false
|
|
||||||
// that.handleSportsList()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 重新估分
|
|
||||||
handleNewScore() {
|
|
||||||
let that = this
|
|
||||||
that.isActive = {}
|
|
||||||
that.selectllist = []
|
|
||||||
that.sportsList = []
|
|
||||||
that.isActiveList = []
|
|
||||||
that.isActiveNameList = []
|
|
||||||
that.getList(0)
|
|
||||||
},
|
|
||||||
changeDisabled(item) {
|
|
||||||
item.inputStyle = '#333'
|
|
||||||
},
|
|
||||||
|
|
||||||
// 多项选择
|
|
||||||
handleActiveState(item, ite, ind) {
|
|
||||||
let that = this
|
|
||||||
// 单选
|
|
||||||
if (Number(item.is_choice) == 1) {
|
|
||||||
item.list.forEach(list => {
|
|
||||||
list.choice_state = 0
|
|
||||||
})
|
|
||||||
ite.choice_state = ite.choice_state == 1 ? 0 : 1
|
|
||||||
}
|
|
||||||
// 多选
|
|
||||||
let isActive = []
|
|
||||||
if (Number(item.is_choice) >= 2) {
|
|
||||||
if (that.isActiveList.indexOf(ite.name) == -1) {
|
|
||||||
that.isActiveList.push(ite.name);
|
|
||||||
} else {
|
|
||||||
that.isActiveList.splice(that.isActiveList.indexOf(ite.name), 1);
|
|
||||||
}
|
|
||||||
if (that.isActiveList.length > 2) {
|
|
||||||
that.isActiveList.splice(0, 1)
|
|
||||||
}
|
|
||||||
item.list.forEach(list => {
|
|
||||||
list.choice_state = 0
|
|
||||||
that.isActiveList.forEach(it => {
|
|
||||||
if (list.name == it) {
|
|
||||||
list.choice_state = 1
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
bindTimeChange(e, it) {
|
|
||||||
let that = this
|
|
||||||
let minute = e.target.value[0]
|
|
||||||
let second = e.target.value[1]
|
|
||||||
it.value = that.timeList[0][minute].substring(0, 2) + ':' + that.timeList[1][second].substring(
|
|
||||||
0, 2)
|
|
||||||
// console.log(e.target.value, it)
|
|
||||||
},
|
|
||||||
handleTips(text) {
|
|
||||||
if (text == null || text == '') return
|
|
||||||
// #ifndef APP-PLUS
|
|
||||||
this.tips = text
|
|
||||||
this.isTips = true
|
|
||||||
// #endif
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
uni.showToast({
|
|
||||||
title: text,
|
|
||||||
duration: 4000,
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
|
|
||||||
// 地区单个类型项目列表
|
|
||||||
handleSportsList() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getSportsList({
|
|
||||||
aud_id: uni.getStorageSync('userid'),
|
|
||||||
gender: uni.getStorageSync('gender'),
|
|
||||||
address: that.address
|
|
||||||
}).then((res) => {
|
|
||||||
console.log("单地区", res)
|
|
||||||
if (res.code != 0) return
|
|
||||||
that.sportsList = res.data.list
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleValue(item) {
|
|
||||||
item.value = ""
|
|
||||||
},
|
|
||||||
// 开始估分
|
|
||||||
handlescore() {
|
|
||||||
let that = this
|
|
||||||
if (!that.familayList.length) {
|
|
||||||
that.$tools.msg("请先添加成员")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
console.log("selectllist", that.selectllist)
|
|
||||||
that.selectllist.forEach(item => {
|
|
||||||
item.list.forEach(ite => {
|
|
||||||
ite.list.forEach(it => {
|
|
||||||
it.value = it.value == "" ? "0" : it.value
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
that.$model.getSportsData({
|
|
||||||
aud_id: uni.getStorageSync('userid'),
|
|
||||||
gender: uni.getStorageSync('gender'),
|
|
||||||
parameter_data: that.address,
|
|
||||||
result_data: that.selectllist,
|
|
||||||
}).then((res) => {
|
|
||||||
console.log("开始估分", res)
|
|
||||||
if (res.code != 0) {
|
|
||||||
that.$tools.msg(res.msg)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
that.isSports = true
|
|
||||||
that.isresult = true
|
|
||||||
that.selectllist = res.data.list
|
|
||||||
that.score = res.data.total_score
|
|
||||||
that.Max_score = res.data.max_score
|
|
||||||
that.chartData.series[0].data = Number(res.data.total_score) / res.data.max_score
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 项目项目
|
|
||||||
handleHistory(item) {
|
|
||||||
let that = this
|
|
||||||
that.List = []
|
|
||||||
that.region_list = item
|
|
||||||
that.sportsList.forEach(ite => {
|
|
||||||
if (ite.key == item.key) {
|
|
||||||
that.List = ite.list
|
|
||||||
that.choice = item.is_choice
|
|
||||||
}
|
|
||||||
})
|
|
||||||
console.log("添加项目", item)
|
|
||||||
that.isDrawe = true
|
|
||||||
},
|
|
||||||
// 选择项目
|
|
||||||
toggle(item) {
|
|
||||||
let that = this
|
|
||||||
// 单选
|
|
||||||
if (that.choice == 1) {
|
|
||||||
that.isActive = that.isActive.name == item.name ? {} : item
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 多选
|
|
||||||
if (that.isActiveNameList.indexOf(item.name) == -1) {
|
|
||||||
that.isActiveNameList.push(item.name)
|
|
||||||
that.isActiveList.push(item)
|
|
||||||
} else {
|
|
||||||
for (var n = 0; n < that.isActiveNameList.length; n++) {
|
|
||||||
if (item.name == that.isActiveNameList[n]) {
|
|
||||||
if (that.isActiveNameList.indexOf(item.name) == -1) {
|
|
||||||
that.isActiveNameList.push(item.name)
|
|
||||||
that.isActiveList.push(item);
|
|
||||||
}
|
|
||||||
that.isActiveNameList.splice(n, 1)
|
|
||||||
that.isActiveList.splice(n, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if (that.isActiveList.length > that.choice) {
|
|
||||||
that.isActiveList.splice(0, 1)
|
|
||||||
that.isActiveNameList.splice(0, 1)
|
|
||||||
}
|
|
||||||
console.log("isActiveList", item.name, that.isActiveList, that.region_list.list)
|
|
||||||
},
|
|
||||||
// 确定选择项目
|
|
||||||
handleTarget() {
|
|
||||||
let that = this
|
|
||||||
that.selectllist.forEach(item => {
|
|
||||||
item.list.forEach(it => {
|
|
||||||
if (it.key == that.region_list.key) {
|
|
||||||
it.list = []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
if (that.choice == 1) {
|
|
||||||
if (Object.keys(that.isActive).length != 0) {
|
|
||||||
that.region_list.list.push(that.isActive)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
that.region_list.list = that.isActiveList
|
|
||||||
}
|
|
||||||
that.isDrawe = false
|
|
||||||
},
|
|
||||||
// 取消选择
|
|
||||||
onTap() {
|
|
||||||
let that = this
|
|
||||||
// 单选
|
|
||||||
if (that.choice == 1) {
|
|
||||||
if (Object.keys(that.isActive).length == 0) {
|
|
||||||
that.region_list.list = []
|
|
||||||
that.selectllist.forEach(item => {
|
|
||||||
item.list.forEach(it => {
|
|
||||||
if (it.key == that.region_list.key) {
|
|
||||||
it.list = []
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
that.isDrawe = false
|
|
||||||
console.log("取消", Object.keys(that.isActive).length, this.isActive)
|
|
||||||
},
|
|
||||||
navTo(url) {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: url
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
@import "@/scss/score.scss";
|
|
||||||
|
|
||||||
.content {
|
|
||||||
min-height: 100vh;
|
|
||||||
padding-bottom: 15px;
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.Max_score {
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.Lastdata {
|
|
||||||
height: 35px;
|
|
||||||
line-height: 35px;
|
|
||||||
margin-top: 15px;
|
|
||||||
font-size: 28rpx;
|
|
||||||
padding: 0 10px;
|
|
||||||
background: #FEC407 !important;
|
|
||||||
border-radius: 10px;
|
|
||||||
color: #fff;
|
|
||||||
width: 30%;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.uni-stat-tooltip {
|
|
||||||
width: 80%;
|
|
||||||
height: auto;
|
|
||||||
overflow: scroll;
|
|
||||||
word-break: break-word;
|
|
||||||
position: fixed;
|
|
||||||
margin: auto;
|
|
||||||
background-color: rgba(0, 0, 0, 0.8);
|
|
||||||
color: #fff;
|
|
||||||
z-index: 999;
|
|
||||||
padding: 10px;
|
|
||||||
border-radius: 10px;
|
|
||||||
top: 33%;
|
|
||||||
left: 10%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,103 +0,0 @@
|
||||||
<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"
|
|
||||||
:Width="340" :Height="250" :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>
|
|
||||||
|
|
@ -1,771 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content skipping">
|
|
||||||
<!-- -->
|
|
||||||
<view class="skiptop">
|
|
||||||
<view class="status" @click="handleisSdevice()">
|
|
||||||
<text>{{textLink}}</text>
|
|
||||||
<image v-if="islink!=1" :class="[islink==-1?'':'icon_link']" src="../../static/zhuan.png"></image>
|
|
||||||
<image v-if="islink==1" src="../../static/dui.png"></image>
|
|
||||||
</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=3" :class="[active==3?'active':'']">倒计数</view>
|
|
||||||
<view @click="active=2" :class="[active==2?'active':'']">倒计时</view>
|
|
||||||
</view>
|
|
||||||
<!--自由训练 -->
|
|
||||||
<view class="box1 box" v-if="active==1">
|
|
||||||
<view class="item">
|
|
||||||
<text class="item-set item-set0">自由</text>
|
|
||||||
<text class="tips">无限制</text>
|
|
||||||
</view>
|
|
||||||
<view :class="[islink==1?'start':'start Nstart']" @click="handleStart(1)">开始</view>
|
|
||||||
<!-- <view class="item">
|
|
||||||
<text class="item-ite">本次时长</text>
|
|
||||||
<text class="bold">{{info?info.last_jump_time:'0'}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<text class="item-ite">消耗卡路里</text>
|
|
||||||
<text class="bold">{{info?info.last_jump_kcal:'0'}}</text>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
|
||||||
<!--定时训练 -->
|
|
||||||
<view class="box1 box" v-if="active==2">
|
|
||||||
<view class="item">
|
|
||||||
<view class="item-set">
|
|
||||||
<text @click="handleTimeEdit('减')">-</text>
|
|
||||||
<text>{{time_m}}:{{time_s}}</text>
|
|
||||||
<text @click="handleTimeEdit('加')">+</text>
|
|
||||||
</view>
|
|
||||||
<view class="tips">
|
|
||||||
<picker mode="multiSelector" :range="timeList" :value="timesTndex" @change="bindTimeChange">
|
|
||||||
<view>调整目标</view>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view :class="[isConnection?'start':'start Nstart']" @click="handleStart(2)">开始</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="item">
|
|
||||||
<view class="item-set">
|
|
||||||
<text @click="handleWeightEdit('减')">-</text>
|
|
||||||
<text v-if="!disabled">{{weight>50?weight:50}}</text>
|
|
||||||
<input type="number" v-model="weight" focus="true" v-else @blur="disabled=false">
|
|
||||||
<text @click="handleWeightEdit('加')">+</text>
|
|
||||||
</view>
|
|
||||||
<text class="tips" @click="disabled=true">调整目标</text>
|
|
||||||
</view>
|
|
||||||
<view :class="[isConnection?'start':'start Nstart']" @click="handleStart(3)">开始</view>
|
|
||||||
<!-- <view class="item">
|
|
||||||
<text class="item-ite">本次时长</text>
|
|
||||||
<text>0</text>
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<text class="item-ite">消耗卡路里</text>
|
|
||||||
<text>0</text>
|
|
||||||
</view> -->
|
|
||||||
</view>
|
|
||||||
<!-- -->
|
|
||||||
<view class="gridList">
|
|
||||||
<view class="data">
|
|
||||||
<view class="item" @click="navTo('/pages/skiping/charts')">
|
|
||||||
<view class="image">
|
|
||||||
<image src="@/static/charts.png"></image>
|
|
||||||
</view>
|
|
||||||
<view class="name">运动曲线</view>
|
|
||||||
</view>
|
|
||||||
<view class="item" @click="navTo('/pageTwo/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('/pageTwo/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>
|
|
||||||
let myTime;
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
import record from '@/element/manuallyAdd/record.vue';
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
active: 1,
|
|
||||||
acd_id: 6,
|
|
||||||
weight: 50,
|
|
||||||
disabled: false,
|
|
||||||
isDevice: 0,
|
|
||||||
isConnection: false,
|
|
||||||
time_m: "",
|
|
||||||
time_s: "",
|
|
||||||
timeList: [],
|
|
||||||
devicesList: [],
|
|
||||||
timesTndex: [1, 0],
|
|
||||||
deviceId: "",
|
|
||||||
serviceId: "",
|
|
||||||
write: "",
|
|
||||||
notify: "",
|
|
||||||
islink: 0, //0连接中,1成功,-1失败
|
|
||||||
textLink: ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
record
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(['user', "MeasureSkip", "isConnected", "isBluetoothTyle"]),
|
|
||||||
info() {
|
|
||||||
return this.MeasureSkip
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
let that = this
|
|
||||||
that.timeList = that.$tools.gethms()
|
|
||||||
that.time_m = that.timeList[0][1].substring(0, 2)
|
|
||||||
that.time_s = that.timeList[1][0].substring(0, 2)
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
let that = this
|
|
||||||
// 首页进入
|
|
||||||
if (options && options.deviceId) {
|
|
||||||
that.deviceId = options.deviceId
|
|
||||||
setTimeout(function() {
|
|
||||||
that.createBLEConnection()
|
|
||||||
}, 500)
|
|
||||||
}
|
|
||||||
if (options && options.acd_id) {
|
|
||||||
that.$Bluetooth.stopBluetoothDevicesDiscovery()
|
|
||||||
setTimeout(function() {
|
|
||||||
that.handleisSdevice()
|
|
||||||
}, 500)
|
|
||||||
}
|
|
||||||
that.$store.dispatch("getSkipResult", {
|
|
||||||
aud_id: uni.getStorageSync('userid')
|
|
||||||
})
|
|
||||||
that.isConnection = that.isConnected
|
|
||||||
that.onBLEConnectionStateChange()
|
|
||||||
uni.onBluetoothAdapterStateChange(function(res) {
|
|
||||||
that.$store.commit("changeBluetooth", res.available);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onPullDownRefresh() {
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.stopPullDownRefresh()
|
|
||||||
}, 1000);
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
let that = this
|
|
||||||
// 跳绳页返回
|
|
||||||
uni.$on('updateData', function(info) {
|
|
||||||
let data = JSON.parse(info)
|
|
||||||
that.acd_id = data.acd_id
|
|
||||||
that.isDevice = data.device
|
|
||||||
that.active = data.active
|
|
||||||
that.deviceId = data.deviceId
|
|
||||||
that.serviceId = data.serviceId
|
|
||||||
that.write = data.write
|
|
||||||
that.notify = data.notify
|
|
||||||
that.islink = !that.isConnected ? -1 : 1
|
|
||||||
that.isConnection = that.isConnected
|
|
||||||
that.notifyBLECharacteristicValue()
|
|
||||||
if (data.isSuccessful) {
|
|
||||||
that.$store.dispatch("getSkipResult", {
|
|
||||||
aud_id: uni.getStorageSync('userid')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
that.onBLEConnectionStateChange()
|
|
||||||
uni.onBluetoothAdapterStateChange(function(res) {
|
|
||||||
that.$store.commit("changeBluetooth", res.available);
|
|
||||||
})
|
|
||||||
console.log('监听到事件来自 updateData', data);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onUnload: function() {
|
|
||||||
let that = this
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.islink = -1
|
|
||||||
that.isConnection = false
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
uni.$off("updateData")
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.switchTab({
|
|
||||||
url: '/pages/home/home'
|
|
||||||
})
|
|
||||||
}, 300)
|
|
||||||
console.log("返回首页onUnload")
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
isConnected() {
|
|
||||||
let that = this
|
|
||||||
if (!that.isConnected) {
|
|
||||||
that.islink = -1
|
|
||||||
that.textLink = "重新连接"
|
|
||||||
}
|
|
||||||
that.isConnection = that.isConnected
|
|
||||||
console.log("蓝牙是否连接", that.isConnected)
|
|
||||||
},
|
|
||||||
isBluetoothTyle() {
|
|
||||||
let that = this
|
|
||||||
if (!that.isBluetoothTyle) {
|
|
||||||
that.isConnection = false
|
|
||||||
that.textLink = "请打开手机蓝牙"
|
|
||||||
that.islink = -1
|
|
||||||
}
|
|
||||||
console.log("蓝牙是否打开", that.isBluetoothTyle)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 初始化蓝牙
|
|
||||||
handleisSdevice() {
|
|
||||||
let that = this
|
|
||||||
if (that.isConnected) return
|
|
||||||
that.devicesList = []
|
|
||||||
that.$Bluetooth.stopBluetoothDevicesDiscovery()
|
|
||||||
uni.openBluetoothAdapter({
|
|
||||||
success: e => {
|
|
||||||
that.islink = 0
|
|
||||||
that.handleMyTime()
|
|
||||||
that.textLink = "蓝牙搜索中"
|
|
||||||
that.startBluetoothDeviceDiscovery()
|
|
||||||
that.$store.commit("changeBluetooth", true)
|
|
||||||
console.log('初始化蓝牙成功:' + e.errMsg);
|
|
||||||
},
|
|
||||||
fail: e => {
|
|
||||||
that.islink = -1
|
|
||||||
that.textLink = that.$tools.getBluetoothAdapter(e)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 开始搜寻附近的蓝牙外围设备
|
|
||||||
startBluetoothDeviceDiscovery() {
|
|
||||||
let that = this
|
|
||||||
uni.startBluetoothDevicesDiscovery({
|
|
||||||
allowDuplicatesKey: true,
|
|
||||||
interval: 200, //上报设备的间隔
|
|
||||||
services: [],
|
|
||||||
success: res => {
|
|
||||||
that.onBluetoothDeviceFound();
|
|
||||||
},
|
|
||||||
fail: res => {}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 发现外围设备
|
|
||||||
*/
|
|
||||||
onBluetoothDeviceFound() {
|
|
||||||
var that = this;
|
|
||||||
uni.onBluetoothDeviceFound(res => {
|
|
||||||
res.devices.forEach(device => {
|
|
||||||
if (!device.name && !device.localName) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (device.name.indexOf('YPC') != -1) {
|
|
||||||
device.deviceId = device.deviceId
|
|
||||||
that.deviceId = device.deviceId
|
|
||||||
that.$Bluetooth.stopBluetoothDevicesDiscovery()
|
|
||||||
that.handleDevice(device)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
that.handleMyTime()
|
|
||||||
},
|
|
||||||
handleDevice(device) {
|
|
||||||
let that = this
|
|
||||||
const foundDevices = that.devicesList
|
|
||||||
const idx = that.$tools.inArray(foundDevices, "deviceId", device.deviceId)
|
|
||||||
if (idx === -1) {
|
|
||||||
that.devicesList.push(device);
|
|
||||||
that.createBLEConnection()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 连接蓝牙
|
|
||||||
createBLEConnection() {
|
|
||||||
let that = this;
|
|
||||||
uni.createBLEConnection({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: res => {
|
|
||||||
that.textLink = "蓝牙连接中"
|
|
||||||
setTimeout(function() {
|
|
||||||
that.islink = 1
|
|
||||||
that.getBLEDeviceServices()
|
|
||||||
}, 1000)
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
that.textLink = "重新连接"
|
|
||||||
console.log("设备连接失败,请重新连接", res, that.deviceId);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 获取设备的UUID
|
|
||||||
*/
|
|
||||||
getBLEDeviceServices() {
|
|
||||||
let serviceList = [];
|
|
||||||
let that = this;
|
|
||||||
uni.getBLEDeviceServices({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: res => {
|
|
||||||
console.log("获取设备的UUID成功", res)
|
|
||||||
serviceList = res.services;
|
|
||||||
for (let i = 0; i < serviceList.length; i++) {
|
|
||||||
let service = serviceList[i];
|
|
||||||
if (service.uuid.indexOf("FFE0") != -1) {
|
|
||||||
that.serviceId = service.uuid;
|
|
||||||
that.isConnection = true
|
|
||||||
that.textLink = "连接成功"
|
|
||||||
that.getBLEDeviceCharacteristics();
|
|
||||||
console.log("设备的FFE0的serviceId: " + that.serviceId);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
console.log('获取设备的UUID失败:', res)
|
|
||||||
that.islink = -1
|
|
||||||
that.textLink = "重新连接"
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.isConnection = false
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取指定服务的特征值
|
|
||||||
*/
|
|
||||||
getBLEDeviceCharacteristics() {
|
|
||||||
let characteristicsList = [];
|
|
||||||
let that = this;
|
|
||||||
uni.getBLEDeviceCharacteristics({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
serviceId: that.serviceId,
|
|
||||||
success: res => {
|
|
||||||
console.log("服务的特征值成功", res)
|
|
||||||
// * 读read: true, //,写write: true, //,通知notify: true
|
|
||||||
for (let i = 0; i < res.characteristics.length; i++) {
|
|
||||||
let item = res.characteristics[i];
|
|
||||||
if (item.uuid.indexOf('0000FF12') != -1) {
|
|
||||||
that.write = item.uuid
|
|
||||||
|
|
||||||
} else if (item.uuid.indexOf('0000FFE4') != -1) {
|
|
||||||
that.notify = item.uuid
|
|
||||||
}
|
|
||||||
}
|
|
||||||
setTimeout(function() {
|
|
||||||
let j = Number(165 + 10 + 1 + 8 + 8 + 8 + 8 + 8 + 8).toString(16)
|
|
||||||
let str = "A50A01080808080808" + j.substr(j.length - 2, 2)
|
|
||||||
that.SendData(str)
|
|
||||||
}, 300)
|
|
||||||
// 体重
|
|
||||||
setTimeout(function() {
|
|
||||||
that.handleStart(4)
|
|
||||||
}, 600)
|
|
||||||
uni.notifyBLECharacteristicValueChange({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
serviceId: that.serviceId,
|
|
||||||
characteristicId: that.notify,
|
|
||||||
state: true,
|
|
||||||
})
|
|
||||||
uni.notifyBLECharacteristicValueChange({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
serviceId: that.serviceId,
|
|
||||||
characteristicId: that.write,
|
|
||||||
state: true,
|
|
||||||
})
|
|
||||||
that.notifyBLECharacteristicValue()
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
console.log('获取特征值失败:', JSON.stringify(res))
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
notifyBLECharacteristicValue() {
|
|
||||||
let that = this;
|
|
||||||
uni.notifyBLECharacteristicValueChange({
|
|
||||||
state: true, // 启用 notify 功能
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
serviceId: that.serviceId,
|
|
||||||
characteristicId: that.notify,
|
|
||||||
success(res) {
|
|
||||||
uni.onBLECharacteristicValueChange(function(res) {
|
|
||||||
let value = that.$tools.ab2hex(res.value, "");
|
|
||||||
if (value == '5a05090169') { //模式设置成功
|
|
||||||
let info = {
|
|
||||||
active: that.active,
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
serviceId: that.serviceId,
|
|
||||||
notify: that.notify,
|
|
||||||
write: that.write,
|
|
||||||
acd_id: that.acd_id,
|
|
||||||
isDevice: that.isDevice,
|
|
||||||
isSuccessful: false
|
|
||||||
}
|
|
||||||
setTimeout(function() {
|
|
||||||
uni.$off("updateData")
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/devices/PCT01?info=" + JSON
|
|
||||||
.stringify(info)
|
|
||||||
})
|
|
||||||
}, 200)
|
|
||||||
}
|
|
||||||
console.log("value", value, that.active)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 开启蓝牙主动上报模式
|
|
||||||
SendData(str) {
|
|
||||||
let that = this
|
|
||||||
let buf = new Uint8Array(str.match(/[\da-f]{2}/gi).map(function(h) {
|
|
||||||
return parseInt(h, 16)
|
|
||||||
}))
|
|
||||||
console.log("xiafa", str)
|
|
||||||
uni.writeBLECharacteristicValue({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
serviceId: that.serviceId,
|
|
||||||
characteristicId: that.write,
|
|
||||||
value: buf.buffer,
|
|
||||||
success: res => {
|
|
||||||
console.log('下发指令成功', res.errMsg)
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
console.log("下发指令失败", res);
|
|
||||||
},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 模式切换
|
|
||||||
handleStart(ind) {
|
|
||||||
let that = this
|
|
||||||
let m = null
|
|
||||||
let send = null
|
|
||||||
if (!that.isConnected) {
|
|
||||||
that.$tools.msg("请先连接设备!")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (ind == 1) { // 1自由
|
|
||||||
m = Number(165 + 8 + 9).toString(16)
|
|
||||||
send = "A5080900000000" + m.substr(m.length - 2, 2)
|
|
||||||
}
|
|
||||||
if (ind == 2) { //2定时
|
|
||||||
let time = Number(that.time_m) * 60 + Number(that.time_s)
|
|
||||||
m = Number(165 + 8 + 9 + time).toString(16)
|
|
||||||
send = "A508090000" + that.$tools.toHex(time, 4) + m.substr(m.length - 2, 2)
|
|
||||||
}
|
|
||||||
if (ind == 3) { //3定数
|
|
||||||
let weight = that.$tools.toHex(that.weight, 4)
|
|
||||||
m = Number(165 + 8 + 9 + that.weight).toString(16)
|
|
||||||
send = "A50809" + weight + "0000" + m.substr(m.length - 2, 2)
|
|
||||||
}
|
|
||||||
if (ind == 4) { //体重
|
|
||||||
|
|
||||||
let weight = Number(that.user.weight) * 2
|
|
||||||
let num = parseInt(weight).toString();
|
|
||||||
m = Number(165 + 5 + 8 + Number(num)).toString(16)
|
|
||||||
send = "A50508" + Number(num).toString(16) + m.substr(m.length - 2, 2)
|
|
||||||
}
|
|
||||||
that.SendData(send)
|
|
||||||
that.$Bluetooth.stopBluetoothDevicesDiscovery()
|
|
||||||
},
|
|
||||||
// 历史数据删除时重新加载接口
|
|
||||||
reload() {
|
|
||||||
let that = this
|
|
||||||
this.$nextTick(() => {
|
|
||||||
that.$store.dispatch("getSkipResult", {
|
|
||||||
aud_id: uni.getStorageSync('userid')
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 定时训练
|
|
||||||
//
|
|
||||||
bindTimeChange(e) {
|
|
||||||
let that = this
|
|
||||||
let m = e.target.value[0]
|
|
||||||
let s = e.target.value[1]
|
|
||||||
that.timesTndex = e.target.value
|
|
||||||
let time_m = Number(that.timeList[0][m].substring(0, 2)) * 60
|
|
||||||
let time_s = Number(that.timeList[1][s].substring(0, 2))
|
|
||||||
if (Number(time_m + time_s) < 30) {
|
|
||||||
that.time_m = '00'
|
|
||||||
that.time_s = '30'
|
|
||||||
} else {
|
|
||||||
that.time_m = that.timeList[0][m].substring(0, 2)
|
|
||||||
that.time_s = that.timeList[1][s].substring(0, 2)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handleTimeEdit(text) {
|
|
||||||
let that = this
|
|
||||||
let time_m = Number(that.time_m) * 60
|
|
||||||
let time_s = Number(that.time_s)
|
|
||||||
let minutes = null
|
|
||||||
let seconds = null
|
|
||||||
|
|
||||||
if (Number(time_m + time_s) >= 3570 && text == '加') {
|
|
||||||
that.time_m = '59'
|
|
||||||
that.time_s = '59'
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (Number(time_m + time_s) <= 30 && text == '减') {
|
|
||||||
that.time_m = '00'
|
|
||||||
that.time_s = '30'
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (text == '减') {
|
|
||||||
minutes = Math.floor((Number(time_m + time_s - 30) % 3600) / 60)
|
|
||||||
seconds = Number(time_m + time_s - 30) % 60
|
|
||||||
}
|
|
||||||
if (text == '加') {
|
|
||||||
minutes = Math.floor((Number(time_m + time_s + 30) % 3600) / 60)
|
|
||||||
seconds = Number(time_m + time_s + 30) % 60
|
|
||||||
}
|
|
||||||
that.time_m = minutes > 9 ? minutes : '0' + minutes;
|
|
||||||
that.time_s = seconds > 9 ? seconds : '0' + seconds;
|
|
||||||
that.timesTndex = [Number(that.time_m), Number(that.time_s)]
|
|
||||||
},
|
|
||||||
handleWeightEdit(text) {
|
|
||||||
let that = this
|
|
||||||
if (text == '减') {
|
|
||||||
that.weight = Number(that.weight) - 50 > 50 ? Number(that.weight) - 50 : 50
|
|
||||||
}
|
|
||||||
if (text == '加') {
|
|
||||||
that.weight = Number(that.weight) + 50
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 蓝牙搜索记时
|
|
||||||
handleMyTime() {
|
|
||||||
let that = this
|
|
||||||
myTime = setTimeout(function() {
|
|
||||||
if (!that.devicesList.length) {
|
|
||||||
that.islink = -1
|
|
||||||
that.textLink = "重新搜索"
|
|
||||||
that.$tools.showModal("没有查找到设备")
|
|
||||||
}
|
|
||||||
clearTimeout(myTime)
|
|
||||||
that.$Bluetooth.stopBluetoothDevicesDiscovery()
|
|
||||||
}, 20000);
|
|
||||||
},
|
|
||||||
// 监听蓝牙连接状态
|
|
||||||
onBLEConnectionStateChange() {
|
|
||||||
let that = this
|
|
||||||
uni.onBLEConnectionStateChange(function(res) {
|
|
||||||
console.log("监听蓝牙连接状态", res.connected)
|
|
||||||
that.$store.commit("changeConnected", res.connected);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 断开蓝牙模块
|
|
||||||
*/
|
|
||||||
closeBluetoothAdapter() {
|
|
||||||
let that = this;
|
|
||||||
uni.closeBluetoothAdapter({
|
|
||||||
success: res => {
|
|
||||||
console.log('蓝牙模块关闭成功');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 断开蓝牙连接
|
|
||||||
*/
|
|
||||||
closeBLEConnection() {
|
|
||||||
var that = this;
|
|
||||||
uni.closeBLEConnection({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: res => {
|
|
||||||
console.log('断开蓝牙连接成功');
|
|
||||||
that.$store.commit("changeConnected", false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
navTo(url) {
|
|
||||||
let that = this
|
|
||||||
if (!that.isConnected) {
|
|
||||||
that.islink = -1
|
|
||||||
clearTimeout(myTime)
|
|
||||||
that.$Bluetooth.closeBluetoothAdapter()
|
|
||||||
that.$Bluetooth.closeBLEConnection(that.deviceId)
|
|
||||||
that.$Bluetooth.stopBluetoothDevicesDiscovery()
|
|
||||||
console.log("蓝牙没有连接")
|
|
||||||
}
|
|
||||||
uni.navigateTo({
|
|
||||||
url: url
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.content {
|
|
||||||
width: 100%;
|
|
||||||
min-height: 100vh;
|
|
||||||
background-color: #F5F6FA;
|
|
||||||
}
|
|
||||||
|
|
||||||
.skiptop {
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.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: 32rpx;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
width: 100%;
|
|
||||||
color: #333;
|
|
||||||
font-size: 44rpx;
|
|
||||||
text-align: center;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
|
|
||||||
text {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item-ite {
|
|
||||||
font-size: 36rpx;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.item-set {
|
|
||||||
width: calc(100% - 30px);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
height: 55px;
|
|
||||||
line-height: 55px;
|
|
||||||
font-size: 60rpx;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
background-color: #f7f7f7;
|
|
||||||
padding: 0 15px;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin: auto;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
/deep/input {
|
|
||||||
font-size: 60rpx;
|
|
||||||
height: 55px;
|
|
||||||
line-height: 55px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.item-set0 {
|
|
||||||
background-color: #fff;
|
|
||||||
justify-content: center
|
|
||||||
}
|
|
||||||
|
|
||||||
.tips {
|
|
||||||
font-size: 32rpx;
|
|
||||||
color: #999;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.start {
|
|
||||||
color: #fff;
|
|
||||||
width: 100px;
|
|
||||||
height: 100px;
|
|
||||||
font-size: 36rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: 100px;
|
|
||||||
text-align: center;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: $textcolor;
|
|
||||||
margin: 15px auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.Nstart {
|
|
||||||
opacity: 0.5 !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.status {
|
|
||||||
background-color: #fff;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 18px;
|
|
||||||
height: 18px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon_link {
|
|
||||||
animation: rotation 0.6s infinite linear;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes rotation {
|
|
||||||
0% {
|
|
||||||
transform: rotate(0deg);
|
|
||||||
}
|
|
||||||
|
|
||||||
100% {
|
|
||||||
transform: rotate(360deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,252 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="content">
|
|
||||||
<view class="f_banner" v-if="fimages.length">
|
|
||||||
<swiper class="swiper" indicator-dots="true" autoplay="true">
|
|
||||||
<swiper-item v-for="(image, index) in fimages" :key="index" @click="$tools.NewsPtype(image)">
|
|
||||||
<image :src="image.cover_image" mode="aspectFill" />
|
|
||||||
</swiper-item>
|
|
||||||
</swiper>
|
|
||||||
</view>
|
|
||||||
<!-- 标签 -->
|
|
||||||
<view class="tabbar">
|
|
||||||
<scroll-view class="scroll-menu" scroll-x="true" style="white-space: nowrap;">
|
|
||||||
<view @click="handleactive(index)" v-for="(name,index) in labelList" :key="index"
|
|
||||||
:class="[active==index?'active':'']">
|
|
||||||
{{name.name}}
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
<!-- list -->
|
|
||||||
<view class="list">
|
|
||||||
<view class="newslist" v-for="(item,index) in list" :key="index" @click="handleActive(item,index)">
|
|
||||||
<view class="left">
|
|
||||||
<view class="title">
|
|
||||||
{{item.title}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="right">
|
|
||||||
<image :src="item.cover_image" mode="aspectFill"></image>
|
|
||||||
</view>
|
|
||||||
<view class="time">
|
|
||||||
<view class="size14 c999">
|
|
||||||
<icon class="iconfont icon-icon-test"></icon>
|
|
||||||
{{item.reading}}次浏览
|
|
||||||
</view>
|
|
||||||
<view class="size14 c999">
|
|
||||||
<icon class="iconfont icon-icon-test1"></icon>
|
|
||||||
{{item.create_time}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
page: 1,
|
|
||||||
fimages: [],
|
|
||||||
lastPage: "",
|
|
||||||
labelList: [],
|
|
||||||
active: 0,
|
|
||||||
list: []
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState([]),
|
|
||||||
},
|
|
||||||
onLoad() {
|
|
||||||
let that = this;
|
|
||||||
that.page = 1
|
|
||||||
that.handleContentLabel()
|
|
||||||
},
|
|
||||||
onReachBottom() {
|
|
||||||
let that = this
|
|
||||||
if (!this.lastPage || this.page >= this.lastPage) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '没有更多数据!',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.page++
|
|
||||||
this.handleContentMsg()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 资讯信息
|
|
||||||
handleContentMsg() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getContentMsg({
|
|
||||||
type: that.active,
|
|
||||||
sector_id: 1,
|
|
||||||
page: that.page,
|
|
||||||
}).then(res => {
|
|
||||||
console.log("资讯", res)
|
|
||||||
if (res.code != 0) return
|
|
||||||
that.list = that.list.concat(res.data.content_data)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 标签类别信息
|
|
||||||
handleContentLabel() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getContentLabel({}).then(res => {
|
|
||||||
console.log("标签类别信息", res)
|
|
||||||
if (res.code != 0) return
|
|
||||||
that.labelList = res.data[0].list
|
|
||||||
that.fimages = res.data[0].loop_data
|
|
||||||
that.handleContentMsg()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 切换文章类别
|
|
||||||
handleactive(ind) {
|
|
||||||
let that = this
|
|
||||||
that.active = ind
|
|
||||||
that.page = 1
|
|
||||||
that.list = []
|
|
||||||
that.handleContentMsg()
|
|
||||||
},
|
|
||||||
detail(ite) {
|
|
||||||
this.$tools.NewsPtype(ite)
|
|
||||||
// uni.navigateTo({
|
|
||||||
// url: "/pageTwo/webview/webview?url=" + item.jump_url
|
|
||||||
// })
|
|
||||||
},
|
|
||||||
handleActive(ite, ind) {
|
|
||||||
let that = this
|
|
||||||
that.$tools.NewsPtype(ite)
|
|
||||||
setTimeout(function() {
|
|
||||||
that.list[ind].reading++
|
|
||||||
}, 2000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
// banner
|
|
||||||
.f_banner {
|
|
||||||
width: 100%;
|
|
||||||
height: 400upx;
|
|
||||||
|
|
||||||
/deep/swiper {
|
|
||||||
height: 400upx;
|
|
||||||
}
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background-size: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tabbar {
|
|
||||||
height: 50px;
|
|
||||||
display: flex;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 16px;
|
|
||||||
justify-content: space-between;
|
|
||||||
margin: 15px 10px;
|
|
||||||
|
|
||||||
.scroll-menu {
|
|
||||||
width: 100%;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
view {
|
|
||||||
display: inline-block;
|
|
||||||
height: 48px;
|
|
||||||
line-height: 48px;
|
|
||||||
padding: 0 10px;
|
|
||||||
|
|
||||||
text {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.active {
|
|
||||||
color: #fff;
|
|
||||||
border-radius: 5px;
|
|
||||||
background-color: $btncolor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.list {
|
|
||||||
width: 100%;
|
|
||||||
padding-bottom: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.newslist {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 10px 15px;
|
|
||||||
border-bottom: 1px solid #f7f7f7;
|
|
||||||
|
|
||||||
.left {
|
|
||||||
width: calc(100% - 115px);
|
|
||||||
height: 60px;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
flex-flow: column;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
width: 100%;
|
|
||||||
font-size: 30rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
-webkit-line-clamp: 2;
|
|
||||||
line-height: 30px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.right {
|
|
||||||
width: 105px;
|
|
||||||
height: 60px;
|
|
||||||
border: 1px solid #f7f7f7;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.time {
|
|
||||||
width: 100%;
|
|
||||||
margin-top: 5px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
icon {
|
|
||||||
width: 20px;
|
|
||||||
display: block;
|
|
||||||
margin-right: 3px;
|
|
||||||
margin-top: -5px;
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon-icon-test1 {
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
view {
|
|
||||||
color: #666;
|
|
||||||
font-size: 14px;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
268
scss/body.scss
|
|
@ -71,38 +71,172 @@
|
||||||
|
|
||||||
// 曲线
|
// 曲线
|
||||||
.charts {
|
.charts {
|
||||||
.boxTime {
|
width: 100%;
|
||||||
display: flex;
|
.TrendPage {
|
||||||
justify-content: center;
|
width: 100%;
|
||||||
align-items: center;
|
padding: 10px 0;
|
||||||
background-color: #fff;
|
border-radius: 10px;
|
||||||
border-radius: 10px 10px 0 0;
|
|
||||||
|
.listC {
|
||||||
.one {
|
width: calc(100% - 20px);
|
||||||
|
padding: 10px;
|
||||||
|
display: flex;
|
||||||
|
border-radius: 10px;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
background-color: #fff;
|
||||||
|
|
||||||
|
view {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.active:after {
|
||||||
|
content: "";
|
||||||
|
height: 3px;
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
bottom: -5px;
|
||||||
|
left: 0;
|
||||||
|
border-radius: 5px;
|
||||||
|
background: $maincolor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
margin-top: 15px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxTime {
|
||||||
|
width: calc(100% - 30px);
|
||||||
|
border-radius: 10px;
|
||||||
|
text-align: center;
|
||||||
|
background: #fff;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 15px;
|
||||||
|
.style {
|
||||||
|
background: $maincolor;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconfont {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.boxLine {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
border-radius: 10px;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.line {
|
||||||
|
clear: both;
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
background-color: #fff;
|
||||||
|
padding-top: 10px;
|
||||||
|
border-bottom: 10px solid #f7f7f7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.gridList {
|
||||||
|
padding: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: space-between;
|
||||||
|
.info {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
line-height: 25px;
|
margin-top: 15px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
|
||||||
|
.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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.center {
|
.data {
|
||||||
width: 10%;
|
|
||||||
margin: 0 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
picker {
|
|
||||||
width: 50%;
|
|
||||||
border: none;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
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: 32rpx;
|
||||||
|
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: 40rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
justify-content: center;
|
||||||
|
color: #666;
|
||||||
|
|
||||||
|
text {
|
||||||
|
font-size: 32rpx;
|
||||||
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
color: #333333;
|
|
||||||
font-size: 36rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
|
|
@ -145,9 +279,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.gridList {
|
.gridList {
|
||||||
margin: 0px !important;
|
|
||||||
width: 100% !important;
|
|
||||||
|
|
||||||
.info {
|
.info {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -185,18 +316,17 @@
|
||||||
|
|
||||||
// 报告
|
// 报告
|
||||||
.report {
|
.report {
|
||||||
|
background: #fff;
|
||||||
|
margin: 15px;
|
||||||
|
padding: 0 15px;
|
||||||
|
border-radius: 10px;
|
||||||
.box {
|
.box {
|
||||||
padding: 10px 10px 0;
|
padding: 0 !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
width: 100% !important;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
display: block;
|
display: block;
|
||||||
margin: 15px 10px;
|
|
||||||
|
|
||||||
.time {
|
|
||||||
color: #999;
|
|
||||||
padding-bottom: 15px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item2 {
|
.item2 {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
@ -232,9 +362,10 @@
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
|
font-size: 28rpx;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin: 10px;
|
margin: 10px 0 ;
|
||||||
background-color: #fff;
|
background-color: #dfdfdf;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info {
|
.info {
|
||||||
|
|
@ -263,6 +394,55 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.data2 {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
line-height: 30px;
|
||||||
|
margin: 10px 0 5px;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
// width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left2 {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
width: 50%;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
font-size: 14px;
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
|
.lixiang {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
justify-content: flex-end;
|
||||||
|
// justify-content: space-between;
|
||||||
|
|
||||||
|
view {
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
text {
|
||||||
|
color: $maincolor;
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.myinfoPage {
|
.myinfoPage {
|
||||||
width:100% ;
|
width:100% ;
|
||||||
|
|
@ -277,7 +457,6 @@
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 0px 15px 0;
|
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
|
|
||||||
.list {
|
.list {
|
||||||
|
|
@ -345,7 +524,7 @@
|
||||||
height: 35px;
|
height: 35px;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
margin: 20px auto 10px;
|
margin: 20px auto 0px;
|
||||||
|
|
||||||
.bi {
|
.bi {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -395,7 +574,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.yuanxing {
|
.yuanxing {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
background: #f19601;
|
background: #f19601;
|
||||||
|
|
@ -468,9 +646,7 @@
|
||||||
.jianyi_box {
|
.jianyi_box {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
padding: 5px 10px 15px;
|
width: 100%;
|
||||||
width: calc(100% -20px);
|
|
||||||
margin: 10px 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.jianyi {
|
.jianyi {
|
||||||
|
|
@ -520,7 +696,7 @@
|
||||||
.tips2 {
|
.tips2 {
|
||||||
color: #999;
|
color: #999;
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
font-size:30rpx;
|
font-size:28rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
727
scss/common.scss
|
|
@ -35,21 +35,24 @@
|
||||||
color: #477EFF !important;
|
color: #477EFF !important;
|
||||||
}
|
}
|
||||||
.size12 {
|
.size12 {
|
||||||
font-size:28rpx !important
|
font-size:24rpx !important
|
||||||
}
|
}
|
||||||
.size14 {
|
.size14 {
|
||||||
font-size: 32rpx !important
|
font-size: 28rpx !important
|
||||||
}
|
}
|
||||||
.size16 {
|
.size16 {
|
||||||
font-size: 36rpx !important
|
font-size: 32rpx !important
|
||||||
}
|
}
|
||||||
|
|
||||||
.size18 {
|
.size18 {
|
||||||
font-size: 40rpx !important
|
font-size: 38rpx !important
|
||||||
}
|
}
|
||||||
|
|
||||||
.size20 {
|
.size20 {
|
||||||
font-size: 44rpx !important
|
font-size: 40rpx !important
|
||||||
|
}
|
||||||
|
.size24 {
|
||||||
|
font-size: 48rpx !important
|
||||||
}
|
}
|
||||||
.size26{
|
.size26{
|
||||||
font-size: 52rpx !important
|
font-size: 52rpx !important
|
||||||
|
|
@ -141,19 +144,26 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.nolist {
|
.nolist {
|
||||||
padding:50px 15px;
|
width: 100%;
|
||||||
width: calc(100% - 30px);
|
padding-top: 100rpx;
|
||||||
text-align: center;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 150px;
|
width: 100rpx;
|
||||||
height: 150px;
|
height: 100rpx;
|
||||||
|
color: #999;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
text {
|
text {
|
||||||
display: block;
|
display: block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-top: 15px;
|
margin: 15px 0;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
@ -173,6 +183,7 @@
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
padding: 15px 0;
|
padding: 15px 0;
|
||||||
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
.groupBtn {
|
.groupBtn {
|
||||||
|
|
@ -335,6 +346,157 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
background-color: #fff;
|
||||||
|
position: absolute;
|
||||||
|
top:15%;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
padding: 20rpx;
|
||||||
|
border-radius: 20rpx 20rpx 0 0;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.cancel {
|
||||||
|
width: 160rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.weight {
|
||||||
|
width: auto;
|
||||||
|
display: flex;
|
||||||
|
font-size: 26rpx;
|
||||||
|
background: $uni-color-warning;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
color: #fff;
|
||||||
|
padding: 3px 8px;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
icon {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.name {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
// margin-top:-30rpx
|
||||||
|
}
|
||||||
|
|
||||||
|
.val {
|
||||||
|
text-align: center;
|
||||||
|
margin: 30rpx 0;
|
||||||
|
|
||||||
|
text {
|
||||||
|
display: inline-block;
|
||||||
|
width:160rpx;
|
||||||
|
border-bottom: 1px solid #dfdfdf;
|
||||||
|
font-size: 44rpx;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.mybrankmask {
|
||||||
|
width: 100%;
|
||||||
|
height: 390rpx;
|
||||||
|
background-color: #EBEEF5;
|
||||||
|
position: fixed;
|
||||||
|
z-index: 999;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
|
||||||
|
.MymaskAll {
|
||||||
|
width: 74%;
|
||||||
|
|
||||||
|
.MymaskList {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: space-around;
|
||||||
|
margin-top: 20rpx;
|
||||||
|
|
||||||
|
.maskListItem {
|
||||||
|
width: 29%;
|
||||||
|
height: 70rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
font-size: 36rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
font-size: 14px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 50rpx;
|
||||||
|
height: 50rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.MymaskList2 {
|
||||||
|
width: 22%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
position: absolute;
|
||||||
|
right: 20rpx;
|
||||||
|
top: 20rpx;
|
||||||
|
bottom: 30rpx;
|
||||||
|
|
||||||
|
.maskListItem {
|
||||||
|
width: 100%;
|
||||||
|
background: #fff;
|
||||||
|
height: 70rpx;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.width48 {
|
||||||
|
color: #fff;
|
||||||
|
height: 152rpx;
|
||||||
|
line-height: 152rpx;
|
||||||
|
background-color: $maincolor;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close {
|
||||||
|
width: 64rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes mytreat {
|
||||||
|
|
||||||
|
/*开始画面*/
|
||||||
|
0% {
|
||||||
|
background-color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
50% {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
background-color: #000;
|
||||||
|
}
|
||||||
|
}
|
||||||
// 弹框
|
// 弹框
|
||||||
|
|
||||||
.edit {
|
.edit {
|
||||||
|
|
@ -498,49 +660,42 @@
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.header {
|
|
||||||
width: 100%;
|
.skiptop {
|
||||||
height: 240rpx;
|
|
||||||
background: $maincolor;
|
background: $maincolor;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin: 0 15px 10px;
|
||||||
|
font-size: 32rpx;
|
||||||
|
padding: 20px 10px 5px;
|
||||||
|
color: #fff;
|
||||||
|
|
||||||
image {
|
.status {
|
||||||
width: 55px;
|
float: right;
|
||||||
height: 55px;
|
margin-bottom: 25px;
|
||||||
border-radius: 50%;
|
width: auto;
|
||||||
}
|
color: #333;
|
||||||
|
|
||||||
.top {
|
|
||||||
margin: 0 10px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
padding:10px 15px;
|
padding:8px 10px;
|
||||||
height: 160rpx;
|
display: flex;
|
||||||
.headimg {
|
align-items: center;
|
||||||
width: 55px;
|
|
||||||
height: 55px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.toggle {
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.add {
|
.item {
|
||||||
border: 1px #dfdfdf dashed;
|
width: 100%;
|
||||||
font-size:56rpx;
|
display: flex;
|
||||||
font-weight: 500;
|
justify-content: space-between;
|
||||||
width: 35px;
|
|
||||||
height: 35px;
|
text {
|
||||||
line-height: 35px;
|
display: block;
|
||||||
border-radius: 10px;
|
width: 100%;
|
||||||
text-align: center;
|
font-size: 36rpx;
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 趋势
|
// 趋势
|
||||||
.TrendPage {
|
.TrendPage {
|
||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
|
|
@ -550,15 +705,20 @@
|
||||||
|
|
||||||
.listC {
|
.listC {
|
||||||
width: calc(100% - 50px);
|
width: calc(100% - 50px);
|
||||||
padding: 15px;
|
padding:0 15px;
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
height: 45px;
|
||||||
|
line-height: 35px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
|
||||||
view {
|
view {
|
||||||
|
width: 20%;
|
||||||
|
padding: 0 10px;
|
||||||
|
text-align: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -613,299 +773,25 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
.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: 32rpx;
|
|
||||||
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: 40rpx;
|
|
||||||
font-weight: 700;
|
|
||||||
justify-content: center;
|
|
||||||
color: #666;
|
|
||||||
|
|
||||||
text {
|
|
||||||
font-size: 32rpx;
|
|
||||||
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: 32rpx;
|
|
||||||
padding: 20px 10px 5px;
|
|
||||||
color: #fff;
|
|
||||||
|
|
||||||
.status {
|
|
||||||
float: right;
|
|
||||||
margin-bottom: 25px;
|
|
||||||
width: auto;
|
|
||||||
color: #333;
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 10px;
|
|
||||||
padding:8px 10px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
// text {
|
|
||||||
// width: auto;
|
|
||||||
// color: #333;
|
|
||||||
// background-color: #fff;
|
|
||||||
// border-radius: 10px;
|
|
||||||
// padding: 8px 10px;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
text {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
font-size: 36rpx;
|
|
||||||
text-align: center;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 首页卡片
|
|
||||||
.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;
|
|
||||||
|
|
||||||
.time{
|
|
||||||
display: flex;
|
|
||||||
font-size: 28rpx;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.name2 {
|
|
||||||
font-size: 36rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-right: 10px;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
padding: 7px 0;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
.weight {
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
text {
|
|
||||||
font-size: 40rpx !important;
|
|
||||||
font-weight: bold;
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.standardBtn {
|
|
||||||
width: 40px;
|
|
||||||
padding: 3px 8px;
|
|
||||||
border-radius: 8px;
|
|
||||||
text-align: center;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 32rpx;
|
|
||||||
margin: auto;
|
|
||||||
background-color: $btncolor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.target {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding-top: 10px;
|
|
||||||
font-size: 32rpx;
|
|
||||||
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: 50%;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
margin: 15px 0;
|
|
||||||
|
|
||||||
.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;
|
|
||||||
border-radius: 10px;
|
|
||||||
color: $textcolor;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 报告页
|
// 报告页
|
||||||
//选择对比
|
//选择对比
|
||||||
.calendar{
|
.calendar{
|
||||||
background: #f7f7f7;
|
background: #f7f7f7;
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
|
|
||||||
.box {
|
.box {
|
||||||
margin-bottom: 305px;
|
margin-bottom: 305px;
|
||||||
padding-bottom: 210px;
|
padding-bottom: 210px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list {
|
.list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin: 15px;
|
margin: 10px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|
@ -913,22 +799,22 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 10px 15px;
|
padding: 10px 5px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
|
|
||||||
view {
|
view {
|
||||||
width: 32%;
|
width: 32%;
|
||||||
}
|
}
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 25px;
|
width: 25px;
|
||||||
height: 25px;
|
height: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
text {
|
text {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size:28rpx;
|
font-size:28rpx;
|
||||||
|
|
@ -937,24 +823,24 @@
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
.check {
|
.check {
|
||||||
width: 35px !important;
|
width: 35px !important;
|
||||||
|
|
||||||
.icon-kongradio {
|
.icon-kongradio {
|
||||||
font-size: 44rpx;
|
font-size: 44rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-radio {
|
.icon-radio {
|
||||||
font-size: 44rpx;
|
font-size: 44rpx;
|
||||||
color: #FCA82D;
|
color: #FCA82D;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.time {
|
.time {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
|
|
@ -963,13 +849,13 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
margin-top: 3px;
|
margin-top: 3px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom {
|
.bottom {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: auto;
|
width: auto;
|
||||||
|
|
@ -982,22 +868,22 @@
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
border-top: 1px solid #dfdfdf;
|
border-top: 1px solid #dfdfdf;
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
width: auto;
|
width: auto;
|
||||||
margin: 10px 0 0;
|
margin: 10px 0 0;
|
||||||
background: $maincolor;
|
background: $maincolor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list {
|
.list {
|
||||||
margin: 10px 0;
|
margin: 10px 0;
|
||||||
height: 120rpx;
|
height: 120rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
background: #F7F7F7;
|
background: #F7F7F7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.time {
|
.time {
|
||||||
float: left;
|
float: left;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
@ -1006,22 +892,22 @@
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
width: 35%;
|
width: 35%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.check {
|
.check {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: -5px;
|
right: -5px;
|
||||||
top: -5px;
|
top: -5px;
|
||||||
width: 25px;
|
width: 25px;
|
||||||
|
|
||||||
.icon-quxiao {
|
.icon-quxiao {
|
||||||
font-size: 40rpx;
|
font-size: 40rpx;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.pkclass {
|
.pkclass {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 30px;
|
width: 30px;
|
||||||
|
|
@ -1035,7 +921,7 @@
|
||||||
left: 30px;
|
left: 30px;
|
||||||
top: 120rpx;
|
top: 120rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn.active {
|
.btn.active {
|
||||||
border: none;
|
border: none;
|
||||||
color: #333 !important;
|
color: #333 !important;
|
||||||
|
|
@ -1231,147 +1117,4 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 测量也
|
|
||||||
.weightPages {
|
|
||||||
.text {
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 36rpx;
|
|
||||||
margin-top: 20px;
|
|
||||||
color: $textcolor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
height: 45px;
|
|
||||||
line-height: 45px;
|
|
||||||
font-size: 36rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 200px;
|
|
||||||
height: 200px;
|
|
||||||
margin: auto;
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.tips {
|
|
||||||
width: auto;
|
|
||||||
margin-top: 25px;
|
|
||||||
padding-left: 20px;
|
|
||||||
line-height: 30px;
|
|
||||||
font-size:28rpx;
|
|
||||||
color: #999;
|
|
||||||
|
|
||||||
text {
|
|
||||||
display: block;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrapper {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
right: 0;
|
|
||||||
left: 0;
|
|
||||||
z-index: 99;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background-color: rgba(0, 0, 0, 0.4);
|
|
||||||
|
|
||||||
.Blue {
|
|
||||||
width: 75%;
|
|
||||||
padding: 15px;
|
|
||||||
background: #fff;
|
|
||||||
z-index: 999;
|
|
||||||
border-radius: 5px;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 30px;
|
|
||||||
|
|
||||||
.h4 {
|
|
||||||
font-size: 36rpx;
|
|
||||||
font-weight: 700;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.Blue-box {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
text-align: left;
|
|
||||||
height: 40px;
|
|
||||||
line-height: 40px;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
|
|
||||||
text {
|
|
||||||
font-size: 36rpx;
|
|
||||||
font-weight: 700;
|
|
||||||
margin: 0 5px;
|
|
||||||
color: $textcolor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
input {
|
|
||||||
width: 85px;
|
|
||||||
background: #f7f7f7;
|
|
||||||
padding: 7px 5px;
|
|
||||||
margin-right: 10px;
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.Blue-btn {
|
|
||||||
width: 45%;
|
|
||||||
background: $textcolor;
|
|
||||||
border-radius: 5px;
|
|
||||||
font-size: 32rpx;
|
|
||||||
margin-top: 10px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
height: 35px;
|
|
||||||
line-height: 35px;
|
|
||||||
float: right;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.Blue-close {
|
|
||||||
background: #dfdfdf !important;
|
|
||||||
float: left !important;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.btnGroup {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.btnClose,
|
|
||||||
.baocun {
|
|
||||||
width: 150px;
|
|
||||||
background-color: $textcolor;
|
|
||||||
border: 1px solid #f7f7f7;
|
|
||||||
color: #fff;
|
|
||||||
text-align: center;
|
|
||||||
padding: 7px;
|
|
||||||
border-radius: 10px;
|
|
||||||
margin: 15px auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btnClose {
|
|
||||||
background-color: #dfdfdf;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
.content {
|
.content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-top: 10px;
|
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background-color: #000;
|
background-color: #000;
|
||||||
}
|
}
|
||||||
|
|
@ -8,7 +7,7 @@
|
||||||
.box1 {
|
.box1 {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
margin: 15px;
|
margin: 15px;
|
||||||
width: calc(100%- 30px);
|
width: calc(100% - 40px);
|
||||||
|
|
||||||
.time {
|
.time {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@
|
||||||
height: 45px;
|
height: 45px;
|
||||||
line-height: 45px;
|
line-height: 45px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
border-bottom: 1px solid #f7f7f7;
|
border-bottom: 1px solid #f7f7f7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
BIN
static/add.png
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 9.7 KiB |
BIN
static/bei.png
|
Before Width: | Height: | Size: 5.8 KiB |
BIN
static/bei2.png
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
BIN
static/logo.png
|
Before Width: | Height: | Size: 3.9 KiB |
BIN
static/none.png
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 3.8 KiB |
BIN
static/pk.png
|
Before Width: | Height: | Size: 5.2 KiB |
BIN
static/q1.png
|
Before Width: | Height: | Size: 4.2 KiB |
BIN
static/q10.png
|
Before Width: | Height: | Size: 3.0 KiB |
BIN
static/q2.png
|
Before Width: | Height: | Size: 5.1 KiB |
BIN
static/q4.png
|
Before Width: | Height: | Size: 3.2 KiB |
BIN
static/q6.png
|
Before Width: | Height: | Size: 3.0 KiB |
BIN
static/q9.png
|
Before Width: | Height: | Size: 3.6 KiB |
117
store/actions.js
|
|
@ -2,6 +2,16 @@ import model from "../toolJs/model.js"
|
||||||
import tools from '@/toolJs/tools.js'
|
import tools from '@/toolJs/tools.js'
|
||||||
// Action 包含异步操作(请求API方法)、回调函数提交mutaions更改state数据状态,使之可以异步
|
// Action 包含异步操作(请求API方法)、回调函数提交mutaions更改state数据状态,使之可以异步
|
||||||
export default {
|
export default {
|
||||||
|
//配置接口
|
||||||
|
getHomeConfig({
|
||||||
|
commit,
|
||||||
|
dispatch
|
||||||
|
}) {
|
||||||
|
return model.getHomeConfig({}).then(res => {
|
||||||
|
commit('changeConfigInfo', res.data)
|
||||||
|
return res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
// 账户信息
|
// 账户信息
|
||||||
getAccountNumber({
|
getAccountNumber({
|
||||||
commit
|
commit
|
||||||
|
|
@ -15,7 +25,19 @@ export default {
|
||||||
commit('changeAccountNumber', res.data)
|
commit('changeAccountNumber', res.data)
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 成员列表
|
||||||
|
getFamilyList({
|
||||||
|
commit
|
||||||
|
},
|
||||||
|
account) {
|
||||||
|
return model.getUserList(account).then(res => {
|
||||||
|
if (res.code != 0) {
|
||||||
|
tools.msg(res.msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
commit('changeFamilay', res.data.user_list)
|
||||||
|
});
|
||||||
|
},
|
||||||
// 用户信息
|
// 用户信息
|
||||||
getUserInfo({
|
getUserInfo({
|
||||||
commit
|
commit
|
||||||
|
|
@ -30,37 +52,13 @@ export default {
|
||||||
uni.setStorageSync('userid', res.data.id)
|
uni.setStorageSync('userid', res.data.id)
|
||||||
uni.setStorageSync('gender', res.data.gender)
|
uni.setStorageSync('gender', res.data.gender)
|
||||||
commit('changeUser', res.data)
|
commit('changeUser', res.data)
|
||||||
commit('changeLungLevel', res.data.vitalcapacity_data)
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 成员列表
|
// 首页身体数据
|
||||||
getFamilyList({
|
getResult({
|
||||||
commit
|
|
||||||
},
|
|
||||||
account) {
|
|
||||||
return model.getUserList(account).then(res => {
|
|
||||||
if (res.code != 0) {
|
|
||||||
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
|
commit
|
||||||
}, account) {
|
}, account) {
|
||||||
return model.getResult(account).then((res) => {
|
return model.getResultHome(account).then((res) => {
|
||||||
console.log("报告", res)
|
console.log("报告", res)
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
commit('changeMeasureResult', res.data)
|
commit('changeMeasureResult', res.data)
|
||||||
|
|
@ -69,11 +67,21 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 获取用户卡片
|
||||||
|
getCardAllList({
|
||||||
|
commit
|
||||||
|
},
|
||||||
|
account) {
|
||||||
|
return model.getCardAllList(account).then(res => {
|
||||||
|
commit('changeCardList', res.data)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
// 跳绳数据
|
// 跳绳数据
|
||||||
getSkipResult({ //报告
|
getSkipResult({ //报告
|
||||||
commit
|
commit
|
||||||
}, account) {
|
}, account) {
|
||||||
return model.getSkipResult(account).then((res) => {
|
return model.getSkipDataResult(account).then((res) => {
|
||||||
console.log("跳绳报告", res)
|
console.log("跳绳报告", res)
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
commit('changeMeasureSkip', res.data)
|
commit('changeMeasureSkip', res.data)
|
||||||
|
|
@ -86,8 +94,7 @@ export default {
|
||||||
getLungResult({ //报告
|
getLungResult({ //报告
|
||||||
commit
|
commit
|
||||||
}, account) {
|
}, account) {
|
||||||
return model.getLungResult(account).then((res) => {
|
return model.getLungDataResult(account).then((res) => {
|
||||||
console.log("肺活量报告", res)
|
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
commit('changeLungLevel', res.data.list)
|
commit('changeLungLevel', res.data.list)
|
||||||
commit('changeMeasureLung', res.data)
|
commit('changeMeasureLung', res.data)
|
||||||
|
|
@ -96,50 +103,16 @@ export default {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 公共
|
|
||||||
getPublicContent({ //报告
|
|
||||||
commit
|
|
||||||
}, account) {
|
|
||||||
return model.getpublicContent(account).then((res) => {
|
|
||||||
console.log("公共报告", res)
|
|
||||||
if (res.code == 0) {
|
|
||||||
commit('changePublicContent', res.data)
|
|
||||||
} else {
|
|
||||||
commit('changePublicContent', null)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
GetBodyTrendList({ //趋势
|
// 计食器信息
|
||||||
|
getCountFoodInfo({
|
||||||
commit
|
commit
|
||||||
}, account) {
|
}, account) {
|
||||||
return model.getTrendList(account).then((res) => {
|
return model.getCountFoodInfo(account).then(res => {
|
||||||
console.log("趋势", res)
|
if (res.code == 0) {
|
||||||
commit('changeTrend', res.data)
|
commit('changeCountFoodInfo', 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)
|
|
||||||
}
|
}
|
||||||
})
|
return res.data
|
||||||
},
|
});
|
||||||
// 设备
|
|
||||||
getUserDeviceList({ // 用户设备
|
|
||||||
commit
|
|
||||||
}) {
|
|
||||||
return model.getUserDeviceList({}).then(res => {
|
|
||||||
console.log("用户设备", res)
|
|
||||||
if (res.data) {
|
|
||||||
commit('changeUserDeviceList', res.data.list)
|
|
||||||
} else {
|
|
||||||
commit('changeUserDeviceList', [])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
255
store/index.js
|
|
@ -1,12 +1,13 @@
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
import actions from './actions.js'
|
import actions from './actions.js'
|
||||||
|
import json from '@/content.json'
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
// state: 存储基本数据
|
// state: 存储基本数据
|
||||||
state: {
|
state: {
|
||||||
user: {
|
user: {
|
||||||
id: "",
|
aud_id: "",
|
||||||
head_pic: null,
|
head_pic: null,
|
||||||
nickname: "",
|
nickname: "",
|
||||||
birthday: "",
|
birthday: "",
|
||||||
|
|
@ -18,11 +19,55 @@ export default new Vuex.Store({
|
||||||
weight: "",
|
weight: "",
|
||||||
address: "",
|
address: "",
|
||||||
head_data: 0,
|
head_data: 0,
|
||||||
|
food_count: {},
|
||||||
card_order: [],
|
card_order: [],
|
||||||
card_data_list: [],
|
card_data_list: [],
|
||||||
target_current: {},
|
target_current: {},
|
||||||
vitalcapacity_data: []
|
vitalcapacity_data: []
|
||||||
},
|
},
|
||||||
|
// 配置接口
|
||||||
|
configInfo: {
|
||||||
|
activity_level: [],
|
||||||
|
area_list: [],
|
||||||
|
banner: [],
|
||||||
|
meal_list: [],
|
||||||
|
literature: {
|
||||||
|
index: [],
|
||||||
|
bmi_evaluation: [],
|
||||||
|
height_prediction: [],
|
||||||
|
warning: []
|
||||||
|
},
|
||||||
|
identity_list: [],
|
||||||
|
grade_list: [],
|
||||||
|
cookbook_label: [],
|
||||||
|
default_count_foot: [],
|
||||||
|
business_cooperation_url: [],
|
||||||
|
},
|
||||||
|
// 蓝牙
|
||||||
|
bleValue: {
|
||||||
|
deviceId: "",
|
||||||
|
serviceId: "",
|
||||||
|
notify: "",
|
||||||
|
write: "",
|
||||||
|
unit: "g",
|
||||||
|
type: 1,
|
||||||
|
unitList: json.unitArray,
|
||||||
|
isSendVal: false,
|
||||||
|
oldCountWeight: 0,
|
||||||
|
countWeight: 100,
|
||||||
|
bleTipsText: "",
|
||||||
|
isConnectStatus: 0,
|
||||||
|
},
|
||||||
|
// 计食器
|
||||||
|
countFoodInfo: {
|
||||||
|
date: "",
|
||||||
|
details: {},
|
||||||
|
list: [],
|
||||||
|
remaining_kcal: "",
|
||||||
|
nutrients_four: [],
|
||||||
|
trace_elements_all_day: []
|
||||||
|
},
|
||||||
|
// 用户接口
|
||||||
accountNumber: {
|
accountNumber: {
|
||||||
create_time: "",
|
create_time: "",
|
||||||
head_pic: "",
|
head_pic: "",
|
||||||
|
|
@ -31,7 +76,6 @@ export default new Vuex.Store({
|
||||||
my_tel: "",
|
my_tel: "",
|
||||||
nickname: "",
|
nickname: "",
|
||||||
},
|
},
|
||||||
MeasureSkip: null,
|
|
||||||
MeasureResult: {
|
MeasureResult: {
|
||||||
body_type_name: "",
|
body_type_name: "",
|
||||||
body_type_unit: "",
|
body_type_unit: "",
|
||||||
|
|
@ -56,45 +100,31 @@ export default new Vuex.Store({
|
||||||
},
|
},
|
||||||
top_list: []
|
top_list: []
|
||||||
},
|
},
|
||||||
|
MeasureSkip: null,
|
||||||
MeasureLung: null,
|
MeasureLung: null,
|
||||||
PublicContent: null,
|
|
||||||
familayList: [],
|
familayList: [],
|
||||||
historyList: [],
|
|
||||||
PublicRecord: [],
|
PublicRecord: [],
|
||||||
cardList: {
|
CardList: {
|
||||||
user: [],
|
chosen_fixed: [],
|
||||||
all: []
|
chosen_yes: [],
|
||||||
|
chosen_no: []
|
||||||
},
|
},
|
||||||
Trend: [],
|
|
||||||
userDeviceList: [], //用户设备列表
|
|
||||||
isDrawe: false, //左侧弹框
|
isDrawe: false, //左侧弹框
|
||||||
isedit: false, //信息弹框
|
|
||||||
isTarget: false, //目标体重
|
isTarget: false, //目标体重
|
||||||
isFirst: false, //初始体重
|
isFirst: false, //初始体重
|
||||||
isRecord: false, //手动记录
|
isRecord: false, //手动记录
|
||||||
isSlider: false, //分数占比
|
isPublicRecord:false, //公共手动记录弹框
|
||||||
isConnected: false,
|
UseBlueConfig: {
|
||||||
isPublicRecord: false,
|
isBleLink: false, //是否可以点击
|
||||||
isBluetoothTyle: false,
|
BleBodyMsg: "", //body页面蓝牙状态提示
|
||||||
CooperationUrl: [],
|
BleConnectMsg: "", //测量页蓝牙状态提示
|
||||||
|
serviceId: "",
|
||||||
|
isUseConnect: false, //蓝牙是否连接
|
||||||
|
},
|
||||||
LungLevel: [], //肺活量标准
|
LungLevel: [], //肺活量标准
|
||||||
devicesList: [], //筛选设备列表
|
|
||||||
labelList: [],
|
|
||||||
phoneInfo: {
|
|
||||||
info: {},
|
|
||||||
versionUrl: null,
|
|
||||||
platform: ""
|
|
||||||
},
|
|
||||||
cityList: [],
|
|
||||||
gradeList: [],
|
|
||||||
identityList: []
|
|
||||||
},
|
},
|
||||||
// mutations: Store中更改state数据状态的唯一方法(必须是同步函数)
|
|
||||||
mutations: {
|
mutations: {
|
||||||
// 版本信息
|
|
||||||
changePhoneInfo(state, newData) {
|
|
||||||
Object.assign(state.phoneInfo, newData)
|
|
||||||
},
|
|
||||||
// 账户信息
|
// 账户信息
|
||||||
changeAccountNumber(state, newData) {
|
changeAccountNumber(state, newData) {
|
||||||
Object.assign(state.accountNumber, newData)
|
Object.assign(state.accountNumber, newData)
|
||||||
|
|
@ -103,64 +133,6 @@ export default new Vuex.Store({
|
||||||
changeUser(state, newData) {
|
changeUser(state, newData) {
|
||||||
Object.assign(state.user, newData)
|
Object.assign(state.user, newData)
|
||||||
},
|
},
|
||||||
// 卡片列表
|
|
||||||
changeCardList(state, newData) {
|
|
||||||
state.cardList = newData
|
|
||||||
},
|
|
||||||
//历史记录
|
|
||||||
changehistoryList(state, newData) {
|
|
||||||
state.historyList = newData
|
|
||||||
},
|
|
||||||
// 获取称重数据
|
|
||||||
changeMeasureResult(state, newData) {
|
|
||||||
// state.MeasureResult = newData
|
|
||||||
Object.assign(state.MeasureResult, newData)
|
|
||||||
},
|
|
||||||
// 跳绳数据
|
|
||||||
changeMeasureSkip(state, newData) {
|
|
||||||
state.MeasureSkip = newData
|
|
||||||
},
|
|
||||||
// 肺活量
|
|
||||||
changeMeasureLung(state, newData) {
|
|
||||||
state.MeasureLung = newData
|
|
||||||
},
|
|
||||||
// 公共
|
|
||||||
changePublicContent(state, newData) {
|
|
||||||
state.PublicContent = newData
|
|
||||||
},
|
|
||||||
// 公共手动记录内容
|
|
||||||
changePublicRecord(state, newData) {
|
|
||||||
state.PublicRecord = newData
|
|
||||||
},
|
|
||||||
|
|
||||||
// 信息弹框
|
|
||||||
changeEdit(state, newData) {
|
|
||||||
state.isedit = newData
|
|
||||||
},
|
|
||||||
// 目标体重
|
|
||||||
changeTarget(state, newData) {
|
|
||||||
state.isTarget = newData
|
|
||||||
},
|
|
||||||
// 初始体重
|
|
||||||
changeFirst(state, newData) {
|
|
||||||
state.isFirst = newData
|
|
||||||
},
|
|
||||||
// 手动记录
|
|
||||||
changeRecord(state, newData) {
|
|
||||||
state.isRecord = newData
|
|
||||||
},
|
|
||||||
// 分数占比
|
|
||||||
changeSlider(state, newData) {
|
|
||||||
state.isSlider = newData
|
|
||||||
},
|
|
||||||
// 左侧菜单弹框
|
|
||||||
changeDrawe(state, newData) {
|
|
||||||
state.isDrawe = newData
|
|
||||||
},
|
|
||||||
// 肺活量标准
|
|
||||||
changeLungLevel(state, newData) {
|
|
||||||
state.lungLevel = newData
|
|
||||||
},
|
|
||||||
//获取家庭成员
|
//获取家庭成员
|
||||||
changeFamilay(state, newData) {
|
changeFamilay(state, newData) {
|
||||||
if (newData.length == 0) {
|
if (newData.length == 0) {
|
||||||
|
|
@ -178,6 +150,7 @@ export default new Vuex.Store({
|
||||||
address: "",
|
address: "",
|
||||||
measure_model: 0,
|
measure_model: 0,
|
||||||
card_order: [],
|
card_order: [],
|
||||||
|
food_count: {},
|
||||||
card_data_list: [],
|
card_data_list: [],
|
||||||
target_current: {},
|
target_current: {},
|
||||||
vitalcapacity_data: []
|
vitalcapacity_data: []
|
||||||
|
|
@ -185,47 +158,79 @@ export default new Vuex.Store({
|
||||||
}
|
}
|
||||||
state.familayList = newData
|
state.familayList = newData
|
||||||
},
|
},
|
||||||
//趋势
|
// 卡片列表
|
||||||
changeTrend(state, newData) {
|
changeCardList(state, newData) {
|
||||||
state.Trend = newData
|
state.CardList = newData
|
||||||
},
|
},
|
||||||
//蓝牙是否开启
|
// 左侧菜单弹框
|
||||||
|
changeDrawe(state, newData) {
|
||||||
|
state.isDrawe = newData
|
||||||
|
},
|
||||||
|
// 获取称重数据
|
||||||
|
changeMeasureResult(state, newData) {
|
||||||
|
Object.assign(state.MeasureResult, newData)
|
||||||
|
},
|
||||||
|
// 菜谱
|
||||||
|
changeMenuList(state, newData) {
|
||||||
|
state.menuList = newData
|
||||||
|
},
|
||||||
|
// 跳绳数据
|
||||||
|
changeMeasureSkip(state, newData) {
|
||||||
|
state.MeasureSkip = newData
|
||||||
|
},
|
||||||
|
// 肺活量标准
|
||||||
|
changeLungLevel(state, newData) {
|
||||||
|
state.lungLevel = newData
|
||||||
|
},
|
||||||
|
// 肺活量
|
||||||
|
changeMeasureLung(state, newData) {
|
||||||
|
state.MeasureLung = newData
|
||||||
|
},
|
||||||
|
|
||||||
|
// 目标体重
|
||||||
|
changeTarget(state, newData) {
|
||||||
|
state.isTarget = newData
|
||||||
|
},
|
||||||
|
// 初始体重
|
||||||
|
changeFirst(state, newData) {
|
||||||
|
state.isFirst = newData
|
||||||
|
},
|
||||||
|
// 手动记录
|
||||||
|
changeRecord(state, newData) {
|
||||||
|
state.isRecord = newData
|
||||||
|
},
|
||||||
|
|
||||||
|
// 公共手动记录内容
|
||||||
|
changePublicRecord(state, newData) {
|
||||||
|
state.PublicRecord = newData
|
||||||
|
},
|
||||||
|
// 公共手动弹框
|
||||||
|
changeTsPublicRecord(state, newData) {
|
||||||
|
state.isPublicRecord = newData
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 计时
|
||||||
|
changeConfigInfo(state, newData) {
|
||||||
|
state.configInfo = newData
|
||||||
|
},
|
||||||
|
// 计食器
|
||||||
|
changeCountFoodInfo(state, newData) {
|
||||||
|
state.countFoodInfo = newData
|
||||||
|
},
|
||||||
|
// 蓝牙起否连接
|
||||||
|
getIsUseBluetooth(state, newData) {
|
||||||
|
Object.assign(state.UseBlueConfig, newData)
|
||||||
|
},
|
||||||
|
// 蓝牙信息
|
||||||
|
changeBluetoothValue(state, newData) {
|
||||||
|
Object.assign(state.bleValue, newData)
|
||||||
|
},
|
||||||
|
//蓝牙状态
|
||||||
changeBluetooth(state, newData) {
|
changeBluetooth(state, newData) {
|
||||||
state.isBluetoothTyle = newData
|
state.isBluetoothTyle = newData
|
||||||
},
|
},
|
||||||
// 蓝牙起否连接
|
|
||||||
changeConnected(state, newData) {
|
|
||||||
state.isConnected = newData
|
|
||||||
},
|
|
||||||
// 用户设备列表
|
|
||||||
changeUserDeviceList(state, newData) {
|
|
||||||
state.userDeviceList = newData
|
|
||||||
}, //
|
|
||||||
changedevicesList(state, newData) {
|
|
||||||
state.devicesList = newData
|
|
||||||
},
|
|
||||||
// 公共卡片
|
|
||||||
changeLabelList(state, newData) {
|
|
||||||
state.labelList = newData
|
|
||||||
},
|
|
||||||
// 城市
|
|
||||||
changeCityList(state, newData) {
|
|
||||||
state.cityList = newData
|
|
||||||
},
|
|
||||||
changeGradeList(state, newData) {
|
|
||||||
state.gradeList = newData
|
|
||||||
},
|
|
||||||
changeIdentityList(state, newData) {
|
|
||||||
state.identityList = newData
|
|
||||||
},
|
|
||||||
changePublicAdd(state, newData) {
|
|
||||||
state.isPublicRecord = newData
|
|
||||||
},
|
|
||||||
// 合作服务
|
|
||||||
changeCooperationUrl(state, newData) {
|
|
||||||
state.CooperationUrl = newData
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// 模块化vuex
|
// 模块化vuex
|
||||||
modules: {},
|
modules: {},
|
||||||
|
|
|
||||||
|
|
@ -1,85 +1,458 @@
|
||||||
import $store from '@/store'
|
import $store from '@/store'
|
||||||
import $Bluetooth from '@/toolJs/Bluetooth.js'
|
import useBluetooth from '@/toolJs/Bluetooth.js'
|
||||||
import $tools from '@/toolJs/tools.js'
|
import $tools from '@/toolJs/tools.js'
|
||||||
let myTime;
|
import $data from '@/content.json'
|
||||||
|
// // 蓝牙连接
|
||||||
|
let unitList = []
|
||||||
let devicesList = []
|
let devicesList = []
|
||||||
|
let searchTimer = null
|
||||||
|
let UNIT_MAP = $data.units
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
str2Num,
|
|
||||||
handleDevicesMac,
|
|
||||||
openBluetoothAdapter,
|
openBluetoothAdapter,
|
||||||
startBluetoothDeviceDiscovery,
|
startBluetoothDeviceDiscovery,
|
||||||
onBluetoothDeviceFound,
|
onBluetoothDeviceFound,
|
||||||
getBluetoothAdapter,
|
Bluetoothfilter,
|
||||||
handleDevice,
|
createBLEConnection,
|
||||||
onBLEConnectionStateChange,
|
getBLEDeviceServices,
|
||||||
closeBLEConnection,
|
getBLEDeviceCharacteristics,
|
||||||
closeBluetoothAdapter,
|
closeBluetoothAdapter,
|
||||||
|
closeBLEConnection,
|
||||||
|
getBLECharacteristicValueChange,
|
||||||
|
onBLEConnectionStateChange,
|
||||||
stopBluetoothDevicesDiscovery
|
stopBluetoothDevicesDiscovery
|
||||||
}
|
}
|
||||||
|
// // 初始化蓝牙
|
||||||
// 蓝牙连接
|
|
||||||
function openBluetoothAdapter() {
|
function openBluetoothAdapter() {
|
||||||
|
devicesList = []
|
||||||
|
unitList = []
|
||||||
|
clearTimeout(searchTimer);
|
||||||
uni.openBluetoothAdapter({
|
uni.openBluetoothAdapter({
|
||||||
success: e => {
|
success: e => {
|
||||||
$store.commit("changeBluetooth", true)
|
$store.commit("changeBluetoothValue", {
|
||||||
$Bluetooth.startBluetoothDeviceDiscovery()
|
bleTipsText: "蓝牙搜索中",
|
||||||
console.log('初始化蓝牙成功:' + e.errMsg);
|
isConnectStatus: 0,
|
||||||
|
unitList: $data.unitMinus,
|
||||||
|
})
|
||||||
|
startBluetoothDeviceDiscovery()
|
||||||
},
|
},
|
||||||
fail: e => {
|
fail: err => {
|
||||||
$Bluetooth.getBluetoothAdapter(e)
|
$store.commit("changeBluetoothValue", {
|
||||||
|
bleTipsText: "连接超时,点击重新连接",
|
||||||
|
isConnectStatus: 1,
|
||||||
|
unitList: $data.unitMinus,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 开始搜寻附近的蓝牙外围设备
|
// 开始搜寻附近的蓝牙外围设备
|
||||||
function startBluetoothDeviceDiscovery() {
|
function startBluetoothDeviceDiscovery() {
|
||||||
devicesList = []
|
|
||||||
uni.startBluetoothDevicesDiscovery({
|
uni.startBluetoothDevicesDiscovery({
|
||||||
allowDuplicatesKey: true,
|
allowDuplicatesKey: true,
|
||||||
interval: 200, //上报设备的间隔
|
interval: 200, //上报设备的间隔
|
||||||
services: [],
|
|
||||||
success: res => {
|
success: res => {
|
||||||
$Bluetooth.onBluetoothDeviceFound();
|
onBluetoothDeviceFound();
|
||||||
|
searchTimer = setTimeout(() => {
|
||||||
|
uni.stopBluetoothDevicesDiscovery()
|
||||||
|
if (!devicesList.length) {
|
||||||
|
clearTimeout(searchTimer);
|
||||||
|
$store.commit("changeBluetoothValue", {
|
||||||
|
bleTipsText: "连接超时,点击重新连接",
|
||||||
|
isConnectStatus: 1
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, 30000); // 30秒超时
|
||||||
},
|
},
|
||||||
fail: res => {
|
fail: res => {
|
||||||
$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
|
$store.commit("changeBluetoothValue", {
|
||||||
|
bleTipsText: "连接超时,点击重新连接",
|
||||||
|
isConnectStatus: 1
|
||||||
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发现外围设备
|
* 发现外围设备
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function onBluetoothDeviceFound() {
|
function onBluetoothDeviceFound() {
|
||||||
uni.onBluetoothDeviceFound(res => {
|
uni.onBluetoothDeviceFound(res => {
|
||||||
console.log('开始监听寻找到新设备的事件', res);
|
|
||||||
res.devices.forEach(device => {
|
res.devices.forEach(device => {
|
||||||
if (!device.name && !device.localName) {
|
if (!device.name && !device.localName) {
|
||||||
|
device.advertisData = device.advertisData ? device.advertisData : ''
|
||||||
|
let value = $tools.ab2hex(device.advertisData, "")
|
||||||
|
let type = value.substring(0, 2)
|
||||||
|
let id = value.substring(12, 16)
|
||||||
|
if (type.toLowerCase() == 'c0') {
|
||||||
|
clearTimeout(searchTimer);
|
||||||
|
device.deviceName = "c00002"
|
||||||
|
Bluetoothfilter(device)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (device.name.indexOf('YPC') != -1) {
|
if (device.name.toLowerCase().indexOf('pc-c06pro') != -1 ||
|
||||||
let buff = device.name.slice(7, 19)
|
device.name.toLowerCase().indexOf('pc-c02pro') != -1 ||
|
||||||
device.macAddr = $Bluetooth.str2Num(buff)
|
device.name.toLowerCase().indexOf('pc-c09pro') != -1 ||
|
||||||
device.deviceId = device.deviceId
|
(device.localName && device.localName.toLowerCase().indexOf('pc-c06pro') != -1) ||
|
||||||
$Bluetooth.stopBluetoothDevicesDiscovery()
|
(device.localName && device.localName.toLowerCase().indexOf('pc-c02pro') != -1) ||
|
||||||
$Bluetooth.handleDevice(device)
|
(device.localName && device.localName.toLowerCase().indexOf('pc-c09pro') != -1)) {
|
||||||
console.log("ypc", device)
|
clearTimeout(searchTimer);
|
||||||
|
const bytes = new Uint8Array(device.advertisData);
|
||||||
|
const macBytes = bytes.slice(6, 12);
|
||||||
|
device.macAddr = $tools.ab2hex(macBytes, ':').toUpperCase()
|
||||||
|
stopBluetoothDevicesDiscovery()
|
||||||
|
Bluetoothfilter(device)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (device.name.toLowerCase().indexOf("g02") != -1 ||
|
||||||
|
device.name.toLowerCase().indexOf('ypc') != -1 ||
|
||||||
|
device.name.toLowerCase().indexOf('pc-x01') != -1 ||
|
||||||
|
device.name.toLowerCase().indexOf('da') != -1 ||
|
||||||
|
device.name.toLowerCase().indexOf('pcl') != -1 ||
|
||||||
|
device.name.toLowerCase().indexOf('pcf01') != -1 ||
|
||||||
|
device.name.toLowerCase().indexOf('Yihejia_Lung') != -1) {
|
||||||
|
clearTimeout(searchTimer);
|
||||||
|
const bytes = new Uint8Array(device.advertisData);
|
||||||
|
const macBytes = bytes.slice(6, 12);
|
||||||
|
device.macAddr = $tools.ab2hex(macBytes, ':').toUpperCase()
|
||||||
|
stopBluetoothDevicesDiscovery()
|
||||||
|
Bluetoothfilter(device)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 蓝牙过滤
|
// 蓝牙过滤
|
||||||
function handleDevice(device) {
|
function Bluetoothfilter(device) {
|
||||||
const foundDevices = devicesList
|
const foundDevices = devicesList
|
||||||
const idx = $tools.inArray(foundDevices, "deviceId", device.deviceId)
|
const idx = $tools.inArray(foundDevices, "deviceId", device.deviceId)
|
||||||
console.log("ind", idx, devicesList, device)
|
|
||||||
if (idx === -1) {
|
if (idx === -1) {
|
||||||
devicesList.push(device);
|
devicesList.push(device);
|
||||||
$store.commit("changedevicesList", devicesList);
|
// 体脂秤
|
||||||
return
|
if (device.name.toLowerCase().indexOf("pcl") != -1) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pageTwo/devices/PCL?deviceId=" + device.deviceId
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 思迈德协议,假阻抗,体脂秤
|
||||||
|
if (device.name.toLowerCase() == "c00002") {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pageTwo/devices/PCL22?deviceId=" + device.deviceId
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 思迈德协议,假阻抗,体脂秤
|
||||||
|
if (device.name.toLowerCase() == "da") {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pageTwo/devices/PCL22S?deviceId=" + device.deviceId
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 身高仪
|
||||||
|
if (device.name.indexOf("G02") != -1) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pageTwo/devices/G02?deviceId=" + device.deviceId
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 跳绳
|
||||||
|
if (device.name.indexOf("YPC") != -1) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/skiping/skip?deviceId=" + device.deviceId
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 婴儿秤
|
||||||
|
if (device.name.indexOf("Chipsea_BLE") != -1) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pageTwo/devices/B20?deviceId=" + device.deviceId
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 心率秤
|
||||||
|
if (device.name.toLowerCase().indexOf('pc-x01') != -1) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pageTwo/devices/PCX01?deviceId=" + device.deviceId
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//厨房秤
|
||||||
|
if (device.name.toLowerCase().indexOf('pc-c06pro') != -1 ||
|
||||||
|
device.name.toLowerCase().indexOf('pc-c02pro') != -1 ||
|
||||||
|
device.name.toLowerCase().indexOf('pc-c09pro') != -1) {
|
||||||
|
handleDevType(device)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 排查设备
|
||||||
|
function handleDevType(device) {
|
||||||
|
$model.getCheckDevice({
|
||||||
|
mac: device.macAddr,
|
||||||
|
}).then(res => {
|
||||||
|
console.log("排查设备:", device, res)
|
||||||
|
if (res.code == 0) {
|
||||||
|
createBLEConnection(device.deviceId)
|
||||||
|
} else {
|
||||||
|
devicesList = []
|
||||||
|
$tools.msg('设备未登记,请联系出售方进行系统认证')
|
||||||
|
$store.commit("changeBluetoothValue", {
|
||||||
|
type: 1,
|
||||||
|
isConnectStatus: 1,
|
||||||
|
bleTipsText: "连接超时,点击重新连接",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//连接设备
|
||||||
|
function createBLEConnection(device_id) {
|
||||||
|
uni.createBLEConnection({
|
||||||
|
deviceId: device_id,
|
||||||
|
success: res => {
|
||||||
|
setTimeout(function() {
|
||||||
|
getBLEDeviceServices(device_id)
|
||||||
|
}, 200)
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
$store.commit("changeBluetoothValue", {
|
||||||
|
type: 1,
|
||||||
|
isConnectStatus: 1,
|
||||||
|
bleTipsText: "连接超时,点击重新连接",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取设备的UUID
|
||||||
|
*/
|
||||||
|
function getBLEDeviceServices(device_id) {
|
||||||
|
let serviceList = [];
|
||||||
|
uni.getBLEDeviceServices({
|
||||||
|
deviceId: device_id,
|
||||||
|
success: res => {
|
||||||
|
console.log("获取设备的UUID成功", res)
|
||||||
|
stopBluetoothDevicesDiscovery();
|
||||||
|
serviceList = res.services;
|
||||||
|
for (let i = 0; i < serviceList.length; i++) {
|
||||||
|
let service = serviceList[i];
|
||||||
|
if (service.uuid.indexOf("FFF0") != -1) {
|
||||||
|
getBLEDeviceCharacteristics(device_id, service.uuid);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
$store.commit("changeBluetoothValue", {
|
||||||
|
type: 1,
|
||||||
|
isConnectStatus: 1,
|
||||||
|
bleTipsText: "连接超时,点击重新连接",
|
||||||
|
})
|
||||||
|
console.log('获取设备的UUID失败:', res)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定服务的特征值
|
||||||
|
*/
|
||||||
|
function getBLEDeviceCharacteristics(deviceId, serviceId) {
|
||||||
|
let characteristicsList = [];
|
||||||
|
uni.getBLEDeviceCharacteristics({
|
||||||
|
deviceId: deviceId,
|
||||||
|
serviceId: serviceId,
|
||||||
|
success: res => {
|
||||||
|
let write, notify
|
||||||
|
for (let i = 0; i < res.characteristics.length; i++) {
|
||||||
|
let item = res.characteristics[i];
|
||||||
|
if (item.uuid.indexOf('0000FFF2') != -1) {
|
||||||
|
write = item.uuid
|
||||||
|
} else if (item.uuid.indexOf('0000FFF1') != -1) {
|
||||||
|
notify = item.uuid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getBLECharacteristicValueChange(deviceId, serviceId, notify, write)
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
$store.commit("changeBluetoothValue", {
|
||||||
|
type: 1,
|
||||||
|
isConnectStatus: 1,
|
||||||
|
bleTipsText: "连接超时,点击重新连接",
|
||||||
|
})
|
||||||
|
console.log('获取特征值失败:', JSON.stringify(res))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function getBLECharacteristicValueChange(deviceId, serviceId, notify, write) {
|
||||||
|
let that = this
|
||||||
|
uni.notifyBLECharacteristicValueChange({
|
||||||
|
deviceId: deviceId,
|
||||||
|
serviceId: serviceId,
|
||||||
|
characteristicId: notify,
|
||||||
|
state: true,
|
||||||
|
success: () => {
|
||||||
|
$store.commit('changeBluetoothValue', {
|
||||||
|
deviceId: deviceId,
|
||||||
|
serviceId: serviceId,
|
||||||
|
notify: notify,
|
||||||
|
write: write,
|
||||||
|
unit: "g",
|
||||||
|
type: 1,
|
||||||
|
countWeight: "",
|
||||||
|
bleTipsText: "测量中,请将食物放到秤上",
|
||||||
|
isConnectStatus: 2
|
||||||
|
})
|
||||||
|
uni.onBLECharacteristicValueChange(function(res) {
|
||||||
|
const value = res.value
|
||||||
|
const dataView = new DataView(value)
|
||||||
|
const header = dataView.getUint8(0)
|
||||||
|
// MCU主动上报数据
|
||||||
|
if (header === 0xC7) {
|
||||||
|
const cmd = dataView.getUint8(2)
|
||||||
|
|
||||||
|
switch (cmd) {
|
||||||
|
case 0x02:
|
||||||
|
const statusByte = dataView.getUint8(4)
|
||||||
|
const isNegative = !!(statusByte & 0x80) // 最高位表示正负
|
||||||
|
const statusType = statusByte & 0x0F // 状态类型
|
||||||
|
|
||||||
|
// 组合24位重量值 (大端序)
|
||||||
|
const weightValue =
|
||||||
|
(dataView.getUint8(5) << 16) |
|
||||||
|
(dataView.getUint8(6) << 8) |
|
||||||
|
dataView.getUint8(7)
|
||||||
|
|
||||||
|
// 精度和单位
|
||||||
|
const unitByte = dataView.getUint8(8)
|
||||||
|
const precision = (unitByte & 0xF0) >> 4 // 高4位精度
|
||||||
|
const unitIndex = unitByte & 0x0F // 低4位单位
|
||||||
|
|
||||||
|
// 计算实际重量
|
||||||
|
let finalWeight = weightValue / Math.pow(10, precision)
|
||||||
|
console.log("类型:", cmd, "重量",
|
||||||
|
finalWeight, "小数点", precision, "单位", UNIT_MAP[unitIndex])
|
||||||
|
|
||||||
|
if (isNegative) finalWeight = -finalWeight
|
||||||
|
$store.commit("changeBluetoothValue", {
|
||||||
|
countWeight: finalWeight,
|
||||||
|
unit: UNIT_MAP[unitIndex],
|
||||||
|
type: statusType
|
||||||
|
})
|
||||||
|
break
|
||||||
|
|
||||||
|
case 0x03:
|
||||||
|
break
|
||||||
|
case 0x08:
|
||||||
|
const start0 = []
|
||||||
|
const value2 = $tools.ab2hex(res.value, "");
|
||||||
|
const start = parseUnitMask(value2.substring(8, 10), UNIT_MAP.slice(0,
|
||||||
|
7))
|
||||||
|
const start1 = parseUnitMask(value2.substring(10, 12), UNIT_MAP.slice(8,
|
||||||
|
10))
|
||||||
|
start.push.apply(start, start1)
|
||||||
|
if (start.length) {
|
||||||
|
$data.unitMinus.forEach(item => {
|
||||||
|
start.forEach(item2 => {
|
||||||
|
if (item.unit == item2) {
|
||||||
|
start0.push(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
$store.commit("changeBluetoothValue", {
|
||||||
|
unitList: start0.length ? start0 : $data.unitMinus
|
||||||
|
})
|
||||||
|
console.log("2222222", start, start0)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
console.log('获取特征值失败:', JSON.stringify(res))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获取服务
|
||||||
|
// function getBLEDeviceServices(uuid) {
|
||||||
|
// let serviceList = [];
|
||||||
|
// let serviceId = ""
|
||||||
|
// uni.getBLEDeviceServices({
|
||||||
|
// deviceId: deviceId,
|
||||||
|
// success: res => {
|
||||||
|
// console.log("获取设备的UUID成功", res)
|
||||||
|
// serviceList = res.services;
|
||||||
|
// for (let i = 0; i < serviceList.length; i++) {
|
||||||
|
// let service = serviceList[i];
|
||||||
|
// if (service.uuid.indexOf(uuid) != -1) {
|
||||||
|
// serviceId = service.uuid
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// $store.commit("getIsUseBluetooth", {
|
||||||
|
// serviceId: serviceId
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// fail: res => {
|
||||||
|
// console.log('获取设备的UUID失败:', res)
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 断开蓝牙模块
|
||||||
|
*/
|
||||||
|
function closeBluetoothAdapter() {
|
||||||
|
uni.closeBluetoothAdapter({
|
||||||
|
success: res => {
|
||||||
|
clearTimeout(searchTimer);
|
||||||
|
$store.commit("changeBluetoothValue", {
|
||||||
|
deviceId: "",
|
||||||
|
serviceId: "",
|
||||||
|
notify: "",
|
||||||
|
write: "",
|
||||||
|
unit: "g",
|
||||||
|
countWeight: '',
|
||||||
|
type: 1,
|
||||||
|
unitList: $data.unitMinus,
|
||||||
|
isConnectStatus: 1,
|
||||||
|
bleTipsText: "连接超时,点击重新连接",
|
||||||
|
})
|
||||||
|
console.log('蓝牙模块关闭成功');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 断开蓝牙连接
|
||||||
|
*/
|
||||||
|
function closeBLEConnection(deviceId) {
|
||||||
|
uni.closeBLEConnection({
|
||||||
|
deviceId: deviceId,
|
||||||
|
success: res => {
|
||||||
|
console.log('断开蓝牙连接成功');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 监听蓝牙连接状态
|
||||||
|
function onBLEConnectionStateChange() {
|
||||||
|
uni.onBLEConnectionStateChange(function(res) {
|
||||||
|
console.log("监听蓝牙连接状态", res.connected)
|
||||||
|
if (!res.connected) {
|
||||||
|
$store.commit("changeBluetoothValue", {
|
||||||
|
bleTipsText: "连接超时,点击重新连接",
|
||||||
|
unitList: $data.unitMinus,
|
||||||
|
isConnectStatus: 1,
|
||||||
|
type: 1,
|
||||||
|
})
|
||||||
|
closeBLEConnection()
|
||||||
|
closeBluetoothAdapter()
|
||||||
|
}
|
||||||
|
$store.commit("changeBluetooth", res.connected);
|
||||||
|
})
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 停止搜索蓝牙设备
|
* 停止搜索蓝牙设备
|
||||||
*/
|
*/
|
||||||
|
|
@ -90,114 +463,27 @@ function stopBluetoothDevicesDiscovery() {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 监听蓝牙连接状态
|
|
||||||
function onBLEConnectionStateChange() {
|
|
||||||
uni.onBLEConnectionStateChange(function(res) {
|
|
||||||
console.log("蓝牙连接状态", JSON.stringify(res));
|
|
||||||
if (!res.connected) {
|
|
||||||
$Bluetooth.closeBLEConnection()
|
|
||||||
$Bluetooth.closeBluetoothAdapter()
|
|
||||||
}
|
|
||||||
$store.commit("changeConnected", res.connected);
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
function parseUnitMask(hexValue, UNIT_MAP) {
|
||||||
* 断开蓝牙模块
|
// 转换为数字
|
||||||
*/
|
const mask = typeof hexValue === 'string' ? parseInt(hexValue, 16) : hexValue;
|
||||||
function closeBluetoothAdapter() {
|
|
||||||
uni.closeBluetoothAdapter({
|
|
||||||
success: res => {
|
|
||||||
console.log('蓝牙模块关闭成功');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 断开蓝牙连接
|
|
||||||
*/
|
|
||||||
function closeBLEConnection(deviceId) {
|
|
||||||
console.log("deviceId", deviceId)
|
|
||||||
uni.closeBLEConnection({
|
|
||||||
deviceId: deviceId,
|
|
||||||
success: res => {
|
|
||||||
console.log('断开蓝牙连接成功');
|
|
||||||
$store.commit("changeConnected", false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function str2Num(str) {
|
// 验证输入
|
||||||
var result = "";
|
if (isNaN(mask) || mask < 0 || mask > 0xFF) {
|
||||||
for (let i = 0; i < str.length - 2; i++) {
|
console.error('无效的位掩码值');
|
||||||
result += str[i];
|
return [];
|
||||||
if (i % 2 === 1) result += ':';
|
|
||||||
}
|
}
|
||||||
return result + str.slice(-2)
|
|
||||||
}
|
// 存储结果
|
||||||
// 蓝牙连接
|
const usedUnits = [];
|
||||||
function handleDevicesMac(device, acd_id) {
|
|
||||||
console.log("卡片设备", device, acd_id)
|
// 遍历每一位
|
||||||
// if (device == 'true' || device || device == true) {
|
for (let i = 0; i < 8; i++) {
|
||||||
uni.openBluetoothAdapter({
|
// 使用位运算检查第 i 位是否为 1
|
||||||
success: e => {
|
if (mask & (1 << i)) {
|
||||||
$store.commit("changeBluetooth", true);
|
usedUnits.push(UNIT_MAP[i]);
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/devices/search?id=" + acd_id + '&device=' + device
|
|
||||||
})
|
|
||||||
console.log('初始化蓝牙成功:' + e.errMsg);
|
|
||||||
},
|
|
||||||
fail: err => {
|
|
||||||
console.log('初始化蓝牙失败:' + err.errMsg);
|
|
||||||
return $Bluetooth.getBluetoothAdapter(err)
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
// } else {
|
|
||||||
// $tools.msg("请先添加设备!")
|
|
||||||
// setTimeout(function() {
|
|
||||||
// uni.navigateTo({
|
|
||||||
// url: "/pageTwo/business/business"
|
|
||||||
// })
|
|
||||||
// }, 500)
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
// 蓝牙连接失败
|
|
||||||
function getBluetoothAdapter(err) {
|
|
||||||
if (err.errMsg == "openBluetoothAdapter:fail auth denied" || err.errMsg ===
|
|
||||||
"openBluetoothAdapter:fail auth deny" ||
|
|
||||||
err.errMsg === "openBluetoothAdapter:fail authorize no response"
|
|
||||||
) {
|
|
||||||
uni.showModal({
|
|
||||||
title: "提示",
|
|
||||||
content: "需要您授权使用手机蓝牙",
|
|
||||||
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 => {
|
|
||||||
$tools.showModal("手机蓝牙未打开")
|
|
||||||
console.log('初始化蓝牙失败:' + err.errMsg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: "获取权限失败,将无法使用手机蓝牙进行测量",
|
|
||||||
icon: "none"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
$tools.showModal("手机蓝牙未打开")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return usedUnits;
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import tools from '@/toolJs/tools.js'
|
import tools from '@/toolJs/tools.js'
|
||||||
import store from '../store'
|
import store from '../store'
|
||||||
let baseUrl = "https://tc.pcxbc.com"
|
let baseUrl = "https://tc.pcxbc.com/reedaw"
|
||||||
// let baseUrl = "https://tc.pcxbc.com/testedition"
|
// let baseUrl = "https://tc.pcxbc.com/testedition"
|
||||||
const httpRequest = (url, method = "get", data) => {
|
const httpRequest = (url, method = "get", data) => {
|
||||||
let httpDefaultOpts = {
|
let httpDefaultOpts = {
|
||||||
|
|
@ -44,6 +44,28 @@ const httpRequest = (url, method = "get", data) => {
|
||||||
return promise
|
return promise
|
||||||
|
|
||||||
};
|
};
|
||||||
|
function uploadFile(url, filePath) {
|
||||||
|
let promise = new Promise((resolve, reject) => {
|
||||||
|
uni.uploadFile({
|
||||||
|
url: baseUrl + url,
|
||||||
|
filePath: filePath.uploadpath.tempFilePath,
|
||||||
|
name: 'image',
|
||||||
|
formData: {
|
||||||
|
token: uni.getStorageSync('token') // 其他表单数据,如 token
|
||||||
|
},
|
||||||
|
}).then(res => {
|
||||||
|
if (res[1].statusCode == 200) {
|
||||||
|
var json = JSON.parse(res[1].data)
|
||||||
|
if (json.code != 0) {
|
||||||
|
tools.msg(json.message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
resolve(json)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
return promise
|
||||||
|
};
|
||||||
const get = (url, data) => {
|
const get = (url, data) => {
|
||||||
data.token = uni.getStorageSync('token')
|
data.token = uni.getStorageSync('token')
|
||||||
data.aan_id = uni.getStorageSync('aan_id')
|
data.aan_id = uni.getStorageSync('aan_id')
|
||||||
|
|
@ -55,8 +77,12 @@ const post = (url, data) => {
|
||||||
data.aan_id = uni.getStorageSync('aan_id')
|
data.aan_id = uni.getStorageSync('aan_id')
|
||||||
return httpRequest(url, 'post', data)
|
return httpRequest(url, 'post', data)
|
||||||
}
|
}
|
||||||
|
const upload = (url, filePath) => {
|
||||||
|
return uploadFile(url, filePath)
|
||||||
|
}
|
||||||
export default {
|
export default {
|
||||||
baseUrl,
|
baseUrl,
|
||||||
get,
|
get,
|
||||||
post
|
post,
|
||||||
|
upload
|
||||||
}
|
}
|
||||||
423
toolJs/model.js
|
|
@ -4,7 +4,7 @@ import store from '@/store'
|
||||||
export default {
|
export default {
|
||||||
// 登录
|
// 登录
|
||||||
getonlogin(param) { // 登录
|
getonlogin(param) { // 登录
|
||||||
return http.post("/login_action", param).then(res => {
|
return http.post("/login", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -14,7 +14,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getregister(param) { // 注册
|
getregister(param) { // 注册
|
||||||
return http.post("/register_action", param).then(res => {
|
return http.post("/register", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -23,22 +23,27 @@ export default {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getdeleteAccount(param) { // 删除用户
|
|
||||||
return http.post("/delete_account", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getResetPassword(param) { // 重置密码
|
getResetPassword(param) { // 重置密码
|
||||||
return http.post("/reset_password", param).then(res => {
|
return http.post("/reset_password", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getloginOut(param) { // 退出登录
|
getloginOut(param) { // 退出登录
|
||||||
return http.post("/user_quit_account", param).then(res => {
|
return http.post("/quit_account", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getloginversion(param) { // 版本检测
|
getdeleteAccount(param) { // 账户注销
|
||||||
|
return http.post("/delete_account", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getHomeConfig(param) { // 配置接口
|
||||||
|
return http.post("/config", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getLoginVersion(param) { // 版本信息
|
||||||
return http.post("/login_invalid_version", param).then(res => {
|
return http.post("/login_invalid_version", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
|
|
@ -49,6 +54,11 @@ export default {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getUserInfo(param) { // 用户信息详情
|
||||||
|
return http.post("/get_user_data_information", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
getAccountPassword(param) { // 修改密码
|
getAccountPassword(param) { // 修改密码
|
||||||
return http.post("/update_my_password", param).then(res => {
|
return http.post("/update_my_password", param).then(res => {
|
||||||
return res
|
return res
|
||||||
|
|
@ -64,202 +74,160 @@ export default {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getEditUser(param) { // 修改成员资料
|
||||||
// 首页
|
return http.post("/update_member", param).then(res => {
|
||||||
getUserInfo(param) { // 成员详情
|
|
||||||
return http.post("/get_user_data_information", param).then(res => {
|
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getAddUser(param) { // 添加成员
|
||||||
|
return http.post("/add_member", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getDelUser(param) { // 删除成员
|
||||||
|
return http.post("/del_member", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 身体数据接口
|
||||||
getUserList(param) { // 成员列表
|
getUserList(param) { // 成员列表
|
||||||
return http.post("/get_user_card_list", param).then(res => {
|
return http.post("/get_user_list", param).then(res => {
|
||||||
if (res.data.length) {
|
if (res.data.user_list.length) {
|
||||||
let options = [{
|
let options = [{
|
||||||
text: '删除',
|
text: '删除',
|
||||||
style: {
|
style: {
|
||||||
backgroundColor: '#dd524d'
|
backgroundColor: '#dd524d'
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
res.data.forEach(item => {
|
res.data.user_list.forEach(item => {
|
||||||
item.options = options
|
item.options = options
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getDelUser(param) { // 删除成员
|
|
||||||
return http.post("/del_user_data", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getEditUser(param) { // 修改成员资料
|
|
||||||
return http.post("/update_user_data", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getAddUser(param) { // 添加成员
|
|
||||||
return http.post("/create_user_data", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getGradeList(param) { // 获取年级、身份、地区列表
|
|
||||||
return http.post("/get_grade_list", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getCardAllList(param) { // 获取所有卡片
|
|
||||||
return http.post("/get_card_all_list", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getCardAllOrder(param) { // 保存卡片顺序
|
|
||||||
return http.post("/save_user_card_order", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 身体数据卡片
|
|
||||||
getfirstweight(param) { //修改初始体重
|
|
||||||
return http.post("/card_modify_weight", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getinsertmeasure(param) { //手动记录
|
getinsertmeasure(param) { //手动记录
|
||||||
return http.post('/card_manual_recording', param).then(res => {
|
return http.post('/manual_record', param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getResult(param) { //获取测量报告
|
getmeasurefunit(param) { //设备记录,保存测量结果
|
||||||
return http.post("/card_data_detailed", param).then(res => {
|
return http.post("/device_record", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getTrendList(param) { //趋势
|
getResultDepth(param) { //深度报告
|
||||||
return http.post("/card_curve_chart", param).then(res => {
|
return http.post("/body_report_depth", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getmeasurefunit(param) { //保存测量结果
|
getResultDetail(param) { //获取测量详情报告
|
||||||
return http.post("/card_manual_recording_device", param).then(res => {
|
return http.post("/body_report_detailed", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 跳绳
|
getResultHome(param) { //获取测量报告,首页展示
|
||||||
getSkipResult(param) { //获取测量报告
|
return http.post("/body_report_brief", param).then(res => {
|
||||||
return http.post("/skip_today_data", param).then(res => {
|
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getskipmeasure(param) { //手动记录
|
getTargetweight(param) { //设置目标体重
|
||||||
return http.post('/skip_manual_recording', param).then(res => {
|
return http.post("/set_target_weight", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getskipResult(param) { //测量报告
|
getfirstweight(param) { //修改初始体重
|
||||||
return http.post('/skip_manual_recording_device', param).then(res => {
|
return http.post("/set_initial_weight", param).then(res => {
|
||||||
return 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
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getMeasureLung(param) { //添加测量记录
|
|
||||||
return http.post('/vitalcapacity_save_record_data_device', param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getLungTrendList(param) { //趋势
|
|
||||||
return http.post("/vitalcapacity_curve_chart", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 估分
|
|
||||||
getSportshistory(param) { //历史
|
|
||||||
return http.post("/sportstesting_get_all_list", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getSportshistorydetail(param) { //历史详情
|
|
||||||
return http.post("/sportstesting_get_one_details", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getSportsListAll(param) { //获取地区所有项目列表
|
|
||||||
return http.post("/sportstesting_get_region_list", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getSportsList(param) { //获取单个项目列表
|
|
||||||
return http.post("/sportstesting_get_type_list", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getSportsData(param) { //开始估分
|
|
||||||
return http.post("/sportstesting_set_once_data", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getCityList(param) { //获取地区
|
|
||||||
return http.post("/sportstesting_get_city_list", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 设备管理
|
|
||||||
getDeviceList(param) { //获取系统设备列表
|
|
||||||
return http.post("/device_data_list", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getBinding(param) { //绑定系统设备
|
|
||||||
return http.post("/device_binding", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getUserDeviceList(param) { //获取用户设备列表
|
|
||||||
return http.post("/device_user_data_list", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getUnbinding(param) { //解绑系统设备
|
|
||||||
return http.post("/device_unbinding", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getdevdetail(param) { //根据Mac地址获取设备详情
|
|
||||||
return http.post("/device_mac_get_content", param).then(res => {
|
|
||||||
return res
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 公共
|
|
||||||
gethistory(param) { //历史记录
|
gethistory(param) { //历史记录
|
||||||
return http.post("/get_all_record_data_page", param).then(res => {
|
return http.post("/history_list_page", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
gethistorydetail(param) { //历史记录详情
|
gethistorydetail(param) { //历史记录详情
|
||||||
return http.post("/get_all_record_detailed_information", param).then(res => {
|
return http.post("/history_detailed", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
gethistorydelete(param) { //删除历史记录
|
gethistorydelete(param) { //删除历史记录
|
||||||
return http.post("/card_del_record_data", param).then(res => {
|
return http.post("/history_del", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getresultdiff(param) { //记录对比
|
getTrendList(param) { //趋势
|
||||||
return http.post("/get_all_record_data_group", param).then(res => {
|
return http.post("/curve_detailed", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 卡片
|
||||||
|
getCardAllList(param) { // 获取所有卡片
|
||||||
|
return http.post("/card_list_all", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getCardAllOrder(param) { // 保存卡片
|
||||||
|
return http.post("/save_card_list", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 身高预测
|
||||||
|
GetPredictheight(param) {
|
||||||
|
return http.post("/genetic_height", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// BMI预测
|
||||||
|
calcbmi(param) {
|
||||||
|
return http.post("/bmi_evaluation", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 跳绳
|
||||||
|
getSkipDataResult(param) { //获取测量报告
|
||||||
|
return http.post("/skip/data_report", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getSkipResult(param) { //跳绳新增设备记录
|
||||||
|
return http.post("skip/device_record", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 肺活量
|
||||||
|
getLungDataResult(param) { //获取测量报告
|
||||||
|
return http.post("/vitalcapacity/data_report", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getLungResult(param) { //肺活量新增设备记录
|
||||||
|
return http.post("/vitalcapacity/device_record", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getPublicRecord(param) { //手动记录内容
|
||||||
|
return http.post("/obtain_manual_record_content", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getpublicmeasure(param) { //手动记录
|
||||||
|
return http.post("/card/manual_record", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
getPublicTrendList(param) { //工具曲线
|
||||||
|
return http.post("/card/curve_chart", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getresultdiff(param) { //工具记录对比
|
||||||
|
return http.post("/card/record_list_group", param).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
let Dlist = []
|
let Dlist = []
|
||||||
for (var i = 0; i < res.data.length; i++) {
|
for (var i = 0; i < res.data.length; i++) {
|
||||||
|
|
@ -273,101 +241,152 @@ export default {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getresultcontrast(param) { //对比详情
|
getresultcontrast(param) { //工具对比详情
|
||||||
return http.post("/get_all_card_data_contrast", param).then(res => {
|
return http.post("/card/data_compare", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 通用卡片
|
getPublicHistory(param) { //工具历史
|
||||||
getPublicRecord(param) { //手动记录内容
|
return http.post("/card/record_list_page", param).then(res => {
|
||||||
return http.post("/obtain_manual_record_content", param).then(res => {
|
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getpublicmeasure(param) { //手动记录
|
getPublicHistoryDetail(param) { //工具历史详情
|
||||||
return http.post("/public_data_save", param).then(res => {
|
return http.post("/card/detailed_record", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getpublicContent(param) { //卡片内容详情
|
getPublicHistoryDel(param) { //工具历史删除
|
||||||
return http.post("/get_card_content", param).then(res => {
|
return http.post("/card/del_record", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getLabelList(param) { //卡片内标签项目信息
|
// // // // // // // // // // //
|
||||||
return http.post("/get_label_list", param).then(res => {
|
// 估分
|
||||||
|
getSportsListAll(param) { //获取地区所有项目列表
|
||||||
|
return http.post("/sportstesting/sportstesting_get_region_list", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getPublicTrendList(param) { //公共曲线
|
getSportsData(param) { //开始估分
|
||||||
return http.post("/card_motion_curve", param).then(res => {
|
return http.post("/sportstesting/sportstesting_set_once_data", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getPublicHistory(param) { //公共历史
|
|
||||||
return http.post("/obtain_history_record", param).then(res => {
|
|
||||||
|
// 厨房秤
|
||||||
|
getHomeUserInfo(param) { // 用户饮食信息
|
||||||
|
return http.post("/user_diet_content", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getPublicHistoryDel(param) { //公共历史删除
|
getHomeSearch(param) { // 首页搜索
|
||||||
return http.post("/history_record_del", param).then(res => {
|
return http.post("/search_column", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getPublicResultdiff(param) { //公共对比
|
getFoodSearch(param) { //搜索食材
|
||||||
return http.post("/data_contrast_obtain_data", param).then(res => {
|
return http.post("/get_food_list", param).then(res => {
|
||||||
if (res.code == 0) {
|
|
||||||
let Dlist = []
|
|
||||||
for (var i = 0; i < res.data.length; i++) {
|
|
||||||
if (!Dlist.includes(res.data[i].r_t)) { //includes 检测数组是否有某个值
|
|
||||||
Dlist.push(res.data[i].r_t);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
res.Dlist = Dlist
|
|
||||||
}
|
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 身高预测
|
getMenuSearchColumn(param) { //搜索菜谱
|
||||||
GetPredictheight(param) { //公共历史删除
|
return http.post("/search_column", param).then(res => {
|
||||||
return http.post("/card_height_prediction", param).then(res => {
|
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// BMI预测
|
getPhotoSearch(param) { //图像识别
|
||||||
calcbmi(param) { //公共历史删除
|
return http.post("/search_food_barcode", param).then(res => {
|
||||||
return http.post("/card_bmi_evaluation", param).then(res => {
|
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 资讯
|
|
||||||
getContentMsg(param) { //获取资讯信息
|
getCookListDetails(param) { // 查询菜谱详情
|
||||||
return http.post("/get_sector_content_msg", param).then(res => {
|
return http.post("/cookbook_details", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getContentLabel(param) { //资讯标签类别信息
|
getCookLike(param) { // 点赞收藏菜谱
|
||||||
return http.post("/get_sector_label_msg", param).then(res => {
|
return http.post("/cookbook_like", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getContentLike(param) { //点赞
|
// 计食器
|
||||||
return http.post("/user_like_it", param).then(res => {
|
getAddIntakeFood(param) { // 添加每日摄入记录
|
||||||
|
return http.post("/add_intake_food", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getContentDetail(param) { //资讯详情
|
getAddEveryMealFood(param) { // 当次食材添加的卡路里摄入记录
|
||||||
return http.get("/model_content", param).then(res => {
|
return http.post("/current_food_statistics", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getBannerList(param) { //banner
|
getCountfootCon(param) { // 每日记食器板块详细内容
|
||||||
return http.post("/get_recommend_information", param).then(res => {
|
return http.post("/get_countfoot_content", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCooperationUrl(param) { //合作服务
|
delCEatAction(param) { // 删除餐饮食物
|
||||||
return http.post("/get_business_cooperation_url", param).then(res => {
|
return http.post("/del_user_eat_log", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
delEatListAction(param) { // 删除餐饮食物列表
|
||||||
|
return http.post("/del_user_eat_list_log", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getLogList(param) { // 记食器角色饮食记录列表
|
||||||
|
return http.post("/get_log_list", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getSetUpContent(param) { // 计食器板块-设置里的内容
|
||||||
|
return http.post("/set_up_content", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getSetUserKcal(param) { // 设置用户的卡路里
|
||||||
|
return http.post("/set_user_kcal", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 个人中心
|
||||||
|
getUserCollectList(param) { // 用户收藏点赞列表
|
||||||
|
return http.post("/get_user_collect_list", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getMyLogList(param) { // 饮食列表
|
||||||
|
return http.post("/get_log_list", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 计食器
|
||||||
|
getAddIntakeFood(param) { // 添加每日摄入记录
|
||||||
|
return http.post("/add_intake_food", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getCountFoodInfo(param) { // 获取记食器板块详细内容
|
||||||
|
return http.post("/get_countfoot_content", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getCountSetKcal(param) { // 获取记食器设置里的内容
|
||||||
|
return http.post("/set_up_content", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getCountSetUserKcal(param) { // 设置用户的卡路里
|
||||||
|
return http.post("/set_user_kcal", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getCountSearchmsg(param) { // 猜你喜欢
|
||||||
|
return http.post("/search_default_msg", param).then(res => {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
||||||
121
toolJs/tools.js
|
|
@ -14,10 +14,12 @@ export default {
|
||||||
PrefixZero,
|
PrefixZero,
|
||||||
showModal,
|
showModal,
|
||||||
NewsPtype,
|
NewsPtype,
|
||||||
|
getTime,
|
||||||
compareVersions,
|
compareVersions,
|
||||||
validatePhoneEmail,
|
validatePhoneEmail,
|
||||||
checkPrivacyAgreement,
|
checkPrivacyAgreement,
|
||||||
getBluetoothAdapter
|
mergeAndDeduplicate,
|
||||||
|
handleCancelUpdate
|
||||||
}
|
}
|
||||||
|
|
||||||
function NewsPtype(con) {
|
function NewsPtype(con) {
|
||||||
|
|
@ -42,6 +44,14 @@ function NewsPtype(con) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function msg(str) {
|
||||||
|
uni.showToast({
|
||||||
|
title: str,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 3000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function showModal(text) {
|
function showModal(text) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
|
|
@ -60,8 +70,9 @@ function showModal(text) {
|
||||||
function compareVersions(version1, version2) {
|
function compareVersions(version1, version2) {
|
||||||
console.log("版本对比", version1, version2)
|
console.log("版本对比", version1, version2)
|
||||||
// 将版本号拆分成数字数组
|
// 将版本号拆分成数字数组
|
||||||
var arr1 = version1.split('.').map(Number);;
|
var arr1 = version1.split('.').map(Number);
|
||||||
var arr2 = version2.split('.').map(Number);;
|
var arr2 = version2.split('.').map(Number);
|
||||||
|
var platform = uni.getSystemInfoSync().platform
|
||||||
|
|
||||||
// 遍历数字数组进行逐段比较
|
// 遍历数字数组进行逐段比较
|
||||||
for (var i = 0; i < Math.max(arr1.length, arr2.length); i++) {
|
for (var i = 0; i < Math.max(arr1.length, arr2.length); i++) {
|
||||||
|
|
@ -69,13 +80,28 @@ function compareVersions(version1, version2) {
|
||||||
var num2 = parseInt(arr2[i] || 0);
|
var num2 = parseInt(arr2[i] || 0);
|
||||||
|
|
||||||
if (num1 < num2) {
|
if (num1 < num2) {
|
||||||
return -1; // 版本1小于版本2
|
// 版本1小于版本2
|
||||||
} else if (num1 > num2) {
|
return uni.showModal({
|
||||||
return 1; // 版本1大于版本2
|
title: '发现新版本',
|
||||||
|
content: '检查到新版本' + version2 + ',是否更新?',
|
||||||
|
success: (modalRes) => {
|
||||||
|
if (modalRes.confirm) { //确定更新
|
||||||
|
if (platform === 'android') { //安卓更新
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pageTwo/my/about"
|
||||||
|
})
|
||||||
|
} else { //ios跳转
|
||||||
|
plus.runtime.launchApplication({
|
||||||
|
action: `itms-apps://itunes.apple.com/cn/app/id6654906497?mt=8`
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
that.$tools.msg("稍后可在'关于我们'内更新程序!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0; // 版本1等于版本2
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2进制位数不足补0
|
// 2进制位数不足补0
|
||||||
|
|
@ -102,27 +128,18 @@ function inArray(arr, key, val) {
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
//邮箱、手机号验证
|
||||||
function validatePhoneEmail(input) {
|
function validatePhoneEmail(input) {
|
||||||
const phoneRegex = /^(\+?\d{1,4})?[-\s.]?\(?(\d{3})\)?[-\s.]?(\d{3})[-\s.]?(\d{4})$/;
|
const phoneRegex = /^(\+?\d{1,4})?[-\s.]?\(?(\d{3})\)?[-\s.]?(\d{3})[-\s.]?(\d{4})$/;
|
||||||
const emailRegex = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
|
const emailRegex = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
|
||||||
const isPhone = phoneRegex.test(input);
|
const isPhone = phoneRegex.test(input);
|
||||||
const isEmail = emailRegex.test(input);
|
const isEmail = emailRegex.test(input);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isPhone,
|
isPhone,
|
||||||
isEmail
|
isEmail
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function msg(str) {
|
|
||||||
uni.showToast({
|
|
||||||
title: str,
|
|
||||||
icon: 'none',
|
|
||||||
duration: 3000
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function ab2hex(buffer, split) {
|
function ab2hex(buffer, split) {
|
||||||
var hexArr = Array.prototype.map.call(
|
var hexArr = Array.prototype.map.call(
|
||||||
new Uint8Array(buffer),
|
new Uint8Array(buffer),
|
||||||
|
|
@ -162,7 +179,7 @@ function gethms(type) {
|
||||||
timeList[1] = secondData
|
timeList[1] = secondData
|
||||||
return timeList
|
return timeList
|
||||||
}
|
}
|
||||||
|
// 指定日期起始月
|
||||||
function getMonth(dates, months) {
|
function getMonth(dates, months) {
|
||||||
var d = new Date(dates.substring(0, 10));
|
var d = new Date(dates.substring(0, 10));
|
||||||
let year = d.getFullYear();
|
let year = d.getFullYear();
|
||||||
|
|
@ -255,43 +272,39 @@ function checkPrivacyAgreement() {
|
||||||
return !!isAgreed;
|
return !!isAgreed;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getBluetoothAdapter(err) {
|
// 合并数组并去重
|
||||||
let textLink = ""
|
function mergeAndDeduplicate(arr1, arr2, uniqueKey) {
|
||||||
if (err.errMsg == "openBluetoothAdapter:fail auth denied" || err.errMsg ===
|
let map = new Map();
|
||||||
"openBluetoothAdapter:fail auth deny" ||
|
let mergedArr = [...arr1, ...arr2];
|
||||||
err.errMsg === "openBluetoothAdapter:fail authorize no response"
|
for (let item of mergedArr) {
|
||||||
) {
|
if (!map.has(item[uniqueKey])) {
|
||||||
uni.showModal({
|
map.set(item[uniqueKey], item);
|
||||||
title: "提示",
|
}
|
||||||
content: "需要您授权使用手机蓝牙",
|
}
|
||||||
showCancel: false,
|
return [...map.values()];
|
||||||
success(modalSuccess) {
|
}
|
||||||
uni.openSetting({
|
// 获取当前年、月、日、时、分、秒
|
||||||
success(settingdata) {
|
function getTime() {
|
||||||
if (settingdata.authSetting["scope.bluetooth"]) {
|
var date = new Date()
|
||||||
uni.openBluetoothAdapter({
|
var y = date.getFullYear();
|
||||||
success: e => {
|
var m = (date.getMonth() + 1) < 10 ? "0" + (date.getMonth() + 1) : (date.getMonth() + 1); //获取当前月份的日期,不足10补0
|
||||||
$store.commit("changeBluetooth", true);
|
var d = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
|
||||||
textLink = "蓝牙权限获取成功,重新连接蓝牙"
|
let H = date.getHours() > 9 ? date.getHours() : '0' + date.getHours()
|
||||||
return textLink
|
let Min = date.getMinutes() > 9 ? date.getMinutes() : '0' + date.getMinutes()
|
||||||
},
|
return y + '/' + m + '/' + d + " " + H + ':' + Min
|
||||||
fail: err => {
|
}
|
||||||
textLink = "请打开手机蓝牙后,开始测量"
|
|
||||||
console.log('初始化蓝牙失败:' + err.errMsg);
|
|
||||||
return textLink
|
|
||||||
|
|
||||||
}
|
// 未登录及取消更新
|
||||||
});
|
function handleCancelUpdate(code) {
|
||||||
} else {
|
if (code == 0) {
|
||||||
textLink = "获取权限失败,将无法使用手机蓝牙进行测量"
|
$store.dispatch('getFamilyList', {
|
||||||
return textLink
|
type: 2
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
textLink = "请打开手机蓝牙后,开始测量"
|
setTimeout(() => {
|
||||||
return textLink
|
uni.reLaunch({
|
||||||
|
url: '/pageTwo/login/login'
|
||||||
|
})
|
||||||
|
}, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
5
uni.scss
|
|
@ -1,4 +1,5 @@
|
||||||
/* 主题色 */
|
/* 主题色 */
|
||||||
$maincolor:#37cc92;
|
$maincolor:#54d87c;
|
||||||
$btncolor:#fea606;
|
$btncolor:#fea606;
|
||||||
$textcolor: #37cc92;
|
$textcolor: #54d87c;
|
||||||
|
$yellowcolor:#f0ae43
|
||||||
|
|
|
||||||
|
|
@ -261,11 +261,11 @@
|
||||||
},
|
},
|
||||||
cHeight: {
|
cHeight: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 400
|
default: 150
|
||||||
},
|
},
|
||||||
cWidth: {
|
cWidth: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 600
|
default: 300
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -357,8 +357,8 @@
|
||||||
this.echarts = true;
|
this.echarts = true;
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
this.cWidth = this.cWidth ? this.cWidth : uni.upx2px(640);
|
this.cWidth = this.cWidth ? this.cWidth : uni.upx2px(600);
|
||||||
this.cHeight = this.cHeight ? this.cHeight : uni.upx2px(500);
|
this.cHeight = this.cHeight ? this.cHeight : uni.upx2px(600);
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.beforeInit();
|
this.beforeInit();
|
||||||
})
|
})
|
||||||
|
|
@ -1133,6 +1133,5 @@
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 15px;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -135,32 +135,34 @@ module.exports = {
|
||||||
"ring": {
|
"ring": {
|
||||||
"type": "ring",
|
"type": "ring",
|
||||||
"color": color,
|
"color": color,
|
||||||
|
"animation": false,
|
||||||
"padding": [5, 5, 5, 5],
|
"padding": [5, 5, 5, 5],
|
||||||
"rotate": false,
|
"rotate": false,
|
||||||
"dataLabel": true,
|
"dataLabel": false,
|
||||||
"legend": {
|
"legend": {
|
||||||
"show": true,
|
"show": false,
|
||||||
"position": "right",
|
"position": "right",
|
||||||
"lineHeight": 25,
|
"lineHeight": 25,
|
||||||
},
|
},
|
||||||
"title": {
|
"title": {
|
||||||
"name": "收益率",
|
"name": "",
|
||||||
"fontSize": 15,
|
"fontSize": 22,
|
||||||
"color": "#666666"
|
"color": "#666666"
|
||||||
},
|
},
|
||||||
"subtitle": {
|
"subtitle": {
|
||||||
"name": "70%",
|
"name": "kcal",
|
||||||
"fontSize": 25,
|
"fontSize": 14,
|
||||||
"color": "#7cb5ec"
|
"offsetY": 8,
|
||||||
|
"color": "#888888"
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"ring": {
|
"ring": {
|
||||||
"ringWidth": 30,
|
"ringWidth": 10,
|
||||||
"activeOpacity": 0.5,
|
"activeOpacity": 0.5,
|
||||||
"activeRadius": 10,
|
"activeRadius": 10,
|
||||||
"offsetAngle": 0,
|
"offsetAngle": 0,
|
||||||
"labelWidth": 15,
|
"labelWidth": 0,
|
||||||
"border": true,
|
"border": false,
|
||||||
"borderWidth": 3,
|
"borderWidth": 3,
|
||||||
"borderColor": "#FFFFFF"
|
"borderColor": "#FFFFFF"
|
||||||
},
|
},
|
||||||
|
|
@ -236,19 +238,19 @@ module.exports = {
|
||||||
"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": 10,
|
"width": 8,
|
||||||
"backgroundColor": "#E9E9E9",
|
"backgroundColor": "#E9E9E9",
|
||||||
"startAngle": 0.75,
|
"startAngle": 0.75,
|
||||||
"endAngle": 0.25,
|
"endAngle": 0.25,
|
||||||
|
|
@ -364,7 +366,6 @@ module.exports = {
|
||||||
"padding": [20, 15, 5, 10],
|
"padding": [20, 15, 5, 10],
|
||||||
"xAxis": {
|
"xAxis": {
|
||||||
"disableGrid": true,
|
"disableGrid": true,
|
||||||
"axisLine": false,
|
|
||||||
},
|
},
|
||||||
"yAxis": {
|
"yAxis": {
|
||||||
"gridType": "dash",
|
"gridType": "dash",
|
||||||
|
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
## 1.4.4(2024-03-20)
|
|
||||||
- 修复 titleBorder类型修正
|
|
||||||
## 1.4.3(2022-01-25)
|
|
||||||
- 修复 初始化的时候 ,open 属性失效的bug
|
|
||||||
## 1.4.2(2022-01-21)
|
|
||||||
- 修复 微信小程序resize后组件收起的bug
|
|
||||||
## 1.4.1(2021-11-22)
|
|
||||||
- 修复 vue3中个别scss变量无法找到的问题
|
|
||||||
## 1.4.0(2021-11-19)
|
|
||||||
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
|
|
||||||
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-collapse](https://uniapp.dcloud.io/component/uniui/uni-collapse)
|
|
||||||
## 1.3.3(2021-08-17)
|
|
||||||
- 优化 show-arrow 属性默认为true
|
|
||||||
## 1.3.2(2021-08-17)
|
|
||||||
- 新增 show-arrow 属性,控制是否显示右侧箭头
|
|
||||||
## 1.3.1(2021-07-30)
|
|
||||||
- 优化 vue3下小程序事件警告的问题
|
|
||||||
## 1.3.0(2021-07-30)
|
|
||||||
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
|
|
||||||
## 1.2.2(2021-07-21)
|
|
||||||
- 修复 由1.2.0版本引起的 change 事件返回 undefined 的Bug
|
|
||||||
## 1.2.1(2021-07-21)
|
|
||||||
- 优化 组件示例
|
|
||||||
## 1.2.0(2021-07-21)
|
|
||||||
- 新增 组件折叠动画
|
|
||||||
- 新增 value\v-model 属性 ,动态修改面板折叠状态
|
|
||||||
- 新增 title 插槽 ,可定义面板标题
|
|
||||||
- 新增 border 属性 ,显示隐藏面板内容分隔线
|
|
||||||
- 新增 title-border 属性 ,显示隐藏面板标题分隔线
|
|
||||||
- 修复 resize 方法失效的Bug
|
|
||||||
- 修复 change 事件返回参数不正确的Bug
|
|
||||||
- 优化 H5、App 平台自动更具内容更新高度,无需调用 reszie() 方法
|
|
||||||
## 1.1.7(2021-05-12)
|
|
||||||
- 新增 组件示例地址
|
|
||||||
## 1.1.6(2021-02-05)
|
|
||||||
- 优化 组件引用关系,通过uni_modules引用组件
|
|
||||||
## 1.1.5(2021-02-05)
|
|
||||||
- 调整为uni_modules目录规范
|
|
||||||
|
|
@ -1,402 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="uni-collapse-item">
|
|
||||||
<!-- onClick(!isOpen) -->
|
|
||||||
<view @click="onClick(!isOpen)" class="uni-collapse-item__title"
|
|
||||||
:class="{'is-open':isOpen &&titleBorder === 'auto' ,'uni-collapse-item-border':titleBorder !== 'none'}">
|
|
||||||
<view class="uni-collapse-item__title-wrap">
|
|
||||||
<slot name="title">
|
|
||||||
<view class="uni-collapse-item__title-box" :class="{'is-disabled':disabled}">
|
|
||||||
<image v-if="thumb" :src="thumb" class="uni-collapse-item__title-img" />
|
|
||||||
<text class="uni-collapse-item__title-text">{{ title }}</text>
|
|
||||||
</view>
|
|
||||||
</slot>
|
|
||||||
</view>
|
|
||||||
<view v-if="showArrow"
|
|
||||||
:class="{ 'uni-collapse-item__title-arrow-active': isOpen, 'uni-collapse-item--animation': showAnimation === true }"
|
|
||||||
class="uni-collapse-item__title-arrow">
|
|
||||||
<uni-icons :color="disabled?'#ddd':'#bbb'" size="14" type="bottom" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="uni-collapse-item__wrap" :class="{'is--transition':showAnimation}"
|
|
||||||
:style="{height: (isOpen?height:0) +'px'}">
|
|
||||||
<view :id="elId" ref="collapse--hook" class="uni-collapse-item__wrap-content"
|
|
||||||
:class="{open:isheight,'uni-collapse-item--border':border&&isOpen}">
|
|
||||||
<slot></slot>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// #ifdef APP-NVUE
|
|
||||||
const dom = weex.requireModule('dom')
|
|
||||||
// #endif
|
|
||||||
/**
|
|
||||||
* CollapseItem 折叠面板子组件
|
|
||||||
* @description 折叠面板子组件
|
|
||||||
* @property {String} title 标题文字
|
|
||||||
* @property {String} thumb 标题左侧缩略图
|
|
||||||
* @property {String} name 唯一标志符
|
|
||||||
* @property {Boolean} open = [true|false] 是否展开组件
|
|
||||||
* @property {Boolean} titleBorder = [true|false] 是否显示标题分隔线
|
|
||||||
* @property {String} border = ['auto'|'show'|'none'] 是否显示分隔线
|
|
||||||
* @property {Boolean} disabled = [true|false] 是否展开面板
|
|
||||||
* @property {Boolean} showAnimation = [true|false] 开启动画
|
|
||||||
* @property {Boolean} showArrow = [true|false] 是否显示右侧箭头
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
name: 'uniCollapseItem',
|
|
||||||
props: {
|
|
||||||
// 列表标题
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
name: {
|
|
||||||
type: [Number, String],
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
// 是否禁用
|
|
||||||
disabled: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
// #ifdef APP-PLUS
|
|
||||||
// 是否显示动画,app 端默认不开启动画,卡顿严重
|
|
||||||
showAnimation: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
// #endif
|
|
||||||
// #ifndef APP-PLUS
|
|
||||||
// 是否显示动画
|
|
||||||
showAnimation: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
// #endif
|
|
||||||
// 是否展开
|
|
||||||
open: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
// 缩略图
|
|
||||||
thumb: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
// 标题分隔线显示类型
|
|
||||||
titleBorder: {
|
|
||||||
type: String,
|
|
||||||
default: 'auto'
|
|
||||||
},
|
|
||||||
border: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
},
|
|
||||||
showArrow: {
|
|
||||||
type: Boolean,
|
|
||||||
default: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
// TODO 随机生生元素ID,解决百度小程序获取同一个元素位置信息的bug
|
|
||||||
const elId = `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`
|
|
||||||
return {
|
|
||||||
isOpen: false,
|
|
||||||
isheight: null,
|
|
||||||
height: 0,
|
|
||||||
elId,
|
|
||||||
nameSync: 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
open(val) {
|
|
||||||
this.isOpen = val
|
|
||||||
this.onClick(val, 'init')
|
|
||||||
}
|
|
||||||
},
|
|
||||||
updated(e) {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.init(true)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.collapse = this.getCollapse()
|
|
||||||
this.oldHeight = 0
|
|
||||||
this.onClick(this.open, 'init')
|
|
||||||
},
|
|
||||||
// #ifndef VUE3
|
|
||||||
// TODO vue2
|
|
||||||
destroyed() {
|
|
||||||
if (this.__isUnmounted) return
|
|
||||||
this.uninstall()
|
|
||||||
},
|
|
||||||
// #endif
|
|
||||||
// #ifdef VUE3
|
|
||||||
// TODO vue3
|
|
||||||
unmounted() {
|
|
||||||
this.__isUnmounted = true
|
|
||||||
this.uninstall()
|
|
||||||
},
|
|
||||||
// #endif
|
|
||||||
mounted() {
|
|
||||||
if (!this.collapse) return
|
|
||||||
if (this.name !== '') {
|
|
||||||
this.nameSync = this.name
|
|
||||||
} else {
|
|
||||||
this.nameSync = this.collapse.childrens.length + ''
|
|
||||||
}
|
|
||||||
if (this.collapse.names.indexOf(this.nameSync) === -1) {
|
|
||||||
this.collapse.names.push(this.nameSync)
|
|
||||||
} else {
|
|
||||||
console.warn(`name 值 ${this.nameSync} 重复`);
|
|
||||||
}
|
|
||||||
if (this.collapse.childrens.indexOf(this) === -1) {
|
|
||||||
this.collapse.childrens.push(this)
|
|
||||||
}
|
|
||||||
this.init()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init(type) {
|
|
||||||
// #ifndef APP-NVUE
|
|
||||||
this.getCollapseHeight(type)
|
|
||||||
// #endif
|
|
||||||
// #ifdef APP-NVUE
|
|
||||||
this.getNvueHwight(type)
|
|
||||||
// #endif
|
|
||||||
},
|
|
||||||
uninstall() {
|
|
||||||
if (this.collapse) {
|
|
||||||
this.collapse.childrens.forEach((item, index) => {
|
|
||||||
if (item === this) {
|
|
||||||
this.collapse.childrens.splice(index, 1)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.collapse.names.forEach((item, index) => {
|
|
||||||
if (item === this.nameSync) {
|
|
||||||
this.collapse.names.splice(index, 1)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onClick(isOpen, type) {
|
|
||||||
if (this.disabled) return
|
|
||||||
this.isOpen = isOpen
|
|
||||||
if (this.isOpen && this.collapse) {
|
|
||||||
this.collapse.setAccordion(this)
|
|
||||||
}
|
|
||||||
if (type !== 'init') {
|
|
||||||
this.collapse.onChange(isOpen, this)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getCollapseHeight(type, index = 0) {
|
|
||||||
const views = uni.createSelectorQuery().in(this)
|
|
||||||
views
|
|
||||||
.select(`#${this.elId}`)
|
|
||||||
.fields({
|
|
||||||
size: true
|
|
||||||
}, data => {
|
|
||||||
// TODO 百度中可能获取不到节点信息 ,需要循环获取
|
|
||||||
if (index >= 10) return
|
|
||||||
if (!data) {
|
|
||||||
index++
|
|
||||||
this.getCollapseHeight(false, index)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// #ifdef APP-NVUE
|
|
||||||
this.height = data.height + 1
|
|
||||||
// #endif
|
|
||||||
// #ifndef APP-NVUE
|
|
||||||
this.height = data.height
|
|
||||||
// #endif
|
|
||||||
this.isheight = true
|
|
||||||
if (type) return
|
|
||||||
this.onClick(this.isOpen, 'init')
|
|
||||||
})
|
|
||||||
.exec()
|
|
||||||
},
|
|
||||||
getNvueHwight(type) {
|
|
||||||
const result = dom.getComponentRect(this.$refs['collapse--hook'], option => {
|
|
||||||
if (option && option.result && option.size) {
|
|
||||||
// #ifdef APP-NVUE
|
|
||||||
this.height = option.size.height + 1
|
|
||||||
// #endif
|
|
||||||
// #ifndef APP-NVUE
|
|
||||||
this.height = option.size.height
|
|
||||||
// #endif
|
|
||||||
this.isheight = true
|
|
||||||
if (type) return
|
|
||||||
this.onClick(this.open, 'init')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 获取父元素实例
|
|
||||||
*/
|
|
||||||
getCollapse(name = 'uniCollapse') {
|
|
||||||
let parent = this.$parent;
|
|
||||||
let parentName = parent.$options.name;
|
|
||||||
while (parentName !== name) {
|
|
||||||
parent = parent.$parent;
|
|
||||||
if (!parent) return false;
|
|
||||||
parentName = parent.$options.name;
|
|
||||||
}
|
|
||||||
return parent;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
.uni-collapse-item {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
box-sizing: border-box;
|
|
||||||
|
|
||||||
/* #endif */
|
|
||||||
&__title {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
transition: border-bottom-color .3s;
|
|
||||||
|
|
||||||
// transition-property: border-bottom-color;
|
|
||||||
// transition-duration: 5s;
|
|
||||||
&-wrap {
|
|
||||||
width: 100%;
|
|
||||||
flex: 1;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
&-box {
|
|
||||||
padding: 0 15px;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
box-sizing: border-box;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
height: 48px;
|
|
||||||
line-height: 48px;
|
|
||||||
background-color: #fff;
|
|
||||||
color: #303133;
|
|
||||||
font-size: 13px;
|
|
||||||
font-weight: 500;
|
|
||||||
/* #ifdef H5 */
|
|
||||||
cursor: pointer;
|
|
||||||
outline: none;
|
|
||||||
|
|
||||||
/* #endif */
|
|
||||||
&.is-disabled {
|
|
||||||
.uni-collapse-item__title-text {
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
&.uni-collapse-item-border {
|
|
||||||
border-bottom: 1px solid #ebeef5;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.is-open {
|
|
||||||
border-bottom-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-img {
|
|
||||||
height: 22px;
|
|
||||||
width: 22px;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-text {
|
|
||||||
flex: 1;
|
|
||||||
font-size: 14px;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
white-space: nowrap;
|
|
||||||
color: inherit;
|
|
||||||
/* #endif */
|
|
||||||
/* #ifdef APP-NVUE */
|
|
||||||
lines: 1;
|
|
||||||
/* #endif */
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
|
|
||||||
&-arrow {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
display: flex;
|
|
||||||
box-sizing: border-box;
|
|
||||||
/* #endif */
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
margin-right: 10px;
|
|
||||||
transform: rotate(0deg);
|
|
||||||
|
|
||||||
&-active {
|
|
||||||
transform: rotate(-180deg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
&__wrap {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
will-change: height;
|
|
||||||
box-sizing: border-box;
|
|
||||||
/* #endif */
|
|
||||||
background-color: #fff;
|
|
||||||
overflow: hidden;
|
|
||||||
position: relative;
|
|
||||||
height: 0;
|
|
||||||
|
|
||||||
&.is--transition {
|
|
||||||
// transition: all 0.3s;
|
|
||||||
transition-property: height, border-bottom-width;
|
|
||||||
transition-duration: 0.3s;
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
will-change: height;
|
|
||||||
/* #endif */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
&-content {
|
|
||||||
position: absolute;
|
|
||||||
font-size: 13px;
|
|
||||||
color: #303133;
|
|
||||||
// transition: height 0.3s;
|
|
||||||
border-bottom-color: transparent;
|
|
||||||
border-bottom-style: solid;
|
|
||||||
border-bottom-width: 0;
|
|
||||||
|
|
||||||
&.uni-collapse-item--border {
|
|
||||||
border-bottom-width: 1px;
|
|
||||||
border-bottom-color: red;
|
|
||||||
border-bottom-color: #ebeef5;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.open {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&--animation {
|
|
||||||
transition-property: transform;
|
|
||||||
transition-duration: 0.3s;
|
|
||||||
transition-timing-function: ease;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,147 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="uni-collapse">
|
|
||||||
<slot />
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
/**
|
|
||||||
* Collapse 折叠面板
|
|
||||||
* @description 展示可以折叠 / 展开的内容区域
|
|
||||||
* @tutorial https://ext.dcloud.net.cn/plugin?id=23
|
|
||||||
* @property {String|Array} value 当前激活面板改变时触发(如果是手风琴模式,参数类型为string,否则为array)
|
|
||||||
* @property {Boolean} accordion = [true|false] 是否开启手风琴效果是否开启手风琴效果
|
|
||||||
* @event {Function} change 切换面板时触发,如果是手风琴模式,返回类型为string,否则为array
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
name: 'uniCollapse',
|
|
||||||
emits:['change','activeItem','input','update:modelValue'],
|
|
||||||
props: {
|
|
||||||
value: {
|
|
||||||
type: [String, Array],
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
modelValue: {
|
|
||||||
type: [String, Array],
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
accordion: {
|
|
||||||
// 是否开启手风琴效果
|
|
||||||
type: [Boolean, String],
|
|
||||||
default: false
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
// TODO 兼容 vue2 和 vue3
|
|
||||||
dataValue() {
|
|
||||||
let value = (typeof this.value === 'string' && this.value === '') ||
|
|
||||||
(Array.isArray(this.value) && this.value.length === 0)
|
|
||||||
let modelValue = (typeof this.modelValue === 'string' && this.modelValue === '') ||
|
|
||||||
(Array.isArray(this.modelValue) && this.modelValue.length === 0)
|
|
||||||
if (value) {
|
|
||||||
return this.modelValue
|
|
||||||
}
|
|
||||||
if (modelValue) {
|
|
||||||
return this.value
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.value
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
dataValue(val) {
|
|
||||||
this.setOpen(val)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.childrens = []
|
|
||||||
this.names = []
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$nextTick(()=>{
|
|
||||||
this.setOpen(this.dataValue)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
setOpen(val) {
|
|
||||||
let str = typeof val === 'string'
|
|
||||||
let arr = Array.isArray(val)
|
|
||||||
this.childrens.forEach((vm, index) => {
|
|
||||||
if (str) {
|
|
||||||
if (val === vm.nameSync) {
|
|
||||||
if (!this.accordion) {
|
|
||||||
console.warn('accordion 属性为 false ,v-model 类型应该为 array')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
vm.isOpen = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (arr) {
|
|
||||||
val.forEach(v => {
|
|
||||||
if (v === vm.nameSync) {
|
|
||||||
if (this.accordion) {
|
|
||||||
console.warn('accordion 属性为 true ,v-model 类型应该为 string')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
vm.isOpen = true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.emit(val)
|
|
||||||
},
|
|
||||||
setAccordion(self) {
|
|
||||||
if (!this.accordion) return
|
|
||||||
this.childrens.forEach((vm, index) => {
|
|
||||||
if (self !== vm) {
|
|
||||||
vm.isOpen = false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
resize() {
|
|
||||||
this.childrens.forEach((vm, index) => {
|
|
||||||
// #ifndef APP-NVUE
|
|
||||||
vm.getCollapseHeight()
|
|
||||||
// #endif
|
|
||||||
// #ifdef APP-NVUE
|
|
||||||
vm.getNvueHwight()
|
|
||||||
// #endif
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onChange(isOpen, self) {
|
|
||||||
let activeItem = []
|
|
||||||
|
|
||||||
if (this.accordion) {
|
|
||||||
activeItem = isOpen ? self.nameSync : ''
|
|
||||||
} else {
|
|
||||||
this.childrens.forEach((vm, index) => {
|
|
||||||
if (vm.isOpen) {
|
|
||||||
activeItem.push(vm.nameSync)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
this.$emit('change', activeItem)
|
|
||||||
this.emit(activeItem)
|
|
||||||
},
|
|
||||||
emit(val){
|
|
||||||
this.$emit('input', val)
|
|
||||||
this.$emit('update:modelValue', val)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" >
|
|
||||||
.uni-collapse {
|
|
||||||
/* #ifndef APP-NVUE */
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
/* #endif */
|
|
||||||
/* #ifdef APP-NVUE */
|
|
||||||
flex: 1;
|
|
||||||
/* #endif */
|
|
||||||
flex-direction: column;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
{
|
|
||||||
"id": "uni-collapse",
|
|
||||||
"displayName": "uni-collapse 折叠面板",
|
|
||||||
"version": "1.4.4",
|
|
||||||
"description": "Collapse 组件,可以折叠 / 展开的内容区域。",
|
|
||||||
"keywords": [
|
|
||||||
"uni-ui",
|
|
||||||
"折叠",
|
|
||||||
"折叠面板",
|
|
||||||
"手风琴"
|
|
||||||
],
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
"client": {
|
|
||||||
"App": {
|
|
||||||
"app-vue": "y",
|
|
||||||
"app-nvue": "y"
|
|
||||||
},
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
## Collapse 折叠面板
|
|
||||||
> **组件名:uni-collapse**
|
|
||||||
> 代码块: `uCollapse`
|
|
||||||
> 关联组件:`uni-collapse-item`、`uni-icons`。
|
|
||||||
|
|
||||||
|
|
||||||
折叠面板用来折叠/显示过长的内容或者是列表。通常是在多内容分类项使用,折叠不重要的内容,显示重要内容。点击可以展开折叠部分。
|
|
||||||
|
|
||||||
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-collapse)
|
|
||||||
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
|
|
||||||
|
|
@ -1,21 +1,3 @@
|
||||||
## 2.0.9(2024-01-12)
|
|
||||||
fix: 修复图标大小默认值错误的问题
|
|
||||||
## 2.0.8(2023-12-14)
|
|
||||||
- 修复 项目未使用 ts 情况下,打包报错的bug
|
|
||||||
## 2.0.7(2023-12-14)
|
|
||||||
- 修复 size 属性为 string 时,不加单位导致尺寸异常的bug
|
|
||||||
## 2.0.6(2023-12-11)
|
|
||||||
- 优化 兼容老版本icon类型,如 top ,bottom 等
|
|
||||||
## 2.0.5(2023-12-11)
|
|
||||||
- 优化 兼容老版本icon类型,如 top ,bottom 等
|
|
||||||
## 2.0.4(2023-12-06)
|
|
||||||
- 优化 uni-app x 下示例项目图标排序
|
|
||||||
## 2.0.3(2023-12-06)
|
|
||||||
- 修复 nvue下引入组件报错的bug
|
|
||||||
## 2.0.2(2023-12-05)
|
|
||||||
-优化 size 属性支持单位
|
|
||||||
## 2.0.1(2023-12-05)
|
|
||||||
- 新增 uni-app x 支持定义图标
|
|
||||||
## 1.3.5(2022-01-24)
|
## 1.3.5(2022-01-24)
|
||||||
- 优化 size 属性可以传入不带单位的字符串数值
|
- 优化 size 属性可以传入不带单位的字符串数值
|
||||||
## 1.3.4(2022-01-24)
|
## 1.3.4(2022-01-24)
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,24 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- #ifdef APP-NVUE -->
|
<!-- #ifdef APP-NVUE -->
|
||||||
<text :style="styleObj" class="uni-icons" @click="_onClick">{{unicode}}</text>
|
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" @click="_onClick">{{unicode}}</text>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifndef APP-NVUE -->
|
<!-- #ifndef APP-NVUE -->
|
||||||
<text :style="styleObj" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick">
|
<text :style="{ color: color, 'font-size': iconSize }" class="uni-icons" :class="['uniui-'+type,customPrefix,customPrefix?type:'']" @click="_onClick"></text>
|
||||||
<slot></slot>
|
|
||||||
</text>
|
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { fontData } from './uniicons_file_vue.js';
|
import icons from './icons.js';
|
||||||
|
|
||||||
const getVal = (val) => {
|
const getVal = (val) => {
|
||||||
const reg = /^[0-9]*$/g
|
const reg = /^[0-9]*$/g
|
||||||
return (typeof val === 'number' || reg.test(val)) ? val + 'px' : val;
|
return (typeof val === 'number' || reg.test(val) )? val + 'px' : val;
|
||||||
}
|
}
|
||||||
|
|
||||||
// #ifdef APP-NVUE
|
// #ifdef APP-NVUE
|
||||||
var domModule = weex.requireModule('dom');
|
var domModule = weex.requireModule('dom');
|
||||||
import iconUrl from './uniicons.ttf'
|
import iconUrl from './uniicons.ttf'
|
||||||
domModule.addRule('fontFace', {
|
domModule.addRule('fontFace', {
|
||||||
'fontFamily': "uniicons",
|
'fontFamily': "uniicons",
|
||||||
'src': "url('" + iconUrl + "')"
|
'src': "url('"+iconUrl+"')"
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
|
|
@ -38,7 +34,7 @@
|
||||||
*/
|
*/
|
||||||
export default {
|
export default {
|
||||||
name: 'UniIcons',
|
name: 'UniIcons',
|
||||||
emits: ['click'],
|
emits:['click'],
|
||||||
props: {
|
props: {
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
|
|
@ -52,36 +48,26 @@
|
||||||
type: [Number, String],
|
type: [Number, String],
|
||||||
default: 16
|
default: 16
|
||||||
},
|
},
|
||||||
customPrefix: {
|
customPrefix:{
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
fontFamily: {
|
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
icons: fontData
|
icons: icons.glyphs
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed:{
|
||||||
unicode() {
|
unicode(){
|
||||||
let code = this.icons.find(v => v.font_class === this.type)
|
let code = this.icons.find(v=>v.font_class === this.type)
|
||||||
if (code) {
|
if(code){
|
||||||
return code.unicode
|
return unescape(`%u${code.unicode}`)
|
||||||
}
|
}
|
||||||
return ''
|
return ''
|
||||||
},
|
},
|
||||||
iconSize() {
|
iconSize(){
|
||||||
return getVal(this.size)
|
return getVal(this.size)
|
||||||
},
|
|
||||||
styleObj() {
|
|
||||||
if (this.fontFamily !== '') {
|
|
||||||
return `color: ${this.color}; font-size: ${this.iconSize}; font-family: ${this.fontFamily};`
|
|
||||||
}
|
|
||||||
return `color: ${this.color}; font-size: ${this.iconSize};`
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
@ -95,10 +81,9 @@
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
/* #ifndef APP-NVUE */
|
/* #ifndef APP-NVUE */
|
||||||
@import './uniicons.css';
|
@import './uniicons.css';
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: uniicons;
|
font-family: uniicons;
|
||||||
src: url('./uniicons.ttf');
|
src: url('./uniicons.ttf') format('truetype');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* #endif */
|
/* #endif */
|
||||||
|
|
@ -107,4 +92,5 @@
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,3 @@
|
||||||
|
|
||||||
.uniui-cart-filled:before {
|
|
||||||
content: "\e6d0";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-gift-filled:before {
|
|
||||||
content: "\e6c4";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-color:before {
|
.uniui-color:before {
|
||||||
content: "\e6cf";
|
content: "\e6cf";
|
||||||
}
|
}
|
||||||
|
|
@ -67,6 +58,10 @@
|
||||||
content: "\e6c3";
|
content: "\e6c3";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.uniui-gift-filled:before {
|
||||||
|
content: "\e6c4";
|
||||||
|
}
|
||||||
|
|
||||||
.uniui-fire-filled:before {
|
.uniui-fire-filled:before {
|
||||||
content: "\e6c5";
|
content: "\e6c5";
|
||||||
}
|
}
|
||||||
|
|
@ -87,18 +82,6 @@
|
||||||
content: "\e698";
|
content: "\e698";
|
||||||
}
|
}
|
||||||
|
|
||||||
.uniui-arrowthinleft:before {
|
|
||||||
content: "\e6d2";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-arrowthinup:before {
|
|
||||||
content: "\e6d3";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-arrowthindown:before {
|
|
||||||
content: "\e6d4";
|
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-back:before {
|
.uniui-back:before {
|
||||||
content: "\e6b9";
|
content: "\e6b9";
|
||||||
}
|
}
|
||||||
|
|
@ -111,52 +94,64 @@
|
||||||
content: "\e6bb";
|
content: "\e6bb";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.uniui-arrowthinright:before {
|
||||||
|
content: "\e6bb";
|
||||||
|
}
|
||||||
|
|
||||||
.uniui-arrow-left:before {
|
.uniui-arrow-left:before {
|
||||||
content: "\e6bc";
|
content: "\e6bc";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.uniui-arrowthinleft:before {
|
||||||
|
content: "\e6bc";
|
||||||
|
}
|
||||||
|
|
||||||
.uniui-arrow-up:before {
|
.uniui-arrow-up:before {
|
||||||
content: "\e6bd";
|
content: "\e6bd";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.uniui-arrowthinup:before {
|
||||||
|
content: "\e6bd";
|
||||||
|
}
|
||||||
|
|
||||||
.uniui-arrow-down:before {
|
.uniui-arrow-down:before {
|
||||||
content: "\e6be";
|
content: "\e6be";
|
||||||
}
|
}
|
||||||
|
|
||||||
.uniui-arrowthinright:before {
|
.uniui-arrowthindown:before {
|
||||||
content: "\e6d1";
|
content: "\e6be";
|
||||||
}
|
|
||||||
|
|
||||||
.uniui-down:before {
|
|
||||||
content: "\e6b8";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.uniui-bottom:before {
|
.uniui-bottom:before {
|
||||||
content: "\e6b8";
|
content: "\e6b8";
|
||||||
}
|
}
|
||||||
|
|
||||||
.uniui-arrowright:before {
|
.uniui-arrowdown:before {
|
||||||
content: "\e6d5";
|
content: "\e6b8";
|
||||||
}
|
}
|
||||||
|
|
||||||
.uniui-right:before {
|
.uniui-right:before {
|
||||||
content: "\e6b5";
|
content: "\e6b5";
|
||||||
}
|
}
|
||||||
|
|
||||||
.uniui-up:before {
|
.uniui-arrowright:before {
|
||||||
content: "\e6b6";
|
content: "\e6b5";
|
||||||
}
|
}
|
||||||
|
|
||||||
.uniui-top:before {
|
.uniui-top:before {
|
||||||
content: "\e6b6";
|
content: "\e6b6";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.uniui-arrowup:before {
|
||||||
|
content: "\e6b6";
|
||||||
|
}
|
||||||
|
|
||||||
.uniui-left:before {
|
.uniui-left:before {
|
||||||
content: "\e6b7";
|
content: "\e6b7";
|
||||||
}
|
}
|
||||||
|
|
||||||
.uniui-arrowup:before {
|
.uniui-arrowleft:before {
|
||||||
content: "\e6d6";
|
content: "\e6b7";
|
||||||
}
|
}
|
||||||
|
|
||||||
.uniui-eye:before {
|
.uniui-eye:before {
|
||||||
|
|
@ -643,6 +638,10 @@
|
||||||
content: "\e627";
|
content: "\e627";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.uniui-cart-filled:before {
|
||||||
|
content: "\e629";
|
||||||
|
}
|
||||||
|
|
||||||
.uniui-checkbox:before {
|
.uniui-checkbox:before {
|
||||||
content: "\e62b";
|
content: "\e62b";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "uni-icons",
|
"id": "uni-icons",
|
||||||
"displayName": "uni-icons 图标",
|
"displayName": "uni-icons 图标",
|
||||||
"version": "2.0.9",
|
"version": "1.3.5",
|
||||||
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
|
"description": "图标组件,用于展示移动端常见的图标,可自定义颜色、大小。",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"uni-ui",
|
"uni-ui",
|
||||||
|
|
@ -16,7 +16,11 @@
|
||||||
"directories": {
|
"directories": {
|
||||||
"example": "../../temps/example_temps"
|
"example": "../../temps/example_temps"
|
||||||
},
|
},
|
||||||
"dcloudext": {
|
"dcloudext": {
|
||||||
|
"category": [
|
||||||
|
"前端组件",
|
||||||
|
"通用组件"
|
||||||
|
],
|
||||||
"sale": {
|
"sale": {
|
||||||
"regular": {
|
"regular": {
|
||||||
"price": "0.00"
|
"price": "0.00"
|
||||||
|
|
@ -33,8 +37,7 @@
|
||||||
"data": "无",
|
"data": "无",
|
||||||
"permissions": "无"
|
"permissions": "无"
|
||||||
},
|
},
|
||||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
|
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
|
||||||
"type": "component-vue"
|
|
||||||
},
|
},
|
||||||
"uni_modules": {
|
"uni_modules": {
|
||||||
"dependencies": ["uni-scss"],
|
"dependencies": ["uni-scss"],
|
||||||
|
|
@ -47,8 +50,7 @@
|
||||||
"client": {
|
"client": {
|
||||||
"App": {
|
"App": {
|
||||||
"app-vue": "y",
|
"app-vue": "y",
|
||||||
"app-nvue": "y",
|
"app-nvue": "y"
|
||||||
"app-uvue": "y"
|
|
||||||
},
|
},
|
||||||
"H5-mobile": {
|
"H5-mobile": {
|
||||||
"Safari": "y",
|
"Safari": "y",
|
||||||
|
|
@ -68,15 +70,11 @@
|
||||||
"阿里": "y",
|
"阿里": "y",
|
||||||
"百度": "y",
|
"百度": "y",
|
||||||
"字节跳动": "y",
|
"字节跳动": "y",
|
||||||
"QQ": "y",
|
"QQ": "y"
|
||||||
"钉钉": "y",
|
|
||||||
"快手": "y",
|
|
||||||
"飞书": "y",
|
|
||||||
"京东": "y"
|
|
||||||
},
|
},
|
||||||
"快应用": {
|
"快应用": {
|
||||||
"华为": "y",
|
"华为": "u",
|
||||||
"联盟": "y"
|
"联盟": "u"
|
||||||
},
|
},
|
||||||
"Vue": {
|
"Vue": {
|
||||||
"vue2": "y",
|
"vue2": "y",
|
||||||
|
|
@ -85,4 +83,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// @use "sass:math";
|
// @use "sass:math";
|
||||||
@import '../toolJs/functions.scss';
|
@import '../tools/functions.scss';
|
||||||
// 间距基础倍数
|
// 间距基础倍数
|
||||||
$uni-space-root: 2 !default;
|
$uni-space-root: 2 !default;
|
||||||
// 边框半径默认值
|
// 边框半径默认值
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,18 @@
|
||||||
|
## 1.3.16(2025-06-11)
|
||||||
|
- 修复 鸿蒙 next 浏览器上无法滑动的问题
|
||||||
|
## 1.3.14(2025-06-09)
|
||||||
|
- 优化 更新示例项目
|
||||||
|
## 1.3.13(2025-04-15)
|
||||||
|
- 修复 app 端 缺少leftOptions 或 rightOptions 时无法滑动的问题
|
||||||
|
## 1.3.12(2025-04-14)
|
||||||
|
- 修复 由上一个兼容版本引发的 安卓运行报错且无法回弹的问题
|
||||||
|
## 1.3.11(2025-04-08)
|
||||||
|
- 优化 兼容鸿蒙平台
|
||||||
|
- 修复 WEB 平台控制台报错
|
||||||
|
## 1.3.10(2024-01-17)
|
||||||
|
- 修复 点击按钮时,按钮会被点击穿透导致自动收缩的 bug(兼容阿里/百度/抖音小程序)
|
||||||
|
## 1.3.9(2024-01-17)
|
||||||
|
- 修复 点击按钮时,按钮会被点击穿透导致自动收缩的 bug
|
||||||
## 1.3.8(2023-04-13)
|
## 1.3.8(2023-04-13)
|
||||||
- 修复`uni-swipe-action`和`uni-swipe-action-item`不同时使用导致 closeOther 方法报错的 bug
|
- 修复`uni-swipe-action`和`uni-swipe-action-item`不同时使用导致 closeOther 方法报错的 bug
|
||||||
## 1.3.7(2022-06-06)
|
## 1.3.7(2022-06-06)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import {
|
||||||
} from "./isPC"
|
} from "./isPC"
|
||||||
is_pc = isPC()
|
is_pc = isPC()
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef APP-VUE|| MP-WEIXIN || H5
|
// #ifdef APP-VUE || APP-HARMONY || MP-WEIXIN || H5
|
||||||
|
|
||||||
mpMixins = {
|
mpMixins = {
|
||||||
data() {
|
data() {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
const MIN_DISTANCE = 10;
|
const MIN_DISTANCE = 10;
|
||||||
export default {
|
export default {
|
||||||
showWatch(newVal, oldVal, ownerInstance, instance, self) {
|
showWatch(newVal, oldVal, ownerInstance, instance, self) {
|
||||||
var state = self.state
|
var state = self.state || {}
|
||||||
var $el = ownerInstance.$el || ownerInstance.$vm && ownerInstance.$vm.$el
|
var $el = ownerInstance.$el || ownerInstance.$vm && ownerInstance.$vm.$el
|
||||||
if (!$el) return
|
if (!$el) return
|
||||||
this.getDom(instance, ownerInstance, self)
|
this.getDom(instance, ownerInstance, self)
|
||||||
|
|
@ -24,7 +24,7 @@ export default {
|
||||||
touchstart(e, ownerInstance, self) {
|
touchstart(e, ownerInstance, self) {
|
||||||
let instance = e.instance;
|
let instance = e.instance;
|
||||||
let disabled = instance.getDataset().disabled
|
let disabled = instance.getDataset().disabled
|
||||||
let state = self.state;
|
let state = self.state || {};
|
||||||
this.getDom(instance, ownerInstance, self)
|
this.getDom(instance, ownerInstance, self)
|
||||||
// fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
|
// fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
|
||||||
disabled = this.getDisabledType(disabled)
|
disabled = this.getDisabledType(disabled)
|
||||||
|
|
@ -51,7 +51,7 @@ export default {
|
||||||
// 删除之后已经那不到实例了
|
// 删除之后已经那不到实例了
|
||||||
if (!instance) return;
|
if (!instance) return;
|
||||||
let disabled = instance.getDataset().disabled
|
let disabled = instance.getDataset().disabled
|
||||||
let state = self.state
|
let state = self.state || {}
|
||||||
// fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
|
// fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
|
||||||
disabled = this.getDisabledType(disabled)
|
disabled = this.getDisabledType(disabled)
|
||||||
if (disabled) return
|
if (disabled) return
|
||||||
|
|
@ -76,7 +76,7 @@ export default {
|
||||||
touchend(e, ownerInstance, self) {
|
touchend(e, ownerInstance, self) {
|
||||||
let instance = e.instance;
|
let instance = e.instance;
|
||||||
let disabled = instance.getDataset().disabled
|
let disabled = instance.getDataset().disabled
|
||||||
let state = self.state
|
let state = self.state || {}
|
||||||
// fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
|
// fix by mehaotian, TODO 兼容 app-vue 获取dataset为字符串 , h5 获取 为 undefined 的问题,待框架修复
|
||||||
disabled = this.getDisabledType(disabled)
|
disabled = this.getDisabledType(disabled)
|
||||||
|
|
||||||
|
|
@ -95,7 +95,7 @@ export default {
|
||||||
*/
|
*/
|
||||||
move(value, instance, ownerInstance, self) {
|
move(value, instance, ownerInstance, self) {
|
||||||
value = value || 0
|
value = value || 0
|
||||||
let state = self.state
|
let state = self.state || {}
|
||||||
let leftWidth = state.leftWidth
|
let leftWidth = state.leftWidth
|
||||||
let rightWidth = state.rightWidth
|
let rightWidth = state.rightWidth
|
||||||
// 获取可滑动范围
|
// 获取可滑动范围
|
||||||
|
|
@ -115,13 +115,20 @@ export default {
|
||||||
* @param {Object} ownerInstance
|
* @param {Object} ownerInstance
|
||||||
*/
|
*/
|
||||||
getDom(instance, ownerInstance, self) {
|
getDom(instance, ownerInstance, self) {
|
||||||
var state = self.state
|
var state = self.state || {}
|
||||||
var $el = ownerInstance.$el || ownerInstance.$vm && ownerInstance.$vm.$el
|
var $el = ownerInstance.$el || ownerInstance.$vm && ownerInstance.$vm.$el
|
||||||
var leftDom = $el.querySelector('.button-group--left')
|
var leftDom = $el.querySelector('.button-group--left')
|
||||||
var rightDom = $el.querySelector('.button-group--right')
|
var rightDom = $el.querySelector('.button-group--right')
|
||||||
|
if (leftDom && leftDom.offsetWidth) {
|
||||||
state.leftWidth = leftDom.offsetWidth || 0
|
state.leftWidth = leftDom.offsetWidth || 0
|
||||||
state.rightWidth = rightDom.offsetWidth || 0
|
} else {
|
||||||
|
state.leftWidth = 0
|
||||||
|
}
|
||||||
|
if (rightDom && rightDom.offsetWidth) {
|
||||||
|
state.rightWidth = rightDom.offsetWidth || 0
|
||||||
|
} else {
|
||||||
|
state.rightWidth = 0
|
||||||
|
}
|
||||||
state.threshold = instance.getDataset().threshold
|
state.threshold = instance.getDataset().threshold
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -148,7 +155,7 @@ export default {
|
||||||
* @param {Object} ins
|
* @param {Object} ins
|
||||||
*/
|
*/
|
||||||
moveDirection(left, ins, ownerInstance, self) {
|
moveDirection(left, ins, ownerInstance, self) {
|
||||||
var state = self.state
|
var state = self.state || {}
|
||||||
var threshold = state.threshold
|
var threshold = state.threshold
|
||||||
var position = state.position
|
var position = state.position
|
||||||
var isopen = state.isopen || 'none'
|
var isopen = state.isopen || 'none'
|
||||||
|
|
@ -181,7 +188,7 @@ export default {
|
||||||
* @param {Object} ownerInstance
|
* @param {Object} ownerInstance
|
||||||
*/
|
*/
|
||||||
openState(type, ins, ownerInstance, self) {
|
openState(type, ins, ownerInstance, self) {
|
||||||
let state = self.state
|
let state = self.state || {}
|
||||||
let leftWidth = state.leftWidth
|
let leftWidth = state.leftWidth
|
||||||
let rightWidth = state.rightWidth
|
let rightWidth = state.rightWidth
|
||||||
let left = ''
|
let left = ''
|
||||||
|
|
@ -231,7 +238,7 @@ export default {
|
||||||
* @param {Object} event
|
* @param {Object} event
|
||||||
*/
|
*/
|
||||||
resetTouchStatus(instance, self) {
|
resetTouchStatus(instance, self) {
|
||||||
let state = self.state;
|
let state = self.state || {};
|
||||||
state.direction = '';
|
state.direction = '';
|
||||||
state.deltaX = 0;
|
state.deltaX = 0;
|
||||||
state.deltaY = 0;
|
state.deltaY = 0;
|
||||||
|
|
@ -245,7 +252,7 @@ export default {
|
||||||
*/
|
*/
|
||||||
stopTouchStart(event, ownerInstance, self) {
|
stopTouchStart(event, ownerInstance, self) {
|
||||||
let instance = event.instance;
|
let instance = event.instance;
|
||||||
let state = self.state
|
let state = self.state || {}
|
||||||
this.resetTouchStatus(instance, self);
|
this.resetTouchStatus(instance, self);
|
||||||
var touch = event.touches[0];
|
var touch = event.touches[0];
|
||||||
state.startX = touch.clientX;
|
state.startX = touch.clientX;
|
||||||
|
|
@ -258,7 +265,7 @@ export default {
|
||||||
*/
|
*/
|
||||||
stopTouchMove(event, self) {
|
stopTouchMove(event, self) {
|
||||||
let instance = event.instance;
|
let instance = event.instance;
|
||||||
let state = self.state;
|
let state = self.state || {};
|
||||||
let touch = event.touches[0];
|
let touch = event.touches[0];
|
||||||
|
|
||||||
state.deltaX = touch.clientX - state.startX;
|
state.deltaX = touch.clientX - state.startX;
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,24 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- 在微信小程序 app vue端 h5 使用wxs 实现-->
|
<!-- 在微信小程序 app vue端 h5 使用wxs 实现-->
|
||||||
<!-- #ifdef APP-VUE || MP-WEIXIN || H5 -->
|
<!-- #ifdef APP-VUE || APP-HARMONY || MP-WEIXIN || H5 -->
|
||||||
<view class="uni-swipe">
|
<view class="uni-swipe">
|
||||||
<!-- #ifdef MP-WEIXIN || VUE3 -->
|
<!-- #ifdef MP-WEIXIN || H5 -->
|
||||||
<view class="uni-swipe_box" :change:prop="wxsswipe.showWatch" :prop="is_show" :data-threshold="threshold"
|
<view class="uni-swipe_box" :change:prop="wxsswipe.showWatch" :prop="is_show" :data-threshold="threshold"
|
||||||
:data-disabled="disabled" @touchstart="wxsswipe.touchstart" @touchmove="wxsswipe.touchmove"
|
:data-disabled="disabled" @touchstart="wxsswipe.touchstart" @touchmove="wxsswipe.touchmove"
|
||||||
@touchend="wxsswipe.touchend">
|
@touchend="wxsswipe.touchend">
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifndef MP-WEIXIN || VUE3 -->
|
<!-- #ifndef MP-WEIXIN || H5 -->
|
||||||
<view class="uni-swipe_box" :change:prop="renderswipe.showWatch" :prop="is_show" :data-threshold="threshold"
|
<view class="uni-swipe_box" :change:prop="renderswipe.showWatch" :prop="is_show" :data-threshold="threshold"
|
||||||
:data-disabled="disabled+''" @touchstart="renderswipe.touchstart" @touchmove="renderswipe.touchmove"
|
:data-disabled="disabled+''" @touchstart="renderswipe.touchstart" @touchmove="renderswipe.touchmove"
|
||||||
@touchend="renderswipe.touchend">
|
@touchend="renderswipe.touchend">
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- 在微信小程序 app vue端 h5 使用wxs 实现-->
|
<!-- 在微信小程序 app vue端 h5 使用wxs 实现-->
|
||||||
<view class="uni-swipe_button-group button-group--left">
|
<view class="uni-swipe_button-group button-group--left">
|
||||||
<slot name="left">
|
<slot name="left">
|
||||||
<view v-for="(item,index) in leftOptions" :key="index" :style="{
|
<view v-for="(item,index) in leftOptions" :key="index" :style="{
|
||||||
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
|
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
|
||||||
}" class="uni-swipe_button button-hock" @touchstart="appTouchStart"
|
}" class="uni-swipe_button button-hock" @touchstart.stop="appTouchStart"
|
||||||
@touchend="appTouchEnd($event,index,item,'left')"
|
@touchend.stop="appTouchEnd($event,index,item,'left')" @click.stop="onClickForPC(index,item,'left')">
|
||||||
@click.stop="onClickForPC(index,item,'left')">
|
|
||||||
<text class="uni-swipe_button-text"
|
<text class="uni-swipe_button-text"
|
||||||
:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
|
:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -32,9 +31,9 @@
|
||||||
<slot name="right">
|
<slot name="right">
|
||||||
<view v-for="(item,index) in rightOptions" :key="index" :style="{
|
<view v-for="(item,index) in rightOptions" :key="index" :style="{
|
||||||
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
|
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
|
||||||
}" class="uni-swipe_button button-hock" @touchstart="appTouchStart"
|
}" class="uni-swipe_button button-hock" @touchstart.stop="appTouchStart"
|
||||||
@touchend="appTouchEnd($event,index,item,'right')"
|
@touchend.stop="appTouchEnd($event,index,item,'right')" @click.stop="onClickForPC(index,item,'right')"><text
|
||||||
@click.stop="onClickForPC(index,item,'right')"><text class="uni-swipe_button-text"
|
class="uni-swipe_button-text"
|
||||||
:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
|
:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
|
||||||
</view>
|
</view>
|
||||||
</slot>
|
</slot>
|
||||||
|
|
@ -49,9 +48,11 @@
|
||||||
<slot name="left">
|
<slot name="left">
|
||||||
<view v-for="(item,index) in leftOptions" :key="index" :style="{
|
<view v-for="(item,index) in leftOptions" :key="index" :style="{
|
||||||
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
|
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD'
|
||||||
}" class="uni-swipe_button button-hock" @click.stop="onClick(index,item,'left')"><text
|
}" class="uni-swipe_button button-hock" @click.stop="onClick(index,item,'left')">
|
||||||
class="uni-swipe_button-text"
|
<text class="uni-swipe_button-text"
|
||||||
:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF', fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">{{ item.text }}</text>
|
:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF', fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'}">
|
||||||
|
{{ item.text }}
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</slot>
|
</slot>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -71,7 +72,7 @@
|
||||||
</view>
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- 其他平台使用 js ,长列表性能可能会有影响-->
|
<!-- 其他平台使用 js ,长列表性能可能会有影响-->
|
||||||
<!-- #ifdef MP-ALIPAY || MP-BAIDU || MP-TOUTIAO || MP-QQ -->
|
<!-- #ifdef MP-ALIPAY || MP-BAIDU || MP-TOUTIAO || MP-QQ || MP-HARMONY -->
|
||||||
<view class="uni-swipe">
|
<view class="uni-swipe">
|
||||||
<view class="uni-swipe_box" @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend"
|
<view class="uni-swipe_box" @touchstart="touchstart" @touchmove="touchmove" @touchend="touchend"
|
||||||
:style="{transform:moveLeft}" :class="{ani:ani}">
|
:style="{transform:moveLeft}" :class="{ani:ani}">
|
||||||
|
|
@ -80,8 +81,8 @@
|
||||||
<view v-for="(item,index) in leftOptions" :key="index" :style="{
|
<view v-for="(item,index) in leftOptions" :key="index" :style="{
|
||||||
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
|
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
|
||||||
fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'
|
fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'
|
||||||
}" class="uni-swipe_button button-hock" @touchstart="appTouchStart"
|
}" class="uni-swipe_button button-hock" @touchstart.stop="appTouchStart"
|
||||||
@touchend="appTouchEnd($event,index,item,'left')"><text class="uni-swipe_button-text"
|
@touchend.stop="appTouchEnd($event,index,item,'left')"><text class="uni-swipe_button-text"
|
||||||
:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',}">{{ item.text }}</text>
|
:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',}">{{ item.text }}</text>
|
||||||
</view>
|
</view>
|
||||||
</slot>
|
</slot>
|
||||||
|
|
@ -92,7 +93,7 @@
|
||||||
<view v-for="(item,index) in rightOptions" :key="index" :style="{
|
<view v-for="(item,index) in rightOptions" :key="index" :style="{
|
||||||
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
|
backgroundColor: item.style && item.style.backgroundColor ? item.style.backgroundColor : '#C7C6CD',
|
||||||
fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'
|
fontSize: item.style && item.style.fontSize ? item.style.fontSize : '16px'
|
||||||
}" @touchstart="appTouchStart" @touchend="appTouchEnd($event,index,item,'right')"
|
}" @touchstart.stop="appTouchStart" @touchend.stop="appTouchEnd($event,index,item,'right')"
|
||||||
class="uni-swipe_button button-hock"><text class="uni-swipe_button-text"
|
class="uni-swipe_button button-hock"><text class="uni-swipe_button-text"
|
||||||
:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',}">{{ item.text }}</text>
|
:style="{color: item.style && item.style.color ? item.style.color : '#FFFFFF',}">{{ item.text }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -141,7 +142,7 @@
|
||||||
* @property {Boolean} autoClose = [true|false] 滑动打开当前组件,是否关闭其他组件
|
* @property {Boolean} autoClose = [true|false] 滑动打开当前组件,是否关闭其他组件
|
||||||
* @property {Number} threshold 滑动缺省值
|
* @property {Number} threshold 滑动缺省值
|
||||||
* @property {Array} leftOptions 左侧选项内容及样式
|
* @property {Array} leftOptions 左侧选项内容及样式
|
||||||
* @property {Array} rgihtOptions 右侧选项内容及样式
|
* @property {Array} rightOptions 右侧选项内容及样式
|
||||||
* @event {Function} click 点击选项按钮时触发事件,e = {content,index} ,content(点击内容)、index(下标)
|
* @event {Function} click 点击选项按钮时触发事件,e = {content,index} ,content(点击内容)、index(下标)
|
||||||
* @event {Function} change 组件打开或关闭时触发,left\right\none
|
* @event {Function} change 组件打开或关闭时触发,left\right\none
|
||||||
*/
|
*/
|
||||||
|
|
@ -281,6 +282,8 @@
|
||||||
|
|
||||||
.button-group--right {
|
.button-group--right {
|
||||||
right: 0;
|
right: 0;
|
||||||
|
padding: 10rpx 0;
|
||||||
|
box-sizing: border-box;
|
||||||
transform: translateX(100%)
|
transform: translateX(100%)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -295,6 +298,7 @@
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
|
border-radius: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uni-swipe_button-text {
|
.uni-swipe_button-text {
|
||||||
|
|
|
||||||
|
|
@ -134,9 +134,14 @@ function getDom(instance, ownerInstance) {
|
||||||
var rightStyles = {
|
var rightStyles = {
|
||||||
width: 0
|
width: 0
|
||||||
}
|
}
|
||||||
leftStyles = leftDom.getBoundingClientRect()
|
|
||||||
rightStyles = rightDom.getBoundingClientRect()
|
|
||||||
|
|
||||||
|
if (leftDom) {
|
||||||
|
leftStyles = leftDom.getBoundingClientRect()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rightDom) {
|
||||||
|
rightStyles = rightDom.getBoundingClientRect()
|
||||||
|
}
|
||||||
state.leftWidth = leftStyles.width || 0
|
state.leftWidth = leftStyles.width || 0
|
||||||
state.rightWidth = rightStyles.width || 0
|
state.rightWidth = rightStyles.width || 0
|
||||||
state.threshold = instance.getDataset().threshold
|
state.threshold = instance.getDataset().threshold
|
||||||
|
|
@ -297,6 +302,9 @@ function isPC() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(userAgentInfo.indexOf('Phone') > 0 && userAgentInfo.indexOf('Harmony') > 0){
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
// 公开给用户使用,重制组件样式
|
// 公开给用户使用,重制组件样式
|
||||||
resize(){
|
resize(){
|
||||||
// wxs 会自己计算组件大小,所以无需执行下面代码
|
// wxs 会自己计算组件大小,所以无需执行下面代码
|
||||||
// #ifndef APP-VUE || H5 || MP-WEIXIN
|
// #ifndef APP-VUE || H5 || MP-WEIXIN || MP-HARMONY
|
||||||
this.children.forEach(vm=>{
|
this.children.forEach(vm=>{
|
||||||
vm.init()
|
vm.init()
|
||||||
})
|
})
|
||||||
|
|
@ -31,22 +31,22 @@
|
||||||
// 公开给用户使用,关闭全部 已经打开的组件
|
// 公开给用户使用,关闭全部 已经打开的组件
|
||||||
closeAll(){
|
closeAll(){
|
||||||
this.children.forEach(vm=>{
|
this.children.forEach(vm=>{
|
||||||
// #ifdef APP-VUE || H5 || MP-WEIXIN
|
// #ifdef APP-VUE || H5 || MP-WEIXIN || MP-HARMONY
|
||||||
vm.is_show = 'none'
|
vm.is_show = 'none'
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifndef APP-VUE || H5 || MP-WEIXIN
|
// #ifndef APP-VUE || H5 || MP-WEIXIN || MP-HARMONY
|
||||||
vm.close()
|
vm.close()
|
||||||
// #endif
|
// #endif
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
closeOther(vm) {
|
closeOther(vm) {
|
||||||
if (this.openItem && this.openItem !== vm) {
|
if (this.openItem && this.openItem !== vm) {
|
||||||
// #ifdef APP-VUE || H5 || MP-WEIXIN
|
// #ifdef APP-VUE || H5 || MP-WEIXIN || MP-HARMONY
|
||||||
this.openItem.is_show = 'none'
|
this.openItem.is_show = 'none'
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifndef APP-VUE || H5 || MP-WEIXIN
|
// #ifndef APP-VUE || H5 || MP-WEIXIN || MP-HARMONY
|
||||||
this.openItem.close()
|
this.openItem.close()
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,84 +1,112 @@
|
||||||
{
|
{
|
||||||
"id": "uni-swipe-action",
|
"id": "uni-swipe-action",
|
||||||
"displayName": "uni-swipe-action 滑动操作",
|
"displayName": "uni-swipe-action 滑动操作",
|
||||||
"version": "1.3.8",
|
"version": "1.3.16",
|
||||||
"description": "SwipeAction 滑动操作操作组件",
|
"description": "SwipeAction 滑动操作操作组件",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"",
|
"",
|
||||||
"uni-ui",
|
"uni-ui",
|
||||||
"uniui",
|
"uniui",
|
||||||
"滑动删除",
|
"滑动删除",
|
||||||
"侧滑删除"
|
"侧滑删除"
|
||||||
|
],
|
||||||
|
"repository": "https://github.com/dcloudio/uni-ui",
|
||||||
|
"engines": {
|
||||||
|
"HBuilderX": "",
|
||||||
|
"uni-app": "^4.27",
|
||||||
|
"uni-app-x": ""
|
||||||
|
},
|
||||||
|
"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",
|
||||||
|
"darkmode": "x",
|
||||||
|
"i18n": "x",
|
||||||
|
"widescreen": "x"
|
||||||
|
},
|
||||||
|
"uni_modules": {
|
||||||
|
"dependencies": [
|
||||||
|
"uni-scss"
|
||||||
],
|
],
|
||||||
"repository": "https://github.com/dcloudio/uni-ui",
|
"encrypt": [],
|
||||||
"engines": {
|
"platforms": {
|
||||||
"HBuilderX": ""
|
"cloud": {
|
||||||
},
|
"tcb": "x",
|
||||||
"directories": {
|
"aliyun": "x",
|
||||||
"example": "../../temps/example_temps"
|
"alipay": "x"
|
||||||
},
|
},
|
||||||
"dcloudext": {
|
"client": {
|
||||||
"sale": {
|
"uni-app": {
|
||||||
"regular": {
|
"vue": {
|
||||||
"price": "0.00"
|
"vue2": {
|
||||||
},
|
"extVersion": "1.3.14",
|
||||||
"sourcecode": {
|
"minVersion": ""
|
||||||
"price": "0.00"
|
},
|
||||||
}
|
"vue3": {
|
||||||
},
|
"extVersion": "1.3.14",
|
||||||
"contact": {
|
"minVersion": ""
|
||||||
"qq": ""
|
}
|
||||||
},
|
},
|
||||||
"declaration": {
|
"web": {
|
||||||
"ads": "无",
|
"safari": "-",
|
||||||
"data": "无",
|
"chrome": "-"
|
||||||
"permissions": "无"
|
},
|
||||||
},
|
"app": {
|
||||||
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui",
|
"vue": "-",
|
||||||
"type": "component-vue"
|
"nvue": "-",
|
||||||
},
|
"android": "-",
|
||||||
"uni_modules": {
|
"ios": "-",
|
||||||
"dependencies": ["uni-scss"],
|
"harmony": "-"
|
||||||
"encrypt": [],
|
},
|
||||||
"platforms": {
|
"mp": {
|
||||||
"cloud": {
|
"weixin": "-",
|
||||||
"tcb": "y",
|
"alipay": "-",
|
||||||
"aliyun": "y"
|
"toutiao": "-",
|
||||||
},
|
"baidu": "-",
|
||||||
"client": {
|
"kuaishou": "-",
|
||||||
"App": {
|
"jd": "-",
|
||||||
"app-vue": "y",
|
"harmony": "-",
|
||||||
"app-nvue": "y"
|
"qq": "-",
|
||||||
},
|
"lark": "-"
|
||||||
"H5-mobile": {
|
},
|
||||||
"Safari": "y",
|
"quickapp": {
|
||||||
"Android Browser": "y",
|
"huawei": "-",
|
||||||
"微信浏览器(Android)": "y",
|
"union": "-"
|
||||||
"QQ浏览器(Android)": "y"
|
}
|
||||||
},
|
},
|
||||||
"H5-pc": {
|
"uni-app-x": {
|
||||||
"Chrome": "y",
|
"web": {
|
||||||
"IE": "y",
|
"safari": "-",
|
||||||
"Edge": "y",
|
"chrome": "-"
|
||||||
"Firefox": "y",
|
},
|
||||||
"Safari": "y"
|
"app": {
|
||||||
},
|
"android": "-",
|
||||||
"小程序": {
|
"ios": "-",
|
||||||
"微信": "y",
|
"harmony": "-"
|
||||||
"阿里": "y",
|
},
|
||||||
"百度": "y",
|
"mp": {
|
||||||
"字节跳动": "y",
|
"weixin": "-"
|
||||||
"QQ": "y"
|
}
|
||||||
},
|
}
|
||||||
"快应用": {
|
}
|
||||||
"华为": "y",
|
}
|
||||||
"联盟": "u"
|
}
|
||||||
},
|
}
|
||||||
"Vue": {
|
|
||||||
"vue2": "y",
|
|
||||||
"vue3": "y"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||