公众配置接口
This commit is contained in:
parent
9f5eca2870
commit
3738c2abe0
110
App.vue
110
App.vue
|
|
@ -1,55 +1,63 @@
|
||||||
<script>
|
<script>
|
||||||
export default {
|
import {
|
||||||
methods: {},
|
mapState
|
||||||
onLaunch() {
|
} from "vuex";
|
||||||
// 版本更新
|
export default {
|
||||||
const updateManager = wx.getUpdateManager()
|
methods: {},
|
||||||
// 请求完新版本信息的回调
|
computed: {
|
||||||
updateManager.onCheckForUpdate(function(res) {
|
...mapState(["appTheme"]),
|
||||||
console.log("是否有新版本", res.hasUpdate)
|
},
|
||||||
})
|
onLaunch() {
|
||||||
// 新版本下载成功
|
// 版本更新
|
||||||
updateManager.onUpdateReady(function() {
|
const updateManager = wx.getUpdateManager()
|
||||||
wx.showModal({
|
// 请求完新版本信息的回调
|
||||||
title: '更新提示',
|
updateManager.onCheckForUpdate(function(res) {
|
||||||
content: '新版本已经准备好,是否重启应用?',
|
console.log("是否有新版本", res.hasUpdate)
|
||||||
success: function(res) {
|
})
|
||||||
if (res.confirm) {
|
// 新版本下载成功
|
||||||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
updateManager.onUpdateReady(function() {
|
||||||
updateManager.applyUpdate()
|
wx.showModal({
|
||||||
}
|
title: '更新提示',
|
||||||
}
|
content: '新版本已经准备好,是否重启应用?',
|
||||||
})
|
success: function(res) {
|
||||||
})
|
if (res.confirm) {
|
||||||
// 新版本下载失败
|
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||||
updateManager.onUpdateFailed(function() {
|
updateManager.applyUpdate()
|
||||||
wx.showModal({
|
}
|
||||||
title: '新版本更新失败',
|
}
|
||||||
content: '请退出并移除小程序,重新打开...',
|
})
|
||||||
})
|
})
|
||||||
})
|
// 新版本下载失败
|
||||||
// 系统信息
|
updateManager.onUpdateFailed(function() {
|
||||||
// uni.getSystemInfo({
|
wx.showModal({
|
||||||
// success: e => {
|
title: '新版本更新失败',
|
||||||
// let res = uni.getMenuButtonBoundingClientRect()
|
content: '请退出并移除小程序,重新打开...',
|
||||||
// let statusBarHeight = {
|
})
|
||||||
// BarTopHeight: res.top,
|
})
|
||||||
// BarTopLineHeight: res.height + 10,
|
// 系统信息
|
||||||
// BarMarginTop: Number(res.top + res.height + 10)
|
// uni.getSystemInfo({
|
||||||
// }
|
// success: e => {
|
||||||
// this.$store.commit("handleBarHeight", statusBarHeight);
|
// let res = uni.getMenuButtonBoundingClientRect()
|
||||||
// console.log("系统信息", e, res)
|
// let statusBarHeight = {
|
||||||
// }
|
// BarTopHeight: res.top,
|
||||||
// })
|
// BarTopLineHeight: res.height + 10,
|
||||||
},
|
// BarMarginTop: Number(res.top + res.height + 10)
|
||||||
mounted() {},
|
// }
|
||||||
onShow: function() {
|
// this.$store.commit("handleBarHeight", statusBarHeight);
|
||||||
console.log('App Show')
|
// console.log("系统信息", e, res)
|
||||||
},
|
// }
|
||||||
onHide: function() {
|
// })
|
||||||
console.log('App Hide')
|
|
||||||
}
|
//
|
||||||
}
|
},
|
||||||
|
mounted() {},
|
||||||
|
onShow: function() {
|
||||||
|
console.log('App Show')
|
||||||
|
},
|
||||||
|
onHide: function() {
|
||||||
|
console.log('App Hide')
|
||||||
|
},
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
|
||||||
|
|
@ -1,428 +1,436 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="content weightPages">
|
<view class="content weightPages">
|
||||||
<view class="title" v-if="isConnection == 0">连接中,请稍后</view>
|
<view class="title" v-if="isConnection == 0">连接中,请稍后</view>
|
||||||
<view class="title" v-if="isConnection == 1">连接成功,请开始测量</view>
|
<view class="title" v-if="isConnection == 1">连接成功,请开始测量</view>
|
||||||
<view class="title" v-if="isConnection == 2" @click="openBluetoothAdapter">连接失败,点击重新连接</view>
|
<view class="title" v-if="isConnection == 2" @click="openBluetoothAdapter">连接失败,点击重新连接</view>
|
||||||
<view class="text">{{text}}</view>
|
<view class="text">{{text}}</view>
|
||||||
<view class="image">
|
<view class="image">
|
||||||
<image src="/BLEPages/static/F018P01.gif" v-if="type==1"></image>
|
<image src="/BLEPages/static/F018P01.gif" v-if="type==1"></image>
|
||||||
<image src="/BLEPages/static/F018P01.gif" v-if="type==2"></image>
|
<image src="/BLEPages/static/F018P01.gif" v-if="type==2"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="tips">
|
<view class="tips">
|
||||||
<text>提示:</text>
|
<text>提示:</text>
|
||||||
<text>1.请确定设备是开机状态</text>
|
<text>1.请确定设备是开机状态</text>
|
||||||
<text>2.请确定手机蓝牙、位置信息已打开</text>
|
<text>2.请确定手机蓝牙、位置信息已打开</text>
|
||||||
<text>3.ios系统需打开设置—>应用—>微信里的蓝牙权限</text>
|
<text>3.ios系统需打开设置—>应用—>微信里的蓝牙权限</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
var myTime;
|
var myTime;
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
text: "",
|
text: "",
|
||||||
height: "",
|
height: "",
|
||||||
weight: "",
|
weight: "",
|
||||||
imp: 0,
|
imp: 0,
|
||||||
type: 1,
|
type: 1,
|
||||||
uuid1: "",
|
uuid1: "",
|
||||||
uuid2: "",
|
uuid2: "",
|
||||||
uuid3: "",
|
uuid3: "",
|
||||||
macAddr: "",
|
macAddr: "",
|
||||||
deviceId: "",
|
deviceId: "",
|
||||||
serviceId: "",
|
serviceId: "",
|
||||||
Unload: false,
|
Unload: false,
|
||||||
isConnection: 0, //是否连接成功
|
isConnection: 0, //是否连接成功
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user", "isConnected", "isBluetoothTyle", "appTheme"]),
|
||||||
|
info() {
|
||||||
|
return this.user
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onUnload: function() {
|
||||||
|
let that = this
|
||||||
|
if (!that.Unload) {
|
||||||
|
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||||
|
clearTimeout(myTime);
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
console.log("返回上一个页面")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
let that = this
|
||||||
|
// 导航栏颜色
|
||||||
|
uni.setNavigationBarColor({
|
||||||
|
frontColor: '#ffffff',
|
||||||
|
backgroundColor: this.appTheme,
|
||||||
|
})
|
||||||
|
//
|
||||||
|
that.text = ""
|
||||||
|
if (options && options.deviceId) {
|
||||||
|
that.macAddr = options.deviceId
|
||||||
|
that.deviceId = options.deviceId
|
||||||
|
that.createBLEConnection()
|
||||||
|
}
|
||||||
|
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
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isBluetoothTyle: function() {
|
||||||
|
let that = this
|
||||||
|
if (!that.isBluetoothTyle) {
|
||||||
|
that.handleBack()
|
||||||
|
that.isConnection = 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 初始化蓝牙
|
||||||
|
openBluetoothAdapter() {
|
||||||
|
let that = this
|
||||||
|
that.type = 1
|
||||||
|
uni.openBluetoothAdapter({
|
||||||
|
success: e => {
|
||||||
|
that.isConnection = 0
|
||||||
|
that.startBluetoothDeviceDiscovery()
|
||||||
|
},
|
||||||
|
fail: e => {
|
||||||
|
that.isConnection = 2
|
||||||
|
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 开始搜寻附近的蓝牙外围设备
|
||||||
|
startBluetoothDeviceDiscovery() {
|
||||||
|
let that = this
|
||||||
|
uni.startBluetoothDevicesDiscovery({
|
||||||
|
allowDuplicatesKey: false,
|
||||||
|
interval: 500, //上报设备的间隔
|
||||||
|
services: [
|
||||||
|
"FFE0",
|
||||||
|
],
|
||||||
|
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) {
|
||||||
computed: {
|
clearTimeout(myTime);
|
||||||
...mapState(["user", "isConnected", "isBluetoothTyle"]),
|
let buff = device.advertisData.slice(-6)
|
||||||
info() {
|
device.mac = new Uint8Array(buff) // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
|
||||||
return this.user
|
let tempMac = Array.from(device.mac)
|
||||||
}
|
tempMac.reverse()
|
||||||
},
|
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
|
||||||
onUnload: function() {
|
if (device.deviceId.indexOf(that.deviceId) != -1 || device.macAddr.indexOf(that.deviceId) != -1) {
|
||||||
let that = this
|
that.stopBluetoothDevicesDiscovery()
|
||||||
if (!that.Unload) {
|
that.macAddr = device.macAddr
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
that.deviceId = device.deviceId;
|
||||||
clearTimeout(myTime);
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
console.log("返回上一个页面")
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
let that = this
|
|
||||||
that.text = ""
|
|
||||||
if (options && options.deviceId) {
|
|
||||||
that.macAddr = options.deviceId
|
|
||||||
that.deviceId = options.deviceId
|
|
||||||
that.createBLEConnection()
|
that.createBLEConnection()
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
that.onBLEConnectionStateChange()
|
})
|
||||||
uni.onBluetoothAdapterStateChange(function(res) {
|
});
|
||||||
that.$store.commit("changeBluetooth", res.available);
|
that.handleMyTime()
|
||||||
})
|
},
|
||||||
},
|
handleMyTime() {
|
||||||
watch: {
|
var that = this;
|
||||||
isConnected: function() {
|
myTime = setTimeout(function() {
|
||||||
let that = this
|
if (!that.macAddr) {
|
||||||
if (!that.isConnected) {
|
clearTimeout(myTime);
|
||||||
that.handleBack()
|
that.Unload = true
|
||||||
that.isConnection = 2
|
that.isConnection = 2
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
}
|
||||||
|
}, 20000);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 停止搜索蓝牙设备
|
||||||
|
*/
|
||||||
|
stopBluetoothDevicesDiscovery() {
|
||||||
|
uni.stopBluetoothDevicesDiscovery({
|
||||||
|
success: e => {
|
||||||
|
console.log("停止搜索蓝牙设备", e)
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 监听蓝牙连接状态
|
||||||
|
onBLEConnectionStateChange() {
|
||||||
|
let that = this
|
||||||
|
uni.onBLEConnectionStateChange(function(res) {
|
||||||
|
console.log("监听蓝牙连接状态", res.connected)
|
||||||
|
if (!res.connected) {
|
||||||
|
clearTimeout(myTime);
|
||||||
|
that.Unload = true
|
||||||
|
that.isConnection = 2
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
}
|
||||||
|
that.$store.commit("changeConnected", res.connected);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 连接蓝牙
|
||||||
|
createBLEConnection() {
|
||||||
|
let that = this;
|
||||||
|
uni.createBLEConnection({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
success: 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.isConnection = 1
|
||||||
|
that.serviceId = service.uuid;
|
||||||
|
that.getBLEDeviceCharacteristics();
|
||||||
|
console.log("设备的FFE0的serviceId: " + that.serviceId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
console.log('获取设备的UUID失败:', res)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取指定服务的特征值
|
||||||
|
*/
|
||||||
|
getBLEDeviceCharacteristics() {
|
||||||
|
let characteristicsList = [];
|
||||||
|
let that = this;
|
||||||
|
uni.getBLEDeviceCharacteristics({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
serviceId: that.serviceId,
|
||||||
|
success: res => {
|
||||||
|
console.log("服务的特征值成功", res)
|
||||||
|
for (let i = 0; i < res.characteristics.length; i++) {
|
||||||
|
let item = res.characteristics[i];
|
||||||
|
if (item.uuid.indexOf('0000FFE1') != -1) {
|
||||||
|
that.uuid1 = item.uuid //下发数据
|
||||||
|
} else if (item.uuid.indexOf('0000FFE2') != -1) {
|
||||||
|
that.uuid2 = item.uuid //监听数据
|
||||||
|
that.notifyBLECharacteristicValue()
|
||||||
|
} else if (item.uuid.indexOf('0000FFE3') != -1) {
|
||||||
|
that.uuid3 = item.uuid //写入设置
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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.uuid2,
|
||||||
|
success(res) {
|
||||||
|
uni.onBLECharacteristicValueChange(function(res) {
|
||||||
|
let value = that.$tools.ab2hex(res.value, "");
|
||||||
|
let num = value.substring(18, 19)
|
||||||
|
let dw = value.substring(19, 20)
|
||||||
|
let type = value.substring(8, 10)
|
||||||
|
let typeInfo = value.substring(10, 12)
|
||||||
|
if (type == "10") {
|
||||||
|
let data = parseInt(value.substring(13, 18), 16)
|
||||||
|
let dw1 = "kg"
|
||||||
|
let dw2 = "kg"
|
||||||
|
if (dw == "1") {
|
||||||
|
dw1 = "斤"
|
||||||
|
dw2 = "jin"
|
||||||
}
|
}
|
||||||
},
|
if (dw == "4") {
|
||||||
isBluetoothTyle: function() {
|
dw1 = "st:lb"
|
||||||
let that = this
|
dw2 = "st"
|
||||||
if (!that.isBluetoothTyle) {
|
data = 1 * data + 5
|
||||||
that.handleBack()
|
|
||||||
that.isConnection = 2
|
|
||||||
}
|
}
|
||||||
},
|
if (dw == "6") {
|
||||||
},
|
dw1 = "lb"
|
||||||
methods: {
|
dw2 = "lb"
|
||||||
// 初始化蓝牙
|
}
|
||||||
openBluetoothAdapter() {
|
if (num == "1") {
|
||||||
let that = this
|
data = parseInt(value.substring(13, 18), 16) / 10
|
||||||
that.type = 1
|
}
|
||||||
uni.openBluetoothAdapter({
|
if (num == "2") {
|
||||||
success: e => {
|
data = parseInt(value.substring(13, 18), 16) / 100
|
||||||
that.isConnection = 0
|
}
|
||||||
that.startBluetoothDeviceDiscovery()
|
if (num == "3") {
|
||||||
},
|
data = parseInt(value.substring(13, 18), 16) / 1000
|
||||||
fail: e => {
|
}
|
||||||
that.isConnection = 2
|
if (typeInfo == "01") {
|
||||||
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
|
that.text = "您的实时体重是:" + data + dw1
|
||||||
}
|
}
|
||||||
});
|
if (typeInfo == "02") {
|
||||||
},
|
that.text = "您的体重是:" + data + dw1
|
||||||
// 开始搜寻附近的蓝牙外围设备
|
that.weight = data + dw2
|
||||||
startBluetoothDeviceDiscovery() {
|
console.log("稳定体重:", value, that.weight)
|
||||||
let that = this
|
}
|
||||||
uni.startBluetoothDevicesDiscovery({
|
}
|
||||||
allowDuplicatesKey: false,
|
if (type == "11") {
|
||||||
interval: 500, //上报设备的间隔
|
that.type = 2
|
||||||
services: [
|
if (typeInfo == "03" || typeInfo == "04") {
|
||||||
"FFE0",
|
that.imp = parseInt(value.substring(17, 22), 16)
|
||||||
],
|
}
|
||||||
success: res => {
|
console.log("体脂:", that.imp)
|
||||||
that.isConnection = 0
|
}
|
||||||
that.onBluetoothDeviceFound();
|
if (type == "14") { //身高模式
|
||||||
},
|
that.height = parseInt(value.substring(10, 14), 16) / 10
|
||||||
fail: res => {
|
console.log("身高模式:", that.height)
|
||||||
that.isConnection = 2
|
}
|
||||||
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
|
if (type == "30") {
|
||||||
}
|
console.log("测量完成", that.weight, that.height, that.imp)
|
||||||
});
|
if (that.imp == 0) {
|
||||||
},
|
uni.showModal({
|
||||||
/**
|
title: '提示',
|
||||||
* 发现外围设备
|
content: "体脂测量失败,是否保存本次测量结果?",
|
||||||
*/
|
cancelText: "放弃",
|
||||||
onBluetoothDeviceFound() {
|
confirmText: "保存",
|
||||||
var that = this;
|
|
||||||
that.isConnection = 0
|
|
||||||
uni.onBluetoothDeviceFound(res => {
|
|
||||||
res.devices.forEach(device => {
|
|
||||||
if (!device.name && !device.localName) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (device.deviceId.indexOf(that.deviceId) != -1) {
|
|
||||||
that.stopBluetoothDevicesDiscovery()
|
|
||||||
clearTimeout(myTime);
|
|
||||||
let buff = device.advertisData.slice(-6)
|
|
||||||
device.mac = new Uint8Array(buff) // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
|
|
||||||
let tempMac = Array.from(device.mac)
|
|
||||||
tempMac.reverse()
|
|
||||||
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
|
|
||||||
that.macAddr = device.macAddr
|
|
||||||
that.deviceId = device.deviceId;
|
|
||||||
that.createBLEConnection()
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
that.handleMyTime()
|
|
||||||
},
|
|
||||||
handleMyTime() {
|
|
||||||
var that = this;
|
|
||||||
myTime = setTimeout(function() {
|
|
||||||
if (!that.macAddr) {
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.Unload = true
|
|
||||||
that.isConnection = 2
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
}
|
|
||||||
}, 20000);
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 停止搜索蓝牙设备
|
|
||||||
*/
|
|
||||||
stopBluetoothDevicesDiscovery() {
|
|
||||||
uni.stopBluetoothDevicesDiscovery({
|
|
||||||
success: e => {
|
|
||||||
console.log("停止搜索蓝牙设备", e)
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 监听蓝牙连接状态
|
|
||||||
onBLEConnectionStateChange() {
|
|
||||||
let that = this
|
|
||||||
uni.onBLEConnectionStateChange(function(res) {
|
|
||||||
console.log("监听蓝牙连接状态", res.connected)
|
|
||||||
if (!res.connected) {
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.Unload = true
|
|
||||||
that.isConnection = 2
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
}
|
|
||||||
that.$store.commit("changeConnected", res.connected);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 连接蓝牙
|
|
||||||
createBLEConnection() {
|
|
||||||
let that = this;
|
|
||||||
uni.createBLEConnection({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: 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.isConnection = 1
|
|
||||||
that.serviceId = service.uuid;
|
|
||||||
that.getBLEDeviceCharacteristics();
|
|
||||||
console.log("设备的FFE0的serviceId: " + that.serviceId);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
console.log('获取设备的UUID失败:', res)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 获取指定服务的特征值
|
|
||||||
*/
|
|
||||||
getBLEDeviceCharacteristics() {
|
|
||||||
let characteristicsList = [];
|
|
||||||
let that = this;
|
|
||||||
uni.getBLEDeviceCharacteristics({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
serviceId: that.serviceId,
|
|
||||||
success: res => {
|
|
||||||
console.log("服务的特征值成功", res)
|
|
||||||
for (let i = 0; i < res.characteristics.length; i++) {
|
|
||||||
let item = res.characteristics[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.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.uuid3,
|
|
||||||
success(res) {
|
success(res) {
|
||||||
uni.onBLECharacteristicValueChange(function(res) {
|
if (res.confirm) {
|
||||||
let value = that.$tools.ab2hex(res.value, "");
|
that.imp = 0
|
||||||
let num = value.substring(18, 19)
|
that.handleGetMeasure()
|
||||||
let dw = value.substring(19, 20)
|
} else {
|
||||||
let type = value.substring(8, 10)
|
that.Unload = true
|
||||||
let typeInfo = value.substring(10, 12)
|
|
||||||
if (type == "10") {
|
|
||||||
let data = parseInt(value.substring(13, 18), 16)
|
|
||||||
let dw1 = "kg"
|
|
||||||
let dw2 = "kg"
|
|
||||||
if (dw == "1") {
|
|
||||||
dw1 = "斤"
|
|
||||||
dw2 = "jin"
|
|
||||||
}
|
|
||||||
if (dw == "4") {
|
|
||||||
dw1 = "st:lb"
|
|
||||||
dw2 = "st"
|
|
||||||
data = 1 * data + 5
|
|
||||||
}
|
|
||||||
if (dw == "6") {
|
|
||||||
dw1 = "lb"
|
|
||||||
dw2 = "lb"
|
|
||||||
}
|
|
||||||
if (num == "1") {
|
|
||||||
data = parseInt(value.substring(13, 18), 16) / 10
|
|
||||||
}
|
|
||||||
if (num == "2") {
|
|
||||||
data = parseInt(value.substring(13, 18), 16) / 100
|
|
||||||
}
|
|
||||||
if (num == "3") {
|
|
||||||
data = parseInt(value.substring(13, 18), 16) / 1000
|
|
||||||
}
|
|
||||||
if (typeInfo == "01") {
|
|
||||||
that.text = "您的实时体重是:" + data + dw1
|
|
||||||
}
|
|
||||||
if (typeInfo == "02") {
|
|
||||||
that.text = "您的体重是:" + data + dw1
|
|
||||||
that.weight = data + dw2
|
|
||||||
console.log("稳定体重:", value, that.weight)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (type == "11") {
|
|
||||||
if (typeInfo == "03") {
|
|
||||||
that.imp = parseInt(value.substring(17, 22), 16)
|
|
||||||
}
|
|
||||||
console.log("体脂:", that.imp)
|
|
||||||
}
|
|
||||||
if (type == "14") { //身高模式
|
|
||||||
that.height = parseInt(value.substring(10, 14), 16) / 10
|
|
||||||
that.type = 2
|
|
||||||
console.log("身高模式:", that.height)
|
|
||||||
}
|
|
||||||
if (type == "30") {
|
|
||||||
console.log("测量完成", that.weight, that.height, that.imp)
|
|
||||||
if (that.imp == 0) {
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: "体脂测量失败,是否保存本次测量结果?",
|
|
||||||
cancelText: "放弃",
|
|
||||||
confirmText: "保存",
|
|
||||||
success(res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
that.imp = 0
|
|
||||||
that.handleGetMeasure()
|
|
||||||
} else {
|
|
||||||
that.Unload = true
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
uni.navigateBack({
|
|
||||||
delta: 1
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
that.handleGetMeasure()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
fail(res) {
|
|
||||||
console.log("测量失败", res.value);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 保存测量结果
|
|
||||||
handleGetMeasure() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getmeasure({
|
|
||||||
weight: that.weight,
|
|
||||||
imp: that.imp,
|
|
||||||
ecode: that.macAddr,
|
|
||||||
height: that.height,
|
|
||||||
familyid: that.info.familyid,
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
that.$tools.msg("测量成功")
|
|
||||||
that.$store.dispatch("getUserInfo", {
|
|
||||||
familyid: that.info.familyid,
|
|
||||||
});
|
|
||||||
that.$store.dispatch("getResult", {
|
|
||||||
birthday: that.info.birthday,
|
|
||||||
familyid: that.info.familyid,
|
|
||||||
height: that.height,
|
|
||||||
sex: that.info.sex,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
console.log("测量失败", res.message)
|
|
||||||
that.$tools.msg(res.message)
|
|
||||||
}
|
|
||||||
that.Unload = true
|
|
||||||
setTimeout(function() {
|
|
||||||
that.closeBLEConnection()
|
that.closeBLEConnection()
|
||||||
that.closeBluetoothAdapter()
|
that.closeBluetoothAdapter()
|
||||||
uni.switchTab({
|
uni.navigateBack({
|
||||||
url: "/pages/index/index"
|
delta: 1
|
||||||
})
|
})
|
||||||
}, 200)
|
}
|
||||||
})
|
|
||||||
},
|
|
||||||
handleBack(ind) {
|
|
||||||
let that = this
|
|
||||||
that.text = ""
|
|
||||||
that.Unload = true
|
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
clearTimeout(myTime)
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 断开蓝牙模块
|
|
||||||
*/
|
|
||||||
closeBluetoothAdapter() {
|
|
||||||
let that = this;
|
|
||||||
uni.closeBluetoothAdapter({
|
|
||||||
success: res => {
|
|
||||||
console.log('蓝牙模块关闭成功');
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
} else {
|
||||||
/**
|
that.handleGetMeasure()
|
||||||
* 断开蓝牙连接
|
}
|
||||||
*/
|
}
|
||||||
closeBLEConnection() {
|
});
|
||||||
var that = this;
|
},
|
||||||
uni.closeBLEConnection({
|
fail(res) {
|
||||||
deviceId: that.deviceId,
|
console.log("测量失败", res.value);
|
||||||
success: res => {
|
}
|
||||||
console.log('断开蓝牙连接成功');
|
});
|
||||||
}
|
},
|
||||||
});
|
// 保存测量结果
|
||||||
},
|
handleGetMeasure() {
|
||||||
},
|
let that = this
|
||||||
}
|
that.$model.getmeasure({
|
||||||
|
weight: that.weight,
|
||||||
|
imp: that.imp,
|
||||||
|
ecode: that.macAddr,
|
||||||
|
height: that.height ? that.height : that.info.height,
|
||||||
|
familyid: that.info.familyid,
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
that.$tools.msg("测量成功")
|
||||||
|
that.$store.dispatch("getUserInfo", {
|
||||||
|
familyid: that.info.familyid,
|
||||||
|
});
|
||||||
|
that.$store.dispatch("getResult", {
|
||||||
|
birthday: that.info.birthday,
|
||||||
|
familyid: that.info.familyid,
|
||||||
|
height: that.height ? that.height : that.info.height,
|
||||||
|
sex: that.info.sex,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log("测量失败", res.message)
|
||||||
|
that.$tools.msg(res.message)
|
||||||
|
}
|
||||||
|
that.Unload = true
|
||||||
|
setTimeout(function() {
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
uni.switchTab({
|
||||||
|
url: "/pages/index/index"
|
||||||
|
})
|
||||||
|
}, 200)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleBack(ind) {
|
||||||
|
let that = this
|
||||||
|
that.text = ""
|
||||||
|
that.Unload = true
|
||||||
|
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
clearTimeout(myTime)
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 断开蓝牙模块
|
||||||
|
*/
|
||||||
|
closeBluetoothAdapter() {
|
||||||
|
let that = this;
|
||||||
|
uni.closeBluetoothAdapter({
|
||||||
|
success: res => {
|
||||||
|
console.log('蓝牙模块关闭成功');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 断开蓝牙连接
|
||||||
|
*/
|
||||||
|
closeBLEConnection() {
|
||||||
|
var that = this;
|
||||||
|
uni.closeBLEConnection({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
success: res => {
|
||||||
|
console.log('断开蓝牙连接成功');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,474 @@
|
||||||
|
<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="image">
|
||||||
|
<image src="/BLEPages/static/F018P01.gif"></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: "",
|
||||||
|
height: "",
|
||||||
|
weight: "",
|
||||||
|
imp: 0,
|
||||||
|
macAddr: "",
|
||||||
|
deviceId: "",
|
||||||
|
serviceId: "",
|
||||||
|
readId: "",
|
||||||
|
writeId: "",
|
||||||
|
notifyId: "",
|
||||||
|
isSend: true,
|
||||||
|
Unload: false,
|
||||||
|
devicesList: [],
|
||||||
|
isConnection: 0,
|
||||||
|
data01: {},
|
||||||
|
data02: {},
|
||||||
|
BLEResult: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user", "isConnected", "isBluetoothTyle", "appTheme"]),
|
||||||
|
info() {
|
||||||
|
return this.user
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onUnload: function() {
|
||||||
|
let that = this
|
||||||
|
if (!that.Unload) {
|
||||||
|
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||||
|
clearTimeout(myTime);
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
console.log("页面返回onUnload")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
let that = this
|
||||||
|
// 导航栏颜色
|
||||||
|
uni.setNavigationBarColor({
|
||||||
|
frontColor: '#ffffff',
|
||||||
|
backgroundColor: this.appTheme,
|
||||||
|
})
|
||||||
|
//
|
||||||
|
that.textW = ""
|
||||||
|
that.textH = ""
|
||||||
|
console.log("options", options)
|
||||||
|
if (options && options.deviceId) {
|
||||||
|
that.macAddr = options.deviceId
|
||||||
|
that.deviceId = options.deviceId
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
that.openBluetoothAdapter()
|
||||||
|
}
|
||||||
|
that.onBLEConnectionStateChange()
|
||||||
|
uni.onBluetoothAdapterStateChange(function(res) {
|
||||||
|
that.$store.commit("changeBluetooth", res.available);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 重新连接
|
||||||
|
openBluetoothAdapter() {
|
||||||
|
let that = this
|
||||||
|
that.isSend = true
|
||||||
|
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("蓝牙连接状态", JSON.stringify(res));
|
||||||
|
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) {
|
||||||
|
clearTimeout(myTime);
|
||||||
|
let buff = device.advertisData.slice(-6)
|
||||||
|
device.mac = new Uint8Array(buff) // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
|
||||||
|
let tempMac = Array.from(device.mac)
|
||||||
|
tempMac.reverse()
|
||||||
|
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
|
||||||
|
if (device.deviceId.indexOf(that.deviceId) != -1 || device.macAddr.indexOf(that.deviceId) != -1) {
|
||||||
|
that.stopBluetoothDevicesDiscovery()
|
||||||
|
that.deviceId = device.deviceId
|
||||||
|
that.macAddr = device.macAddr
|
||||||
|
const foundDevices = that.devicesList
|
||||||
|
const idx = that.$tools.inArray(foundDevices, "deviceId", device.deviceId)
|
||||||
|
if (idx === -1) {
|
||||||
|
that.devicesList.push(device);
|
||||||
|
} else {
|
||||||
|
that.devicesList[idx] = device
|
||||||
|
}
|
||||||
|
that.createBLEConnection()
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
that.handleMyTime()
|
||||||
|
},
|
||||||
|
handleMyTime() {
|
||||||
|
var that = this;
|
||||||
|
myTime = setTimeout(function() {
|
||||||
|
if (!that.macAddr) {
|
||||||
|
clearTimeout(myTime);
|
||||||
|
that.Unload = true
|
||||||
|
that.isConnection = 2
|
||||||
|
that.devicesList = []
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
}
|
||||||
|
}, 20000);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 停止搜索蓝牙设备
|
||||||
|
*/
|
||||||
|
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.devicesList)
|
||||||
|
that.devicesList[0].serviceId = that.serviceId
|
||||||
|
plugin.initPlugin(res.characteristics, that.devicesList[0])
|
||||||
|
uni.onBLECharacteristicValueChange((characteristic) => {
|
||||||
|
let bleData = plugin.parseBleData(characteristic.value)
|
||||||
|
let dw0 = "kg"
|
||||||
|
let data1 = {}
|
||||||
|
let data2 = {}
|
||||||
|
if (bleData.status == 0) {
|
||||||
|
let sex0 = that.info.sex == 1 ? 1 : 0
|
||||||
|
let sex = "0x0" + sex0.toString(16)
|
||||||
|
let age = "0x" + that.info.age.toString(16)
|
||||||
|
let height = "0x" + that.info.height.toString(16)
|
||||||
|
let arr = [0x01, parseInt(sex), parseInt(age), parseInt(height), 0x00]
|
||||||
|
console.log("指令发送成功", arr)
|
||||||
|
plugin.sendDataOfA7(arr)
|
||||||
|
console.log("握手成功")
|
||||||
|
} else if (bleData.status == 1) {
|
||||||
|
let payload = that.$tools.ab2hex(bleData.data, '')
|
||||||
|
let type = payload.substring(0, 2)
|
||||||
|
console.log("开始测量", payload)
|
||||||
|
if (type == "10" || type == "30" || type == "40") { //体脂模式
|
||||||
|
let data = parseInt(payload.substring(6, 12), 16)
|
||||||
|
let typeInfo = payload.substring(4, 6)
|
||||||
|
let num = payload.substring(12, 13)
|
||||||
|
let dw = payload.substring(13, 14)
|
||||||
|
if (dw == "1") {
|
||||||
|
dw0 = "jin"
|
||||||
|
}
|
||||||
|
if (num == "1") {
|
||||||
|
data = data / 10
|
||||||
|
}
|
||||||
|
if (num == "2") {
|
||||||
|
data = data / 100
|
||||||
|
}
|
||||||
|
if (num == "3") {
|
||||||
|
data = data / 1000
|
||||||
|
}
|
||||||
|
if (typeInfo == "01") {
|
||||||
|
that.textW = "您的实时体重是:" + data
|
||||||
|
}
|
||||||
|
if (typeInfo == "02") {
|
||||||
|
that.textW = "您的体重是:" + data
|
||||||
|
that.weight = data + dw0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type == "14" || type == "41") { //身高模式
|
||||||
|
let height = parseInt(payload.substring(4, 8), 16)
|
||||||
|
that.textH = "您的身高是:" + height + "cm"
|
||||||
|
that.height = height
|
||||||
|
console.log("身高模式:", that.height)
|
||||||
|
}
|
||||||
|
if (type == "11") { //阻抗模式
|
||||||
|
let typeInfo = payload.substring(4, 6)
|
||||||
|
if (typeInfo == "02") {
|
||||||
|
that.imp = 0
|
||||||
|
}
|
||||||
|
if (typeInfo == "04") {
|
||||||
|
that.imp = parseInt(payload.substring(8, 12), 16)
|
||||||
|
}
|
||||||
|
console.log("阻抗:", that.imp)
|
||||||
|
}
|
||||||
|
if (type == '15') {
|
||||||
|
let typeInfo = payload.substring(4, 6)
|
||||||
|
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 = Object.assign(that.data01, that.data02)
|
||||||
|
}
|
||||||
|
if (type == "80") { //测量结束
|
||||||
|
that.BLEResult.weight = that.weight
|
||||||
|
that.BLEResult.imp = that.imp ? that.imp : 0
|
||||||
|
that.BLEResult.ecode = that.macAddr
|
||||||
|
that.BLEResult.height = that.height ? that.height : that.info.height
|
||||||
|
that.BLEResult.familyid = that.info.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.getmeasuredata(data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
that.$store.dispatch("getUserInfo", {
|
||||||
|
familyid: that.info.familyid,
|
||||||
|
});
|
||||||
|
that.$store.dispatch("getResult", {
|
||||||
|
birthday: that.info.birthday,
|
||||||
|
familyid: that.info.familyid,
|
||||||
|
height: that.height ? that.height : that.info.height,
|
||||||
|
sex: that.info.sex,
|
||||||
|
});
|
||||||
|
that.$tools.msg("测量成功")
|
||||||
|
} else {
|
||||||
|
console.log("测量失败", res.message)
|
||||||
|
that.$tools.msg(res.message)
|
||||||
|
}
|
||||||
|
that.Unload = true
|
||||||
|
setTimeout(function() {
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
uni.switchTab({
|
||||||
|
url: "/pages/index/index"
|
||||||
|
})
|
||||||
|
}, 200)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 断开蓝牙模块
|
||||||
|
*/
|
||||||
|
closeBluetoothAdapter() {
|
||||||
|
let that = this;
|
||||||
|
uni.closeBluetoothAdapter({
|
||||||
|
success: res => {
|
||||||
|
console.log('蓝牙模块关闭成功');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleBack() {
|
||||||
|
let that = this
|
||||||
|
that.Unload = true
|
||||||
|
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 断开蓝牙连接
|
||||||
|
*/
|
||||||
|
closeBLEConnection() {
|
||||||
|
var that = this;
|
||||||
|
uni.closeBLEConnection({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
success: res => {
|
||||||
|
console.log('断开蓝牙连接成功');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
</style>
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user", "isConnected", "isBluetoothTyle"]),
|
...mapState(["user", "isConnected", "isBluetoothTyle","appTheme"]),
|
||||||
info() {
|
info() {
|
||||||
return this.user
|
return this.user
|
||||||
}
|
}
|
||||||
|
|
@ -74,12 +74,19 @@
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
|
// 导航栏颜色
|
||||||
|
uni.setNavigationBarColor({
|
||||||
|
frontColor: '#ffffff',
|
||||||
|
backgroundColor: this.appTheme,
|
||||||
|
})
|
||||||
|
//
|
||||||
that.textW = ""
|
that.textW = ""
|
||||||
that.textH = ""
|
that.textH = ""
|
||||||
if (options && options.deviceId) {
|
if (options && options.deviceId) {
|
||||||
that.macAddr = options.deviceId
|
|
||||||
that.deviceId = options.deviceId
|
that.deviceId = options.deviceId
|
||||||
that.createBLEConnection()
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
that.openBluetoothAdapter()
|
||||||
}
|
}
|
||||||
that.onBLEConnectionStateChange()
|
that.onBLEConnectionStateChange()
|
||||||
uni.onBluetoothAdapterStateChange(function(res) {
|
uni.onBluetoothAdapterStateChange(function(res) {
|
||||||
|
|
@ -139,22 +146,26 @@
|
||||||
var that = this;
|
var that = this;
|
||||||
that.isConnection = 0
|
that.isConnection = 0
|
||||||
uni.onBluetoothDeviceFound(res => {
|
uni.onBluetoothDeviceFound(res => {
|
||||||
console.log('开始监听寻找到新设备的事件', res);
|
|
||||||
res.devices.forEach(device => {
|
res.devices.forEach(device => {
|
||||||
if (!device.name && !device.localName) {
|
if (!device.name && !device.localName) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (device.deviceId.indexOf(that.deviceId) != -1) {
|
console.log('开始监听寻找到新设备的事件', device);
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
if (device.name.indexOf('My') != -1) {
|
||||||
clearTimeout(myTime);
|
clearTimeout(myTime);
|
||||||
let buff = device.advertisData.slice(-6)
|
let buff = device.advertisData.slice(-6)
|
||||||
device.mac = new Uint8Array(buff) // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
|
device.mac = new Uint8Array(buff) // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
|
||||||
let tempMac = Array.from(device.mac)
|
let tempMac = Array.from(device.mac)
|
||||||
|
console.log('开始监听寻找到新设备的事件0', device)
|
||||||
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
|
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
|
||||||
that.deviceId = device.macAddr
|
if (device.deviceId.indexOf(that.deviceId) != -1 || device.macAddr.indexOf(that.deviceId) != -1) {
|
||||||
that.macAddr = device.macAddr
|
console.log('开始监听寻找到新设备的事件1', that.deviceId)
|
||||||
that.createBLEConnection()
|
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||||
return;
|
that.deviceId = device.deviceId
|
||||||
|
that.macAddr = device.macAddr
|
||||||
|
that.createBLEConnection()
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,448 +1,457 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="content weightPages">
|
<view class="content weightPages">
|
||||||
<view class="title" v-if="isConnection == 0">连接中,请稍后</view>
|
<view class="title" v-if="isConnection == 0">连接中,请稍后</view>
|
||||||
<view class="title" v-if="isConnection == 1">连接成功,请开始测量</view>
|
<view class="title" v-if="isConnection == 1">连接成功,请开始测量</view>
|
||||||
<view class="title" v-if="isConnection == 2" @click="openBluetoothAdapter">连接失败,点击重新连接</view>
|
<view class="title" v-if="isConnection == 2" @click="openBluetoothAdapter">连接失败,点击重新连接</view>
|
||||||
<view class="text">{{text}}</view>
|
<view class="text">{{text}}</view>
|
||||||
<view class="text">{{textH}}</view>
|
<view class="text">{{textH}}</view>
|
||||||
<view class="image">
|
<view class="image">
|
||||||
<image src="/BLEPages/static/H09B.gif" v-if="type == 1"></image>
|
<image src="/BLEPages/static/H09B.gif" v-if="type == 1"></image>
|
||||||
<image src="/BLEPages/static/H09B2.gif" v-if="type == 2"></image>
|
<image src="/BLEPages/static/H09B2.gif" v-if="type == 2"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="tips">
|
<view class="tips">
|
||||||
<text>提示:</text>
|
<text>提示:</text>
|
||||||
<text>1.请确定设备是开机状态</text>
|
<text>1.请确定设备是开机状态</text>
|
||||||
<text>2.请确定手机蓝牙、位置信息已打开</text>
|
<text>2.请确定手机蓝牙、位置信息已打开</text>
|
||||||
<text>3.ios系统需打开设置—>应用—>微信里的蓝牙权限</text>
|
<text>3.ios系统需打开设置—>应用—>微信里的蓝牙权限</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
var myTime;
|
var myTime;
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
text: "",
|
text: "",
|
||||||
textH: "",
|
textH: "",
|
||||||
height: "",
|
height: "",
|
||||||
weight: "",
|
weight: "",
|
||||||
imp: 0,
|
imp: 0,
|
||||||
type: 1,
|
type: 1,
|
||||||
uuid1: "",
|
uuid1: "",
|
||||||
uuid2: "",
|
uuid2: "",
|
||||||
uuid3: "",
|
uuid3: "",
|
||||||
macAddr: "",
|
macAddr: "",
|
||||||
deviceId: "",
|
deviceId: "",
|
||||||
serviceId: "",
|
serviceId: "",
|
||||||
Unload: false,
|
Unload: false,
|
||||||
isConnection: 0, //是否连接成功
|
isConnection: 0, //是否连接成功
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user", "isConnected", "isBluetoothTyle", "appTheme"]),
|
||||||
|
info() {
|
||||||
|
return this.user
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onUnload: function() {
|
||||||
|
let that = this
|
||||||
|
if (!that.Unload) {
|
||||||
|
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||||
|
clearTimeout(myTime);
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
let that = this
|
||||||
|
// 导航栏颜色
|
||||||
|
uni.setNavigationBarColor({
|
||||||
|
frontColor: '#ffffff',
|
||||||
|
backgroundColor: this.appTheme,
|
||||||
|
})
|
||||||
|
//
|
||||||
|
that.text = ""
|
||||||
|
that.textH = ""
|
||||||
|
that.imp = 0
|
||||||
|
if (options && options.deviceId) {
|
||||||
|
that.deviceId = options.deviceId
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
that.openBluetoothAdapter()
|
||||||
|
}
|
||||||
|
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
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isBluetoothTyle: function() {
|
||||||
|
let that = this
|
||||||
|
if (!that.isBluetoothTyle) {
|
||||||
|
that.handleBack()
|
||||||
|
that.isConnection = 2
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 初始化蓝牙
|
||||||
|
openBluetoothAdapter() {
|
||||||
|
let that = this
|
||||||
|
that.type = 1
|
||||||
|
uni.openBluetoothAdapter({
|
||||||
|
success: e => {
|
||||||
|
that.isConnection = 0
|
||||||
|
that.startBluetoothDeviceDiscovery()
|
||||||
|
},
|
||||||
|
fail: e => {
|
||||||
|
that.isConnection = 2
|
||||||
|
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 开始搜寻附近的蓝牙外围设备
|
||||||
|
startBluetoothDeviceDiscovery() {
|
||||||
|
let that = this
|
||||||
|
uni.startBluetoothDevicesDiscovery({
|
||||||
|
allowDuplicatesKey: false,
|
||||||
|
interval: 500, //上报设备的间隔
|
||||||
|
services: [
|
||||||
|
"FFE0",
|
||||||
|
],
|
||||||
|
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) {
|
||||||
computed: {
|
clearTimeout(myTime);
|
||||||
...mapState(["user", "isConnected", "isBluetoothTyle"]),
|
let buff = device.advertisData.slice(-6)
|
||||||
info() {
|
device.mac = new Uint8Array(buff) // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
|
||||||
return this.user
|
let tempMac = Array.from(device.mac)
|
||||||
}
|
tempMac.reverse()
|
||||||
},
|
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
|
||||||
onUnload: function() {
|
if (device.deviceId.indexOf(that.deviceId) != -1 || device.macAddr.indexOf(that.deviceId) != -1) {
|
||||||
let that = this
|
that.stopBluetoothDevicesDiscovery()
|
||||||
if (!that.Unload) {
|
that.macAddr = device.macAddr
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
that.deviceId = device.deviceId;
|
||||||
clearTimeout(myTime);
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
let that = this
|
|
||||||
that.text = ""
|
|
||||||
that.textH = ""
|
|
||||||
that.imp = 0
|
|
||||||
if (options && options.deviceId) {
|
|
||||||
that.macAddr = options.deviceId
|
|
||||||
that.deviceId = options.deviceId
|
|
||||||
that.createBLEConnection()
|
that.createBLEConnection()
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
that.onBLEConnectionStateChange()
|
})
|
||||||
uni.onBluetoothAdapterStateChange(function(res) {
|
});
|
||||||
that.$store.commit("changeBluetooth", res.available);
|
that.handleMyTime()
|
||||||
|
},
|
||||||
|
handleMyTime() {
|
||||||
|
var that = this;
|
||||||
|
myTime = setTimeout(function() {
|
||||||
|
if (!that.macAddr) {
|
||||||
|
clearTimeout(myTime);
|
||||||
|
that.Unload = true
|
||||||
|
that.isConnection = 2
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
}
|
||||||
|
}, 20000);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 停止搜索蓝牙设备
|
||||||
|
*/
|
||||||
|
stopBluetoothDevicesDiscovery() {
|
||||||
|
uni.stopBluetoothDevicesDiscovery({
|
||||||
|
success: e => {
|
||||||
|
console.log("停止搜索蓝牙设备", e)
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 监听蓝牙连接状态
|
||||||
|
onBLEConnectionStateChange() {
|
||||||
|
let that = this
|
||||||
|
uni.onBLEConnectionStateChange(function(res) {
|
||||||
|
console.log("监听蓝牙连接状态", res.connected)
|
||||||
|
if (!res.connected) {
|
||||||
|
that.Unload = true
|
||||||
|
that.isConnection = 2
|
||||||
|
clearTimeout(myTime);
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
}
|
||||||
|
that.$store.commit("changeConnected", res.connected);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 连接蓝牙
|
||||||
|
createBLEConnection() {
|
||||||
|
let that = this;
|
||||||
|
uni.createBLEConnection({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
success: 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.isConnection = 1
|
||||||
|
that.serviceId = service.uuid;
|
||||||
|
that.getBLEDeviceCharacteristics();
|
||||||
|
console.log("设备的FFE0的serviceId: " + that.serviceId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
console.log('获取设备的UUID失败:', res)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取指定服务的特征值
|
||||||
|
*/
|
||||||
|
getBLEDeviceCharacteristics() {
|
||||||
|
let characteristicsList = [];
|
||||||
|
let that = this;
|
||||||
|
uni.getBLEDeviceCharacteristics({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
serviceId: that.serviceId,
|
||||||
|
success: res => {
|
||||||
|
console.log("服务的特征值成功", res)
|
||||||
|
for (let i = 0; i < res.characteristics.length; i++) {
|
||||||
|
let item = res.characteristics[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.sendData()
|
||||||
|
uni.notifyBLECharacteristicValueChange({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
serviceId: that.serviceId,
|
||||||
|
characteristicId: that.uuid2,
|
||||||
|
state: true,
|
||||||
})
|
})
|
||||||
},
|
uni.notifyBLECharacteristicValueChange({
|
||||||
watch: {
|
deviceId: that.deviceId,
|
||||||
isConnected: function() {
|
serviceId: that.serviceId,
|
||||||
let that = this
|
characteristicId: that.uuid3,
|
||||||
if (!that.isConnected) {
|
state: true,
|
||||||
that.handleBack()
|
})
|
||||||
that.isConnection = 2
|
uni.onBLECharacteristicValueChange(function(res) {
|
||||||
|
let value = that.$tools.ab2hex(res.value, "");
|
||||||
|
let num = value.substring(18, 19)
|
||||||
|
let dw = value.substring(19, 20)
|
||||||
|
let type = value.substring(8, 10)
|
||||||
|
let typeInfo = value.substring(10, 12)
|
||||||
|
if (type == "10") {
|
||||||
|
let data = parseInt(value.substring(13, 18), 16)
|
||||||
|
let dw1 = "kg"
|
||||||
|
let dw2 = "kg"
|
||||||
|
if (dw == "1") {
|
||||||
|
dw1 = "斤"
|
||||||
|
dw2 = "jin"
|
||||||
}
|
}
|
||||||
},
|
if (dw == "4") {
|
||||||
isBluetoothTyle: function() {
|
dw1 = "st:lb"
|
||||||
let that = this
|
dw2 = "st"
|
||||||
if (!that.isBluetoothTyle) {
|
data = 1 * data + 5
|
||||||
that.handleBack()
|
|
||||||
that.isConnection = 2
|
|
||||||
}
|
}
|
||||||
},
|
if (dw == "6") {
|
||||||
},
|
dw1 = "lb"
|
||||||
methods: {
|
dw2 = "lb"
|
||||||
// 初始化蓝牙
|
}
|
||||||
openBluetoothAdapter() {
|
if (num == "1") {
|
||||||
let that = this
|
data = parseInt(value.substring(13, 18), 16) / 10
|
||||||
that.type = 1
|
}
|
||||||
uni.openBluetoothAdapter({
|
if (num == "2") {
|
||||||
success: e => {
|
data = parseInt(value.substring(13, 18), 16) / 100
|
||||||
that.isConnection = 0
|
}
|
||||||
that.startBluetoothDeviceDiscovery()
|
if (num == "3") {
|
||||||
},
|
data = parseInt(value.substring(13, 18), 16) / 1000
|
||||||
fail: e => {
|
}
|
||||||
that.isConnection = 2
|
if (typeInfo == "01") {
|
||||||
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
|
that.text = "您的实时体重是:" + data + dw1
|
||||||
}
|
}
|
||||||
});
|
if (typeInfo == "02") {
|
||||||
},
|
that.text = "您的体重是:" + data + dw1
|
||||||
// 开始搜寻附近的蓝牙外围设备
|
that.weight = data + dw2
|
||||||
startBluetoothDeviceDiscovery() {
|
console.log("稳定体重:", value, that.weight)
|
||||||
let that = this
|
}
|
||||||
uni.startBluetoothDevicesDiscovery({
|
}
|
||||||
allowDuplicatesKey: false,
|
if (type == "14") {
|
||||||
interval: 500, //上报设备的间隔
|
that.height = parseInt(value.substring(10, 14), 16) / 10
|
||||||
services: [
|
that.textH = "您的身高是:" + that.height + "cm"
|
||||||
"FFE0",
|
that.type = 2
|
||||||
],
|
console.log("稳定身高:", that.height)
|
||||||
success: res => {
|
}
|
||||||
that.isConnection = 0
|
if (type == "11") {
|
||||||
that.onBluetoothDeviceFound();
|
if (typeInfo == "03" || typeInfo == "04") {
|
||||||
},
|
that.imp = parseInt(value.substring(17, 22), 16)
|
||||||
fail: res => {
|
}
|
||||||
that.isConnection = 2
|
console.log("阻抗:", typeInfo, parseInt(value.substring(17, 22), 16))
|
||||||
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!")
|
}
|
||||||
}
|
if (type == "30") {
|
||||||
});
|
console.log("测量完成", that.weight, that.imp, that.height)
|
||||||
},
|
if (that.imp == 0) {
|
||||||
/**
|
uni.showModal({
|
||||||
* 发现外围设备
|
title: '提示',
|
||||||
*/
|
content: "体脂测量失败,是否保存本次测量结果?",
|
||||||
onBluetoothDeviceFound() {
|
cancelText: "放弃",
|
||||||
var that = this;
|
confirmText: "保存",
|
||||||
that.isConnection = 0
|
success(res) {
|
||||||
uni.onBluetoothDeviceFound(res => {
|
if (res.confirm) {
|
||||||
res.devices.forEach(device => {
|
that.imp = 0
|
||||||
if (!device.name && !device.localName) {
|
that.handleGetMeasure()
|
||||||
return
|
} else {
|
||||||
}
|
console.log("放弃保存")
|
||||||
if (device.deviceId.indexOf(that.deviceId) != -1) {
|
|
||||||
that.stopBluetoothDevicesDiscovery()
|
|
||||||
clearTimeout(myTime);
|
|
||||||
let buff = device.advertisData.slice(-6)
|
|
||||||
device.mac = new Uint8Array(buff) // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
|
|
||||||
let tempMac = Array.from(device.mac)
|
|
||||||
tempMac.reverse()
|
|
||||||
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
|
|
||||||
that.macAddr = device.macAddr
|
|
||||||
that.deviceId = device.deviceId;
|
|
||||||
that.createBLEConnection()
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
that.handleMyTime()
|
|
||||||
},
|
|
||||||
handleMyTime() {
|
|
||||||
var that = this;
|
|
||||||
myTime = setTimeout(function() {
|
|
||||||
if (!that.macAddr) {
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.Unload = true
|
that.Unload = true
|
||||||
that.isConnection = 2
|
|
||||||
that.closeBLEConnection()
|
that.closeBLEConnection()
|
||||||
that.closeBluetoothAdapter()
|
that.closeBluetoothAdapter()
|
||||||
}
|
uni.navigateBack({
|
||||||
}, 20000);
|
delta: 1
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 停止搜索蓝牙设备
|
|
||||||
*/
|
|
||||||
stopBluetoothDevicesDiscovery() {
|
|
||||||
uni.stopBluetoothDevicesDiscovery({
|
|
||||||
success: e => {
|
|
||||||
console.log("停止搜索蓝牙设备", e)
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 监听蓝牙连接状态
|
|
||||||
onBLEConnectionStateChange() {
|
|
||||||
let that = this
|
|
||||||
uni.onBLEConnectionStateChange(function(res) {
|
|
||||||
console.log("监听蓝牙连接状态", res.connected)
|
|
||||||
if (!res.connected) {
|
|
||||||
that.Unload = true
|
|
||||||
that.isConnection = 2
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
}
|
|
||||||
that.$store.commit("changeConnected", res.connected);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 连接蓝牙
|
|
||||||
createBLEConnection() {
|
|
||||||
let that = this;
|
|
||||||
uni.createBLEConnection({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: 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.isConnection = 1
|
|
||||||
that.serviceId = service.uuid;
|
|
||||||
that.getBLEDeviceCharacteristics();
|
|
||||||
console.log("设备的FFE0的serviceId: " + that.serviceId);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
console.log('获取设备的UUID失败:', res)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 获取指定服务的特征值
|
|
||||||
*/
|
|
||||||
getBLEDeviceCharacteristics() {
|
|
||||||
let characteristicsList = [];
|
|
||||||
let that = this;
|
|
||||||
uni.getBLEDeviceCharacteristics({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
serviceId: that.serviceId,
|
|
||||||
success: res => {
|
|
||||||
console.log("服务的特征值成功", res)
|
|
||||||
for (let i = 0; i < res.characteristics.length; i++) {
|
|
||||||
let item = res.characteristics[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.sendData()
|
|
||||||
uni.notifyBLECharacteristicValueChange({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
serviceId: that.serviceId,
|
|
||||||
characteristicId: that.uuid2,
|
|
||||||
state: true,
|
|
||||||
})
|
})
|
||||||
uni.notifyBLECharacteristicValueChange({
|
}
|
||||||
deviceId: that.deviceId,
|
|
||||||
serviceId: that.serviceId,
|
|
||||||
characteristicId: that.uuid3,
|
|
||||||
state: true,
|
|
||||||
})
|
|
||||||
uni.onBLECharacteristicValueChange(function(res) {
|
|
||||||
let value = that.$tools.ab2hex(res.value, "");
|
|
||||||
let num = value.substring(18, 19)
|
|
||||||
let dw = value.substring(19, 20)
|
|
||||||
let type = value.substring(8, 10)
|
|
||||||
let typeInfo = value.substring(10, 12)
|
|
||||||
if (type == "10") {
|
|
||||||
let data = parseInt(value.substring(13, 18), 16)
|
|
||||||
let dw1 = "kg"
|
|
||||||
let dw2 = "kg"
|
|
||||||
if (dw == "1") {
|
|
||||||
dw1 = "斤"
|
|
||||||
dw2 = "jin"
|
|
||||||
}
|
|
||||||
if (dw == "4") {
|
|
||||||
dw1 = "st:lb"
|
|
||||||
dw2 = "st"
|
|
||||||
data = 1 * data + 5
|
|
||||||
}
|
|
||||||
if (dw == "6") {
|
|
||||||
dw1 = "lb"
|
|
||||||
dw2 = "lb"
|
|
||||||
}
|
|
||||||
if (num == "1") {
|
|
||||||
data = parseInt(value.substring(13, 18), 16) / 10
|
|
||||||
}
|
|
||||||
if (num == "2") {
|
|
||||||
data = parseInt(value.substring(13, 18), 16) / 100
|
|
||||||
}
|
|
||||||
if (num == "3") {
|
|
||||||
data = parseInt(value.substring(13, 18), 16) / 1000
|
|
||||||
}
|
|
||||||
if (typeInfo == "01") {
|
|
||||||
that.text = "您的实时体重是:" + data + dw1
|
|
||||||
}
|
|
||||||
if (typeInfo == "02") {
|
|
||||||
that.text = "您的体重是:" + data + dw1
|
|
||||||
that.weight = data + dw2
|
|
||||||
console.log("稳定体重:", value, that.weight)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (type == "14") {
|
|
||||||
that.height = parseInt(value.substring(10, 14), 16) / 10
|
|
||||||
that.textH = "您的身高是:" + that.height + "cm"
|
|
||||||
that.type = 2
|
|
||||||
console.log("稳定身高:", that.height)
|
|
||||||
}
|
|
||||||
if (type == "11") {
|
|
||||||
if (typeInfo == "03" || typeInfo == "04") {
|
|
||||||
that.imp = parseInt(value.substring(17, 22), 16)
|
|
||||||
}
|
|
||||||
console.log("阻抗:", typeInfo, parseInt(value.substring(17, 22), 16))
|
|
||||||
}
|
|
||||||
if (type == "30") {
|
|
||||||
console.log("测量完成", that.weight, that.imp, that.height)
|
|
||||||
if (that.imp == 0) {
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: "体脂测量失败,是否保存本次测量结果?",
|
|
||||||
cancelText: "放弃",
|
|
||||||
confirmText: "保存",
|
|
||||||
success(res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
that.imp = 0
|
|
||||||
that.handleGetMeasure()
|
|
||||||
} else {
|
|
||||||
console.log("放弃保存")
|
|
||||||
that.Unload = true
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
uni.navigateBack({
|
|
||||||
delta: 1
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
that.handleGetMeasure()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
console.log('获取特征值失败:', JSON.stringify(res))
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
} else {
|
||||||
// 身高体重体脂模式
|
that.handleGetMeasure()
|
||||||
sendData() {
|
}
|
||||||
let that = this
|
}
|
||||||
let j = Number(26 + 3 + 6 + 1).toString(16)
|
});
|
||||||
let str = "A9002603060100" + j.substr(j.length - 2, 2) + "9A"
|
},
|
||||||
let buf = new Uint8Array(str.match(/[\da-f]{2}/gi).map(function(h) {
|
fail: res => {
|
||||||
return parseInt(h, 16)
|
console.log('获取特征值失败:', JSON.stringify(res))
|
||||||
}))
|
}
|
||||||
uni.writeBLECharacteristicValue({
|
})
|
||||||
deviceId: that.deviceId,
|
},
|
||||||
serviceId: that.serviceId,
|
// 身高体重体脂模式
|
||||||
characteristicId: that.uuid1,
|
sendData() {
|
||||||
value: buf.buffer,
|
let that = this
|
||||||
success: res => {
|
let j = Number(26 + 3 + 6 + 1).toString(16)
|
||||||
console.log('下发指令成功', res.errMsg)
|
let str = "A9002603060100" + j.substr(j.length - 2, 2) + "9A"
|
||||||
},
|
let buf = new Uint8Array(str.match(/[\da-f]{2}/gi).map(function(h) {
|
||||||
fail: res => {
|
return parseInt(h, 16)
|
||||||
console.log("下发指令失败", res);
|
}))
|
||||||
},
|
uni.writeBLECharacteristicValue({
|
||||||
})
|
deviceId: that.deviceId,
|
||||||
},
|
serviceId: that.serviceId,
|
||||||
// 保存测量结果
|
characteristicId: that.uuid1,
|
||||||
handleGetMeasure() {
|
value: buf.buffer,
|
||||||
let that = this
|
success: res => {
|
||||||
that.$model.getmeasure({
|
console.log('下发指令成功', res.errMsg)
|
||||||
weight: that.weight,
|
},
|
||||||
imp: that.imp,
|
fail: res => {
|
||||||
ecode: that.macAddr,
|
console.log("下发指令失败", res);
|
||||||
height: that.height,
|
},
|
||||||
familyid: that.info.familyid,
|
})
|
||||||
}).then(res => {
|
},
|
||||||
if (res.code == 0) {
|
// 保存测量结果
|
||||||
that.$store.dispatch("getUserInfo", {
|
handleGetMeasure() {
|
||||||
familyid: that.info.familyid,
|
let that = this
|
||||||
});
|
that.$model.getmeasure({
|
||||||
that.$store.dispatch("getResult", {
|
weight: that.weight,
|
||||||
birthday: that.info.birthday,
|
imp: that.imp,
|
||||||
familyid: that.info.familyid,
|
ecode: that.macAddr,
|
||||||
height: that.height,
|
height: that.height,
|
||||||
sex: that.info.sex,
|
familyid: that.info.familyid,
|
||||||
});
|
}).then(res => {
|
||||||
that.$tools.msg("测量成功")
|
if (res.code == 0) {
|
||||||
} else {
|
that.$store.dispatch("getUserInfo", {
|
||||||
console.log("测量失败", res.message)
|
familyid: that.info.familyid,
|
||||||
that.$tools.msg(res.message)
|
});
|
||||||
}
|
that.$store.dispatch("getResult", {
|
||||||
that.Unload = true
|
birthday: that.info.birthday,
|
||||||
setTimeout(function() {
|
familyid: that.info.familyid,
|
||||||
that.closeBLEConnection()
|
height: that.height,
|
||||||
that.closeBluetoothAdapter()
|
sex: that.info.sex,
|
||||||
uni.switchTab({
|
});
|
||||||
url: "/pages/index/index"
|
that.$tools.msg("测量成功")
|
||||||
})
|
} else {
|
||||||
}, 200)
|
console.log("测量失败", res.message)
|
||||||
})
|
that.$tools.msg(res.message)
|
||||||
},
|
}
|
||||||
handleBack(ind) {
|
that.Unload = true
|
||||||
let that = this
|
setTimeout(function() {
|
||||||
that.text = ""
|
that.closeBLEConnection()
|
||||||
that.textH = ""
|
that.closeBluetoothAdapter()
|
||||||
that.Unload = true
|
uni.switchTab({
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
url: "/pages/index/index"
|
||||||
that.closeBLEConnection()
|
})
|
||||||
that.closeBluetoothAdapter()
|
}, 200)
|
||||||
},
|
})
|
||||||
/**
|
},
|
||||||
* 断开蓝牙模块
|
handleBack(ind) {
|
||||||
*/
|
let that = this
|
||||||
closeBluetoothAdapter() {
|
that.text = ""
|
||||||
let that = this;
|
that.textH = ""
|
||||||
uni.closeBluetoothAdapter({
|
that.Unload = true
|
||||||
success: res => {
|
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||||
console.log('蓝牙模块关闭成功');
|
that.closeBLEConnection()
|
||||||
}
|
that.closeBluetoothAdapter()
|
||||||
})
|
},
|
||||||
},
|
/**
|
||||||
/**
|
* 断开蓝牙模块
|
||||||
* 断开蓝牙连接
|
*/
|
||||||
*/
|
closeBluetoothAdapter() {
|
||||||
closeBLEConnection() {
|
let that = this;
|
||||||
var that = this;
|
uni.closeBluetoothAdapter({
|
||||||
uni.closeBLEConnection({
|
success: res => {
|
||||||
deviceId: that.deviceId,
|
console.log('蓝牙模块关闭成功');
|
||||||
success: res => {
|
}
|
||||||
console.log('断开蓝牙连接成功');
|
})
|
||||||
}
|
},
|
||||||
});
|
/**
|
||||||
},
|
* 断开蓝牙连接
|
||||||
},
|
*/
|
||||||
}
|
closeBLEConnection() {
|
||||||
|
var that = this;
|
||||||
|
uni.closeBLEConnection({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
success: res => {
|
||||||
|
console.log('断开蓝牙连接成功');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user", "isConnected", "isBluetoothTyle"]),
|
...mapState(["user", "isConnected", "isBluetoothTyle","appTheme"]),
|
||||||
info() {
|
info() {
|
||||||
return this.user
|
return this.user
|
||||||
}
|
}
|
||||||
|
|
@ -62,6 +62,12 @@
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
|
// 导航栏颜色
|
||||||
|
uni.setNavigationBarColor({
|
||||||
|
frontColor: '#ffffff',
|
||||||
|
backgroundColor: this.appTheme,
|
||||||
|
})
|
||||||
|
//
|
||||||
cnt = 0
|
cnt = 0
|
||||||
that.text = ""
|
that.text = ""
|
||||||
if (options && options.deviceId) {
|
if (options && options.deviceId) {
|
||||||
|
|
@ -137,18 +143,20 @@
|
||||||
if (!device.name && !device.localName) {
|
if (!device.name && !device.localName) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (device.deviceId.indexOf(that.deviceId) != -1) {
|
if (device.name.indexOf('AiLink_') != -1) {
|
||||||
that.stopBluetoothDevicesDiscovery()
|
|
||||||
clearTimeout(myTime);
|
clearTimeout(myTime);
|
||||||
let buff = device.advertisData.slice(-6)
|
let buff = device.advertisData.slice(-6)
|
||||||
device.mac = new Uint8Array(buff) // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
|
device.mac = new Uint8Array(buff) // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
|
||||||
let tempMac = Array.from(device.mac)
|
let tempMac = Array.from(device.mac)
|
||||||
tempMac.reverse()
|
tempMac.reverse()
|
||||||
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
|
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
|
||||||
that.macAddr = device.macAddr
|
if (device.deviceId.indexOf(that.deviceId) != -1 || device.macAddr.indexOf(that.deviceId) != -1) {
|
||||||
that.deviceId = device.deviceId;
|
that.stopBluetoothDevicesDiscovery()
|
||||||
that.createBLEConnection()
|
that.macAddr = device.macAddr
|
||||||
return;
|
that.deviceId = device.deviceId;
|
||||||
|
that.createBLEConnection()
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user", "isConnected", "isBluetoothTyle"]),
|
...mapState(["user", "isConnected", "isBluetoothTyle","appTheme"]),
|
||||||
info() {
|
info() {
|
||||||
return this.user
|
return this.user
|
||||||
}
|
}
|
||||||
|
|
@ -57,10 +57,15 @@
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
|
// 导航栏颜色
|
||||||
|
uni.setNavigationBarColor({
|
||||||
|
frontColor: '#ffffff',
|
||||||
|
backgroundColor: this.appTheme,
|
||||||
|
})
|
||||||
|
//
|
||||||
that.text = ""
|
that.text = ""
|
||||||
if (options && options.deviceId) {
|
if (options && options.deviceId) {
|
||||||
that.deviceId = options.deviceId
|
that.deviceId = options.deviceId
|
||||||
console.log(0)
|
|
||||||
that.openBluetoothAdapter()
|
that.openBluetoothAdapter()
|
||||||
}
|
}
|
||||||
uni.onBluetoothAdapterStateChange(function(res) {
|
uni.onBluetoothAdapterStateChange(function(res) {
|
||||||
|
|
|
||||||
|
|
@ -310,7 +310,7 @@
|
||||||
|
|
||||||
.add {
|
.add {
|
||||||
margin: 15px;
|
margin: 15px;
|
||||||
background: $greencolor;
|
background: $btncolor;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
@ -1161,7 +1161,8 @@
|
||||||
.title {
|
.title {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 15px;
|
height: 45px;
|
||||||
|
line-height: 45px;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,146 +1,146 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="wrapper" v-if="isDrawe">
|
<view class="wrapper" v-if="isDrawe">
|
||||||
<view class="bg" @click="clear"></view>
|
<view class="bg" @click="clear"></view>
|
||||||
<view class="wrapper_box">
|
<view class="wrapper_box">
|
||||||
<view class="top">
|
<view class="top" :style="{background:appTheme}">
|
||||||
<image class="headimage mt-10" v-if="userinfo.headimg" :src="userinfo.headimg"></image>
|
<image class="headimage mt-10" v-if="userinfo.headimg" :src="userinfo.headimg"></image>
|
||||||
<view class="overflow">{{userinfo.nickname||userinfo.name}}</view>
|
<view class="overflow">{{userinfo.nickname||userinfo.name}}</view>
|
||||||
</view>
|
|
||||||
<view class="drawerList">
|
|
||||||
<view v-if="List.length">
|
|
||||||
<view class="drawerList_item" v-for="(item, index) in List" :key="index" @click="toggle(item)">
|
|
||||||
<image v-if="item.headimg" :src="item.headimg" class="image1"></image>
|
|
||||||
<view class="right">
|
|
||||||
<view class="name">
|
|
||||||
<view class="overflow">
|
|
||||||
{{item.name}}
|
|
||||||
</view>
|
|
||||||
<view class="dangqian" v-if="item.id == userinfo.familyid">当前</view>
|
|
||||||
</view>
|
|
||||||
<view class="info">
|
|
||||||
<view>{{item.mage}}</view>
|
|
||||||
<view>{{item.sex==0?'未知':item.sex==1?'男':'女'}}</view>
|
|
||||||
<view>{{item.type}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="add">
|
|
||||||
<view @click="addInfo('add')">
|
|
||||||
+
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
<view class="drawerList">
|
||||||
|
<view v-if="List.length">
|
||||||
|
<view class="drawerList_item" v-for="(item, index) in List" :key="index" @click="toggle(item)">
|
||||||
|
<image v-if="item.headimg" :src="item.headimg" class="image1"></image>
|
||||||
|
<view class="right">
|
||||||
|
<view class="name">
|
||||||
|
<view class="overflow">
|
||||||
|
{{item.name}}
|
||||||
|
</view>
|
||||||
|
<view class="dangqian" v-if="item.id == userinfo.familyid">当前</view>
|
||||||
|
</view>
|
||||||
|
<view class="info">
|
||||||
|
<view>{{item.mage}}</view>
|
||||||
|
<view>{{item.sex==0?'未知':item.sex==1?'男':'女'}}</view>
|
||||||
|
<view>{{item.type}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="add">
|
||||||
|
<view @click="addInfo('add')">
|
||||||
|
+
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user", "familayList", "isDrawe"]),
|
...mapState(["user", "familayList", "isDrawe", "appTheme"]),
|
||||||
userinfo() {
|
userinfo() {
|
||||||
return this.user
|
return this.user
|
||||||
},
|
},
|
||||||
List() {
|
List() {
|
||||||
return this.familayList
|
return this.familayList
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 切换用户
|
// 切换用户
|
||||||
toggle(val) {
|
toggle(val) {
|
||||||
let that = this
|
let that = this
|
||||||
uni.setStorageSync('familyid', val.familyid)
|
uni.setStorageSync('familyid', val.familyid)
|
||||||
that.$store.dispatch("getResult", {
|
that.$store.dispatch("getResult", {
|
||||||
birthday: val.birthday,
|
birthday: val.birthday,
|
||||||
familyid: val.familyid,
|
familyid: val.familyid,
|
||||||
height: val.height,
|
height: val.height,
|
||||||
sex: val.sex,
|
sex: val.sex,
|
||||||
});
|
});
|
||||||
that.$store.dispatch("getUserInfo", {
|
that.$store.dispatch("getUserInfo", {
|
||||||
familyid: val.familyid,
|
familyid: val.familyid,
|
||||||
});
|
});
|
||||||
that.$store.commit("changeDrawe", false);
|
that.$store.commit("changeDrawe", false);
|
||||||
},
|
},
|
||||||
//添加
|
//添加
|
||||||
addInfo(type) {
|
addInfo(type) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pageTwo/me/adduser?type=" + type
|
url: "/pageTwo/me/adduser?type=" + type
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
clear() {
|
clear() {
|
||||||
this.$store.commit("changeDrawe", false);
|
this.$store.commit("changeDrawe", false);
|
||||||
},
|
},
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.wrapper {
|
.wrapper {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg {
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
height: 100vh;
|
||||||
|
background-color: rgba(0, 0, 0, 0.4);
|
||||||
|
z-index: 99;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uniDrawer {
|
||||||
|
width: 220px;
|
||||||
|
background-color: #fff;
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes uniDrawer {
|
||||||
|
0% {
|
||||||
|
transform: translateX(-100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.bg {
|
100% {
|
||||||
position: fixed;
|
transform: translateX(0%);
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
top: 0;
|
|
||||||
bottom: 0;
|
|
||||||
height: 100vh;
|
|
||||||
background-color: rgba(0, 0, 0, 0.4);
|
|
||||||
z-index: 99;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.uniDrawer {
|
.list {
|
||||||
width: 220px;
|
position: relative;
|
||||||
background-color: #fff;
|
top: 0;
|
||||||
z-index: 1000;
|
left: 0;
|
||||||
}
|
flex-direction: column;
|
||||||
|
flex: 1;
|
||||||
@keyframes uniDrawer {
|
justify-content: flex-end;
|
||||||
0% {
|
margin-bottom: 20rpx;
|
||||||
transform: translateX(-100%);
|
width: 220px;
|
||||||
}
|
height: calc(100vh - 100px);
|
||||||
|
overflow-y: scroll;
|
||||||
100% {
|
}
|
||||||
transform: translateX(0%);
|
|
||||||
}
|
|
||||||
}
|
.name {
|
||||||
|
width: 100%;
|
||||||
.list {
|
display: flex;
|
||||||
position: relative;
|
justify-content: space-between;
|
||||||
top: 0;
|
|
||||||
left: 0;
|
.overflow {
|
||||||
flex-direction: column;
|
width: 60%;
|
||||||
flex: 1;
|
|
||||||
justify-content: flex-end;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
width: 220px;
|
|
||||||
height: calc(100vh - 100px);
|
|
||||||
overflow-y: scroll;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.name {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.overflow {
|
|
||||||
width: 60%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
<view class="editem">
|
<view class="editem">
|
||||||
<view class="name">出生日期</view>
|
<view class="name">出生日期</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<picker mode="date" :end="startDate" class="f-r" :value="info.birthday" @change="onBirthdayArr">
|
<picker mode="date" :end="endDate" class="f-r" :value="info.birthday" @change="onBirthdayArr">
|
||||||
<view class="uni-input">{{info.birthday?info.birthday:"请选择"}}
|
<view class="uni-input">{{info.birthday?info.birthday:"请选择"}}
|
||||||
<icon class="iconfont icon-arrow-down"></icon>
|
<icon class="iconfont icon-arrow-down"></icon>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -65,6 +65,9 @@
|
||||||
userInfo: function() {
|
userInfo: function() {
|
||||||
return this.user
|
return this.user
|
||||||
},
|
},
|
||||||
|
endDate() {
|
||||||
|
return this.$tools.getDate("start")
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
var agedata = []
|
var agedata = []
|
||||||
|
|
@ -114,10 +117,13 @@
|
||||||
height: that.userInfo.height,
|
height: that.userInfo.height,
|
||||||
sex: that.userInfo.sex,
|
sex: that.userInfo.sex,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
that.$store.dispatch("getUserInfo", {
|
if (res.code == 0) {
|
||||||
familyid: that.userInfo.familyid,
|
that.$store.commit('changeMeasureResult', res.data)
|
||||||
})
|
that.$store.dispatch("getUserInfo", {
|
||||||
that.$store.dispatch("getFamilyList");
|
familyid: that.userInfo.familyid,
|
||||||
|
})
|
||||||
|
that.$store.dispatch("getFamilyList");
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,10 @@
|
||||||
uni.getUserProfile({
|
uni.getUserProfile({
|
||||||
desc: '登录',
|
desc: '登录',
|
||||||
success: (infoRes) => {
|
success: (infoRes) => {
|
||||||
console.log("getUserProfile授权成功", infoRes, that.url);
|
console.log("getUserProfile授权成功", infoRes, uni.getStorageSync('tenantid'));
|
||||||
|
that.$store.dispatch("getConfig", {
|
||||||
|
tenantId: uni.getStorageSync('tenantid')
|
||||||
|
})
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: `/pageTwo/login/login?name=` + infoRes.userInfo.nickName +
|
url: `/pageTwo/login/login?name=` + infoRes.userInfo.nickName +
|
||||||
"&headimg=" + infoRes.userInfo.avatarUrl + "&url=" + that.url
|
"&headimg=" + infoRes.userInfo.avatarUrl + "&url=" + that.url
|
||||||
|
|
|
||||||
26
config.js
26
config.js
|
|
@ -1,29 +1,17 @@
|
||||||
|
|
||||||
const accountInfo = wx.getAccountInfoSync();
|
const accountInfo = wx.getAccountInfoSync();
|
||||||
const appid = accountInfo.miniProgram.appId
|
const appid = accountInfo.miniProgram.appId
|
||||||
uni.setStorageSync('appid', appid)
|
uni.setStorageSync('appid', appid)
|
||||||
let host = ""
|
let host = ""
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
console.log("开发环境")
|
console.log("开发环境")
|
||||||
// host = "https://ttybapi.pcxbc.com"
|
// host = "https://ttybapi.pcxbc.com"
|
||||||
host = "https://ttybapi.pcxbc.com"
|
host = "https://ybapi.pcxbc.com"
|
||||||
} else {
|
} else {
|
||||||
console.log("生产环境")
|
console.log("生产环境")
|
||||||
host = "https://ybapi.pcxbc.com"
|
host = "https://ybapi.pcxbc.com"
|
||||||
}
|
}
|
||||||
// // 设备管理
|
|
||||||
// let baseUrl = {}
|
|
||||||
// if (appid === 'wx3e83b37ba682faf5') {
|
|
||||||
// console.log("每日一称儿童")
|
|
||||||
// baseUrl.adult = "wxd230a93791c03259"
|
|
||||||
// baseUrl.device = "wx6f48cc32c5c0a4a2"
|
|
||||||
// } else if (appid === 'wx44df5e42ddf16203') {
|
|
||||||
// console.log("小秤匠")
|
|
||||||
// baseUrl.adult = "wx39cf431caa22b5c8"
|
|
||||||
// baseUrl.device = "wx6f48cc32c5c0a4a2"
|
|
||||||
// }
|
|
||||||
console.log("appid", appid)
|
console.log("appid", appid)
|
||||||
module.exports = {
|
module.exports = {
|
||||||
appid,
|
appid,
|
||||||
host
|
host,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
6
main.js
6
main.js
|
|
@ -22,14 +22,14 @@ Vue.prototype.$model = model;
|
||||||
// 环境配置
|
// 环境配置
|
||||||
import config from './config.js'
|
import config from './config.js'
|
||||||
Vue.prototype.config = config;
|
Vue.prototype.config = config;
|
||||||
|
console.log("uni.setStorageSync", store)
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
App.mpType = 'app'
|
App.mpType = 'app'
|
||||||
//让页面onLoad在onLaunch后执行
|
//让页面onLoad在onLaunch后执行
|
||||||
Vue.prototype.$onLaunched = new Promise(resolve => {
|
Vue.prototype.$onLaunched = new Promise(resolve => {
|
||||||
Vue.prototype.$isResolve = resolve
|
Vue.prototype.$isResolve = resolve
|
||||||
})
|
})
|
||||||
const app = new Vue({
|
const app = new Vue({
|
||||||
...App
|
...App
|
||||||
})
|
})
|
||||||
app.$mount()
|
app.$mount()
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
"quickapp" : {},
|
"quickapp" : {},
|
||||||
/* 小程序特有相关 */
|
/* 小程序特有相关 */
|
||||||
"mp-weixin" : {
|
"mp-weixin" : {
|
||||||
"appid" : "wx3e83b37ba682faf5",
|
"appid" : "wxd230a93791c03259",
|
||||||
"setting" : {
|
"setting" : {
|
||||||
"urlCheck" : true,
|
"urlCheck" : true,
|
||||||
"minified" : true,
|
"minified" : true,
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,11 @@
|
||||||
export default {
|
export default {
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
|
// 导航栏颜色
|
||||||
|
uni.setNavigationBarColor({
|
||||||
|
frontColor: '#ffffff',
|
||||||
|
backgroundColor: this.appTheme,
|
||||||
|
})
|
||||||
console.log("options", options)
|
console.log("options", options)
|
||||||
if (options.info) {
|
if (options.info) {
|
||||||
that.infoID = JSON.parse(options.info)
|
that.infoID = JSON.parse(options.info)
|
||||||
|
|
@ -92,7 +97,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user"]),
|
...mapState(["user","appTheme"]),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleSharepic(id) {
|
handleSharepic(id) {
|
||||||
|
|
|
||||||
|
|
@ -1,217 +0,0 @@
|
||||||
<template>
|
|
||||||
<view class="common homePage">
|
|
||||||
<!-- 头部 -->
|
|
||||||
<headTop :token="token"></headTop>
|
|
||||||
<!-- 健康报告 -->
|
|
||||||
<view class="myinfo myinfoPage">
|
|
||||||
<view class="mt-15" v-show="MeasureResult&&MeasureResult.muscle==0">
|
|
||||||
<view class="unusual">体脂测量异常,请重新测量</view>
|
|
||||||
</view>
|
|
||||||
<view v-if="infoList.length">
|
|
||||||
<view class="box">
|
|
||||||
<view class="left">
|
|
||||||
<text class="text">本次健康评分</text>
|
|
||||||
<view class="circleprogress">
|
|
||||||
<view class="wrapper">
|
|
||||||
<view class="leftprogress" :style="{ width: MeasureResult.cmi + '%'}">
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="fen">
|
|
||||||
<view>{{MeasureResult.cmi}}</view>分
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="right">
|
|
||||||
<view class="item">
|
|
||||||
<view><text>{{MeasureResult.height}}</text>cm</view>
|
|
||||||
<view class="tivon">身高</image>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<view><text>{{MeasureResult.weight}}</text>kg</view>
|
|
||||||
<view>体重</view>
|
|
||||||
</view>
|
|
||||||
<!-- <view class="item">
|
|
||||||
<view><text>{{MeasureResult.lbm}}</text>kg</view>
|
|
||||||
<view class="tivon">去脂体重</image>
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
<view class="item">
|
|
||||||
<view><text>{{MeasureResult.bodyage}}</text>岁</view>
|
|
||||||
<view>体龄</view>
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<view><text class="f-14">{{MeasureResult.body}}</text></view>
|
|
||||||
<view>体型</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="box1">
|
|
||||||
<view class="h2">
|
|
||||||
<icon class="yuanxing"></icon>其他人体成分分析
|
|
||||||
</view>
|
|
||||||
<view class="list" v-for="(item,index) in infoList" :key="index" @click="handleToggle(index)">
|
|
||||||
<view class="block">
|
|
||||||
<view class="name">
|
|
||||||
<icon class="t-icon iconfont" :class="'t-icon-'+item.key"></icon>
|
|
||||||
{{item.title}}
|
|
||||||
</view>
|
|
||||||
<view class="val" v-if="item.title!='肥胖等级'">
|
|
||||||
{{item.fvalue?item.fvalue:'0'}}{{item.dw}}
|
|
||||||
</view>
|
|
||||||
<view class="val0" v-else>{{item.fevaluation}}</view>
|
|
||||||
<view class="level" v-if="item.title!='肥胖等级'">
|
|
||||||
<view class="btnf" :style="{backgroundColor:item.color}">{{item.fevaluation}}</view>
|
|
||||||
</view>
|
|
||||||
<view class="icon">
|
|
||||||
<icon class="iconfont icon-arrow-down" v-if="item.desc"></icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="desc" v-if="item.showCon">
|
|
||||||
<view v-if="item.desc">{{item.desc}}</view>
|
|
||||||
<view class="statuevue" v-if="item.slist">
|
|
||||||
<view class="bi" v-if="item.title!='基础代谢'">
|
|
||||||
<view class="item" v-for="(ite , ind) in item.slist" :key="ind"
|
|
||||||
:style="{backgroundColor:ite.color}">
|
|
||||||
<view class="span1">{{ite.text}}</view>
|
|
||||||
<view v-if="ite.text==item.fevaluation&&item.fvalue>ite.maxvalue"
|
|
||||||
style="right: 10px" class="peobox">
|
|
||||||
<view class="xx"></view>
|
|
||||||
</view>
|
|
||||||
<view v-if="ite.text==item.fevaluation&&item.fvalue<=ite.maxvalue"
|
|
||||||
:style="'left:'+item.leftval+'rem'" class="peobox">
|
|
||||||
<view class="xx"></view>
|
|
||||||
</view>
|
|
||||||
<view class="span" v-if="ind<item.slist.length-1">{{ite.maxvalue}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view v-else>
|
|
||||||
<view class="kcalClass">
|
|
||||||
标准值:{{item.slist[0].maxvalue}}kcal
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="introction">
|
|
||||||
<icon class="t-icon t-icon-tishi"></icon>
|
|
||||||
<span>此测量数据仅供参考,不可代替医学专业测试!</span>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view v-else class="nolist">
|
|
||||||
<icon class="iconfont icon-zanwu"></icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
mapState
|
|
||||||
} from "vuex";
|
|
||||||
import headTop from "@/components/header/head.vue"
|
|
||||||
export default {
|
|
||||||
components: {
|
|
||||||
headTop
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
token: null,
|
|
||||||
devtype: 0,
|
|
||||||
infoList: [],
|
|
||||||
deviceId: null,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState(["user", "MeasureResult"]),
|
|
||||||
},
|
|
||||||
onUnload: function() {
|
|
||||||
let that = this
|
|
||||||
uni.switchTab({
|
|
||||||
url: "/pages/index/index"
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onShow() {
|
|
||||||
let that = this;
|
|
||||||
that.token = uni.getStorageSync('token')
|
|
||||||
uni.onBluetoothAdapterStateChange(function(res) {
|
|
||||||
that.$store.commit("changeBluetooth", res.available);
|
|
||||||
console.log("报告页监听蓝牙状态openBluetoothAdapter", res.available)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
let that = this;
|
|
||||||
console.log("options", options)
|
|
||||||
if (options) {
|
|
||||||
that.devtype = options.t
|
|
||||||
that.deviceId = options.sn
|
|
||||||
}
|
|
||||||
this.$nextTick(() => {
|
|
||||||
that.handleToggle(0)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
MeasureResult() {
|
|
||||||
this.handleToggle(0)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 切换
|
|
||||||
handleToggle(index) {
|
|
||||||
let that = this
|
|
||||||
if (!that.MeasureResult) return
|
|
||||||
let str = this.weightInfo.infoList(that.MeasureResult).slice(1, 14)
|
|
||||||
for (var i = 0; i < str.length; i++) {
|
|
||||||
if (i == index) {
|
|
||||||
str[i].showCon = !str[i].showCon
|
|
||||||
} else {
|
|
||||||
str[i].showCon = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
that.infoList = this.weightInfo.infoList(that.MeasureResult).slice(1, 14)
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.myinfo {
|
|
||||||
margin-top: 105px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.val0 {
|
|
||||||
position: absolute;
|
|
||||||
left: 40%;
|
|
||||||
margin-left: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wrapper {
|
|
||||||
z-index: 9 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.unusual {
|
|
||||||
font-size: 14px;
|
|
||||||
border-radius: 8px;
|
|
||||||
text-align: center;
|
|
||||||
color: #e83a1e;
|
|
||||||
margin: 15px;
|
|
||||||
background: #f7e4c8;
|
|
||||||
padding: 5px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.introction {
|
|
||||||
display: flex;
|
|
||||||
margin-left: 15px;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #666;
|
|
||||||
|
|
||||||
.t-icon {
|
|
||||||
width: 15px;
|
|
||||||
height: 15px;
|
|
||||||
margin-right: 5px;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,76 +1,88 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view>
|
<view>
|
||||||
<view class="title">{{content.title}}</view>
|
<view class="title">{{content.title}}</view>
|
||||||
<view class="time">发布时间:{{content.createtime}}</view>
|
<view class="time">发布时间:{{content.createtime}}</view>
|
||||||
<u-parse :content="content.content" @preview="preview" @navigate="navigate"></u-parse>
|
<u-parse :content="content.content" @preview="preview" @navigate="navigate"></u-parse>
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import uParse from '@/components/u-parse/u-parse.vue'
|
import {
|
||||||
export default {
|
mapState
|
||||||
data() {
|
} from "vuex";
|
||||||
return {
|
import uParse from '@/components/u-parse/u-parse.vue'
|
||||||
content: "",
|
export default {
|
||||||
url: null
|
data() {
|
||||||
}
|
return {
|
||||||
},
|
content: "",
|
||||||
components: {
|
url: null
|
||||||
uParse
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
components: {
|
||||||
console.log(option)
|
uParse
|
||||||
if (option.id) {
|
},
|
||||||
this.getOrderDetail(option.id);
|
computed: {
|
||||||
}
|
...mapState(["user", "appTheme"]),
|
||||||
if (option.url) {
|
},
|
||||||
this.url = option.url
|
onLoad(option) {
|
||||||
} else {
|
// 导航栏颜色
|
||||||
this.url = null
|
uni.setNavigationBarColor({
|
||||||
}
|
frontColor: '#ffffff',
|
||||||
|
backgroundColor: this.appTheme,
|
||||||
|
})
|
||||||
|
//
|
||||||
|
console.log(option)
|
||||||
|
if (option.id) {
|
||||||
|
this.getOrderDetail(option.id);
|
||||||
|
}
|
||||||
|
if (option.url) {
|
||||||
|
this.url = option.url
|
||||||
|
} else {
|
||||||
|
this.url = null
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getOrderDetail(orderno) {
|
getOrderDetail(orderno) {
|
||||||
this.$model.GetAdListDetail({
|
this.$model.GetAdListDetail({
|
||||||
id: orderno
|
id: orderno
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code != 0) return
|
if (res.code != 0) return
|
||||||
this.content = res.data
|
this.content = res.data
|
||||||
console.log("资讯详情", res)
|
console.log("资讯详情", res)
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
preview(src, e) {
|
preview(src, e) {
|
||||||
// do something
|
// do something
|
||||||
},
|
},
|
||||||
navigate(href, e) {
|
navigate(href, e) {
|
||||||
// do something
|
// do something
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@import url("@/components/u-parse/u-parse.css");
|
@import url("@/components/u-parse/u-parse.css");
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.time {
|
.time {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,340 +1,351 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<image src="@/static/logo.png"></image>
|
<image :src="configBox.logo"></image>
|
||||||
<text>每日一称-成人</text>
|
<text>{{configBox.title}}</text>
|
||||||
</view>
|
|
||||||
<view class="edit">
|
|
||||||
<view class="ts">
|
|
||||||
<view>短信验证码登录</view>
|
|
||||||
</view>
|
|
||||||
<view class="editem">
|
|
||||||
<view class="input">
|
|
||||||
<input class="uni-input" v-model="phone" placeholder="请输入手机号" />
|
|
||||||
</view>
|
|
||||||
<view class="input yanzheng">
|
|
||||||
<view class="yanzhengma">
|
|
||||||
<input class="uni-input" v-model="code" placeholder="请输入验证码" />
|
|
||||||
</view>
|
|
||||||
<button class="code" type="none" @tap="handleCode" v-model="codeInfo"
|
|
||||||
:disabled="disabled">{{second<60 ? second+'S后重发':'获取验证码'}}
|
|
||||||
</button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="btnlogin" @click="handleTelLogin">登录</view>
|
|
||||||
</view>
|
|
||||||
<view class="btnGroup">
|
|
||||||
<view class="wxbtn" v-if="iswxphone">
|
|
||||||
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
|
||||||
<icon class="iconfont icon-weixin"></icon>
|
|
||||||
<text>微信登录</text>
|
|
||||||
</button>
|
|
||||||
</view>
|
|
||||||
<view class="xieyi">
|
|
||||||
<checkbox-group @change="checkboxChange" class="group">
|
|
||||||
<checkbox :value="1" checked="true" style="transform:scale(0.7)" />同意每日一称<text
|
|
||||||
@click="handlexieyi">《个人信息保护政策》</text>
|
|
||||||
</checkbox-group>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
<view class="edit">
|
||||||
|
<view class="ts">
|
||||||
|
<view>短信验证码登录</view>
|
||||||
|
</view>
|
||||||
|
<view class="editem">
|
||||||
|
<view class="input">
|
||||||
|
<input class="uni-input" v-model="phone" placeholder="请输入手机号" />
|
||||||
|
</view>
|
||||||
|
<view class="input yanzheng">
|
||||||
|
<view class="yanzhengma">
|
||||||
|
<input class="uni-input" v-model="code" placeholder="请输入验证码" />
|
||||||
|
</view>
|
||||||
|
<button class="code" type="none" @tap="handleCode" v-model="codeInfo"
|
||||||
|
:disabled="disabled">{{second<60 ? second+'S后重发':'获取验证码'}}
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="btnlogin" @click="handleTelLogin">登录</view>
|
||||||
|
</view>
|
||||||
|
<view class="btnGroup">
|
||||||
|
<view class="wxbtn" v-if="iswxphone">
|
||||||
|
<button open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
||||||
|
<icon class="iconfont icon-weixin"></icon>
|
||||||
|
<text>微信登录</text>
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
<view class="xieyi">
|
||||||
|
<checkbox-group @change="checkboxChange" class="group">
|
||||||
|
<checkbox :value="1" checked="true" style="transform:scale(0.7)" />同意{{configBox.title}}<text
|
||||||
|
@click="handlexieyi">《个人信息保护政策》</text>
|
||||||
|
</checkbox-group>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
import {
|
||||||
data() {
|
mapState
|
||||||
return {
|
} from "vuex";
|
||||||
phone: "",
|
export default {
|
||||||
code: "",
|
data() {
|
||||||
disabled: false,
|
return {
|
||||||
second: 60,
|
phone: "",
|
||||||
value: 1,
|
code: "",
|
||||||
iswxphone: true,
|
disabled: false,
|
||||||
infoRes: {}
|
second: 60,
|
||||||
}
|
value: 1,
|
||||||
},
|
iswxphone: true,
|
||||||
onLoad(options) {
|
infoRes: {}
|
||||||
let that = this
|
}
|
||||||
if (options) {
|
},
|
||||||
that.infoRes = options
|
computed: {
|
||||||
console.log("登录信息", options, that.infoRes)
|
...mapState(["configBox", "appTheme"]),
|
||||||
}
|
},
|
||||||
|
onLoad(options) {
|
||||||
|
// 导航栏颜色
|
||||||
|
uni.setNavigationBarColor({
|
||||||
|
frontColor: '#ffffff',
|
||||||
|
backgroundColor: this.appTheme,
|
||||||
|
})
|
||||||
|
let that = this
|
||||||
|
if (options) {
|
||||||
|
that.infoRes = options
|
||||||
|
console.log("登录信息", options, that.infoRes, this.configBox)
|
||||||
|
}
|
||||||
|
|
||||||
this.iswxphone = uni.getStorageSync('iswxphone')
|
this.iswxphone = uni.getStorageSync('iswxphone')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
checkboxChange(e) {
|
checkboxChange(e) {
|
||||||
this.value = e.detail.value.length ? e.detail.value[0] : "0"
|
this.value = e.detail.value.length ? e.detail.value[0] : "0"
|
||||||
},
|
},
|
||||||
// 登录、
|
// 登录、
|
||||||
handleTelLogin() {
|
handleTelLogin() {
|
||||||
let that = this
|
let that = this
|
||||||
if (this.value == 0) {
|
if (this.value == 0) {
|
||||||
that.$tools.msg("请先勾选同意每日一称《个人信息保护政策》")
|
that.$tools.msg("请先勾选同意每日一称《个人信息保护政策》")
|
||||||
return
|
return
|
||||||
}
|
|
||||||
if (!this.phone) {
|
|
||||||
that.$tools.msg("请输入手机号")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!(/^1[3456789]\d{9}$/.test(that.phone))) {
|
|
||||||
that.$tools.msg("请输入正确的手机号码")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!that.code) {
|
|
||||||
that.$tools.msg("请输入验证码")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.$model.getRegister({
|
|
||||||
phone: that.phone,
|
|
||||||
tenantId: uni.getStorageSync('tenantid'),
|
|
||||||
sessionId: uni.getStorageSync('sessionid'),
|
|
||||||
name: that.infoRes.name,
|
|
||||||
headImg: that.infoRes.headimg,
|
|
||||||
code: that.code,
|
|
||||||
isvrcode: true,
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code != 0) {
|
|
||||||
that.$tools.msg(res.message)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
uni.setStorageSync('token', res.data.token)
|
|
||||||
uni.setStorageSync('iswxphone', res.data.iswxphone)
|
|
||||||
uni.setStorageSync('refreshtoken', res.data.refreshtoken)
|
|
||||||
uni.setStorageSync('sessionid', res.data.sessionid)
|
|
||||||
if (that.infoRes.url == 'active') {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: "/pages/index/active"
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: "/pages/index/index"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}).catch(err => {})
|
|
||||||
},
|
|
||||||
// 获取验证码
|
|
||||||
handleCode() {
|
|
||||||
let that = this
|
|
||||||
if (!that.phone) {
|
|
||||||
that.$tools.msg("请输入手机号")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!(/^1[3456789]\d{9}$/.test(that.phone))) {
|
|
||||||
that.$tools.msg("请输入正确的手机号码")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
//
|
|
||||||
that.$model.getSendCode({
|
|
||||||
phone: that.phone
|
|
||||||
}).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
if (res.code != 0) {
|
|
||||||
that.$tools.msg(res.message)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
that.disabled = true
|
|
||||||
let interval = setInterval(() => {
|
|
||||||
--that.second
|
|
||||||
}, 1000)
|
|
||||||
setTimeout(() => {
|
|
||||||
clearInterval(interval)
|
|
||||||
that.disabled = false
|
|
||||||
that.second = 60
|
|
||||||
}, 60000)
|
|
||||||
}).catch(err => {})
|
|
||||||
},
|
|
||||||
// 授权
|
|
||||||
getPhoneNumber(res) {
|
|
||||||
const that = this
|
|
||||||
if (this.value == 0) {
|
|
||||||
that.$tools.msg("请先勾选同意每日一称《个人信息保护政策")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (res.detail.errMsg == 'getPhoneNumber:ok') {
|
|
||||||
console.log("res", res)
|
|
||||||
this.$model.getregister({
|
|
||||||
tenantId: uni.getStorageSync('tenantid'),
|
|
||||||
sessionId: uni.getStorageSync('sessionid'),
|
|
||||||
encryptedData: res.detail.encryptedData,
|
|
||||||
iv: res.detail.iv,
|
|
||||||
name: that.infoRes.name,
|
|
||||||
headImg: that.infoRes.headimg,
|
|
||||||
fansid: uni.getStorageSync('fansid')
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code != 0) return
|
|
||||||
that.value = 1
|
|
||||||
uni.setStorageSync('token', res.data.token)
|
|
||||||
uni.setStorageSync('iswxphone', res.data.iswxphone)
|
|
||||||
uni.setStorageSync('refreshtoken', res.data.refreshtoken)
|
|
||||||
uni.setStorageSync('sessionid', res.data.sessionid)
|
|
||||||
if (that.infoRes.url == 'active') {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: "/pages/index/active"
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: "/pages/index/index"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//
|
|
||||||
handlexieyi() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/login/detail?id=08DA1796-2FEE-4813-8B0C-8A45E7A57E70"
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (!this.phone) {
|
||||||
|
that.$tools.msg("请输入手机号")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!(/^1[3456789]\d{9}$/.test(that.phone))) {
|
||||||
|
that.$tools.msg("请输入正确的手机号码")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!that.code) {
|
||||||
|
that.$tools.msg("请输入验证码")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$model.getRegister({
|
||||||
|
phone: that.phone,
|
||||||
|
tenantId: uni.getStorageSync('tenantid'),
|
||||||
|
sessionId: uni.getStorageSync('sessionid'),
|
||||||
|
name: that.infoRes.name,
|
||||||
|
headImg: that.infoRes.headimg,
|
||||||
|
code: that.code,
|
||||||
|
isvrcode: true,
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code != 0) {
|
||||||
|
that.$tools.msg(res.message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.setStorageSync('token', res.data.token)
|
||||||
|
uni.setStorageSync('iswxphone', res.data.iswxphone)
|
||||||
|
uni.setStorageSync('refreshtoken', res.data.refreshtoken)
|
||||||
|
uni.setStorageSync('sessionid', res.data.sessionid)
|
||||||
|
if (that.infoRes.url == 'active') {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: "/pages/index/active"
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: "/pages/index/index"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}).catch(err => {})
|
||||||
|
},
|
||||||
|
// 获取验证码
|
||||||
|
handleCode() {
|
||||||
|
let that = this
|
||||||
|
if (!that.phone) {
|
||||||
|
that.$tools.msg("请输入手机号")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!(/^1[3456789]\d{9}$/.test(that.phone))) {
|
||||||
|
that.$tools.msg("请输入正确的手机号码")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//
|
||||||
|
that.$model.getSendCode({
|
||||||
|
phone: that.phone
|
||||||
|
}).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
if (res.code != 0) {
|
||||||
|
that.$tools.msg(res.message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
that.disabled = true
|
||||||
|
let interval = setInterval(() => {
|
||||||
|
--that.second
|
||||||
|
}, 1000)
|
||||||
|
setTimeout(() => {
|
||||||
|
clearInterval(interval)
|
||||||
|
that.disabled = false
|
||||||
|
that.second = 60
|
||||||
|
}, 60000)
|
||||||
|
}).catch(err => {})
|
||||||
|
},
|
||||||
|
// 授权
|
||||||
|
getPhoneNumber(res) {
|
||||||
|
const that = this
|
||||||
|
if (this.value == 0) {
|
||||||
|
that.$tools.msg("请先勾选同意每日一称《个人信息保护政策")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (res.detail.errMsg == 'getPhoneNumber:ok') {
|
||||||
|
console.log("res", res)
|
||||||
|
this.$model.getregister({
|
||||||
|
tenantId: uni.getStorageSync('tenantid'),
|
||||||
|
sessionId: uni.getStorageSync('sessionid'),
|
||||||
|
encryptedData: res.detail.encryptedData,
|
||||||
|
iv: res.detail.iv,
|
||||||
|
name: that.infoRes.name,
|
||||||
|
headImg: that.infoRes.headimg,
|
||||||
|
fansid: uni.getStorageSync('fansid')
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code != 0) return
|
||||||
|
that.value = 1
|
||||||
|
uni.setStorageSync('token', res.data.token)
|
||||||
|
uni.setStorageSync('iswxphone', res.data.iswxphone)
|
||||||
|
uni.setStorageSync('refreshtoken', res.data.refreshtoken)
|
||||||
|
uni.setStorageSync('sessionid', res.data.sessionid)
|
||||||
|
if (that.infoRes.url == 'active') {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: "/pages/index/active"
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: "/pages/index/index"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//
|
||||||
|
handlexieyi() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pageTwo/login/detail?id=" + this.configBox.privacyid
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.content {
|
.content {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 80px 0 0;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 70px;
|
||||||
|
height: 70px;
|
||||||
|
margin: auto;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top {
|
text {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.edit {
|
||||||
|
width: 75%;
|
||||||
|
height: auto;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 15px;
|
||||||
|
margin: 40px auto 15px;
|
||||||
|
|
||||||
|
.ts {
|
||||||
|
text-align: left;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.editem {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 28upx;
|
||||||
|
justify-content: space-between;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
width: 100%;
|
||||||
|
border: #dfdfdf 1px solid;
|
||||||
|
padding: 0 10px;
|
||||||
|
height: 35px;
|
||||||
|
line-height: 35px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
display: flex;
|
||||||
|
border-radius: 10px;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
input {
|
||||||
|
height: 35px;
|
||||||
|
line-height: 35px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
}
|
||||||
flex-wrap: wrap;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
padding: 80px 0 0;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 70px;
|
|
||||||
height: 70px;
|
|
||||||
margin: auto;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.edit {
|
.btnlogin {
|
||||||
width: 75%;
|
width: 100%;
|
||||||
height: auto;
|
margin: 20px 0;
|
||||||
|
height: 38px;
|
||||||
|
line-height: 38px;
|
||||||
|
background: $btncolor;
|
||||||
|
font-weight: 700;
|
||||||
|
border-radius: 10px;
|
||||||
|
text-align: center;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.code {
|
||||||
|
width: 110px;
|
||||||
|
background: #dfdfdf;
|
||||||
|
font-size: 12px;
|
||||||
|
margin: 0;
|
||||||
|
border-radius: 10px;
|
||||||
|
text-align: center;
|
||||||
|
position: absolute;
|
||||||
|
right: 2.5px;
|
||||||
|
top: 2.5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btnGroup {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
background-color: inherit;
|
||||||
|
line-height: inherit;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 80rpx;
|
||||||
|
|
||||||
|
.wxbtn {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
icon {
|
||||||
|
font-size: 25px;
|
||||||
|
color: #28c445;
|
||||||
|
}
|
||||||
|
|
||||||
|
text {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 5px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #666;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
line-height: initial;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 10px;
|
|
||||||
padding: 15px;
|
|
||||||
margin: 40px auto 15px;
|
|
||||||
|
|
||||||
.ts {
|
|
||||||
text-align: left;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.editem {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 28upx;
|
|
||||||
justify-content: space-between;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input {
|
|
||||||
width: 100%;
|
|
||||||
border: #dfdfdf 1px solid;
|
|
||||||
padding: 0 10px;
|
|
||||||
height: 35px;
|
|
||||||
line-height: 35px;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
display: flex;
|
|
||||||
border-radius: 10px;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
input {
|
|
||||||
height: 35px;
|
|
||||||
line-height: 35px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btnlogin {
|
|
||||||
width: 100%;
|
|
||||||
margin: 20px 0;
|
|
||||||
height: 38px;
|
|
||||||
line-height: 38px;
|
|
||||||
background: $btncolor;
|
|
||||||
font-weight: 700;
|
|
||||||
border-radius: 10px;
|
|
||||||
text-align: center;
|
|
||||||
color: #fff !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.code {
|
|
||||||
width: 110px;
|
|
||||||
background: #dfdfdf;
|
|
||||||
font-size: 12px;
|
|
||||||
margin: 0;
|
|
||||||
border-radius: 10px;
|
|
||||||
text-align: center;
|
|
||||||
position: absolute;
|
|
||||||
right: 2.5px;
|
|
||||||
top: 2.5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btnGroup {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
background-color: inherit;
|
padding: 0;
|
||||||
line-height: inherit;
|
justify-content: center;
|
||||||
position: absolute;
|
}
|
||||||
bottom: 80rpx;
|
|
||||||
|
|
||||||
.wxbtn {
|
button::after {
|
||||||
width: 100%;
|
display: none;
|
||||||
|
}
|
||||||
icon {
|
|
||||||
font-size: 25px;
|
|
||||||
color: #28c445;
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
margin-top: 5px;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #666;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
line-height: initial;
|
|
||||||
background: #fff;
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
padding: 0;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
button::after {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.xieyi {
|
|
||||||
font-size: 14px;
|
|
||||||
margin-top: 20px;
|
|
||||||
color: #333;
|
|
||||||
|
|
||||||
text {
|
|
||||||
border-bottom: 1px solid #333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.xieyi {
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 20px;
|
||||||
|
color: #333;
|
||||||
|
|
||||||
|
text {
|
||||||
|
border-bottom: 1px solid #333;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,262 +1,268 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<view class="lanBox">
|
<view class="lanBox">
|
||||||
<form action>
|
<form action>
|
||||||
<view class="headbox">
|
<view class="headbox">
|
||||||
<view class="touxiang">
|
<view class="touxiang">
|
||||||
<icon class="t-icon t-icon-touxiang headimage"></icon>
|
<icon class="t-icon t-icon-touxiang headimage"></icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="lan2">
|
<view class="lan2">
|
||||||
请补充信息,帮助我们更准确的分析数据
|
请补充信息,帮助我们更准确的分析数据
|
||||||
</view>
|
</view>
|
||||||
<view class="lan border-bottom">
|
<view class="lan border-bottom">
|
||||||
<view class="left">用户名/昵称</view>
|
<view class="left">用户名/昵称</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<input name="name" type="text" v-model="name" placeholder="请输入用户名/昵称" />
|
<text v-if="user.nickname">{{user.nickname}}</text>
|
||||||
</view>
|
<!-- <input name="name" type="text" v-model="name" placeholder="请输入用户名/昵称" /> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="lan border-bottom">
|
</view>
|
||||||
<view class="left">性别</view>
|
<view class="lan border-bottom">
|
||||||
<view class="right">
|
<view class="left">性别</view>
|
||||||
<picker mode="selector" :range="sexItem" @change="onsexArr">
|
<view class="right">
|
||||||
<view class="uni-input">{{sex==0?'请选择':sex==1?'男':'女'}}</view>
|
<picker mode="selector" :range="sexItem" @change="onsexArr">
|
||||||
<icon class="iconfont icon-arrow-down"></icon>
|
<view class="uni-input">{{sex==0?'请选择':sex==1?'男':'女'}}</view>
|
||||||
</picker>
|
<icon class="iconfont icon-arrow-down"></icon>
|
||||||
</view>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
<view class="lan border-bottom">
|
</view>
|
||||||
<view class="left">身高</view>
|
<view class="lan border-bottom">
|
||||||
<view class="right">
|
<view class="left">身高</view>
|
||||||
<input type="digit" class="mr-5" v-model="height" placeholder="请输入身高" />cm
|
<view class="right">
|
||||||
<!-- <view class="uni-input">{{height?height+"cm":"请选择"}}</view>
|
<input type="digit" class="mr-5" v-model="height" placeholder="请输入身高" />cm
|
||||||
|
<!-- <view class="uni-input">{{height?height+"cm":"请选择"}}</view>
|
||||||
<icon class="iconfont icon-arrow-down ml-15"></icon> -->
|
<icon class="iconfont icon-arrow-down ml-15"></icon> -->
|
||||||
<!-- <picker mode="selector" class="f-r" value="85" :range="heightArr" @change="onheightArr">
|
<!-- <picker mode="selector" class="f-r" value="85" :range="heightArr" @change="onheightArr">
|
||||||
<view class="uni-input">{{height!=0?height:"请选择"}}</view>
|
<view class="uni-input">{{height!=0?height:"请选择"}}</view>
|
||||||
<icon class="iconfont icon-arrow-down"></icon>
|
<icon class="iconfont icon-arrow-down"></icon>
|
||||||
</picker> -->
|
</picker> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
<view class="lan border-bottom">
|
|
||||||
<view class="left">出生日期</view>
|
|
||||||
<view class="right">
|
|
||||||
<picker class="picker" mode="date" :end="startDate" :value="birthday" @change="bindDateChange">
|
|
||||||
<view class="uni-input">{{birthday?birthday:"请选择"}}</view>
|
|
||||||
<icon class="iconfont icon-arrow-down"></icon>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</form>
|
|
||||||
</view>
|
</view>
|
||||||
<view v-if="isHeight" class="slidePopup">
|
<view class="lan border-bottom">
|
||||||
<view class="bg" @click="onTap">
|
<view class="left">出生日期</view>
|
||||||
<view class="slide-box" @click.stop>
|
<view class="right">
|
||||||
<view class="btnGroup">
|
<picker class="picker" mode="date" :end="endDate" :value="birthday" @change="bindDateChange">
|
||||||
<view class="subtn close" @click="onTap">取消</view>
|
<view class="uni-input">{{birthday?birthday:"请选择"}}</view>
|
||||||
<view class="heightVal">{{height}}cm</view>
|
<icon class="iconfont icon-arrow-down"></icon>
|
||||||
<view class="subtn" @click="isHeight = false">确定</view>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
<slide-choose v-model="height" ref="slide"></slide-choose>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="btn" @click="confirmInfo">提交</view>
|
</form>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="isHeight" class="slidePopup">
|
||||||
|
<view class="bg" @click="onTap">
|
||||||
|
<view class="slide-box" @click.stop>
|
||||||
|
<view class="btnGroup">
|
||||||
|
<view class="subtn close" @click="onTap">取消</view>
|
||||||
|
<view class="heightVal">{{height}}cm</view>
|
||||||
|
<view class="subtn" @click="isHeight = false">确定</view>
|
||||||
|
</view>
|
||||||
|
<slide-choose v-model="height" ref="slide"></slide-choose>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="btn" @click="confirmInfo">提交</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
ageArr: [],
|
ageArr: [],
|
||||||
sexItem: [
|
sexItem: [
|
||||||
"男",
|
"男",
|
||||||
"女"
|
"女"
|
||||||
],
|
],
|
||||||
sex: 0,
|
sex: 0,
|
||||||
name: null,
|
name: null,
|
||||||
birthday: "",
|
birthday: "",
|
||||||
height: "",
|
height: "",
|
||||||
isHeight: false,
|
isHeight: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user"]),
|
...mapState(["user", "appTheme"]),
|
||||||
userInfo() {
|
userInfo() {
|
||||||
return this.user
|
return this.user
|
||||||
},
|
},
|
||||||
startDate() {
|
endDate() {
|
||||||
return this.$tools.getDate('start');
|
return this.$tools.getDate("start")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 提交
|
// 提交
|
||||||
confirmInfo() {
|
confirmInfo() {
|
||||||
let data = {};
|
let data = {};
|
||||||
if (!this.name) {
|
if (!this.name) {
|
||||||
this.$tools.msg("请输入用户名")
|
this.$tools.msg("请输入用户名")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.sex) {
|
if (!this.sex) {
|
||||||
this.$tools.msg("请选择性别")
|
this.$tools.msg("请选择性别")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.height) {
|
if (!this.height) {
|
||||||
this.$tools.msg("请选择身高")
|
this.$tools.msg("请选择身高")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.birthday) {
|
if (!this.birthday) {
|
||||||
this.$tools.msg("请选择出生日期")
|
this.$tools.msg("请选择出生日期")
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
data.name = this.name
|
data.name = this.name
|
||||||
data.sex = this.sex;
|
data.sex = this.sex;
|
||||||
data.height = this.height;
|
data.height = this.height;
|
||||||
data.birthday = this.birthday;
|
data.birthday = this.birthday;
|
||||||
data.id = this.user.familyid
|
data.id = this.user.familyid
|
||||||
console.log("提交", data)
|
console.log("提交", data)
|
||||||
this.subInfo(data);
|
this.subInfo(data);
|
||||||
},
|
},
|
||||||
subInfo(data) {
|
subInfo(data) {
|
||||||
let that = this
|
let that = this
|
||||||
that.$model.getsubmit(data).then(res => {
|
that.$model.getsubmit(data).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
that.$tools.msg("提交成功");
|
that.$tools.msg("提交成功");
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: "/pages/index/index"
|
url: "/pages/index/index"
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
that.$tools.msg(res.message);
|
that.$tools.msg(res.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//确定年龄
|
//确定年龄
|
||||||
bindDateChange(e) {
|
bindDateChange(e) {
|
||||||
console.log(e.target.value, this.startDate)
|
console.log(e.target.value, this.startDate)
|
||||||
this.birthday = e.target.value
|
this.birthday = e.target.value
|
||||||
},
|
},
|
||||||
onAgeArr(e) {
|
onAgeArr(e) {
|
||||||
this.age = this.ageArr[e.target.value]
|
this.age = this.ageArr[e.target.value]
|
||||||
},
|
},
|
||||||
//确定性别
|
//确定性别
|
||||||
onsexArr(e) {
|
onsexArr(e) {
|
||||||
this.sex = this.sexItem[e.target.value] == "男" ? 1 : 2
|
this.sex = this.sexItem[e.target.value] == "男" ? 1 : 2
|
||||||
},
|
},
|
||||||
onTap() {
|
onTap() {
|
||||||
this.height = ""
|
this.height = ""
|
||||||
this.isHeight = false
|
this.isHeight = false
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
var agedata = []
|
// 导航栏颜色
|
||||||
for (var i = 12; i <= 80; i++) {
|
uni.setNavigationBarColor({
|
||||||
agedata.push(i);
|
frontColor: '#ffffff',
|
||||||
}
|
backgroundColor: this.appTheme,
|
||||||
this.ageArr = agedata
|
})
|
||||||
},
|
var agedata = []
|
||||||
};
|
for (var i = 12; i <= 80; i++) {
|
||||||
|
agedata.push(i);
|
||||||
|
}
|
||||||
|
this.ageArr = agedata
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped="scoped" lang="scss">
|
<style scoped="scoped" lang="scss">
|
||||||
.box {
|
.box {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
// padding: 0 15px;
|
// padding: 0 15px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.touxiang {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
margin: 0 auto;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
input {
|
||||||
|
border: none;
|
||||||
|
background: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headbox {
|
||||||
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
height: 70px;
|
||||||
|
margin: 15px 0 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headimage,
|
||||||
|
.icontouxiang {
|
||||||
|
display: block;
|
||||||
|
width: 70px;
|
||||||
|
height: 70px;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icontouxiang {
|
||||||
|
font-size: 70px;
|
||||||
|
color: $btncolor;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lanBox {
|
||||||
|
padding: 15px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lan {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 14px;
|
||||||
|
padding: 5px 0;
|
||||||
|
margin: 5px 15px;
|
||||||
|
border-bottom: 1px solid #f7f7f7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lan .left {
|
||||||
|
width: 24%;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lan .right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
width: 72%;
|
||||||
|
min-height: 38px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
line-height: 36px;
|
||||||
|
position: relative;
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
|
picker {
|
||||||
|
width: 100%;
|
||||||
|
text-align: right;
|
||||||
|
border: none;
|
||||||
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.touxiang {
|
.iconfont {
|
||||||
position: absolute;
|
color: #333333;
|
||||||
top: 0;
|
font-size: 16px;
|
||||||
margin: 0 auto;
|
position: absolute;
|
||||||
z-index: 2;
|
right: -10px;
|
||||||
|
top: 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
input {
|
.btn {
|
||||||
border: none;
|
width: auto;
|
||||||
background: inherit;
|
margin: 40px 15px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.headbox {
|
.lan2 {
|
||||||
text-align: center;
|
height: 35px;
|
||||||
position: relative;
|
line-height: 35px;
|
||||||
display: flex;
|
background: #f7f7f7;
|
||||||
justify-content: center;
|
font-size: 12px;
|
||||||
height: 70px;
|
padding-left: 15px;
|
||||||
margin: 15px 0 30px;
|
color: #999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.headimage,
|
|
||||||
.icontouxiang {
|
|
||||||
display: block;
|
|
||||||
width: 70px;
|
|
||||||
height: 70px;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.icontouxiang {
|
|
||||||
font-size: 70px;
|
|
||||||
color: $btncolor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lanBox {
|
|
||||||
padding: 15px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lan {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 5px 0;
|
|
||||||
margin: 5px 15px;
|
|
||||||
border-bottom: 1px solid #f7f7f7;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lan .left {
|
|
||||||
width: 24%;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lan .right {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
width: 72%;
|
|
||||||
min-height: 38px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
line-height: 36px;
|
|
||||||
position: relative;
|
|
||||||
text-align: right;
|
|
||||||
|
|
||||||
picker {
|
|
||||||
width: 100%;
|
|
||||||
text-align: right;
|
|
||||||
border: none;
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
color: #333333;
|
|
||||||
font-size: 16px;
|
|
||||||
position: absolute;
|
|
||||||
right: -10px;
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
width: auto;
|
|
||||||
margin: 40px 15px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lan2 {
|
|
||||||
height: 35px;
|
|
||||||
line-height: 35px;
|
|
||||||
background: #f7f7f7;
|
|
||||||
font-size: 12px;
|
|
||||||
padding-left: 15px;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,253 +1,258 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<view class="lanBox">
|
<view class="lanBox">
|
||||||
<form action>
|
<form action>
|
||||||
<view class="headbox">
|
<view class="headbox">
|
||||||
<view class="touxiang">
|
<view class="touxiang">
|
||||||
<image v-if="memInfo.headimg" :src="memInfo.headimg" class="headimage" />
|
<image v-if="memInfo.headimg" :src="memInfo.headimg" class="headimage" />
|
||||||
<icon v-else class="t-icon t-icon-touxiang headimage"></icon>
|
<icon v-else class="t-icon t-icon-touxiang headimage"></icon>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
<view class="lan border-bottom">
|
|
||||||
<view class="left">用户名</view>
|
|
||||||
<view class="right">
|
|
||||||
<input name="name" type="text" v-model="memInfo.name" placeholder="请输入用户名/昵称" />
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="lan border-bottom">
|
|
||||||
<view class="left">性别</view>
|
|
||||||
<view class="right">
|
|
||||||
<picker mode="selector" :range="sexItem" @change="onsexArr">
|
|
||||||
<view class="uni-input">{{!memInfo.sex?'请选择':memInfo.sex==1?'男':'女'}}</view>
|
|
||||||
<icon class="iconfont icon-arrow-down"></icon>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="lan border-bottom">
|
|
||||||
<view class="left">身高</view>
|
|
||||||
<view class="right">
|
|
||||||
<input type="digit" class="mr-5" v-model="memInfo.height" placeholder="请输入身高"/> cm
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="lan border-bottom">
|
|
||||||
<view class="left">出生日期</view>
|
|
||||||
<view class="right">
|
|
||||||
<picker class="picker" mode="date" :end="startDate" :value="memInfo.birthday"
|
|
||||||
@change="bindDateChange">
|
|
||||||
<view class="uni-input">{{memInfo.birthday?memInfo.birthday:"请选择"}}</view>
|
|
||||||
<icon class="iconfont icon-arrow-down"></icon>
|
|
||||||
</picker>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</form>
|
|
||||||
</view>
|
</view>
|
||||||
<view v-if="isHeight" class="slidePopup">
|
<view class="lan border-bottom">
|
||||||
<view class="bg" @click="onTap">
|
<view class="left">用户名</view>
|
||||||
<view class="slide-box" @click.stop>
|
<view class="right">
|
||||||
<view class="btnGroup">
|
<input name="name" type="text" v-model="memInfo.name" placeholder="请输入用户名/昵称" />
|
||||||
<view class="subtn close" @click="onTap">取消</view>
|
</view>
|
||||||
<view class="heightVal">{{memInfo.height}}cm</view>
|
|
||||||
<view class="subtn" @click="isHeight = false">确定</view>
|
|
||||||
</view>
|
|
||||||
<slide-choose v-model="memInfo.height" ref="slide"></slide-choose>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="btn" @click="confirmInfo">提交</view>
|
<view class="lan border-bottom">
|
||||||
|
<view class="left">性别</view>
|
||||||
|
<view class="right">
|
||||||
|
<picker mode="selector" :range="sexItem" @change="onsexArr">
|
||||||
|
<view class="uni-input">{{!memInfo.sex?'请选择':memInfo.sex==1?'男':'女'}}</view>
|
||||||
|
<icon class="iconfont icon-arrow-down"></icon>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="lan border-bottom">
|
||||||
|
<view class="left">身高</view>
|
||||||
|
<view class="right">
|
||||||
|
<input type="digit" class="mr-5" v-model="memInfo.height" placeholder="请输入身高" /> cm
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="lan border-bottom">
|
||||||
|
<view class="left">出生日期</view>
|
||||||
|
<view class="right">
|
||||||
|
<picker class="picker" mode="date" :end="startDate" :value="memInfo.birthday" @change="bindDateChange">
|
||||||
|
<view class="uni-input">{{memInfo.birthday?memInfo.birthday:"请选择"}}</view>
|
||||||
|
<icon class="iconfont icon-arrow-down"></icon>
|
||||||
|
</picker>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</form>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-if="isHeight" class="slidePopup">
|
||||||
|
<view class="bg" @click="onTap">
|
||||||
|
<view class="slide-box" @click.stop>
|
||||||
|
<view class="btnGroup">
|
||||||
|
<view class="subtn close" @click="onTap">取消</view>
|
||||||
|
<view class="heightVal">{{memInfo.height}}cm</view>
|
||||||
|
<view class="subtn" @click="isHeight = false">确定</view>
|
||||||
|
</view>
|
||||||
|
<slide-choose v-model="memInfo.height" ref="slide"></slide-choose>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="btn" @click="confirmInfo">提交</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
ageArr: [],
|
ageArr: [],
|
||||||
sexItem: [
|
sexItem: [
|
||||||
"男",
|
"男",
|
||||||
"女"
|
"女"
|
||||||
],
|
],
|
||||||
isHeight: false,
|
isHeight: false,
|
||||||
isEdit: false,
|
isEdit: false,
|
||||||
memInfo: {
|
memInfo: {
|
||||||
birthday: "",
|
birthday: "",
|
||||||
height: "",
|
height: "",
|
||||||
sex: "",
|
sex: "",
|
||||||
name: ""
|
name: ""
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
},
|
||||||
computed: {
|
};
|
||||||
...mapState(["user"]),
|
},
|
||||||
startDate() {
|
computed: {
|
||||||
return this.$tools.getDate('start');
|
...mapState(["user", "appTheme"]),
|
||||||
|
startDate() {
|
||||||
|
return this.$tools.getDate('start');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 提交
|
||||||
|
confirmInfo() {
|
||||||
|
let that = this
|
||||||
|
that.isHeight = false
|
||||||
|
if (!this.memInfo.name) {
|
||||||
|
this.$tools.msg("请输入用户名")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.memInfo.sex) {
|
||||||
|
this.$tools.msg("请选择性别")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.memInfo.height) {
|
||||||
|
this.$tools.msg("请选则身高")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.memInfo.birthday) {
|
||||||
|
this.$tools.msg("请选择出生日期")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// console.log("提交", this.memInfo)
|
||||||
|
that.subInfo(this.memInfo)
|
||||||
|
},
|
||||||
|
subInfo(data) {
|
||||||
|
let that = this
|
||||||
|
data.fansid = uni.getStorageSync("unionid");
|
||||||
|
that.$model.getsubmit(data).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
if (that.isEdit) {
|
||||||
|
that.$store.dispatch("getUserInfo", {
|
||||||
|
familyid: that.user.id
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
that.$store.dispatch("getFamilyList")
|
||||||
methods: {
|
that.$tools.msg("提交成功");
|
||||||
// 提交
|
uni.navigateBack({
|
||||||
confirmInfo() {
|
delta: 1
|
||||||
let that = this
|
});
|
||||||
that.isHeight = false
|
} else {
|
||||||
if (!this.memInfo.name) {
|
that.$tools.msg(res.message);
|
||||||
this.$tools.msg("请输入用户名")
|
}
|
||||||
return;
|
});
|
||||||
}
|
},
|
||||||
if (!this.memInfo.sex) {
|
//确定年龄
|
||||||
this.$tools.msg("请选择性别")
|
bindDateChange(e) {
|
||||||
return;
|
// console.log("年龄", e)
|
||||||
}
|
this.memInfo.birthday = e.target.value
|
||||||
if (!this.memInfo.height) {
|
},
|
||||||
this.$tools.msg("请选则身高")
|
//确定性别
|
||||||
return;
|
onsexArr(e) {
|
||||||
}
|
// console.log("性别", e)
|
||||||
if (!this.memInfo.birthday) {
|
this.memInfo.sex = this.sexItem[e.target.value] == "男" ? 1 : 2
|
||||||
this.$tools.msg("请选择出生日期")
|
},
|
||||||
return;
|
// 确定身份
|
||||||
}
|
ontypeArr(e) {
|
||||||
// console.log("提交", this.memInfo)
|
this.type = this.typeItem[e.target.value] == "成人" ? 1 : this.typeItem[e.target.value] == "儿童" ? 2 : 3
|
||||||
that.subInfo(this.memInfo)
|
},
|
||||||
},
|
},
|
||||||
subInfo(data) {
|
onLoad(options) {
|
||||||
let that = this
|
// 导航栏颜色
|
||||||
data.fansid = uni.getStorageSync("unionid");
|
uni.setNavigationBarColor({
|
||||||
that.$model.getsubmit(data).then(res => {
|
frontColor: '#ffffff',
|
||||||
if (res.code == 0) {
|
backgroundColor: this.appTheme,
|
||||||
if (that.isEdit) {
|
})
|
||||||
that.$store.dispatch("getUserInfo", {
|
//
|
||||||
familyid: that.user.id
|
var agedata = []
|
||||||
})
|
for (var i = 12; i <= 80; i++) {
|
||||||
}
|
agedata.push(i);
|
||||||
that.$store.dispatch("getFamilyList")
|
}
|
||||||
that.$tools.msg("提交成功");
|
this.ageArr = agedata
|
||||||
uni.navigateBack({
|
// 编辑
|
||||||
delta: 1
|
if (options.familayData) {
|
||||||
});
|
let info = options.familayData
|
||||||
} else {
|
this.memInfo = JSON.parse(info)
|
||||||
that.$tools.msg(res.message);
|
this.isEdit = true
|
||||||
}
|
// console.log("编辑", this.memInfo)
|
||||||
});
|
}
|
||||||
},
|
// 添加
|
||||||
//确定年龄
|
if (options.type) {
|
||||||
bindDateChange(e) {
|
this.isEdit = false
|
||||||
// console.log("年龄", e)
|
this.memInfo = {
|
||||||
this.memInfo.birthday = e.target.value
|
birthday: "",
|
||||||
},
|
height: "",
|
||||||
//确定性别
|
sex: "",
|
||||||
onsexArr(e) {
|
name: ""
|
||||||
// console.log("性别", e)
|
}
|
||||||
this.memInfo.sex = this.sexItem[e.target.value] == "男" ? 1 : 2
|
}
|
||||||
},
|
},
|
||||||
// 确定身份
|
};
|
||||||
ontypeArr(e) {
|
|
||||||
this.type = this.typeItem[e.target.value] == "成人" ? 1 : this.typeItem[e.target.value] == "儿童" ? 2 : 3
|
|
||||||
},
|
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
var agedata = []
|
|
||||||
for (var i = 12; i <= 80; i++) {
|
|
||||||
agedata.push(i);
|
|
||||||
}
|
|
||||||
this.ageArr = agedata
|
|
||||||
// 编辑
|
|
||||||
if (options.familayData) {
|
|
||||||
let info = options.familayData
|
|
||||||
this.memInfo = JSON.parse(info)
|
|
||||||
this.isEdit = true
|
|
||||||
// console.log("编辑", this.memInfo)
|
|
||||||
}
|
|
||||||
// 添加
|
|
||||||
if (options.type) {
|
|
||||||
this.isEdit = false
|
|
||||||
this.memInfo = {
|
|
||||||
birthday: "",
|
|
||||||
height: "",
|
|
||||||
sex: "",
|
|
||||||
name: ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped="scoped" lang="scss">
|
<style scoped="scoped" lang="scss">
|
||||||
.box {
|
.box {
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headimage,
|
||||||
|
.icontouxiang {
|
||||||
|
display: block;
|
||||||
|
width: 65px;
|
||||||
|
height: 65px;
|
||||||
|
font-size: 65px;
|
||||||
|
color: $btncolor;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.headbox {
|
||||||
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
height: 65px;
|
||||||
|
margin: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lanBox {
|
||||||
|
padding: 15px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lan {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 14px;
|
||||||
|
padding: 5px 0;
|
||||||
|
margin: 4px auto;
|
||||||
|
border-bottom: 1px solid #f7f7f7;
|
||||||
|
|
||||||
|
input {
|
||||||
|
border: none;
|
||||||
|
background: inherit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.lan .left {
|
||||||
|
width: 24%;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lan .right {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end;
|
||||||
|
width: 72%;
|
||||||
|
min-height: 38px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
line-height: 36px;
|
||||||
|
position: relative;
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
|
picker {
|
||||||
|
width: 100%;
|
||||||
|
text-align: right;
|
||||||
|
border: none;
|
||||||
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.headimage,
|
.iconfont {
|
||||||
.icontouxiang {
|
color: #333333;
|
||||||
display: block;
|
font-size: 16px;
|
||||||
width: 65px;
|
position: absolute;
|
||||||
height: 65px;
|
right: -10px;
|
||||||
font-size: 65px;
|
top: 0;
|
||||||
color: $btncolor;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.headbox {
|
.btn {
|
||||||
text-align: center;
|
margin: 10px auto 0;
|
||||||
position: relative;
|
}
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
height: 65px;
|
|
||||||
margin: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lanBox {
|
|
||||||
padding: 15px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lan {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 5px 0;
|
|
||||||
margin: 4px auto;
|
|
||||||
border-bottom: 1px solid #f7f7f7;
|
|
||||||
|
|
||||||
input {
|
|
||||||
border: none;
|
|
||||||
background: inherit;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.lan .left {
|
|
||||||
width: 24%;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lan .right {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
width: 72%;
|
|
||||||
min-height: 38px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
line-height: 36px;
|
|
||||||
position: relative;
|
|
||||||
text-align: right;
|
|
||||||
|
|
||||||
picker {
|
|
||||||
width: 100%;
|
|
||||||
text-align: right;
|
|
||||||
border: none;
|
|
||||||
margin-right: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.iconfont {
|
|
||||||
color: #333333;
|
|
||||||
font-size: 16px;
|
|
||||||
position: absolute;
|
|
||||||
right: -10px;
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
margin: 10px auto 0;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,319 +1,325 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="common">
|
<view class="common">
|
||||||
<view class="header" v-if="info">
|
<view class="header" v-if="info" :style="{background:appTheme}">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<image :src="info.headimg" class="image1" />
|
<image :src="info.headimg" class="image1" />
|
||||||
<view class="left_sm">
|
<view class="left_sm">
|
||||||
<view class="name">
|
<view class="name">
|
||||||
<view>{{info.name?info.name:""}}</view>
|
<view>{{info.name?info.name:""}}</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view v-if="info.isself != 1" @click="deldet(Infoid)" class="guanliyuan">删除</view>
|
<view v-if="info.isself != 1" @click="deldet(Infoid)" class="guanliyuan">删除</view>
|
||||||
<view @click="editorInfo()" class="guanliyuan">编辑</view>
|
<view @click="editorInfo()" class="guanliyuan">编辑</view>
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="mt-5">
|
|
||||||
<text>{{info.sex==0?'未知':info.sex==2?'女':'男'}}</text>
|
|
||||||
<text>{{info.height}}cm</text>
|
|
||||||
<text>{{info.mage?info.mage:"0岁"}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="mt-5">
|
||||||
|
<text>{{info.sex==0?'未知':info.sex==2?'女':'男'}}</text>
|
||||||
|
<text>{{info.height}}cm</text>
|
||||||
|
<text>{{info.mage?info.mage:"0岁"}}</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view scroll-y class="list ">
|
</view>
|
||||||
<view class="history" v-if="ranklist.length">
|
|
||||||
<view class="list-item" v-for="(item ,index) in ranklist" :key="index">
|
|
||||||
<view class="item">
|
|
||||||
<view class="time">
|
|
||||||
<icon class="t-icon t-icon-shijian-mianxing-0"></icon>
|
|
||||||
<text>{{item.createtime}}</text>
|
|
||||||
</view>
|
|
||||||
<view>{{item.height}}<text>身高</text></view>
|
|
||||||
<view>{{item.weight}}<text>体重</text></view>
|
|
||||||
<view>{{item.bmi}}<text>BMI</text></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="endtext" v-if="!lastPage || page >= lastPage">—— 到底了,看看别的吧 ——</view>
|
|
||||||
</view>
|
|
||||||
<view class="nolist" v-else>
|
|
||||||
<icon class="iconfont icon-zanwu"></icon>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
</view>
|
||||||
|
<scroll-view scroll-y class="list ">
|
||||||
|
<view class="history" v-if="ranklist.length">
|
||||||
|
<view class="list-item" v-for="(item ,index) in ranklist" :key="index">
|
||||||
|
<view class="item">
|
||||||
|
<view class="time">
|
||||||
|
<icon class="t-icon t-icon-shijian-mianxing-0"></icon>
|
||||||
|
<text>{{item.createtime}}</text>
|
||||||
|
</view>
|
||||||
|
<view>{{item.height}}<text>身高</text></view>
|
||||||
|
<view>{{item.weight}}<text>体重</text></view>
|
||||||
|
<view>{{item.bmi}}<text>BMI</text></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="endtext" v-if="!lastPage || page >= lastPage">—— 到底了,看看别的吧 ——</view>
|
||||||
|
</view>
|
||||||
|
<view class="nolist" v-else>
|
||||||
|
<icon class="iconfont icon-zanwu"></icon>
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
ranklist: [],
|
ranklist: [],
|
||||||
info: {},
|
info: {},
|
||||||
memberText: null,
|
memberText: null,
|
||||||
memberType: [],
|
memberType: [],
|
||||||
page: 1,
|
page: 1,
|
||||||
lastPage: '',
|
lastPage: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["user", "appTheme"])
|
||||||
|
},
|
||||||
|
onLoad(option) {
|
||||||
|
// 导航栏颜色
|
||||||
|
uni.setNavigationBarColor({
|
||||||
|
frontColor: '#ffffff',
|
||||||
|
backgroundColor: this.appTheme,
|
||||||
|
})
|
||||||
|
//
|
||||||
|
this.page = 1
|
||||||
|
this.ranklist = []
|
||||||
|
console.log("id", option)
|
||||||
|
if (option.id) {
|
||||||
|
this.Infoid = option.id
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.ranklist = []
|
||||||
|
this.gethistory(this.Infoid)
|
||||||
|
this.getHistoryList(this.Infoid)
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
console.log(this.lastPage, this.page)
|
||||||
|
if (!this.lastPage || this.page >= this.lastPage) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '没有更多数据!',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.page++
|
||||||
|
this.getHistoryList(this.Infoid)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 历史记录
|
||||||
|
getHistoryList(id) {
|
||||||
|
this.$model.getHistoryList({
|
||||||
|
familyId: id,
|
||||||
|
pageNo: this.page,
|
||||||
|
pageSize: 10,
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code != 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.ranklist = this.ranklist.concat(res.data.rows)
|
||||||
|
this.lastPage = res.data.totalpage
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 信息
|
||||||
|
gethistory(id) {
|
||||||
|
this.$model.getdetail({
|
||||||
|
id: id
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code != 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.info = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 编辑
|
||||||
|
editorInfo() {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pageTwo/me/adduser?familayData=" + JSON.stringify(this.info),
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//删除
|
||||||
|
deldet(id) {
|
||||||
|
let that = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '友情提示',
|
||||||
|
content: '确定删除该成员吗',
|
||||||
|
success: function(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
that.$model.getdelete({
|
||||||
|
id: id,
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code != 0) return
|
||||||
|
that.$tools.msg("删除成功!");
|
||||||
|
that.getFamilyList()
|
||||||
|
})
|
||||||
|
} else if (res.cancel) {
|
||||||
|
that.$tools.msg("您已取消删除!");
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
computed: {
|
});
|
||||||
...mapState(["user"])
|
},
|
||||||
},
|
getFamilyList() {
|
||||||
onLoad(option) {
|
let that = this
|
||||||
this.page = 1
|
that.$model.getFamilyList({}).then(res => {
|
||||||
this.ranklist = []
|
that.$store.commit("changeFamilay", res)
|
||||||
console.log("id", option)
|
that.$store.dispatch("getUserInfo", {
|
||||||
if (option.id) {
|
familyid: res[0].familyid
|
||||||
this.Infoid = option.id
|
})
|
||||||
}
|
uni.switchTab({
|
||||||
},
|
url: '/pages/me/me'
|
||||||
onShow() {
|
});
|
||||||
this.ranklist = []
|
}).catch(e => {})
|
||||||
this.gethistory(this.Infoid)
|
},
|
||||||
this.getHistoryList(this.Infoid)
|
},
|
||||||
},
|
}
|
||||||
onReachBottom() {
|
|
||||||
console.log(this.lastPage, this.page)
|
|
||||||
if (!this.lastPage || this.page >= this.lastPage) {
|
|
||||||
uni.showToast({
|
|
||||||
title: '没有更多数据!',
|
|
||||||
icon: 'none'
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.page++
|
|
||||||
this.getHistoryList(this.Infoid)
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 历史记录
|
|
||||||
getHistoryList(id) {
|
|
||||||
this.$model.getHistoryList({
|
|
||||||
familyId: id,
|
|
||||||
pageNo: this.page,
|
|
||||||
pageSize: 10,
|
|
||||||
}).then((res) => {
|
|
||||||
if (res.code != 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.ranklist = this.ranklist.concat(res.data.rows)
|
|
||||||
this.lastPage = res.data.totalpage
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 信息
|
|
||||||
gethistory(id) {
|
|
||||||
this.$model.getdetail({
|
|
||||||
id: id
|
|
||||||
}).then((res) => {
|
|
||||||
if (res.code != 0) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.info = res.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 编辑
|
|
||||||
editorInfo() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/me/adduser?familayData=" + JSON.stringify(this.info),
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//删除
|
|
||||||
deldet(id) {
|
|
||||||
let that = this
|
|
||||||
uni.showModal({
|
|
||||||
title: '友情提示',
|
|
||||||
content: '确定删除该成员吗',
|
|
||||||
success: function(res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
that.$model.getdelete({
|
|
||||||
id: id,
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code != 0) return
|
|
||||||
that.$tools.msg("删除成功!");
|
|
||||||
that.getFamilyList()
|
|
||||||
})
|
|
||||||
} else if (res.cancel) {
|
|
||||||
that.$tools.msg("您已取消删除!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getFamilyList() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getFamilyList({}).then(res => {
|
|
||||||
that.$store.commit("changeFamilay", res)
|
|
||||||
that.$store.dispatch("getUserInfo", {
|
|
||||||
familyid: res[0].familyid
|
|
||||||
})
|
|
||||||
uni.switchTab({
|
|
||||||
url: '/pages/me/me'
|
|
||||||
});
|
|
||||||
}).catch(e => {})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped="scoped" lang="scss">
|
<style scoped="scoped" lang="scss">
|
||||||
.list {
|
.list {
|
||||||
margin-top: 80px;
|
margin-top: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list-item {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
text-align: center;
|
||||||
|
margin: 10px 0 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 5px 10px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
border-radius: 10px;
|
||||||
|
align-items: center;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 32rpx;
|
||||||
|
font-weight: 700;
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
line-height: 40rpx;
|
||||||
|
|
||||||
|
text {
|
||||||
|
width: 100%;
|
||||||
|
font-size: 24rpx;
|
||||||
|
display: block;
|
||||||
|
color: #666;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-item {
|
view {
|
||||||
|
width: 18%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time {
|
||||||
|
width: 32% !important;
|
||||||
|
font-size: 28rpx;
|
||||||
|
color: #666;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
text {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: auto;
|
font-size: 28rpx;
|
||||||
text-align: center;
|
margin-top: 3px;
|
||||||
margin: 10px 0 15px;
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.item {
|
}
|
||||||
background-color: #fff;
|
|
||||||
padding: 5px 10px;
|
//
|
||||||
display: flex;
|
.common {
|
||||||
justify-content: space-between;
|
padding: 0 15px;
|
||||||
border-radius: 10px;
|
min-height: calc(100vh - 90px);
|
||||||
align-items: center;
|
height: 100%;
|
||||||
text-align: center;
|
}
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: 700;
|
.header {
|
||||||
margin-bottom: 30rpx;
|
height: 90px;
|
||||||
line-height: 40rpx;
|
background: $mainColor;
|
||||||
|
position: fixed;
|
||||||
|
top: 0rem;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
display: flex;
|
||||||
|
z-index: 99;
|
||||||
|
padding: 0 10px;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: start;
|
||||||
|
align-items: center;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.left_sm {
|
||||||
|
text-align: left;
|
||||||
|
color: #FFFFFF;
|
||||||
|
position: absolute;
|
||||||
|
left: 60px;
|
||||||
|
top: 25px;
|
||||||
|
right: 0;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
text {
|
text {
|
||||||
width: 100%;
|
display: inline-block;
|
||||||
font-size: 24rpx;
|
padding-right: 10px;
|
||||||
display: block;
|
font-size: 14px;
|
||||||
color: #666;
|
|
||||||
text-align: center;
|
|
||||||
font-weight: 400;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
view {
|
.type,
|
||||||
width: 18%;
|
.type2 {
|
||||||
}
|
background: #fff;
|
||||||
|
text-align: center;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 3px !important;
|
||||||
|
font-size: 12px !important;
|
||||||
|
border-radius: 10px;
|
||||||
|
line-height: initial;
|
||||||
|
color: $btncolor;
|
||||||
|
}
|
||||||
|
|
||||||
.time {
|
.image1 {
|
||||||
width: 32% !important;
|
width: 50px;
|
||||||
font-size: 28rpx;
|
height: 50px;
|
||||||
color: #666;
|
float: left;
|
||||||
display: flex;
|
border-radius: 50%;
|
||||||
align-items: center;
|
}
|
||||||
justify-content: center;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 40rpx;
|
|
||||||
height: 40rpx;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
width: 100%;
|
|
||||||
font-size: 28rpx;
|
|
||||||
margin-top: 3px;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
p {
|
||||||
|
text-align: left;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
.right {
|
||||||
.common {
|
display: flex;
|
||||||
padding: 0 15px;
|
align-items: center;
|
||||||
min-height: calc(100vh - 90px);
|
color: #fff;
|
||||||
height: 100%;
|
text-align: right;
|
||||||
|
font-size: 14px;
|
||||||
|
|
||||||
|
.guanliyuan {
|
||||||
|
border: 1px solid #fff;
|
||||||
|
padding: 2px 6px;
|
||||||
|
border-radius: 10px;
|
||||||
|
font-size: 12px;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.header {
|
.leftChild {
|
||||||
height: 90px;
|
width: 100% !important;
|
||||||
background: $mainColor;
|
padding: 10px 0 !important;
|
||||||
position: fixed;
|
|
||||||
top: 0rem;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
display: flex;
|
|
||||||
z-index: 99;
|
|
||||||
padding: 0 10px;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.left {
|
view {
|
||||||
width: 100%;
|
min-width: auto !important;
|
||||||
display: flex;
|
|
||||||
justify-content: start;
|
|
||||||
align-items: center;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.left_sm {
|
|
||||||
text-align: left;
|
|
||||||
color: #FFFFFF;
|
|
||||||
position: absolute;
|
|
||||||
left: 60px;
|
|
||||||
top: 25px;
|
|
||||||
right: 0;
|
|
||||||
|
|
||||||
.name {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
display: inline-block;
|
|
||||||
padding-right: 10px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.type,
|
|
||||||
.type2 {
|
|
||||||
background: #fff;
|
|
||||||
text-align: center;
|
|
||||||
display: inline-block;
|
|
||||||
padding: 0 3px !important;
|
|
||||||
font-size: 12px !important;
|
|
||||||
border-radius: 10px;
|
|
||||||
line-height: initial;
|
|
||||||
color: $btncolor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image1 {
|
|
||||||
width: 50px;
|
|
||||||
height: 50px;
|
|
||||||
float: left;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
text-align: left;
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.right {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
color: #fff;
|
|
||||||
text-align: right;
|
|
||||||
font-size: 14px;
|
|
||||||
|
|
||||||
.guanliyuan {
|
|
||||||
border: 1px solid #fff;
|
|
||||||
padding: 2px 6px;
|
|
||||||
border-radius: 10px;
|
|
||||||
font-size: 12px;
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.leftChild {
|
|
||||||
width: 100% !important;
|
|
||||||
padding: 10px 0 !important;
|
|
||||||
|
|
||||||
view {
|
|
||||||
min-width: auto !important;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,103 +1,115 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="formbox">
|
<view class="formbox">
|
||||||
<view class="input">
|
<view class="input">
|
||||||
<view class="t-icon t-icon-dianhuatianchong"></view>
|
<view class="t-icon t-icon-dianhuatianchong"></view>
|
||||||
<input type="text" v-model="formdata.phone" placeholder="在此输入您的联系方式" />
|
<input type="text" v-model="formdata.phone" placeholder="在此输入您的联系方式" />
|
||||||
</view>
|
</view>
|
||||||
<view class="input textarea">
|
<view class="input textarea">
|
||||||
<view class="t-icon t-icon-xinxi"></view>
|
<view class="t-icon t-icon-xinxi"></view>
|
||||||
<textarea v-model="formdata.content" name="content" placeholder-style="font-size:13px;margin-top:10px;"
|
<textarea v-model="formdata.content" name="content" placeholder-style="font-size:13px;margin-top:10px;"
|
||||||
placeholder="有什么想说的,尽管来吧..." />
|
placeholder="有什么想说的,尽管来吧..." />
|
||||||
</view>
|
</view>
|
||||||
<view class="btn " type="button" @click="submit">提交</view>
|
<view class="btn " type="button" @click="submit">提交</view>
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
import {
|
||||||
data() {
|
mapState
|
||||||
return {
|
} from "vuex";
|
||||||
formdata: {
|
export default {
|
||||||
phone: "",
|
data() {
|
||||||
content: ""
|
return {
|
||||||
},
|
formdata: {
|
||||||
}
|
phone: "",
|
||||||
|
content: ""
|
||||||
},
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(["appTheme"])
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
// 导航栏颜色
|
||||||
|
uni.setNavigationBarColor({
|
||||||
|
frontColor: '#ffffff',
|
||||||
|
backgroundColor: this.appTheme,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
submit() {
|
||||||
|
if (!this.formdata.phone.trim()) {
|
||||||
|
this.$tools.msg("请输入联系方式");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (!/(^1[3|4|5|7|8][0-9]{9}$)/.test(this.formdata.phone)) {
|
||||||
|
this.$tools.msg('请输入正确的联系方式');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.formdata.content.trim()) {
|
||||||
|
this.$tools.msg("请输入建议");
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$model.submitadvice(this.formdata).then((res) => {
|
||||||
|
this.$tools.msg(res.message)
|
||||||
|
setTimeout(function() {
|
||||||
|
uni.switchTab({
|
||||||
|
url: "/pages/me/me"
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
|
||||||
methods: {
|
}).catch((res) => {
|
||||||
submit() {
|
this.$tools.msg('提交失败,请稍后重试!')
|
||||||
if (!this.formdata.phone.trim()) {
|
});
|
||||||
this.$tools.msg("请输入联系方式");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (!/(^1[3|4|5|7|8][0-9]{9}$)/.test(this.formdata.phone)) {
|
|
||||||
this.$tools.msg('请输入正确的联系方式');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.formdata.content.trim()) {
|
|
||||||
this.$tools.msg("请输入建议");
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.$model.submitadvice(this.formdata).then((res) => {
|
|
||||||
this.$tools.msg(res.message)
|
|
||||||
setTimeout(function() {
|
|
||||||
uni.switchTab({
|
|
||||||
url: "/pages/me/me"
|
|
||||||
})
|
|
||||||
}, 500)
|
|
||||||
|
|
||||||
}).catch((res) => {
|
}
|
||||||
this.$tools.msg('提交失败,请稍后重试!')
|
},
|
||||||
});
|
}
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.content {
|
.content {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formbox {
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
margin: 0;
|
||||||
|
display: flex;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 10px;
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
border: 1px solid #f7f7f7;
|
||||||
|
|
||||||
|
input {
|
||||||
|
width: 100%;
|
||||||
|
height: 1.5rem;
|
||||||
|
line-height: 1.5rem;
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.formbox {
|
/deep/textarea {
|
||||||
padding: 15px;
|
width: 100%;
|
||||||
|
height: 6.5rem;
|
||||||
|
line-height: 0;
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.input {
|
.btn {
|
||||||
margin: 0;
|
display: block;
|
||||||
display: flex;
|
margin: 30px auto;
|
||||||
border-radius: 5px;
|
font-size: 14px;
|
||||||
padding: 10px;
|
}
|
||||||
margin-bottom: 1rem;
|
|
||||||
border: 1px solid #f7f7f7;
|
|
||||||
|
|
||||||
input {
|
|
||||||
width: 100%;
|
|
||||||
height: 1.5rem;
|
|
||||||
line-height: 1.5rem;
|
|
||||||
background: none;
|
|
||||||
border: none;
|
|
||||||
font-size: 14px;
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/deep/textarea {
|
|
||||||
width: 100%;
|
|
||||||
height: 6.5rem;
|
|
||||||
line-height: 0;
|
|
||||||
background: none;
|
|
||||||
border: none;
|
|
||||||
font-size: 14px;
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn {
|
|
||||||
display: block;
|
|
||||||
margin: 30px auto;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,165 +1,170 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="common">
|
<view class="common">
|
||||||
<view class="history" v-if="ranklist.length">
|
<view class="history" v-if="ranklist.length">
|
||||||
<delectList :list="ranklist" :type="user.type" :border="false" @changeDelete="changeDelete"></delectList>
|
<delectList :list="ranklist" :type="user.type" :border="false" @changeDelete="changeDelete"></delectList>
|
||||||
<view class="endtext" v-if="!lastPage || page >= lastPage">—— 到底了,看看别的吧 ——</view>
|
<view class="endtext" v-if="!lastPage || page >= lastPage">—— 到底了,看看别的吧 ——</view>
|
||||||
</view>
|
|
||||||
<view class="nolist" v-if="!lastPage">
|
|
||||||
<icon class="iconfont icon-zanwu"></icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
<view class="nolist" v-if="!lastPage">
|
||||||
|
<icon class="iconfont icon-zanwu"></icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import delectList from "@/components/mark-slide-list/mark-slide-list.vue"
|
import delectList from "@/components/mark-slide-list/mark-slide-list.vue"
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
delectList
|
delectList
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['user']),
|
...mapState(['user', "appTheme"]),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
buttonList: [{
|
buttonList: [{
|
||||||
title: '删除',
|
title: '删除',
|
||||||
background: '#ff3b32'
|
background: '#ff3b32'
|
||||||
}],
|
}],
|
||||||
list: [
|
list: [
|
||||||
"测量时间",
|
"测量时间",
|
||||||
"体重",
|
"体重",
|
||||||
"BMI",
|
"BMI",
|
||||||
"操作",
|
"操作",
|
||||||
],
|
],
|
||||||
ranklist: [],
|
ranklist: [],
|
||||||
page: 1,
|
page: 1,
|
||||||
lastPage: 1,
|
lastPage: 1,
|
||||||
type: null,
|
type: null,
|
||||||
id: null,
|
id: null,
|
||||||
startX: 0,
|
startX: 0,
|
||||||
endX: 0
|
endX: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
let that = this
|
||||||
|
// 导航栏颜色
|
||||||
|
uni.setNavigationBarColor({
|
||||||
|
frontColor: '#ffffff',
|
||||||
|
backgroundColor: that.appTheme,
|
||||||
|
})
|
||||||
|
that.getList(1)
|
||||||
|
},
|
||||||
|
onReachBottom() {
|
||||||
|
let that = this
|
||||||
|
console.log("this.lastPage", this.lastPage)
|
||||||
|
if (!this.lastPage || this.page >= this.lastPage) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '没有更多数据!',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.page++
|
||||||
|
this.getList(this.page)
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
changeDelete(item) {
|
||||||
|
let that = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '友情提示',
|
||||||
|
content: '是否删除当前测量记录?',
|
||||||
|
success: function(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
that.$model.gethistorydelete({
|
||||||
|
id: item.id,
|
||||||
|
}).then((res) => {
|
||||||
|
if (res.code != 0) {
|
||||||
|
that.$tools.msg(res.message)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
that.ranklist.splice(that.ranklist.findIndex(ite => ite.id === item
|
||||||
|
.id), 1)
|
||||||
|
that.$store.dispatch("getUserInfo", {
|
||||||
|
familyid: that.user.familyid,
|
||||||
|
})
|
||||||
|
that.$store.dispatch("getResult", {
|
||||||
|
birthday: that.user.birthday,
|
||||||
|
familyid: that.user.familyid,
|
||||||
|
height: that.user.height,
|
||||||
|
sex: that.user.sex,
|
||||||
|
})
|
||||||
|
|
||||||
|
that.$tools.msg("删除成功")
|
||||||
|
})
|
||||||
|
} else if (res.cancel) {
|
||||||
|
that.$tools.msg("您已取消操作!");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
})
|
||||||
let that = this
|
},
|
||||||
that.getList(1)
|
getList(page) {
|
||||||
},
|
let that = this
|
||||||
onReachBottom() {
|
that.$model.getHistoryList({
|
||||||
let that = this
|
familyId: that.user.familyid,
|
||||||
console.log("this.lastPage", this.lastPage)
|
pageNo: page,
|
||||||
if (!this.lastPage || this.page >= this.lastPage) {
|
pageSize: 10
|
||||||
uni.showToast({
|
}).then((res) => {
|
||||||
title: '没有更多数据!',
|
console.log("历史记录", res)
|
||||||
icon: 'none'
|
if (res.code != 0) return
|
||||||
})
|
res.data.rows.forEach(item => {
|
||||||
return
|
item.slide_x = 0
|
||||||
}
|
})
|
||||||
this.page++
|
this.ranklist = this.ranklist.concat(res.data.rows)
|
||||||
this.getList(this.page)
|
this.lastPage = res.data.totalpage
|
||||||
},
|
})
|
||||||
methods: {
|
},
|
||||||
changeDelete(item) {
|
// 滑动开始
|
||||||
let that = this
|
touchStart(e) {
|
||||||
uni.showModal({
|
// 记录初始位置
|
||||||
title: '友情提示',
|
this.startX = e.touches[0].clientX
|
||||||
content: '是否删除当前测量记录?',
|
},
|
||||||
success: function(res) {
|
// 滑动结束
|
||||||
if (res.confirm) {
|
touchEnd(e) {
|
||||||
that.$model.gethistorydelete({
|
console.log("2", e)
|
||||||
id: item.id,
|
// 当前滑动的父级元素
|
||||||
}).then((res) => {
|
let parentElement = e.currentTarget
|
||||||
if (res.code != 0) {
|
// 记录结束位置
|
||||||
that.$tools.msg(res.message)
|
this.endX = e.changedTouches[0].clientX
|
||||||
return
|
// 左滑
|
||||||
}
|
if (parentElement.dataset.type == 0 && this.startX - this.endX > 30) {
|
||||||
that.ranklist.splice(that.ranklist.findIndex(ite => ite.id === item
|
this.restSlide()
|
||||||
.id), 1)
|
parentElement.dataset.type = 1
|
||||||
that.$store.dispatch("getUserInfo", {
|
|
||||||
familyid: that.user.familyid,
|
|
||||||
})
|
|
||||||
that.$store.dispatch("getResult", {
|
|
||||||
birthday: that.user.birthday,
|
|
||||||
familyid: that.user.familyid,
|
|
||||||
height: that.user.height,
|
|
||||||
sex: that.user.sex,
|
|
||||||
})
|
|
||||||
|
|
||||||
that.$tools.msg("删除成功")
|
|
||||||
})
|
|
||||||
} else if (res.cancel) {
|
|
||||||
that.$tools.msg("您已取消操作!");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getList(page) {
|
|
||||||
let that = this
|
|
||||||
that.$model.getHistoryList({
|
|
||||||
familyId: that.user.familyid,
|
|
||||||
pageNo: page,
|
|
||||||
pageSize: 10
|
|
||||||
}).then((res) => {
|
|
||||||
console.log("历史记录", res)
|
|
||||||
if (res.code != 0) return
|
|
||||||
res.data.rows.forEach(item => {
|
|
||||||
item.slide_x = 0
|
|
||||||
})
|
|
||||||
this.ranklist = this.ranklist.concat(res.data.rows)
|
|
||||||
this.lastPage = res.data.totalpage
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 滑动开始
|
|
||||||
touchStart(e) {
|
|
||||||
// 记录初始位置
|
|
||||||
this.startX = e.touches[0].clientX
|
|
||||||
},
|
|
||||||
// 滑动结束
|
|
||||||
touchEnd(e) {
|
|
||||||
console.log("2", e)
|
|
||||||
// 当前滑动的父级元素
|
|
||||||
let parentElement = e.currentTarget
|
|
||||||
// 记录结束位置
|
|
||||||
this.endX = e.changedTouches[0].clientX
|
|
||||||
// 左滑
|
|
||||||
if (parentElement.dataset.type == 0 && this.startX - this.endX > 30) {
|
|
||||||
this.restSlide()
|
|
||||||
parentElement.dataset.type = 1
|
|
||||||
}
|
|
||||||
// 右滑
|
|
||||||
if (parentElement.dataset.type == 1 && this.startX - this.endX < -30) {
|
|
||||||
this.restSlide()
|
|
||||||
parentElement.dataset.type = 0
|
|
||||||
}
|
|
||||||
this.startX = 0
|
|
||||||
this.endX = 0
|
|
||||||
},
|
|
||||||
// 判断当前是否有滑块处于滑动状态
|
|
||||||
checkSlide() {
|
|
||||||
let listItems = document.querySelectorAll('.list')
|
|
||||||
for (let i = 0; i < listItems.length; i++) {
|
|
||||||
if (listItems[i].dataset.type == 1) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
},
|
|
||||||
// 复位滑动状态
|
|
||||||
restSlide() {
|
|
||||||
let listItems = document.querySelectorAll('list')
|
|
||||||
// 复位
|
|
||||||
for (let i = 0; i < listItems.length; i++) {
|
|
||||||
listItems[i].dataset.type = 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
// 右滑
|
||||||
|
if (parentElement.dataset.type == 1 && this.startX - this.endX < -30) {
|
||||||
|
this.restSlide()
|
||||||
|
parentElement.dataset.type = 0
|
||||||
|
}
|
||||||
|
this.startX = 0
|
||||||
|
this.endX = 0
|
||||||
|
},
|
||||||
|
// 判断当前是否有滑块处于滑动状态
|
||||||
|
checkSlide() {
|
||||||
|
let listItems = document.querySelectorAll('.list')
|
||||||
|
for (let i = 0; i < listItems.length; i++) {
|
||||||
|
if (listItems[i].dataset.type == 1) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
// 复位滑动状态
|
||||||
|
restSlide() {
|
||||||
|
let listItems = document.querySelectorAll('list')
|
||||||
|
// 复位
|
||||||
|
for (let i = 0; i < listItems.length; i++) {
|
||||||
|
listItems[i].dataset.type = 0
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped="scoped" lang="scss">
|
<style scoped="scoped" lang="scss">
|
||||||
.common {
|
.common {
|
||||||
min-height: calc(100vh - 40px);
|
min-height: calc(100vh - 40px);
|
||||||
padding-bottom: 15px
|
padding-bottom: 15px
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,22 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<view class="form lanBox">
|
<view class="form lanBox">
|
||||||
<view class="lan border-bottom" v-for="(item,index) in list" :key="index">
|
<view class="lan border-bottom" v-for="(item,index) in list" :key="index">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="icon">
|
<view class="icon">
|
||||||
<icon class="t-icon" :class="'t-icon-'+item.key"></icon>
|
<icon class="t-icon" :class="'t-icon-'+item.key"></icon>
|
||||||
</view>
|
</view>
|
||||||
{{item.title}}
|
{{item.title}}
|
||||||
</view>
|
</view>
|
||||||
<view class="center">
|
<view class="center">
|
||||||
<view v-if="item.title!='肥胖等级'">
|
<view v-if="item.title!='肥胖等级'">
|
||||||
<text>{{item.fvalue?item.fvalue:"0"}}</text><text v-if="item.dw">{{item.dw}}</text>
|
<text>{{item.fvalue?item.fvalue:"0"}}</text><text v-if="item.dw">{{item.dw}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="item.title=='肥胖等级'"><text>{{item.fevaluation}}</text></view>
|
<view v-if="item.title=='肥胖等级'"><text>{{item.fevaluation}}</text></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="lan border-bottom">
|
<!-- <view class="lan border-bottom">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<image src="@/static/weight.png"></image>体重
|
<image src="@/static/weight.png"></image>体重
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -124,76 +124,88 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="right">{{memInfo.body?memInfo.body:'0'}}</view>
|
<view class="right">{{memInfo.body?memInfo.body:'0'}}</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
import {
|
||||||
data() {
|
mapState
|
||||||
return {
|
} from "vuex";
|
||||||
list: {},
|
export default {
|
||||||
};
|
data() {
|
||||||
},
|
return {
|
||||||
onLoad(options) {
|
list: {},
|
||||||
let info = options.index
|
};
|
||||||
let memInfo = JSON.parse(info)
|
},
|
||||||
this.list = this.weightInfo.infoList(memInfo)
|
computed: {
|
||||||
console.log(this.list)
|
...mapState(["appTheme"])
|
||||||
}
|
},
|
||||||
};
|
onLoad(options) {
|
||||||
|
// 导航栏颜色
|
||||||
|
uni.setNavigationBarColor({
|
||||||
|
frontColor: '#ffffff',
|
||||||
|
backgroundColor: this.appTheme,
|
||||||
|
})
|
||||||
|
//
|
||||||
|
let info = options.index
|
||||||
|
let memInfo = JSON.parse(info)
|
||||||
|
this.list = this.weightInfo.infoList(memInfo)
|
||||||
|
console.log(this.list)
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped="scoped" lang="scss">
|
<style scoped="scoped" lang="scss">
|
||||||
.box {
|
.box {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lanBox {
|
.lanBox {
|
||||||
padding: 0px 15px 0;
|
padding: 0px 15px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lan {
|
.lan {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
line-height: 50px;
|
line-height: 50px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
border-bottom: 1px solid #f7f7f7;
|
border-bottom: 1px solid #f7f7f7;
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
padding-left: 30px;
|
padding-left: 30px;
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
width: 18px;
|
width: 18px;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 15px;
|
left: 15px;
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
background-color: #aaa;
|
background-color: #aaa;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
min-height: 38px;
|
min-height: 38px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
line-height: 36px;
|
line-height: 36px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,115 +1,121 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="common">
|
<view class="common">
|
||||||
<view class="add" @click="addInfo('add')">
|
<view class="add" @click="addInfo('add')">
|
||||||
<icon class="iconfont icon-tianjia"></icon>添加成员
|
<icon class="iconfont icon-tianjia"></icon>添加成员
|
||||||
</view>
|
|
||||||
<view class="box" v-if="familayList.lenght!=0">
|
|
||||||
<view class="list" v-for="(item ,index) in familayList" :key="index" @click="datail(item.id)">
|
|
||||||
<image :src="item.headimg" class="image1" />
|
|
||||||
<view class="left">
|
|
||||||
<view class="title">{{item.name?item.name:""}}</view>
|
|
||||||
<view class="title2">
|
|
||||||
<text>{{item.sex==0?'未知':item.sex==1?'男':'女'}}</text>
|
|
||||||
<text>{{item.mage?item.mage:'0岁'}}</text>
|
|
||||||
<text>{{item.type}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="title2">最后测量时间:{{item.lasthearttime||'-'}}</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view v-else>
|
|
||||||
没有数据了!
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
<view class="box" v-if="familayList.lenght!=0">
|
||||||
|
<view class="list" v-for="(item ,index) in familayList" :key="index" @click="datail(item.id)">
|
||||||
|
<image :src="item.headimg" class="image1" />
|
||||||
|
<view class="left">
|
||||||
|
<view class="title">{{item.name?item.name:""}}</view>
|
||||||
|
<view class="title2">
|
||||||
|
<text>{{item.sex==0?'未知':item.sex==1?'男':'女'}}</text>
|
||||||
|
<text>{{item.mage?item.mage:'0岁'}}</text>
|
||||||
|
<text>{{item.type}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="title2">最后测量时间:{{item.lasthearttime||'-'}}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-else>
|
||||||
|
没有数据了!
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
visible: false,
|
visible: false,
|
||||||
ranklist: [],
|
ranklist: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["familayList", "user"])
|
...mapState(["familayList", "user", "appTheme"])
|
||||||
},
|
},
|
||||||
onLoad() {},
|
onLoad() {
|
||||||
methods: {
|
// 导航栏颜色
|
||||||
//添加
|
uni.setNavigationBarColor({
|
||||||
addInfo(type) {
|
frontColor: '#ffffff',
|
||||||
uni.navigateTo({
|
backgroundColor: this.appTheme,
|
||||||
url: "/pageTwo/me/adduser?type=${type}"
|
})
|
||||||
})
|
},
|
||||||
},
|
methods: {
|
||||||
//查看
|
//添加
|
||||||
datail(id) {
|
addInfo(type) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pageTwo/me/detail?id=` + id,
|
url: "/pageTwo/me/adduser?type=${type}"
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
}
|
//查看
|
||||||
|
datail(id) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pageTwo/me/detail?id=` + id,
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped="scoped" lang="scss">
|
<style scoped="scoped" lang="scss">
|
||||||
.common {
|
.common {
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
height: calc(100vh - 30px);
|
height: calc(100vh - 30px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.add {
|
||||||
|
width: 135px;
|
||||||
|
height: 30px;
|
||||||
|
line-height: 30px;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 15px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
background: $btncolor;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
width: auto;
|
||||||
|
background: #fff;
|
||||||
|
display: flex;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
padding: 10px 15px;
|
||||||
|
font-size: 14px;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.image1 {
|
||||||
|
width: 55px;
|
||||||
|
height: 55px;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.left {
|
||||||
|
width: 70%;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.add {
|
.title2 {
|
||||||
width: 135px;
|
margin-top: 5px;
|
||||||
height: 30px;
|
font-size: 12px;
|
||||||
line-height: 30px;
|
color: #999;
|
||||||
font-size: 14px;
|
|
||||||
margin-bottom: 10px;
|
text {
|
||||||
color: #fff;
|
margin-right: 10px;
|
||||||
border-radius: 15px;
|
}
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
background: $btncolor;
|
|
||||||
}
|
|
||||||
|
|
||||||
.list {
|
|
||||||
width: auto;
|
|
||||||
background: #fff;
|
|
||||||
display: flex;
|
|
||||||
border-radius: 10px;
|
|
||||||
margin-bottom: 15px;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
padding: 10px 15px;
|
|
||||||
font-size: 14px;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.image1 {
|
|
||||||
width: 55px;
|
|
||||||
height: 55px;
|
|
||||||
border-radius: 50%;
|
|
||||||
margin-right: 15px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.left {
|
|
||||||
width: 70%;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title2 {
|
|
||||||
margin-top: 5px;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #999;
|
|
||||||
|
|
||||||
text {
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,384 +1,389 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="bgheight" v-if="!isShowA">
|
<view class="bgheight" v-if="!isShowA">
|
||||||
<view v-if="listA">
|
<view v-if="listA">
|
||||||
<view class="btn" @tap="handleListx(1)">重新测评</view>
|
<view class="btn" @tap="handleListx(1)">重新测评</view>
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<view class="name">
|
<view class="name">
|
||||||
<view>本次体质评估结果为</view>
|
<view>本次体质评估结果为</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="conbt">
|
<view class="conbt">
|
||||||
{{listA.bodytype}}
|
{{listA.bodytype}}
|
||||||
</view>
|
</view>
|
||||||
<view class="conbt">
|
<view class="conbt">
|
||||||
{{listA.extinfo}}
|
{{listA.extinfo}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="box" v-if="listA.list.length">
|
<view class="box" v-if="listA.list.length">
|
||||||
<view class="h2">体质解读:</view>
|
<view class="h2">体质解读:</view>
|
||||||
<view v-for="(item,index) in listA.list" :key="index">
|
<view v-for="(item,index) in listA.list" :key="index">
|
||||||
<view class="title">{{item.bodytype}}</view>
|
<view class="title">{{item.bodytype}}</view>
|
||||||
<view class="con">
|
<view class="con">
|
||||||
<view class="text" v-show="item.feature"><text>特征:</text>{{item.feature}}</view>
|
<view class="text" v-show="item.feature"><text>特征:</text>{{item.feature}}</view>
|
||||||
<view class="text" v-show="item.people"><text>重点人群:</text>{{item.people}}</view>
|
<view class="text" v-show="item.people"><text>重点人群:</text>{{item.people}}</view>
|
||||||
<view class="text" v-show="item.sick"><text>患病倾向:</text>{{item.sick}}</view>
|
<view class="text" v-show="item.sick"><text>患病倾向:</text>{{item.sick}}</view>
|
||||||
<view class="text" v-show="item.health"><text>调养方式:</text>{{item.health}}</view>
|
<view class="text" v-show="item.health"><text>调养方式:</text>{{item.health}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="tips" v-if="listA.referlist">
|
<view class="tips" v-if="listA.referlist">
|
||||||
{{listA.referlist}}
|
{{listA.referlist}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 评估 -->
|
<!-- 评估 -->
|
||||||
<view class="commonAll" v-else>
|
<view class="commonAll" v-else>
|
||||||
<view class="h2">请根据近一年的体验和感觉,回答以下问题</view>
|
<view class="h2">请根据近一年的体验和感觉,回答以下问题</view>
|
||||||
<view class="box" v-for="(item,index) in infoListA.slice((currpage-1)*eachpage,currpage*eachpage)"
|
<view class="box" v-for="(item,index) in infoListA.slice((currpage-1)*eachpage,currpage*eachpage)" :key="index">
|
||||||
:key="index">
|
<view v-for="(ite, ind) in item.qalist" :key="ind">
|
||||||
<view v-for="(ite, ind) in item.qalist" :key="ind">
|
<view class="h5">{{ite.title}}</view>
|
||||||
<view class="h5">{{ite.title}}</view>
|
<view class="item">
|
||||||
<view class="item">
|
<view class="group" v-for="(it, id) in ite.data" :key="id" @click="Changeradio(it)">
|
||||||
<view class="group" v-for="(it, id) in ite.data" :key="id" @click="Changeradio(it)">
|
<icon class="iconfont radioimg" :class="[dasC.indexOf(it.val)!=-1?'icon-radio':'icon-kongradio']">
|
||||||
<icon class="iconfont radioimg"
|
</icon>
|
||||||
:class="[dasC.indexOf(it.val)!=-1?'icon-radio':'icon-kongradio']">
|
<view>{{it.name}}</view>
|
||||||
</icon>
|
</view>
|
||||||
<view>{{it.name}}</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="page" v-if='!listA'>
|
||||||
</view>
|
<view class="pre" v-if="currpage>1" @click="pre">上一页</view>
|
||||||
<view class="page" v-if='!listA'>
|
<view v-if="currpage<pagesum" @click="next">下一页</view>
|
||||||
<view class="pre" v-if="currpage>1" @click="pre">上一页</view>
|
<view class="btn" v-if="currpage==pagesum" @click="handlesub">
|
||||||
<view v-if="currpage<pagesum" @click="next">下一页</view>
|
提交
|
||||||
<view class="btn" v-if="currpage==pagesum" @click="handlesub">
|
</view>
|
||||||
提交
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user"]),
|
...mapState(["user", "appTheme"]),
|
||||||
info() {
|
info() {
|
||||||
return this.user
|
return this.user
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onLoad() {
|
||||||
let that = this
|
// 导航栏颜色
|
||||||
that.handleTypeInfo()
|
uni.setNavigationBarColor({
|
||||||
},
|
frontColor: '#ffffff',
|
||||||
methods: {
|
backgroundColor: this.appTheme,
|
||||||
//测评结果
|
})
|
||||||
handleTypeInfo() {
|
},
|
||||||
let that = this
|
onShow() {
|
||||||
that.$model.getbodyinfo({
|
let that = this
|
||||||
familyid: that.user.familyid,
|
that.handleTypeInfo()
|
||||||
}).then(res => {
|
},
|
||||||
if (res.code != 0) {
|
methods: {
|
||||||
that.handleListx(1)
|
//测评结果
|
||||||
return
|
handleTypeInfo() {
|
||||||
}
|
let that = this
|
||||||
that.listA = res.data
|
that.$model.getbodyinfo({
|
||||||
that.isShowA = false
|
familyid: that.user.familyid,
|
||||||
console.log("计算成功,去查看结果吧!")
|
}).then(res => {
|
||||||
})
|
if (res.code != 0) {
|
||||||
|
that.handleListx(1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
that.listA = res.data
|
||||||
|
that.isShowA = false
|
||||||
|
console.log("计算成功,去查看结果吧!")
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
// 重新测评
|
// 重新测评
|
||||||
handleListx(ind) {
|
handleListx(ind) {
|
||||||
let that = this
|
let that = this
|
||||||
that.isShowA = true
|
that.isShowA = true
|
||||||
that.currpage = 1
|
that.currpage = 1
|
||||||
that.dasA = []
|
that.dasA = []
|
||||||
that.dasC = []
|
that.dasC = []
|
||||||
that.listA = ""
|
that.listA = ""
|
||||||
that.tmidlistA = []
|
that.tmidlistA = []
|
||||||
that.infoListA = []
|
that.infoListA = []
|
||||||
that.$model.getbodylist({
|
that.$model.getbodylist({
|
||||||
isrestart: ind,
|
isrestart: ind,
|
||||||
sex: that.user.sex,
|
sex: that.user.sex,
|
||||||
familyid: that.user.familyid,
|
familyid: that.user.familyid,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(123, res)
|
console.log(123, res)
|
||||||
if (res.code != 0) return
|
if (res.code != 0) return
|
||||||
that.pagesum = Math.ceil(res.data.length / that.eachpage);
|
that.pagesum = Math.ceil(res.data.length / that.eachpage);
|
||||||
that.infoListA = res.data
|
that.infoListA = res.data
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
// 测评选择
|
// 测评选择
|
||||||
Changeradio(tmitem) {
|
Changeradio(tmitem) {
|
||||||
let that = this
|
let that = this
|
||||||
if (that.tmidlistA.indexOf(tmitem.id) == -1) {
|
if (that.tmidlistA.indexOf(tmitem.id) == -1) {
|
||||||
console.log(0)
|
console.log(0)
|
||||||
that.tmidlistA.push(tmitem.id)
|
that.tmidlistA.push(tmitem.id)
|
||||||
that.dasC.push(tmitem.val);
|
that.dasC.push(tmitem.val);
|
||||||
that.dasA.push(tmitem)
|
that.dasA.push(tmitem)
|
||||||
} else {
|
} else {
|
||||||
for (var n = 0; n < that.tmidlistA.length; n++) {
|
for (var n = 0; n < that.tmidlistA.length; n++) {
|
||||||
if (tmitem.id == that.tmidlistA[n]) {
|
if (tmitem.id == that.tmidlistA[n]) {
|
||||||
console.log(1)
|
console.log(1)
|
||||||
if (that.dasC.indexOf(tmitem.val) == -1) {
|
if (that.dasC.indexOf(tmitem.val) == -1) {
|
||||||
that.tmidlistA.push(tmitem.id)
|
that.tmidlistA.push(tmitem.id)
|
||||||
that.dasC.push(tmitem.val);
|
that.dasC.push(tmitem.val);
|
||||||
that.dasA.push(tmitem)
|
that.dasA.push(tmitem)
|
||||||
console.log(2)
|
console.log(2)
|
||||||
}
|
}
|
||||||
that.tmidlistA.splice(n, 1)
|
that.tmidlistA.splice(n, 1)
|
||||||
that.dasC.splice(n, 1);
|
that.dasC.splice(n, 1);
|
||||||
that.dasA.splice(n, 1);
|
that.dasA.splice(n, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 提交
|
// 提交
|
||||||
handlesub() {
|
handlesub() {
|
||||||
let that = this
|
let that = this
|
||||||
var obj = {}
|
var obj = {}
|
||||||
let newArr = []
|
let newArr = []
|
||||||
that.dasA.forEach(function(item, suffix) {
|
that.dasA.forEach(function(item, suffix) {
|
||||||
if (!obj[item.valId]) {
|
if (!obj[item.valId]) {
|
||||||
var arr = {
|
var arr = {
|
||||||
id: '',
|
id: '',
|
||||||
list: []
|
list: []
|
||||||
};
|
};
|
||||||
arr.id = item.valId
|
arr.id = item.valId
|
||||||
arr.list.push({
|
arr.list.push({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
score: item.value
|
score: item.value
|
||||||
})
|
})
|
||||||
newArr.push(arr);
|
newArr.push(arr);
|
||||||
obj[item.valId] = item;
|
obj[item.valId] = item;
|
||||||
} else {
|
} else {
|
||||||
for (var q = 0; q < newArr.length; q++) {
|
for (var q = 0; q < newArr.length; q++) {
|
||||||
if (newArr[q].id == item.valId) {
|
if (newArr[q].id == item.valId) {
|
||||||
newArr[q].list.push({
|
newArr[q].list.push({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
score: item.value
|
score: item.value
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// for (var i = 0; i < that.infoListA.length; i++) {
|
// for (var i = 0; i < that.infoListA.length; i++) {
|
||||||
// var arr = {
|
// var arr = {
|
||||||
// id: '',
|
// id: '',
|
||||||
// list: []
|
// list: []
|
||||||
// };
|
// };
|
||||||
// arr.id = that.infoListA[i].id
|
// arr.id = that.infoListA[i].id
|
||||||
// for (var e = 0; e < that.infoListA[i].qalist.length; e++) {
|
// for (var e = 0; e < that.infoListA[i].qalist.length; e++) {
|
||||||
// arr.list.push({
|
// arr.list.push({
|
||||||
// id: that.infoListA[i].qalist[e].Id,
|
// id: that.infoListA[i].qalist[e].Id,
|
||||||
// score: 3
|
// score: 3
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
// newArr.push(arr)
|
// newArr.push(arr)
|
||||||
// }
|
// }
|
||||||
console.log("去计算", newArr)
|
console.log("去计算", newArr)
|
||||||
// if (newArr.length < 7 || newArr.length < 9) {
|
// if (newArr.length < 7 || newArr.length < 9) {
|
||||||
// that.$api.msg("请先完成问答")
|
// that.$api.msg("请先完成问答")
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
that.$model.getbodyresultinfo({
|
that.$model.getbodyresultinfo({
|
||||||
appid: uni.getStorageSync("appid"),
|
appid: uni.getStorageSync("appid"),
|
||||||
familyid: that.user.familyid,
|
familyid: that.user.familyid,
|
||||||
data: newArr
|
data: newArr
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log('res', res)
|
console.log('res', res)
|
||||||
that.tmidlistA = []
|
that.tmidlistA = []
|
||||||
that.dasA = []
|
that.dasA = []
|
||||||
that.dasC = []
|
that.dasC = []
|
||||||
if (res.code != 0) {
|
if (res.code != 0) {
|
||||||
that.$tools.msg(res.message)
|
that.$tools.msg(res.message)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
that.listA = res.data
|
that.listA = res.data
|
||||||
that.isShowA = false
|
that.isShowA = false
|
||||||
that.currpage = 1
|
that.currpage = 1
|
||||||
console.log("计算成功,去查看结果吧!")
|
console.log("计算成功,去查看结果吧!")
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
pre() {
|
pre() {
|
||||||
this.currpage--
|
this.currpage--
|
||||||
},
|
},
|
||||||
next() {
|
next() {
|
||||||
let that = this
|
let that = this
|
||||||
that.currpage++
|
that.currpage++
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isShowA: true,
|
isShowA: true,
|
||||||
dasA: [],
|
dasA: [],
|
||||||
dasC: [],
|
dasC: [],
|
||||||
listA: [],
|
listA: [],
|
||||||
infoListA: [],
|
infoListA: [],
|
||||||
tmidlistA: [],
|
tmidlistA: [],
|
||||||
pagesum: null, //总页数
|
pagesum: null, //总页数
|
||||||
currpage: 1, //当前页数
|
currpage: 1, //当前页数
|
||||||
eachpage: 2, //每页行数
|
eachpage: 2, //每页行数
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.content {
|
.content {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
color: #666;
|
color: #666;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
min-height: calc(100vh - 30px);
|
min-height: calc(100vh - 30px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.h2 {
|
.h2 {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.h5 {
|
.h5 {
|
||||||
margin: 15px 0 10px;
|
margin: 15px 0 10px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.bgheight {
|
.bgheight {
|
||||||
.name {
|
.name {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #f19601;
|
color: #f19601;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.conbt {
|
.conbt {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 25px;
|
line-height: 25px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.box .conbt:nth-last-child(1) text {
|
.box .conbt:nth-last-child(1) text {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin: 15px 0;
|
margin: 15px 0;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.con {
|
.con {
|
||||||
line-height: 25px;
|
line-height: 25px;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
color: #333;
|
color: #333;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
display: block;
|
display: block;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
border: none;
|
border: none;
|
||||||
background: #f19601;
|
background: #f19601;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
float: right;
|
float: right;
|
||||||
// margin-bottom: 10px;
|
// margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.uni-list-cell {
|
.uni-list-cell {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 60%;
|
width: 60%;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
:nth-child(even).uni-list-cell {
|
:nth-child(even).uni-list-cell {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.commonAll {
|
.commonAll {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page {
|
.page {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 35px;
|
height: 35px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 20px auto;
|
margin: 20px auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
|
|
||||||
view {
|
view {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
background: #dfdfdf;
|
background: #dfdfdf;
|
||||||
padding: 5px 0;
|
padding: 5px 0;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
background: #f19601;
|
background: #f19601;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
height: auto;
|
height: auto;
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.group {
|
.group {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
width: 50%;
|
width: 50%;
|
||||||
justify-content: end;
|
justify-content: end;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
width: 22px;
|
width: 22px;
|
||||||
height: 22px;
|
height: 22px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
color: #dfdfdf;
|
color: #dfdfdf;
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-right: 3px;
|
margin-right: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-radio {
|
.icon-radio {
|
||||||
color: #f19601;
|
color: #f19601;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tips {
|
.tips {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #999;
|
color: #999;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
433
pages.json
433
pages.json
|
|
@ -1,208 +1,233 @@
|
||||||
{
|
{
|
||||||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||||
{
|
{
|
||||||
"path": "pages/index/index",
|
"path": "pages/index/index",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": ""
|
"navigationBarTitleText": "",
|
||||||
}
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
},
|
}
|
||||||
{
|
|
||||||
"path": "pages/target/target",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "目标"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/compk/compk",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "对比"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"path": "pages/me/me",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "我的"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/index/active",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "设备激活",
|
|
||||||
"enablePullDownRefresh": false,
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/search/devType",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "设备搜索"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"subPackages": [{
|
|
||||||
"root": "pageTwo",
|
|
||||||
"pages": [{
|
|
||||||
"path": "login/login",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "登录",
|
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "login/detail",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "协议"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "login/userinfo",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "home/index",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "报告页"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "compk/pkdetail",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "对比详情"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "me/history",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "历史记录"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "me/feedBack",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "意见反馈"
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "me/manage",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "用户管理"
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "me/adduser",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": ""
|
|
||||||
}
|
|
||||||
|
|
||||||
}, {
|
|
||||||
"path": "me/detail",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "me/info",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "survey/survey",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
]
|
|
||||||
}, {
|
|
||||||
"root": "BLEPages",
|
|
||||||
"pages": [{
|
|
||||||
"path": "adult/H01pro",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "adult/PCD01pro",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "adult/PCL01",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "adult/H09B",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
, {
|
|
||||||
"path": "adult/F01B",
|
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": "",
|
|
||||||
"enablePullDownRefresh": false
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}],
|
|
||||||
"globalStyle": {
|
|
||||||
"navigationBarTextStyle": "#fff",
|
|
||||||
"navigationBarBackgroundColor": "#00c6c6",
|
|
||||||
"backgroundColor": "#fff"
|
|
||||||
},
|
},
|
||||||
// 切换导航
|
{
|
||||||
"tabBar": {
|
"path": "pages/target/target",
|
||||||
"color": "#333",
|
"style": {
|
||||||
"selectedColor": "#00c6c6",
|
"navigationBarTitleText": "目标",
|
||||||
"backgroundColor": "#fff",
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
"list": [{
|
}
|
||||||
"pagePath": "pages/index/index",
|
},
|
||||||
"iconPath": "static/tab_sy.png",
|
{
|
||||||
"selectedIconPath": "static/tab_sy01.png",
|
"path": "pages/compk/compk",
|
||||||
"text": "首页"
|
"style": {
|
||||||
},
|
"navigationBarTitleText": "对比",
|
||||||
{
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
"pagePath": "pages/target/target",
|
}
|
||||||
"iconPath": "static/tab_sj.png",
|
},
|
||||||
"selectedIconPath": "static/tab_sj01.png",
|
|
||||||
"text": "目标"
|
{
|
||||||
},
|
"path": "pages/me/me",
|
||||||
{
|
"style": {
|
||||||
"pagePath": "pages/compk/compk",
|
"navigationBarTitleText": "我的",
|
||||||
"iconPath": "static/tab_db.png",
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
"selectedIconPath": "static/tab_db01.png",
|
}
|
||||||
"text": "对比"
|
},
|
||||||
},
|
{
|
||||||
{
|
"path": "pages/index/active",
|
||||||
"pagePath": "pages/me/me",
|
"style": {
|
||||||
"iconPath": "static/tab_me.png",
|
"navigationBarTitleText": "设备激活",
|
||||||
"selectedIconPath": "static/tab_me01.png",
|
"navigationBarBackgroundColor": "#F9FAFC",
|
||||||
"text": "我的"
|
"enablePullDownRefresh": false,
|
||||||
}
|
"navigationStyle": "custom"
|
||||||
]
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/search/devType",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "设备搜索",
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"subPackages": [{
|
||||||
|
"root": "pageTwo",
|
||||||
|
"pages": [{
|
||||||
|
"path": "login/login",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "登录",
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC",
|
||||||
|
"navigationStyle": "custom"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "login/detail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "协议",
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "login/userinfo",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"path": "compk/pkdetail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "对比详情",
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "me/history",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "历史记录",
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "me/feedBack",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "意见反馈",
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "me/manage",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "用户管理",
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "me/adduser",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
|
}
|
||||||
|
|
||||||
|
}, {
|
||||||
|
"path": "me/detail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "me/info",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "survey/survey",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
]
|
||||||
|
}, {
|
||||||
|
"root": "BLEPages",
|
||||||
|
"pages": [{
|
||||||
|
"path": "adult/H01pro",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "adult/PCD01pro",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "adult/PCL01",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "adult/H09B",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
, {
|
||||||
|
"path": "adult/F01B",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
|
}
|
||||||
|
|
||||||
|
}, {
|
||||||
|
"path": "adult/F01PRO",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}],
|
||||||
|
"globalStyle": {
|
||||||
|
"navigationBarTextStyle": "#fff",
|
||||||
|
"navigationBarBackgroundColor": "#00c6c6",
|
||||||
|
"backgroundColor": "#fff"
|
||||||
|
},
|
||||||
|
// 切换导航
|
||||||
|
"tabBar": {
|
||||||
|
"color": "#333",
|
||||||
|
"selectedColor": "#00c6c6",
|
||||||
|
"backgroundColor": "#fff",
|
||||||
|
"list": [{
|
||||||
|
"pagePath": "pages/index/index",
|
||||||
|
"iconPath": "static/tab_sy.png",
|
||||||
|
"selectedIconPath": "static/tab_sy01.png",
|
||||||
|
"text": "首页"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/target/target",
|
||||||
|
"iconPath": "static/tab_sj.png",
|
||||||
|
"selectedIconPath": "static/tab_sj01.png",
|
||||||
|
"text": "目标"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/compk/compk",
|
||||||
|
"iconPath": "static/tab_db.png",
|
||||||
|
"selectedIconPath": "static/tab_db01.png",
|
||||||
|
"text": "对比"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"pagePath": "pages/me/me",
|
||||||
|
"iconPath": "static/tab_me.png",
|
||||||
|
"selectedIconPath": "static/tab_me01.png",
|
||||||
|
"text": "我的"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,172 +1,177 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class=" calendar">
|
<view class=" calendar">
|
||||||
<!-- 日历 -->
|
<!-- 日历 -->
|
||||||
<ren-calendar ref='ren' :markDays='markDays' @onDayClick='onDayClick' @onMonthClickPre='onMonthClickPre'
|
<ren-calendar ref='ren' :markDays='markDays' @onDayClick='onDayClick' @onMonthClickPre='onMonthClickPre'
|
||||||
@onMonthClickNext="onMonthClickNext" v-if="isShow">
|
@onMonthClickNext="onMonthClickNext" v-if="isShow">
|
||||||
</ren-calendar>
|
</ren-calendar>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<view class="box" v-if="infoList.length">
|
<view class="box" v-if="infoList.length">
|
||||||
<view class="list" v-for="(item,index) in infoList" :key="index" @click="addMemberTags(item.id,item)">
|
<view class="list" v-for="(item,index) in infoList" :key="index" @click="addMemberTags(item.id,item)">
|
||||||
<!-- 成人 -->
|
<!-- 成人 -->
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<view class="check">
|
<view class="check">
|
||||||
<icon class="iconfont" :class="isActive.indexOf(item.id)!=-1?'icon-radio':'icon-kongradio'">
|
<icon class="iconfont" :class="isActive.indexOf(item.id)!=-1?'icon-radio':'icon-kongradio'">
|
||||||
</icon>
|
</icon>
|
||||||
</view>
|
|
||||||
<view>{{item.height}}<text>身高</text></view>
|
|
||||||
<view>{{item.weight}}<text>体重</text></view>
|
|
||||||
<view>{{item.bmi}}<text>BMI</text></view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- -->
|
|
||||||
<view class="bottom">
|
|
||||||
<view class="list" v-for="(ite,ind) in ActiveDays" :key="ind" v-if="isActive"
|
|
||||||
@click="addMemberTags(ite.id,ite)">
|
|
||||||
<view class="item borderRadius">
|
|
||||||
<view class="time">{{ite.createtime}}</view>
|
|
||||||
<view>{{ite.height}}<text>身高</text></view>
|
|
||||||
<view>{{ite.weight}}<text>体重</text></view>
|
|
||||||
<view>{{ite.bmi}}<text>BMI</text></view>
|
|
||||||
<view class="check">
|
|
||||||
<icon class="iconfont icon-quxiao"></icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="pkclass" v-if="length==2">vs</view>
|
|
||||||
<view :class="{'active':length!=2}" class="btn" @click="handlePK">减脂对比</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
<view>{{item.height}}<text>身高</text></view>
|
||||||
|
<view>{{item.weight}}<text>体重</text></view>
|
||||||
|
<view>{{item.bmi}}<text>BMI</text></view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<userPopup></userPopup>
|
</view>
|
||||||
|
<!-- -->
|
||||||
|
<view class="bottom">
|
||||||
|
<view class="list" v-for="(ite,ind) in ActiveDays" :key="ind" v-if="isActive"
|
||||||
|
@click="addMemberTags(ite.id,ite)">
|
||||||
|
<view class="item borderRadius">
|
||||||
|
<view class="time">{{ite.createtime}}</view>
|
||||||
|
<view>{{ite.height}}<text>身高</text></view>
|
||||||
|
<view>{{ite.weight}}<text>体重</text></view>
|
||||||
|
<view>{{ite.bmi}}<text>BMI</text></view>
|
||||||
|
<view class="check">
|
||||||
|
<icon class="iconfont icon-quxiao"></icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="pkclass" v-if="length==2">vs</view>
|
||||||
|
<view :class="{'active':length!=2}" class="btn" @click="handlePK">减脂对比</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<userPopup></userPopup>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import userPopup from '@/components/userLogin.vue'
|
import userPopup from '@/components/userLogin.vue'
|
||||||
import RenCalendar from '@/components/ren-calendar/ren-calendar.vue';
|
import RenCalendar from '@/components/ren-calendar/ren-calendar.vue';
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
userPopup,
|
userPopup,
|
||||||
RenCalendar,
|
RenCalendar,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user", "TrendPk"]),
|
...mapState(["user", "TrendPk", "appTheme"]),
|
||||||
length() {
|
length() {
|
||||||
return this.isActive.length
|
return this.isActive.length
|
||||||
},
|
},
|
||||||
endDate() {
|
endDate() {
|
||||||
return this.$tools.getDate("start")
|
return this.$tools.getDate("start")
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.token = uni.getStorageSync("token")
|
//
|
||||||
},
|
uni.setNavigationBarColor({
|
||||||
onShow() {
|
frontColor: '#ffffff',
|
||||||
let that = this
|
backgroundColor: this.appTheme,
|
||||||
that.startM = that.$tools.getDate("m").substring(0, 10)
|
})
|
||||||
that.endM = that.$tools.getDate("m").substring(11, 21)
|
this.token = uni.getStorageSync("token")
|
||||||
that.infoList = []
|
},
|
||||||
that.markDays = []
|
onShow() {
|
||||||
that.list = []
|
let that = this
|
||||||
that.isActive = []
|
that.startM = that.$tools.getDate("m").substring(0, 10)
|
||||||
that.ActiveDays = []
|
that.endM = that.$tools.getDate("m").substring(11, 21)
|
||||||
that.isShow = false
|
that.infoList = []
|
||||||
this.$nextTick(() => {
|
that.markDays = []
|
||||||
that.isShow = true
|
that.list = []
|
||||||
that.getList(that.startM, that.endM)
|
that.isActive = []
|
||||||
})
|
that.ActiveDays = []
|
||||||
},
|
that.isShow = false
|
||||||
methods: {
|
this.$nextTick(() => {
|
||||||
getList(start, end) {
|
that.isShow = true
|
||||||
let that = this
|
that.getList(that.startM, that.endM)
|
||||||
that.$model.GetTrendList({
|
})
|
||||||
familyid: uni.getStorageSync('familyid'),
|
},
|
||||||
starttime: start,
|
methods: {
|
||||||
endtime: end,
|
getList(start, end) {
|
||||||
}).then(res => {
|
let that = this
|
||||||
if (res) {
|
that.$model.GetTrendList({
|
||||||
that.markDays = res.pkList.Dlist
|
familyid: uni.getStorageSync('familyid'),
|
||||||
that.list = res.pkList.list
|
starttime: start,
|
||||||
for (var i = 0; i < res.pkList.list.length; i++) {
|
endtime: end,
|
||||||
if (Date.parse(that.endDate) == Date.parse(res.pkList.list[i].createtime)) {
|
}).then(res => {
|
||||||
that.infoList.push(res.pkList.list[i]);
|
if (res) {
|
||||||
}
|
that.markDays = res.pkList.Dlist
|
||||||
}
|
that.list = res.pkList.list
|
||||||
}
|
for (var i = 0; i < res.pkList.list.length; i++) {
|
||||||
})
|
if (Date.parse(that.endDate) == Date.parse(res.pkList.list[i].createtime)) {
|
||||||
},
|
that.infoList.push(res.pkList.list[i]);
|
||||||
onMonthClickPre(data) {
|
}
|
||||||
console.log("onMonthClickPre", data)
|
|
||||||
let that = this
|
|
||||||
let start = data.substring(0, 10)
|
|
||||||
let end = data.substring(11, 21)
|
|
||||||
that.infoList = []
|
|
||||||
that.markDays = []
|
|
||||||
that.list = []
|
|
||||||
that.getList(start, end)
|
|
||||||
},
|
|
||||||
onDayClick(data) {
|
|
||||||
let that = this
|
|
||||||
this.infoList = []
|
|
||||||
for (var i = 0; i < that.list.length; i++) {
|
|
||||||
if (Date.parse(data.date) == Date.parse(that.list[i].createtime)) { //includes 检测数组是否有某个值
|
|
||||||
this.infoList.push(that.list[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
addMemberTags(index, item) {
|
|
||||||
var that = this;
|
|
||||||
console.log("addMemberTags", index, item)
|
|
||||||
// if (this.user.type != 1) return
|
|
||||||
if (that.isActive.indexOf(index) == -1) {
|
|
||||||
that.isActive.push(index);
|
|
||||||
that.ActiveDays.push(item);
|
|
||||||
} else {
|
|
||||||
that.isActive.splice(that.isActive.indexOf(index), 1);
|
|
||||||
that.ActiveDays.splice(that.ActiveDays.indexOf(item), 1);
|
|
||||||
}
|
|
||||||
if (that.isActive.length > 2) {
|
|
||||||
that.isActive.splice(0, 1)
|
|
||||||
that.ActiveDays.splice(0, 1);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
handlePK() {
|
|
||||||
let that = this
|
|
||||||
if (!uni.getStorageSync('token')) {
|
|
||||||
this.$store.commit("changeUserLogin", true);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (that.isActive.length != 2) {
|
|
||||||
that.$tools.msg("请先选择数据!")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let info = {}
|
|
||||||
info.familyid = uni.getStorageSync('familyid')
|
|
||||||
info.firstId = that.isActive[0]
|
|
||||||
info.secondId = that.isActive[1]
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pageTwo/compk/pkdetail?info=" + JSON.stringify(info)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
markDays: [],
|
|
||||||
infoList: [],
|
|
||||||
list: [],
|
|
||||||
isActive: [],
|
|
||||||
ActiveDays: [],
|
|
||||||
token: null,
|
|
||||||
startM: null,
|
|
||||||
endM: null,
|
|
||||||
isShow: true,
|
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
}
|
})
|
||||||
|
},
|
||||||
|
onMonthClickPre(data) {
|
||||||
|
console.log("onMonthClickPre", data)
|
||||||
|
let that = this
|
||||||
|
let start = data.substring(0, 10)
|
||||||
|
let end = data.substring(11, 21)
|
||||||
|
that.infoList = []
|
||||||
|
that.markDays = []
|
||||||
|
that.list = []
|
||||||
|
that.getList(start, end)
|
||||||
|
},
|
||||||
|
onDayClick(data) {
|
||||||
|
let that = this
|
||||||
|
this.infoList = []
|
||||||
|
for (var i = 0; i < that.list.length; i++) {
|
||||||
|
if (Date.parse(data.date) == Date.parse(that.list[i].createtime)) { //includes 检测数组是否有某个值
|
||||||
|
this.infoList.push(that.list[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
addMemberTags(index, item) {
|
||||||
|
var that = this;
|
||||||
|
console.log("addMemberTags", index, item)
|
||||||
|
// if (this.user.type != 1) return
|
||||||
|
if (that.isActive.indexOf(index) == -1) {
|
||||||
|
that.isActive.push(index);
|
||||||
|
that.ActiveDays.push(item);
|
||||||
|
} else {
|
||||||
|
that.isActive.splice(that.isActive.indexOf(index), 1);
|
||||||
|
that.ActiveDays.splice(that.ActiveDays.indexOf(item), 1);
|
||||||
|
}
|
||||||
|
if (that.isActive.length > 2) {
|
||||||
|
that.isActive.splice(0, 1)
|
||||||
|
that.ActiveDays.splice(0, 1);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handlePK() {
|
||||||
|
let that = this
|
||||||
|
if (!uni.getStorageSync('token')) {
|
||||||
|
this.$store.commit("changeUserLogin", true);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (that.isActive.length != 2) {
|
||||||
|
that.$tools.msg("请先选择数据!")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let info = {}
|
||||||
|
info.familyid = uni.getStorageSync('familyid')
|
||||||
|
info.firstId = that.isActive[0]
|
||||||
|
info.secondId = that.isActive[1]
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pageTwo/compk/pkdetail?info=" + JSON.stringify(info)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
markDays: [],
|
||||||
|
infoList: [],
|
||||||
|
list: [],
|
||||||
|
isActive: [],
|
||||||
|
ActiveDays: [],
|
||||||
|
token: null,
|
||||||
|
startM: null,
|
||||||
|
endM: null,
|
||||||
|
isShow: true,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
||||||
|
|
@ -1,378 +1,384 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="tips">请在设备开机状态下,搜索设备</view>
|
<view class="tips">请在设备开机状态下,搜索设备</view>
|
||||||
<view class="item" @click="handleWeight">开始搜索设备</view>
|
<view class="item" @click="handleWeight">开始搜索设备</view>
|
||||||
<view class="devices_summary">已发现 {{devices.length}} 个设备:</view>
|
<view class="devices_summary">已发现 {{devices.length}} 个设备:</view>
|
||||||
<view>
|
<view>
|
||||||
<scroll-view class="device_list" scroll-y scroll-with-animation v-if="popup">
|
<scroll-view class="device_list" scroll-y scroll-with-animation v-if="popup">
|
||||||
<view v-for="(item,index) in devices" :key="index" @tap="createBLEConnection(item)" class="device_item">
|
<view v-for="(item,index) in devices" :key="index" @tap="createBLEConnection(item)" class="device_item">
|
||||||
<view>
|
<view>
|
||||||
<text>{{item.name|| item.localName}}</text>
|
<text>{{item.name|| item.localName}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view>mac地址:{{item.macAddr || item.deviceId}}</view>
|
<view>mac地址:{{item.macAddr || item.deviceId}}</view>
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="tishi">
|
</scroll-view>
|
||||||
<view class="text">
|
|
||||||
<icon class="t-icon t-icon-tishi"></icon> 设备激活流程说明
|
|
||||||
</view>
|
|
||||||
<view class="dv">
|
|
||||||
<text>1、打开手机蓝牙和位置信息</text>
|
|
||||||
<text>2、ios系统需打开设置—>应用—>微信里的蓝牙权限</text>
|
|
||||||
<text>3、设备亮屏状态下搜索蓝牙</text>
|
|
||||||
<text>4、选择蓝牙进行激活</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<userLogin :url="'active'"></userLogin>
|
|
||||||
</view>
|
</view>
|
||||||
|
<view class="tishi">
|
||||||
|
<view class="text">
|
||||||
|
<icon class="t-icon t-icon-tishi"></icon> 设备激活流程说明
|
||||||
|
</view>
|
||||||
|
<view class="dv">
|
||||||
|
<text>1、打开手机蓝牙和位置信息</text>
|
||||||
|
<text>2、ios系统需打开设置—>应用—>微信里的蓝牙权限</text>
|
||||||
|
<text>3、设备亮屏状态下搜索蓝牙</text>
|
||||||
|
<text>4、选择蓝牙进行激活</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<userLogin :url="'active'"></userLogin>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var myTime;
|
var myTime;
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
import userLogin from "@/components/userLogin.vue"
|
import userLogin from "@/components/userLogin.vue"
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
token: "",
|
token: "",
|
||||||
macAddr: "",
|
macAddr: "",
|
||||||
code: "",
|
code: "",
|
||||||
deviceId: "",
|
deviceId: "",
|
||||||
popup: false,
|
popup: false,
|
||||||
devices: [],
|
devices: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
userLogin
|
userLogin
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user", "isBluetoothTyle"])
|
...mapState(["user", "isBluetoothTyle", "appTheme"])
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
let that = this
|
let that = this
|
||||||
console.log("设备code码", options)
|
// 导航栏颜色
|
||||||
if (options) {
|
uni.setNavigationBarColor({
|
||||||
that.code = options.code
|
frontColor: '#ffffff',
|
||||||
}
|
backgroundColor: this.appTheme,
|
||||||
that.token = uni.getStorageSync('token')
|
})
|
||||||
that.login()
|
//
|
||||||
uni.onBluetoothAdapterStateChange(function(res) {
|
console.log("设备code码", options)
|
||||||
that.$store.commit("changeBluetooth", res.available);
|
if (options) {
|
||||||
})
|
that.code = options.code
|
||||||
},
|
}
|
||||||
methods: {
|
that.token = uni.getStorageSync('token')
|
||||||
login() {
|
that.login()
|
||||||
let that = this
|
uni.onBluetoothAdapterStateChange(function(res) {
|
||||||
uni.login({
|
that.$store.commit("changeBluetooth", res.available);
|
||||||
success(res) {
|
})
|
||||||
if (res.code) {
|
},
|
||||||
if (res.errMsg = "login:ok") {
|
methods: {
|
||||||
that.$model.onlogin({
|
login() {
|
||||||
code: res.code,
|
let that = this
|
||||||
}).then(res => {
|
uni.login({
|
||||||
if (res.code == 2) {
|
success(res) {
|
||||||
uni.clearStorageSync()
|
if (res.code) {
|
||||||
uni.removeStorageSync('token')
|
if (res.errMsg = "login:ok") {
|
||||||
uni.removeStorageSync('changeUser')
|
that.$model.onlogin({
|
||||||
uni.setStorageSync('tenantid', res.data.tenantid)
|
code: res.code,
|
||||||
uni.setStorageSync('sessionid', res.data.sessionid)
|
}).then(res => {
|
||||||
uni.setStorageSync('iswxphone', res.data.iswxphone)
|
if (res.code == 2) {
|
||||||
that.$store.commit("changeUserLogin", true)
|
uni.clearStorageSync()
|
||||||
return
|
uni.removeStorageSync('token')
|
||||||
} else {
|
uni.removeStorageSync('changeUser')
|
||||||
uni.setStorageSync('sessionid', res.data.sessionid)
|
uni.setStorageSync('tenantid', res.data.tenantid)
|
||||||
uni.setStorageSync('token', res.data.token)
|
uni.setStorageSync('sessionid', res.data.sessionid)
|
||||||
uni.setStorageSync('iswxphone', res.data.iswxphone)
|
uni.setStorageSync('iswxphone', res.data.iswxphone)
|
||||||
uni.setStorageSync('tenantid', res.data.tenantid)
|
|
||||||
uni.setStorageSync('refreshtoken', res.data.refreshtoken)
|
|
||||||
}
|
|
||||||
}).catch(e => {})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleWeight() {
|
|
||||||
let that = this
|
|
||||||
that.devices = []
|
|
||||||
if (!that.token) {
|
|
||||||
that.$store.commit("changeUserLogin", true)
|
that.$store.commit("changeUserLogin", true)
|
||||||
return
|
return
|
||||||
}
|
} else {
|
||||||
uni.openBluetoothAdapter({
|
uni.setStorageSync('sessionid', res.data.sessionid)
|
||||||
success: e => {
|
uni.setStorageSync('token', res.data.token)
|
||||||
that.$store.commit("changeBluetooth", true);
|
uni.setStorageSync('iswxphone', res.data.iswxphone)
|
||||||
that.startBluetoothDeviceDiscovery()
|
uni.setStorageSync('tenantid', res.data.tenantid)
|
||||||
},
|
uni.setStorageSync('refreshtoken', res.data.refreshtoken)
|
||||||
fail: e => {
|
}
|
||||||
wx.hideLoading()
|
}).catch(e => {})
|
||||||
console.log("openBluetoothAdapter失败", e)
|
}
|
||||||
return that.$tools.getBluetoothAdapter(e)
|
}
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
startBluetoothDeviceDiscovery() {
|
handleWeight() {
|
||||||
let that = this;
|
let that = this
|
||||||
wx.showLoading({
|
that.devices = []
|
||||||
title: '设备搜索中',
|
if (!that.token) {
|
||||||
})
|
that.$store.commit("changeUserLogin", true)
|
||||||
uni.startBluetoothDevicesDiscovery({
|
return
|
||||||
allowDuplicatesKey: true,
|
|
||||||
success: res => {
|
|
||||||
that.onBluetoothDeviceFound();
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
wx.hideLoading()
|
|
||||||
console.log("startBluetoothDeviceDiscovery失败", res)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
onBluetoothDeviceFound() {
|
|
||||||
var that = this;
|
|
||||||
const foundDevices = []
|
|
||||||
uni.onBluetoothDeviceFound(res => {
|
|
||||||
res.devices.forEach(device => {
|
|
||||||
if (!device.name && !device.localName) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (device.name.indexOf('AiLink_') != -1) {
|
|
||||||
const foundDevices = that.devices
|
|
||||||
const idx = that.$tools.inArray(foundDevices, "deviceId", device.deviceId)
|
|
||||||
let buff = device.advertisData.slice(-6)
|
|
||||||
device.mac = new Uint8Array(buff) // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
|
|
||||||
let tempMac = Array.from(device.mac)
|
|
||||||
tempMac.reverse()
|
|
||||||
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
|
|
||||||
that.deviceId = device.deviceId
|
|
||||||
that.macAddr = device.macAddr
|
|
||||||
if (idx === -1) {
|
|
||||||
that.devices.push(device);
|
|
||||||
} else {
|
|
||||||
that.devices[idx] = device
|
|
||||||
}
|
|
||||||
that.popup = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (device.advertisServiceUUIDs[0].indexOf("F0A0") !== -1) {
|
|
||||||
const foundDevices = that.devices
|
|
||||||
const idx = that.$tools.inArray(foundDevices, "deviceId", device.deviceId)
|
|
||||||
let buffer = device.advertisData.slice(0, 8)
|
|
||||||
device.mac = new Uint8Array(buffer)
|
|
||||||
let tempMac = Array.from(device.mac)
|
|
||||||
tempMac.reverse()
|
|
||||||
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
|
|
||||||
that.deviceId = device.deviceId;
|
|
||||||
that.macAddr = device.macAddr
|
|
||||||
console.log("device1", device.macAddr, that.deviceId)
|
|
||||||
if (idx === -1) {
|
|
||||||
that.devices.push(device);
|
|
||||||
} else {
|
|
||||||
that.devices[idx] = device
|
|
||||||
}
|
|
||||||
that.popup = true
|
|
||||||
return
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
that.handleMyTime()
|
|
||||||
},
|
|
||||||
handleMyTime() {
|
|
||||||
var that = this;
|
|
||||||
myTime = setTimeout(function() {
|
|
||||||
if (!that.devices.length) {
|
|
||||||
clearTimeout(myTime);
|
|
||||||
wx.hideLoading()
|
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: '请确定蓝牙和手机位置信息已打开!请确定设备已开机;ios系统需打开设置——>应用——>微信里的蓝牙权限!是否继续?',
|
|
||||||
cancelText: "取消",
|
|
||||||
confirmText: "继续",
|
|
||||||
success(res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
that.startBluetoothDeviceDiscovery()
|
|
||||||
} else {
|
|
||||||
that.$tools.msg("您已取消操作")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.stopBluetoothDevicesDiscovery()
|
|
||||||
}
|
|
||||||
}, 30000);
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 停止搜索蓝牙设备
|
|
||||||
*/
|
|
||||||
stopBluetoothDevicesDiscovery() {
|
|
||||||
uni.stopBluetoothDevicesDiscovery({
|
|
||||||
success: e => {
|
|
||||||
console.log("停止搜索蓝牙设备", e)
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 连接蓝牙
|
|
||||||
createBLEConnection(e) {
|
|
||||||
let that = this;
|
|
||||||
that.stopBluetoothDevicesDiscovery()
|
|
||||||
that.macAddr = e.macAddr
|
|
||||||
that.getCode()
|
|
||||||
},
|
|
||||||
getCode() {
|
|
||||||
let that = this;
|
|
||||||
clearTimeout(myTime);
|
|
||||||
wx.hideLoading()
|
|
||||||
uni.showModal({
|
|
||||||
title: '提示',
|
|
||||||
content: '是否激活该设备?',
|
|
||||||
cancelText: "取消",
|
|
||||||
confirmText: "确定",
|
|
||||||
success: (res) => {
|
|
||||||
if (res.confirm) {
|
|
||||||
that.getActive()
|
|
||||||
} else {
|
|
||||||
that.$tools.msg("您已取消操作")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getActive() {
|
|
||||||
let that = this
|
|
||||||
that.$model.getdevactive({
|
|
||||||
code: that.code,
|
|
||||||
sn: that.macAddr
|
|
||||||
}).then(res => {
|
|
||||||
that.$tools.msg(res.message)
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.devices = []
|
|
||||||
if (res.code == 0) {
|
|
||||||
setTimeout(function() {
|
|
||||||
uni.reLaunch({
|
|
||||||
url: "/pages/index/index?t=" + that.devtype
|
|
||||||
})
|
|
||||||
}, 500)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 断开蓝牙模块
|
|
||||||
*/
|
|
||||||
closeBluetoothAdapter() {
|
|
||||||
let that = this;
|
|
||||||
uni.closeBluetoothAdapter({
|
|
||||||
success: res => {
|
|
||||||
console.log('蓝牙模块关闭成功');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 断开蓝牙连接
|
|
||||||
*/
|
|
||||||
closeBLEConnection() {
|
|
||||||
var that = this;
|
|
||||||
uni.closeBLEConnection({
|
|
||||||
deviceId: that.deviceId,
|
|
||||||
success: res => {
|
|
||||||
console.log('断开蓝牙连接成功');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
uni.openBluetoothAdapter({
|
||||||
|
success: e => {
|
||||||
|
that.$store.commit("changeBluetooth", true);
|
||||||
|
that.startBluetoothDeviceDiscovery()
|
||||||
|
},
|
||||||
|
fail: e => {
|
||||||
|
wx.hideLoading()
|
||||||
|
console.log("openBluetoothAdapter失败", e)
|
||||||
|
return that.$tools.getBluetoothAdapter(e)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
startBluetoothDeviceDiscovery() {
|
||||||
|
let that = this;
|
||||||
|
wx.showLoading({
|
||||||
|
title: '设备搜索中',
|
||||||
|
})
|
||||||
|
uni.startBluetoothDevicesDiscovery({
|
||||||
|
allowDuplicatesKey: true,
|
||||||
|
success: res => {
|
||||||
|
that.onBluetoothDeviceFound();
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
wx.hideLoading()
|
||||||
|
console.log("startBluetoothDeviceDiscovery失败", res)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onBluetoothDeviceFound() {
|
||||||
|
var that = this;
|
||||||
|
const foundDevices = []
|
||||||
|
uni.onBluetoothDeviceFound(res => {
|
||||||
|
res.devices.forEach(device => {
|
||||||
|
if (!device.name && !device.localName) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (device.name.indexOf('AiLink_') != -1) {
|
||||||
|
const foundDevices = that.devices
|
||||||
|
const idx = that.$tools.inArray(foundDevices, "deviceId", device.deviceId)
|
||||||
|
let buff = device.advertisData.slice(-6)
|
||||||
|
device.mac = new Uint8Array(buff) // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
|
||||||
|
let tempMac = Array.from(device.mac)
|
||||||
|
tempMac.reverse()
|
||||||
|
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
|
||||||
|
that.deviceId = device.deviceId
|
||||||
|
that.macAddr = device.macAddr
|
||||||
|
if (idx === -1) {
|
||||||
|
that.devices.push(device);
|
||||||
|
} else {
|
||||||
|
that.devices[idx] = device
|
||||||
|
}
|
||||||
|
that.popup = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (device.advertisServiceUUIDs[0].indexOf("F0A0") !== -1) {
|
||||||
|
const foundDevices = that.devices
|
||||||
|
const idx = that.$tools.inArray(foundDevices, "deviceId", device.deviceId)
|
||||||
|
let buffer = device.advertisData.slice(0, 8)
|
||||||
|
device.mac = new Uint8Array(buffer)
|
||||||
|
let tempMac = Array.from(device.mac)
|
||||||
|
tempMac.reverse()
|
||||||
|
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
|
||||||
|
that.deviceId = device.deviceId;
|
||||||
|
that.macAddr = device.macAddr
|
||||||
|
console.log("device1", device.macAddr, that.deviceId)
|
||||||
|
if (idx === -1) {
|
||||||
|
that.devices.push(device);
|
||||||
|
} else {
|
||||||
|
that.devices[idx] = device
|
||||||
|
}
|
||||||
|
that.popup = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
that.handleMyTime()
|
||||||
|
},
|
||||||
|
handleMyTime() {
|
||||||
|
var that = this;
|
||||||
|
myTime = setTimeout(function() {
|
||||||
|
if (!that.devices.length) {
|
||||||
|
clearTimeout(myTime);
|
||||||
|
wx.hideLoading()
|
||||||
|
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '请确定蓝牙和手机位置信息已打开!请确定设备已开机;ios系统需打开设置——>应用——>微信里的蓝牙权限!是否继续?',
|
||||||
|
cancelText: "取消",
|
||||||
|
confirmText: "继续",
|
||||||
|
success(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
that.startBluetoothDeviceDiscovery()
|
||||||
|
} else {
|
||||||
|
that.$tools.msg("您已取消操作")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
clearTimeout(myTime);
|
||||||
|
that.stopBluetoothDevicesDiscovery()
|
||||||
|
}
|
||||||
|
}, 30000);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 停止搜索蓝牙设备
|
||||||
|
*/
|
||||||
|
stopBluetoothDevicesDiscovery() {
|
||||||
|
uni.stopBluetoothDevicesDiscovery({
|
||||||
|
success: e => {
|
||||||
|
console.log("停止搜索蓝牙设备", e)
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 连接蓝牙
|
||||||
|
createBLEConnection(e) {
|
||||||
|
let that = this;
|
||||||
|
that.stopBluetoothDevicesDiscovery()
|
||||||
|
that.macAddr = e.macAddr
|
||||||
|
that.getCode()
|
||||||
|
},
|
||||||
|
getCode() {
|
||||||
|
let that = this;
|
||||||
|
clearTimeout(myTime);
|
||||||
|
wx.hideLoading()
|
||||||
|
uni.showModal({
|
||||||
|
title: '提示',
|
||||||
|
content: '是否激活该设备?',
|
||||||
|
cancelText: "取消",
|
||||||
|
confirmText: "确定",
|
||||||
|
success: (res) => {
|
||||||
|
if (res.confirm) {
|
||||||
|
that.getActive()
|
||||||
|
} else {
|
||||||
|
that.$tools.msg("您已取消操作")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getActive() {
|
||||||
|
let that = this
|
||||||
|
that.$model.getdevactive({
|
||||||
|
code: that.code,
|
||||||
|
sn: that.macAddr
|
||||||
|
}).then(res => {
|
||||||
|
that.$tools.msg(res.message)
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.devices = []
|
||||||
|
if (res.code == 0) {
|
||||||
|
setTimeout(function() {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: "/pages/index/index?t=" + that.devtype
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 断开蓝牙模块
|
||||||
|
*/
|
||||||
|
closeBluetoothAdapter() {
|
||||||
|
let that = this;
|
||||||
|
uni.closeBluetoothAdapter({
|
||||||
|
success: res => {
|
||||||
|
console.log('蓝牙模块关闭成功');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 断开蓝牙连接
|
||||||
|
*/
|
||||||
|
closeBLEConnection() {
|
||||||
|
var that = this;
|
||||||
|
uni.closeBLEConnection({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
success: res => {
|
||||||
|
console.log('断开蓝牙连接成功');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.content {
|
.content {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border-top: 66px solid #75DAD0;
|
border-top: 66px solid #75DAD0;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tishi {
|
||||||
|
width: 100%;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 25px;
|
||||||
|
font-weight: bold;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 30px;
|
||||||
|
padding-left: 15px;
|
||||||
|
|
||||||
|
.text {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
icon {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tishi {
|
text {
|
||||||
width: 100%;
|
font-weight: 500;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #999;
|
||||||
|
width: 100%;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
width: 70%;
|
||||||
|
height: 40px;
|
||||||
|
line-height: 38px;
|
||||||
|
text-align: center;
|
||||||
|
background: #f7f7f7;
|
||||||
|
border: 1px solid #dfdfdf;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: auto;
|
||||||
|
border-radius: 15px;
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.devices_summary {
|
||||||
|
width: 100%;
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device_list {
|
||||||
|
flex: 1;
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
max-height: 200px;
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
.device_item {
|
||||||
|
font-size: 14px;
|
||||||
|
padding: 10px;
|
||||||
|
color: #999;
|
||||||
|
border-bottom: 1px solid #dfdfdf;
|
||||||
|
|
||||||
|
text {
|
||||||
|
display: inline-block;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 25px;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
position: absolute;
|
|
||||||
bottom: 30px;
|
|
||||||
padding-left: 15px;
|
|
||||||
|
|
||||||
.text {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
icon {
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
font-weight: 500;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #999;
|
|
||||||
width: 100%;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.item {
|
|
||||||
width: 70%;
|
|
||||||
height: 40px;
|
|
||||||
line-height: 38px;
|
|
||||||
text-align: center;
|
|
||||||
background: #f7f7f7;
|
|
||||||
border: 1px solid #dfdfdf;
|
|
||||||
font-weight: bold;
|
|
||||||
margin: auto;
|
|
||||||
border-radius: 15px;
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.devices_summary {
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
line-height: 40px;
|
|
||||||
text-align: center;
|
|
||||||
font-size: 16px;
|
|
||||||
color: #666;
|
color: #666;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.device_list {
|
.tips {
|
||||||
flex: 1;
|
font-size: 14px;
|
||||||
width: 100%;
|
text-align: center;
|
||||||
height: auto;
|
color: #e83a1e;
|
||||||
max-height: 200px;
|
background: #f7e4c8;
|
||||||
margin-top: 0;
|
padding: 5px 0;
|
||||||
margin-bottom: 10px;
|
margin-top: 15px;
|
||||||
|
}
|
||||||
.device_item {
|
|
||||||
font-size: 14px;
|
|
||||||
padding: 10px;
|
|
||||||
color: #999;
|
|
||||||
border-bottom: 1px solid #dfdfdf;
|
|
||||||
|
|
||||||
text {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #666;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tips {
|
|
||||||
font-size: 14px;
|
|
||||||
text-align: center;
|
|
||||||
color: #e83a1e;
|
|
||||||
background: #f7e4c8;
|
|
||||||
padding: 5px 0;
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
573
pages/me/me.vue
573
pages/me/me.vue
|
|
@ -1,307 +1,312 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="header-con">
|
<view class="header-con" :style="{background:appTheme}">
|
||||||
<view class="header" v-if="token">
|
<view class="header" v-if="token">
|
||||||
<image :src="user.headimg" class="headimage" />
|
<image :src="user.headimg" class="headimage" />
|
||||||
<text>{{user.name||user.name}}</text>
|
<text>{{user.name||user.name}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="header2" v-else @click="handleLogin">
|
<view class="header2" v-else @click="handleLogin">
|
||||||
<view class="text"><text>登录</text>查看更多信息</view>
|
<view class="text"><text>登录</text>查看更多信息</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
<!-- 列表 -->
|
|
||||||
<view class="infolist">
|
|
||||||
<view class="item borderRadius" @click="handleEditClick">
|
|
||||||
<view class="left">
|
|
||||||
性别
|
|
||||||
</view>
|
|
||||||
<view class="right"><text>{{user.sex==0?"未知":user.sex==1?'男':'女'}}</text>
|
|
||||||
<icon class="t-icon t-icon-bianji3"></icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="item borderRadius" @click="handleEditClick">
|
|
||||||
<view class="left">
|
|
||||||
年龄(岁)
|
|
||||||
</view>
|
|
||||||
<view class="right"><text>{{user.age?user.age:user.mage?user.mage:0}}</text>
|
|
||||||
<icon class="t-icon t-icon-bianji3"></icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="item borderRadius" @click="handleEditClick">
|
|
||||||
<view class="left">
|
|
||||||
身高(cm)
|
|
||||||
</view>
|
|
||||||
<view class="right"><text>{{user.height?user.height:0}}</text>
|
|
||||||
<icon class="t-icon t-icon-bianji3"></icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- -->
|
|
||||||
<view class="wxlist borderRadius">
|
|
||||||
<view class="list" @tap="navTo('/pageTwo/me/manage')">
|
|
||||||
<view class="item border-bottom">
|
|
||||||
<view class="left">
|
|
||||||
<i class="t-icon t-icon-shoucang"></i>
|
|
||||||
<view class="name">成员管理</view>
|
|
||||||
</view>
|
|
||||||
<view class="right">
|
|
||||||
<icon class="icon iconfont icon-arrow-right" color="#999"></icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- -->
|
|
||||||
<view class="list" @tap="navTo('/pageTwo/me/history')">
|
|
||||||
<view class="item border-bottom">
|
|
||||||
<view class="left">
|
|
||||||
<i class="t-icon t-icon-gonglve"></i>
|
|
||||||
<view class="name">历史记录</view>
|
|
||||||
</view>
|
|
||||||
<view class="right">
|
|
||||||
<icon class="icon iconfont icon-arrow-right" color="#999"></icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- -->
|
|
||||||
<view class="list" @tap="navTo('/pageTwo/me/feedBack')">
|
|
||||||
<view class="item border-bottom">
|
|
||||||
<view class="left">
|
|
||||||
<i class="t-icon t-icon-pinglun"></i>
|
|
||||||
<view class="name">意见反馈</view>
|
|
||||||
</view>
|
|
||||||
<view class="right">
|
|
||||||
<icon class="icon iconfont icon-arrow-right" color="#999"></icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- -->
|
|
||||||
<view class="list" @click="handleClick(1)">
|
|
||||||
<view class="item border-bottom">
|
|
||||||
<view class="left">
|
|
||||||
<icon class="t-icon t-icon-shouhou"></icon>
|
|
||||||
<view class="name">设备管理</view>
|
|
||||||
</view>
|
|
||||||
<view class="right">
|
|
||||||
<icon class="icon iconfont icon-arrow-right" color="#999"></icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- -->
|
|
||||||
<view class="list" @click="handleClick(0)">
|
|
||||||
<view class="item border-bottom">
|
|
||||||
<view class="left">
|
|
||||||
<icon class="t-icon t-icon-hezuo"></icon>
|
|
||||||
<view class="name">儿童测量</view>
|
|
||||||
</view>
|
|
||||||
<view class="right">
|
|
||||||
<icon class="icon iconfont icon-arrow-right" color="#999"></icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="btn ml-15 mr-15" v-if="token" @click="handleOutLogin">退出登录</view>
|
|
||||||
<SignUp></SignUp>
|
|
||||||
<userPopup></userPopup>
|
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 列表 -->
|
||||||
|
<view class="infolist">
|
||||||
|
<view class="item borderRadius" @click="handleEditClick">
|
||||||
|
<view class="left">
|
||||||
|
性别
|
||||||
|
</view>
|
||||||
|
<view class="right"><text>{{user.sex==0?"未知":user.sex==1?'男':'女'}}</text>
|
||||||
|
<icon class="t-icon t-icon-bianji3"></icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="item borderRadius" @click="handleEditClick">
|
||||||
|
<view class="left">
|
||||||
|
年龄(岁)
|
||||||
|
</view>
|
||||||
|
<view class="right"><text>{{user.age?user.age:user.mage?user.mage:0}}</text>
|
||||||
|
<icon class="t-icon t-icon-bianji3"></icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="item borderRadius" @click="handleEditClick">
|
||||||
|
<view class="left">
|
||||||
|
身高(cm)
|
||||||
|
</view>
|
||||||
|
<view class="right"><text>{{user.height?user.height:0}}</text>
|
||||||
|
<icon class="t-icon t-icon-bianji3"></icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- -->
|
||||||
|
<view class="wxlist borderRadius">
|
||||||
|
<view class="list" @tap="navTo('/pageTwo/me/manage')">
|
||||||
|
<view class="item border-bottom">
|
||||||
|
<view class="left">
|
||||||
|
<i class="t-icon t-icon-shoucang"></i>
|
||||||
|
<view class="name">成员管理</view>
|
||||||
|
</view>
|
||||||
|
<view class="right">
|
||||||
|
<icon class="icon iconfont icon-arrow-right" color="#999"></icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- -->
|
||||||
|
<view class="list" @tap="navTo('/pageTwo/me/history')">
|
||||||
|
<view class="item border-bottom">
|
||||||
|
<view class="left">
|
||||||
|
<i class="t-icon t-icon-gonglve"></i>
|
||||||
|
<view class="name">历史记录</view>
|
||||||
|
</view>
|
||||||
|
<view class="right">
|
||||||
|
<icon class="icon iconfont icon-arrow-right" color="#999"></icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- -->
|
||||||
|
<view class="list" @tap="navTo('/pageTwo/me/feedBack')">
|
||||||
|
<view class="item border-bottom">
|
||||||
|
<view class="left">
|
||||||
|
<i class="t-icon t-icon-pinglun"></i>
|
||||||
|
<view class="name">意见反馈</view>
|
||||||
|
</view>
|
||||||
|
<view class="right">
|
||||||
|
<icon class="icon iconfont icon-arrow-right" color="#999"></icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- -->
|
||||||
|
<view class="list" @click="handleClick('device')">
|
||||||
|
<view class="item border-bottom">
|
||||||
|
<view class="left">
|
||||||
|
<icon class="t-icon t-icon-shouhou"></icon>
|
||||||
|
<view class="name">设备管理</view>
|
||||||
|
</view>
|
||||||
|
<view class="right">
|
||||||
|
<icon class="icon iconfont icon-arrow-right" color="#999"></icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- -->
|
||||||
|
<view class="list" @click="handleClick('adult')">
|
||||||
|
<view class="item border-bottom">
|
||||||
|
<view class="left">
|
||||||
|
<icon class="t-icon t-icon-hezuo"></icon>
|
||||||
|
<view class="name">儿童测量</view>
|
||||||
|
</view>
|
||||||
|
<view class="right">
|
||||||
|
<icon class="icon iconfont icon-arrow-right" color="#999"></icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="btn ml-15 mr-15" v-if="token" @click="handleOutLogin">退出登录</view>
|
||||||
|
<SignUp></SignUp>
|
||||||
|
<userPopup></userPopup>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
import SignUp from '@/components/signup/signup.vue';
|
import SignUp from '@/components/signup/signup.vue';
|
||||||
import userPopup from '@/components/userLogin.vue'
|
import userPopup from '@/components/userLogin.vue'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
token: null,
|
token: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
userPopup,
|
userPopup,
|
||||||
SignUp,
|
SignUp,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user"]),
|
...mapState(["user", "configBox", "appTheme"]),
|
||||||
},
|
},
|
||||||
onTabItemTap() {
|
onTabItemTap() {
|
||||||
this.$store.commit("changeEdit", false);
|
this.$store.commit("changeEdit", false);
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.token = uni.getStorageSync("token")
|
// 导航栏颜色
|
||||||
},
|
uni.setNavigationBarColor({
|
||||||
methods: {
|
frontColor: '#ffffff',
|
||||||
handleLogin() {
|
backgroundColor: this.appTheme,
|
||||||
if (!uni.getStorageSync('token')) {
|
})
|
||||||
this.$store.commit("changeUserLogin", true);
|
//
|
||||||
return
|
this.token = uni.getStorageSync("token")
|
||||||
}
|
},
|
||||||
},
|
methods: {
|
||||||
handleOutLogin() {
|
handleLogin() {
|
||||||
let that = this
|
if (!uni.getStorageSync('token')) {
|
||||||
uni.showModal({
|
this.$store.commit("changeUserLogin", true);
|
||||||
title: '友情提示',
|
return
|
||||||
content: '是否退出登录?',
|
|
||||||
success: function(res) {
|
|
||||||
if (res.confirm) {
|
|
||||||
that.$model.getoutlogin({
|
|
||||||
sessionid: uni.getStorageSync('sessionid')
|
|
||||||
}).then((res) => {
|
|
||||||
that.$tools.msg(res.message)
|
|
||||||
if (res.code != 0) return
|
|
||||||
console.log('确定退出', res)
|
|
||||||
uni.clearStorageSync()
|
|
||||||
uni.setStorageSync('sessionid', null)
|
|
||||||
that.$store.commit("changeLogout", false);
|
|
||||||
uni.reLaunch({
|
|
||||||
url: "/pages/index/index"
|
|
||||||
})
|
|
||||||
})
|
|
||||||
} else if (res.cancel) {
|
|
||||||
that.$tools.msg("您已取消操作!");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleClick(ind) {
|
|
||||||
if (!uni.getStorageSync('token')) {
|
|
||||||
this.$store.commit("changeUserLogin", true);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 儿童版
|
|
||||||
if (ind == 0) {
|
|
||||||
uni.navigateToMiniProgram({
|
|
||||||
appId: 'wx3e83b37ba682faf5',
|
|
||||||
path: 'pages/index/index',
|
|
||||||
extraData: {},
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// 设备管理小程序
|
|
||||||
if (ind == 1) {
|
|
||||||
uni.navigateToMiniProgram({
|
|
||||||
appId: 'wx6f48cc32c5c0a4a2',
|
|
||||||
path: 'pages/index/index',
|
|
||||||
extraData: {},
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
},
|
|
||||||
navTo(url) {
|
|
||||||
if (!uni.getStorageSync('token')) {
|
|
||||||
this.$store.commit("changeUserLogin", true);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
uni.navigateTo({
|
|
||||||
url
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleEditClick() {
|
|
||||||
if (!uni.getStorageSync('token')) {
|
|
||||||
this.$store.commit("changeUserLogin", true);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.$store.commit("changeEdit", true);
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
handleOutLogin() {
|
||||||
|
let that = this
|
||||||
|
uni.showModal({
|
||||||
|
title: '友情提示',
|
||||||
|
content: '是否退出登录?',
|
||||||
|
success: function(res) {
|
||||||
|
if (res.confirm) {
|
||||||
|
that.$model.getoutlogin({
|
||||||
|
sessionid: uni.getStorageSync('sessionid')
|
||||||
|
}).then((res) => {
|
||||||
|
that.$tools.msg(res.message)
|
||||||
|
if (res.code != 0) return
|
||||||
|
console.log('确定退出', res)
|
||||||
|
uni.clearStorageSync()
|
||||||
|
uni.setStorageSync('sessionid', null)
|
||||||
|
that.$store.commit("changeLogout", false);
|
||||||
|
uni.reLaunch({
|
||||||
|
url: "/pages/index/index"
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else if (res.cancel) {
|
||||||
|
that.$tools.msg("您已取消操作!");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleClick(ind) {
|
||||||
|
let that = this
|
||||||
|
if (!uni.getStorageSync('token')) {
|
||||||
|
this.$store.commit("changeUserLogin", true);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (ind == 'adult' && that.configBox.referappid) {
|
||||||
|
uni.navigateToMiniProgram({
|
||||||
|
appId: that.configBox.referappid,
|
||||||
|
path: 'pages/index/index',
|
||||||
|
extraData: {},
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (ind == 'device' && that.configBox.businessappid) {
|
||||||
|
uni.navigateToMiniProgram({
|
||||||
|
appId: that.configBox.businessappid,
|
||||||
|
path: 'pages/index/index',
|
||||||
|
extraData: {},
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
},
|
||||||
|
navTo(url) {
|
||||||
|
if (!uni.getStorageSync('token')) {
|
||||||
|
this.$store.commit("changeUserLogin", true);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
uni.navigateTo({
|
||||||
|
url
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleEditClick() {
|
||||||
|
if (!uni.getStorageSync('token')) {
|
||||||
|
this.$store.commit("changeUserLogin", true);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.$store.commit("changeEdit", true);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped="scoped" lang="scss">
|
<style scoped="scoped" lang="scss">
|
||||||
.content {
|
.content {
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
margin-top: 110px;
|
margin-top: 110px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-con {
|
.header-con {
|
||||||
height: 95px !important;
|
height: 95px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wxlist {
|
.wxlist {
|
||||||
height: auto;
|
height: auto;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 0 15px;
|
margin: 0 15px;
|
||||||
padding: 0 15px;
|
padding: 0 15px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
width: auto;
|
width: auto;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 55px;
|
line-height: 55px;
|
||||||
height: 55px;
|
height: 55px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: relative;
|
position: relative;
|
||||||
// border-bottom: 1px solid #dfdfdf;
|
// border-bottom: 1px solid #dfdfdf;
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
display: flex;
|
|
||||||
|
|
||||||
.name {
|
|
||||||
float: left;
|
|
||||||
color: #333;
|
|
||||||
position: absolute;
|
|
||||||
left: 27px;
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.infolist {
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin: 15px;
|
|
||||||
|
|
||||||
.item {
|
.name {
|
||||||
width: 30%;
|
float: left;
|
||||||
padding: 10px 0;
|
color: #333;
|
||||||
text-align: center;
|
position: absolute;
|
||||||
background: #fff;
|
left: 27px;
|
||||||
border-radius: 10px;
|
top: 0;
|
||||||
position: relative;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.right {
|
.infolist {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: space-between;
|
||||||
margin-top: 5px;
|
align-items: center;
|
||||||
|
margin: 15px;
|
||||||
|
|
||||||
text {
|
.item {
|
||||||
display: inline-block;
|
width: 30%;
|
||||||
font-size: 16px;
|
padding: 10px 0;
|
||||||
color: #666;
|
text-align: center;
|
||||||
font-weight: 700;
|
background: #fff;
|
||||||
}
|
border-radius: 10px;
|
||||||
|
position: relative;
|
||||||
icon {
|
|
||||||
position: absolute;
|
|
||||||
right: 7px;
|
|
||||||
bottom: 9px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.right {
|
||||||
width: auto;
|
display: flex;
|
||||||
margin-top: 50px;
|
justify-content: center;
|
||||||
}
|
margin-top: 5px;
|
||||||
|
|
||||||
/deep/ .header {
|
text {
|
||||||
justify-content: center;
|
display: inline-block;
|
||||||
flex-wrap: wrap;
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/deep/ .header text {
|
|
||||||
background: inherit;
|
|
||||||
border: none;
|
|
||||||
width: 100%;
|
|
||||||
display: block;
|
|
||||||
color: #fff;
|
|
||||||
text-align: center;
|
|
||||||
margin-right: 0;
|
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
color: #666;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
icon {
|
||||||
|
position: absolute;
|
||||||
|
right: 7px;
|
||||||
|
bottom: 9px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
width: auto;
|
||||||
|
margin-top: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .header {
|
||||||
|
justify-content: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/ .header text {
|
||||||
|
background: inherit;
|
||||||
|
border: none;
|
||||||
|
width: 100%;
|
||||||
|
display: block;
|
||||||
|
color: #fff;
|
||||||
|
text-align: center;
|
||||||
|
margin-right: 0;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,469 +1,467 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="text" @click="openBluetoothAdapter" v-if="issearch">没有搜到想要的?点击重新搜索</view>
|
<view class="text" @click="openBluetoothAdapter" v-if="issearch">没有搜到想要的?点击重新搜索</view>
|
||||||
<view class="point-area">
|
<view class="point-area">
|
||||||
<view class="point point-10"></view>
|
<view class="point point-10"></view>
|
||||||
<view class="point point-40"></view>
|
<view class="point point-40"></view>
|
||||||
<view class="point point-80"></view>
|
<view class="point point-80"></view>
|
||||||
<view class="point point-100"></view>
|
<view class="point point-100"></view>
|
||||||
<view class="point point-120"></view>
|
<view class="point point-120"></view>
|
||||||
</view>
|
|
||||||
<view class="list">
|
|
||||||
<view class="item" v-for="(item,index) in devList" :key="index" @click="handleWeight(item)">
|
|
||||||
<image :src="item.img"></image>
|
|
||||||
<text>{{item.faccode}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="tips" v-if="isdevTip">
|
|
||||||
<view>提示:</view>
|
|
||||||
<text>1.请确保设备是已激活</text>
|
|
||||||
<text>2.请确保设备是开机状态</text>
|
|
||||||
<text>3.请确定手机蓝牙、位置信息已打开</text>
|
|
||||||
<text>4.ios系统需打开设置—>应用—>微信里的蓝牙权限</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
|
<view class="list">
|
||||||
|
<view class="item" v-for="(item,index) in devList" :key="index" @click="handleWeight(item)">
|
||||||
|
<image :src="item.img"></image>
|
||||||
|
<text>{{item.faccode}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="tips" v-if="isdevTip">
|
||||||
|
<view>提示:</view>
|
||||||
|
<text>1.请确保设备是已激活</text>
|
||||||
|
<text>2.请确保设备是开机状态</text>
|
||||||
|
<text>3.请确定手机蓝牙、位置信息已打开</text>
|
||||||
|
<text>4.ios系统需打开设置—>应用—>微信里的蓝牙权限</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
let that;
|
let that;
|
||||||
let myTime;
|
let myTime;
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
Unload: false,
|
Unload: false,
|
||||||
issearch: false,
|
issearch: false,
|
||||||
isdevTip: false,
|
isdevTip: false,
|
||||||
devList: []
|
devList: [],
|
||||||
}
|
devicesList: [],
|
||||||
},
|
}
|
||||||
computed: {
|
},
|
||||||
...mapState(["user", "isConnected", "isBluetoothTyle"]),
|
computed: {
|
||||||
},
|
...mapState(["user", "isConnected", "isBluetoothTyle", "appTheme"]),
|
||||||
onLoad() {
|
},
|
||||||
that = this
|
onLoad() {
|
||||||
that.openBluetoothAdapter()
|
that = this
|
||||||
that.onBLEConnectionStateChange()
|
// 导航栏颜色
|
||||||
uni.onBluetoothAdapterStateChange(function(res) {
|
uni.setNavigationBarColor({
|
||||||
that.$store.commit("changeBluetooth", res.available);
|
frontColor: '#ffffff',
|
||||||
})
|
backgroundColor: this.appTheme,
|
||||||
},
|
})
|
||||||
onUnload: function() {
|
that.openBluetoothAdapter()
|
||||||
let that = this
|
that.onBLEConnectionStateChange()
|
||||||
if (!that.Unload) {
|
uni.onBluetoothAdapterStateChange(function(res) {
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
that.$store.commit("changeBluetooth", res.available);
|
||||||
that.closeBLEConnection()
|
})
|
||||||
that.closeBluetoothAdapter()
|
},
|
||||||
console.log("搜索页返回")
|
onUnload: function() {
|
||||||
}
|
let that = this
|
||||||
},
|
if (!that.Unload) {
|
||||||
watch: {
|
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||||
isBluetoothTyle: function() {
|
that.closeBLEConnection()
|
||||||
let that = this
|
that.closeBluetoothAdapter()
|
||||||
if (!that.isBluetoothTyle) {
|
console.log("搜索页返回")
|
||||||
that.issearch = true
|
}
|
||||||
that.isdevTip = true
|
},
|
||||||
that.devList = []
|
watch: {
|
||||||
clearTimeout(myTime);
|
isBluetoothTyle: function() {
|
||||||
that.closeBLEConnection()
|
let that = this
|
||||||
that.closeBluetoothAdapter()
|
if (!that.isBluetoothTyle) {
|
||||||
that.stopBluetoothDevicesDiscovery()
|
that.issearch = true
|
||||||
}
|
that.isdevTip = true
|
||||||
}
|
that.devList = []
|
||||||
},
|
clearTimeout(myTime);
|
||||||
methods: {
|
that.closeBLEConnection()
|
||||||
// 初始化蓝牙
|
that.closeBluetoothAdapter()
|
||||||
openBluetoothAdapter() {
|
that.stopBluetoothDevicesDiscovery()
|
||||||
let that = this
|
|
||||||
uni.openBluetoothAdapter({
|
|
||||||
success: e => {
|
|
||||||
console.log("蓝牙初始化成功")
|
|
||||||
that.issearch = false
|
|
||||||
that.isdevTip = false
|
|
||||||
that.devList = []
|
|
||||||
that.startBluetoothDeviceDiscovery()
|
|
||||||
},
|
|
||||||
fail: e => {
|
|
||||||
that.$tools.msg("请打开蓝牙!安卓系统需打开蓝牙、定位权限;ios系统需打开设置——>应用——>微信里的蓝牙权限!")
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 监听蓝牙连接状态
|
|
||||||
onBLEConnectionStateChange() {
|
|
||||||
let that = this
|
|
||||||
uni.onBLEConnectionStateChange(function(res) {
|
|
||||||
console.log("蓝牙连接状态", res.connected)
|
|
||||||
that.$store.commit("changeConnected", res.connected);
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 停止搜索蓝牙设备
|
|
||||||
*/
|
|
||||||
stopBluetoothDevicesDiscovery() {
|
|
||||||
uni.stopBluetoothDevicesDiscovery({
|
|
||||||
success: e => {
|
|
||||||
console.log("停止搜索蓝牙设备", e)
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 开始搜寻附近的蓝牙外围设备
|
|
||||||
startBluetoothDeviceDiscovery() {
|
|
||||||
let that = this
|
|
||||||
uni.startBluetoothDevicesDiscovery({
|
|
||||||
// allowDuplicatesKey: false, //是否允许重复上报同一设备
|
|
||||||
success: res => {
|
|
||||||
that.onBluetoothDeviceFound();
|
|
||||||
},
|
|
||||||
fail: res => {
|
|
||||||
that.$tools.msg("请打开蓝牙!安卓系统需打开蓝牙、定位权限;ios系统需打开设置——>应用——>微信里的蓝牙权限!")
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 发现外围设备
|
|
||||||
*/
|
|
||||||
onBluetoothDeviceFound() {
|
|
||||||
var that = this;
|
|
||||||
uni.onBluetoothDeviceFound(res => {
|
|
||||||
res.devices.forEach(device => {
|
|
||||||
if (!device.name && !device.localName) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (device.advertisServiceUUIDs[0].indexOf("F0A0") !== -1) {
|
|
||||||
let buffer = device.advertisData.slice(0, 8)
|
|
||||||
device.mac = new Uint8Array(buffer)
|
|
||||||
let tempMac = Array.from(device.mac)
|
|
||||||
tempMac.reverse()
|
|
||||||
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
|
|
||||||
if (device.macAddr != "") {
|
|
||||||
that.handleDevType(device.macAddr)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let buff = device.advertisData.slice(-6)
|
|
||||||
device.mac = new Uint8Array(buff)
|
|
||||||
let tempMac = Array.from(device.mac)
|
|
||||||
if (device.name.indexOf('My') == -1) {
|
|
||||||
tempMac.reverse()
|
|
||||||
}
|
|
||||||
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
|
|
||||||
if (device.macAddr != "") {
|
|
||||||
that.handleDevType(device.macAddr)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
that.handleMyTime()
|
|
||||||
},
|
|
||||||
handleMyTime() {
|
|
||||||
var that = this;
|
|
||||||
myTime = setTimeout(function() {
|
|
||||||
if (!that.devList.length) {
|
|
||||||
that.isdevTip = true
|
|
||||||
that.devList = []
|
|
||||||
}
|
|
||||||
that.issearch = true
|
|
||||||
clearTimeout(myTime);
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
|
||||||
}, 30000);
|
|
||||||
},
|
|
||||||
// 排查设备
|
|
||||||
handleDevType(sn) {
|
|
||||||
that = this
|
|
||||||
that.$model.getdevdetail({
|
|
||||||
sn: sn
|
|
||||||
}).then(res => {
|
|
||||||
if (res.code == 0) {
|
|
||||||
res.data.deviceId = sn
|
|
||||||
that.devList.push(res.data);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleWeight(item) {
|
|
||||||
let that = this
|
|
||||||
that.Unload = true
|
|
||||||
clearTimeout(myTime);
|
|
||||||
if (item.type != 4 || item.type != 5 || item.type != 16) {
|
|
||||||
that.stopBluetoothDevicesDiscovery()
|
|
||||||
}
|
|
||||||
that.$tools.handlePages(item.type, item.deviceId)
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 断开蓝牙模块
|
|
||||||
*/
|
|
||||||
closeBluetoothAdapter() {
|
|
||||||
let that = this;
|
|
||||||
uni.closeBluetoothAdapter({
|
|
||||||
success: res => {
|
|
||||||
console.log('蓝牙模块关闭成功');
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* 断开蓝牙连接
|
|
||||||
*/
|
|
||||||
closeBLEConnection() {
|
|
||||||
var that = this;
|
|
||||||
uni.closeBLEConnection({
|
|
||||||
success: res => {
|
|
||||||
console.log('断开蓝牙连接成功');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleBack() {
|
|
||||||
let that = this
|
|
||||||
that.Unload = true
|
|
||||||
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
|
||||||
that.closeBLEConnection()
|
|
||||||
that.closeBluetoothAdapter()
|
|
||||||
uni.navigateBack({
|
|
||||||
delta: 1
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 初始化蓝牙
|
||||||
|
openBluetoothAdapter() {
|
||||||
|
let that = this
|
||||||
|
uni.openBluetoothAdapter({
|
||||||
|
success: e => {
|
||||||
|
console.log("蓝牙初始化成功")
|
||||||
|
that.issearch = false
|
||||||
|
that.isdevTip = false
|
||||||
|
that.devList = []
|
||||||
|
that.startBluetoothDeviceDiscovery()
|
||||||
|
},
|
||||||
|
fail: e => {
|
||||||
|
that.$tools.msg("请打开蓝牙!安卓系统需打开蓝牙、定位权限;ios系统需打开设置——>应用——>微信里的蓝牙权限!")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 监听蓝牙连接状态
|
||||||
|
onBLEConnectionStateChange() {
|
||||||
|
let that = this
|
||||||
|
uni.onBLEConnectionStateChange(function(res) {
|
||||||
|
console.log("蓝牙连接状态", res.connected)
|
||||||
|
that.$store.commit("changeConnected", res.connected);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 停止搜索蓝牙设备
|
||||||
|
*/
|
||||||
|
stopBluetoothDevicesDiscovery() {
|
||||||
|
uni.stopBluetoothDevicesDiscovery({
|
||||||
|
success: e => {
|
||||||
|
console.log("停止搜索蓝牙设备", e)
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 开始搜寻附近的蓝牙外围设备
|
||||||
|
startBluetoothDeviceDiscovery() {
|
||||||
|
let that = this
|
||||||
|
uni.startBluetoothDevicesDiscovery({
|
||||||
|
allowDuplicatesKey: false, //是否允许重复上报同一设备
|
||||||
|
// interval: 200,
|
||||||
|
success: res => {
|
||||||
|
that.onBluetoothDeviceFound();
|
||||||
|
},
|
||||||
|
fail: res => {
|
||||||
|
that.$tools.msg("请打开蓝牙!安卓系统需打开蓝牙、定位权限;ios系统需打开设置——>应用——>微信里的蓝牙权限!")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 发现外围设备
|
||||||
|
*/
|
||||||
|
onBluetoothDeviceFound() {
|
||||||
|
var that = this;
|
||||||
|
uni.onBluetoothDeviceFound(res => {
|
||||||
|
res.devices.forEach(device => {
|
||||||
|
if (!device.name && !device.localName) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
console.log("设备列表", device)
|
||||||
|
let buff = ""
|
||||||
|
if (device.name.indexOf("ELK") !== -1 && device.advertisServiceUUIDs[0].indexOf("F0A0") !== -1) {
|
||||||
|
buff = device.advertisData.slice(0, 8)
|
||||||
|
} else {
|
||||||
|
buff = device.advertisData.slice(-6)
|
||||||
|
}
|
||||||
|
device.mac = new Uint8Array(buff)
|
||||||
|
let tempMac = Array.from(device.mac)
|
||||||
|
if (device.name.indexOf('My') == -1) {
|
||||||
|
tempMac.reverse()
|
||||||
|
}
|
||||||
|
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase()
|
||||||
|
const foundDevices = that.devicesList
|
||||||
|
const idx = that.$tools.inArray(foundDevices, "deviceId", device.deviceId)
|
||||||
|
if (idx === -1) {
|
||||||
|
that.devicesList.push(device);
|
||||||
|
if (device.macAddr != "") {
|
||||||
|
that.handleDevType(device.macAddr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// console.log("设备列表", that.devicesList)
|
||||||
|
})
|
||||||
|
});
|
||||||
|
that.handleMyTime()
|
||||||
|
},
|
||||||
|
handleMyTime() {
|
||||||
|
var that = this;
|
||||||
|
myTime = setTimeout(function() {
|
||||||
|
if (!that.devList.length) {
|
||||||
|
that.isdevTip = true
|
||||||
|
that.devList = []
|
||||||
|
}
|
||||||
|
that.issearch = true
|
||||||
|
clearTimeout(myTime);
|
||||||
|
that.closeBLEConnection()
|
||||||
|
that.closeBluetoothAdapter()
|
||||||
|
that.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||||
|
}, 30000);
|
||||||
|
},
|
||||||
|
// 排查设备
|
||||||
|
handleDevType(sn) {
|
||||||
|
that = this
|
||||||
|
that.$model.getdevdetail({
|
||||||
|
sn: sn
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
res.data.deviceId = sn
|
||||||
|
that.devList.push(res.data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleWeight(item) {
|
||||||
|
let that = this
|
||||||
|
that.Unload = true
|
||||||
|
clearTimeout(myTime);
|
||||||
|
if (item.type != 4 || item.type != 5 || item.type != 16) {
|
||||||
|
that.stopBluetoothDevicesDiscovery()
|
||||||
|
}
|
||||||
|
that.$tools.handlePages(item.type, item.deviceId)
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 断开蓝牙模块
|
||||||
|
*/
|
||||||
|
closeBluetoothAdapter() {
|
||||||
|
let that = this;
|
||||||
|
uni.closeBluetoothAdapter({
|
||||||
|
success: res => {
|
||||||
|
console.log('蓝牙模块关闭成功');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 断开蓝牙连接
|
||||||
|
*/
|
||||||
|
closeBLEConnection() {
|
||||||
|
var that = this;
|
||||||
|
uni.closeBLEConnection({
|
||||||
|
success: res => {
|
||||||
|
console.log('断开蓝牙连接成功');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.text {
|
.text {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0px;
|
top: 0px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
line-height: 50px;
|
line-height: 50px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: $greencolor;
|
color: $greencolor;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tips {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
bottom: 15px;
|
||||||
|
line-height: 24px;
|
||||||
|
|
||||||
|
view {
|
||||||
|
font-size: 14px;
|
||||||
|
color: $greencolor;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-left: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tips {
|
text {
|
||||||
position: absolute;
|
font-size: 12px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
bottom: 15px;
|
display: block;
|
||||||
line-height: 24px;
|
margin-left: 20px;
|
||||||
|
color: #999;
|
||||||
view {
|
|
||||||
font-size: 14px;
|
|
||||||
color: $greencolor;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-left: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
font-size: 12px;
|
|
||||||
width: 100%;
|
|
||||||
display: block;
|
|
||||||
margin-left: 20px;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.list {
|
.list {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 55%;
|
left: 55%;
|
||||||
top: -10px;
|
top: -10px;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 45px;
|
width: 45px;
|
||||||
height: 45px;
|
height: 45px;
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
text {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
font-size: 12px;
|
|
||||||
color: #666;
|
|
||||||
margin-top: 5px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.item:nth-of-type(2) {
|
|
||||||
left: calc(55% - 60px);
|
|
||||||
top: 50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item:nth-of-type(3) {
|
|
||||||
left: calc(50% - 140px);
|
|
||||||
top: 90px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item:nth-of-type(4) {
|
|
||||||
left: calc(61% + 20px);
|
|
||||||
top: 70px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item:nth-of-type(5) {
|
|
||||||
left: 20%;
|
|
||||||
top: -100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item:nth-of-type(6) {
|
|
||||||
left: calc(20% - 16px);
|
|
||||||
top: -38px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item:nth-of-type(7) {
|
|
||||||
left: 0;
|
|
||||||
top: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item:nth-of-type(8) {
|
|
||||||
left: calc(20% + 75px);
|
|
||||||
top: -150px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item:nth-of-type(9) {
|
|
||||||
left: calc(20% + 96px);
|
|
||||||
top: -80px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item:nth-of-type(10) {
|
|
||||||
left: 37px;
|
|
||||||
top: -170px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item:nth-of-type(11) {
|
|
||||||
left: calc(20% + 75px);
|
|
||||||
top: 130px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item:nth-of-type(12) {
|
|
||||||
left: -10px;
|
|
||||||
top: -104px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item:nth-of-type(13) {
|
|
||||||
left: calc(47% + 75px);
|
|
||||||
top: -150px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item:nth-of-type(14) {
|
|
||||||
left: calc(53% + 75px);
|
|
||||||
top: -50px;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.container {
|
|
||||||
width: 100%;
|
|
||||||
height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 中心园
|
|
||||||
.container::after {
|
|
||||||
content: "";
|
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background-color: #fbb780;
|
}
|
||||||
position: absolute;
|
|
||||||
z-index: 9;
|
|
||||||
|
|
||||||
}
|
text {
|
||||||
|
|
||||||
/* 定义范围*/
|
|
||||||
.point-area {
|
|
||||||
text-align: center;
|
|
||||||
position: relative;
|
|
||||||
width: 400rpx;
|
|
||||||
height: 400rpx;
|
|
||||||
transition: opacity 0.5s ease-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
.point-10,
|
|
||||||
.point-40,
|
|
||||||
.point-80,
|
|
||||||
.point-100,
|
|
||||||
.point-120 {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.point-10:after,
|
|
||||||
.point-40:after,
|
|
||||||
.point-80:after,
|
|
||||||
.point-100:after,
|
|
||||||
.point-120:after {
|
|
||||||
content: '';
|
|
||||||
display: block;
|
display: block;
|
||||||
position: absolute;
|
width: 100%;
|
||||||
top: 0;
|
font-size: 12px;
|
||||||
right: 0;
|
color: #666;
|
||||||
bottom: 0;
|
margin-top: 5px;
|
||||||
left: 0;
|
text-align: center;
|
||||||
border-radius: 50%;
|
}
|
||||||
opacity: 0;
|
|
||||||
border: 1px solid #f7cb6b;
|
|
||||||
animation-play-state: paused;
|
|
||||||
-webkit-animation-play-state: paused;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.point-10:after {
|
.item:nth-of-type(2) {
|
||||||
content: '';
|
left: calc(55% - 60px);
|
||||||
animation: ripple 3000ms linear 0ms infinite;
|
top: 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.point-40:after {
|
.item:nth-of-type(3) {
|
||||||
content: '';
|
left: calc(50% - 140px);
|
||||||
animation: ripple 3000ms linear 600ms infinite;
|
top: 90px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.point-80:after {
|
.item:nth-of-type(4) {
|
||||||
content: '';
|
left: calc(61% + 20px);
|
||||||
animation: ripple 3000ms linear 1200ms infinite;
|
top: 70px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.point-100:after {
|
.item:nth-of-type(5) {
|
||||||
content: '';
|
left: 20%;
|
||||||
animation: ripple 3000ms linear 1800ms infinite;
|
top: -100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.point-120:after {
|
.item:nth-of-type(6) {
|
||||||
content: '';
|
left: calc(20% - 16px);
|
||||||
animation: ripple 3000ms linear 2400ms infinite;
|
top: -38px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.item:nth-of-type(7) {
|
||||||
@keyframes ripple {
|
left: 0;
|
||||||
|
top: 15px;
|
||||||
0% {
|
|
||||||
opacity: 0;
|
|
||||||
transform: scale(0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
50% {
|
|
||||||
opacity: 0.8;
|
|
||||||
transform: scale(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
100% {
|
|
||||||
opacity: 0.2;
|
|
||||||
transform: scale(2.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.item:nth-of-type(8) {
|
||||||
|
left: calc(20% + 75px);
|
||||||
|
top: -150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item:nth-of-type(9) {
|
||||||
|
left: calc(20% + 96px);
|
||||||
|
top: -80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item:nth-of-type(10) {
|
||||||
|
left: 37px;
|
||||||
|
top: -170px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item:nth-of-type(11) {
|
||||||
|
left: calc(20% + 75px);
|
||||||
|
top: 130px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item:nth-of-type(12) {
|
||||||
|
left: -10px;
|
||||||
|
top: -104px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item:nth-of-type(13) {
|
||||||
|
left: calc(47% + 75px);
|
||||||
|
top: -150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item:nth-of-type(14) {
|
||||||
|
left: calc(53% + 75px);
|
||||||
|
top: -50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 中心园
|
||||||
|
.container::after {
|
||||||
|
content: "";
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: #fbb780;
|
||||||
|
position: absolute;
|
||||||
|
z-index: 9;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 定义范围*/
|
||||||
|
.point-area {
|
||||||
|
text-align: center;
|
||||||
|
position: relative;
|
||||||
|
width: 400rpx;
|
||||||
|
height: 400rpx;
|
||||||
|
transition: opacity 0.5s ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.point-10,
|
||||||
|
.point-40,
|
||||||
|
.point-80,
|
||||||
|
.point-100,
|
||||||
|
.point-120 {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.point-10:after,
|
||||||
|
.point-40:after,
|
||||||
|
.point-80:after,
|
||||||
|
.point-100:after,
|
||||||
|
.point-120:after {
|
||||||
|
content: '';
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
border-radius: 50%;
|
||||||
|
opacity: 0;
|
||||||
|
border: 1px solid #f7cb6b;
|
||||||
|
animation-play-state: paused;
|
||||||
|
-webkit-animation-play-state: paused;
|
||||||
|
}
|
||||||
|
|
||||||
|
.point-10:after {
|
||||||
|
content: '';
|
||||||
|
animation: ripple 3000ms linear 0ms infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.point-40:after {
|
||||||
|
content: '';
|
||||||
|
animation: ripple 3000ms linear 600ms infinite;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.point-80:after {
|
||||||
|
content: '';
|
||||||
|
animation: ripple 3000ms linear 1200ms infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.point-100:after {
|
||||||
|
content: '';
|
||||||
|
animation: ripple 3000ms linear 1800ms infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.point-120:after {
|
||||||
|
content: '';
|
||||||
|
animation: ripple 3000ms linear 2400ms infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@keyframes ripple {
|
||||||
|
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
transform: scale(0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
50% {
|
||||||
|
opacity: 0.8;
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
opacity: 0.2;
|
||||||
|
transform: scale(2.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,312 +1,319 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<!-- 时间选择 -->
|
<!-- 时间选择 -->
|
||||||
<view class="TrendPage">
|
<view class="TrendPage">
|
||||||
<view class="TrendTime">
|
<view class="TrendTime">
|
||||||
<view class="boxTime">
|
<view class="boxTime">
|
||||||
<view class="one">
|
<view class="one">
|
||||||
<picker mode="date" class="f-l" :value="startTime?startTime:startDate" @change="handStartTimeH">
|
<picker mode="date" class="f-l" :value="startTime?startTime:startDate" @change="handStartTimeH">
|
||||||
<view class="uni-input">{{startTime?startTime:startDate}}
|
<view class="uni-input">{{startTime?startTime:startDate}}
|
||||||
<icon class="iconfont iconDown"></icon>
|
<icon class="iconfont iconDown"></icon>
|
||||||
</view>
|
</view>
|
||||||
</picker>
|
</picker>
|
||||||
|
|
||||||
<picker mode="date" :end="endDate" class="f-r" :value="endDate" @change="handEndTimeH">
|
<picker mode="date" :end="endDate" class="f-r" :value="endDate" @change="handEndTimeH">
|
||||||
<view class="uni-input">~ {{endTime?endTime:endDate}}
|
<view class="uni-input">~ {{endTime?endTime:endDate}}
|
||||||
<icon class="iconfont iconDown"></icon>
|
<icon class="iconfont iconDown"></icon>
|
||||||
</view>
|
</view>
|
||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
<view class="tow" @click="handAllTime(0)" :class="{style:active==0}">
|
<view class="tow" @click="handAllTime(0)" :class="{style:active==0}">
|
||||||
近3月
|
近3月
|
||||||
</view>
|
</view>
|
||||||
<view class="tow" @click="handAllTime(1)" :class="{style:active==1}">
|
<view class="tow" @click="handAllTime(1)" :class="{style:active==1}">
|
||||||
近半年
|
近半年
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 曲线图 -->
|
|
||||||
<view class="box boxList">
|
|
||||||
<view class="listC">
|
|
||||||
<view :class="{active:index==active1}" class="name" v-for="(item,index) in weightList" :key="index"
|
|
||||||
@click="showbox(index)">
|
|
||||||
{{item.title}}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="blockC">
|
|
||||||
<view v-if="lineData&&lineData.categories.length&&handTrue">
|
|
||||||
<qiun-data-charts type="area" :chartData="lineData" :canvas2d="true" canvasId="charts09"
|
|
||||||
:cHeight="480" :cWidth="640" :animation="false"
|
|
||||||
:opts="{enableScroll:true,xAxis:{scrollShow:false,itemCount:3}}" :ontouch="true" />
|
|
||||||
</view>
|
|
||||||
<view class="nolist" v-else>
|
|
||||||
<icon class="iconfont icon-zanwu"></icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 目标-->
|
|
||||||
<view class="box">
|
|
||||||
<view class="data">
|
|
||||||
<view class="item" @click="handleClick(0)">
|
|
||||||
<view class="val">{{userInfo.targetweight?userInfo.targetweight:0}}<text>kg</text>
|
|
||||||
</view>
|
|
||||||
<view class="name">目标体重<icon class="t-icon t-icon-bianji3"></icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<view class="val">{{userInfo.totalweight?Math.abs(userInfo.totalweight):0}}<text>kg</text>
|
|
||||||
</view>
|
|
||||||
<view class="name" v-if="Number(userInfo.totalweight)<0">累计增重</view>
|
|
||||||
<view class="name" v-else>累计减重</view>
|
|
||||||
</view>
|
|
||||||
<view class="item" @click="handleClick(1)">
|
|
||||||
<view class="val">{{userInfo.firstweight?userInfo.firstweight:0}}<text>kg</text>
|
|
||||||
</view>
|
|
||||||
<view class="name">初始体重<icon class="t-icon t-icon-bianji3"></icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="item">
|
|
||||||
<view class="val">{{userInfo.day?userInfo.day:0}}<text>天</text></view>
|
|
||||||
<view class="name">减重天数</view>
|
|
||||||
</view>
|
|
||||||
<view class="item" @click="handleClick(2)">
|
|
||||||
<view class="val"></view>
|
|
||||||
<view class="name">
|
|
||||||
<icon class="iconfont icon-tianjia">手动记录</icon>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<!-- 手动 -->
|
|
||||||
<manuaRecord @getList="getList"></manuaRecord>
|
|
||||||
<!-- 初始 -->
|
|
||||||
<firstweight></firstweight>
|
|
||||||
<!-- 目标 -->
|
|
||||||
<targetWeight></targetWeight>
|
|
||||||
<!-- 登录 -->
|
|
||||||
<userPopup></userPopup>
|
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 曲线图 -->
|
||||||
|
<view class="box boxList">
|
||||||
|
<view class="listC">
|
||||||
|
<view :class="{active:index==active1}" class="name" v-for="(item,index) in weightList" :key="index"
|
||||||
|
@click="showbox(index)">
|
||||||
|
{{item.title}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="blockC">
|
||||||
|
<view v-if="lineData&&lineData.categories.length&&handTrue">
|
||||||
|
<qiun-data-charts type="area" :chartData="lineData" :canvas2d="true" canvasId="charts09" :cHeight="480"
|
||||||
|
:cWidth="640" :animation="false" :opts="{enableScroll:true,xAxis:{scrollShow:false,itemCount:3}}"
|
||||||
|
:ontouch="true" />
|
||||||
|
</view>
|
||||||
|
<view class="nolist" v-else>
|
||||||
|
<icon class="iconfont icon-zanwu"></icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 目标-->
|
||||||
|
<view class="box">
|
||||||
|
<view class="data">
|
||||||
|
<view class="item" @click="handleClick(0)">
|
||||||
|
<view class="val">{{userInfo.targetweight?userInfo.targetweight:0}}<text>kg</text>
|
||||||
|
</view>
|
||||||
|
<view class="name">目标体重<icon class="t-icon t-icon-bianji3"></icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<view class="val">{{userInfo.totalweight?Math.abs(userInfo.totalweight):0}}<text>kg</text>
|
||||||
|
</view>
|
||||||
|
<view class="name" v-if="Number(userInfo.totalweight)<0">累计增重</view>
|
||||||
|
<view class="name" v-else>累计减重</view>
|
||||||
|
</view>
|
||||||
|
<view class="item" @click="handleClick(1)">
|
||||||
|
<view class="val">{{userInfo.firstweight?userInfo.firstweight:0}}<text>kg</text>
|
||||||
|
</view>
|
||||||
|
<view class="name">初始体重<icon class="t-icon t-icon-bianji3"></icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="item">
|
||||||
|
<view class="val">{{userInfo.day?userInfo.day:0}}<text>天</text></view>
|
||||||
|
<view class="name">减重天数</view>
|
||||||
|
</view>
|
||||||
|
<view class="item" @click="handleClick(2)">
|
||||||
|
<view class="val"></view>
|
||||||
|
<view class="name">
|
||||||
|
<icon class="iconfont icon-tianjia">手动记录</icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 手动 -->
|
||||||
|
<manuaRecord @getList="getList"></manuaRecord>
|
||||||
|
<!-- 初始 -->
|
||||||
|
<firstweight></firstweight>
|
||||||
|
<!-- 目标 -->
|
||||||
|
<targetWeight></targetWeight>
|
||||||
|
<!-- 登录 -->
|
||||||
|
<userPopup></userPopup>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
import userPopup from '@/components/userLogin.vue'
|
import userPopup from '@/components/userLogin.vue'
|
||||||
import targetWeight from '@/components/target/targetWeight.vue';
|
import targetWeight from '@/components/target/targetWeight.vue';
|
||||||
import firstweight from '@/components/target/firstweight.vue';
|
import firstweight from '@/components/target/firstweight.vue';
|
||||||
import manuaRecord from '@/components/target/manuaRecord.vue';
|
import manuaRecord from '@/components/target/manuaRecord.vue';
|
||||||
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts.vue';
|
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts.vue';
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
targetWeight,
|
targetWeight,
|
||||||
firstweight,
|
firstweight,
|
||||||
manuaRecord,
|
manuaRecord,
|
||||||
userPopup,
|
userPopup,
|
||||||
qiunDataCharts,
|
qiunDataCharts,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user", "Trend"]),
|
...mapState(["user", "Trend", "appTheme"]),
|
||||||
userInfo: function() {
|
userInfo: function() {
|
||||||
return this.user
|
return this.user
|
||||||
},
|
},
|
||||||
endDate() {
|
endDate() {
|
||||||
return this.$tools.getDate("start")
|
return this.$tools.getDate("start")
|
||||||
},
|
},
|
||||||
startDate() {
|
startDate() {
|
||||||
return this.$tools.GetDateStr(-90);
|
return this.$tools.GetDateStr(-90);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onShow() {
|
onLoad() {
|
||||||
let that = this
|
// 导航栏颜色
|
||||||
this.token = uni.getStorageSync('token')
|
uni.setNavigationBarColor({
|
||||||
this.active = 0
|
frontColor: '#ffffff',
|
||||||
this.startTime = ""
|
backgroundColor: this.appTheme,
|
||||||
this.endTime = ""
|
})
|
||||||
that.getList(this.startDate, this.endDate)
|
},
|
||||||
},
|
onShow() {
|
||||||
methods: {
|
let that = this
|
||||||
getList(start, end) {
|
this.token = uni.getStorageSync('token')
|
||||||
console.log("fanhui", start, end)
|
this.active = 0
|
||||||
let that = this
|
this.startTime = ""
|
||||||
that.$model.getTrendList({
|
this.endTime = ""
|
||||||
familyid: uni.getStorageSync('familyid'),
|
that.getList(this.startDate, this.endDate)
|
||||||
starttime: start,
|
},
|
||||||
endtime: end,
|
methods: {
|
||||||
}).then(res => {
|
getList(start, end) {
|
||||||
if (res) {
|
console.log("fanhui", start, end)
|
||||||
for (var i = 0; i < that.weightList.length; i++) {
|
let that = this
|
||||||
that.weightList[i].Line = res[that.weightList[i].key];
|
that.$model.getTrendList({
|
||||||
}
|
familyid: uni.getStorageSync('familyid'),
|
||||||
that.showbox(0)
|
starttime: start,
|
||||||
}
|
endtime: end,
|
||||||
})
|
}).then(res => {
|
||||||
},
|
if (res) {
|
||||||
showbox(index) {
|
for (var i = 0; i < that.weightList.length; i++) {
|
||||||
let that = this
|
that.weightList[i].Line = res[that.weightList[i].key];
|
||||||
that.handTrue = false
|
}
|
||||||
this.$nextTick(function() {
|
that.showbox(0)
|
||||||
that.handTrue = true
|
}
|
||||||
that.lineData = that.weightList[index].Line
|
})
|
||||||
})
|
},
|
||||||
that.active1 = index
|
showbox(index) {
|
||||||
},
|
let that = this
|
||||||
//开始
|
that.handTrue = false
|
||||||
handStartTimeH(e) {
|
this.$nextTick(function() {
|
||||||
let that = this
|
that.handTrue = true
|
||||||
if (this.endTime) {
|
that.lineData = that.weightList[index].Line
|
||||||
if (Date.parse(e.target.value) > Date.parse(this.endTime)) {
|
})
|
||||||
this.$tools.msg("请选择正确的时间")
|
that.active1 = index
|
||||||
return
|
},
|
||||||
}
|
//开始
|
||||||
} else {
|
handStartTimeH(e) {
|
||||||
if (Date.parse(e.target.value) > Date.parse(this.endDate)) {
|
let that = this
|
||||||
this.$tools.msg("请选择正确的时间")
|
if (this.endTime) {
|
||||||
return
|
if (Date.parse(e.target.value) > Date.parse(this.endTime)) {
|
||||||
}
|
this.$tools.msg("请选择正确的时间")
|
||||||
}
|
return
|
||||||
this.startTime = e.target.value
|
}
|
||||||
let endtime = that.endTime ? that.endTime : that.endDate
|
} else {
|
||||||
this.getList(that.startTime, endtime)
|
if (Date.parse(e.target.value) > Date.parse(this.endDate)) {
|
||||||
},
|
this.$tools.msg("请选择正确的时间")
|
||||||
// 结束
|
return
|
||||||
handEndTimeH(e) {
|
}
|
||||||
let that = this
|
|
||||||
if (this.startTime) {
|
|
||||||
if (Date.parse(e.target.value) < Date.parse(this.startTime)) {
|
|
||||||
this.$tools.msg("请选择正确的时间")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (Date.parse(e.target.value) < Date.parse(this.startDate)) {
|
|
||||||
this.$tools.msg("请选择正确的时间")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.endTime = e.target.value
|
|
||||||
let startTime = that.startTime ? that.startTime : that.startDate
|
|
||||||
this.getList(startTime, this.endTime)
|
|
||||||
},
|
|
||||||
// 日期
|
|
||||||
handAllTime(ind) {
|
|
||||||
let that = this
|
|
||||||
if (!uni.getStorageSync('token')) {
|
|
||||||
this.$store.commit("changeUserLogin", true);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.active = ind
|
|
||||||
if (ind == 0) {
|
|
||||||
this.startTime = that.$tools.GetDateStr(-90)
|
|
||||||
} else {
|
|
||||||
this.startTime = that.$tools.GetDateStr(-180)
|
|
||||||
}
|
|
||||||
this.getList(this.startTime, this.endDate)
|
|
||||||
},
|
|
||||||
handleClick(ind) {
|
|
||||||
if (!uni.getStorageSync('token')) {
|
|
||||||
this.$store.commit("changeUserLogin", true);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (ind == 0) {
|
|
||||||
this.$store.commit("changeTarget", true);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (ind == 1) {
|
|
||||||
this.$store.commit("changeFirst", true);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (ind == 2) {
|
|
||||||
this.$store.commit("changeRecord", true);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
lineData: null,
|
|
||||||
type: null,
|
|
||||||
active1: 0,
|
|
||||||
weight: "",
|
|
||||||
startTime: "",
|
|
||||||
endTime: "",
|
|
||||||
active: 0,
|
|
||||||
token: null,
|
|
||||||
handTrue: true,
|
|
||||||
weightList: [{
|
|
||||||
title: '体重',
|
|
||||||
key: 'weight',
|
|
||||||
showCon: false,
|
|
||||||
Line: {
|
|
||||||
"categories": [],
|
|
||||||
"series": [{
|
|
||||||
"color": "#fb7b92",
|
|
||||||
"name": "体重",
|
|
||||||
"data": []
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: 'BMI',
|
|
||||||
key: 'bmi',
|
|
||||||
Line: {
|
|
||||||
"categories": [],
|
|
||||||
"series": [{
|
|
||||||
"color": "#6bb0fe",
|
|
||||||
"name": "bmi",
|
|
||||||
"data": []
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
}, {
|
|
||||||
title: '肌肉',
|
|
||||||
key: 'muscle',
|
|
||||||
showCon: false,
|
|
||||||
Line: {
|
|
||||||
"categories": [],
|
|
||||||
"series": [{
|
|
||||||
"color": "#ff9f40",
|
|
||||||
"name": "肌肉率",
|
|
||||||
"data": []
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '脂肪',
|
|
||||||
key: 'fat_r',
|
|
||||||
showCon: false,
|
|
||||||
Line: {
|
|
||||||
"categories": [],
|
|
||||||
"series": [{
|
|
||||||
"color": "#3fcba7",
|
|
||||||
"name": "脂肪率",
|
|
||||||
"data": []
|
|
||||||
}]
|
|
||||||
},
|
|
||||||
}
|
|
||||||
],
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
this.startTime = e.target.value
|
||||||
|
let endtime = that.endTime ? that.endTime : that.endDate
|
||||||
|
this.getList(that.startTime, endtime)
|
||||||
|
},
|
||||||
|
// 结束
|
||||||
|
handEndTimeH(e) {
|
||||||
|
let that = this
|
||||||
|
if (this.startTime) {
|
||||||
|
if (Date.parse(e.target.value) < Date.parse(this.startTime)) {
|
||||||
|
this.$tools.msg("请选择正确的时间")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (Date.parse(e.target.value) < Date.parse(this.startDate)) {
|
||||||
|
this.$tools.msg("请选择正确的时间")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.endTime = e.target.value
|
||||||
|
let startTime = that.startTime ? that.startTime : that.startDate
|
||||||
|
this.getList(startTime, this.endTime)
|
||||||
|
},
|
||||||
|
// 日期
|
||||||
|
handAllTime(ind) {
|
||||||
|
let that = this
|
||||||
|
if (!uni.getStorageSync('token')) {
|
||||||
|
this.$store.commit("changeUserLogin", true);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.active = ind
|
||||||
|
if (ind == 0) {
|
||||||
|
this.startTime = that.$tools.GetDateStr(-90)
|
||||||
|
} else {
|
||||||
|
this.startTime = that.$tools.GetDateStr(-180)
|
||||||
|
}
|
||||||
|
this.getList(this.startTime, this.endDate)
|
||||||
|
},
|
||||||
|
handleClick(ind) {
|
||||||
|
if (!uni.getStorageSync('token')) {
|
||||||
|
this.$store.commit("changeUserLogin", true);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (ind == 0) {
|
||||||
|
this.$store.commit("changeTarget", true);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (ind == 1) {
|
||||||
|
this.$store.commit("changeFirst", true);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (ind == 2) {
|
||||||
|
this.$store.commit("changeRecord", true);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
lineData: null,
|
||||||
|
type: null,
|
||||||
|
active1: 0,
|
||||||
|
weight: "",
|
||||||
|
startTime: "",
|
||||||
|
endTime: "",
|
||||||
|
active: 0,
|
||||||
|
token: null,
|
||||||
|
handTrue: true,
|
||||||
|
weightList: [{
|
||||||
|
title: '体重',
|
||||||
|
key: 'weight',
|
||||||
|
showCon: false,
|
||||||
|
Line: {
|
||||||
|
"categories": [],
|
||||||
|
"series": [{
|
||||||
|
"color": "#fb7b92",
|
||||||
|
"name": "体重",
|
||||||
|
"data": []
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'BMI',
|
||||||
|
key: 'bmi',
|
||||||
|
Line: {
|
||||||
|
"categories": [],
|
||||||
|
"series": [{
|
||||||
|
"color": "#6bb0fe",
|
||||||
|
"name": "bmi",
|
||||||
|
"data": []
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
title: '肌肉',
|
||||||
|
key: 'muscle',
|
||||||
|
showCon: false,
|
||||||
|
Line: {
|
||||||
|
"categories": [],
|
||||||
|
"series": [{
|
||||||
|
"color": "#ff9f40",
|
||||||
|
"name": "肌肉率",
|
||||||
|
"data": []
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '脂肪',
|
||||||
|
key: 'fat_r',
|
||||||
|
showCon: false,
|
||||||
|
Line: {
|
||||||
|
"categories": [],
|
||||||
|
"series": [{
|
||||||
|
"color": "#3fcba7",
|
||||||
|
"name": "脂肪率",
|
||||||
|
"data": []
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
}
|
||||||
|
],
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.TrendTime {
|
.TrendTime {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.listC {
|
.listC {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.boxList {
|
.boxList {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
|
||||||
.list {
|
.list {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 19 KiB |
167
store/actions.js
167
store/actions.js
|
|
@ -1,83 +1,98 @@
|
||||||
import model from "../tools/model.js"
|
import model from "../tools/model.js"
|
||||||
import tools from '@/tools/tools.js'
|
import tools from '@/tools/tools.js'
|
||||||
|
import config from '@/config.js'
|
||||||
// Action 包含异步操作(请求API方法)、回调函数提交mutaions更改state数据状态,使之可以异步
|
// Action 包含异步操作(请求API方法)、回调函数提交mutaions更改state数据状态,使之可以异步
|
||||||
export default {
|
export default {
|
||||||
// 用户信息
|
// 用户信息
|
||||||
getUserInfo({
|
getUserInfo({
|
||||||
commit
|
commit
|
||||||
},
|
|
||||||
account) {
|
|
||||||
return model.getUserInfo(account).then(res => {
|
|
||||||
commit('changeUser', res.data)
|
|
||||||
if (!res.data.height || !res.data.mage || !res.data.birthday) {
|
|
||||||
uni.redirectTo({
|
|
||||||
url: `/pageTwo/login/userinfo`
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
// 获取称重结果
|
account) {
|
||||||
getResult({
|
return model.getUserInfo(account).then(res => {
|
||||||
commit
|
commit('changeUser', res.data)
|
||||||
}, account) {
|
if (!res.data.height || !res.data.mage || !res.data.birthday) {
|
||||||
return model.getResult(account).then((res) => {
|
uni.redirectTo({
|
||||||
console.log("报告", res)
|
url: `/pageTwo/login/userinfo`
|
||||||
if (res.code == 0) {
|
|
||||||
commit('changeMeasureResult', res.data)
|
|
||||||
} else {
|
|
||||||
commit('changeMeasureResult', null)
|
|
||||||
}
|
|
||||||
return res.data
|
|
||||||
})
|
})
|
||||||
},
|
return
|
||||||
// 获取历史记录
|
}
|
||||||
gethistoryList({
|
});
|
||||||
commit
|
},
|
||||||
}, account) {
|
// 获取称重结果
|
||||||
return model.getHistoryList(account).then((res) => {
|
getResult({
|
||||||
if (res.data && res.data.items) {
|
commit
|
||||||
commit('changehistoryList', res.data.items)
|
}, account) {
|
||||||
} else {
|
return model.getResult(account).then((res) => {
|
||||||
commit('changehistoryList', null)
|
console.log("报告", res)
|
||||||
}
|
if (res.code == 0) {
|
||||||
return res
|
commit('changeMeasureResult', res.data)
|
||||||
})
|
} else {
|
||||||
},
|
commit('changeMeasureResult', null)
|
||||||
//趋势
|
}
|
||||||
GetBodyTrendList({
|
return res.data
|
||||||
commit
|
})
|
||||||
}, account) {
|
},
|
||||||
return model.GetBodyTrendList(account).then((res) => {
|
// 获取历史记录
|
||||||
if (res) {
|
gethistoryList({
|
||||||
commit('changeTrend', res.cidata)
|
commit
|
||||||
}
|
}, account) {
|
||||||
return res
|
return model.getHistoryList(account).then((res) => {
|
||||||
})
|
if (res.data && res.data.items) {
|
||||||
},
|
commit('changehistoryList', res.data.items)
|
||||||
// 更新家庭成员
|
} else {
|
||||||
getFamilyList({
|
commit('changehistoryList', null)
|
||||||
commit
|
}
|
||||||
}) {
|
return res
|
||||||
return model.getFamilyList({
|
})
|
||||||
pagenum: 20,
|
},
|
||||||
pagesize: 1
|
//趋势
|
||||||
}).then((res) => {
|
GetBodyTrendList({
|
||||||
commit('changeFamilay', res)
|
commit
|
||||||
return res
|
}, account) {
|
||||||
})
|
return model.GetBodyTrendList(account).then((res) => {
|
||||||
},
|
if (res) {
|
||||||
// 获取历史记录
|
commit('changeTrend', res.cidata)
|
||||||
gethistoryList({
|
}
|
||||||
commit
|
return res
|
||||||
}, account) {
|
})
|
||||||
return model.getHistoryList(account).then((res) => {
|
},
|
||||||
if (res.data && res.data.rows) {
|
// 更新家庭成员
|
||||||
commit('changehistoryList', res.data.rows)
|
getFamilyList({
|
||||||
} else {
|
commit
|
||||||
commit('changehistoryList', null)
|
}) {
|
||||||
}
|
return model.getFamilyList({
|
||||||
return res
|
pagenum: 20,
|
||||||
})
|
pagesize: 1
|
||||||
},
|
}).then((res) => {
|
||||||
|
commit('changeFamilay', res)
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获取历史记录
|
||||||
|
gethistoryList({
|
||||||
|
commit
|
||||||
|
}, account) {
|
||||||
|
return model.getHistoryList(account).then((res) => {
|
||||||
|
if (res.data && res.data.rows) {
|
||||||
|
commit('changehistoryList', res.data.rows)
|
||||||
|
} else {
|
||||||
|
commit('changehistoryList', null)
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 配置详情
|
||||||
|
getConfig({
|
||||||
|
commit
|
||||||
|
}, account) {
|
||||||
|
account.appid = config.appid
|
||||||
|
return model.getConfig(account).then((res) => {
|
||||||
|
console.log("配置详情", res)
|
||||||
|
if (res.code == 0) {
|
||||||
|
commit("changeConfig", res.data)
|
||||||
|
commit("toggleColor", res.data.themecolor)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
257
store/index.js
257
store/index.js
|
|
@ -3,130 +3,139 @@ import Vuex from 'vuex'
|
||||||
import actions from './actions.js'
|
import actions from './actions.js'
|
||||||
Vue.use(Vuex)
|
Vue.use(Vuex)
|
||||||
export default new Vuex.Store({
|
export default new Vuex.Store({
|
||||||
// state: 存储基本数据
|
// state: 存储基本数据
|
||||||
state: {
|
state: {
|
||||||
user: {
|
user: {
|
||||||
headimg: null,
|
headimg: null,
|
||||||
name: "",
|
name: "",
|
||||||
nickname: "",
|
nickname: "",
|
||||||
targetweight: 0, //目标体重
|
targetweight: 0, //目标体重
|
||||||
firstweight: 0, //初始体重
|
firstweight: 0, //初始体重
|
||||||
weight: 0,
|
weight: 0,
|
||||||
birthday: "",
|
birthday: "",
|
||||||
height: 0,
|
height: 0,
|
||||||
age: "0",
|
age: "0",
|
||||||
sex: 0,
|
sex: 0,
|
||||||
familyid: 0,
|
familyid: 0,
|
||||||
mage: "",
|
mage: "",
|
||||||
firstresulttime: ""
|
firstresulttime: ""
|
||||||
},
|
},
|
||||||
MeasureResult: {},
|
MeasureResult: {},
|
||||||
isedit: false,
|
isedit: false,
|
||||||
isDrawe: false,
|
isDrawe: false,
|
||||||
isConnected: false,
|
isConnected: false,
|
||||||
isBluetoothTyle: false,
|
isBluetoothTyle: false,
|
||||||
familayList: [],
|
configBox: {},
|
||||||
historyList: [],
|
familayList: [],
|
||||||
Banner: [],
|
historyList: [],
|
||||||
Trend: {},
|
Banner: [],
|
||||||
TrendPk: {},
|
Trend: {},
|
||||||
isTarget: false,
|
TrendPk: {},
|
||||||
isFirst: false,
|
isTarget: false,
|
||||||
isRecord: false,
|
isFirst: false,
|
||||||
isLogin: false,
|
isRecord: false,
|
||||||
isLogout: true,
|
isLogin: false,
|
||||||
|
isLogout: true,
|
||||||
|
appTheme: '#00c6c6',
|
||||||
|
},
|
||||||
|
// mutations: Store中更改state数据状态的唯一方法(必须是同步函数)
|
||||||
|
mutations: {
|
||||||
|
toggleColor(state, color) { //你可以传入一个颜色参数(需要上面公共css中含有,如果不传入默认为粉色)
|
||||||
|
state.appTheme = color
|
||||||
|
},
|
||||||
|
/* 用户信息 */
|
||||||
|
changeUser(state, newData) {
|
||||||
|
if (newData.familyid) {
|
||||||
|
uni.setStorageSync('familyid', newData.familyid);
|
||||||
|
}
|
||||||
|
Object.assign(state.user, newData)
|
||||||
|
},
|
||||||
|
//登录弹框
|
||||||
|
changeUserLogin(state, newData) {
|
||||||
|
state.isLogin = newData
|
||||||
|
},
|
||||||
|
//历史记录
|
||||||
|
changehistoryList(state, newData) {
|
||||||
|
state.historyList = newData
|
||||||
|
},
|
||||||
|
// 获取称重数据
|
||||||
|
changeMeasureResult(state, newData) {
|
||||||
|
state.MeasureResult = newData
|
||||||
|
},
|
||||||
|
// 信息弹框
|
||||||
|
changeEdit(state, newData) {
|
||||||
|
state.isedit = newData
|
||||||
|
},
|
||||||
|
// 目标体重
|
||||||
|
changeTarget(state, newData) {
|
||||||
|
state.isTarget = newData
|
||||||
|
},
|
||||||
|
// 初始体重
|
||||||
|
changeFirst(state, newData) {
|
||||||
|
state.isFirst = newData
|
||||||
|
},
|
||||||
|
// 手动记录
|
||||||
|
changeRecord(state, newData) {
|
||||||
|
state.isRecord = newData
|
||||||
|
},
|
||||||
|
// 左侧菜单弹框
|
||||||
|
changeDrawe(state, newData) {
|
||||||
|
state.isDrawe = newData
|
||||||
|
},
|
||||||
|
//获取家庭成员
|
||||||
|
changeFamilay(state, newData) {
|
||||||
|
state.familayList = newData
|
||||||
|
},
|
||||||
|
//蓝牙状态
|
||||||
|
changeBluetooth(state, newData) {
|
||||||
|
state.isBluetoothTyle = newData
|
||||||
|
},
|
||||||
|
// 蓝牙连接状态
|
||||||
|
changeConnected(state, newData) {
|
||||||
|
state.isConnected = newData
|
||||||
|
},
|
||||||
|
//趋势
|
||||||
|
changeTrend(state, newData) {
|
||||||
|
state.Trend = newData
|
||||||
|
},
|
||||||
|
//对比
|
||||||
|
changeTrendPk(state, newData) {
|
||||||
|
state.TrendPk = newData
|
||||||
|
},
|
||||||
|
// banner
|
||||||
|
changeBanner(state, newData) {
|
||||||
|
state.Banner = newData
|
||||||
|
},
|
||||||
|
//配置详情
|
||||||
|
changeConfig(state, newData) {
|
||||||
|
state.configBox = newData
|
||||||
|
},
|
||||||
|
// 退出登录
|
||||||
|
changeLogout(state, newData) {
|
||||||
|
if (newData == false) {
|
||||||
|
state.user = {
|
||||||
|
headimg: null,
|
||||||
|
nickname: "",
|
||||||
|
name: "",
|
||||||
|
targetweight: 0, //目标体重
|
||||||
|
firstweight: 0, //初始体重
|
||||||
|
weight: 0,
|
||||||
|
birthday: "",
|
||||||
|
height: 0,
|
||||||
|
age: 0,
|
||||||
|
sex: 0,
|
||||||
|
familyid: 0,
|
||||||
|
firstresulttime: ""
|
||||||
|
}
|
||||||
|
state.Trend = null
|
||||||
|
state.historyList = null
|
||||||
|
state.devTypeList = null
|
||||||
|
}
|
||||||
|
state.isLogout = newData
|
||||||
},
|
},
|
||||||
// mutations: Store中更改state数据状态的唯一方法(必须是同步函数)
|
|
||||||
mutations: {
|
|
||||||
/* 用户信息 */
|
|
||||||
changeUser(state, newData) {
|
|
||||||
if (newData.familyid) {
|
|
||||||
uni.setStorageSync('familyid', newData.familyid);
|
|
||||||
}
|
|
||||||
Object.assign(state.user, newData)
|
|
||||||
},
|
|
||||||
//登录弹框
|
|
||||||
changeUserLogin(state, newData) {
|
|
||||||
state.isLogin = newData
|
|
||||||
},
|
|
||||||
//历史记录
|
|
||||||
changehistoryList(state, newData) {
|
|
||||||
state.historyList = newData
|
|
||||||
},
|
|
||||||
// 获取称重数据
|
|
||||||
changeMeasureResult(state, newData) {
|
|
||||||
state.MeasureResult = newData
|
|
||||||
},
|
|
||||||
// 信息弹框
|
|
||||||
changeEdit(state, newData) {
|
|
||||||
state.isedit = newData
|
|
||||||
},
|
|
||||||
// 目标体重
|
|
||||||
changeTarget(state, newData) {
|
|
||||||
state.isTarget = newData
|
|
||||||
},
|
|
||||||
// 初始体重
|
|
||||||
changeFirst(state, newData) {
|
|
||||||
state.isFirst = newData
|
|
||||||
},
|
|
||||||
// 手动记录
|
|
||||||
changeRecord(state, newData) {
|
|
||||||
state.isRecord = newData
|
|
||||||
},
|
|
||||||
// 左侧菜单弹框
|
|
||||||
changeDrawe(state, newData) {
|
|
||||||
state.isDrawe = newData
|
|
||||||
},
|
|
||||||
//获取家庭成员
|
|
||||||
changeFamilay(state, newData) {
|
|
||||||
state.familayList = newData
|
|
||||||
},
|
|
||||||
//蓝牙状态
|
|
||||||
changeBluetooth(state, newData) {
|
|
||||||
state.isBluetoothTyle = newData
|
|
||||||
},
|
|
||||||
// 蓝牙连接状态
|
|
||||||
changeConnected(state, newData) {
|
|
||||||
state.isConnected = newData
|
|
||||||
},
|
|
||||||
//趋势
|
|
||||||
changeTrend(state, newData) {
|
|
||||||
state.Trend = newData
|
|
||||||
},
|
|
||||||
//对比
|
|
||||||
changeTrendPk(state, newData) {
|
|
||||||
state.TrendPk = newData
|
|
||||||
},
|
|
||||||
// banner
|
|
||||||
changeBanner(state, newData) {
|
|
||||||
state.Banner = newData
|
|
||||||
},
|
|
||||||
// 退出登录
|
|
||||||
changeLogout(state, newData) {
|
|
||||||
if (newData == false) {
|
|
||||||
state.user = {
|
|
||||||
headimg: null,
|
|
||||||
nickname: "",
|
|
||||||
name: "",
|
|
||||||
targetweight: 0, //目标体重
|
|
||||||
firstweight: 0, //初始体重
|
|
||||||
weight: 0,
|
|
||||||
birthday: "",
|
|
||||||
height: 0,
|
|
||||||
age: 0,
|
|
||||||
sex: 0,
|
|
||||||
familyid: 0,
|
|
||||||
firstresulttime: ""
|
|
||||||
}
|
|
||||||
state.Trend = null
|
|
||||||
state.historyList = null
|
|
||||||
state.devTypeList = null
|
|
||||||
}
|
|
||||||
state.isLogout = newData
|
|
||||||
},
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// 模块化vuex
|
// 模块化vuex
|
||||||
modules: {},
|
modules: {},
|
||||||
actions
|
actions
|
||||||
})
|
})
|
||||||
|
|
|
||||||
570
tools/data4.js
570
tools/data4.js
|
|
@ -1,296 +1,296 @@
|
||||||
let data = [{
|
let data = [{
|
||||||
title: '体重',
|
title: '体重',
|
||||||
showCon: false,
|
showCon: false,
|
||||||
key: 'weight',
|
key: 'weight',
|
||||||
dw: 'kg',
|
dw: 'kg',
|
||||||
fvalue: null,
|
fvalue: null,
|
||||||
svalue: null,
|
svalue: null,
|
||||||
fevaluation: null,
|
fevaluation: null,
|
||||||
sevaluation: null,
|
sevaluation: null,
|
||||||
vs: 0,
|
vs: 0,
|
||||||
num: 0,
|
num: 0,
|
||||||
color: "#ff4239",
|
color: "#ff4239",
|
||||||
desc: "反映和衡量一个人健康状况的重要标志之一",
|
desc: "反映和衡量一个人健康状况的重要标志之一",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'BMI',
|
title: 'BMI',
|
||||||
color: "#ff4239",
|
color: "#ff4239",
|
||||||
showCon: false,
|
showCon: false,
|
||||||
key: 'bmi',
|
key: 'bmi',
|
||||||
level: "bmilevel",
|
level: "bmilevel",
|
||||||
dw: '',
|
dw: '',
|
||||||
slist: [],
|
slist: [],
|
||||||
fvalue: null,
|
fvalue: null,
|
||||||
svalue: null,
|
svalue: null,
|
||||||
fevaluation: null,
|
fevaluation: null,
|
||||||
sevaluation: null,
|
sevaluation: null,
|
||||||
vs: 0,
|
vs: 0,
|
||||||
num: 0,
|
num: 0,
|
||||||
desc: 'BMI是身体质量指数,是目前国际上常用的衡量人体胖瘦程度以及是否健康的一个标准。',
|
desc: 'BMI是身体质量指数,是目前国际上常用的衡量人体胖瘦程度以及是否健康的一个标准。',
|
||||||
}, {
|
}, {
|
||||||
title: '脂肪率',
|
title: '脂肪率',
|
||||||
showCon: false,
|
showCon: false,
|
||||||
color: "#ff4239",
|
color: "#ff4239",
|
||||||
key: 'fat_r',
|
key: 'fat_r',
|
||||||
level: "fat_rlevel",
|
level: "fat_rlevel",
|
||||||
dw: '%',
|
dw: '%',
|
||||||
slist: [],
|
slist: [],
|
||||||
fvalue: null,
|
fvalue: null,
|
||||||
svalue: null,
|
svalue: null,
|
||||||
fevaluation: null,
|
fevaluation: null,
|
||||||
sevaluation: null,
|
sevaluation: null,
|
||||||
vs: 0,
|
vs: 0,
|
||||||
num: 0,
|
num: 0,
|
||||||
desc: '体脂率是指身体成分中,脂肪组织所占的比率。测量体脂率比单纯的只测量体重更能反映我们身体的脂肪水平(肥胖程度)。',
|
desc: '体脂率是指身体成分中,脂肪组织所占的比率。测量体脂率比单纯的只测量体重更能反映我们身体的脂肪水平(肥胖程度)。',
|
||||||
},
|
},
|
||||||
//
|
//
|
||||||
{
|
{
|
||||||
title: '脂肪量',
|
title: '脂肪量',
|
||||||
key: 'fat_w',
|
key: 'fat_w',
|
||||||
color: "#ff4239",
|
color: "#ff4239",
|
||||||
scope: '',
|
scope: '',
|
||||||
showCon: false,
|
showCon: false,
|
||||||
level: "fat_wlevel",
|
level: "fat_wlevel",
|
||||||
dw: 'kg',
|
dw: 'kg',
|
||||||
leftval: 0,
|
leftval: 0,
|
||||||
desc: '人体脂肪的重量',
|
desc: '人体脂肪的重量',
|
||||||
fvalue: null,
|
fvalue: null,
|
||||||
svalue: null,
|
svalue: null,
|
||||||
fevaluation: null,
|
fevaluation: null,
|
||||||
sevaluation: null,
|
sevaluation: null,
|
||||||
vs: 0,
|
vs: 0,
|
||||||
num: 0,
|
num: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '肌肉率',
|
title: '肌肉率',
|
||||||
key: 'muscle',
|
key: 'muscle',
|
||||||
showCon: false,
|
showCon: false,
|
||||||
color: "#ff4239",
|
color: "#ff4239",
|
||||||
level: "musclelevel",
|
level: "musclelevel",
|
||||||
dw: '%',
|
dw: '%',
|
||||||
slist: [],
|
slist: [],
|
||||||
leftval: 0,
|
leftval: 0,
|
||||||
fvalue: null,
|
fvalue: null,
|
||||||
svalue: null,
|
svalue: null,
|
||||||
fevaluation: null,
|
fevaluation: null,
|
||||||
sevaluation: null,
|
sevaluation: null,
|
||||||
vs: 0,
|
vs: 0,
|
||||||
num: 0,
|
num: 0,
|
||||||
desc: '根据人体肌肉总量和人体体重、身高等相结合得到的人体的一个比例值,这个值的范围决定一个人的身体健康状况以及力量的多少。',
|
desc: '根据人体肌肉总量和人体体重、身高等相结合得到的人体的一个比例值,这个值的范围决定一个人的身体健康状况以及力量的多少。',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '肌肉量',
|
title: '肌肉量',
|
||||||
color: "#ff4239",
|
color: "#ff4239",
|
||||||
key: 'muscleval',
|
key: 'muscleval',
|
||||||
level: "musclelevel",
|
level: "musclelevel",
|
||||||
showCon: false,
|
showCon: false,
|
||||||
dw: 'kg',
|
dw: 'kg',
|
||||||
slist: [],
|
slist: [],
|
||||||
fvalue: null,
|
fvalue: null,
|
||||||
svalue: null,
|
svalue: null,
|
||||||
fevaluation: null,
|
fevaluation: null,
|
||||||
sevaluation: null,
|
sevaluation: null,
|
||||||
vs: 0,
|
vs: 0,
|
||||||
num: 0,
|
num: 0,
|
||||||
desc: '肌肉量=实际体重*肌肉率',
|
desc: '肌肉量=实际体重*肌肉率',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '水分',
|
title: '水分',
|
||||||
key: 'water',
|
key: 'water',
|
||||||
color: "#ff4239",
|
color: "#ff4239",
|
||||||
level: "waterlevel",
|
level: "waterlevel",
|
||||||
showCon: false,
|
showCon: false,
|
||||||
dw: '%',
|
dw: '%',
|
||||||
desc: '指人体内水分比例。',
|
desc: '指人体内水分比例。',
|
||||||
slist: [],
|
slist: [],
|
||||||
fvalue: null,
|
fvalue: null,
|
||||||
svalue: null,
|
svalue: null,
|
||||||
fevaluation: null,
|
fevaluation: null,
|
||||||
sevaluation: null,
|
sevaluation: null,
|
||||||
vs: 0,
|
vs: 0,
|
||||||
num: 0,
|
num: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '蛋白量',
|
title: '蛋白量',
|
||||||
color: "#ff4239",
|
color: "#ff4239",
|
||||||
level: "proteinlevel",
|
level: "proteinlevel",
|
||||||
key: 'proteinval',
|
key: 'proteinval',
|
||||||
showCon: false,
|
showCon: false,
|
||||||
dw: 'kg',
|
dw: 'kg',
|
||||||
desc: '蛋白量=实际体重*蛋白率',
|
desc: '蛋白量=实际体重*蛋白率',
|
||||||
slist: [],
|
slist: [],
|
||||||
fvalue: null,
|
fvalue: null,
|
||||||
svalue: null,
|
svalue: null,
|
||||||
fevaluation: null,
|
fevaluation: null,
|
||||||
sevaluation: null,
|
sevaluation: null,
|
||||||
vs: 0,
|
vs: 0,
|
||||||
num: 0,
|
num: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '骨重',
|
title: '骨重',
|
||||||
color: "#ff4239",
|
color: "#ff4239",
|
||||||
key: 'bone',
|
key: 'bone',
|
||||||
showCon: false,
|
showCon: false,
|
||||||
level: "bonelevel",
|
level: "bonelevel",
|
||||||
dw: '',
|
dw: '',
|
||||||
slist: [],
|
slist: [],
|
||||||
fvalue: null,
|
fvalue: null,
|
||||||
svalue: null,
|
svalue: null,
|
||||||
fevaluation: null,
|
fevaluation: null,
|
||||||
sevaluation: null,
|
sevaluation: null,
|
||||||
vs: 0,
|
vs: 0,
|
||||||
num: 0,
|
num: 0,
|
||||||
desc: '单位体积内,骨组织、骨矿物质(钙、磷等)和骨基质(骨胶原、蛋白率、无机盐等等)]含量,骨量代表它们骨骼健康的情况。',
|
desc: '单位体积内,骨组织、骨矿物质(钙、磷等)和骨基质(骨胶原、蛋白率、无机盐等等)]含量,骨量代表它们骨骼健康的情况。',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '蛋白率',
|
title: '蛋白率',
|
||||||
color: "#ff4239",
|
color: "#ff4239",
|
||||||
key: 'protein',
|
key: 'protein',
|
||||||
level: "proteinlevel",
|
level: "proteinlevel",
|
||||||
showCon: false,
|
showCon: false,
|
||||||
dw: '%',
|
dw: '%',
|
||||||
desc: '人体内蛋白率含量。',
|
desc: '人体内蛋白率含量。',
|
||||||
slist: [],
|
slist: [],
|
||||||
fvalue: null,
|
fvalue: null,
|
||||||
svalue: null,
|
svalue: null,
|
||||||
fevaluation: null,
|
fevaluation: null,
|
||||||
sevaluation: null,
|
sevaluation: null,
|
||||||
vs: 0,
|
vs: 0,
|
||||||
num: 0,
|
num: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '基础代谢',
|
title: '基础代谢',
|
||||||
key: 'kcal',
|
key: 'kcal',
|
||||||
color: "#ff4239",
|
color: "#ff4239",
|
||||||
level: "kcallevel",
|
level: "kcallevel",
|
||||||
showCon: false,
|
showCon: false,
|
||||||
dw: 'kcal',
|
dw: 'kcal',
|
||||||
slist: [],
|
slist: [],
|
||||||
fvalue: null,
|
fvalue: null,
|
||||||
svalue: null,
|
svalue: null,
|
||||||
fevaluation: null,
|
fevaluation: null,
|
||||||
sevaluation: null,
|
sevaluation: null,
|
||||||
vs: 0,
|
vs: 0,
|
||||||
num: 0,
|
num: 0,
|
||||||
desc: '指人体在清醒而又极端安静的状态下,不受肌肉活动、环境温度、食物及精神紧张等影响时的能量代谢率',
|
desc: '指人体在清醒而又极端安静的状态下,不受肌肉活动、环境温度、食物及精神紧张等影响时的能量代谢率',
|
||||||
},
|
},
|
||||||
//
|
//
|
||||||
|
|
||||||
{
|
{
|
||||||
title: '内脏指数',
|
title: '内脏指数',
|
||||||
color: "#ff4239",
|
color: "#ff4239",
|
||||||
key: 'visceral',
|
key: 'visceral',
|
||||||
showCon: false,
|
showCon: false,
|
||||||
level: "viscerallevel",
|
level: "viscerallevel",
|
||||||
dw: '',
|
dw: '',
|
||||||
desc: '内脏脂肪指数',
|
desc: '内脏脂肪指数',
|
||||||
slist: [],
|
slist: [],
|
||||||
fvalue: null,
|
fvalue: null,
|
||||||
svalue: null,
|
svalue: null,
|
||||||
fevaluation: null,
|
fevaluation: null,
|
||||||
sevaluation: null,
|
sevaluation: null,
|
||||||
vs: 0,
|
vs: 0,
|
||||||
num: 0,
|
num: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '皮下脂肪',
|
title: '皮下脂肪',
|
||||||
key: 'sfr',
|
key: 'sfr',
|
||||||
color: "#ff4239",
|
color: "#ff4239",
|
||||||
showCon: false,
|
showCon: false,
|
||||||
level: "sfrlevel",
|
level: "sfrlevel",
|
||||||
dw: '%',
|
dw: '%',
|
||||||
desc: '皮下脂脂肪就是贮存于皮下的脂肪组织,人体的脂肪大约有2/3贮存在皮下组织',
|
desc: '皮下脂脂肪就是贮存于皮下的脂肪组织,人体的脂肪大约有2/3贮存在皮下组织',
|
||||||
slist: [],
|
slist: [],
|
||||||
fvalue: null,
|
fvalue: null,
|
||||||
svalue: null,
|
svalue: null,
|
||||||
fevaluation: null,
|
fevaluation: null,
|
||||||
sevaluation: null,
|
sevaluation: null,
|
||||||
vs: 0,
|
vs: 0,
|
||||||
num: 0,
|
num: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '肥胖等级',
|
title: '肥胖等级',
|
||||||
key: 'fatlevel',
|
key: 'fatlevel',
|
||||||
level: "fatlevel",
|
level: "fatlevel",
|
||||||
showCon: false,
|
showCon: false,
|
||||||
leftval: 0,
|
leftval: 0,
|
||||||
fvalue: null,
|
fvalue: null,
|
||||||
svalue: null,
|
svalue: null,
|
||||||
fevaluation: null,
|
fevaluation: null,
|
||||||
sevaluation: null,
|
sevaluation: null,
|
||||||
vs: 0,
|
vs: 0,
|
||||||
num: 0,
|
num: 0,
|
||||||
desc: '肥胖的程度,表现实际体重与理想体重的差距。肥胖等级是判定肥胖症的一个指标。',
|
desc: '肥胖的程度,表现实际体重与理想体重的差距。肥胖等级是判定肥胖症的一个指标。',
|
||||||
},
|
},
|
||||||
//
|
//
|
||||||
{
|
{
|
||||||
title: '去脂体重',
|
title: '去脂体重',
|
||||||
key: 'lbm',
|
key: 'lbm',
|
||||||
showCon: false,
|
showCon: false,
|
||||||
dw: 'kg',
|
dw: 'kg',
|
||||||
fvalue: null,
|
fvalue: null,
|
||||||
svalue: null,
|
svalue: null,
|
||||||
fevaluation: null,
|
fevaluation: null,
|
||||||
sevaluation: null,
|
sevaluation: null,
|
||||||
vs: 0,
|
vs: 0,
|
||||||
num: 0,
|
num: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '体龄',
|
title: '体龄',
|
||||||
key: 'bodyage',
|
key: 'bodyage',
|
||||||
showCon: false,
|
showCon: false,
|
||||||
dw: '岁',
|
dw: '岁',
|
||||||
fvalue: null,
|
fvalue: null,
|
||||||
svalue: null,
|
svalue: null,
|
||||||
fevaluation: null,
|
fevaluation: null,
|
||||||
sevaluation: null,
|
sevaluation: null,
|
||||||
vs: 0,
|
vs: 0,
|
||||||
num: 0,
|
num: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '体型',
|
title: '体型',
|
||||||
key: 'body',
|
key: 'body',
|
||||||
level: "bodylevel",
|
level: "bodylevel",
|
||||||
showCon: false,
|
showCon: false,
|
||||||
fvalue: null,
|
fvalue: null,
|
||||||
svalue: null,
|
svalue: null,
|
||||||
fevaluation: null,
|
fevaluation: null,
|
||||||
sevaluation: null,
|
sevaluation: null,
|
||||||
vs: 0,
|
vs: 0,
|
||||||
num: 0,
|
num: 0,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
function infoList(str) {
|
function infoList(str) {
|
||||||
let listStr = [...data];
|
let listStr = [...data];
|
||||||
let leftval = 0
|
let leftval = 0
|
||||||
if (!str) return
|
if (!str) return
|
||||||
for (var i = 0; i < listStr.length; i++) {
|
for (var i = 0; i < listStr.length; i++) {
|
||||||
listStr[i].fvalue = str[listStr[i].key];
|
listStr[i].fvalue = str[listStr[i].key];
|
||||||
listStr[i].fevaluation = str[listStr[i].level];
|
listStr[i].fevaluation = str[listStr[i].level];
|
||||||
if (str.list && str.list.length) {
|
if (str.list && str.list.length) {
|
||||||
for (var k = 0; k < str.list.length; k++) {
|
for (var k = 0; k < str.list.length; k++) {
|
||||||
if (listStr[i].key == str.list[k].name) {
|
if (listStr[i].key == str.list[k].name) {
|
||||||
listStr[i].slist = str.list[k].list
|
listStr[i].slist = str.list[k].list
|
||||||
listStr[i].color = str.list[k].color
|
listStr[i].color = str.list[k].color
|
||||||
listStr[i].fvalue = str.list[k].value
|
listStr[i].fvalue = str.list[k].value
|
||||||
listStr[i].fevaluation = str.list[k].level
|
listStr[i].fevaluation = str.list[k].level
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let j in listStr[i].slist) {
|
|
||||||
if (listStr[i].fevaluation == listStr[i].slist[j].text) {
|
|
||||||
listStr[i].leftval = (listStr[i].fvalue - listStr[i].slist[j].minvalue) / (listStr[i].slist[j]
|
|
||||||
.maxvalue - listStr[i].slist[j].minvalue) * 4.2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
listStr[i].slist = null
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
for (let j in listStr[i].slist) {
|
||||||
|
if (listStr[i].fevaluation == listStr[i].slist[j].text) {
|
||||||
|
listStr[i].leftval = (listStr[i].fvalue - listStr[i].slist[j].minvalue) / (listStr[i].slist[j]
|
||||||
|
.maxvalue - listStr[i].slist[j].minvalue) * 4.2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
listStr[i].slist = null
|
||||||
}
|
}
|
||||||
return listStr
|
}
|
||||||
|
return listStr
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data,
|
data,
|
||||||
infoList,
|
infoList,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,11 @@ export default {
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getConfig(param) { // 配置详情
|
||||||
|
return http.post("/api/wxopen/config/get", param).then(res => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
getoutlogin(param) { // 退出登录
|
getoutlogin(param) { // 退出登录
|
||||||
return http.get("/api/wxopen/outlogin", param).then(res => {
|
return http.get("/api/wxopen/outlogin", param).then(res => {
|
||||||
return res
|
return res
|
||||||
|
|
@ -45,6 +50,7 @@ export default {
|
||||||
return http.post("/api/adult/info", param).then(res => {
|
return http.post("/api/adult/info", param).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
res.data.name = res.data.nickname
|
res.data.name = res.data.nickname
|
||||||
|
res.data.id = res.data.familyid
|
||||||
// res.data.firstresulttime = res.data.firstresulttime.substring(0, 10)
|
// res.data.firstresulttime = res.data.firstresulttime.substring(0, 10)
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
|
|
|
||||||
501
tools/tools.js
501
tools/tools.js
|
|
@ -1,296 +1,303 @@
|
||||||
import $store from '@/store'
|
import $store from '@/store'
|
||||||
export default {
|
export default {
|
||||||
msg,
|
msg,
|
||||||
str2hex,
|
str2hex,
|
||||||
hex2str,
|
hex2str,
|
||||||
ab2hex,
|
ab2hex,
|
||||||
inArray,
|
inArray,
|
||||||
getAge,
|
getAge,
|
||||||
getTime,
|
getTime,
|
||||||
getDate,
|
getDate,
|
||||||
getMonth,
|
getMonth,
|
||||||
GetDateStr,
|
GetDateStr,
|
||||||
handlePages,
|
handlePages,
|
||||||
getBluetoothAdapter
|
getBluetoothAdapter
|
||||||
}
|
}
|
||||||
|
|
||||||
function inArray(arr, key, val) {
|
function inArray(arr, key, val) {
|
||||||
if (!arr || !arr.length || typeof arr != 'object' || !Array.isArray(arr)) {
|
if (!arr || !arr.length || typeof arr != 'object' || !Array.isArray(arr)) {
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
for (let i = 0; i < arr.length; i++) {
|
for (let i = 0; i < arr.length; i++) {
|
||||||
if (!key) {
|
if (!key) {
|
||||||
if (arr[i] == val) {
|
if (arr[i] == val) {
|
||||||
return i
|
return i
|
||||||
}
|
}
|
||||||
} else if (arr[i][key] === val) {
|
} else if (arr[i][key] === val) {
|
||||||
return i
|
return i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function msg(str) {
|
function msg(str) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: str,
|
title: str,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function ab2hex(buffer, split) {
|
function ab2hex(buffer, split) {
|
||||||
var hexArr = Array.prototype.map.call(
|
var hexArr = Array.prototype.map.call(
|
||||||
new Uint8Array(buffer),
|
new Uint8Array(buffer),
|
||||||
function(bit) {
|
function(bit) {
|
||||||
return ('00' + bit.toString(16)).slice(-2)
|
return ('00' + bit.toString(16)).slice(-2)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return hexArr.join(split);
|
return hexArr.join(split);
|
||||||
}
|
}
|
||||||
|
|
||||||
function hex2str(arr) {
|
function hex2str(arr) {
|
||||||
let decoder = new TextDecoder('utf8')
|
let decoder = new TextDecoder('utf8')
|
||||||
let uint8 = new Uint8Array(arr)
|
let uint8 = new Uint8Array(arr)
|
||||||
let res = decoder.decode(uint8)
|
let res = decoder.decode(uint8)
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
function str2hex(str) {
|
function str2hex(str) {
|
||||||
let encoder = new TextEncoder('utf8')
|
let encoder = new TextEncoder('utf8')
|
||||||
return encoder.encode(str)
|
return encoder.encode(str)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getBluetoothAdapter(err) {
|
function getBluetoothAdapter(err) {
|
||||||
if (err.errMsg == "openBluetoothAdapter:fail auth denied" || err.errMsg ===
|
if (err.errMsg == "openBluetoothAdapter:fail auth denied" || err.errMsg ===
|
||||||
"openBluetoothAdapter:fail auth deny" ||
|
"openBluetoothAdapter:fail auth deny" ||
|
||||||
err.errMsg === "openBluetoothAdapter:fail authorize no response"
|
err.errMsg === "openBluetoothAdapter:fail authorize no response"
|
||||||
) {
|
) {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: "提示",
|
title: "提示",
|
||||||
content: "需要您授权使用手机蓝牙",
|
content: "需要您授权使用手机蓝牙",
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
success(modalSuccess) {
|
success(modalSuccess) {
|
||||||
uni.openSetting({
|
uni.openSetting({
|
||||||
success(settingdata) {
|
success(settingdata) {
|
||||||
if (settingdata.authSetting["scope.bluetooth"]) {
|
if (settingdata.authSetting["scope.bluetooth"]) {
|
||||||
uni.openBluetoothAdapter({
|
uni.openBluetoothAdapter({
|
||||||
success: e => {
|
success: e => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "获取权限成功,请继续去测量",
|
title: "获取权限成功,请继续去测量",
|
||||||
icon: "none"
|
icon: "none"
|
||||||
})
|
})
|
||||||
$store.commit("changeBluetooth", true);
|
$store.commit("changeBluetooth", true);
|
||||||
},
|
},
|
||||||
fail: err => {
|
fail: err => {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请打开手机蓝牙",
|
title: "请打开手机蓝牙",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
})
|
})
|
||||||
console.log('初始化蓝牙失败:' + err.errMsg);
|
console.log('初始化蓝牙失败:' + err.errMsg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "获取权限失败,将无法使用手机蓝牙进行测量",
|
title: "获取权限失败,将无法使用手机蓝牙进行测量",
|
||||||
icon: "none"
|
icon: "none"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "请打开手机蓝牙",
|
title: "请打开手机蓝牙",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDate(type) {
|
function getDate(type) {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
let year = date.getFullYear();
|
let year = date.getFullYear();
|
||||||
let month = date.getMonth() + 1;
|
let month = date.getMonth() + 1;
|
||||||
let day = date.getDate();
|
let day = date.getDate();
|
||||||
month = month > 9 ? month : '0' + month;;
|
month = month > 9 ? month : '0' + month;;
|
||||||
day = day > 9 ? day : '0' + day;
|
day = day > 9 ? day : '0' + day;
|
||||||
if (type === 'tow') {
|
if (type === 'tow') {
|
||||||
year = year - 2;
|
year = year - 2;
|
||||||
return `${year}-${month}-${day}`;
|
return `${year}-${month}-${day}`;
|
||||||
}
|
}
|
||||||
if (type === 'start') {
|
if (type === 'start') {
|
||||||
year = year;
|
year = year;
|
||||||
return `${year}-${month}-${day}`;
|
return `${year}-${month}-${day}`;
|
||||||
}
|
}
|
||||||
if (type === 'end') {
|
if (type === 'end') {
|
||||||
year = year + 60;
|
year = year + 60;
|
||||||
return `${year}-${month}-${day}`;
|
return `${year}-${month}-${day}`;
|
||||||
}
|
}
|
||||||
if (type == "m") {
|
if (type == "m") {
|
||||||
if (month == "01" || month == "03" || month == "05" || month == "07" || month == "08" || month == "10" ||
|
if (month == "01" || month == "03" || month == "05" || month == "07" || month == "08" || month == "10" ||
|
||||||
month == "12") {
|
month == "12") {
|
||||||
return year + "/" + month + "/01" + "~" + year + "/" + month + "/31";
|
return year + "/" + month + "/01" + "~" + year + "/" + month + "/31";
|
||||||
} else if (month == "02") {
|
} else if (month == "02") {
|
||||||
if ((year % 4 == 0 && year % 100 != 0) || (year % 100 == 0 && year % 400 == 0)) {
|
if ((year % 4 == 0 && year % 100 != 0) || (year % 100 == 0 && year % 400 == 0)) {
|
||||||
return year + "/" + month + "/01" + "~" + year + "/" + month + "/29";
|
return year + "/" + month + "/01" + "~" + year + "/" + month + "/29";
|
||||||
} else {
|
} else {
|
||||||
return year + "/" + month + "/01" + "~" + year + "/" + month + "/28";
|
return year + "/" + month + "/01" + "~" + year + "/" + month + "/28";
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return year + "/" + month + "/01" + "~" + year + "/" + month + "/30";
|
return year + "/" + month + "/01" + "~" + year + "/" + month + "/30";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetDateStr(AddDayCount) {
|
function GetDateStr(AddDayCount) {
|
||||||
var dd = new Date();
|
var dd = new Date();
|
||||||
dd.setDate(dd.getDate() + AddDayCount); //获取AddDayCount天后的日期
|
dd.setDate(dd.getDate() + AddDayCount); //获取AddDayCount天后的日期
|
||||||
var y = dd.getFullYear();
|
var y = dd.getFullYear();
|
||||||
var m = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1); //获取当前月份的日期,不足10补0
|
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
|
var d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate(); //获取当前几号,不足10补0
|
||||||
return y + "-" + m + "-" + d;
|
return y + "-" + m + "-" + d;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取当前日期
|
// 获取当前日期
|
||||||
function getTime() {
|
function getTime() {
|
||||||
var date = new Date()
|
var date = new Date()
|
||||||
var todate =
|
var todate =
|
||||||
((date.getMonth() + 1) < 10 ? ('0' + (date.getMonth() + 1)) : date.getMonth() +
|
((date.getMonth() + 1) < 10 ? ('0' + (date.getMonth() + 1)) : date.getMonth() +
|
||||||
1) + '月' + (date.getDate() < 10 ? ('0' + date.getDate()) : date.getDate() + '日')
|
1) + '月' + (date.getDate() < 10 ? ('0' + date.getDate()) : date.getDate() + '日')
|
||||||
return todate
|
return todate
|
||||||
}
|
}
|
||||||
// 根据出生日期获取年龄
|
// 根据出生日期获取年龄
|
||||||
function getAge(str) {
|
function getAge(str) {
|
||||||
var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})/);
|
var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})/);
|
||||||
if (r == null) return false;
|
if (r == null) return false;
|
||||||
|
|
||||||
var d = new Date(r[1], r[3] - 1, r[4]);
|
var d = new Date(r[1], r[3] - 1, r[4]);
|
||||||
var returnStr = "输入的日期格式错误!";
|
var returnStr = "输入的日期格式错误!";
|
||||||
|
|
||||||
if (d.getFullYear() == r[1] && (d.getMonth() + 1) == r[3] && d.getDate() == r[4]) {
|
if (d.getFullYear() == r[1] && (d.getMonth() + 1) == r[3] && d.getDate() == r[4]) {
|
||||||
|
|
||||||
var date = new Date();
|
var date = new Date();
|
||||||
var yearNow = date.getFullYear();
|
var yearNow = date.getFullYear();
|
||||||
var monthNow = date.getMonth() + 1;
|
var monthNow = date.getMonth() + 1;
|
||||||
var dayNow = date.getDate();
|
var dayNow = date.getDate();
|
||||||
|
|
||||||
var largeMonths = [1, 3, 5, 7, 8, 10, 12], //大月, 用于计算天,只在年月都为零时,天数有效
|
var largeMonths = [1, 3, 5, 7, 8, 10, 12], //大月, 用于计算天,只在年月都为零时,天数有效
|
||||||
lastMonth = monthNow - 1 > 0 ? monthNow - 1 : 12, // 上一个月的月份
|
lastMonth = monthNow - 1 > 0 ? monthNow - 1 : 12, // 上一个月的月份
|
||||||
isLeapYear = false, // 是否是闰年
|
isLeapYear = false, // 是否是闰年
|
||||||
daysOFMonth = 0; // 当前日期的上一个月多少天
|
daysOFMonth = 0; // 当前日期的上一个月多少天
|
||||||
|
|
||||||
if ((yearNow % 4 === 0 && yearNow % 100 !== 0) || yearNow % 400 === 0) { // 是否闰年, 用于计算天,只在年月都为零时,天数有效
|
if ((yearNow % 4 === 0 && yearNow % 100 !== 0) || yearNow % 400 === 0) { // 是否闰年, 用于计算天,只在年月都为零时,天数有效
|
||||||
isLeapYear = true;
|
isLeapYear = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (largeMonths.indexOf(lastMonth) > -1) {
|
if (largeMonths.indexOf(lastMonth) > -1) {
|
||||||
daysOFMonth = 31;
|
daysOFMonth = 31;
|
||||||
} else if (lastMonth === 2) {
|
} else if (lastMonth === 2) {
|
||||||
if (isLeapYear) {
|
if (isLeapYear) {
|
||||||
daysOFMonth = 29;
|
daysOFMonth = 29;
|
||||||
} else {
|
} else {
|
||||||
daysOFMonth = 28;
|
daysOFMonth = 28;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
daysOFMonth = 30;
|
daysOFMonth = 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
var Y = yearNow - parseInt(r[1]);
|
var Y = yearNow - parseInt(r[1]);
|
||||||
var M = monthNow - parseInt(r[3]);
|
var M = monthNow - parseInt(r[3]);
|
||||||
var D = dayNow - parseInt(r[4]);
|
var D = dayNow - parseInt(r[4]);
|
||||||
if (D < 0) {
|
if (D < 0) {
|
||||||
D = D + daysOFMonth; //借一个月
|
D = D + daysOFMonth; //借一个月
|
||||||
M--;
|
M--;
|
||||||
}
|
}
|
||||||
if (M < 0) { // 借一年 12个月
|
if (M < 0) { // 借一年 12个月
|
||||||
Y--;
|
Y--;
|
||||||
M = M + 12; //
|
M = M + 12; //
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Y < 0) {
|
if (Y < 0) {
|
||||||
returnStr = "出生日期有误!";
|
returnStr = "出生日期有误!";
|
||||||
|
|
||||||
} else if (Y === 0) {
|
} else if (Y === 0) {
|
||||||
if (M === 0) {
|
if (M === 0) {
|
||||||
returnStr = D + "天";
|
returnStr = D + "天";
|
||||||
} else {
|
} else {
|
||||||
returnStr = M + "个月";
|
returnStr = M + "个月";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (M === 0) {
|
if (M === 0) {
|
||||||
returnStr = Y + "岁";
|
returnStr = Y + "岁";
|
||||||
} else {
|
} else {
|
||||||
returnStr = Y + "岁" + M + "个月";
|
returnStr = Y + "岁" + M + "个月";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return returnStr;
|
return returnStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMonth(dates, months) {
|
function getMonth(dates, months) {
|
||||||
var d = new Date(dates.substring(0, 10));
|
var d = new Date(dates.substring(0, 10));
|
||||||
let year = d.getFullYear();
|
let year = d.getFullYear();
|
||||||
var month = d.getMonth() + 1;
|
var month = d.getMonth() + 1;
|
||||||
if (Math.abs(months) > 12) {
|
if (Math.abs(months) > 12) {
|
||||||
months = months % 12;
|
months = months % 12;
|
||||||
};
|
};
|
||||||
if (months != 0) {
|
if (months != 0) {
|
||||||
if (month + months > 12) {
|
if (month + months > 12) {
|
||||||
year++;
|
year++;
|
||||||
month = (month + months) % 12;
|
month = (month + months) % 12;
|
||||||
} else if (month + months < 1) {
|
} else if (month + months < 1) {
|
||||||
year--;
|
year--;
|
||||||
month = 12 + month + months;
|
month = 12 + month + months;
|
||||||
} else {
|
} else {
|
||||||
month = month + months;
|
month = month + months;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
month = month < 10 ? "0" + month : month;
|
month = month < 10 ? "0" + month : month;
|
||||||
var date = d.getDate();
|
var date = d.getDate();
|
||||||
if (month == "01" || month == "03" || month == "05" || month == "07" || month == "08" || month == "10" ||
|
if (month == "01" || month == "03" || month == "05" || month == "07" || month == "08" || month == "10" ||
|
||||||
month == "12") {
|
month == "12") {
|
||||||
return year + "/" + month + "/01" + "~" + year + "/" + month + "/31";
|
return year + "/" + month + "/01" + "~" + year + "/" + month + "/31";
|
||||||
} else if (month == "02") {
|
} else if (month == "02") {
|
||||||
if ((year % 4 == 0 && year % 100 != 0) || (year % 100 == 0 && year % 400 == 0)) {
|
if ((year % 4 == 0 && year % 100 != 0) || (year % 100 == 0 && year % 400 == 0)) {
|
||||||
return year + '/' + month + "/01" + "~" + year + "/" + year + "/" + month + "/29";
|
return year + '/' + month + "/01" + "~" + year + "/" + year + "/" + month + "/29";
|
||||||
} else {
|
} else {
|
||||||
return year + '/' + month + "/01" + "~" + year + "/" + month + "/28";
|
return year + '/' + month + "/01" + "~" + year + "/" + month + "/28";
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
return year + '/' + month + "/01" + "~" + year + "/" + month + "/30";
|
return year + '/' + month + "/01" + "~" + year + "/" + month + "/30";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
// 页面跳转
|
// 页面跳转
|
||||||
function handlePages(type, deviceId) {
|
function handlePages(type, deviceId) {
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: "/BLEPages/adult/PCD01pro?deviceId=" + deviceId
|
url: "/BLEPages/adult/PCD01pro?deviceId=" + deviceId
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (type == 4 || type == 16) {
|
if (type == 4 || type == 16) {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: "/BLEPages/adult/PCL01?deviceId=" + deviceId
|
url: "/BLEPages/adult/PCL01?deviceId=" + deviceId
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (type == 8) {
|
if (type == 7) {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: "/BLEPages/adult/H01pro?deviceId=" + deviceId
|
url: "/BLEPages/adult/F01PRO?deviceId=" + deviceId
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (type == 14) {
|
if (type == 8) {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: "/BLEPages/adult/F01B?deviceId=" + deviceId
|
url: "/BLEPages/adult/H01pro?deviceId=" + deviceId
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (type == 21) {
|
|
||||||
uni.redirectTo({
|
if (type == 14) {
|
||||||
url: "/BLEPages/adult/H09B?deviceId=" + deviceId
|
uni.redirectTo({
|
||||||
})
|
url: "/BLEPages/adult/F01B?deviceId=" + deviceId
|
||||||
return
|
})
|
||||||
}
|
return
|
||||||
|
}
|
||||||
|
if (type == 21) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: "/BLEPages/adult/H09B?deviceId=" + deviceId
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
5
uni.scss
5
uni.scss
|
|
@ -74,8 +74,7 @@ $uni-color-subtitle: #555555; // 二级标题颜色
|
||||||
$uni-font-size-subtitle:36rpx;
|
$uni-font-size-subtitle:36rpx;
|
||||||
$uni-color-paragraph: #3F536E; // 文章段落颜色
|
$uni-color-paragraph: #3F536E; // 文章段落颜色
|
||||||
$uni-font-size-paragraph:30rpx;
|
$uni-font-size-paragraph:30rpx;
|
||||||
// 自定义
|
// 自定义/* $mainColor:#1d2088;*/
|
||||||
$mainColor:linear-gradient(-180deg,#95E0DB,#75DAD0 80%,);
|
$mainColor:#00c6c6;
|
||||||
$mainColor:#00c6c6;
|
|
||||||
$btncolor:#FCA82D;
|
$btncolor:#FCA82D;
|
||||||
$greencolor:#00c6c6
|
$greencolor:#00c6c6
|
||||||
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
|
|
@ -1,34 +1,34 @@
|
||||||
(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["BLEPages/adult/F01B"],{
|
(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["BLEPages/adult/F01B"],{
|
||||||
|
|
||||||
/***/ 187:
|
/***/ 180:
|
||||||
/*!*******************************************************************************!*\
|
/*!**************************************************************************************************!*\
|
||||||
!*** E:/qiaocongli/adultDeviceApp/main.js?{"page":"BLEPages%2Fadult%2FF01B"} ***!
|
!*** D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/main.js?{"page":"BLEPages%2Fadult%2FF01B"} ***!
|
||||||
\*******************************************************************************/
|
\**************************************************************************************************/
|
||||||
/*! no static exports found */
|
/*! no static exports found */
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
/* WEBPACK VAR INJECTION */(function(createPage) {__webpack_require__(/*! uni-pages */ 5);
|
/* WEBPACK VAR INJECTION */(function(createPage) {__webpack_require__(/*! uni-pages */ 5);
|
||||||
var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
|
var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
|
||||||
var _F01B = _interopRequireDefault(__webpack_require__(/*! ./BLEPages/adult/F01B.vue */ 188));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}wx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;
|
var _F01B = _interopRequireDefault(__webpack_require__(/*! ./BLEPages/adult/F01B.vue */ 181));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}wx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;
|
||||||
createPage(_F01B.default);
|
createPage(_F01B.default);
|
||||||
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["createPage"]))
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["createPage"]))
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 188:
|
/***/ 181:
|
||||||
/*!************************************************************!*\
|
/*!*******************************************************************************!*\
|
||||||
!*** E:/qiaocongli/adultDeviceApp/BLEPages/adult/F01B.vue ***!
|
!*** D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/BLEPages/adult/F01B.vue ***!
|
||||||
\************************************************************/
|
\*******************************************************************************/
|
||||||
/*! no static exports found */
|
/*! no static exports found */
|
||||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
__webpack_require__.r(__webpack_exports__);
|
__webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony import */ var _F01B_vue_vue_type_template_id_904b3610_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./F01B.vue?vue&type=template&id=904b3610&scoped=true& */ 189);
|
/* harmony import */ var _F01B_vue_vue_type_template_id_904b3610_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./F01B.vue?vue&type=template&id=904b3610&scoped=true& */ 182);
|
||||||
/* harmony import */ var _F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./F01B.vue?vue&type=script&lang=js& */ 191);
|
/* harmony import */ var _F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./F01B.vue?vue&type=script&lang=js& */ 184);
|
||||||
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
||||||
/* harmony import */ var _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 9);
|
/* harmony import */ var _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 10);
|
||||||
|
|
||||||
var renderjs
|
var renderjs
|
||||||
|
|
||||||
|
|
@ -37,7 +37,7 @@ var renderjs
|
||||||
|
|
||||||
/* normalize component */
|
/* normalize component */
|
||||||
|
|
||||||
var component = Object(_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
|
var component = Object(_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
|
||||||
_F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
|
_F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
|
||||||
_F01B_vue_vue_type_template_id_904b3610_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"],
|
_F01B_vue_vue_type_template_id_904b3610_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"],
|
||||||
_F01B_vue_vue_type_template_id_904b3610_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
|
_F01B_vue_vue_type_template_id_904b3610_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
|
||||||
|
|
@ -55,32 +55,32 @@ component.options.__file = "BLEPages/adult/F01B.vue"
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 189:
|
/***/ 182:
|
||||||
/*!*******************************************************************************************************!*\
|
/*!**************************************************************************************************************************!*\
|
||||||
!*** E:/qiaocongli/adultDeviceApp/BLEPages/adult/F01B.vue?vue&type=template&id=904b3610&scoped=true& ***!
|
!*** D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/BLEPages/adult/F01B.vue?vue&type=template&id=904b3610&scoped=true& ***!
|
||||||
\*******************************************************************************************************/
|
\**************************************************************************************************************************/
|
||||||
/*! exports provided: render, staticRenderFns, recyclableRender, components */
|
/*! exports provided: render, staticRenderFns, recyclableRender, components */
|
||||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
__webpack_require__.r(__webpack_exports__);
|
__webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony import */ var _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_template_id_904b3610_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./F01B.vue?vue&type=template&id=904b3610&scoped=true& */ 190);
|
/* harmony import */ var _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_template_id_904b3610_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./F01B.vue?vue&type=template&id=904b3610&scoped=true& */ 183);
|
||||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_template_id_904b3610_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; });
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_template_id_904b3610_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; });
|
||||||
|
|
||||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_template_id_904b3610_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_template_id_904b3610_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
|
||||||
|
|
||||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_template_id_904b3610_scoped_true___WEBPACK_IMPORTED_MODULE_0__["recyclableRender"]; });
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_template_id_904b3610_scoped_true___WEBPACK_IMPORTED_MODULE_0__["recyclableRender"]; });
|
||||||
|
|
||||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_template_id_904b3610_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"]; });
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_template_id_904b3610_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 190:
|
/***/ 183:
|
||||||
/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
/*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/qiaocongli/adultDeviceApp/BLEPages/adult/F01B.vue?vue&type=template&id=904b3610&scoped=true& ***!
|
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/BLEPages/adult/F01B.vue?vue&type=template&id=904b3610&scoped=true& ***!
|
||||||
\*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
\**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
/*! exports provided: render, staticRenderFns, recyclableRender, components */
|
/*! exports provided: render, staticRenderFns, recyclableRender, components */
|
||||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
|
@ -104,26 +104,26 @@ render._withStripped = true
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 191:
|
/***/ 184:
|
||||||
/*!*************************************************************************************!*\
|
/*!********************************************************************************************************!*\
|
||||||
!*** E:/qiaocongli/adultDeviceApp/BLEPages/adult/F01B.vue?vue&type=script&lang=js& ***!
|
!*** D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/BLEPages/adult/F01B.vue?vue&type=script&lang=js& ***!
|
||||||
\*************************************************************************************/
|
\********************************************************************************************************/
|
||||||
/*! no static exports found */
|
/*! no static exports found */
|
||||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
__webpack_require__.r(__webpack_exports__);
|
__webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony import */ var _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./F01B.vue?vue&type=script&lang=js& */ 192);
|
/* harmony import */ var _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./F01B.vue?vue&type=script&lang=js& */ 185);
|
||||||
/* harmony import */ var _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
|
/* harmony import */ var _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
|
||||||
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
||||||
/* harmony default export */ __webpack_exports__["default"] = (_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
|
/* harmony default export */ __webpack_exports__["default"] = (_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01B_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 192:
|
/***/ 185:
|
||||||
/*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
!*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/qiaocongli/adultDeviceApp/BLEPages/adult/F01B.vue?vue&type=script&lang=js& ***!
|
!*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/BLEPages/adult/F01B.vue?vue&type=script&lang=js& ***!
|
||||||
\********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
\***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
/*! no static exports found */
|
/*! no static exports found */
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
|
@ -150,7 +150,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var _vuex = __webpack_require__(/*! vuex */ 15);function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
|
var _vuex = __webpack_require__(/*! vuex */ 9);function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
|
||||||
|
|
||||||
|
|
||||||
var myTime;var _default =
|
var myTime;var _default =
|
||||||
|
|
@ -173,7 +173,7 @@ var myTime;var _default =
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: _objectSpread(_objectSpread({},
|
computed: _objectSpread(_objectSpread({},
|
||||||
(0, _vuex.mapState)(["user", "isConnected", "isBluetoothTyle"])), {}, {
|
(0, _vuex.mapState)(["user", "isConnected", "isBluetoothTyle", "appTheme"])), {}, {
|
||||||
info: function info() {
|
info: function info() {
|
||||||
return this.user;
|
return this.user;
|
||||||
} }),
|
} }),
|
||||||
|
|
@ -190,6 +190,12 @@ var myTime;var _default =
|
||||||
},
|
},
|
||||||
onLoad: function onLoad(options) {
|
onLoad: function onLoad(options) {
|
||||||
var that = this;
|
var that = this;
|
||||||
|
// 导航栏颜色
|
||||||
|
uni.setNavigationBarColor({
|
||||||
|
frontColor: '#ffffff',
|
||||||
|
backgroundColor: this.appTheme });
|
||||||
|
|
||||||
|
//
|
||||||
that.text = "";
|
that.text = "";
|
||||||
if (options && options.deviceId) {
|
if (options && options.deviceId) {
|
||||||
that.macAddr = options.deviceId;
|
that.macAddr = options.deviceId;
|
||||||
|
|
@ -263,18 +269,20 @@ var myTime;var _default =
|
||||||
if (!device.name && !device.localName) {
|
if (!device.name && !device.localName) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (device.deviceId.indexOf(that.deviceId) != -1) {
|
if (device.name.indexOf('AiLink_') != -1) {
|
||||||
that.stopBluetoothDevicesDiscovery();
|
|
||||||
clearTimeout(myTime);
|
clearTimeout(myTime);
|
||||||
var buff = device.advertisData.slice(-6);
|
var buff = device.advertisData.slice(-6);
|
||||||
device.mac = new Uint8Array(buff); // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
|
device.mac = new Uint8Array(buff); // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
|
||||||
var tempMac = Array.from(device.mac);
|
var tempMac = Array.from(device.mac);
|
||||||
tempMac.reverse();
|
tempMac.reverse();
|
||||||
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase();
|
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase();
|
||||||
that.macAddr = device.macAddr;
|
if (device.deviceId.indexOf(that.deviceId) != -1 || device.macAddr.indexOf(that.deviceId) != -1) {
|
||||||
that.deviceId = device.deviceId;
|
that.stopBluetoothDevicesDiscovery();
|
||||||
that.createBLEConnection();
|
that.macAddr = device.macAddr;
|
||||||
return;
|
that.deviceId = device.deviceId;
|
||||||
|
that.createBLEConnection();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -376,9 +384,9 @@ var myTime;var _default =
|
||||||
that.uuid1 = item.uuid; //下发数据
|
that.uuid1 = item.uuid; //下发数据
|
||||||
} else if (item.uuid.indexOf('0000FFE2') != -1) {
|
} else if (item.uuid.indexOf('0000FFE2') != -1) {
|
||||||
that.uuid2 = item.uuid; //监听数据
|
that.uuid2 = item.uuid; //监听数据
|
||||||
|
that.notifyBLECharacteristicValue();
|
||||||
} else if (item.uuid.indexOf('0000FFE3') != -1) {
|
} else if (item.uuid.indexOf('0000FFE3') != -1) {
|
||||||
that.uuid3 = item.uuid; //写入设置
|
that.uuid3 = item.uuid; //写入设置
|
||||||
that.notifyBLECharacteristicValue();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -397,7 +405,7 @@ var myTime;var _default =
|
||||||
state: true, // 启用 notify 功能
|
state: true, // 启用 notify 功能
|
||||||
deviceId: that.deviceId,
|
deviceId: that.deviceId,
|
||||||
serviceId: that.serviceId,
|
serviceId: that.serviceId,
|
||||||
characteristicId: that.uuid3,
|
characteristicId: that.uuid2,
|
||||||
success: function success(res) {
|
success: function success(res) {
|
||||||
uni.onBLECharacteristicValueChange(function (res) {
|
uni.onBLECharacteristicValueChange(function (res) {
|
||||||
var value = that.$tools.ab2hex(res.value, "");
|
var value = that.$tools.ab2hex(res.value, "");
|
||||||
|
|
@ -441,14 +449,14 @@ var myTime;var _default =
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (type == "11") {
|
if (type == "11") {
|
||||||
if (typeInfo == "03") {
|
that.type = 2;
|
||||||
|
if (typeInfo == "03" || typeInfo == "04") {
|
||||||
that.imp = parseInt(value.substring(17, 22), 16);
|
that.imp = parseInt(value.substring(17, 22), 16);
|
||||||
}
|
}
|
||||||
console.log("体脂:", that.imp);
|
console.log("体脂:", that.imp);
|
||||||
}
|
}
|
||||||
if (type == "14") {//身高模式
|
if (type == "14") {//身高模式
|
||||||
that.height = parseInt(value.substring(10, 14), 16) / 10;
|
that.height = parseInt(value.substring(10, 14), 16) / 10;
|
||||||
that.type = 2;
|
|
||||||
console.log("身高模式:", that.height);
|
console.log("身高模式:", that.height);
|
||||||
}
|
}
|
||||||
if (type == "30") {
|
if (type == "30") {
|
||||||
|
|
@ -491,7 +499,7 @@ var myTime;var _default =
|
||||||
weight: that.weight,
|
weight: that.weight,
|
||||||
imp: that.imp,
|
imp: that.imp,
|
||||||
ecode: that.macAddr,
|
ecode: that.macAddr,
|
||||||
height: that.height,
|
height: that.height ? that.height : that.info.height,
|
||||||
familyid: that.info.familyid }).
|
familyid: that.info.familyid }).
|
||||||
then(function (res) {
|
then(function (res) {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
|
|
@ -502,7 +510,7 @@ var myTime;var _default =
|
||||||
that.$store.dispatch("getResult", {
|
that.$store.dispatch("getResult", {
|
||||||
birthday: that.info.birthday,
|
birthday: that.info.birthday,
|
||||||
familyid: that.info.familyid,
|
familyid: that.info.familyid,
|
||||||
height: that.height,
|
height: that.height ? that.height : that.info.height,
|
||||||
sex: that.info.sex });
|
sex: that.info.sex });
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -555,5 +563,5 @@ var myTime;var _default =
|
||||||
|
|
||||||
/***/ })
|
/***/ })
|
||||||
|
|
||||||
},[[187,"common/runtime","common/vendor"]]]);
|
},[[180,"common/runtime","common/vendor"]]]);
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/BLEPages/adult/F01B.js.map
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/BLEPages/adult/F01B.js.map
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC",
|
||||||
"usingComponents": {}
|
"usingComponents": {}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,604 @@
|
||||||
|
(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["BLEPages/adult/F01PRO"],{
|
||||||
|
|
||||||
|
/***/ 186:
|
||||||
|
/*!****************************************************************************************************!*\
|
||||||
|
!*** D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/main.js?{"page":"BLEPages%2Fadult%2FF01PRO"} ***!
|
||||||
|
\****************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
/* WEBPACK VAR INJECTION */(function(createPage) {__webpack_require__(/*! uni-pages */ 5);
|
||||||
|
var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
|
||||||
|
var _F01PRO = _interopRequireDefault(__webpack_require__(/*! ./BLEPages/adult/F01PRO.vue */ 187));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}wx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;
|
||||||
|
createPage(_F01PRO.default);
|
||||||
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["createPage"]))
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 187:
|
||||||
|
/*!*********************************************************************************!*\
|
||||||
|
!*** D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/BLEPages/adult/F01PRO.vue ***!
|
||||||
|
\*********************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _F01PRO_vue_vue_type_template_id_4a952e43_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./F01PRO.vue?vue&type=template&id=4a952e43&scoped=true& */ 188);
|
||||||
|
/* harmony import */ var _F01PRO_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./F01PRO.vue?vue&type=script&lang=js& */ 190);
|
||||||
|
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _F01PRO_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _F01PRO_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
||||||
|
/* harmony import */ var _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 10);
|
||||||
|
|
||||||
|
var renderjs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* normalize component */
|
||||||
|
|
||||||
|
var component = Object(_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
|
||||||
|
_F01PRO_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
|
||||||
|
_F01PRO_vue_vue_type_template_id_4a952e43_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"],
|
||||||
|
_F01PRO_vue_vue_type_template_id_4a952e43_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
|
||||||
|
false,
|
||||||
|
null,
|
||||||
|
"4a952e43",
|
||||||
|
null,
|
||||||
|
false,
|
||||||
|
_F01PRO_vue_vue_type_template_id_4a952e43_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"],
|
||||||
|
renderjs
|
||||||
|
)
|
||||||
|
|
||||||
|
component.options.__file = "BLEPages/adult/F01PRO.vue"
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (component.exports);
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 188:
|
||||||
|
/*!****************************************************************************************************************************!*\
|
||||||
|
!*** D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/BLEPages/adult/F01PRO.vue?vue&type=template&id=4a952e43&scoped=true& ***!
|
||||||
|
\****************************************************************************************************************************/
|
||||||
|
/*! exports provided: render, staticRenderFns, recyclableRender, components */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01PRO_vue_vue_type_template_id_4a952e43_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./F01PRO.vue?vue&type=template&id=4a952e43&scoped=true& */ 189);
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01PRO_vue_vue_type_template_id_4a952e43_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; });
|
||||||
|
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01PRO_vue_vue_type_template_id_4a952e43_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
|
||||||
|
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01PRO_vue_vue_type_template_id_4a952e43_scoped_true___WEBPACK_IMPORTED_MODULE_0__["recyclableRender"]; });
|
||||||
|
|
||||||
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01PRO_vue_vue_type_template_id_4a952e43_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 189:
|
||||||
|
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/BLEPages/adult/F01PRO.vue?vue&type=template&id=4a952e43&scoped=true& ***!
|
||||||
|
\****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
/*! exports provided: render, staticRenderFns, recyclableRender, components */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return recyclableRender; });
|
||||||
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "components", function() { return components; });
|
||||||
|
var components
|
||||||
|
var render = function() {
|
||||||
|
var _vm = this
|
||||||
|
var _h = _vm.$createElement
|
||||||
|
var _c = _vm._self._c || _h
|
||||||
|
}
|
||||||
|
var recyclableRender = false
|
||||||
|
var staticRenderFns = []
|
||||||
|
render._withStripped = true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 190:
|
||||||
|
/*!**********************************************************************************************************!*\
|
||||||
|
!*** D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/BLEPages/adult/F01PRO.vue?vue&type=script&lang=js& ***!
|
||||||
|
\**********************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
__webpack_require__.r(__webpack_exports__);
|
||||||
|
/* harmony import */ var _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01PRO_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./F01PRO.vue?vue&type=script&lang=js& */ 191);
|
||||||
|
/* harmony import */ var _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01PRO_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01PRO_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
|
||||||
|
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01PRO_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01PRO_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
||||||
|
/* harmony default export */ __webpack_exports__["default"] = (_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_F01PRO_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 191:
|
||||||
|
/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
|
!*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/BLEPages/adult/F01PRO.vue?vue&type=script&lang=js& ***!
|
||||||
|
\*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
|
/*! no static exports found */
|
||||||
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
/* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var _vuex = __webpack_require__(/*! vuex */ 9);function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
|
||||||
|
|
||||||
|
|
||||||
|
var myTime;
|
||||||
|
var plugin = requirePlugin("sdkPlugin").AiLink;var _default =
|
||||||
|
{
|
||||||
|
data: function data() {
|
||||||
|
return {
|
||||||
|
textW: "",
|
||||||
|
textH: "",
|
||||||
|
height: "",
|
||||||
|
weight: "",
|
||||||
|
imp: 0,
|
||||||
|
macAddr: "",
|
||||||
|
deviceId: "",
|
||||||
|
serviceId: "",
|
||||||
|
readId: "",
|
||||||
|
writeId: "",
|
||||||
|
notifyId: "",
|
||||||
|
isSend: true,
|
||||||
|
Unload: false,
|
||||||
|
devicesList: [],
|
||||||
|
isConnection: 0,
|
||||||
|
data01: {},
|
||||||
|
data02: {},
|
||||||
|
BLEResult: {} };
|
||||||
|
|
||||||
|
},
|
||||||
|
computed: _objectSpread(_objectSpread({},
|
||||||
|
(0, _vuex.mapState)(["user", "isConnected", "isBluetoothTyle", "appTheme"])), {}, {
|
||||||
|
info: function info() {
|
||||||
|
return this.user;
|
||||||
|
} }),
|
||||||
|
|
||||||
|
onUnload: function onUnload() {
|
||||||
|
var that = this;
|
||||||
|
if (!that.Unload) {
|
||||||
|
that.stopBluetoothDevicesDiscovery(); //取消蓝牙搜索
|
||||||
|
clearTimeout(myTime);
|
||||||
|
that.closeBLEConnection();
|
||||||
|
that.closeBluetoothAdapter();
|
||||||
|
console.log("页面返回onUnload");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
isConnected: function isConnected() {
|
||||||
|
var that = this;
|
||||||
|
if (!that.isConnected) {
|
||||||
|
that.handleBack();
|
||||||
|
that.isConnection = 2;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isBluetoothTyle: function isBluetoothTyle() {
|
||||||
|
var that = this;
|
||||||
|
if (!that.isBluetoothTyle) {
|
||||||
|
that.handleBack();
|
||||||
|
that.isConnection = 2;
|
||||||
|
}
|
||||||
|
} },
|
||||||
|
|
||||||
|
onLoad: function onLoad(options) {
|
||||||
|
var that = this;
|
||||||
|
// 导航栏颜色
|
||||||
|
uni.setNavigationBarColor({
|
||||||
|
frontColor: '#ffffff',
|
||||||
|
backgroundColor: this.appTheme });
|
||||||
|
|
||||||
|
//
|
||||||
|
that.textW = "";
|
||||||
|
that.textH = "";
|
||||||
|
console.log("options", options);
|
||||||
|
if (options && options.deviceId) {
|
||||||
|
that.macAddr = options.deviceId;
|
||||||
|
that.deviceId = options.deviceId;
|
||||||
|
that.closeBLEConnection();
|
||||||
|
that.closeBluetoothAdapter();
|
||||||
|
that.openBluetoothAdapter();
|
||||||
|
}
|
||||||
|
that.onBLEConnectionStateChange();
|
||||||
|
uni.onBluetoothAdapterStateChange(function (res) {
|
||||||
|
that.$store.commit("changeBluetooth", res.available);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 重新连接
|
||||||
|
openBluetoothAdapter: function openBluetoothAdapter() {
|
||||||
|
var that = this;
|
||||||
|
that.isSend = true;
|
||||||
|
uni.openBluetoothAdapter({
|
||||||
|
success: function success(e) {
|
||||||
|
that.isConnection = 0;
|
||||||
|
that.startBluetoothDeviceDiscovery();
|
||||||
|
console.log('初始化蓝牙成功:' + e.errMsg);
|
||||||
|
},
|
||||||
|
fail: function fail(e) {
|
||||||
|
that.isConnection = 2;
|
||||||
|
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!");
|
||||||
|
} });
|
||||||
|
|
||||||
|
},
|
||||||
|
// 监听蓝牙连接状态
|
||||||
|
onBLEConnectionStateChange: function onBLEConnectionStateChange() {
|
||||||
|
var that = this;
|
||||||
|
uni.onBLEConnectionStateChange(function (res) {
|
||||||
|
console.log("蓝牙连接状态", JSON.stringify(res));
|
||||||
|
if (!res.connected) {
|
||||||
|
that.Unload = true;
|
||||||
|
that.isConnection = 2;
|
||||||
|
clearTimeout(myTime);
|
||||||
|
that.closeBLEConnection();
|
||||||
|
that.closeBluetoothAdapter();
|
||||||
|
}
|
||||||
|
that.$store.commit("changeConnected", res.connected);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 开始搜寻附近的蓝牙外围设备
|
||||||
|
startBluetoothDeviceDiscovery: function startBluetoothDeviceDiscovery() {
|
||||||
|
var that = this;
|
||||||
|
uni.startBluetoothDevicesDiscovery({
|
||||||
|
allowDuplicatesKey: false,
|
||||||
|
interval: 500, //上报设备的间隔
|
||||||
|
success: function success(res) {
|
||||||
|
that.isConnection = 0;
|
||||||
|
that.onBluetoothDeviceFound();
|
||||||
|
},
|
||||||
|
fail: function fail(res) {
|
||||||
|
that.isConnection = 2;
|
||||||
|
that.$tools.msg("请确定设备是开机状态、手机蓝牙权限已打开!");
|
||||||
|
} });
|
||||||
|
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 发现外围设备
|
||||||
|
*/
|
||||||
|
onBluetoothDeviceFound: function onBluetoothDeviceFound() {
|
||||||
|
var that = this;
|
||||||
|
that.isConnection = 0;
|
||||||
|
uni.onBluetoothDeviceFound(function (res) {
|
||||||
|
res.devices.forEach(function (device) {
|
||||||
|
if (!device.name && !device.localName) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (device.name.indexOf('AiLink_') != -1) {
|
||||||
|
clearTimeout(myTime);
|
||||||
|
var buff = device.advertisData.slice(-6);
|
||||||
|
device.mac = new Uint8Array(buff); // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
|
||||||
|
var tempMac = Array.from(device.mac);
|
||||||
|
tempMac.reverse();
|
||||||
|
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase();
|
||||||
|
if (device.deviceId.indexOf(that.deviceId) != -1 || device.macAddr.indexOf(that.deviceId) != -1) {
|
||||||
|
that.stopBluetoothDevicesDiscovery();
|
||||||
|
that.deviceId = device.deviceId;
|
||||||
|
that.macAddr = device.macAddr;
|
||||||
|
var foundDevices = that.devicesList;
|
||||||
|
var idx = that.$tools.inArray(foundDevices, "deviceId", device.deviceId);
|
||||||
|
if (idx === -1) {
|
||||||
|
that.devicesList.push(device);
|
||||||
|
} else {
|
||||||
|
that.devicesList[idx] = device;
|
||||||
|
}
|
||||||
|
that.createBLEConnection();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
that.handleMyTime();
|
||||||
|
},
|
||||||
|
handleMyTime: function handleMyTime() {
|
||||||
|
var that = this;
|
||||||
|
myTime = setTimeout(function () {
|
||||||
|
if (!that.macAddr) {
|
||||||
|
clearTimeout(myTime);
|
||||||
|
that.Unload = true;
|
||||||
|
that.isConnection = 2;
|
||||||
|
that.devicesList = [];
|
||||||
|
that.closeBLEConnection();
|
||||||
|
that.closeBluetoothAdapter();
|
||||||
|
}
|
||||||
|
}, 20000);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 停止搜索蓝牙设备
|
||||||
|
*/
|
||||||
|
stopBluetoothDevicesDiscovery: function stopBluetoothDevicesDiscovery() {
|
||||||
|
uni.stopBluetoothDevicesDiscovery({
|
||||||
|
success: function success(e) {
|
||||||
|
console.log("停止搜索蓝牙设备", e);
|
||||||
|
} });
|
||||||
|
|
||||||
|
},
|
||||||
|
// 连接蓝牙
|
||||||
|
createBLEConnection: function createBLEConnection() {
|
||||||
|
var that = this;
|
||||||
|
uni.createBLEConnection({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
success: function success(res) {
|
||||||
|
console.log("设备连接成功,获取设备的services", res);
|
||||||
|
that.isConnection = 0;
|
||||||
|
that.getBLEDeviceServices();
|
||||||
|
},
|
||||||
|
fail: function fail(res) {
|
||||||
|
that.isConnection = 2;
|
||||||
|
console.log("设备连接失败,请重新连接", res);
|
||||||
|
} });
|
||||||
|
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取设备的UUID
|
||||||
|
*/
|
||||||
|
getBLEDeviceServices: function getBLEDeviceServices() {
|
||||||
|
var serviceList = [];
|
||||||
|
var that = this;
|
||||||
|
uni.getBLEDeviceServices({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
success: function success(res) {
|
||||||
|
console.log("获取设备的UUID成功", res);
|
||||||
|
serviceList = res.services;
|
||||||
|
for (var i = 0; i < serviceList.length; i++) {
|
||||||
|
var 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: function fail(res) {
|
||||||
|
console.log('获取设备的UUID失败:', res);
|
||||||
|
} });
|
||||||
|
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取指定服务的特征值
|
||||||
|
*/
|
||||||
|
getBLEDeviceCharacteristics: function getBLEDeviceCharacteristics(deviceId, serviceId) {
|
||||||
|
var characteristicsList = [];
|
||||||
|
var that = this;
|
||||||
|
uni.getBLEDeviceCharacteristics({
|
||||||
|
deviceId: deviceId,
|
||||||
|
serviceId: serviceId,
|
||||||
|
success: function success(res) {
|
||||||
|
console.log("服务的特征值成功", res);
|
||||||
|
characteristicsList = res.characteristics;
|
||||||
|
for (var i = 0; i < characteristicsList.length; i++) {
|
||||||
|
var 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: deviceId,
|
||||||
|
serviceId: serviceId,
|
||||||
|
characteristicId: that.uuid2,
|
||||||
|
state: true });
|
||||||
|
|
||||||
|
uni.notifyBLECharacteristicValueChange({
|
||||||
|
deviceId: deviceId,
|
||||||
|
serviceId: serviceId,
|
||||||
|
characteristicId: that.uuid3,
|
||||||
|
state: true });
|
||||||
|
|
||||||
|
// 初始化插件
|
||||||
|
console.log("初始化插件", that.devicesList);
|
||||||
|
that.devicesList[0].serviceId = that.serviceId;
|
||||||
|
plugin.initPlugin(res.characteristics, that.devicesList[0]);
|
||||||
|
uni.onBLECharacteristicValueChange(function (characteristic) {
|
||||||
|
var bleData = plugin.parseBleData(characteristic.value);
|
||||||
|
var dw0 = "kg";
|
||||||
|
var data1 = {};
|
||||||
|
var data2 = {};
|
||||||
|
if (bleData.status == 0) {
|
||||||
|
var sex0 = that.info.sex == 1 ? 1 : 0;
|
||||||
|
var sex = "0x0" + sex0.toString(16);
|
||||||
|
var age = "0x" + that.info.age.toString(16);
|
||||||
|
var height = "0x" + that.info.height.toString(16);
|
||||||
|
var arr = [0x01, parseInt(sex), parseInt(age), parseInt(height), 0x00];
|
||||||
|
console.log("指令发送成功", arr);
|
||||||
|
plugin.sendDataOfA7(arr);
|
||||||
|
console.log("握手成功");
|
||||||
|
} else if (bleData.status == 1) {
|
||||||
|
var payload = that.$tools.ab2hex(bleData.data, '');
|
||||||
|
var type = payload.substring(0, 2);
|
||||||
|
console.log("开始测量", payload);
|
||||||
|
if (type == "10" || type == "30" || type == "40") {//体脂模式
|
||||||
|
var data = parseInt(payload.substring(6, 12), 16);
|
||||||
|
var typeInfo = payload.substring(4, 6);
|
||||||
|
var num = payload.substring(12, 13);
|
||||||
|
var dw = payload.substring(13, 14);
|
||||||
|
if (dw == "1") {
|
||||||
|
dw0 = "jin";
|
||||||
|
}
|
||||||
|
if (num == "1") {
|
||||||
|
data = data / 10;
|
||||||
|
}
|
||||||
|
if (num == "2") {
|
||||||
|
data = data / 100;
|
||||||
|
}
|
||||||
|
if (num == "3") {
|
||||||
|
data = data / 1000;
|
||||||
|
}
|
||||||
|
if (typeInfo == "01") {
|
||||||
|
that.textW = "您的实时体重是:" + data;
|
||||||
|
}
|
||||||
|
if (typeInfo == "02") {
|
||||||
|
that.textW = "您的体重是:" + data;
|
||||||
|
that.weight = data + dw0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type == "14" || type == "41") {//身高模式
|
||||||
|
var _height = parseInt(payload.substring(4, 8), 16);
|
||||||
|
that.textH = "您的身高是:" + _height + "cm";
|
||||||
|
that.height = _height;
|
||||||
|
console.log("身高模式:", that.height);
|
||||||
|
}
|
||||||
|
if (type == "11") {//阻抗模式
|
||||||
|
var _typeInfo = payload.substring(4, 6);
|
||||||
|
if (_typeInfo == "02") {
|
||||||
|
that.imp = 0;
|
||||||
|
}
|
||||||
|
if (_typeInfo == "04") {
|
||||||
|
that.imp = parseInt(payload.substring(8, 12), 16);
|
||||||
|
}
|
||||||
|
console.log("阻抗:", that.imp);
|
||||||
|
}
|
||||||
|
if (type == '15') {
|
||||||
|
var _typeInfo2 = payload.substring(4, 6);
|
||||||
|
if (_typeInfo2 == "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 (_typeInfo2 == '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 = Object.assign(that.data01, that.data02);
|
||||||
|
}
|
||||||
|
if (type == "80") {//测量结束
|
||||||
|
that.BLEResult.weight = that.weight;
|
||||||
|
that.BLEResult.imp = that.imp ? that.imp : 0;
|
||||||
|
that.BLEResult.ecode = that.macAddr;
|
||||||
|
that.BLEResult.height = that.height ? that.height : that.info.height;
|
||||||
|
that.BLEResult.familyid = that.info.id;
|
||||||
|
console.log("体脂成功:", that.BLEResult);
|
||||||
|
that.handleGetMeasure(that.BLEResult);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fail: function fail(res) {
|
||||||
|
console.log('获取特征值失败:', JSON.stringify(res));
|
||||||
|
} });
|
||||||
|
|
||||||
|
},
|
||||||
|
// 保存测量结果
|
||||||
|
handleGetMeasure: function handleGetMeasure(data) {
|
||||||
|
console.log("保存结果");
|
||||||
|
var that = this;
|
||||||
|
that.$model.getmeasuredata(data).then(function (res) {
|
||||||
|
if (res.code == 0) {
|
||||||
|
that.$store.dispatch("getUserInfo", {
|
||||||
|
familyid: that.info.familyid });
|
||||||
|
|
||||||
|
that.$store.dispatch("getResult", {
|
||||||
|
birthday: that.info.birthday,
|
||||||
|
familyid: that.info.familyid,
|
||||||
|
height: that.height ? that.height : that.info.height,
|
||||||
|
sex: that.info.sex });
|
||||||
|
|
||||||
|
that.$tools.msg("测量成功");
|
||||||
|
} else {
|
||||||
|
console.log("测量失败", res.message);
|
||||||
|
that.$tools.msg(res.message);
|
||||||
|
}
|
||||||
|
that.Unload = true;
|
||||||
|
setTimeout(function () {
|
||||||
|
that.closeBLEConnection();
|
||||||
|
that.closeBluetoothAdapter();
|
||||||
|
uni.switchTab({
|
||||||
|
url: "/pages/index/index" });
|
||||||
|
|
||||||
|
}, 200);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 断开蓝牙模块
|
||||||
|
*/
|
||||||
|
closeBluetoothAdapter: function closeBluetoothAdapter() {
|
||||||
|
var that = this;
|
||||||
|
uni.closeBluetoothAdapter({
|
||||||
|
success: function success(res) {
|
||||||
|
console.log('蓝牙模块关闭成功');
|
||||||
|
} });
|
||||||
|
|
||||||
|
},
|
||||||
|
handleBack: function handleBack() {
|
||||||
|
var that = this;
|
||||||
|
that.Unload = true;
|
||||||
|
that.stopBluetoothDevicesDiscovery(); //取消蓝牙搜索
|
||||||
|
that.closeBLEConnection();
|
||||||
|
that.closeBluetoothAdapter();
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 断开蓝牙连接
|
||||||
|
*/
|
||||||
|
closeBLEConnection: function closeBLEConnection() {
|
||||||
|
var that = this;
|
||||||
|
uni.closeBLEConnection({
|
||||||
|
deviceId: that.deviceId,
|
||||||
|
success: function success(res) {
|
||||||
|
console.log('断开蓝牙连接成功');
|
||||||
|
} });
|
||||||
|
|
||||||
|
} } };exports.default = _default;
|
||||||
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
|
||||||
|
|
||||||
|
/***/ })
|
||||||
|
|
||||||
|
},[[186,"common/runtime","common/vendor"]]]);
|
||||||
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/BLEPages/adult/F01PRO.js.map
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"navigationBarTitleText": "",
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC",
|
||||||
|
"usingComponents": {}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
<view class="data-v-4a952e43"><view class="content weightPages data-v-4a952e43"><block wx:if="{{isConnection==0}}"><view class="title data-v-4a952e43">连接中,请稍后</view></block><block wx:if="{{isConnection==1}}"><view class="title data-v-4a952e43">连接成功,请开始测量</view></block><block wx:if="{{isConnection==2}}"><view data-event-opts="{{[['tap',[['openBluetoothAdapter',['$event']]]]]}}" class="title data-v-4a952e43" bindtap="__e">连接失败,点击重新连接</view></block><view class="text data-v-4a952e43">{{textW}}</view><view class="text data-v-4a952e43">{{textH}}</view><view class="image data-v-4a952e43"><image src="/BLEPages/static/F018P01.gif" class="data-v-4a952e43"></image></view><view class="tips data-v-4a952e43"><text class="data-v-4a952e43">请确保:</text><text class="data-v-4a952e43">1.请确定设备是开机状态</text><text class="data-v-4a952e43">2.请确定手机蓝牙、位置信息已打开</text><text class="data-v-4a952e43">3.ios系统需打开设置—>应用—>微信里的蓝牙权限</text></view></view></view>
|
||||||
|
|
@ -1,34 +1,34 @@
|
||||||
(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["BLEPages/adult/H01pro"],{
|
(global["webpackJsonp"] = global["webpackJsonp"] || []).push([["BLEPages/adult/H01pro"],{
|
||||||
|
|
||||||
/***/ 163:
|
/***/ 156:
|
||||||
/*!*********************************************************************************!*\
|
/*!****************************************************************************************************!*\
|
||||||
!*** E:/qiaocongli/adultDeviceApp/main.js?{"page":"BLEPages%2Fadult%2FH01pro"} ***!
|
!*** D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/main.js?{"page":"BLEPages%2Fadult%2FH01pro"} ***!
|
||||||
\*********************************************************************************/
|
\****************************************************************************************************/
|
||||||
/*! no static exports found */
|
/*! no static exports found */
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
/* WEBPACK VAR INJECTION */(function(createPage) {__webpack_require__(/*! uni-pages */ 5);
|
/* WEBPACK VAR INJECTION */(function(createPage) {__webpack_require__(/*! uni-pages */ 5);
|
||||||
var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
|
var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
|
||||||
var _H01pro = _interopRequireDefault(__webpack_require__(/*! ./BLEPages/adult/H01pro.vue */ 164));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}wx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;
|
var _H01pro = _interopRequireDefault(__webpack_require__(/*! ./BLEPages/adult/H01pro.vue */ 157));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}wx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;
|
||||||
createPage(_H01pro.default);
|
createPage(_H01pro.default);
|
||||||
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["createPage"]))
|
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["createPage"]))
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 164:
|
/***/ 157:
|
||||||
/*!**************************************************************!*\
|
/*!*********************************************************************************!*\
|
||||||
!*** E:/qiaocongli/adultDeviceApp/BLEPages/adult/H01pro.vue ***!
|
!*** D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/BLEPages/adult/H01pro.vue ***!
|
||||||
\**************************************************************/
|
\*********************************************************************************/
|
||||||
/*! no static exports found */
|
/*! no static exports found */
|
||||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
__webpack_require__.r(__webpack_exports__);
|
__webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony import */ var _H01pro_vue_vue_type_template_id_084d7ca1_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./H01pro.vue?vue&type=template&id=084d7ca1&scoped=true& */ 165);
|
/* harmony import */ var _H01pro_vue_vue_type_template_id_084d7ca1_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./H01pro.vue?vue&type=template&id=084d7ca1&scoped=true& */ 158);
|
||||||
/* harmony import */ var _H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./H01pro.vue?vue&type=script&lang=js& */ 167);
|
/* harmony import */ var _H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./H01pro.vue?vue&type=script&lang=js& */ 160);
|
||||||
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
||||||
/* harmony import */ var _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 9);
|
/* harmony import */ var _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js */ 10);
|
||||||
|
|
||||||
var renderjs
|
var renderjs
|
||||||
|
|
||||||
|
|
@ -37,7 +37,7 @@ var renderjs
|
||||||
|
|
||||||
/* normalize component */
|
/* normalize component */
|
||||||
|
|
||||||
var component = Object(_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
|
var component = Object(_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])(
|
||||||
_H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
|
_H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
|
||||||
_H01pro_vue_vue_type_template_id_084d7ca1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"],
|
_H01pro_vue_vue_type_template_id_084d7ca1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"],
|
||||||
_H01pro_vue_vue_type_template_id_084d7ca1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
|
_H01pro_vue_vue_type_template_id_084d7ca1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
|
||||||
|
|
@ -55,32 +55,32 @@ component.options.__file = "BLEPages/adult/H01pro.vue"
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 165:
|
/***/ 158:
|
||||||
/*!*********************************************************************************************************!*\
|
/*!****************************************************************************************************************************!*\
|
||||||
!*** E:/qiaocongli/adultDeviceApp/BLEPages/adult/H01pro.vue?vue&type=template&id=084d7ca1&scoped=true& ***!
|
!*** D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/BLEPages/adult/H01pro.vue?vue&type=template&id=084d7ca1&scoped=true& ***!
|
||||||
\*********************************************************************************************************/
|
\****************************************************************************************************************************/
|
||||||
/*! exports provided: render, staticRenderFns, recyclableRender, components */
|
/*! exports provided: render, staticRenderFns, recyclableRender, components */
|
||||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
__webpack_require__.r(__webpack_exports__);
|
__webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony import */ var _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_template_id_084d7ca1_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./H01pro.vue?vue&type=template&id=084d7ca1&scoped=true& */ 166);
|
/* harmony import */ var _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_template_id_084d7ca1_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./H01pro.vue?vue&type=template&id=084d7ca1&scoped=true& */ 159);
|
||||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_template_id_084d7ca1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; });
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_template_id_084d7ca1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; });
|
||||||
|
|
||||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_template_id_084d7ca1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_template_id_084d7ca1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
|
||||||
|
|
||||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_template_id_084d7ca1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["recyclableRender"]; });
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "recyclableRender", function() { return _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_template_id_084d7ca1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["recyclableRender"]; });
|
||||||
|
|
||||||
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_template_id_084d7ca1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"]; });
|
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "components", function() { return _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_16_0_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_template_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_uni_app_loader_page_meta_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_template_id_084d7ca1_scoped_true___WEBPACK_IMPORTED_MODULE_0__["components"]; });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 166:
|
/***/ 159:
|
||||||
/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/qiaocongli/adultDeviceApp/BLEPages/adult/H01pro.vue?vue&type=template&id=084d7ca1&scoped=true& ***!
|
!*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--16-0!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/BLEPages/adult/H01pro.vue?vue&type=template&id=084d7ca1&scoped=true& ***!
|
||||||
\*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
\****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
/*! exports provided: render, staticRenderFns, recyclableRender, components */
|
/*! exports provided: render, staticRenderFns, recyclableRender, components */
|
||||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
|
|
@ -104,26 +104,26 @@ render._withStripped = true
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 167:
|
/***/ 160:
|
||||||
/*!***************************************************************************************!*\
|
/*!**********************************************************************************************************!*\
|
||||||
!*** E:/qiaocongli/adultDeviceApp/BLEPages/adult/H01pro.vue?vue&type=script&lang=js& ***!
|
!*** D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/BLEPages/adult/H01pro.vue?vue&type=script&lang=js& ***!
|
||||||
\***************************************************************************************/
|
\**********************************************************************************************************/
|
||||||
/*! no static exports found */
|
/*! no static exports found */
|
||||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
__webpack_require__.r(__webpack_exports__);
|
__webpack_require__.r(__webpack_exports__);
|
||||||
/* harmony import */ var _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./H01pro.vue?vue&type=script&lang=js& */ 168);
|
/* harmony import */ var _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!../../../../../../../../360Downloads/Software/HBuilderX.3.3.13.20220314/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./H01pro.vue?vue&type=script&lang=js& */ 161);
|
||||||
/* harmony import */ var _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
|
/* harmony import */ var _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);
|
||||||
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
|
||||||
/* harmony default export */ __webpack_exports__["default"] = (_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_D_360_HBuilderX_3_4_7_20220422_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
|
/* harmony default export */ __webpack_exports__["default"] = (_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_babel_loader_lib_index_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_webpack_preprocess_loader_index_js_ref_12_1_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_script_js_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_vue_cli_plugin_uni_packages_vue_loader_lib_index_js_vue_loader_options_360Downloads_Software_HBuilderX_3_3_13_20220314_HBuilderX_plugins_uniapp_cli_node_modules_dcloudio_webpack_uni_mp_loader_lib_style_js_H01pro_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a);
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 168:
|
/***/ 161:
|
||||||
/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
|
||||||
!*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!E:/qiaocongli/adultDeviceApp/BLEPages/adult/H01pro.vue?vue&type=script&lang=js& ***!
|
!*** ./node_modules/babel-loader/lib!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader??ref--12-1!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib??vue-loader-options!./node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!D:/MyWork/mywork/小程序/每日一称/成人版小程序/adultDeviceApp/BLEPages/adult/H01pro.vue?vue&type=script&lang=js& ***!
|
||||||
\**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
\*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
|
||||||
/*! no static exports found */
|
/*! no static exports found */
|
||||||
/***/ (function(module, exports, __webpack_require__) {
|
/***/ (function(module, exports, __webpack_require__) {
|
||||||
|
|
||||||
|
|
@ -148,7 +148,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var _vuex = __webpack_require__(/*! vuex */ 15);function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
|
var _vuex = __webpack_require__(/*! vuex */ 9);function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
|
||||||
|
|
||||||
|
|
||||||
var myTime;var _default =
|
var myTime;var _default =
|
||||||
|
|
@ -171,7 +171,7 @@ var myTime;var _default =
|
||||||
|
|
||||||
},
|
},
|
||||||
computed: _objectSpread(_objectSpread({},
|
computed: _objectSpread(_objectSpread({},
|
||||||
(0, _vuex.mapState)(["user", "isConnected", "isBluetoothTyle"])), {}, {
|
(0, _vuex.mapState)(["user", "isConnected", "isBluetoothTyle", "appTheme"])), {}, {
|
||||||
info: function info() {
|
info: function info() {
|
||||||
return this.user;
|
return this.user;
|
||||||
} }),
|
} }),
|
||||||
|
|
@ -204,12 +204,19 @@ var myTime;var _default =
|
||||||
|
|
||||||
onLoad: function onLoad(options) {
|
onLoad: function onLoad(options) {
|
||||||
var that = this;
|
var that = this;
|
||||||
|
// 导航栏颜色
|
||||||
|
uni.setNavigationBarColor({
|
||||||
|
frontColor: '#ffffff',
|
||||||
|
backgroundColor: this.appTheme });
|
||||||
|
|
||||||
|
//
|
||||||
that.textW = "";
|
that.textW = "";
|
||||||
that.textH = "";
|
that.textH = "";
|
||||||
if (options && options.deviceId) {
|
if (options && options.deviceId) {
|
||||||
that.macAddr = options.deviceId;
|
|
||||||
that.deviceId = options.deviceId;
|
that.deviceId = options.deviceId;
|
||||||
that.createBLEConnection();
|
that.closeBLEConnection();
|
||||||
|
that.closeBluetoothAdapter();
|
||||||
|
that.openBluetoothAdapter();
|
||||||
}
|
}
|
||||||
that.onBLEConnectionStateChange();
|
that.onBLEConnectionStateChange();
|
||||||
uni.onBluetoothAdapterStateChange(function (res) {
|
uni.onBluetoothAdapterStateChange(function (res) {
|
||||||
|
|
@ -269,22 +276,26 @@ var myTime;var _default =
|
||||||
var that = this;
|
var that = this;
|
||||||
that.isConnection = 0;
|
that.isConnection = 0;
|
||||||
uni.onBluetoothDeviceFound(function (res) {
|
uni.onBluetoothDeviceFound(function (res) {
|
||||||
console.log('开始监听寻找到新设备的事件', res);
|
|
||||||
res.devices.forEach(function (device) {
|
res.devices.forEach(function (device) {
|
||||||
if (!device.name && !device.localName) {
|
if (!device.name && !device.localName) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (device.deviceId.indexOf(that.deviceId) != -1) {
|
console.log('开始监听寻找到新设备的事件', device);
|
||||||
that.stopBluetoothDevicesDiscovery(); //取消蓝牙搜索
|
if (device.name.indexOf('My') != -1) {
|
||||||
clearTimeout(myTime);
|
clearTimeout(myTime);
|
||||||
var buff = device.advertisData.slice(-6);
|
var buff = device.advertisData.slice(-6);
|
||||||
device.mac = new Uint8Array(buff); // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
|
device.mac = new Uint8Array(buff); // 保存广播数据中的mac地址,这是由于iOS不直接返回mac地址
|
||||||
var tempMac = Array.from(device.mac);
|
var tempMac = Array.from(device.mac);
|
||||||
|
console.log('开始监听寻找到新设备的事件0', device);
|
||||||
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase();
|
device.macAddr = that.$tools.ab2hex(tempMac, ':').toUpperCase();
|
||||||
that.deviceId = device.macAddr;
|
if (device.deviceId.indexOf(that.deviceId) != -1 || device.macAddr.indexOf(that.deviceId) != -1) {
|
||||||
that.macAddr = device.macAddr;
|
console.log('开始监听寻找到新设备的事件1', that.deviceId);
|
||||||
that.createBLEConnection();
|
that.stopBluetoothDevicesDiscovery(); //取消蓝牙搜索
|
||||||
return;
|
that.deviceId = device.deviceId;
|
||||||
|
that.macAddr = device.macAddr;
|
||||||
|
that.createBLEConnection();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -509,5 +520,5 @@ var myTime;var _default =
|
||||||
|
|
||||||
/***/ })
|
/***/ })
|
||||||
|
|
||||||
},[[163,"common/runtime","common/vendor"]]]);
|
},[[156,"common/runtime","common/vendor"]]]);
|
||||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/BLEPages/adult/H01pro.js.map
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/BLEPages/adult/H01pro.js.map
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"navigationBarTitleText": "",
|
"navigationBarTitleText": "",
|
||||||
"enablePullDownRefresh": false,
|
"enablePullDownRefresh": false,
|
||||||
|
"navigationBarBackgroundColor": "#F9FAFC",
|
||||||
"usingComponents": {}
|
"usingComponents": {}
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue