修改搜索蓝牙流程,新增资讯

This commit is contained in:
qiaocl 2024-11-12 15:38:28 +08:00
parent cbad43df91
commit c2d4b36089
446 changed files with 21463 additions and 11633 deletions

101
App.vue
View File

@ -2,9 +2,7 @@
let platform = ""
export default {
data() {
return {
Status: false
}
return {}
},
onLaunch: function() {
let that = this
@ -19,10 +17,10 @@
console.log("getSystemInfo", e.platform)
}
})
// ios
if (platform === 'ios') {
if (platform === 'ios') { // ios
uni.onNetworkStatusChange(function(res) {
if (res.isConnected == true) {
that.handleCityList()
uni.reLaunch({
url: '/pageTwo/login/login'
})
@ -32,7 +30,9 @@
}
that.checkForUpdates()
// #endif
that.handleoginversion()
// #ifndef APP-PLUS
that.handleCityList()
// #endif
console.log('App Launch')
},
onShow: function() {
@ -56,6 +56,7 @@
info: info
})
console.log("当前应用版本号", info)
that.handleCityList()
that.handleoginversion(info)
})
},
@ -63,6 +64,7 @@
handleoginversion(info) {
let that = this
that.$model.getloginversion({}).then(res => {
console.log("小程序版本信息返回", res)
that.handleCancelUpdate(res.code)
// #ifdef APP-PLUS
@ -87,20 +89,21 @@
success: (downloadRes) => {
if (downloadRes.statusCode === 200) {
plus.nativeUI.closeWaiting()
plus.runtime.install(downloadRes
.tempFilePath, {
force: true
},
function() {
plus.runtime.restart();
console.log(
'install success...'
);
},
function(e) {
console.error(
'install fail...');
});
.runtime.install(downloadRes
.tempFilePath, {
force: true
},
function() {
plus.runtime.restart();
console.log(
'install success...'
);
},
function(e) {
console.error(
'install fail...');
});
}
},
fail: () => {
@ -133,7 +136,6 @@
handleCancelUpdate(code) {
let that = this
if (code == 0) {
// that.handleUserList()
uni.reLaunch({
url: "/pages/home/home?type=1"
})
@ -145,56 +147,15 @@
}, 500);
}
},
//
handleUserList() {
//
handleCityList() {
let that = this
that.$model.getUserList({
type: 2
}).then(res => {
console.log("用户列表", res)
if (res.code != 0) {
that.$tools.msg(res.msg)
return
}
that.$store.commit('changeFamilay', res.data)
if (res.data.length) {
that.$store.dispatch('getUserInfo', {
aud_id: uni.getStorageSync('userid') ? uni.getStorageSync(
'userid') : res.data[
0].id
})
that.$store.dispatch("getCardList", {
aud_id: uni.getStorageSync('userid') ? uni.getStorageSync(
'userid') : res.data[
0].id
})
that.handleLabelList(res.data[0].id)
that.handlePublicRecord(res.data[0].id)
}
}).catch(err => {})
},
//
handleLabelList(id) {
let that = this
that.$model.getLabelList({
aud_id: uni.getStorageSync('userid') ? uni.getStorageSync('userid') : 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: uni.getStorageSync('userid') ? uni.getStorageSync('userid') : id
}).then(res => {
console.log("公共手动记录", res)
if (res.code == 0) {
that.$store.commit('changePublicRecord', res.data)
}
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)
})
},
}

View File

@ -57,10 +57,23 @@
that.$store.dispatch("getUserInfo", {
aud_id: val.id
});
that.$store.dispatch("getCardList", {
that.$store.dispatch("getResult", {
aud_id: val.id
})
that.$store.commit("changeDrawe", false);
that.handlePublicRecord(val.id)
},
//
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)
}
})
},
//
addInfo() {

View File

@ -7,11 +7,11 @@
</view>
<view class="info" @click="handleAddUser(1)">
<view class="size18 bold">{{info.nickname}}</view>
<view class="mt-10">
<view class="mt-5">
<text class="mr-10">性别{{info.gender==1?'男':info.gender==2?'女':'未知'}}</text>
<text class="ml-10">年龄{{info.age}}</text>
</view>
<view class="mt-10">当前地区{{info.address}}</view>
<view class="mt-5" v-if="info.measure_model==1">当前地区{{info.address}}</view>
</view>
<text class="t-icon t-icon-qiehuan1" @click="$store.commit('changeDrawe', true)" v-if="isLeft"></text>
</view>
@ -142,6 +142,7 @@
"/pageTwo/my/userInfo"
})
} else {
console.log("headerIndex跳转登录页面")
uni.reLaunch({
url: '/pageTwo/login/login'
})
@ -151,12 +152,17 @@
handleCityList() {
let that = this
if (that.cityList.length) {
that.province = that.cityList
let str = that.user.address.split(',')[0]
var Index0 = that.province.findIndex((profile) => profile.name == str);
that.value[0] = Index0
console.log("地区", str, Index0)
that.city = that.province[Index0].list
if (that.user.address != '') {
that.province = that.cityList
let str = that.user.address.split(',')[0]
var Index0 = that.province.findIndex((profile) => profile.name == str);
that.value[0] = Index0
console.log("地区", str, Index0)
that.city = that.province[Index0].list
} else {
that.value = [2, 0]
that.city = that.cityList[2].list
}
}
},
}

View File

@ -1,5 +1,5 @@
<template>
<view class="wrapper">
<view class="wrapper" v-if="isRecord">
<view class="bg" @click="onTap">
<view class="edit" @click.stop>
<view class="title">手动记录</view>
@ -54,8 +54,11 @@
fields: "",
}
},
props: {
rtype: null,
},
computed: {
...mapState(["user"]),
...mapState(["user","isRecord"]),
endDate() {
return this.$tools.getDate("start")
},
@ -99,10 +102,11 @@
that.$store.dispatch("getLungResult", {
aud_id: uni.getStorageSync('userid')
})
this.regTime = ""
this.number1 = ""
this.number2 = ""
this.number3 = ""
that.regTime = ""
that.number1 = ""
that.number2 = ""
that.number3 = ""
that.onTap()
})
},
//

View File

@ -1,19 +1,16 @@
<template>
<view class="wrapper">
<view class="wrapper" v-if="isPublicRecord">
<view class="bg" @click="onTap">
<view class="edit" @click.stop>
<view class="title">手动记录</view>
<view class="editem" @click="hideKeyboard">
<view class="editem">
<view class="left">项目</view>
<view class="right">
<picker :range="list" :value="lableTndex" @change="bindLableChange">
<view class="uni-input">{{name?name:'请选择'}}</view>
<icon class="iconfont icon-arrow-down-bold"></icon>
</picker>
{{labelName}}
</view>
</view>
<!-- -->
<view class="editem" @click="hideKeyboard">
<view class="editem">
<view class="left">日期</view>
<view class="right">
<picker mode="date" :end="endDate" @change="changeLog" :fields="fields">
@ -22,15 +19,32 @@
</picker>
</view>
</view>
<view class="">
<view class="editem">
<view class="name">时长</view>
<view class="right">
<picker mode="multiSelector" :range="timeList" :value="timesTndex" @change="bindTimeChange">
<view class="size16">{{time_m?time_m+':':'请选择'}}{{time_s?time_s:''}}</view>
</picker>
<uni-icons type="bottom" class="ml-15 c666"></uni-icons>
</view>
<view class="editem" v-if="info&&info.list.length&&listType">
<view class="name">{{describe}}</view>
<view class="right" v-if="listType==4">
<picker mode="multiSelector" :range="timeList" :value="timesTndex" @change="bindTimeChange">
<view class="size16">{{time_m?time_m+':':'请选择'}}{{time_s?time_s:''}}</view>
</picker>
<uni-icons type="bottom" class="ml-10 c666"></uni-icons>
</view>
<view class="right" v-if="listType!=4">
<input :type="listType==1?'number':'digit'" v-model="number" placeholder="请输入">
{{unit}}
</view>
</view>
<view class="editem" v-if="info&&info.time">
<view class="name">时长</view>
<view class="right">
<picker mode="multiSelector" :range="timeList" :value="timesTndex" @change="bindTimeChange">
<view class="size16">{{time_m?time_m+':':'请选择'}}{{time_s?time_s:''}}</view>
</picker>
<uni-icons type="bottom" class="ml-15 c666"></uni-icons>
</view>
</view>
<view class="editem" v-if="info&&info.number">
<view class="name">个数</view>
<view class="right">
<input type="number" v-model="number" placeholder="请输入">
</view>
</view>
<view class="btn close" @click="onTap()">取消</view>
@ -54,24 +68,49 @@
time_m: "",
time_s: "",
fields: "",
listType: null,
describe: "",
unit: "",
timesTndex: [1, 0],
lableTndex: 0,
labelName: "",
}
},
props: {
type: {},
rtype: null,
active: {
type: Number,
default: 0
},
},
computed: {
...mapState(["labelList"]),
list() {
...mapState(["PublicRecord", "isPublicRecord"]),
info() {
let that = this
let list = []
that.labelList.forEach(ite => {
if (ite.acd_id == that.type) {
list = ite.list
let info = {
height: false,
weight: false,
number: false,
time: false,
list: []
}
if (that.PublicRecord.length) {
that.PublicRecord.forEach(ite => {
if (ite.id == that.rtype) {
info = ite
}
})
if (info && info.list.length) {
// console.log("8888888", that.PublicRecord, info, that.active)
that.labelName = info.list[that.active].name
that.listType = info.list[that.active].type
that.describe = info.list[that.active].describe
that.unit = info.list[that.active].unit
// console.log("", info, that.active)
}
})
return list
}
return that.PublicRecord.length ? info : null
},
endDate() {
return this.$tools.getDate("start")
@ -80,6 +119,9 @@
return this.$tools.GetDateStr(-90);
},
},
mounted() {
// console.log("999999", that.labelName, that.PublicRecord)
},
mounted() {
let that = this
that.timeList = this.$tools.gethms()
@ -95,37 +137,35 @@
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)
}
that.timesTndex = e.target.value
that.time_m = that.timeList[0][m].substring(0, 2)
that.time_s = that.timeList[1][s].substring(0, 2)
console.log("时长", that.time_m, that.time_s)
},
//
handleTarget() {
let that = this
if (!that.name) {
that.$tools.msg("请选择测量项目")
return
}
if (!that.regTime) {
that.$tools.msg("请选择日期")
return
}
if (!that.time_m || !that.time_s) {
if (that.listType == 4 && (!that.time_m || !that.time_s)) {
that.$tools.msg("请输入时长")
return
}
if (that.listType != 4 && !that.number) {
let msg = that.listType == 1 ? '请输入个数' : '请输入时长'
that.$tools.msg(msg)
return
}
let time_m = that.time_m + ':' + that.time_s
that.$model.getpublicmeasure({
acd_id: that.type,
name: that.name,
acd_id: that.rtype,
name: that.labelName,
record_time: that.regTime,
data: that.time_m + ':' + that.time_s,
data: that.listType == 4 ? time_m : that.number,
aud_id: uni.getStorageSync('userid')
}).then(res => {
if (res.code != 0) return
@ -135,15 +175,21 @@
aud_id: uni.getStorageSync('userid'),
})
that.$store.dispatch("getPublicContent", {
acd_id: that.type,
acd_id: that.rtype,
aud_id: uni.getStorageSync('userid')
})
that.regTime = ""
that.onTap()
})
},
bindLableChange(e) {
bindTimeChange(e) {
let that = this
that.name = that.list[e.detail.value]
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))
that.time_m = that.timeList[0][m].substring(0, 2)
that.time_s = that.timeList[1][s].substring(0, 2)
},
//
changeLog(e) {
@ -151,11 +197,7 @@
},
onTap() {
this.regTime = ""
this.name = ""
this.$store.commit("changeRecord", false);
},
hideKeyboard() {
uni.hideKeyboard()
this.$store.commit("changePublicAdd", false);
},
}
}

View File

@ -310,11 +310,11 @@
that.$store.dispatch("getUserInfo", {
aud_id: uni.getStorageSync('userid')
})
that.$store.dispatch("GetBodyTrendList", {
aud_id: uni.getStorageSync('userid'),
s_time: that.startDate,
e_time: that.endDate
})
// that.$store.dispatch("GetBodyTrendList", {
// aud_id: uni.getStorageSync('userid'),
// s_time: that.startDate,
// e_time: that.endDate
// })
that.onTap()
})
},

View File

@ -6,7 +6,7 @@
<view class="editem" @click="hideKeyboard" v-if="type!=1">
<view class="name">日期</view>
<view class="right">
<picker mode="date" :start="startDate" :end="endDate" @change="changeLog" :fields="fields">
<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>
@ -45,9 +45,6 @@
endDate() {
return this.$tools.getDate("start")
},
startDate() {
return this.$tools.getDate('start');
}
},
mounted() {
let that = this

View File

@ -17,6 +17,10 @@ Vue.prototype.$model = model;
// 语言
import messages from './language/index'
//模拟数据
import video from '@/video.json'
Vue.prototype.$video = video;
let i18nConfig = {
locale: uni.getLocale(),
messages

View File

@ -2,8 +2,8 @@
"name" : "Reedaw",
"appid" : "__UNI__20604F1",
"description" : "面向儿童青少年的健康体质测量APP",
"versionName" : "1.2.2",
"versionCode" : 122,
"versionName" : "1.2.6",
"versionCode" : 126,
"transformPx" : false,
/* 5+App */
"app-plus" : {

View File

@ -61,7 +61,6 @@
list: [],
isActive: [],
ActiveDays: [],
token: null,
startM: null,
endM: null,
isShow: true,

View File

@ -38,16 +38,35 @@
} from "vuex";
export default {
data() {
return {}
},
onLoad() {},
computed: {
...mapState(["cardList", 'user']),
list() {
return this.cardList
return {
cardList: {
user: [],
all: []
},
}
},
onLoad() {
let that = this
that.handleCardList()
},
computed: {
...mapState(['user']),
},
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() {
let that = this
let list = []
@ -125,7 +144,8 @@
line-height: 60px;
border-radius: 5px;
.uni-icons,uni-icons {
.uni-icons,
uni-icons {
font-size: 36rpx;
position: absolute;
top: -28px;

View File

@ -53,7 +53,6 @@
list: [],
isActive: [],
ActiveDays: [],
token: null,
startM: null,
endM: null,
isShow: true,

View File

@ -0,0 +1,285 @@
<template>
<view class="weightPages">
<view class="content ">
<view class="title" v-if="isConnection == 0">连接中请稍后</view>
<view class="title" v-if="isConnection == 1">连接成功开始测量</view>
<view class="title" v-if="isConnection == 2" @click="openBluetoothAdapter">连接失败点击重新连接</view>
<view class="text">{{text}}</view>
<view class="image">
<image src="/static/HC.png" class="image3"></image>
</view>
<view class="tips">
<view>提示</view>
<text>1.请确定设备已开机</text>
<text>2.请确定手机蓝牙及位置信息已打开</text>
</view>
</view>
<!-- 手动记录 -->
<view class="wrapper" v-if="isHeight">
<view class="bg"></view>
<view class="Blue">
<view class="h4">测量结果提示</view>
<view class="Blue-box">
本次测量身高为<text>{{height}}{{unit}}</text>
</view>
<view class="Blue-box">
上次测量体重为<input v-model="weight" type="digit" placeholder="请输入体重" />kg
</view>
<view class="Blue-btn Blue-close" @click="handleBack(1)">取消</view>
<view class="Blue-btn" @click="handleGetMeasure">保存测量结果</view>
</view>
</view>
</view>
</template>
<script>
import {
mapState
} from "vuex";
let myTime;
export default {
data() {
return {
text: "",
weight: "",
height: "",
deviceId: "",
macAddr: "",
unit: "cm",
Unload: false,
stopblue: true,
isHeight: false,
isConnection: 0,
isdevice: false
}
},
computed: {
...mapState(["user", "isConnected", "isBluetoothTyle"]),
info() {
return this.user
},
endDate() {
return this.$tools.getDate("start")
},
startDate() {
return this.$tools.GetDateStr(-90);
},
},
onUnload: function() {
let that = this
if (!that.Unload) {
clearTimeout(myTime)
that.stopBluetoothDevicesDiscovery() //
that.closeBluetoothAdapter()
console.log("页面返回onUnload")
}
},
onLoad(options) {
let that = this
that.text = ""
that.isdevice = options.isdevice
that.openBluetoothAdapter()
},
watch: {
isConnected: function() {
let that = this
if (!that.isConnected) {
that.handleBack()
that.isConnection = 2
}
},
isBluetoothTyle: function() {
let that = this
if (!that.isBluetoothTyle) {
that.handleBack()
that.isConnection = 2
}
},
stopblue: function() {
let that = this
if (!that.stopblue) {
clearTimeout(myTime);
that.isHeight = true
}
}
},
methods: {
//
openBluetoothAdapter() {
let that = this
that.text = ""
that.stopblue = true
that.isHeight = false
uni.openBluetoothAdapter({
success: e => {
that.isConnection = 0
that.startBluetoothDeviceDiscovery()
},
fail: e => {
that.isConnection = 2
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
}
});
},
//
startBluetoothDeviceDiscovery() {
let that = this
uni.startBluetoothDevicesDiscovery({
allowDuplicatesKey: true,
success: res => {
that.onBluetoothDeviceFound();
},
fail: res => {
that.isConnection = 2
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
}
});
},
/**
* 发现外围设备
*/
onBluetoothDeviceFound() {
var that = this;
uni.onBluetoothDeviceFound(res => {
res.devices.forEach(device => {
if (!device.name && !device.localName) {
return
}
if (device.name.indexOf("G02") !== -1) {
let value = that.$tools.ab2hex(device.advertisData, "")
let type = value.substring(22, 24)
let num = value.substring(28, 29)
let dw = value.substring(29, 30)
let data = parseInt(value.substring(24, 28), 16)
that.isConnection = 1
if (dw == "1") {
that.unit = "FT"
data = data * 2.54
}
if (num == "1") {
data = data / 10
}
if (num == "2") {
data = data / 100
}
if (num == "3") {
data = data / 1000
}
if (type == "01") {
clearTimeout(myTime);
that.text = "您的身高是:" + data + that.unit
let buffer = device.advertisData.slice(3, 9)
device.mac = new Uint8Array(buffer) // 广maciOSmac
let tempMac = Array.from(device.mac)
tempMac.reverse()
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
that.deviceId = device.deviceId
that.macAddr = device.macAddr
that.height = data
that.stopblue = false
return
}
return;
}
})
});
that.handleMyTime()
},
handleMyTime() {
var that = this;
myTime = setTimeout(function() {
if (!that.macAddr) {
clearTimeout(myTime);
that.text = ""
that.Unload = true
that.stopblue = true
that.isHeight = false
that.isConnection = 2
that.startBluetoothDeviceDiscovery()
that.closeBluetoothAdapter()
}
}, 30000);
},
/**
* 停止搜索蓝牙设备
*/
stopBluetoothDevicesDiscovery() {
uni.stopBluetoothDevicesDiscovery({
success: e => {
console.log("停止搜索蓝牙设备", e)
},
});
},
//
handleGetMeasure() {
let that = this
if (!that.weight) {
this.$tools.msg("请输入体重")
return
}
that.$model.getmeasurefunit({
adc: 0,
weight: that.weight,
height: that.height,
aud_id: that.info.id
}).then(res => {
that.isHeight = false
if (res.code == 0) {
that.$store.dispatch('getUserInfo', {
aud_id: uni.getStorageSync('userid')
})
that.$store.dispatch("getResult", {
aud_id: uni.getStorageSync('userid')
})
that.$store.dispatch("GetBodyTrendList", {
aud_id: uni.getStorageSync('userid'),
s_time: that.startDate,
e_time: that.endDate
})
that.$tools.msg("测量成功")
} else {
that.$tools.msg("测量失败")
}
that.Unload = true
setTimeout(function() {
that.closeBluetoothAdapter()
uni.redirectTo({
url: "/pages/body/body?acd_id=2" + '&device=' + that.isdevice
})
}, 200)
})
},
//
handleBack(ind) {
let that = this
that.text = ""
that.Unload = true
that.stopBluetoothDevicesDiscovery()
that.closeBluetoothAdapter()
if (ind == 1) {
uni.redirectTo({
url: "/pages/body/body?acd_id=2" + '&device=' + that.isdevice
})
}
},
/**
* 断开蓝牙模块
*/
closeBluetoothAdapter() {
let that = this;
uni.closeBluetoothAdapter({
success: res => {
console.log('蓝牙模块关闭成功');
}
})
},
},
}
</script>
<style scoped lang="scss">
.image3 {
width: 200px !important;
height: 340px !important;
}
</style>

View File

@ -1,9 +1,7 @@
<template>
<view class="weightPages">
<view class="content ">
<view class="title" v-if="isConnection == 0">连接中请稍后</view>
<view class="title" v-if="isConnection == 1">连接成功开始测量</view>
<view class="title" v-if="isConnection == 2" @click="openBluetoothAdapter">连接失败点击重新连接</view>
<view class="title">连接成功开始测量</view>
<view class="text">{{text}}</view>
<view class="image">
<image src="/static/HC.png" class="image3"></image>
@ -25,7 +23,7 @@
<view class="Blue-box">
上次测量体重为<input v-model="weight" type="digit" placeholder="请输入体重" />kg
</view>
<view class="Blue-btn Blue-close" @click="handleBack(1)">取消</view>
<view class="Blue-btn Blue-close" @click="handleHeight">重新测量</view>
<view class="Blue-btn" @click="handleGetMeasure">保存测量结果</view>
</view>
</view>
@ -47,168 +45,115 @@
macAddr: "",
unit: "cm",
Unload: false,
stopblue: true,
isHeight: false,
isConnection: 0,
isdevice: false
isdevice: false,
info: {}
}
},
computed: {
...mapState(["user", "isConnected", "isBluetoothTyle"]),
info() {
userInfo() {
return this.user
},
endDate() {
return this.$tools.getDate("start")
},
startDate() {
return this.$tools.GetDateStr(-90);
},
}
},
onUnload: function() {
let that = this
if (!that.Unload) {
clearTimeout(myTime)
that.stopBluetoothDevicesDiscovery() //
that.closeBLEConnection()
that.closeBluetoothAdapter()
console.log("页面返回onUnload")
}
},
onLoad(options) {
let that = this
that.text = ""
that.isdevice = options.isdevice
that.openBluetoothAdapter()
let info = options.info
that.info = JSON.parse(info)
that.weight = that.userInfo.weight
that.notifyBLECharacteristicValue()
that.onBLEConnectionStateChange()
uni.onBluetoothAdapterStateChange(function(res) {
that.$store.commit("changeBluetooth", res.available);
})
},
watch: {
isConnected: function() {
let that = this
if (!that.isConnected) {
that.handleBack()
that.isConnection = 2
uni.showModal({
title: '连接已断开',
content: '测量过程中已与设备连接中断,请重新连接设备再开始测量',
showCancel: false,
success: function(res) {
if (res.confirm) {
uni.switchTab({ //
url: "/pages/home/home"
})
}
}
})
}
},
isBluetoothTyle: function() {
let that = this
if (!that.isBluetoothTyle) {
that.handleBack()
that.isConnection = 2
}
},
stopblue: function() {
let that = this
if (!that.stopblue) {
clearTimeout(myTime);
that.isHeight = true
}
}
},
methods: {
//
openBluetoothAdapter() {
let that = this
that.text = ""
that.stopblue = true
that.isHeight = false
uni.openBluetoothAdapter({
success: e => {
that.isConnection = 0
that.startBluetoothDeviceDiscovery()
},
fail: e => {
that.isConnection = 2
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
}
});
},
//
startBluetoothDeviceDiscovery() {
let that = this
uni.startBluetoothDevicesDiscovery({
allowDuplicatesKey: true,
success: res => {
that.onBluetoothDeviceFound();
},
fail: res => {
that.isConnection = 2
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
}
});
},
/**
* 发现外围设备
*/
onBluetoothDeviceFound() {
var that = this;
uni.onBluetoothDeviceFound(res => {
res.devices.forEach(device => {
if (!device.name && !device.localName) {
return
}
if (device.name.indexOf("G02") !== -1) {
let value = that.$tools.ab2hex(device.advertisData, "")
let type = value.substring(22, 24)
let num = value.substring(28, 29)
let dw = value.substring(29, 30)
let data = parseInt(value.substring(24, 28), 16)
that.isConnection = 1
if (dw == "1") {
that.unit = "FT"
data = data * 2.54
uni.showModal({
title: '连接已断开',
content: '蓝牙已关闭,请重新打开蓝牙后再开始测量',
showCancel: false,
success: function(res) {
if (res.confirm) {
uni.switchTab({ //
url: "/pages/home/home"
})
}
if (num == "1") {
data = data / 10
}
if (num == "2") {
data = data / 100
}
if (num == "3") {
data = data / 1000
}
if (type == "01") {
clearTimeout(myTime);
that.text = "您的身高是:" + data + that.unit
let buffer = device.advertisData.slice(3, 9)
device.mac = new Uint8Array(buffer) // 广maciOSmac
let tempMac = Array.from(device.mac)
tempMac.reverse()
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
that.deviceId = device.deviceId
that.macAddr = device.macAddr
that.height = data
that.stopblue = false
return
}
return;
}
})
});
that.handleMyTime()
}
},
handleMyTime() {
var that = this;
myTime = setTimeout(function() {
if (!that.macAddr) {
clearTimeout(myTime);
that.text = ""
that.Unload = true
that.stopblue = true
that.isHeight = false
that.isConnection = 2
that.startBluetoothDeviceDiscovery()
that.closeBluetoothAdapter()
}
}, 30000);
},
/**
* 停止搜索蓝牙设备
*/
stopBluetoothDevicesDiscovery() {
uni.stopBluetoothDevicesDiscovery({
success: e => {
console.log("停止搜索蓝牙设备", e)
},
methods: {
//
notifyBLECharacteristicValue() {
let that = this;
uni.notifyBLECharacteristicValueChange({
state: true, // notify
deviceId: that.info.deviceId,
serviceId: that.info.serviceId,
characteristicId: that.info.notify,
success(res) {
uni.onBLECharacteristicValueChange(function(res) {
let value = that.$tools.ab2hex(res.value, "");
let data = parseInt(value.substring(7, 10), 16)
let unit = parseInt(value.substring(10, 12))
let digit = parseInt(value.substring(12, 14))
if (unit == "1") {
that.unit = "inch"
}
if (unit == "2") {
that.unit = "ftin"
}
if (digit == "1") {
data = data / 10
}
if (digit == "2") {
data = data / 100
}
if (Number(data) < 20) {
that.text = "操作错误,请重新测量"
} else {
that.height = data
that.text = "您的身高是:" + data + that.unit
that.isHeight = true
}
console.log("G02", value, data)
})
},
});
fail(res) {
console.log("测量失败", res.value);
}
})
},
//
handleGetMeasure() {
@ -221,46 +166,60 @@
adc: 0,
weight: that.weight,
height: that.height,
aud_id: that.info.id
aud_id: that.user.id
}).then(res => {
that.isHeight = false
if (res.code == 0) {
that.$store.dispatch('getUserInfo', {
aud_id: uni.getStorageSync('userid')
})
that.$store.dispatch("getResult", {
aud_id: uni.getStorageSync('userid')
})
that.$store.dispatch("GetBodyTrendList", {
aud_id: uni.getStorageSync('userid'),
s_time: that.startDate,
e_time: that.endDate
that.$store.dispatch('getUserInfo', {
aud_id: uni.getStorageSync('userid')
})
that.$tools.msg("测量成功")
} else {
that.$tools.msg("测量失败")
}
that.Unload = true
uni.switchTab({
url: "/pages/home/home"
})
setTimeout(function() {
that.closeBLEConnection()
that.closeBluetoothAdapter()
uni.redirectTo({
url: "/pages/body/body?acd_id=2" + '&device=' + that.isdevice
})
}, 200)
}, 500)
})
},
//
handleBack(ind) {
handleHeight() {
let that = this
that.isHeight = false
that.height = ""
that.text = ""
that.Unload = true
that.stopBluetoothDevicesDiscovery()
that.closeBluetoothAdapter()
if (ind == 1) {
uni.redirectTo({
url: "/pages/body/body?acd_id=2" + '&device=' + that.isdevice
})
}
// 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.info.deviceId,
// serviceId: that.info.serviceId,
// characteristicId: that.info.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);
})
},
/**
* 断开蓝牙模块
@ -273,6 +232,19 @@
}
})
},
/**
* 断开蓝牙连接
*/
closeBLEConnection() {
var that = this;
uni.closeBLEConnection({
deviceId: that.info.deviceId,
success: res => {
console.log('断开蓝牙连接成功');
that.$store.commit("changeBluetooth", false);
}
});
},
},
}
</script>

234
pageTwo/devices/PCL.vue Normal file
View File

@ -0,0 +1,234 @@
<template>
<view class="weightPages">
<view class="content ">
<view class="title">连接成功开始测量</view>
<view class="text">{{text}}</view>
<view class="image">
<image src="/static/PCL.gif" class="image3"></image>
</view>
<view class="tips">
<view>提示</view>
<text>1.请确定设备已开机</text>
<text>2.请确定手机蓝牙及位置信息已打开</text>
</view>
</view>
<!-- 手动记录 -->
<view class="wrapper" v-if="isHeight">
<view class="bg"></view>
<view class="Blue">
<view class="h4">测量结果提示</view>
<view class="Blue-box">
本次测量体重为<text>{{weight}}{{unit}}</text>
</view>
<view class="Blue-box">
上次测量身高为<input v-model="height" type="digit" placeholder="请输入身高" />cm
</view>
<view class="Blue-btn Blue-close" @click="handleBack">取消</view>
<view class="Blue-btn" @click="handleGetMeasure">保存测量结果</view>
</view>
</view>
</view>
</template>
<script>
import {
mapState
} from "vuex";
let myTime;
export default {
data() {
return {
text: "",
imp: "",
weight: "",
height: "",
deviceId: "",
unit: "kg",
Unload: false,
isHeight: false,
isConnection: 0,
isdevice: false,
stopblue: true,
}
},
computed: {
...mapState(["user"]),
info() {
return this.user
},
},
onUnload: function() {
let that = this
if (!that.Unload) {
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) {
let that = this
that.text = ""
that.stopblue = true
that.deviceId = options.deviceId
that.height = that.user.height
that.onBluetoothDeviceFound()
},
watch: {
stopblue: function() {
let that = this
if (!that.stopblue) {
clearTimeout(myTime);
that.isHeight = true
}
}
},
methods: {
/**
* 发现外围设备
*/
onBluetoothDeviceFound() {
var that = this;
uni.onBluetoothDeviceFound(res => {
res.devices.forEach(device => {
device.advertisData = device.advertisData ? device.advertisData : ''
if (device.name.indexOf("PCL") !== -1 && device.deviceId.indexOf(that.deviceId) !=
-1) {
clearTimeout(myTime);
let value = that.$tools.ab2hex(device.advertisData, "")
let data = parseInt(value.substring(4, 8), 16)
let msg = parseInt(value.substring(16, 18), 16).toString(2)
let type = msg.substring(5, 6) //0,1
let num = msg.substring(3, 5) //
let dw = msg.substring(1, 3) //
if (dw == "01") {
that.unit = "斤"
}
if (dw == "10") {
that.unit = "lb"
}
if (num == "00") {
data = data / 10
}
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.handleMyTime()
},
handleMyTime() {
var that = this;
myTime = setTimeout(function() {
if (!that.macAddr) {
clearTimeout(myTime);
that.text = ""
that.Unload = true
that.isHeight = false
that.startBluetoothDeviceDiscovery()
that.closeBluetoothAdapter()
}
}, 30000);
},
/**
* 停止搜索蓝牙设备
*/
stopBluetoothDevicesDiscovery() {
uni.stopBluetoothDevicesDiscovery({
success: e => {
console.log("停止搜索蓝牙设备", e)
},
});
},
//
handleGetMeasure() {
let that = this
if (!that.height) {
this.$tools.msg("请输入身高")
return
}
if (that.unit == "斤") {
that.weight = that.weight / 2
}
that.$model.getmeasurefunit({
adc: that.imp,
weight: that.weight,
height: that.height,
aud_id: that.info.id
}).then(res => {
that.isHeight = false
console.log("res", res,that.imp)
if (res.code == 0) {
that.$store.dispatch('getUserInfo', {
aud_id: uni.getStorageSync('userid')
})
that.$store.dispatch("getResult", {
aud_id: uni.getStorageSync('userid')
})
that.$tools.msg("测量成功")
} else {
that.$tools.msg("测量失败")
}
that.Unload = true
setTimeout(function() {
that.stopBluetoothDevicesDiscovery() //
let pages = getCurrentPages();
pages[pages.length - 2].$vm.getBlereload();
uni.switchTab({
url: "/pages/home/home"
})
}, 200)
})
},
//
handleBack() {
let that = this
that.text = ""
that.Unload = true
that.stopBluetoothDevicesDiscovery() //
let pages = getCurrentPages();
console.log("页面返回onUnload", pages, pages[pages.length - 2])
pages[pages.length - 2].$vm.getBlereload();
uni.switchTab({
url: "/pages/home/home"
})
},
/**
* 断开蓝牙模块
*/
closeBluetoothAdapter() {
let that = this;
uni.closeBluetoothAdapter({
success: res => {
console.log('蓝牙模块关闭成功');
}
})
},
},
}
</script>
<style scoped lang="scss">
.image3 {
width: 200px !important;
height: 340px !important;
}
</style>

View File

@ -83,8 +83,7 @@
isToggle: false,
isEnd: false,
iswrapper: false,
isStart: false,
isStart: false
}
},
computed: {
@ -103,6 +102,7 @@
that.handleStart('连续')
}, 1200)
}
that.handleAudioStart()
that.$Bluetooth.onBLEConnectionStateChange()
uni.onBluetoothAdapterStateChange(function(res) {
that.$store.commit("changeBluetooth", res.available);
@ -137,6 +137,13 @@
console.log("蓝牙是否打开", that.isBluetoothTyle)
}
},
//
isStart: function() {
let that = this
if (that.isStart) {
that.handleAudio()
}
},
//
isToggle: function() {
let that = this
@ -170,13 +177,74 @@
}, 400)
}
},
//
isStart: function() {
//
weight: function() {
let that = this
if (that.isStart) {
that.handleAudio()
if (that.info.active == 1) {
that.$video.video.forEach(ite => {
if (Number(ite.name) == that.weight) {
innerAudioContext.autoplay = true;
innerAudioContext.loop = false;
innerAudioContext.src = ite.video;
innerAudioContext.play()
setTimeout(function() {
innerAudioContext.stop();
that.handleAudio()
}, 3000)
}
})
}
}
if (that.info.active == 2) {
let time = that.time_m * 60 + that.time_s
that.$video.video.forEach(ite => {
if ((Number(ite.name) == that.weight) && (Number(time) > 10)) {
innerAudioContext.autoplay = true;
innerAudioContext.loop = false;
innerAudioContext.src = ite.video;
innerAudioContext.play()
setTimeout(function() {
innerAudioContext.stop();
that.handleAudio()
}, 3000)
}
})
if (that.time_m == "00" && that.time_s == "10") {
innerAudioContext.autoplay = true;
innerAudioContext.loop = false;
innerAudioContext.src = '/static/time.mp3';
innerAudioContext.play()
setTimeout(function() {
innerAudioContext.stop();
that.handleAudio()
}, 3000)
}
}
if (that.info.active == 3) {
that.$video.video.forEach(ite => {
if ((Number(ite.name) == (Number(that.Ycount) - Number(that.weight))) && Number(that
.weight) != 0) {
innerAudioContext.autoplay = true;
innerAudioContext.loop = false;
innerAudioContext.src = ite.video;
innerAudioContext.play()
setTimeout(function() {
innerAudioContext.stop();
that.handleAudio()
}, 3000)
}
})
if (Number(that.weight) == 10) {
innerAudioContext.autoplay = true;
innerAudioContext.loop = false;
innerAudioContext.src = '/static/number.mp3';
innerAudioContext.play()
setTimeout(function() {
innerAudioContext.stop();
that.handleAudio()
}, 3000)
}
}
},
},
methods: {
handleAudio() {
@ -184,7 +252,17 @@
innerAudioContext.loop = true;
innerAudioContext.src = '/static/flight.mp3';
innerAudioContext.play()
},
handleAudioStart() {
let that = this
innerAudioContext.autoplay = true;
innerAudioContext.loop = false;
innerAudioContext.src = '/static/Start.mp3';
innerAudioContext.play()
setTimeout(function() {
innerAudioContext.stop();
that.handleAudio()
}, 5000)
},
//
notifyBLECharacteristicValue() {
@ -211,9 +289,6 @@
that.Ycount = Ycount
that.time = time
that.kcal = kcal / 10
if (count != 0 && !that.isStart) {
that.isStart = true
}
if (that.info.active != 2 && count != 0) { // +
minutes = Math.floor((time % 3600) / 60)
seconds = time % 60
@ -282,6 +357,7 @@
cancelText: "返回",
success: function(res) {
if (res.cancel) {
that.isStart = false
innerAudioContext.stop();
uni.navigateBack({ //
delta: 1
@ -329,6 +405,8 @@
type: that.info.active == 1 ? 'free' : that.info.active == 2 ? 'time' : 'num'
}).then(res => {
console.log("保存", that.time, res)
that.isStart = false
innerAudioContext.stop()
if (res.code == 0) {
that.bpm = that.weight / (that.time / 60)
that.iswrapper = true
@ -379,6 +457,7 @@
},
handleTarget() {
let that = this
innerAudioContext.stop();
uni.navigateBack({ //
delta: 1
})

View File

@ -1,6 +1,6 @@
<template>
<view class="common">
<view class="history">
<view class="history" v-if="ranklist.length">
<uni-swipe-action>
<uni-swipe-action-item :right-options="item.options" v-for="(item, index) in ranklist" :key="index"
@click="swipeClick($event, index)">
@ -20,7 +20,7 @@
</uni-swipe-action>
<view class="endtext" v-if="!lastPage || page >= lastPage"> 到底了看看别的吧 </view>
</view>
<view class="nolist" v-if="!lastPage">
<view class="nolist" v-if="!ranklist.length||!lastPage">
<image src="../../static/none.png"></image>
<text>暂无数据</text>
</view>
@ -98,10 +98,19 @@
return
}
that.ranklist.splice(index, 1)
that.$store.dispatch("getUserInfo", {
aud_id: uni.getStorageSync('userid')
})
that.isDelete = true
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("删除成功")
})
} else if (res.cancel) {
@ -176,7 +185,7 @@
align-items: center;
font-weight: 700;
line-height: 50rpx;
font-size:36rpx !important;
font-size: 36rpx !important;
text {
display: block;
@ -188,7 +197,7 @@
}
.time {
font-size: 28rpx;
font-size: 28rpx;
color: #666;
display: flex;
align-items: center;

329
pageTwo/home/bmi.vue Normal file
View File

@ -0,0 +1,329 @@
<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">
<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.maxvalue}}</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,
}
},
computed: {
endDate() {
return this.$tools.getDate("start")
},
},
onLoad() {},
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: 12px;
color: #999;
line-height: 22px
}
.editem {
position: relative;
display: flex;
align-items: center;
font-size: 14px;
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: 14px !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: 13px;
}
.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>

View File

@ -0,0 +1,291 @@
<template>
<view class="content">
<view class="top">
<text>成年身高预测</text>
为保证数据准确定请认真填写真实信息
</view>
<table class="table">
<tr>
<th>性别</th>
<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-15">
<uni-icons :type="sex==2?'checkbox-filled':'circle'" @click="sex=2" size="24"
:color="sex==2?'#fea606':'#dfdfdf'"></uni-icons>
</view>
</td>
</tr>
<tr>
<th>出生日期</th>
<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>
</td>
</tr>
<tr>
<th>爸爸身高</th>
<td><input class="input" type="digit" v-model="dadheight " placeholder="请输入">cm
</td>
<th>妈妈身高</th>
<td><input class="input" type="digit" v-model="momheight" placeholder="请输入">cm
</td>
</tr>
</table>
<view class="table table2">
<tr>
<th>当前标准身高</th>
<th>成年身高预测</th>
</tr>
<tr>
<td><text>{{geneticheight}}</text>cm</td>
<td><text>{{adultheight}}</text>
<text class="text" v-if="errorvalue">±{{errorvalue}}</text> cm
</td>
</tr>
</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"]),
startDate() {
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;
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: 12px;
text-align: center;
margin-bottom: 30rpx;
color: #999;
text {
width: 100%;
display: block;
text-align: center;
font-size: 20px;
color: #333;
font-weight: 600;
}
}
.h5 {
font-size: 14px;
color: #666;
}
.con {
margin-top: 5px;
margin-bottom: 30rpx;
color: #999;
line-height: 22px;
font-size: 12px;
}
/deep/input {
width: 95%;
height: 35px;
line-height: 35px;
font-size: 12px !important;
}
.table,
.table2 {
width: 100%;
border: 1px solid #d69231;
border-bottom: none;
box-sizing: border-box;
border-spacing: inherit;
font-size: 12px;
height: auto;
overflow: hidden;
border-right: none;
th {
width: 20%;
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;
width: 30%;
height: 35px;
line-height: 35px;
padding-right: 10px;
padding-left: 10px;
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: 12px !important;
}
}
}
.table2 {
margin: 50rpx auto;
border-right: none;
text-align: center;
th {
width: 50%;
border-right: 1px solid #d69231;
}
td {
height: 50px;
width: 50%;
line-height: 50px;
display: inherit;
border-right: 1px solid #d69231;
text {
font-size: 18px;
font-weight: bold
}
}
}
}
.btn {
margin-top: 20px;
margin-bottom: 15px;
background-color: $maincolor;
}
</style>

View File

@ -34,19 +34,20 @@
<input class="uni-input" v-model="password" />
</view>
</view>
<view class="forget " v-if="!isCode" >
<view class="forget " v-if="!isCode">
<text @click="handlePassword('forgetPassword')">忘记密码?</text>
</view>
</view>
<!-- <view class="xieyi">
<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>
<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>
<view class="btnlogin" @click="handleTelLogin">登录</view>
<view class="btngroup" @click="handlePassword('register')">
<text>注册</text>
@ -65,7 +66,7 @@
password: "",
disabled: false,
second: 60,
value: 1,
value: 0,
isCode: true,
}
},
@ -158,7 +159,13 @@
})
},
handlexieyi() {
let that = this
uni.navigateTo({
url: "/pageTwo/webview/webview?url=http://tc.pcxbc.com/technology/privacy_index"
})
},
handleUserXieyi() {
let that = this
}
}
}
@ -171,4 +178,18 @@
width: 100%;
height: 100vh;
}
.xieyi {
font-size: 28rpx;
color: #999;
margin-left: 10px;
text {
color: $maincolor;
}
}
.href {
width: auto;
}
</style>

View File

@ -95,7 +95,7 @@
});
dtask.onProgressUpdate((res) => {
showLoading.setTitle(" 正在下载" + res.progress + "% ");
console.log('下载进度' + res.progress + '%');
// console.log('' + res.progress + '%');
});
} else {
plus.runtime.launchApplication({

View File

@ -106,15 +106,26 @@
}
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.$store.dispatch("getCardList", {
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)

View File

@ -18,10 +18,18 @@
<view class="lan border-bottom">
<view class="left">性别</view>
<view class="right">
<picker mode="selector" :range="sexItem" @change="onsexArr">
<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>
</picker> -->
</view>
</view>
<view class="lan border-bottom">
@ -50,7 +58,24 @@
</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="memInfo.measure_model=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="memInfo.measure_model=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"
@ -61,22 +86,14 @@
</picker>
</view>
</view>
<view class="lan border-bottom" v-if="memInfo.identity_id=='P0'">
<view class="left">自定义</view>
<view class="right">
<input name="name" type="text" v-model="identityName" placeholder="请输入身份" />
<uni-icons type="clear" color="#999" v-if="identityName" @click="identityName=''"
size="20"></uni-icons>
</view>
</view>
<view class="lan border-bottom" @click="handleCityList">
<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">
<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"
@ -121,17 +138,17 @@
"女"
],
memInfo: {
measure_model: 2,
birthday: "",
gender: '',
gender: 1,
nickname: "",
grade: "",
grade: "nothing",
height: "",
weight: "",
address: '',
identity_name: "",
identity_id: "P0",
},
identityName: "",
visible: false,
province: [], //
city: [], //
@ -154,13 +171,14 @@
},
onLoad(options) {
let that = this
that.handleGradeList()
that.handleIdentityList()
if (options.info) {
that.memInfo = JSON.parse(options.info)
that.gradeIndex = that.gradeList.findIndex((profile) => profile.id === that.memInfo.grade);
that.identityIndex = that.identityList.findIndex((profile) => profile.id === that.memInfo.identity_id);
that.identityName = that.memInfo.identity_id == 'P0' ? that.memInfo.identity_name : ''
if(options.measure_model=="1"){
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);
}
that.isEdit = true
}
// #ifdef APP-PLUS
@ -178,10 +196,6 @@
that.$tools.msg("请输入姓名")
return;
}
if (!that.memInfo.gender) {
that.$tools.msg("请选择性别")
return;
}
if (!that.memInfo.height) {
that.$tools.msg("请选择身高")
return;
@ -194,22 +208,14 @@
that.$tools.msg("请选择出生日期")
return;
}
if (!that.memInfo.identity_id) {
if (that.memInfo.measure_model == 1 && !that.memInfo.identity_id) {
that.$tools.msg("请选择身份信息")
return;
}
if (!that.memInfo.address) {
if (that.memInfo.measure_model == 1 && !that.memInfo.address) {
that.$tools.msg("请选择所属地区")
return;
}
if (!that.memInfo.grade) {
that.$tools.msg("请选择所在年级")
return;
}
if (that.memInfo.identity_id == 'P0') {
that.memInfo.identity_name = that.identityName ? that.identityName : that.identityList[that
.identityIndex].name
}
let https = that.isEdit ? that.$model.getEditUser(that.memInfo) : that.$model.getAddUser(that.memInfo)
return https.then(res => {
console.log("成功", res)
@ -228,36 +234,43 @@
}).then(res => {
console.log("成员列表", res)
that.$store.commit('changeFamilay', res.data)
let aud_id = ""
//
if (that.isEdit && that.memInfo.id == uni.getStorageSync('userid')) {
console.log("修改用户")
that.$store.dispatch('getUserInfo', {
aud_id: uni.getStorageSync('userid')
})
aud_id = uni.getStorageSync('userid')
}
//
if (!that.isEdit) {
console.log("添加用户")
uni.setStorageSync('userid', id)
uni.setStorageSync('gender', that.memInfo.gender)
that.$store.dispatch('getUserInfo', {
aud_id: id
})
that.$store.dispatch("getCardList", {
aud_id: id
})
uni.redirectTo({
url: "/pageTwo/cardList/card"
})
} else {
uni.navigateBack({
delta: 1
});
aud_id = id
}
that.$store.dispatch('getUserInfo', {
aud_id: aud_id
})
that.$store.dispatch("getResult", {
aud_id: aud_id
})
that.handlePublicRecord(aud_id)
uni.navigateBack({
delta: 1
});
}).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)
@ -280,7 +293,7 @@
that.memInfo.identity_name = that.identityList[e.detail.value].name
},
//
bindChange: function(e) {
bindChange(e) {
let that = this
if (e.detail.value[0] != that.value[0]) {
e.detail.value[1] = 0
@ -297,23 +310,28 @@
handleCityList() {
let that = this
that.province = that.cityList
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
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
}
},
// 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
@ -383,6 +401,11 @@
position: relative;
text-align: right;
.radio {
display: flex;
align-items: center;
}
picker {
width: 100%;
text-align: right;

View File

@ -0,0 +1,20 @@
<template>
<web-view :src="webviewUrl"></web-view>
</template>
<script>
export default {
data() {
return {
webviewUrl: ''
};
},
// URL
onLoad(option) {
let token = uni.getStorageSync('token')
let url = "https://tc.pcxbc.com/editortext/model_content?token=" + token + '&id=' + option.id
console.log("11111",url)
this.webviewUrl = decodeURIComponent(url);
}
}
</script>

View File

@ -60,15 +60,6 @@
}
},
{
"path": "pages/business/business",
"style": {
"navigationBarTitleText": "设备管理",
"enablePullDownRefresh": true,
"onReachBottomDistance": 50
}
},
{
"path": "pages/PublicCards/PublicCards",
"style": {
@ -83,6 +74,12 @@
"onReachBottomDistance": 50
}
},
{
"path": "pages/zixun/list",
"style": {
"navigationBarTitleText": ""
}
}
],
@ -125,6 +122,15 @@
"navigationBarTitleText": "卡片设置",
"enablePullDownRefresh": false
}
},
{
"path": "business/business",
"style": {
"navigationBarTitleText": "设备管理",
"enablePullDownRefresh": true,
"onReachBottomDistance": 50
}
}, {
"path": "business/addDevice",
@ -252,6 +258,12 @@
}
},
{
"path": "devices/PCL",
"style": {
"navigationBarTitleText": "测量",
"enablePullDownRefresh": false
}
}, {
"path": "devices/PCV02",
"style": {
"navigationBarTitleText": "",
@ -303,6 +315,26 @@
"style": {
"navigationBarTitleText": "对比详情"
}
},
{
"path": "home/inheritHeighet",
"style": {
"navigationBarTitleText": "身高预测"
}
},
{
"path": "home/bmi",
"style": {
"navigationBarTitleText": "BMI测评"
}
},
{
"path": "webview/webview",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
]
}],
@ -316,7 +348,7 @@
//
"tabBar": {
"color": "#333",
"fontSize": "13px",
"fontSize": "14px",
"selectedColor": "#37cc92",
"backgroundColor": "#fff",
"list": [{
@ -326,15 +358,10 @@
"text": "首页"
},
{
"pagePath": "pages/score/score",
"pagePath": "pages/zixun/list",
"iconPath": "static/ping.png",
"selectedIconPath": "static/ping2.png",
"text": "估分"
}, {
"pagePath": "pages/business/business",
"iconPath": "static/bei.png",
"selectedIconPath": "static/bei2.png",
"text": "设备"
"text": "资讯"
},
{
"pagePath": "pages/my/me",

View File

@ -68,7 +68,7 @@
</view>
<view class="right">
<view class="charts">
<qiun-data-charts type="arcbar" :chartData="chartData" :Height="140" :Width="140" />
<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">
@ -103,7 +103,7 @@
</view>
<view class="name">数据对比</view>
</view>
<view class="item" @click="$store.commit('changeRecord',true)">
<view class="item" @click="$store.commit('changePublicAdd',true)">
<view class="image">
<image src="@/static/history.png"></image>
</view>
@ -112,7 +112,7 @@
</view>
</view>
<!-- 手动记录 -->
<record :rtype='acd_id'></record>
<publicAdd :rtype='acd_id' :active="active"></publicAdd>
</view>
</template>
@ -120,7 +120,7 @@
import {
mapState
} from "vuex";
import record from '@/element/manuallyAdd/record.vue';
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() {
@ -135,13 +135,13 @@
series: [{
name: "正确率",
color: "#4687F9",
data: 0.8
data: 0
}]
},
}
},
components: {
record,
publicAdd,
qiunDataCharts
},
computed: {
@ -152,10 +152,9 @@
that.labelName = that.PublicContent.label_list[that.active]
that.lineList = that.PublicContent.line_list
that.label_data = that.PublicContent.label_data
that.chartData.series[0].data = Number(that.PublicContent.label_data[that.active].offset) / 100
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
}
console.log("11111", that.PublicContent, that.active, that.labelName)
return that.PublicContent ? that.PublicContent.label_list : []
},
},
@ -371,6 +370,7 @@
display: flex;
align-items: center;
justify-content: center;
z-index: 9;
.name {
width: 100%;
@ -391,7 +391,7 @@
.standard {
width: 100%;
text-align: center;
margin-top: -3px;
margin-top: 0px;
margin-bottom: 8px;
text {

View File

@ -1,161 +1,8 @@
<template>
<view class="content">
<!-- tabbar -->
<view class="tabbar">
<view @click="active=1" :class="[active==1?'active':'']">报告</view>
<view @click="active=2" :class="[active==2?'active':'']">曲线</view>
</view>
<!--报告 -->
<view v-if="active==1" class="report">
<view class="box" v-if="info&&info.top_list.length">
<view class="time">{{info?info.record_time:''}}</view>
<view class="item2">
<view class="item2_data" v-for="(item,index) in info.top_list" @click="handleToggleTop(item)">
<view class="data ">
<view class="c666 mb-5">{{item.name}}</view>
<view><text>{{item.value}}</text>{{item.unit}}</view>
</view>
</view>
<view class="myinfoPage" v-if="infoListTop">
<view class="desc">
<view v-if="infoListTop.desc" class="ming">{{infoListTop.desc}}</view>
<view :class="[infoListTop.list.length?'statuevue':'']" v-if="infoListTop.list">
<view class="bi">
<view :style="'left:'+infoListTop.offset+'%'" class="peobox">
<view class="xx"></view>
</view>
<view class="item" v-for="(ite , ind) in infoListTop.list" :key="ind"
:style="{backgroundColor:ite.color}">
<view class="span1">{{ite.text}}</view>
<view class="span" v-if="ind<infoListTop.list.length-1">{{ite.max_val}}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="nolist" v-if="!info">
<image src="../../static/none.png"></image>
<text>暂无数据请手动添加~</text>
</view>
<!-- -->
<view class="box2" v-if="info">
<view>身体得分{{info?info.score_value:0}}</view>
<view>身体类型{{info?info.body_type_value:'无'}}</view>
</view>
<!-- -->
<view class="info">
<view class="item" @click="handlerRecord">
<text class="t-icon-jilu1 t-icon"></text>
<view>手动记录</view>
</view>
<view class="item" @click="handleisSdevice()">
<text class="t-icon-wulianjie t-icon"></text>
<view>连接设备</view>
</view>
</view>
<!-- -->
<view class="bold mt-10" v-if="info&&info.bottom_list">其他数据</view>
<view class="myinfoPage" v-if="info&&info.bottom_list">
<view class="box1">
<uni-collapse accordion>
<uni-collapse-item class="list" v-for="(item,index) in info.bottom_list" :key="index">
<template v-slot:title>
<uni-list-item class="block">
<view class="name">
<icon class="t-icon iconfont" :class="'t-icon-'+item.key_name"></icon>
{{item.name}}
</view>
<view class="val" v-if="item.title=='肥胖等级'||item.title=='体型'"> - </view>
<view class="val" v-else>{{item.value?item.value:'0'}}{{item.unit}}</view>
<view class="level">
<view class="btnf"
:style="{backgroundColor:(item.standard=='异常'?'#FFF':item.color)}"
:class="[item.standard=='异常'?'btnC':'']">
{{item.standard=='异常'?'-':item.standard}}
</view>
</view>
</uni-list-item>
</template>
<view class="desc">
<view v-if="item.desc" class="ming">{{item.desc}}</view>
<view :class="[item.list.length?'statuevue':'']" v-if="item.list">
<view class="bi" v-if="item.title!='基础代谢'">
<view :style="'left:'+item.offset+'%'" class="peobox">
<view class="xx"></view>
</view>
<view class="item" v-for="(ite , ind) in item.list" :key="ind"
:style="{backgroundColor:ite.color}">
<view class="span1">{{ite.text}}</view>
<view class="span" v-if="ind<item.list.length-1">{{ite.max_val}}</view>
</view>
</view>
<view v-else>
<view class="kcalClass" v-if="item.list&&item.list.length">
标准值:{{item.list[0].max_val}}kcal
</view>
</view>
</view>
</view>
</uni-collapse-item>
</uni-collapse>
</view>
<view class="tips c999 ml-15" v-if="info&&info.literature.length">
<text>*数据参考</text>
<text v-for="(item,index) in info.literature" :key="index">
{{item}}
</text>
</view>
</view>
<view class="tips2" v-if="info&&info.bottom_list">
<uni-icons type="info-filled" color="red"></uni-icons>
此测量数据仅供参考不可代替医学专业测试
</view>
<!-- 成长建议 -->
<view v-if="info&&cplist&&(cplist.sleeplist.lengt||cplist.nutritionlist.length)">
<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>
<!-- 手动记录 -->
<record :rtype="acd_id"></record>
</view>
<!-- 曲线 -->
<view v-if="active==2" class="charts">
<view class="charts">
<view class="TrendPage">
<!-- 时间选择 -->
<view class="boxTime">
@ -195,22 +42,12 @@
<view class="box" v-else>
<view class="nolist">
<image src="../../static/none.png"></image>
<text>暂无数据请手动添加~</text>
<text>暂无数据</text>
</view>
</view>
</view>
<!-- 目标-->
<view class="gridList">
<view class="info">
<view class="item" @click="navTo('/pageTwo/history/history?acd_id='+ acd_id)">
<text class="t-icon-lishi t-icon"></text>
<view>历史记录</view>
</view>
<view class="item" @click="navTo('/pageTwo/compk/contrast?acd_id='+ acd_id)">
<text class="t-icon-renshiduibifenxi t-icon"></text>
<view>数据对比</view>
</view>
</view>
<view class="data">
<view class="item" @click="handleClick(1)">
<view class="val">
@ -260,22 +97,12 @@
fields: "",
active: 1,
acd_id: 2,
isDevice: 0,
infoList: [],
infoListTop: {},
ind: 0,
active1: 0,
startTime: "",
endTime: "",
lineData: {},
handTrue: true,
proposalnd: 1,
cplist: {
moodlist: [],
nutritionlist: [],
sleeplist: [],
sportlist: []
}
}
},
computed: {
@ -286,13 +113,7 @@
return that.Trend
},
userInfo() {
return this.user
},
info() {
let that = this
that.cplist = that.MeasureResult ? that.MeasureResult.cplist : {}
that.infoListTop = that.MeasureResult ? that.MeasureResult.top_list[0] : {}
return that.MeasureResult
return this.MeasureResult
},
endDate() {
return this.$tools.getDate("start")
@ -309,10 +130,6 @@
onLoad(options) {
let that = this
that.acd_id = options.acd_id
that.isDevice = options.device
that.$store.dispatch("getResult", {
aud_id: uni.getStorageSync('userid')
})
that.$store.dispatch("GetBodyTrendList", {
aud_id: uni.getStorageSync('userid'),
s_time: that.startDate,
@ -325,22 +142,9 @@
that.fields = "day"
// #endif
},
onBackPress(options) {
let that = this
setTimeout(() => {
uni.switchTab({
url: '/pages/home/home'
})
}, 300)
console.log("返回首页")
return true
},
//
onPullDownRefresh() {
let that = this
that.$store.dispatch("getResult", {
aud_id: uni.getStorageSync('userid')
})
that.$store.dispatch("GetBodyTrendList", {
aud_id: uni.getStorageSync('userid'),
s_time: that.startDate,
@ -351,47 +155,6 @@
}, 1000);
},
methods: {
handleisSdevice() {
let that = this
console.log("isDevice", that.isDevice, typeof that.isDevice)
if (Number(that.isDevice) != 0) {
uni.openBluetoothAdapter({
success: e => {
that.$store.commit("changeBluetooth", true);
uni.navigateTo({
url: "/pageTwo/devices/search?id=" + that.acd_id
})
console.log('初始化蓝牙成功:' + e.errMsg);
},
fail: err => {
console.log('初始化蓝牙失败:' + err.errMsg);
return that.$Bluetooth.getBluetoothAdapter(err)
}
});
} else {
that.$tools.msg("请先添加设备!")
setTimeout(function() {
uni.switchTab({
url: "/pages/business/business"
})
}, 500)
}
},
//
reload() {
let that = this
console.log('重新加载');
this.$nextTick(() => {
that.$store.dispatch("getResult", {
aud_id: uni.getStorageSync('userid')
})
that.$store.dispatch("GetBodyTrendList", {
aud_id: uni.getStorageSync('userid'),
s_time: that.startDate,
e_time: that.endDate
})
})
},
showbox(index) {
let that = this
that.handTrue = false
@ -451,18 +214,6 @@
this.ind = ind
this.$store.commit("changeFirst", true);
},
//
handlerRecord() {
this.$store.commit('changeRecord', true)
},
handleToggleTop(item) {
this.infoListTop = item
},
navTo(url) {
uni.navigateTo({
url: url
})
},
}
}
</script>

View File

@ -1,9 +1,160 @@
<template>
<view class="content indexCarList">
<!-- 头部 -->
<headerIndex :isArea="false"></headerIndex>
<!-- 卡片数据 -->
<view class="radius50"></view>
<headerIndex :isArea="false" v-if="isShow"></headerIndex>
<!-- 蓝牙提示区 -->
<view class="bleTips" v-if="islink==0">
{{textLink}}
</view>
<view class="bleTips2 bleTips" v-else @click="openBluetoothAdapter">
{{textLink}}
</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>
<!-- 身体数据 -->
<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" 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 class="tips c999 ml-15 mb-15" v-if="info&&info.literature.length">
<text>*数据参考</text>
<text v-for="(item,index) in info.literature" :key="index">
{{item}}
</text>
</view>
</view>
<view class="tips2" v-if="info&&info.bottom_list">
<uni-icons type="info-filled" color="red"></uni-icons>
此测量数据仅供参考不可代替医学专业测试
</view>
<!-- 成长建议 -->
<view v-if="info&&cplist&&(cplist.sleeplist.length||cplist.nutritionlist.length)">
<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>
<!-- 卡片 -->
<view class="list" v-if="user">
<view v-for="(item,index) in user.card_data_list">
<!-- 标题 -->
@ -36,7 +187,7 @@
<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="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>
@ -44,13 +195,13 @@
</view>
</view>
<!-- 设置数据卡片 -->
<view class="setcard" @click="handleCard" v-if="userList.length">
<view class="setcard" @click="handleCard" v-if="userList.length&&user.measure_model==1">
设置数据页卡片
</view>
<view class="nolist" v-else @click="handleAddUser" style="margin-top: 150px;">
<!-- <view class="nolist" @click="handleAddUser" :style="{'marginTop':isShow?'150px':'0'}">
<image src="../../static/none.png"></image>
<text>请先添加成员</text>
</view>
</view> -->
<!-- 手动 -->
<record :rtype="rtype"></record>
</view>
@ -60,13 +211,82 @@
import {
mapState
} from "vuex";
let myTime;
import headerIndex from "@/element/headerIndex.vue"
import record from '@/element/manuallyAdd/record.vue';
export default {
data() {
return {
rtype: 0,
transition: 1.6
transition: 1.6,
isShow: true,
infoListTop: {},
activeHeight: 0,
deviceId: "",
serviceId: "",
write: "",
notify: "",
cplist: {
moodlist: [],
nutritionlist: [],
sleeplist: [],
sportlist: []
},
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"
},
],
}
},
components: {
@ -74,47 +294,321 @@
headerIndex
},
computed: {
...mapState(["user", "familayList"]),
...mapState(["user", "familayList", 'MeasureResult', "isConnected", "isBluetoothTyle"]),
userList() {
return this.familayList
},
info() {
let that = this
that.cplist = that.MeasureResult ? that.MeasureResult.cplist : null
that.infoListTop = that.MeasureResult ? that.MeasureResult.top_list[0] : {}
that.activeHeight = 0
return that.MeasureResult
},
},
onLoad(options) {
let that = this
console.log("首页options", options)
// #ifdef APP-PLUS
if (options && options.type == 1) {
that.handleUserList()
that.openBluetoothAdapter()
}
},
onShow() {
let that = this
that.$Bluetooth.stopBluetoothDevicesDiscovery()
uni.hideLoading()
// #endif
// #ifndef APP-PLUS
that.handleoginversion()
// #endif
uni.onBluetoothAdapterStateChange(function(res) {
that.$store.commit("changeBluetooth", res.available);
})
},
onPullDownRefresh() {
let that = this
that.$store.dispatch('getUserInfo', {
aud_id: uni.getStorageSync('userid')
})
setTimeout(() => {
uni.stopPullDownRefresh()
}, 1000);
that.isShow = true
if (that.userList.length) {
that.handleUserList()
}
that.openBluetoothAdapter()
uni.stopPullDownRefresh()
},
watch: {
isConnected: function() {
let that = this
if (!that.isConnected) {
that.textLink = "请打开手机蓝牙后,开始测量"
that.islink = -1
}
},
isBluetoothTyle: function() {
let that = this
if (!that.isBluetoothTyle) {
that.textLink = "重新测量"
that.islink = -1
}
},
},
methods: {
//
handlelenver(value) {
//
openBluetoothAdapter() {
let that = this
let number = 0
let length = that.list.length
number = value / (that.list[0].max_val - that.list[length - 1].min_val) * 100
return number.toFixed(0)
that.devicesList = []
uni.openBluetoothAdapter({
success: e => {
that.islink = 0
that.textLink = "蓝牙搜索中"
console.log("蓝牙初始化成功")
that.startBluetoothDeviceDiscovery()
},
fail: 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 => {
that.islink = -1
that.textLink =
"获取权限成功,连接蓝牙"
that.$store.commit(
"changeBluetooth",
true);
},
fail: err => {
that.islink = -1
that.textLink =
"请打开手机蓝牙后,开始测量"
}
});
} else {
uni.showToast({
title: "获取权限失败,将无法使用手机蓝牙进行测量",
icon: "none"
})
}
}
})
}
})
} else {
that.islink = -1
that.textLink = "请打开手机蓝牙后,开始测量"
}
}
});
},
//
startBluetoothDeviceDiscovery() {
let that = this
uni.startBluetoothDevicesDiscovery({
allowDuplicatesKey: true, //
success: res => {
that.onBluetoothDeviceFound();
},
fail: res => {}
});
},
/**
* 发现外围设备
*/
onBluetoothDeviceFound() {
var that = this;
uni.onBluetoothDeviceFound(res => {
res.devices.forEach(device => {
if (device.name.indexOf("G02") != -1) {
clearTimeout(myTime);
that.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.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)
if (idx === -1) {
if (device.name.indexOf("PCL") != -1) {
that.devicesList.push(device)
uni.navigateTo({
url: "/pageTwo/devices/PCL?deviceId=" + device.deviceId
})
} else {
that.devicesList.push(device);
that.createBLEConnection()
that.$Bluetooth.stopBluetoothDevicesDiscovery()
}
}
},
//
createBLEConnection() {
let that = this;
uni.createBLEConnection({
deviceId: that.deviceId,
success: res => {
setTimeout(function() {
uni.hideLoading()
that.textLink = "蓝牙连接中"
that.getBLEDeviceServices()
}, 1000)
},
fail: res => {
that.islink = -1
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.islink = -1
that.textLink = "设备连接失败,重新连接"
clearTimeout(myTime);
console.log('获取设备的UUID失败:', res)
}
});
},
/**
* 获取指定服务的特征值
*/
getBLEDeviceCharacteristics() {
let that = this;
uni.getBLEDeviceCharacteristics({
deviceId: that.deviceId,
serviceId: that.serviceId,
success: 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('0000FFF1') != -1) {
that.notify = item.uuid
} else if (item.uuid.indexOf('0000FFF2') != -1) {
that.write = item.uuid
}
}
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))
}
})
},
/**
* 开启订阅特征值
* read: true, //,write: true, //,notify: true, //广
*/
notifyBLECharacteristicValue() {
let that = this;
uni.notifyBLECharacteristicValueChange({
state: true, // notify
deviceId: that.deviceId,
serviceId: that.serviceId,
characteristicId: that.notify,
success(res) {
let info = {
deviceId: that.deviceId,
serviceId: that.serviceId,
notify: that.notify,
write: that.write,
}
uni.navigateTo({
url: "/pageTwo/devices/G02?info=" + JSON.stringify(info)
})
},
fail(res) {
console.log("测量失败", res.value);
}
});
},
handleMyTime() {
var that = this;
myTime = setTimeout(function() {
if (!that.devicesList.length) {
that.islink = -1
that.textLink = "未搜索到有效设备,重新搜索"
clearTimeout(myTime);
that.$Bluetooth.stopBluetoothDevicesDiscovery()
}
}, 30000);
},
// 广
getBlereload() {
let that = this
that.islink = -1
that.textLink = "重新测量"
},
//
handleoginversion() {
let that = this
that.$model.getloginversion({}).then(res => {
if (res.code == 0) {
that.handleUserList()
that.openBluetoothAdapter()
} 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)
@ -122,17 +616,24 @@
}
that.$store.commit('changeFamilay', res.data)
if (res.data.length) {
let userid = uni.getStorageSync('userid')
let found = res.data.find(e => e.id == userid);
if (found !== undefined) {
userid = found.id
} else {
userid = res.data[0].id
uni.setStorageSync('userid', res.data[0].id)
}
console.log("正确userid", userid)
that.$store.dispatch('getUserInfo', {
aud_id: uni.getStorageSync('userid') ? uni.getStorageSync('userid') : res.data[
0].id
aud_id: userid
})
that.$store.dispatch("getCardList", {
aud_id: uni.getStorageSync('userid') ? uni.getStorageSync('userid') : res.data[
0].id
that.$store.dispatch("getResult", {
aud_id: userid
})
that.handleLabelList(res.data[0].id)
that.handlePublicRecord(res.data[0].id)
that.handleCityList()
that.handleLabelList(userid)
that.handlePublicRecord(userid)
}
}).catch(err => {})
},
@ -140,7 +641,7 @@
handleLabelList(id) {
let that = this
that.$model.getLabelList({
aud_id: uni.getStorageSync('userid') ? uni.getStorageSync('userid') : id
aud_id: id
}).then(res => {
console.log("公共卡片项目", res)
if (res.code == 0) {
@ -148,22 +649,11 @@
}
})
},
//
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)
})
},
//
handlePublicRecord(id) {
let that = this
that.$model.getPublicRecord({
aud_id: uni.getStorageSync('userid') ? uni.getStorageSync('userid') : id
aud_id: id
}).then(res => {
console.log("公共手动记录", res)
if (res.code == 0) {
@ -177,6 +667,14 @@
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)
@ -196,17 +694,47 @@
url: "/pageTwo/my/userInfo"
})
},
handleToggleTop(item, index) {
this.infoListTop = item
this.activeHeight = index
},
navTo(url) {
console.log("url", url)
uni.navigateTo({
url: url
})
}
},
/**
* 断开蓝牙模块
*/
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("changeBluetooth", false);
}
});
},
}
}
</script>
<style lang="scss" scoped>
@import "@/scss/body.scss";
/deep/.header {
width: 100%;
@ -294,4 +822,52 @@
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;
}
//
.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;
}
}
.bleTips2 {
background: #fea606;
color: #fff;
}
.activeHeight {
padding-bottom: 10px;
border-bottom: 2px solid $maincolor;
}
</style>

View File

@ -61,7 +61,7 @@
</view>
</view>
<!-- 手动记录 -->
<record :rtype='acd_id'></record>
<record :rtype="acd_id"></record>
</view>
</template>

View File

@ -20,7 +20,7 @@
</view>
</view>
</view>
<!-- <view class="list">
<view class="list" @click="navTo('/pageTwo/business/business')">
<view class="item border-bottom">
<view class="left">
<view class="name">设备管理</view>
@ -29,7 +29,7 @@
<uni-icons type="right"></uni-icons>
</view>
</view>
</view> -->
</view>
<view class="list" @click="navTo('/pageTwo/score/history')">
<view class="item border-bottom">
<view class="left">

View File

@ -6,7 +6,7 @@
<view class="box">
<view class="title bold">本次估分成绩为</view>
<view class="charts mt-15">
<qiun-data-charts type="arcbar" :chartData="chartData" :Height="140" :Width="140" />
<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>
@ -24,8 +24,12 @@
</view>
<!-- 列表 -->
<view class="item3" v-for="(it,ik) in ite.list" :key="ik" v-if="!isresult">
<view class="name overflow">{{it.name}}<uni-icons type="info" color="#f0ad4e" size="20"
@click="handleTips(it.describe)" v-if="it.describe"></uni-icons></view>
<view class="name overflow" @click="handleTips(it.describe)">
{{it.name}}
<uni-icons type="info" color="#f0ad4e" size="20" v-if="it.describe"></uni-icons>
</view>
<view class="weight">
<view class="input">
<!-- 整数类型 -->
@ -75,18 +79,20 @@
<!-- 弹框 -->
<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}}
@ -97,6 +103,12 @@
<view class="btn" @click="handleTarget">确定</view>
</view>
</view>
<!-- -->
<!-- #ifndef APP-PLUS -->
<view class="uni-stat-tooltip" v-if="isTips">
{{tips}}
</view>
<!-- #endif -->
</view>
</template>
@ -110,6 +122,8 @@
export default {
data() {
return {
tips: "",
isTips: false,
chartData: {
series: [{
name: "正确率",
@ -135,7 +149,6 @@
isresult: false,
choice: 0,
isRefresh: false,
info: []
}
},
computed: {
@ -155,6 +168,8 @@
onLoad() {
let that = this
that.score = 0
that.tips = ""
that.isTips = false
that.selectllist = []
that.sportsList = []
that.timeList = that.$tools.gethms()
@ -166,6 +181,8 @@
},
onPullDownRefresh() {
let that = this
that.tips = ""
that.isTips = false
that.score = 0
that.choice = 0
that.Max_score = 0
@ -187,6 +204,8 @@
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
@ -198,15 +217,14 @@
}
},
watch: {
// userAddress() {
// let that = this
// that.score = 0
// that.selectllist = []
// that.sportsList = []
// that.address = that.user.address
// that.getList()
// console.log("user", that.sportsList, that.selectllist)
// },
isTips() {
let that = this
if (that.isTips) {
setTimeout(() => {
that.isTips = false
}, 4000);
}
}
},
methods: {
getAciveCity(item) {
@ -229,7 +247,6 @@
that.$model.getSportsListAll({
gender: uni.getStorageSync('gender'),
parameter_data: that.address,
// parameter_data: ","
}).then((res) => {
console.log("全部项目", res)
if (res.code != 0) {
@ -240,6 +257,8 @@
that.Max_score = 0
that.selectllist = res.data
that.chartData.series[0].data = 0.8
that.tips = ""
that.isTips = false
that.handleSportsList()
})
},
@ -250,7 +269,6 @@
aud_id: uni.getStorageSync('userid'),
gender: uni.getStorageSync('gender'),
address: that.address
// address: ","
}).then((res) => {
console.log("单地区", res)
if (res.code != 0) return
@ -276,7 +294,6 @@
aud_id: uni.getStorageSync('userid'),
gender: uni.getStorageSync('gender'),
parameter_data: that.address,
// parameter_data: ",",
result_data: that.selectllist,
}).then((res) => {
console.log("开始估分", res)
@ -347,36 +364,54 @@
//
handleTarget() {
let that = this
if (that.choice == 1) {
that.region_list.list.push(that.isActive)
} else {
that.region_list.list = that.isActiveList
}
that.selectllist.forEach(item => {
item.list.forEach(it => {
if (it.key == that.region_list.key) {
it.list = that.region_list.list
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
},
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
},
//
onTap() {
this.isActive = {}
this.isDrawe = false
},
handleTap() {
// this.isActive = {}
// this.isDrawe = false
console.log('quxiao', this.info)
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({
@ -395,4 +430,20 @@
padding-bottom: 15px;
background-color: #f7f7f7;
}
.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>

View File

@ -25,7 +25,7 @@
<text class="item-set item-set0">自由</text>
<text class="tips">无限制</text>
</view>
<view :class="[isConnection?'start':'start Nstart']" @click="handleStart(1)">开始</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>
@ -231,7 +231,8 @@
if (that.devicesList.length) {
clearTimeout(myTime);
that.$Bluetooth.stopBluetoothDevicesDiscovery()
that.handleDevType(that.devicesList[0])
that.deviceId = that.devicesList[0].deviceId
that.createBLEConnection()
}
console.log("devicesList", that.devicesList)
},
@ -256,32 +257,32 @@
handleisSdevice() {
let that = this
if (that.isConnected) return
if (Number(that.isDevice) != 0) {
that.$Bluetooth.stopBluetoothDevicesDiscovery()
uni.openBluetoothAdapter({
success: e => {
that.islink = 0
that.handleMyTime()
that.$store.commit("changedevicesList", []);
that.$store.commit("changeBluetooth", true)
that.$Bluetooth.startBluetoothDeviceDiscovery()
console.log('初始化蓝牙成功:' + e.errMsg);
},
fail: e => {
that.islink = -1
that.$Bluetooth.getBluetoothAdapter(e)
}
});
} else {
that.islink = -1
that.$tools.msg("请先添加设备!")
that.$Bluetooth.stopBluetoothDevicesDiscovery()
// setTimeout(function() {
// uni.switchTab({
// url: "/pages/business/business"
// })
// }, 500)
}
// if (Number(that.isDevice) != 0) {
that.$Bluetooth.stopBluetoothDevicesDiscovery()
uni.openBluetoothAdapter({
success: e => {
that.islink = 0
that.handleMyTime()
that.$store.commit("changedevicesList", []);
that.$store.commit("changeBluetooth", true)
that.$Bluetooth.startBluetoothDeviceDiscovery()
console.log('初始化蓝牙成功:' + e.errMsg);
},
fail: e => {
that.islink = -1
that.$Bluetooth.getBluetoothAdapter(e)
}
});
// } else {
// that.islink = -1
// that.$tools.msg("")
// that.$Bluetooth.stopBluetoothDevicesDiscovery()
// setTimeout(function() {
// uni.switchTab({
// url: "/pageTwo/business/business"
// })
// }, 500)
// }
},
//
handleDevType(device) {
@ -556,7 +557,7 @@
}
clearTimeout(myTime)
that.$Bluetooth.stopBluetoothDevicesDiscovery()
}, 12000);
}, 20000);
},
navTo(url) {
let that = this

251
pages/zixun/list.vue Normal file
View File

@ -0,0 +1,251 @@
<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="detail(image)">
<image :src="image.cover_image" />
</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"></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(item){
uni.navigateTo({
url: "/pageTwo/webview/webview?id=" + item.id
})
},
handleActive(item, ind) {
let that = this
that.list[ind].reading++
uni.navigateTo({
url: "/pageTwo/webview/webview?id=" + item.id
})
}
}
}
</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>

View File

@ -141,7 +141,8 @@
padding: 10px 10px 0;
background-color: #fff;
border-radius: 10px;
margin-bottom: 10px;
display: block;
margin: 15px 10px;
.time {
color: #999;
@ -179,7 +180,7 @@
display: flex;
padding: 0 10px;
justify-content: space-between;
margin-bottom: 10px;
margin: 10px;
background-color: #fff;
}
@ -211,10 +212,10 @@
}
.myinfoPage {
width: 100%;
width:100% ;
background: #fff;
margin-top: 10px;
padding-bottom: 15px;
margin: 10px 0;
padding-bottom: 0px;
border-radius: 10px;
.box1 {
@ -303,6 +304,7 @@
position: absolute;
right: 0;
top: -1px;
z-index: 999;
.xx {
width: 5px;

BIN
static/100.mp3 Normal file

Binary file not shown.

BIN
static/1000.mp3 Normal file

Binary file not shown.

BIN
static/150.mp3 Normal file

Binary file not shown.

BIN
static/200.mp3 Normal file

Binary file not shown.

BIN
static/250.mp3 Normal file

Binary file not shown.

BIN
static/300.mp3 Normal file

Binary file not shown.

BIN
static/350.mp3 Normal file

Binary file not shown.

BIN
static/400.mp3 Normal file

Binary file not shown.

BIN
static/450.mp3 Normal file

Binary file not shown.

BIN
static/50.mp3 Normal file

Binary file not shown.

BIN
static/500.mp3 Normal file

Binary file not shown.

BIN
static/550.mp3 Normal file

Binary file not shown.

BIN
static/600.mp3 Normal file

Binary file not shown.

BIN
static/650.mp3 Normal file

Binary file not shown.

BIN
static/700.mp3 Normal file

Binary file not shown.

BIN
static/750.mp3 Normal file

Binary file not shown.

BIN
static/800.mp3 Normal file

Binary file not shown.

BIN
static/850.mp3 Normal file

Binary file not shown.

BIN
static/900.mp3 Normal file

Binary file not shown.

BIN
static/950.mp3 Normal file

Binary file not shown.

BIN
static/PCL.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
static/Start.mp3 Normal file

Binary file not shown.

BIN
static/number.mp3 Normal file

Binary file not shown.

BIN
static/q1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
static/q10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
static/q2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
static/q3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

BIN
static/q4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
static/q5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
static/q6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
static/q7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
static/q8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
static/q9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
static/time.mp3 Normal file

Binary file not shown.

View File

@ -13,6 +13,7 @@ export default new Vuex.Store({
gender: 0,
sex: 0,
age: 0,
height: "",
weight: "",
address: "",
card_order: [],
@ -48,6 +49,7 @@ export default new Vuex.Store({
isRecord: false, //手动记录
isSlider: false, //分数占比
isConnected: false,
isPublicRecord: false,
isBluetoothTyle: false,
LungLevel: [], //肺活量标准
devicesList: [], //筛选设备列表
@ -137,8 +139,22 @@ export default new Vuex.Store({
if (newData.length == 0) {
uni.setStorageSync('userid', "")
uni.setStorageSync('gender', 0)
state.user.target_current = {}
state.user.card_data_list = []
state.user = {
id: "",
head_pic: null,
nickname: "",
birthday: "",
gender: 0,
sex: 0,
age: 0,
weight: "",
address: "",
measure_model: 0,
card_order: [],
card_data_list: [],
target_current: {},
vitalcapacity_data: []
}
}
state.familayList = newData
},
@ -175,6 +191,10 @@ export default new Vuex.Store({
changeIdentityList(state, newData) {
state.identityList = newData
},
changePublicAdd(state, newData) {
state.isPublicRecord = newData
},
},
// 模块化vuex
modules: {},

View File

@ -61,6 +61,7 @@ function onBluetoothDeviceFound() {
let buff = device.name.slice(7, 19)
device.macAddr = $Bluetooth.str2Num(buff)
device.deviceId = device.deviceId
$Bluetooth.stopBluetoothDevicesDiscovery()
$Bluetooth.handleDevice(device)
console.log("ypc", device)
return
@ -135,28 +136,28 @@ function str2Num(str) {
// 蓝牙连接
function handleDevicesMac(device, acd_id) {
console.log("卡片设备", device, acd_id)
if (device == 'true' || device || device == true) {
uni.openBluetoothAdapter({
success: e => {
$store.commit("changeBluetooth", true);
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.switchTab({
url: "/pages/business/business"
// if (device == 'true' || device || device == true) {
uni.openBluetoothAdapter({
success: e => {
$store.commit("changeBluetooth", true);
uni.navigateTo({
url: "/pageTwo/devices/search?id=" + acd_id + '&device=' + device
})
}, 500)
}
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) {

View File

@ -1,10 +1,8 @@
import tools from '@/toolJs/tools.js'
import store from '../store'
// let baseUrl = "http://tc.pcxbc.com"
// let baseUrl = "https://tc.pcxbc.com"
let baseUrl = "https://tc.pcxbc.com/testedition"
const httpRequest = (url, method = "get", data) => {
data.token = uni.getStorageSync('token')
data.aan_id = uni.getStorageSync('aan_id')
let httpDefaultOpts = {
url: baseUrl + url,
data: data,
@ -18,11 +16,12 @@ const httpRequest = (url, method = "get", data) => {
uni.request(httpDefaultOpts).then(
(res) => {
uni.hideLoading()
console.log("request", url, res, data)
console.log("request", url, res,)
if (res[1].data.code == 20001) {
uni.clearStorageSync()
uni.setStorageSync('token', null)
uni.setStorageSync('aan_id', null)
console.log("https.js跳转登录页面")
setTimeout(function() {
uni.reLaunch({
url: "/pageTwo/login/login"
@ -47,10 +46,14 @@ const httpRequest = (url, method = "get", data) => {
};
const get = (url, data) => {
data.token = uni.getStorageSync('token')
data.aan_id = uni.getStorageSync('aan_id')
return httpRequest(url, 'get', data)
}
const post = (url, data) => {
data.token = uni.getStorageSync('token')
data.aan_id = uni.getStorageSync('aan_id')
return httpRequest(url, 'post', data)
}
export default {

View File

@ -323,4 +323,37 @@ export default {
return res
})
},
// 身高预测
GetPredictheight(param) { //公共历史删除
return http.post("/card_height_prediction", param).then(res => {
return res
})
},
// BMI预测
calcbmi(param) { //公共历史删除
return http.post("/card_bmi_evaluation", param).then(res => {
return res
})
},
// 资讯
getContentMsg(param) { //获取资讯信息
return http.post("/get_sector_content_msg", param).then(res => {
return res
})
},
getContentLabel(param) { //资讯标签类别信息
return http.post("/get_sector_label_msg", param).then(res => {
return res
})
},
getContentLike(param) { //点赞
return http.post("/user_like_it", param).then(res => {
return res
})
},
getContentDetail(param) { //资讯详情
return http.get("/model_content", param).then(res => {
return res
})
},
}

View File

@ -14,7 +14,8 @@ export default {
PrefixZero,
showModal,
compareVersions,
validatePhoneEmail
validatePhoneEmail,
checkPrivacyAgreement
}
function showModal(text) {
@ -218,4 +219,10 @@ function GetDateStr(AddDayCount) {
var m = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1); //获取当前月份的日期不足10补0
var d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate(); //获取当前几号不足10补0
return y + "-" + m + "-" + d;
}
//用于检查用户是否同意隐私协议
function checkPrivacyAgreement() {
// 这里应该是获取用户同意状态的逻辑,例如从本地存储或服务端获取
const isAgreed = uni.getStorageSync('isPrivacyAgreed');
return !!isAgreed;
}

View File

@ -17,7 +17,7 @@ universalLinks_weibo=
spaceid_weibo=
[appstore]
appstore=464187c2f88ea218696051f42374e439
appstore=
[iphone]
app%402x=df2dff03c468b60aa18ea193377d9650

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__20604F1","name":"Reedaw","version":{"name":"1.2.2","code":122},"description":"面向儿童青少年的健康体质测量APP","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"Bluetooth":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"light","background":"#37cc92"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"template":"index.html","compattible":{"ignoreVersion":true},"distribute":{"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"splashscreen":{"androidStyle":"common","android":{"hdpi":"static/logo.png","xhdpi":"static/logo.png","xxhdpi":"static/logo.png"},"useOriginalMsgbox":true},"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"],"abiFilters":["arm64-v8a","x86"]},"apple":{"dSYMs":false,"idfa":false,"privacyDescription":{"NSBluetoothAlwaysUsageDescription":"需要蓝牙权限来连接设备","NSBluetoothPeripheralUsageDescription":"使用蓝牙与外设通信"}},"plugins":{"share":{},"ad":{},"geolocation":{"system":{"__platform__":["ios"]}},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"uniStatistics":{"enable":false,"version":"2"},"allowsInlineMediaPlayback":true,"safearea":{"background":"#fff","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"4.24","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#333","fontSize":"13px","selectedColor":"#37cc92","backgroundColor":"#fff","list":[{"pagePath":"pages/home/home","iconPath":"static/shou.png","selectedIconPath":"static/shou2.png","text":"首页"},{"pagePath":"pages/score/score","iconPath":"static/ping.png","selectedIconPath":"static/ping2.png","text":"估分"},{"pagePath":"pages/business/business","iconPath":"static/bei.png","selectedIconPath":"static/bei2.png","text":"设备"},{"pagePath":"pages/my/me","iconPath":"static/wo.png","selectedIconPath":"static/wo2.png","text":"我的"}],"borderStyle":"rgba(0,0,0,0.4)","height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"},"locale":"zh-Hans"}
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__20604F1","name":"Reedaw","version":{"name":"1.2.6","code":126},"description":"面向儿童青少年的健康体质测量APP","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"Bluetooth":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"light","background":"#37cc92"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"template":"index.html","compattible":{"ignoreVersion":true},"distribute":{"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"splashscreen":{"androidStyle":"common","android":{"hdpi":"static/logo.png","xhdpi":"static/logo.png","xxhdpi":"static/logo.png"},"useOriginalMsgbox":true},"google":{"permissions":["<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"],"abiFilters":["arm64-v8a","x86"]},"apple":{"dSYMs":false,"idfa":false,"privacyDescription":{"NSBluetoothAlwaysUsageDescription":"需要蓝牙权限来连接设备","NSBluetoothPeripheralUsageDescription":"使用蓝牙与外设通信"}},"plugins":{"share":{},"ad":{},"geolocation":{"system":{"__platform__":["ios"]}},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"uniStatistics":{"enable":false,"version":"2"},"allowsInlineMediaPlayback":true,"safearea":{"background":"#fff","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"4.24","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#333","fontSize":"13px","selectedColor":"#37cc92","backgroundColor":"#fff","list":[{"pagePath":"pages/home/home","iconPath":"static/shou.png","selectedIconPath":"static/shou2.png","text":"首页"},{"pagePath":"pages/score/score","iconPath":"static/ping.png","selectedIconPath":"static/ping2.png","text":"估分"},{"pagePath":"pages/business/business","iconPath":"static/bei.png","selectedIconPath":"static/bei2.png","text":"设备"},{"pagePath":"pages/my/me","iconPath":"static/wo.png","selectedIconPath":"static/wo2.png","text":"我的"}],"borderStyle":"rgba(0,0,0,0.4)","height":"50px","child":["lauchwebview"],"selected":0},"launch_path":"__uniappview.html"},"locale":"zh-Hans"}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

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