新增BMI/身高数据说明
This commit is contained in:
parent
84327e2f69
commit
5fd85143e7
45
App.vue
45
App.vue
|
|
@ -20,6 +20,7 @@
|
||||||
if (platform === 'ios') { // ios首次安装没有网络
|
if (platform === 'ios') { // ios首次安装没有网络
|
||||||
uni.onNetworkStatusChange(function(res) {
|
uni.onNetworkStatusChange(function(res) {
|
||||||
if (res.isConnected == true) {
|
if (res.isConnected == true) {
|
||||||
|
that.handleConfig()
|
||||||
that.handleCityList()
|
that.handleCityList()
|
||||||
that.handleCooperationUrl()
|
that.handleCooperationUrl()
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
|
|
@ -33,6 +34,7 @@
|
||||||
// #endif
|
// #endif
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
// 版本更新
|
// 版本更新
|
||||||
|
that.handleConfig()
|
||||||
that.handleCityList()
|
that.handleCityList()
|
||||||
that.handleCooperationUrl()
|
that.handleCooperationUrl()
|
||||||
that.updataWeiXin()
|
that.updataWeiXin()
|
||||||
|
|
@ -61,6 +63,7 @@
|
||||||
})
|
})
|
||||||
console.log("当前应用版本号", info)
|
console.log("当前应用版本号", info)
|
||||||
that.handleCityList()
|
that.handleCityList()
|
||||||
|
that.handleConfig()
|
||||||
that.handleCooperationUrl()
|
that.handleCooperationUrl()
|
||||||
that.handleoginversion(info)
|
that.handleoginversion(info)
|
||||||
})
|
})
|
||||||
|
|
@ -91,39 +94,6 @@
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pageTwo/my/about"
|
url: "/pageTwo/my/about"
|
||||||
})
|
})
|
||||||
// let showLoading = plus.nativeUI.showWaiting('正在下载')
|
|
||||||
// const dtask = uni.downloadFile({
|
|
||||||
// url: res.data.url,
|
|
||||||
// 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...');
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// fail: () => {
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '更新失败',
|
|
||||||
// icon: 'none'
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// dtask.onProgressUpdate((res) => {
|
|
||||||
// showLoading.setTitle(" 正在下载" + res.progress +
|
|
||||||
// "% ");
|
|
||||||
// });
|
|
||||||
} else { //ios跳转
|
} else { //ios跳转
|
||||||
plus.runtime.launchApplication({
|
plus.runtime.launchApplication({
|
||||||
action: `itms-apps://itunes.apple.com/cn/app/id6654906497?mt=8`
|
action: `itms-apps://itunes.apple.com/cn/app/id6654906497?mt=8`
|
||||||
|
|
@ -164,6 +134,15 @@
|
||||||
that.$store.commit('changeIdentityList', res.data.identity_list)
|
that.$store.commit('changeIdentityList', res.data.identity_list)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 通用枚举
|
||||||
|
handleConfig() {
|
||||||
|
let that = this
|
||||||
|
that.$model.getConfig({}).then((res) => {
|
||||||
|
// console.log("|全部枚举", res.data)
|
||||||
|
if (res.code != 0) return
|
||||||
|
that.$store.commit('changeConfig', res.data)
|
||||||
|
})
|
||||||
|
},
|
||||||
// 合作服务
|
// 合作服务
|
||||||
handleCooperationUrl() {
|
handleCooperationUrl() {
|
||||||
let that = this
|
let that = this
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,489 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="content weightPages">
|
||||||
|
<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">{{textW}}</view>
|
||||||
|
<view class="text">{{textH}}</view>
|
||||||
|
<view class="text" v-if="textImp != ''">{{textImp}}</view>
|
||||||
|
<view class="image" style="margin-top: 200rpx;">
|
||||||
|
<image src="/pageTwo/static/F018P01.gif" mode="widthFix"></image>
|
||||||
|
</view>
|
||||||
|
<view class="tips">
|
||||||
|
<text>请确保:</text>
|
||||||
|
<text>1.请确定设备是开机状态</text>
|
||||||
|
<text>2.请确定手机蓝牙、位置信息已打开</text>
|
||||||
|
<text>3.ios系统需打开设置—>应用—>微信里的蓝牙权限</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
mapState
|
||||||
|
} from "vuex";
|
||||||
|
var myTime;
|
||||||
|
const plugin = requirePlugin("sdkPlugin").AiLink;
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
textW: "",
|
||||||
|
textH: "",
|
||||||
|
textImp: "",
|
||||||
|
height: "",
|
||||||
|
weight: "",
|
||||||
|
imp: 0,
|
||||||
|
macAddr: "",
|
||||||
|
deviceId: "",
|
||||||
|
serviceId: "",
|
||||||
|
readId: "",
|
||||||
|
writeId: "",
|
||||||
|
notifyId: "",
|
||||||
|
isSend: true,
|
||||||
|
Unload: false,
|
||||||
|
isConnection: 0,
|
||||||
|
data01: {},
|
||||||
|
data02: {},
|
||||||
|
BLEResult: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user", "isConnected", "isBluetoothTyle"]),
|
||||||
|
userInfo() {
|
||||||
|
return this.user
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onUnload: async function() {
|
||||||
|
let that = this
|
||||||
|
if (!that.Unload) {
|
||||||
|
clearTimeout(myTime)
|
||||||
|
that.$store.state.devicesList2 = []
|
||||||
|
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
|
||||||
|
if(that.isConnection != 1) {
|
||||||
|
let pages = getCurrentPages();
|
||||||
|
pages[pages.length - 2].$vm.islink = -1;
|
||||||
|
pages[pages.length - 2].$vm.textLink = '开始连接';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
isConnected: function() {
|
||||||
|
let that = this
|
||||||
|
if (!that.isConnected) {
|
||||||
|
console.log('F01PRO:isConnected-' + that.isConnected)
|
||||||
|
that.handleBack()
|
||||||
|
that.isConnection = 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isBluetoothTyle: function() {
|
||||||
|
let that = this
|
||||||
|
if (!that.isBluetoothTyle) {
|
||||||
|
console.log('F01PRO:isBluetoothTyle-' + that.isBluetoothTyle)
|
||||||
|
that.handleBack()
|
||||||
|
that.isConnection = 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
let that = this
|
||||||
|
that.textW = ""
|
||||||
|
that.textH = ""
|
||||||
|
console.log("options", options)
|
||||||
|
if (options && options.deviceId) {
|
||||||
|
that.deviceId = options.deviceId
|
||||||
|
that.createBLEConnection()
|
||||||
|
}
|
||||||
|
|
||||||
|
that.onBLEConnectionStateChange()
|
||||||
|
uni.onBluetoothAdapterStateChange(function(res) {
|
||||||
|
that.$store.commit("changeBluetooth", res.available);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 重新连接
|
||||||
|
openBluetoothAdapter() {
|
||||||
|
let that = this
|
||||||
|
that.textW = ""
|
||||||
|
that.textH = ""
|
||||||
|
that.isSend = true
|
||||||
|
that.Unload = false
|
||||||
|
uni.openBluetoothAdapter({
|
||||||
|
success: e => {
|
||||||
|
that.isConnection = 0
|
||||||
|
that.startBluetoothDeviceDiscovery()
|
||||||
|
console.log('初始化蓝牙成功:' + e.errMsg);
|
||||||
|
},
|
||||||
|
fail: e => {
|
||||||
|
that.isConnection = 2
|
||||||
|
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 监听蓝牙连接状态
|
||||||
|
onBLEConnectionStateChange() {
|
||||||
|
let that = this
|
||||||
|
uni.onBLEConnectionStateChange(function(res) {
|
||||||
|
console.log('F01PRO:onBLEConnectionStateChange-' + res.connected)
|
||||||
|
if (!res.connected) {
|
||||||
|
that.Unload = true
|
||||||
|
that.isConnection = 2
|
||||||
|
clearTimeout(myTime);
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
}
|
||||||
|
that.$store.commit("changeConnected", res.connected);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 开始搜寻附近的蓝牙外围设备
|
||||||
|
startBluetoothDeviceDiscovery() {
|
||||||
|
let that = this
|
||||||
|
uni.startBluetoothDevicesDiscovery({
|
||||||
|
allowDuplicatesKey: false,
|
||||||
|
interval: 500, //上报设备的间隔
|
||||||
|
success: res => {
|
||||||
|
that.isConnection = 0
|
||||||
|
that.onBluetoothDeviceFound();
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
that.isConnection = 2
|
||||||
|
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 发现外围设备
|
||||||
|
*/
|
||||||
|
onBluetoothDeviceFound() {
|
||||||
|
var that = this;
|
||||||
|
that.isConnection = 0
|
||||||
|
uni.onBluetoothDeviceFound(res => {
|
||||||
|
res.devices.forEach(device => {
|
||||||
|
if (!device.name && !device.localName) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (device.name.indexOf('AiLink_') != -1 || device.name.indexOf('PCF01') != -1 || (device
|
||||||
|
.localName && (device.localName
|
||||||
|
.indexOf('AiLink_') != -1 || device.localName
|
||||||
|
.indexOf('PCF01') != -1))) {
|
||||||
|
clearTimeout(myTime);
|
||||||
|
if (device.deviceId.indexOf(that.deviceId) != -1) {
|
||||||
|
that.stopBluetoothDevicesDiscovery()
|
||||||
|
that.deviceId = device.deviceId
|
||||||
|
const foundDevices = that.$store.state.devicesList2
|
||||||
|
const idx = that.$tools.inArray(foundDevices, "deviceId", device.deviceId)
|
||||||
|
if (idx === -1) {
|
||||||
|
that.$store.state.devicesList2.push(device);
|
||||||
|
} else {
|
||||||
|
that.$store.state.devicesList2[idx] = device
|
||||||
|
}
|
||||||
|
that.createBLEConnection()
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 停止搜索蓝牙设备
|
||||||
|
*/
|
||||||
|
stopBluetoothDevicesDiscovery() {
|
||||||
|
uni.stopBluetoothDevicesDiscovery({
|
||||||
|
success: e => {
|
||||||
|
console.log("停止搜索蓝牙设备", e)
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 连接蓝牙
|
||||||
|
createBLEConnection() {
|
||||||
|
let that = this;
|
||||||
|
uni.createBLEConnection({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
success: res => {
|
||||||
|
console.log("设备连接成功,获取设备的services", res);
|
||||||
|
that.isConnection = 0
|
||||||
|
that.getBLEDeviceServices();
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
that.isConnection = 2
|
||||||
|
console.log("设备连接失败,请重新连接", res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取设备的UUID
|
||||||
|
*/
|
||||||
|
getBLEDeviceServices() {
|
||||||
|
let serviceList = [];
|
||||||
|
let that = this;
|
||||||
|
uni.getBLEDeviceServices({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
success: res => {
|
||||||
|
console.log("获取设备的UUID成功", res)
|
||||||
|
serviceList = res.services;
|
||||||
|
for (let i = 0; i < serviceList.length; i++) {
|
||||||
|
let service = serviceList[i];
|
||||||
|
if (service.uuid.indexOf('FFE0') != -1) {
|
||||||
|
that.serviceId = service.uuid;
|
||||||
|
that.isConnection = 1
|
||||||
|
that.getBLEDeviceCharacteristics(that.deviceId, service.uuid);
|
||||||
|
console.log("设备的FFE0的serviceId: ", that.serviceId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
console.log('获取设备的UUID失败:', res)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取指定服务的特征值
|
||||||
|
*/
|
||||||
|
getBLEDeviceCharacteristics(deviceId, serviceId) {
|
||||||
|
let characteristicsList = [];
|
||||||
|
let that = this;
|
||||||
|
uni.getBLEDeviceCharacteristics({
|
||||||
|
deviceId: deviceId,
|
||||||
|
serviceId: serviceId,
|
||||||
|
success: res => {
|
||||||
|
console.log("服务的特征值成功", res)
|
||||||
|
characteristicsList = res.characteristics;
|
||||||
|
for (let i = 0; i < characteristicsList.length; i++) {
|
||||||
|
let item = characteristicsList[i];
|
||||||
|
if (item.uuid.indexOf('0000FFE1') != -1) {
|
||||||
|
that.uuid1 = item.uuid //下发数据
|
||||||
|
} else if (item.uuid.indexOf('0000FFE2') != -1) {
|
||||||
|
that.uuid2 = item.uuid //监听数据
|
||||||
|
} else if (item.uuid.indexOf('0000FFE3') != -1) {
|
||||||
|
that.uuid3 = item.uuid //写入设置
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 打开监听
|
||||||
|
uni.notifyBLECharacteristicValueChange({
|
||||||
|
deviceId,
|
||||||
|
serviceId,
|
||||||
|
characteristicId: that.uuid2,
|
||||||
|
state: true,
|
||||||
|
})
|
||||||
|
uni.notifyBLECharacteristicValueChange({
|
||||||
|
deviceId,
|
||||||
|
serviceId,
|
||||||
|
characteristicId: that.uuid3,
|
||||||
|
state: true,
|
||||||
|
})
|
||||||
|
// 初始化插件
|
||||||
|
console.log("初始化插件", that.$store.state.devicesList2)
|
||||||
|
that.$store.state.devicesList2[0].serviceId = that.serviceId
|
||||||
|
|
||||||
|
plugin.initPlugin(res.characteristics, that.$store.state.devicesList2[0])
|
||||||
|
uni.onBLECharacteristicValueChange((characteristic) => {
|
||||||
|
let bleData = plugin.parseBleData(characteristic.value)
|
||||||
|
let dw1 = "kg"
|
||||||
|
console.log("bleData", bleData)
|
||||||
|
if (bleData.status == 0) {
|
||||||
|
let sex0 = that.userInfo.gender == 1 ? 1 : 0
|
||||||
|
let sex = "0x0" + sex0.toString(16)
|
||||||
|
let age = "0x" + that.userInfo.age.toString(16)
|
||||||
|
let height = "0x" + that.userInfo.height.toString(16)
|
||||||
|
let arr = [0x01, parseInt(sex), parseInt(age), parseInt(height), 0x00]
|
||||||
|
plugin.sendDataOfA7(arr)
|
||||||
|
console.log("握手成功", arr)
|
||||||
|
} else if (bleData.status == 1) {
|
||||||
|
let payload = that.$tools.ab2hex(bleData.data, '')
|
||||||
|
let typeInfo = payload.substring(4, 6)
|
||||||
|
let type = payload.substring(0, 2)
|
||||||
|
console.log("开始测量", payload)
|
||||||
|
if (type == '03') {
|
||||||
|
console.log('MCU主动请求用户数据')
|
||||||
|
let sex0 = that.userInfo.gender == 1 ? 1 : 0
|
||||||
|
let sex = "0x0" + sex0.toString(16)
|
||||||
|
let age = "0x" + that.userInfo.age.toString(16)
|
||||||
|
let height = "0x" + that.userInfo.height.toString(16)
|
||||||
|
let arr = [0x01, parseInt(sex), parseInt(age), parseInt(height), 0x00]
|
||||||
|
plugin.sendDataOfA7(arr)
|
||||||
|
}
|
||||||
|
if (type == "10" || type == "30" || type == "40") { //体脂模式
|
||||||
|
let data = parseInt(payload.substring(6, 12), 16)
|
||||||
|
let msg = parseInt(payload.substring(12, 14), 16).toString(2)
|
||||||
|
let dw = that.$tools.PrefixZero(msg, 8).substring(4, 8)
|
||||||
|
let num = that.$tools.PrefixZero(msg, 8).substring(0, 4)
|
||||||
|
let dw1 = "kg"
|
||||||
|
if (dw == "0001") {
|
||||||
|
dw1 = '斤'
|
||||||
|
}
|
||||||
|
if (dw == "0110") {
|
||||||
|
dw1 = 'lb'
|
||||||
|
}
|
||||||
|
if (num == "0001") {
|
||||||
|
data = data / 10
|
||||||
|
}
|
||||||
|
if (num == "0010") {
|
||||||
|
data = data / 100
|
||||||
|
}
|
||||||
|
if (num == "0011") {
|
||||||
|
data = data / 1000
|
||||||
|
}
|
||||||
|
if (typeInfo == "01") {
|
||||||
|
that.textW = "您的实时体重是:" + data + dw1
|
||||||
|
}
|
||||||
|
if (typeInfo == "02") {
|
||||||
|
that.textW = "您的体重是:" + data + dw1
|
||||||
|
that.weight = data + dw1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type == "14" || type == "41") { //身高模式
|
||||||
|
let height = parseInt(payload.substring(4, 8), 16)
|
||||||
|
let numH = parseInt(payload.substring(10, 12), 16)
|
||||||
|
if (numH == "1") {
|
||||||
|
height = height / 10
|
||||||
|
}
|
||||||
|
if (numH == "2") {
|
||||||
|
height = height / 100
|
||||||
|
}
|
||||||
|
that.textH = "您的身高是:" + height + "cm"
|
||||||
|
that.height = height
|
||||||
|
console.log("身高模式:", that.height)
|
||||||
|
}
|
||||||
|
if (type == "11") { //阻抗模式
|
||||||
|
if (typeInfo == "01") { //测量中
|
||||||
|
that.textImp = '正在测量体脂:请双手紧握扶手'
|
||||||
|
}
|
||||||
|
if (typeInfo == "02") {
|
||||||
|
that.imp = 0
|
||||||
|
that.textImp = ""
|
||||||
|
}
|
||||||
|
if (typeInfo == "04") {
|
||||||
|
that.textImp = ""
|
||||||
|
that.imp = parseInt(payload.substring(8, 12), 16)
|
||||||
|
}
|
||||||
|
console.log("阻抗:", that.imp)
|
||||||
|
}
|
||||||
|
if (type == '15') {
|
||||||
|
if (typeInfo == "01") {
|
||||||
|
that.data01 = {
|
||||||
|
bodyage: parseInt(payload.substring(26, 28),
|
||||||
|
16),
|
||||||
|
fat_r: parseInt(payload.substring(6, 10),
|
||||||
|
16) / 10,
|
||||||
|
muscle: parseInt(payload.substring(18, 22),
|
||||||
|
16) / 10,
|
||||||
|
kcal: parseInt(payload.substring(22, 26),
|
||||||
|
16),
|
||||||
|
visceral: parseInt(payload.substring(14,
|
||||||
|
18), 16),
|
||||||
|
sfr: parseInt(payload.substring(10, 14),
|
||||||
|
16) / 10,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (typeInfo == '02') {
|
||||||
|
that.data02 = {
|
||||||
|
water: parseInt(payload.substring(10, 14),
|
||||||
|
16) / 10,
|
||||||
|
bone: parseInt(payload.substring(6, 10),
|
||||||
|
16) / 10,
|
||||||
|
fatlevlval: parseInt(payload.substring(24,
|
||||||
|
26), 16) /
|
||||||
|
10,
|
||||||
|
protein: parseInt(payload.substring(14, 18),
|
||||||
|
16) / 10,
|
||||||
|
bmi: parseInt(payload.substring(18, 22),
|
||||||
|
16) / 10,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log("体脂数据", that.data01, that.data02)
|
||||||
|
that.BLEResult.info = Object.assign(that.data01, that.data02)
|
||||||
|
}
|
||||||
|
if (type == "80") { //测量结束
|
||||||
|
that.BLEResult.weight = that.weight
|
||||||
|
that.BLEResult.adc = that.imp ? that.imp : 0
|
||||||
|
that.BLEResult.height = (that.height ? that.height : that.userInfo.height) + 'cm'
|
||||||
|
that.BLEResult.aud_id = that.userInfo.id
|
||||||
|
console.log("体脂成功:", that.BLEResult)
|
||||||
|
that.handleGetMeasure(that.BLEResult)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
console.log('获取特征值失败:', JSON.stringify(res))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 保存测量结果
|
||||||
|
handleGetMeasure(data) {
|
||||||
|
console.log("保存结果")
|
||||||
|
let that = this
|
||||||
|
that.$model.getmeasurefunit(data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
that.$store.dispatch('getUserInfo', {
|
||||||
|
aud_id: uni.getStorageSync('userid')
|
||||||
|
})
|
||||||
|
that.$store.dispatch("getResult", {
|
||||||
|
aud_id: uni.getStorageSync('userid')
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '测量成功'
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.message,
|
||||||
|
icon: "error"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.Unload = true
|
||||||
|
setTimeout(function() {
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
that.$store.state.devicesList2 = []
|
||||||
|
|
||||||
|
uni.switchTab({
|
||||||
|
url: "/pages/home/home"
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 断开蓝牙模块
|
||||||
|
*/
|
||||||
|
closeBluetoothAdapter() {
|
||||||
|
let that = this;
|
||||||
|
uni.closeBluetoothAdapter({
|
||||||
|
success: res => {
|
||||||
|
console.log('F01PRO:蓝牙模块关闭成功');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleBack() {
|
||||||
|
let that = this
|
||||||
|
that.Unload = true
|
||||||
|
console.log('F01PRO:handleBack');
|
||||||
|
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
that.$store.state.devicesList2 = []
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 断开蓝牙连接
|
||||||
|
*/
|
||||||
|
closeBLEConnection() {
|
||||||
|
var that = this;
|
||||||
|
uni.closeBLEConnection({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
success: res => {
|
||||||
|
console.log('F01PRO:断开蓝牙连接成功');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
</style>
|
||||||
|
|
@ -1,489 +1,397 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view class="content weightPages">
|
||||||
<view class="content weightPages">
|
<view class="content ">
|
||||||
<view class="title" v-if="isConnection == 0">连接中,请稍后</view>
|
<view class="status">{{textLink}}</view>
|
||||||
<view class="title" v-if="isConnection == 1">连接成功,请开始测量</view>
|
<view class="text">{{textW}}</view>
|
||||||
<view class="title" v-if="isConnection == 2" @click="openBluetoothAdapter">连接失败,点击重新连接</view>
|
<view class="text">{{textH}}</view>
|
||||||
<view class="text">{{textW}}</view>
|
<view class="image">
|
||||||
<view class="text">{{textH}}</view>
|
<image src="/pageTwo/static/F018P01.gif" class="image3"></image>
|
||||||
<view class="text" v-if="textImp != ''">{{textImp}}</view>
|
</view>
|
||||||
<view class="image" style="margin-top: 200rpx;">
|
<view class="tips">
|
||||||
<image src="/pageTwo/static/F018P01.gif" mode="widthFix"></image>
|
<view>提示:</view>
|
||||||
</view>
|
<text>1.请确定设备已开机</text>
|
||||||
<view class="tips">
|
<text>2.请确定手机蓝牙及位置信息已打开</text>
|
||||||
<text>请确保:</text>
|
</view>
|
||||||
<text>1.请确定设备是开机状态</text>
|
</view>
|
||||||
<text>2.请确定手机蓝牙、位置信息已打开</text>
|
</view>
|
||||||
<text>3.ios系统需打开设置—>应用—>微信里的蓝牙权限</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
var myTime;
|
var myTime;
|
||||||
const plugin = requirePlugin("sdkPlugin").AiLink;
|
export default {
|
||||||
export default {
|
data() {
|
||||||
data() {
|
return {
|
||||||
return {
|
textW: "",
|
||||||
textW: "",
|
textH: "",
|
||||||
textH: "",
|
height: "",
|
||||||
textImp: "",
|
weight: "",
|
||||||
height: "",
|
imp: 0,
|
||||||
weight: "",
|
macAddr: "",
|
||||||
imp: 0,
|
deviceId: "",
|
||||||
macAddr: "",
|
serviceId: "",
|
||||||
deviceId: "",
|
uuid1: "",
|
||||||
serviceId: "",
|
uuid2: "",
|
||||||
readId: "",
|
uuid3: "",
|
||||||
writeId: "",
|
Unload: false,
|
||||||
notifyId: "",
|
isConnection: 0,
|
||||||
isSend: true,
|
data01: {},
|
||||||
Unload: false,
|
data02: {},
|
||||||
isConnection: 0,
|
BLEResult: {},
|
||||||
data01: {},
|
textLink: ""
|
||||||
data02: {},
|
}
|
||||||
BLEResult: {}
|
},
|
||||||
}
|
computed: {
|
||||||
},
|
...mapState(["user", "isConnected", "isBluetoothTyle"]),
|
||||||
computed: {
|
userInfo() {
|
||||||
...mapState(["user", "isConnected", "isBluetoothTyle"]),
|
return this.user
|
||||||
userInfo() {
|
}
|
||||||
return this.user
|
},
|
||||||
}
|
onUnload: async function() {
|
||||||
},
|
let that = this
|
||||||
onUnload: async function() {
|
if (!that.Unload) {
|
||||||
let that = this
|
clearTimeout(myTime)
|
||||||
if (!that.Unload) {
|
that.$store.state.devicesList2 = []
|
||||||
clearTimeout(myTime)
|
that.closeBLEConnection()
|
||||||
that.$store.state.devicesList2 = []
|
that.closeBluetoothAdapter()
|
||||||
|
}
|
||||||
that.closeBLEConnection()
|
},
|
||||||
that.closeBluetoothAdapter()
|
watch: {
|
||||||
|
isConnected: function() {
|
||||||
if(that.isConnection != 1) {
|
let that = this
|
||||||
let pages = getCurrentPages();
|
if (!that.isConnected) {
|
||||||
pages[pages.length - 2].$vm.islink = -1;
|
console.log('F01PRO:isConnected-' + that.isConnected)
|
||||||
pages[pages.length - 2].$vm.textLink = '开始连接';
|
let text = '测量过程中已与设备连接中断,请重新连接设备再开始测量'
|
||||||
}
|
that.$tools.showModal(text)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
isBluetoothTyle: function() {
|
||||||
isConnected: function() {
|
let that = this
|
||||||
let that = this
|
if (!that.isBluetoothTyle) {
|
||||||
if (!that.isConnected) {
|
console.log('F01PRO:isBluetoothTyle-' + that.isBluetoothTyle)
|
||||||
console.log('F01PRO:isConnected-' + that.isConnected)
|
let text = '蓝牙已关闭,请重新打开蓝牙后再开始测量'
|
||||||
that.handleBack()
|
that.$tools.showModal(text)
|
||||||
that.isConnection = 2
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
isBluetoothTyle: function() {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
if (!that.isBluetoothTyle) {
|
console.log("options", options)
|
||||||
console.log('F01PRO:isBluetoothTyle-' + that.isBluetoothTyle)
|
that.deviceId = options.deviceId
|
||||||
that.handleBack()
|
that.createBLEConnection()
|
||||||
that.isConnection = 2
|
that.onBLEConnectionStateChange()
|
||||||
}
|
uni.onBluetoothAdapterStateChange(function(res) {
|
||||||
},
|
that.$store.commit("changeBluetooth", res.available);
|
||||||
},
|
})
|
||||||
onLoad(options) {
|
},
|
||||||
let that = this
|
methods: {
|
||||||
that.textW = ""
|
// 连接蓝牙
|
||||||
that.textH = ""
|
createBLEConnection() {
|
||||||
console.log("options", options)
|
let that = this;
|
||||||
if (options && options.deviceId) {
|
uni.createBLEConnection({
|
||||||
that.deviceId = options.deviceId
|
deviceId: that.deviceId,
|
||||||
that.createBLEConnection()
|
success: res => {
|
||||||
}
|
that.textLink = "蓝牙连接中"
|
||||||
|
setTimeout(function() {
|
||||||
|
that.getBLEDeviceServices()
|
||||||
|
}, 1000)
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
that.textLink = "设备连接失败,返回首页重新连接"
|
||||||
|
console.log("设备连接失败,请重新连接", res, that.deviceId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 监听蓝牙连接状态
|
||||||
|
onBLEConnectionStateChange() {
|
||||||
|
let that = this
|
||||||
|
uni.onBLEConnectionStateChange(function(res) {
|
||||||
|
console.log("监听蓝牙连接状态", res.connected)
|
||||||
|
that.$store.commit("changeConnected", res.connected);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取设备的UUID
|
||||||
|
*/
|
||||||
|
getBLEDeviceServices() {
|
||||||
|
let serviceList = [];
|
||||||
|
let that = this;
|
||||||
|
uni.getBLEDeviceServices({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
success: res => {
|
||||||
|
console.log("获取设备的UUID成功", res)
|
||||||
|
serviceList = res.services;
|
||||||
|
for (let i = 0; i < serviceList.length; i++) {
|
||||||
|
let service = serviceList[i];
|
||||||
|
if (service.uuid.indexOf('FFE0') != -1) {
|
||||||
|
that.serviceId = service.uuid;
|
||||||
|
that.getBLEDeviceCharacteristics(that.deviceId, service.uuid);
|
||||||
|
console.log("设备的FFE0的serviceId: ", that.serviceId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
that.textLink = "设备连接失败,返回首页重新连接"
|
||||||
|
console.log('获取设备的UUID失败:', res)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取指定服务的特征值
|
||||||
|
*/
|
||||||
|
getBLEDeviceCharacteristics(deviceId, serviceId) {
|
||||||
|
let characteristicsList = [];
|
||||||
|
let that = this;
|
||||||
|
uni.getBLEDeviceCharacteristics({
|
||||||
|
deviceId: deviceId,
|
||||||
|
serviceId: serviceId,
|
||||||
|
success: res => {
|
||||||
|
console.log("服务的特征值成功", res)
|
||||||
|
characteristicsList = res.characteristics;
|
||||||
|
for (let i = 0; i < characteristicsList.length; i++) {
|
||||||
|
let item = characteristicsList[i];
|
||||||
|
if (item.uuid.indexOf('0000FFE1') != -1) {
|
||||||
|
that.uuid1 = item.uuid //下发数据
|
||||||
|
} else if (item.uuid.indexOf('0000FFE2') != -1) {
|
||||||
|
that.uuid2 = item.uuid //监听数据
|
||||||
|
} else if (item.uuid.indexOf('0000FFE3') != -1) {
|
||||||
|
that.uuid3 = item.uuid //写入设置
|
||||||
|
that.writeBLECharacteristicValue("a603420100466a")
|
||||||
|
|
||||||
that.onBLEConnectionStateChange()
|
}
|
||||||
uni.onBluetoothAdapterStateChange(function(res) {
|
}
|
||||||
that.$store.commit("changeBluetooth", res.available);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 重新连接
|
|
||||||
openBluetoothAdapter() {
|
|
||||||
let that = this
|
|
||||||
that.textW = ""
|
|
||||||
that.textH = ""
|
|
||||||
that.isSend = true
|
|
||||||
that.Unload = false
|
|
||||||
uni.openBluetoothAdapter({
|
|
||||||
success: e => {
|
|
||||||
that.isConnection = 0
|
|
||||||
that.startBluetoothDeviceDiscovery()
|
|
||||||
console.log('初始化蓝牙成功:' + e.errMsg);
|
|
||||||
},
|
|
||||||
fail: e => {
|
|
||||||
that.isConnection = 2
|
|
||||||
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 监听蓝牙连接状态
|
|
||||||
onBLEConnectionStateChange() {
|
|
||||||
let that = this
|
|
||||||
uni.onBLEConnectionStateChange(function(res) {
|
|
||||||
console.log('F01PRO:onBLEConnectionStateChange-' + res.connected)
|
|
||||||
if (!res.connected) {
|
|
||||||
that.Unload = true
|
|
||||||
that.isConnection = 2
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
}
|
|
||||||
that.$store.commit("changeConnected", res.connected);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 开始搜寻附近的蓝牙外围设备
|
|
||||||
startBluetoothDeviceDiscovery() {
|
|
||||||
let that = this
|
|
||||||
uni.startBluetoothDevicesDiscovery({
|
|
||||||
allowDuplicatesKey: false,
|
|
||||||
interval: 500, //上报设备的间隔
|
|
||||||
success: res => {
|
|
||||||
that.isConnection = 0
|
|
||||||
that.onBluetoothDeviceFound();
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
that.isConnection = 2
|
|
||||||
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 发现外围设备
|
|
||||||
*/
|
|
||||||
onBluetoothDeviceFound() {
|
|
||||||
var that = this;
|
|
||||||
that.isConnection = 0
|
|
||||||
uni.onBluetoothDeviceFound(res => {
|
|
||||||
res.devices.forEach(device => {
|
|
||||||
if (!device.name && !device.localName) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (device.name.indexOf('AiLink_') != -1 || device.name.indexOf('PCF01') != -1 || (device
|
|
||||||
.localName && (device.localName
|
|
||||||
.indexOf('AiLink_') != -1 || device.localName
|
|
||||||
.indexOf('PCF01') != -1))) {
|
|
||||||
clearTimeout(myTime);
|
|
||||||
if (device.deviceId.indexOf(that.deviceId) != -1) {
|
|
||||||
that.stopBluetoothDevicesDiscovery()
|
|
||||||
that.deviceId = device.deviceId
|
|
||||||
const foundDevices = that.$store.state.devicesList2
|
|
||||||
const idx = that.$tools.inArray(foundDevices, "deviceId", device.deviceId)
|
|
||||||
if (idx === -1) {
|
|
||||||
that.$store.state.devicesList2.push(device);
|
|
||||||
} else {
|
|
||||||
that.$store.state.devicesList2[idx] = device
|
|
||||||
}
|
|
||||||
that.createBLEConnection()
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 停止搜索蓝牙设备
|
|
||||||
*/
|
|
||||||
stopBluetoothDevicesDiscovery() {
|
|
||||||
uni.stopBluetoothDevicesDiscovery({
|
|
||||||
success: e => {
|
|
||||||
console.log("停止搜索蓝牙设备", e)
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 连接蓝牙
|
|
||||||
createBLEConnection() {
|
|
||||||
let that = this;
|
|
||||||
uni.createBLEConnection({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: res => {
|
|
||||||
console.log("设备连接成功,获取设备的services", res);
|
|
||||||
that.isConnection = 0
|
|
||||||
that.getBLEDeviceServices();
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
that.isConnection = 2
|
|
||||||
console.log("设备连接失败,请重新连接", res);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 获取设备的UUID
|
|
||||||
*/
|
|
||||||
getBLEDeviceServices() {
|
|
||||||
let serviceList = [];
|
|
||||||
let that = this;
|
|
||||||
uni.getBLEDeviceServices({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: res => {
|
|
||||||
console.log("获取设备的UUID成功", res)
|
|
||||||
serviceList = res.services;
|
|
||||||
for (let i = 0; i < serviceList.length; i++) {
|
|
||||||
let service = serviceList[i];
|
|
||||||
if (service.uuid.indexOf('FFE0') != -1) {
|
|
||||||
that.serviceId = service.uuid;
|
|
||||||
that.isConnection = 1
|
|
||||||
that.getBLEDeviceCharacteristics(that.deviceId, service.uuid);
|
|
||||||
console.log("设备的FFE0的serviceId: ", that.serviceId);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
console.log('获取设备的UUID失败:', res)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 获取指定服务的特征值
|
|
||||||
*/
|
|
||||||
getBLEDeviceCharacteristics(deviceId, serviceId) {
|
|
||||||
let characteristicsList = [];
|
|
||||||
let that = this;
|
|
||||||
uni.getBLEDeviceCharacteristics({
|
|
||||||
deviceId: deviceId,
|
|
||||||
serviceId: serviceId,
|
|
||||||
success: res => {
|
|
||||||
console.log("服务的特征值成功", res)
|
|
||||||
characteristicsList = res.characteristics;
|
|
||||||
for (let i = 0; i < characteristicsList.length; i++) {
|
|
||||||
let item = characteristicsList[i];
|
|
||||||
if (item.uuid.indexOf('0000FFE1') != -1) {
|
|
||||||
that.uuid1 = item.uuid //下发数据
|
|
||||||
} else if (item.uuid.indexOf('0000FFE2') != -1) {
|
|
||||||
that.uuid2 = item.uuid //监听数据
|
|
||||||
} else if (item.uuid.indexOf('0000FFE3') != -1) {
|
|
||||||
that.uuid3 = item.uuid //写入设置
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 打开监听
|
|
||||||
uni.notifyBLECharacteristicValueChange({
|
|
||||||
deviceId,
|
|
||||||
serviceId,
|
|
||||||
characteristicId: that.uuid2,
|
|
||||||
state: true,
|
|
||||||
})
|
|
||||||
uni.notifyBLECharacteristicValueChange({
|
|
||||||
deviceId,
|
|
||||||
serviceId,
|
|
||||||
characteristicId: that.uuid3,
|
|
||||||
state: true,
|
|
||||||
})
|
|
||||||
// 初始化插件
|
|
||||||
console.log("初始化插件", that.$store.state.devicesList2)
|
|
||||||
that.$store.state.devicesList2[0].serviceId = that.serviceId
|
|
||||||
|
|
||||||
plugin.initPlugin(res.characteristics, that.$store.state.devicesList2[0])
|
// 打开监听
|
||||||
uni.onBLECharacteristicValueChange((characteristic) => {
|
that.textLink = "蓝牙连接成功,请开始测量"
|
||||||
let bleData = plugin.parseBleData(characteristic.value)
|
uni.notifyBLECharacteristicValueChange({
|
||||||
let dw1 = "kg"
|
deviceId,
|
||||||
console.log("bleData", bleData)
|
serviceId,
|
||||||
if (bleData.status == 0) {
|
characteristicId: that.uuid2,
|
||||||
let sex0 = that.userInfo.gender == 1 ? 1 : 0
|
state: true,
|
||||||
let sex = "0x0" + sex0.toString(16)
|
})
|
||||||
let age = "0x" + that.userInfo.age.toString(16)
|
uni.notifyBLECharacteristicValueChange({
|
||||||
let height = "0x" + that.userInfo.height.toString(16)
|
deviceId,
|
||||||
let arr = [0x01, parseInt(sex), parseInt(age), parseInt(height), 0x00]
|
serviceId,
|
||||||
plugin.sendDataOfA7(arr)
|
characteristicId: that.uuid3,
|
||||||
console.log("握手成功", arr)
|
state: true,
|
||||||
} else if (bleData.status == 1) {
|
})
|
||||||
let payload = that.$tools.ab2hex(bleData.data, '')
|
|
||||||
let typeInfo = payload.substring(4, 6)
|
|
||||||
let type = payload.substring(0, 2)
|
|
||||||
console.log("开始测量", payload)
|
|
||||||
if (type == '03') {
|
|
||||||
console.log('MCU主动请求用户数据')
|
|
||||||
let sex0 = that.userInfo.gender == 1 ? 1 : 0
|
|
||||||
let sex = "0x0" + sex0.toString(16)
|
|
||||||
let age = "0x" + that.userInfo.age.toString(16)
|
|
||||||
let height = "0x" + that.userInfo.height.toString(16)
|
|
||||||
let arr = [0x01, parseInt(sex), parseInt(age), parseInt(height), 0x00]
|
|
||||||
plugin.sendDataOfA7(arr)
|
|
||||||
}
|
|
||||||
if (type == "10" || type == "30" || type == "40") { //体脂模式
|
|
||||||
let data = parseInt(payload.substring(6, 12), 16)
|
|
||||||
let msg = parseInt(payload.substring(12, 14), 16).toString(2)
|
|
||||||
let dw = that.$tools.PrefixZero(msg, 8).substring(4, 8)
|
|
||||||
let num = that.$tools.PrefixZero(msg, 8).substring(0, 4)
|
|
||||||
let dw1 = "kg"
|
|
||||||
if (dw == "0001") {
|
|
||||||
dw1 = '斤'
|
|
||||||
}
|
|
||||||
if (dw == "0110") {
|
|
||||||
dw1 = 'lb'
|
|
||||||
}
|
|
||||||
if (num == "0001") {
|
|
||||||
data = data / 10
|
|
||||||
}
|
|
||||||
if (num == "0010") {
|
|
||||||
data = data / 100
|
|
||||||
}
|
|
||||||
if (num == "0011") {
|
|
||||||
data = data / 1000
|
|
||||||
}
|
|
||||||
if (typeInfo == "01") {
|
|
||||||
that.textW = "您的实时体重是:" + data + dw1
|
|
||||||
}
|
|
||||||
if (typeInfo == "02") {
|
|
||||||
that.textW = "您的体重是:" + data + dw1
|
|
||||||
that.weight = data + dw1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (type == "14" || type == "41") { //身高模式
|
|
||||||
let height = parseInt(payload.substring(4, 8), 16)
|
|
||||||
let numH = parseInt(payload.substring(10, 12), 16)
|
|
||||||
if (numH == "1") {
|
|
||||||
height = height / 10
|
|
||||||
}
|
|
||||||
if (numH == "2") {
|
|
||||||
height = height / 100
|
|
||||||
}
|
|
||||||
that.textH = "您的身高是:" + height + "cm"
|
|
||||||
that.height = height
|
|
||||||
console.log("身高模式:", that.height)
|
|
||||||
}
|
|
||||||
if (type == "11") { //阻抗模式
|
|
||||||
if (typeInfo == "01") { //测量中
|
|
||||||
that.textImp = '正在测量体脂:请双手紧握扶手'
|
|
||||||
}
|
|
||||||
if (typeInfo == "02") {
|
|
||||||
that.imp = 0
|
|
||||||
that.textImp = ""
|
|
||||||
}
|
|
||||||
if (typeInfo == "04") {
|
|
||||||
that.textImp = ""
|
|
||||||
that.imp = parseInt(payload.substring(8, 12), 16)
|
|
||||||
}
|
|
||||||
console.log("阻抗:", that.imp)
|
|
||||||
}
|
|
||||||
if (type == '15') {
|
|
||||||
if (typeInfo == "01") {
|
|
||||||
that.data01 = {
|
|
||||||
bodyage: parseInt(payload.substring(26, 28),
|
|
||||||
16),
|
|
||||||
fat_r: parseInt(payload.substring(6, 10),
|
|
||||||
16) / 10,
|
|
||||||
muscle: parseInt(payload.substring(18, 22),
|
|
||||||
16) / 10,
|
|
||||||
kcal: parseInt(payload.substring(22, 26),
|
|
||||||
16),
|
|
||||||
visceral: parseInt(payload.substring(14,
|
|
||||||
18), 16),
|
|
||||||
sfr: parseInt(payload.substring(10, 14),
|
|
||||||
16) / 10,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (typeInfo == '02') {
|
|
||||||
that.data02 = {
|
|
||||||
water: parseInt(payload.substring(10, 14),
|
|
||||||
16) / 10,
|
|
||||||
bone: parseInt(payload.substring(6, 10),
|
|
||||||
16) / 10,
|
|
||||||
fatlevlval: parseInt(payload.substring(24,
|
|
||||||
26), 16) /
|
|
||||||
10,
|
|
||||||
protein: parseInt(payload.substring(14, 18),
|
|
||||||
16) / 10,
|
|
||||||
bmi: parseInt(payload.substring(18, 22),
|
|
||||||
16) / 10,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log("体脂数据", that.data01, that.data02)
|
|
||||||
that.BLEResult.info = Object.assign(that.data01, that.data02)
|
|
||||||
}
|
|
||||||
if (type == "80") { //测量结束
|
|
||||||
that.BLEResult.weight = that.weight
|
|
||||||
that.BLEResult.adc = that.imp ? that.imp : 0
|
|
||||||
that.BLEResult.height = (that.height ? that.height : that.userInfo.height) + 'cm'
|
|
||||||
that.BLEResult.aud_id = that.userInfo.id
|
|
||||||
console.log("体脂成功:", that.BLEResult)
|
|
||||||
that.handleGetMeasure(that.BLEResult)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
console.log('获取特征值失败:', JSON.stringify(res))
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 保存测量结果
|
|
||||||
handleGetMeasure(data) {
|
|
||||||
console.log("保存结果")
|
|
||||||
let that = this
|
|
||||||
that.$model.getmeasurefunit(data).then(res => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
that.$store.dispatch('getUserInfo', {
|
|
||||||
aud_id: uni.getStorageSync('userid')
|
|
||||||
})
|
|
||||||
that.$store.dispatch("getResult", {
|
|
||||||
aud_id: uni.getStorageSync('userid')
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
|
||||||
uni.showToast({
|
|
||||||
title: '测量成功'
|
|
||||||
})
|
|
||||||
}, 500)
|
|
||||||
} else {
|
|
||||||
uni.showToast({
|
|
||||||
title: res.message,
|
|
||||||
icon: "error"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
that.Unload = true
|
|
||||||
setTimeout(function() {
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
that.$store.state.devicesList2 = []
|
|
||||||
|
|
||||||
uni.switchTab({
|
uni.onBLECharacteristicValueChange((characteristic) => {
|
||||||
url: "/pages/home/home"
|
const raw = new Uint8Array(characteristic.value);
|
||||||
})
|
// console.log("raw", raw)
|
||||||
}, 1000)
|
|
||||||
})
|
let payload = that.$tools.ab2hex(characteristic.value, '')
|
||||||
},
|
let type = payload.substring(8, 10)
|
||||||
/**
|
// let sex = that.userInfo.gender == 1 ? "01" : "00"
|
||||||
* 断开蓝牙模块
|
// let age = that.userInfo.age.toString(16)
|
||||||
*/
|
// let height = Math.round(that.userInfo.height)
|
||||||
closeBluetoothAdapter() {
|
// let j = Number(26 + 5 + 1 + sex + age + height).toString(16)
|
||||||
let that = this;
|
// let arr = "A700260501" + sex + age + height.toString(16) + "00" + j.substr(
|
||||||
uni.closeBluetoothAdapter({
|
// j.length - 2, 2) + "7A"
|
||||||
success: res => {
|
|
||||||
console.log('F01PRO:蓝牙模块关闭成功');
|
// let j = Number(38 + 5 + 1 + 1 + 17 + 151).toString(16)
|
||||||
}
|
// let arr = "A70026050101169700"+ j.substr(j.length - 2, 2) + "7A"
|
||||||
})
|
|
||||||
},
|
console.log("开始测量", payload)
|
||||||
handleBack() {
|
if (payload == "a603420100466a" || type == '03') {
|
||||||
let that = this
|
// 男性,22岁,180身高
|
||||||
that.Unload = true
|
that.writeBLECharacteristicValue("a7002605010116b400f77a")
|
||||||
console.log('F01PRO:handleBack');
|
}
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
if (type == "10" || type == "30" || type == "40") { //体脂模式
|
||||||
that.closeBLEConnection()
|
let typeInfo = payload.substring(12, 14)
|
||||||
that.closeBluetoothAdapter()
|
let data = parseInt(payload.substring(14, 20), 16)
|
||||||
that.$store.state.devicesList2 = []
|
let msg = parseInt(payload.substring(20, 22), 16).toString(2)
|
||||||
},
|
let dw = that.$tools.PrefixZero(msg, 8).substring(4, 8)
|
||||||
/**
|
let num = that.$tools.PrefixZero(msg, 8).substring(0, 4)
|
||||||
* 断开蓝牙连接
|
let dw1 = "kg"
|
||||||
*/
|
if (dw == "0001") {
|
||||||
closeBLEConnection() {
|
dw1 = '斤'
|
||||||
var that = this;
|
}
|
||||||
uni.closeBLEConnection({
|
if (dw == "0110") {
|
||||||
deviceId: that.deviceId,
|
dw1 = 'lb'
|
||||||
success: res => {
|
}
|
||||||
console.log('F01PRO:断开蓝牙连接成功');
|
if (num == "0001") {
|
||||||
}
|
data = data / 10
|
||||||
});
|
}
|
||||||
},
|
if (num == "0010") {
|
||||||
},
|
data = data / 100
|
||||||
}
|
}
|
||||||
|
if (num == "0011") {
|
||||||
|
data = data / 1000
|
||||||
|
}
|
||||||
|
if (typeInfo == "01") {
|
||||||
|
that.textW = "您的实时体重是:" + data + dw1
|
||||||
|
}
|
||||||
|
if (typeInfo == "02") {
|
||||||
|
that.textW = "您的体重是:" + data + dw1
|
||||||
|
that.weight = data + dw1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type == "14" || type == "41") { //身高模式
|
||||||
|
let height = parseInt(payload.substring(12, 16), 16)
|
||||||
|
let numH = parseInt(payload.substring(18, 20), 16)
|
||||||
|
if (numH == "1") {
|
||||||
|
height = height / 10
|
||||||
|
}
|
||||||
|
if (numH == "2") {
|
||||||
|
height = height / 100
|
||||||
|
}
|
||||||
|
that.textH = "您的身高是:" + height + "cm"
|
||||||
|
that.height = height
|
||||||
|
console.log("身高模式:", that.height)
|
||||||
|
}
|
||||||
|
if (type == "11") { //阻抗模式
|
||||||
|
let typeInfo = payload.substring(12, 14)
|
||||||
|
if (typeInfo == "01") { //测量中
|
||||||
|
that.textLink = '正在测量体脂:请双手紧握扶手'
|
||||||
|
}
|
||||||
|
if (typeInfo == "02") {
|
||||||
|
that.imp = 0
|
||||||
|
that.textLink = ""
|
||||||
|
}
|
||||||
|
if (typeInfo == "04") {
|
||||||
|
that.textLink = ""
|
||||||
|
that.imp = parseInt(payload.substring(16, 20), 16)
|
||||||
|
}
|
||||||
|
console.log("阻抗:", that.imp)
|
||||||
|
}
|
||||||
|
if (type == '15') {
|
||||||
|
let typeInfo = payload.substring(12, 14)
|
||||||
|
if (typeInfo == "01") {
|
||||||
|
that.data01 = {
|
||||||
|
fat_r: parseInt(payload.substring(14, 18), 16) / 10,
|
||||||
|
sfr: parseInt(payload.substring(18, 22), 16) / 10,
|
||||||
|
visceral: parseInt(payload.substring(22, 26), 16),
|
||||||
|
muscle: parseInt(payload.substring(26, 30), 16) / 10,
|
||||||
|
kcal: parseInt(payload.substring(30, 34), 16),
|
||||||
|
bodyage: parseInt(payload.substring(34, 36), 16),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (typeInfo == '02') {
|
||||||
|
that.data02 = {
|
||||||
|
bone: parseInt(payload.substring(14, 18), 16) / 10,
|
||||||
|
water: parseInt(payload.substring(18, 22), 16) / 10,
|
||||||
|
protein: parseInt(payload.substring(22, 26), 16) / 10,
|
||||||
|
bmi: parseInt(payload.substring(26, 30), 16) / 10,
|
||||||
|
fatlevlval: parseInt(payload.substring(30, 32), 16) / 10,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log("体脂数据", that.data01, that.data02)
|
||||||
|
that.BLEResult.info = Object.assign(that.data01, that.data02)
|
||||||
|
}
|
||||||
|
if (type == "80") { //测量结束
|
||||||
|
that.BLEResult.weight = that.weight
|
||||||
|
that.BLEResult.adc = that.imp ? that.imp : 0
|
||||||
|
that.BLEResult.height = (that.height ? that.height : that.userInfo
|
||||||
|
.height) + 'cm'
|
||||||
|
that.BLEResult.aud_id = that.userInfo.id
|
||||||
|
console.log("体脂成功:", that.BLEResult)
|
||||||
|
that.handleGetMeasure(that.BLEResult)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
console.log('获取特征值失败:', JSON.stringify(res))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
writeBLECharacteristicValue(str) {
|
||||||
|
var that = this;
|
||||||
|
let buf = new Uint8Array(str.match(/[\da-f]{2}/gi).map(function(h) {
|
||||||
|
return parseInt(h, 16)
|
||||||
|
}))
|
||||||
|
console.log("buffer", str)
|
||||||
|
uni.writeBLECharacteristicValue({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
serviceId: that.serviceId,
|
||||||
|
characteristicId: that.uuid3,
|
||||||
|
value: buf.buffer,
|
||||||
|
success: res => {
|
||||||
|
console.log('下发指令成功', res.errMsg)
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
console.log("下发指令失败", res);
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 保存测量结果
|
||||||
|
handleGetMeasure(data) {
|
||||||
|
console.log("保存结果")
|
||||||
|
let that = this
|
||||||
|
that.$model.getmeasurefunit(data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
that.$store.dispatch('getUserInfo', {
|
||||||
|
aud_id: uni.getStorageSync('userid')
|
||||||
|
})
|
||||||
|
that.$store.dispatch("getResult", {
|
||||||
|
aud_id: uni.getStorageSync('userid')
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.showToast({
|
||||||
|
title: '测量成功'
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.message,
|
||||||
|
icon: "error"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
that.Unload = true
|
||||||
|
uni.switchTab({
|
||||||
|
url: "/pages/home/home"
|
||||||
|
})
|
||||||
|
setTimeout(function() {
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
}, 500)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 断开蓝牙模块
|
||||||
|
*/
|
||||||
|
closeBluetoothAdapter() {
|
||||||
|
let that = this;
|
||||||
|
uni.closeBluetoothAdapter({
|
||||||
|
success: res => {
|
||||||
|
console.log('F01PRO:蓝牙模块关闭成功');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 断开蓝牙连接
|
||||||
|
*/
|
||||||
|
closeBLEConnection() {
|
||||||
|
var that = this;
|
||||||
|
uni.closeBLEConnection({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
success: res => {
|
||||||
|
console.log('F01PRO:断开蓝牙连接成功');
|
||||||
|
that.$store.commit("changeConnected", false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
.image3 {
|
||||||
|
width: 200px !important;
|
||||||
|
height: 340px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status {
|
||||||
|
width: 70%;
|
||||||
|
font-size: 16px;
|
||||||
|
height: 35px;
|
||||||
|
line-height: 35px;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 15px;
|
||||||
|
margin: 15px auto;
|
||||||
|
background-color: #ffdda6;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -43,6 +43,7 @@
|
||||||
height: "",
|
height: "",
|
||||||
height2: "",
|
height2: "",
|
||||||
deviceId: "",
|
deviceId: "",
|
||||||
|
serviceId:"",
|
||||||
macAddr: "",
|
macAddr: "",
|
||||||
write: "",
|
write: "",
|
||||||
notify: "",
|
notify: "",
|
||||||
|
|
|
||||||
|
|
@ -69,13 +69,20 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="tip">
|
<view class="tip">
|
||||||
BMI是身体质量指数,是目前国际上常用的衡量人体胖瘦程度以及是否健康的一个标准
|
BMI是身体质量指数,是目前国际上常用的衡量人体胖瘦程度以及是否健康的一个标准.
|
||||||
|
<view class="text" v-for="(ite,ind) in Config.literature.bmi_evaluation"
|
||||||
|
v-if="Config.literature.bmi_evaluation.length">
|
||||||
|
{{ite}}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn mt-20" @click="submit"> 立即计算</view>
|
<view class="btn mt-20" @click="submit"> 立即计算</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {
|
||||||
|
mapState
|
||||||
|
} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -104,6 +111,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapState(["Config"]),
|
||||||
endDate() {
|
endDate() {
|
||||||
return this.$tools.getDate("start")
|
return this.$tools.getDate("start")
|
||||||
},
|
},
|
||||||
|
|
@ -224,7 +232,7 @@
|
||||||
/deep/input {
|
/deep/input {
|
||||||
padding-left: 0px;
|
padding-left: 0px;
|
||||||
margin-top: 0px;
|
margin-top: 0px;
|
||||||
font-size:30rpx !important;
|
font-size: 30rpx !important;
|
||||||
height: 38px;
|
height: 38px;
|
||||||
line-height: 38px;
|
line-height: 38px;
|
||||||
}
|
}
|
||||||
|
|
@ -238,7 +246,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.box_con {
|
.box_con {
|
||||||
margin-top: 15px;
|
margin: 15px 0;
|
||||||
padding: 10px 15px 15px;
|
padding: 10px 15px 15px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,12 @@
|
||||||
<view class="con">孩子后天生长环境不利长高。请从饮食、睡眠、运动、情绪等方面排查。加强后天因素管理,让孩子处于最佳长高状态。</view>
|
<view class="con">孩子后天生长环境不利长高。请从饮食、睡眠、运动、情绪等方面排查。加强后天因素管理,让孩子处于最佳长高状态。</view>
|
||||||
<view class="h5">如果当前实际身高﹥当前标准身高</view>
|
<view class="h5">如果当前实际身高﹥当前标准身高</view>
|
||||||
<view class="con">孩子后天生长环境有利长高。请继续保持,加强后天因素管理,孩子成年可比标准高10cm以上。</view>
|
<view class="con">孩子后天生长环境有利长高。请继续保持,加强后天因素管理,孩子成年可比标准高10cm以上。</view>
|
||||||
|
<view class="con" v-for="(ite,ind) in Config.literature.height_prediction"
|
||||||
|
v-if="Config.literature.height_prediction.length">
|
||||||
|
{{ite}}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -85,7 +90,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user"]),
|
...mapState(["user", "Config"]),
|
||||||
endDate() {
|
endDate() {
|
||||||
return this.$tools.getDate("start")
|
return this.$tools.getDate("start")
|
||||||
},
|
},
|
||||||
|
|
@ -198,7 +203,6 @@
|
||||||
|
|
||||||
.con {
|
.con {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
margin-bottom: 30rpx;
|
|
||||||
color: #999;
|
color: #999;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
|
|
|
||||||
38
pages.json
38
pages.json
|
|
@ -279,37 +279,33 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path" : "devices/B20",
|
"path": "devices/B20",
|
||||||
"style" :
|
"style": {
|
||||||
{
|
"navigationBarTitleText": "",
|
||||||
"navigationBarTitleText" : "",
|
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path" : "devices/PCL22",
|
"path": "devices/PCL22",
|
||||||
"style" :
|
"style": {
|
||||||
{
|
"navigationBarTitleText": "",
|
||||||
"navigationBarTitleText" : "",
|
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path" : "devices/PCL22S",
|
"path": "devices/PCL22S",
|
||||||
"style" :
|
"style": {
|
||||||
{
|
"navigationBarTitleText": "",
|
||||||
"navigationBarTitleText" : "",
|
"enablePullDownRefresh": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "devices/F01PRO",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
"enablePullDownRefresh": false
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path" : "devices/F01PRO",
|
|
||||||
"style" :
|
|
||||||
{
|
|
||||||
"navigationBarTitleText" : "",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "notepad/notepad",
|
"path": "notepad/notepad",
|
||||||
"style": {
|
"style": {
|
||||||
|
|
@ -354,7 +350,7 @@
|
||||||
"navigationBarTitleText": "身高预测"
|
"navigationBarTitleText": "身高预测"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"path": "home/bmi",
|
"path": "home/bmi",
|
||||||
"style": {
|
"style": {
|
||||||
|
|
|
||||||
1755
pages/home/home.vue
1755
pages/home/home.vue
File diff suppressed because it is too large
Load Diff
|
|
@ -79,7 +79,7 @@ export default new Vuex.Store({
|
||||||
CooperationUrl: [],
|
CooperationUrl: [],
|
||||||
LungLevel: [], //肺活量标准
|
LungLevel: [], //肺活量标准
|
||||||
devicesList: [], //筛选设备列表
|
devicesList: [], //筛选设备列表
|
||||||
devicesList2:[], //F01PRO使用
|
devicesList2: [], //F01PRO使用
|
||||||
labelList: [],
|
labelList: [],
|
||||||
phoneInfo: {
|
phoneInfo: {
|
||||||
info: {},
|
info: {},
|
||||||
|
|
@ -88,8 +88,10 @@ export default new Vuex.Store({
|
||||||
},
|
},
|
||||||
cityList: [],
|
cityList: [],
|
||||||
gradeList: [],
|
gradeList: [],
|
||||||
identityList: []
|
identityList: [],
|
||||||
|
Config: {}
|
||||||
},
|
},
|
||||||
|
|
||||||
// mutations: Store中更改state数据状态的唯一方法(必须是同步函数)
|
// mutations: Store中更改state数据状态的唯一方法(必须是同步函数)
|
||||||
mutations: {
|
mutations: {
|
||||||
// 版本信息
|
// 版本信息
|
||||||
|
|
@ -129,6 +131,9 @@ export default new Vuex.Store({
|
||||||
changePublicContent(state, newData) {
|
changePublicContent(state, newData) {
|
||||||
state.PublicContent = newData
|
state.PublicContent = newData
|
||||||
},
|
},
|
||||||
|
changeConfig(state, newData){
|
||||||
|
state.Config = newData
|
||||||
|
},
|
||||||
// 公共手动记录内容
|
// 公共手动记录内容
|
||||||
changePublicRecord(state, newData) {
|
changePublicRecord(state, newData) {
|
||||||
state.PublicRecord = newData
|
state.PublicRecord = newData
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,11 @@ export default {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getConfig(param) { // 枚举接口
|
||||||
|
return http.post("/reedaw/config", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
getRegisterPhone(param) { // 手机号快捷登录
|
getRegisterPhone(param) { // 手机号快捷登录
|
||||||
return http.post("/wechat_quick_login", param).then(res => {
|
return http.post("/wechat_quick_login", param).then(res => {
|
||||||
return res
|
return res
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
https://app.liuyingyong.cn/build/download/f411d760-7bb3-11ef-88e8-3f2eddb71367
|
https://app.liuyingyong.cn/build/download/2dd73620-8d29-11f0-b6b9-b3859587e79f
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,3 +1,4 @@
|
||||||
andrCertfile=D:/qingce.keystore
|
andrCertfile=D:/Desktop/青测证书/安卓证书/qingce.keystore
|
||||||
andrCertAlias=qingce
|
andrCertAlias=qingce
|
||||||
andrCertPass=e7l98mrpB0Uj4WWFn9y0Mg==
|
andrCertPass=e7l98mrpB0Uj4WWFn9y0Mg==
|
||||||
|
storePassword=e7l98mrpB0Uj4WWFn9y0Mg==
|
||||||
|
|
|
||||||
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
|
|
@ -1 +1 @@
|
||||||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__20604F1","name":"Reedaw","version":{"name":"1.3.2","code":132},"description":"面向儿童青少年的健康体质测量APP","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"Bluetooth":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":true,"delay":0,"target":"id:1","waiting":true},"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":"icon-android-hdpi.png","xhdpi":"icon-android-xhdpi.png","xxhdpi":"icon-android-xxhdpi.png","xxxhdpi":"icon-android-xxxhdpi.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"},"prerendered":"false"}},"splashscreen":{"androidStyle":"common","android":{"hdpi":"static/logo.png","xhdpi":"static/logo.png","xxhdpi":"static/logo.png"},"useOriginalMsgbox":true},"google":{"abiFilters":["arm64-v8a","x86"],"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\"/>"],"packagename":"uni.UNI20604F1","aliasname":"qingce","password":"e7l98mrpB0Uj4WWFn9y0Mg==","keystore":"google-keystore.keystore","custompermissions":true},"apple":{"dSYMs":false,"idfa":false,"privacyDescription":{"NSBluetoothAlwaysUsageDescription":"需要蓝牙权限来连接设备","NSBluetoothPeripheralUsageDescription":"使用蓝牙与外设通信"},"plistcmds":["Add :UIFileSharingEnabled bool true"],"devices":"universal"},"plugins":{"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}},"debug":true,"syncDebug":true,"orientation":"portrait-primary"},"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":"14px","selectedColor":"#37cc92","backgroundColor":"#fff","list":[{"pagePath":"pages/home/home","iconPath":"static/shou.png","selectedIconPath":"static/shou2.png","text":"记录"},{"pagePath":"pages/zixun/list","iconPath":"static/ping.png","selectedIconPath":"static/ping2.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","adid":"124881220911"},"locale":"zh-Hans"}
|
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__20604F1","name":"Reedaw","version":{"name":"1.3.5","code":135},"description":"面向儿童青少年的健康体质测量APP","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"Bluetooth":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"autoclose":true,"delay":0,"target":"id:1","waiting":true},"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":"icon-android-hdpi.png","xhdpi":"icon-android-xhdpi.png","xxhdpi":"icon-android-xxhdpi.png","xxxhdpi":"icon-android-xxxhdpi.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"},"prerendered":"false"}},"splashscreen":{"androidStyle":"common","android":{"hdpi":"static/logo.png","xhdpi":"static/logo.png","xxhdpi":"static/logo.png"},"useOriginalMsgbox":true},"google":{"abiFilters":["arm64-v8a","x86"],"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\"/>"],"packagename":"uni.UNI20604F1","aliasname":"qingce","password":"e7l98mrpB0Uj4WWFn9y0Mg==","storepwd":"e7l98mrpB0Uj4WWFn9y0Mg==","keypwd":"e7l98mrpB0Uj4WWFn9y0Mg==","keystore":"google-keystore.keystore","custompermissions":true},"apple":{"dSYMs":false,"idfa":false,"privacyDescription":{"NSBluetoothAlwaysUsageDescription":"需要蓝牙权限来连接设备","NSBluetoothPeripheralUsageDescription":"使用蓝牙与外设通信"},"devices":"universal"},"plugins":{"ad":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}},"orientation":"portrait-primary"},"uniStatistics":{"enable":false,"version":"2"},"allowsInlineMediaPlayback":true,"safearea":{"background":"#fff","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"4.76","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#333","fontSize":"14px","selectedColor":"#37cc92","backgroundColor":"#fff","list":[{"pagePath":"pages/home/home","iconPath":"static/shou.png","selectedIconPath":"static/shou2.png","text":"记录"},{"pagePath":"pages/zixun/list","iconPath":"static/ping.png","selectedIconPath":"static/ping2.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","adid":"124881220911"},"locale":"zh-Hans"}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue