调多语言页面样式
This commit is contained in:
parent
1a3a8babc4
commit
e80157c6f7
50
App.vue
50
App.vue
|
|
@ -9,7 +9,7 @@
|
||||||
return {}
|
return {}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["user"]),
|
...mapState(["user", "bleValue"]),
|
||||||
},
|
},
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
let that = this
|
let that = this
|
||||||
|
|
@ -70,9 +70,8 @@
|
||||||
that.$store.dispatch("getCardAllList") // 全部卡片
|
that.$store.dispatch("getCardAllList") // 全部卡片
|
||||||
that.$store.dispatch("getPublicRecord") // 卡片手动记录配置
|
that.$store.dispatch("getPublicRecord") // 卡片手动记录配置
|
||||||
that.$store.dispatch("getHomeConfig") //配置接口信息
|
that.$store.dispatch("getHomeConfig") //配置接口信息
|
||||||
|
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
that.$tools.handleUserList()
|
that.handleUserList()
|
||||||
} else {
|
} else {
|
||||||
uni.setStorageSync('token', "")
|
uni.setStorageSync('token', "")
|
||||||
uni.setStorageSync('aan_id', null)
|
uni.setStorageSync('aan_id', null)
|
||||||
|
|
@ -117,6 +116,51 @@
|
||||||
// console.error('Error fetching data:', error);
|
// console.error('Error fetching data:', error);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
handleUserList() {
|
||||||
|
let that = this
|
||||||
|
that.$model.getUserList({
|
||||||
|
type: 2
|
||||||
|
}).then(res => {
|
||||||
|
if (res.code != 0) {
|
||||||
|
that.$tools.msg(res.msg)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
that.$store.commit('changeFamilay', res.data.user_list)
|
||||||
|
if (res.data.user_list.length) {
|
||||||
|
let userid = ""
|
||||||
|
if (uni.getStorageSync('userid')) {
|
||||||
|
let found = res.data.user_list.find(e => e.id == uni.getStorageSync('userid'));
|
||||||
|
if (found !== undefined) {
|
||||||
|
userid = found.id
|
||||||
|
} else {
|
||||||
|
userid = res.data.user_list[0].id
|
||||||
|
uni.setStorageSync('userid', res.data.user_list[0].id)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
userid = res.data.user_list[0].id
|
||||||
|
uni.setStorageSync('userid', res.data.user_list[0].id)
|
||||||
|
}
|
||||||
|
// 用户信息接口
|
||||||
|
that.$store.dispatch('getUserInfo', {
|
||||||
|
aud_id: userid
|
||||||
|
})
|
||||||
|
// 厨房秤接口
|
||||||
|
that.$store.dispatch("getCountFoodInfo", {
|
||||||
|
aud_id: userid,
|
||||||
|
time: that.$tools.getDate("start")
|
||||||
|
})
|
||||||
|
//
|
||||||
|
that.$store.dispatch("getResult", {
|
||||||
|
aud_id: userid
|
||||||
|
})
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
that.$isResolve()
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch(err => {})
|
||||||
|
},
|
||||||
handleTabBarItem() {
|
handleTabBarItem() {
|
||||||
let that = this
|
let that = this
|
||||||
uni.setTabBarItem({
|
uni.setTabBarItem({
|
||||||
|
|
|
||||||
|
|
@ -329,7 +329,7 @@
|
||||||
that.showScanCodeDlg = false
|
that.showScanCodeDlg = false
|
||||||
that.showAutoSearchDlg = false
|
that.showAutoSearchDlg = false
|
||||||
that.activeType = ite
|
that.activeType = ite
|
||||||
that.weightKcal = ite.kcal
|
that.weightKcal = Number(ite.kcal)
|
||||||
if (that.bleValue.serviceId != "") {
|
if (that.bleValue.serviceId != "") {
|
||||||
that.realTimeWeight(that.bleValue.foodWeight, that.bleValue.foodUnit)
|
that.realTimeWeight(that.bleValue.foodWeight, that.bleValue.foodUnit)
|
||||||
if (that.bleValue.foodType == 2 && Number(that.bleValue.foodWeight) > 0) {
|
if (that.bleValue.foodType == 2 && Number(that.bleValue.foodWeight) > 0) {
|
||||||
|
|
@ -359,6 +359,7 @@
|
||||||
food_list: list,
|
food_list: list,
|
||||||
time: that.time
|
time: that.time
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
console.log("饮食称重保存", res)
|
||||||
if (res.code != 0) return
|
if (res.code != 0) return
|
||||||
that.$store.dispatch("getCountFoodInfo", {
|
that.$store.dispatch("getCountFoodInfo", {
|
||||||
aud_id: that.user.aud_id,
|
aud_id: that.user.aud_id,
|
||||||
|
|
@ -449,9 +450,9 @@
|
||||||
handledelactive(ite) {
|
handledelactive(ite) {
|
||||||
let that = this
|
let that = this
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
content: this.$t('WhetherTodelete') + ite.name,
|
content: this.$t('WhetherTodelete') + ite.name,
|
||||||
cancelText: that.$t("btnSancellation"),//取消按钮文字
|
cancelText: that.$t("btnSancellation"), //取消按钮文字
|
||||||
confirmText: that.$t("btnConfirm"),//确认按钮文字
|
confirmText: that.$t("btnConfirm"), //确认按钮文字
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
this.$model.delCEatAction({
|
this.$model.delCEatAction({
|
||||||
|
|
@ -911,14 +912,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
width: 31%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
|
||||||
.che {
|
.che {
|
||||||
width: 80rpx;
|
width: 100rpx;
|
||||||
height: 80rpx;
|
height: 100rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
|
|
@ -946,6 +947,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.type {
|
.type {
|
||||||
|
margin-left: 5px;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 15px;
|
width: 15px;
|
||||||
height: 15px;
|
height: 15px;
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,8 @@
|
||||||
uni.setStorageSync('language', key)
|
uni.setStorageSync('language', key)
|
||||||
that.$store.commit('changeLocale', key)
|
that.$store.commit('changeLocale', key)
|
||||||
that.$store.dispatch("getHomeConfig")
|
that.$store.dispatch("getHomeConfig")
|
||||||
|
that.$store.dispatch("getCardAllList") // 全部卡片
|
||||||
|
that.$store.dispatch("getPublicRecord") // 卡片手动记录配置
|
||||||
that.$tools.handleUserList()
|
that.$tools.handleUserList()
|
||||||
that.handleTabBarItem()
|
that.handleTabBarItem()
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@
|
||||||
that.$store.commit('changeFamilay', res.data.user_list)
|
that.$store.commit('changeFamilay', res.data.user_list)
|
||||||
console.log("删除", that.id, uni.getStorageSync('userid'))
|
console.log("删除", that.id, uni.getStorageSync('userid'))
|
||||||
// 删除的是当前用户
|
// 删除的是当前用户
|
||||||
if (that.id == uni.getStorageSync('userid') || !res.data.user_list.length) {
|
if (that.id == uni.getStorageSync('userid')) {
|
||||||
let userid = !res.data.user_list.length ? "" : res.data.user_list[0].id
|
let userid = !res.data.user_list.length ? "" : res.data.user_list[0].id
|
||||||
uni.setStorageSync('userid', userid)
|
uni.setStorageSync('userid', userid)
|
||||||
that.$store.dispatch('getUserInfo', {
|
that.$store.dispatch('getUserInfo', {
|
||||||
|
|
@ -164,8 +164,8 @@
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 10px 15px;
|
padding: 10px;
|
||||||
width: calc(100% - 30px);
|
width: calc(100% - 20px);
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -174,7 +174,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
width: 75%;
|
width: 80%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,7 @@
|
||||||
<view class="lanBox">
|
<view class="lanBox">
|
||||||
<view class="headbox">
|
<view class="headbox">
|
||||||
<view class="touxiang">
|
<view class="touxiang">
|
||||||
<image v-if="headimg" :src="headimg" class="headimage" />
|
<icon class="iconfont icon-user-filling headimage"></icon>
|
||||||
<icon v-else class="iconfont icon-user-filling headimage"></icon>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="lan border-bottom">
|
<view class="lan border-bottom">
|
||||||
|
|
@ -179,22 +178,21 @@
|
||||||
// 新增成员
|
// 新增成员
|
||||||
if (!that.isEdit) {
|
if (!that.isEdit) {
|
||||||
console.log('新增', that.addID)
|
console.log('新增', that.addID)
|
||||||
let userid = that.addID
|
|
||||||
uni.setStorageSync('userid', that.addID)
|
uni.setStorageSync('userid', that.addID)
|
||||||
that.$store.dispatch('getUserInfo', {
|
that.$store.dispatch('getUserInfo', {
|
||||||
aud_id: userid
|
aud_id: that.addID
|
||||||
})
|
})
|
||||||
that.$store.dispatch("getCountFoodInfo", {
|
that.$store.dispatch("getCountFoodInfo", {
|
||||||
aud_id: userid,
|
aud_id: that.addID,
|
||||||
time: that.$tools.getDate("start")
|
time: that.$tools.getDate("start")
|
||||||
})
|
})
|
||||||
that.$store.dispatch("getCardAllList", {
|
|
||||||
aud_id: userid
|
|
||||||
})
|
|
||||||
//
|
//
|
||||||
that.$store.dispatch("getResult", {
|
that.$store.dispatch("getResult", {
|
||||||
aud_id: userid
|
aud_id: that.addID
|
||||||
})
|
})
|
||||||
|
if (res.data.user_list.length == 1) {
|
||||||
|
that.$isResolve()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 编辑当前用户
|
// 编辑当前用户
|
||||||
if (that.isEdit && that.memInfo.id == uni.getStorageSync('userid')) {
|
if (that.isEdit && that.memInfo.id == uni.getStorageSync('userid')) {
|
||||||
|
|
@ -209,8 +207,9 @@
|
||||||
aud_id: that.memInfo.id
|
aud_id: that.memInfo.id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
uni.switchTab({
|
uni.reLaunch({
|
||||||
url: "/pages/index/index"
|
url: "/pages/index/index"
|
||||||
})
|
})
|
||||||
}, 500)
|
}, 500)
|
||||||
|
|
|
||||||
|
|
@ -685,7 +685,8 @@
|
||||||
|
|
||||||
.Xlist {
|
.Xlist {
|
||||||
display: flex;
|
display: flex;
|
||||||
line-height: 40px;
|
height: 45px;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
view {
|
view {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
|
@ -767,8 +768,8 @@
|
||||||
view {
|
view {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
line-height: 60px;
|
display: flex;
|
||||||
text-align: center;
|
align-items: center;
|
||||||
background: #f7f7f7;
|
background: #f7f7f7;
|
||||||
border: 1px solid $maincolor;
|
border: 1px solid $maincolor;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
|
@ -790,7 +791,7 @@
|
||||||
color: #666;
|
color: #666;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 15%;
|
width: 33%;
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["bleValue", "countFoodInfo", "isBluetoothTyle", ]),
|
...mapState(["bleValue", "countFoodInfo", "isBluetoothTyle", "configInfo"]),
|
||||||
weight() {
|
weight() {
|
||||||
let weightNew = this.$ble.convertToGrams(this.bleValue.foodWeight, this.bleValue.foodUnit)
|
let weightNew = this.$ble.convertToGrams(this.bleValue.foodWeight, this.bleValue.foodUnit)
|
||||||
this.kcal = (Number(this.weightKcal) / 100 * weightNew).toFixed(1)
|
this.kcal = (Number(this.weightKcal) / 100 * weightNew).toFixed(1)
|
||||||
|
|
@ -338,8 +338,9 @@
|
||||||
|
|
||||||
// 添加食物
|
// 添加食物
|
||||||
handleAddFood() {
|
handleAddFood() {
|
||||||
|
let name = this.configInfo.meal_list[0].name
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/Food/count/search?name=早餐&time=" + this.countFoodInfo.date
|
url: "/Food/count/search?name=" + name + '&time=' + this.countFoodInfo.date
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
inputDialogToggle() {
|
inputDialogToggle() {
|
||||||
|
|
|
||||||
6
main.js
6
main.js
|
|
@ -28,6 +28,12 @@ let i18nConfig = {
|
||||||
import json from '@/content.json'
|
import json from '@/content.json'
|
||||||
Vue.prototype.$json = json;
|
Vue.prototype.$json = json;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Vue.prototype.$onLaunched = new Promise(resolve => {
|
||||||
|
Vue.prototype.$isResolve = resolve
|
||||||
|
})
|
||||||
|
|
||||||
// #ifndef VUE3
|
// #ifndef VUE3
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import VueI18n from 'vue-i18n'
|
import VueI18n from 'vue-i18n'
|
||||||
|
|
|
||||||
|
|
@ -24,13 +24,13 @@
|
||||||
<view class="Blue">
|
<view class="Blue">
|
||||||
<view class="h4">{{$t("measureResultTips")}}</view>
|
<view class="h4">{{$t("measureResultTips")}}</view>
|
||||||
<view class="Blue-box">
|
<view class="Blue-box">
|
||||||
{{$t("nowWeight")}}:<text>{{weight}}{{unit}}</text>
|
{{$t("infoWeight")}}:<text>{{weight}}{{unit}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="Blue-box">
|
<view class="Blue-box">
|
||||||
{{$t("lastHeight")}}:<input v-model="height" type="digit" :placeholder="$t('verifyHeight')" />cm
|
{{$t("infoHeight")}}:<input v-model="height" type="digit" :placeholder="$t('verifyHeight')" />cm
|
||||||
</view>
|
</view>
|
||||||
<view class="Blue-box" v-if="userInfo.stage==3">
|
<view class="Blue-box" v-if="userInfo.stage==3">
|
||||||
{{$t("lastHead")}}:<input v-model="head" type="digit" :placeholder="$t('verifyHead')" />cm
|
{{$t("infoHead")}}:<input v-model="head" type="digit" :placeholder="$t('verifyHead')" />cm
|
||||||
</view>
|
</view>
|
||||||
<view class="Blue-btn Blue-close" @click="handleBack">{{$t("remeasure")}}</view>
|
<view class="Blue-btn Blue-close" @click="handleBack">{{$t("remeasure")}}</view>
|
||||||
<view class="Blue-btn" @click="handleGetMeasure">{{$t("SaveResult")}}</view>
|
<view class="Blue-btn" @click="handleGetMeasure">{{$t("SaveResult")}}</view>
|
||||||
|
|
@ -142,7 +142,7 @@
|
||||||
that.$store.commit("changeBluetoothValue", {
|
that.$store.commit("changeBluetoothValue", {
|
||||||
type: 1,
|
type: 1,
|
||||||
isConnectStatus: 2,
|
isConnectStatus: 2,
|
||||||
bleTipsText:that.$t("linkBluetoothSuccess"),
|
bleTipsText: that.$t("linkBluetoothSuccess"),
|
||||||
})
|
})
|
||||||
uni.notifyBLECharacteristicValueChange({
|
uni.notifyBLECharacteristicValueChange({
|
||||||
deviceId: that.deviceId,
|
deviceId: that.deviceId,
|
||||||
|
|
@ -379,6 +379,7 @@
|
||||||
.weight {
|
.weight {
|
||||||
font-size: 42px;
|
font-size: 42px;
|
||||||
color: #000;
|
color: #000;
|
||||||
|
margin-right: 10px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -405,13 +406,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.status {
|
.status {
|
||||||
width: 70%;
|
width: calc(100% - 30px);
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
height: 35px;
|
height: 35px;
|
||||||
line-height: 35px;
|
line-height: 35px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
margin: 15px auto;
|
margin: 15px;
|
||||||
background-color: #ffdda6;
|
background-color: #ffdda6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,10 @@
|
||||||
<view class="Blue">
|
<view class="Blue">
|
||||||
<view class="h4">{{$t("measureResultTips")}}</view>
|
<view class="h4">{{$t("measureResultTips")}}</view>
|
||||||
<view class="Blue-box">
|
<view class="Blue-box">
|
||||||
{{$t("nowHeight")}}:<text>{{height}}{{unit}}</text>
|
{{$t("infoHeight")}}:<text>{{height}}{{unit}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="Blue-box">
|
<view class="Blue-box">
|
||||||
{{$t("lastWeight")}}:<input v-model="weight" type="digit" :placeholder="$t('verifyWeight')" />kg
|
{{$t("infoWeight")}}:<input v-model="weight" type="digit" :placeholder="$t('verifyWeight')" />kg
|
||||||
</view>
|
</view>
|
||||||
<view class="Blue-btn Blue-close" @click="handleHeight">{{$t("remeasure")}}</view>
|
<view class="Blue-btn Blue-close" @click="handleHeight">{{$t("remeasure")}}</view>
|
||||||
<view class="Blue-btn" @click="handleGetMeasure">{{$t("SaveResult")}}</view>
|
<view class="Blue-btn" @click="handleGetMeasure">{{$t("SaveResult")}}</view>
|
||||||
|
|
@ -116,7 +116,7 @@
|
||||||
that.$store.commit("changeBluetoothValue", {
|
that.$store.commit("changeBluetoothValue", {
|
||||||
type: 1,
|
type: 1,
|
||||||
isConnectStatus: 2,
|
isConnectStatus: 2,
|
||||||
bleTipsText: $t("linkBluetoothSuccess"),
|
bleTipsText: that.$t("linkBluetoothSuccess"),
|
||||||
})
|
})
|
||||||
uni.notifyBLECharacteristicValueChange({
|
uni.notifyBLECharacteristicValueChange({
|
||||||
deviceId: that.deviceId,
|
deviceId: that.deviceId,
|
||||||
|
|
@ -178,7 +178,7 @@
|
||||||
that.height2 = data
|
that.height2 = data
|
||||||
that.height = data
|
that.height = data
|
||||||
}
|
}
|
||||||
that.text = that.$t("heightText") + that.height + that.unit
|
that.text = that.$t("heightText") + ':' + that.height + that.unit
|
||||||
that.isHeight = true
|
that.isHeight = true
|
||||||
}
|
}
|
||||||
console.log("G02", value, unit, data, that.height, that.height2)
|
console.log("G02", value, unit, data, that.height, that.height2)
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,10 @@
|
||||||
<view class="Blue">
|
<view class="Blue">
|
||||||
<view class="h4">{{$t("measureResultTips")}}</view>
|
<view class="h4">{{$t("measureResultTips")}}</view>
|
||||||
<view class="Blue-box">
|
<view class="Blue-box">
|
||||||
{{$t("nowWeight")}}:<text>{{weight}}{{unit}}</text>
|
{{$t("infoWeight")}}:<text>{{weight}}{{unit}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="Blue-box">
|
<view class="Blue-box">
|
||||||
{{$t("lastHeight")}}:<input v-model="height" type="digit" :placeholder="$t('verifyHeight')" />cm
|
{{$t("infoHeight")}}:<input v-model="height" type="digit" :placeholder="$t('verifyHeight')" />cm
|
||||||
</view>
|
</view>
|
||||||
<view class="Blue-btn Blue-close" @click="handleBack">{{$t("remeasure")}}</view>
|
<view class="Blue-btn Blue-close" @click="handleBack">{{$t("remeasure")}}</view>
|
||||||
<view class="Blue-btn" @click="handleGetMeasure">{{$t("SaveResult")}}</view>
|
<view class="Blue-btn" @click="handleGetMeasure">{{$t("SaveResult")}}</view>
|
||||||
|
|
@ -69,7 +69,6 @@
|
||||||
isConnectStatus: 1,
|
isConnectStatus: 1,
|
||||||
bleTipsText: that.$t("ConnectionTimeout"),
|
bleTipsText: that.$t("ConnectionTimeout"),
|
||||||
})
|
})
|
||||||
that.$store.commit("changehomeCard", 0);
|
|
||||||
that.$ble.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
that.$ble.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
@ -120,9 +119,9 @@
|
||||||
data = data / 100
|
data = data / 100
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
that.text = that.$t("realTimeWeight") + data + that.unit
|
that.text = that.$t("realTimeWeight") + ':' + data + that.unit
|
||||||
if (type == "1") {
|
if (type == "1") {
|
||||||
that.text = that.$t("StableWeight") + data + that.unit
|
that.text = that.$t("StableWeight") + ':' + data + that.unit
|
||||||
that.imp = parseInt(value.substring(8, 12), 16) / 10
|
that.imp = parseInt(value.substring(8, 12), 16) / 10
|
||||||
that.deviceId = device.deviceId
|
that.deviceId = device.deviceId
|
||||||
that.weight = data
|
that.weight = data
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,10 @@
|
||||||
<view class="Blue">
|
<view class="Blue">
|
||||||
<view class="h4">{{$t("measureResultTips")}}</view>
|
<view class="h4">{{$t("measureResultTips")}}</view>
|
||||||
<view class="Blue-box">
|
<view class="Blue-box">
|
||||||
{{$t("nowWeight")}}:<text>{{weight}}{{unit}}</text>
|
{{$t("infoWeight")}}:<text>{{weight}}{{unit}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="Blue-box">
|
<view class="Blue-box">
|
||||||
{{$t("lastHeight")}}:<input v-model="height" type="digit" :placeholder="$t('verifyHeight')" />cm
|
{{$t("infoHeight")}}:<input v-model="height" type="digit" :placeholder="$t('verifyHeight')" />cm
|
||||||
</view>
|
</view>
|
||||||
<view class="Blue-btn Blue-close" @click="handleBack">{{$t("remeasure")}}</view>
|
<view class="Blue-btn Blue-close" @click="handleBack">{{$t("remeasure")}}</view>
|
||||||
<view class="Blue-btn" @click="handleGetMeasure">{{$t("SaveResult")}}</view>
|
<view class="Blue-btn" @click="handleGetMeasure">{{$t("SaveResult")}}</view>
|
||||||
|
|
@ -131,14 +131,14 @@
|
||||||
if (status == "0") {
|
if (status == "0") {
|
||||||
that.typeInfo = 0
|
that.typeInfo = 0
|
||||||
that.stopblue = false
|
that.stopblue = false
|
||||||
that.text = that.$t("realTimeWeight") + weight + that.unit
|
that.text = that.$t("realTimeWeight") + ':' + weight + that.unit
|
||||||
}
|
}
|
||||||
if (status == "1") {
|
if (status == "1") {
|
||||||
if (type == '1') {
|
if (type == '1') {
|
||||||
that.imp = parseInt(value.substring(8, 12), 16) / 10
|
that.imp = parseInt(value.substring(8, 12), 16) / 10
|
||||||
}
|
}
|
||||||
that.typeInfo = 1
|
that.typeInfo = 1
|
||||||
that.text = that.$t("StableWeight")+ weight + that.unit
|
that.text = that.$t("StableWeight") + ':' + weight + that.unit
|
||||||
that.weight = weight
|
that.weight = weight
|
||||||
that.stopblue = true
|
that.stopblue = true
|
||||||
that.$ble.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
that.$ble.stopBluetoothDevicesDiscovery() //取消蓝牙搜索
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,10 @@
|
||||||
<view class="Blue">
|
<view class="Blue">
|
||||||
<view class="h4">{{$t("measureResultTips")}}</view>
|
<view class="h4">{{$t("measureResultTips")}}</view>
|
||||||
<view class="Blue-box">
|
<view class="Blue-box">
|
||||||
{{$t("nowWeight")}}:<text>{{weight}}{{unit}}</text>
|
{{$t("infoWeight")}}:<text>{{weight}}{{unit}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="Blue-box">
|
<view class="Blue-box">
|
||||||
{{$t("lastHeight")}}:<input v-model="height" type="digit" :placeholder="$t('verifyHeight')" />cm
|
{{$t("infoHeight")}}:<input v-model="height" type="digit" :placeholder="$t('verifyHeight')" />cm
|
||||||
</view>
|
</view>
|
||||||
<view class="Blue-btn Blue-close" @click="handleBack">{{$t("remeasure")}}</view>
|
<view class="Blue-btn Blue-close" @click="handleBack">{{$t("remeasure")}}</view>
|
||||||
<view class="Blue-btn" @click="handleGetMeasure">{{$t("SaveResult")}}</view>
|
<view class="Blue-btn" @click="handleGetMeasure">{{$t("SaveResult")}}</view>
|
||||||
|
|
@ -104,11 +104,11 @@
|
||||||
if (type == "d") {
|
if (type == "d") {
|
||||||
that.typeInfo = 0
|
that.typeInfo = 0
|
||||||
that.stopblue = false
|
that.stopblue = false
|
||||||
that.text = that.$t("realTimeWeight") + weight + 'kg'
|
that.text = that.$t("realTimeWeight") + ':' + weight + 'kg'
|
||||||
}
|
}
|
||||||
if (type == "e") {
|
if (type == "e") {
|
||||||
that.typeInfo = 1
|
that.typeInfo = 1
|
||||||
that.text = that.$t("StableWeight") + weight + 'kg'
|
that.text = that.$t("StableWeight") + ':' + weight + 'kg'
|
||||||
that.imp = !isNaN(type2) ? parseInt(value.substring(6, 10), 16) : ''
|
that.imp = !isNaN(type2) ? parseInt(value.substring(6, 10), 16) : ''
|
||||||
that.weight = weight
|
that.weight = weight
|
||||||
that.stopblue = true
|
that.stopblue = true
|
||||||
|
|
|
||||||
|
|
@ -332,6 +332,7 @@
|
||||||
.weight {
|
.weight {
|
||||||
font-size: 42px;
|
font-size: 42px;
|
||||||
color: #000;
|
color: #000;
|
||||||
|
margin-right: 10px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -358,13 +359,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.status {
|
.status {
|
||||||
width: 70%;
|
width: calc(100% - 30px);
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
height: 35px;
|
height: 35px;
|
||||||
line-height: 35px;
|
line-height: 35px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
margin: 15px auto;
|
margin: 15px;
|
||||||
background-color: #ffdda6;
|
background-color: #ffdda6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,19 +3,19 @@
|
||||||
<view class="cardList">
|
<view class="cardList">
|
||||||
<view class="caritem" @click="handleNavTol('/pageTwo/charts/charts')">
|
<view class="caritem" @click="handleNavTol('/pageTwo/charts/charts')">
|
||||||
<image src="/static/q5.png"></image>
|
<image src="/static/q5.png"></image>
|
||||||
<view>{{$t('titleCharts')}}</view>
|
<view class="text_c">{{$t('titleCharts')}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="caritem" @click="handleNavTol('/pageTwo/compk/contrast')">
|
<view class="caritem" @click="handleNavTol('/pageTwo/compk/contrast')">
|
||||||
<image src="/static/q3.png"></image>
|
<image src="/static/q3.png"></image>
|
||||||
<view>{{$t('titleContrast')}}</view>
|
<view class="text_c">{{$t('titleContrast')}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="caritem" @click="handlerRecord">
|
<view class="caritem" @click="handlerRecord">
|
||||||
<image src="/static/q7.png"></image>
|
<image src="/static/q7.png"></image>
|
||||||
<view>{{$t('addRecord')}}</view>
|
<view class="text_c">{{$t('addRecord')}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="caritem" @click="handleNavTol('/pageTwo/history/history')">
|
<view class="caritem" @click="handleNavTol('/pageTwo/history/history')">
|
||||||
<image src="/static/q8.png"></image>
|
<image src="/static/q8.png"></image>
|
||||||
<view>{{$t('HistoricalRcord')}}</view>
|
<view class="text_c">{{$t('HistoricalRcord')}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
@ -40,11 +40,8 @@
|
||||||
<view class="title">{{name}}</view>
|
<view class="title">{{name}}</view>
|
||||||
<!-- 项目内容 -->
|
<!-- 项目内容 -->
|
||||||
<view class="editem">
|
<view class="editem">
|
||||||
<view class="left">{{$t('TimeSpent')}}</view>
|
<input type="number" v-model="number" :placeholder="$t('verifyRecord')">
|
||||||
<view class="right">
|
<text>{{$t('minutes')}}</text>
|
||||||
<input type="number" v-model="number" :placeholder="$t('verifyRecord')">
|
|
||||||
<text style="width: 60px;">{{$t('minutes')}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="btn close" @click="onTap()">{{$t('btnSancellation')}}</view>
|
<view class="btn close" @click="onTap()">{{$t('btnSancellation')}}</view>
|
||||||
<view class="btn" @click="handlepublicmeasure">{{$t('btnConfirm')}}</view>
|
<view class="btn" @click="handlepublicmeasure">{{$t('btnConfirm')}}</view>
|
||||||
|
|
@ -73,7 +70,7 @@
|
||||||
record,
|
record,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(['user', "CardList"]),
|
...mapState(['user', "CardList", "familayList"]),
|
||||||
endDate() {
|
endDate() {
|
||||||
return this.$tools.getDate("start")
|
return this.$tools.getDate("start")
|
||||||
},
|
},
|
||||||
|
|
@ -81,7 +78,6 @@
|
||||||
return this.$tools.GetDateStr(-90);
|
return this.$tools.GetDateStr(-90);
|
||||||
},
|
},
|
||||||
cardList() {
|
cardList() {
|
||||||
console.log("11111111111111",this.CardList)
|
|
||||||
return this.CardList
|
return this.CardList
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -94,9 +90,19 @@
|
||||||
methods: {
|
methods: {
|
||||||
// 手动
|
// 手动
|
||||||
handlerRecord() {
|
handlerRecord() {
|
||||||
|
let that = this
|
||||||
|
if (!that.familayList.length) {
|
||||||
|
that.$tools.msg(that.$t("msgAddUser"))
|
||||||
|
return
|
||||||
|
}
|
||||||
this.$store.commit('changeTsPublicRecord', true)
|
this.$store.commit('changeTsPublicRecord', true)
|
||||||
},
|
},
|
||||||
handleNavItem(ite) {
|
handleNavItem(ite) {
|
||||||
|
let that = this
|
||||||
|
if (!that.familayList.length) {
|
||||||
|
that.$tools.msg(that.$t("msgAddUser"))
|
||||||
|
return
|
||||||
|
}
|
||||||
if (ite.page_jump) {
|
if (ite.page_jump) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: ite.page_jump
|
url: ite.page_jump
|
||||||
|
|
@ -108,6 +114,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleNavTol(url) {
|
handleNavTol(url) {
|
||||||
|
let that = this
|
||||||
|
if (!that.familayList.length) {
|
||||||
|
that.$tools.msg(that.$t("msgAddUser"))
|
||||||
|
return
|
||||||
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: url
|
url: url
|
||||||
})
|
})
|
||||||
|
|
@ -159,10 +170,11 @@
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
margin: 10px 15px;
|
margin: 10px 15px;
|
||||||
padding: 10px;
|
padding: 10px 0;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
|
||||||
.caritem {
|
.caritem {
|
||||||
|
width: 25%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
@ -237,4 +249,11 @@
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.editem {
|
||||||
|
text {
|
||||||
|
width: 30%;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view v-else class="content_box">
|
<view v-else class="content_box">
|
||||||
<!-- 每日摄入 -->
|
<!-- 每日摄入 -->
|
||||||
<view class="box" v-if="user.aud_id!=''">
|
<view class="box" v-if="userList.length">
|
||||||
<!-- 日期选择 -->
|
<!-- 日期选择 -->
|
||||||
<view class="data">
|
<view class="data">
|
||||||
<picker mode="date" fields="day" :end="endDate" @change="changeClickDate"
|
<picker mode="date" fields="day" :end="endDate" @change="changeClickDate"
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 称重 -->
|
<!-- 称重 -->
|
||||||
<view class="blue-tooth" v-if="user.aud_id!=''&& isBle">
|
<view class="blue-tooth" v-if="userList.length && isBle">
|
||||||
<blue-tooth :btnType="btnType"></blue-tooth>
|
<blue-tooth :btnType="btnType"></blue-tooth>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
@ -130,12 +130,9 @@
|
||||||
</view> -->
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
<!-- m没有成员时先添加成员 -->
|
<!-- m没有成员时先添加成员 -->
|
||||||
<view v-else class="list2" @click="handleEditUser()">
|
<view class="nolist" v-else @click="handleEditUser()">
|
||||||
<view class="nolist">
|
<image src="/static/none.png"></image>
|
||||||
<image src="/static/none.png"></image>
|
<text>{{$t("msgAddUser")}}</text>
|
||||||
<text>{{$t('msgAddUser')}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="btn">{{$t('ImproveInformation')}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
@ -241,10 +238,13 @@
|
||||||
qiunDataCharts
|
qiunDataCharts
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(["configInfo", "user", "countFoodInfo", "bleValue"]),
|
...mapState(["configInfo", "user", "familayList", "countFoodInfo", "bleValue"]),
|
||||||
info() {
|
info() {
|
||||||
return this.user
|
return this.user
|
||||||
},
|
},
|
||||||
|
userList() {
|
||||||
|
return this.familayList
|
||||||
|
},
|
||||||
kcalVal() {
|
kcalVal() {
|
||||||
return this.configInfo.kcal_data
|
return this.configInfo.kcal_data
|
||||||
},
|
},
|
||||||
|
|
@ -346,7 +346,7 @@
|
||||||
// 完善资料
|
// 完善资料
|
||||||
handleEditUser() {
|
handleEditUser() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/body/my/userInfo.vue"
|
url: "/body/my/userInfo"
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleDrawerClose() {
|
handleDrawerClose() {
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
{{$t("msgLoginTips")}}
|
{{$t("msgLoginTips")}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="token&&Measure.top_list.length" class="body">
|
<view v-if="token&&userList.length&&Measure.top_list.length" class="body">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<view class="info box_shadow" v-for="(ite,ind) in Measure.top_list"
|
<view class="info box_shadow" v-for="(ite,ind) in Measure.top_list"
|
||||||
:style="{'backgroundColor':ite.bk_color}" @click="handelCurveDetailed">
|
:style="{'backgroundColor':ite.bk_color}" @click="handelCurveDetailed">
|
||||||
|
|
@ -48,7 +48,8 @@
|
||||||
<view class="weight">
|
<view class="weight">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="number"><text class="size26 bold">{{ite.value}}</text>{{ite.unit}}</view>
|
<view class="number"><text class="size26 bold">{{ite.value}}</text>{{ite.unit}}</view>
|
||||||
<view class="standard bold size16" :style="{'color':ite.standard_color}">{{ite.standard}}
|
<view class="standard bold size16 text_r" :style="{'color':ite.standard_color}">
|
||||||
|
{{ite.standard}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="charts" v-if="handTrue&&ite.curve_list.line.categories.length">
|
<view class="charts" v-if="handTrue&&ite.curve_list.line.categories.length">
|
||||||
|
|
@ -118,6 +119,7 @@
|
||||||
import {
|
import {
|
||||||
mapState
|
mapState
|
||||||
} from "vuex";
|
} from "vuex";
|
||||||
|
import messages from '@/language/index.js'
|
||||||
import drawer from "@/components/bodyIndex/drawer.vue"
|
import drawer from "@/components/bodyIndex/drawer.vue"
|
||||||
import record from '@/components/bodyIndex/record.vue';
|
import record from '@/components/bodyIndex/record.vue';
|
||||||
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue'
|
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue'
|
||||||
|
|
@ -183,13 +185,15 @@
|
||||||
return this.MeasureResult
|
return this.MeasureResult
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
async onLoad() {
|
||||||
let that = this
|
let that = this
|
||||||
uni.setNavigationBarTitle({
|
uni.setNavigationBarTitle({
|
||||||
title: this.$t('titleHealth'),
|
title: this.$t('titleHealth')
|
||||||
})
|
})
|
||||||
|
await that.$onLaunched;
|
||||||
|
console.log("shouyaonLoad", that.token, that.familayList.length)
|
||||||
that.token = uni.getStorageSync("token")
|
that.token = uni.getStorageSync("token")
|
||||||
if (that.token && uni.getStorageSync('userid') && that.bleValue.isConnectStatus != 2) {
|
if (that.token && that.userList.length && that.bleValue.isConnectStatus != 2) {
|
||||||
that.$ble.openBluetoothAdapter()
|
that.$ble.openBluetoothAdapter()
|
||||||
}
|
}
|
||||||
that.$ble.onBLEConnectionStateChange()
|
that.$ble.onBLEConnectionStateChange()
|
||||||
|
|
@ -200,7 +204,7 @@
|
||||||
onPullDownRefresh() {
|
onPullDownRefresh() {
|
||||||
let that = this
|
let that = this
|
||||||
that.$tools.handleUserList()
|
that.$tools.handleUserList()
|
||||||
if (that.token && that.bleValue.isConnectStatus != 2) {
|
if (that.token && that.userList.length && that.bleValue.isConnectStatus != 2) {
|
||||||
that.$ble.openBluetoothAdapter()
|
that.$ble.openBluetoothAdapter()
|
||||||
}
|
}
|
||||||
that.$ble.onBLEConnectionStateChange()
|
that.$ble.onBLEConnectionStateChange()
|
||||||
|
|
|
||||||
|
|
@ -202,6 +202,8 @@
|
||||||
uni.setStorageSync('language', key)
|
uni.setStorageSync('language', key)
|
||||||
that.$store.commit('changeLocale', key)
|
that.$store.commit('changeLocale', key)
|
||||||
that.$store.dispatch("getHomeConfig")
|
that.$store.dispatch("getHomeConfig")
|
||||||
|
that.$store.dispatch("getCardAllList") // 全部卡片
|
||||||
|
that.$store.dispatch("getPublicRecord") // 卡片手动记录配置
|
||||||
that.$tools.handleUserList()
|
that.$tools.handleUserList()
|
||||||
that.handleTabBarItem()
|
that.handleTabBarItem()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
@ -307,22 +309,20 @@
|
||||||
.item {
|
.item {
|
||||||
width: auto;
|
width: auto;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
line-height: 50px;
|
|
||||||
height: 50px;
|
height: 50px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
width: 120px;
|
width: 50%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.right {
|
.right {
|
||||||
width: calc(100% - 120px);
|
width: 50%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -590,8 +590,9 @@
|
||||||
margin: 0 10px 0 0;
|
margin: 0 10px 0 0;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
padding: 0 5px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
width: 44px !important;
|
width: auto !important;
|
||||||
text-align: center !important;
|
text-align: center !important;
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1134,7 +1134,7 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
height: 45px;
|
height: 45px;
|
||||||
line-height: 45px;
|
margin-top: 15px;
|
||||||
font-size: 36rpx;
|
font-size: 36rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
@ -1209,7 +1209,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
width: 85px;
|
width: 50%;
|
||||||
background: #f7f7f7;
|
background: #f7f7f7;
|
||||||
padding: 7px 5px;
|
padding: 7px 5px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ export default new Vuex.Store({
|
||||||
foodWrite: "",
|
foodWrite: "",
|
||||||
foodunitList: json.unitArray,
|
foodunitList: json.unitArray,
|
||||||
foodType: 1, //食物称 1实时,2锁定 状态类型
|
foodType: 1, //食物称 1实时,2锁定 状态类型
|
||||||
bleTipsText: "搜索中", //蓝牙提示语
|
bleTipsText: '', //蓝牙提示语
|
||||||
isConnectStatus: 0, //蓝牙连接状态 0搜索中,1失败,2成功
|
isConnectStatus: 0, //蓝牙连接状态 0搜索中,1失败,2成功
|
||||||
},
|
},
|
||||||
// 计食器
|
// 计食器
|
||||||
|
|
@ -215,6 +215,8 @@ export default new Vuex.Store({
|
||||||
|
|
||||||
// 设置语言
|
// 设置语言
|
||||||
changeLocale(state, newData) {
|
changeLocale(state, newData) {
|
||||||
|
// let $t = messages[newData]
|
||||||
|
// state.bleValue.bleTipsText = $t.SearchBluetooth
|
||||||
state.setLocale = newData
|
state.setLocale = newData
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,6 @@ let deviceId = ""
|
||||||
let deviceName = ""
|
let deviceName = ""
|
||||||
let devicesList = []
|
let devicesList = []
|
||||||
let searchTimer = null
|
let searchTimer = null
|
||||||
let Language = $store.state.setLocale
|
|
||||||
let $t = messages[Language]
|
|
||||||
export default {
|
export default {
|
||||||
unitInstruction,
|
unitInstruction,
|
||||||
convertToGrams,
|
convertToGrams,
|
||||||
|
|
@ -31,6 +29,8 @@ function openBluetoothAdapter() {
|
||||||
devicesList = []
|
devicesList = []
|
||||||
deviceId = ""
|
deviceId = ""
|
||||||
deviceName = ""
|
deviceName = ""
|
||||||
|
let Language = uni.getStorageSync('language')
|
||||||
|
let $t = messages[Language]
|
||||||
clearTimeout(searchTimer);
|
clearTimeout(searchTimer);
|
||||||
uni.openBluetoothAdapter({
|
uni.openBluetoothAdapter({
|
||||||
success: e => {
|
success: e => {
|
||||||
|
|
@ -57,13 +57,15 @@ function openBluetoothAdapter() {
|
||||||
|
|
||||||
// 开始搜寻附近的蓝牙外围设备
|
// 开始搜寻附近的蓝牙外围设备
|
||||||
function startBluetoothDeviceDiscovery() {
|
function startBluetoothDeviceDiscovery() {
|
||||||
|
let Language = uni.getStorageSync('language')
|
||||||
|
let $t = messages[Language]
|
||||||
uni.startBluetoothDevicesDiscovery({
|
uni.startBluetoothDevicesDiscovery({
|
||||||
allowDuplicatesKey: true,
|
allowDuplicatesKey: true,
|
||||||
interval: 200, //上报设备的间隔
|
interval: 200, //上报设备的间隔
|
||||||
success: res => {
|
success: res => {
|
||||||
onBluetoothDeviceFound();
|
onBluetoothDeviceFound();
|
||||||
searchTimer = setTimeout(() => {
|
searchTimer = setTimeout(() => {
|
||||||
uni.stopBluetoothDevicesDiscovery()
|
stopBluetoothDevicesDiscovery()
|
||||||
if (!devicesList.length) {
|
if (!devicesList.length) {
|
||||||
clearTimeout(searchTimer);
|
clearTimeout(searchTimer);
|
||||||
$store.commit("changeBluetoothValue", {
|
$store.commit("changeBluetoothValue", {
|
||||||
|
|
@ -86,6 +88,8 @@ function startBluetoothDeviceDiscovery() {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function onBluetoothDeviceFound() {
|
function onBluetoothDeviceFound() {
|
||||||
|
let Language = uni.getStorageSync('language')
|
||||||
|
let $t = messages[Language]
|
||||||
uni.onBluetoothDeviceFound(res => {
|
uni.onBluetoothDeviceFound(res => {
|
||||||
res.devices.forEach(device => {
|
res.devices.forEach(device => {
|
||||||
if (!device.name && !device.localName) {
|
if (!device.name && !device.localName) {
|
||||||
|
|
@ -118,7 +122,6 @@ function onBluetoothDeviceFound() {
|
||||||
stopBluetoothDevicesDiscovery()
|
stopBluetoothDevicesDiscovery()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log("name", device.name)
|
|
||||||
if (device.name.toLowerCase().indexOf("g02") != -1 ||
|
if (device.name.toLowerCase().indexOf("g02") != -1 ||
|
||||||
device.name.toLowerCase().indexOf('ypc') != -1 ||
|
device.name.toLowerCase().indexOf('ypc') != -1 ||
|
||||||
device.name.toLowerCase().indexOf('da') != -1 ||
|
device.name.toLowerCase().indexOf('da') != -1 ||
|
||||||
|
|
@ -139,12 +142,14 @@ function onBluetoothDeviceFound() {
|
||||||
}
|
}
|
||||||
// 蓝牙过滤
|
// 蓝牙过滤
|
||||||
function Bluetoothfilter(device) {
|
function Bluetoothfilter(device) {
|
||||||
|
let Language = uni.getStorageSync('language')
|
||||||
|
let $t = messages[Language]
|
||||||
const foundDevices = devicesList
|
const foundDevices = devicesList
|
||||||
const idx = $tools.inArray(foundDevices, "deviceId", device.deviceId)
|
const idx = $tools.inArray(foundDevices, "deviceId", device.deviceId)
|
||||||
if (idx === -1) {
|
if (idx === -1) {
|
||||||
devicesList.push(device);
|
devicesList.push(device);
|
||||||
deviceId = device.deviceId
|
deviceId = device.deviceId
|
||||||
console.log("deviceName", device.name)
|
// console.log("deviceName", device.name)
|
||||||
// 广播体脂秤
|
// 广播体脂秤
|
||||||
if (device.name.toLowerCase().indexOf("pcl") != -1) {
|
if (device.name.toLowerCase().indexOf("pcl") != -1) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
@ -209,6 +214,8 @@ function Bluetoothfilter(device) {
|
||||||
}
|
}
|
||||||
// 排查设备
|
// 排查设备
|
||||||
function handleDevType(device) {
|
function handleDevType(device) {
|
||||||
|
let Language = uni.getStorageSync('language')
|
||||||
|
let $t = messages[Language]
|
||||||
$model.getCheckDevice({
|
$model.getCheckDevice({
|
||||||
mac: device.macAddr,
|
mac: device.macAddr,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
|
@ -229,6 +236,8 @@ function handleDevType(device) {
|
||||||
}
|
}
|
||||||
//连接设备
|
//连接设备
|
||||||
function createBLEConnection(serviceId) {
|
function createBLEConnection(serviceId) {
|
||||||
|
let Language = uni.getStorageSync('language')
|
||||||
|
let $t = messages[Language]
|
||||||
uni.createBLEConnection({
|
uni.createBLEConnection({
|
||||||
deviceId: deviceId,
|
deviceId: deviceId,
|
||||||
success: res => {
|
success: res => {
|
||||||
|
|
@ -249,6 +258,8 @@ function createBLEConnection(serviceId) {
|
||||||
* 获取设备的UUID
|
* 获取设备的UUID
|
||||||
*/
|
*/
|
||||||
function getBLEDeviceServices(serviceId) {
|
function getBLEDeviceServices(serviceId) {
|
||||||
|
let Language = uni.getStorageSync('language')
|
||||||
|
let $t = messages[Language]
|
||||||
let serviceList = [];
|
let serviceList = [];
|
||||||
uni.getBLEDeviceServices({
|
uni.getBLEDeviceServices({
|
||||||
deviceId: deviceId,
|
deviceId: deviceId,
|
||||||
|
|
@ -315,6 +326,8 @@ function getBLEDeviceServices(serviceId) {
|
||||||
* 断开蓝牙模块
|
* 断开蓝牙模块
|
||||||
*/
|
*/
|
||||||
function closeBluetoothAdapter() {
|
function closeBluetoothAdapter() {
|
||||||
|
let Language = uni.getStorageSync('language')
|
||||||
|
let $t = messages[Language]
|
||||||
uni.closeBluetoothAdapter({
|
uni.closeBluetoothAdapter({
|
||||||
success: res => {
|
success: res => {
|
||||||
clearTimeout(searchTimer);
|
clearTimeout(searchTimer);
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -397,7 +397,7 @@ var _default = {
|
||||||
that.showScanCodeDlg = false;
|
that.showScanCodeDlg = false;
|
||||||
that.showAutoSearchDlg = false;
|
that.showAutoSearchDlg = false;
|
||||||
that.activeType = ite;
|
that.activeType = ite;
|
||||||
that.weightKcal = ite.kcal;
|
that.weightKcal = Number(ite.kcal);
|
||||||
if (that.bleValue.serviceId != "") {
|
if (that.bleValue.serviceId != "") {
|
||||||
that.realTimeWeight(that.bleValue.foodWeight, that.bleValue.foodUnit);
|
that.realTimeWeight(that.bleValue.foodWeight, that.bleValue.foodUnit);
|
||||||
if (that.bleValue.foodType == 2 && Number(that.bleValue.foodWeight) > 0) {
|
if (that.bleValue.foodType == 2 && Number(that.bleValue.foodWeight) > 0) {
|
||||||
|
|
@ -426,6 +426,7 @@ var _default = {
|
||||||
food_list: list,
|
food_list: list,
|
||||||
time: that.time
|
time: that.time
|
||||||
}).then(function (res) {
|
}).then(function (res) {
|
||||||
|
console.log("饮食称重保存", res);
|
||||||
if (res.code != 0) return;
|
if (res.code != 0) return;
|
||||||
that.$store.dispatch("getCountFoodInfo", {
|
that.$store.dispatch("getCountFoodInfo", {
|
||||||
aud_id: that.user.aud_id,
|
aud_id: that.user.aud_id,
|
||||||
|
|
|
||||||
|
|
@ -268,13 +268,13 @@
|
||||||
background-color: #f0ae43;
|
background-color: #f0ae43;
|
||||||
}
|
}
|
||||||
.groupbtn .left.data-v-3f42cc7b {
|
.groupbtn .left.data-v-3f42cc7b {
|
||||||
width: 31%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.groupbtn .left .che.data-v-3f42cc7b {
|
.groupbtn .left .che.data-v-3f42cc7b {
|
||||||
width: 80rpx;
|
width: 100rpx;
|
||||||
height: 80rpx;
|
height: 100rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.groupbtn .left .che text.data-v-3f42cc7b {
|
.groupbtn .left .che text.data-v-3f42cc7b {
|
||||||
|
|
@ -298,6 +298,9 @@
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
.groupbtn .left .type.data-v-3f42cc7b {
|
||||||
|
margin-left: 5px;
|
||||||
|
}
|
||||||
.groupbtn .left .type image.data-v-3f42cc7b {
|
.groupbtn .left .type image.data-v-3f42cc7b {
|
||||||
width: 15px;
|
width: 15px;
|
||||||
height: 15px;
|
height: 15px;
|
||||||
|
|
|
||||||
|
|
@ -509,8 +509,9 @@
|
||||||
margin: 0 10px 0 0;
|
margin: 0 10px 0 0;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
padding: 0 5px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
width: 44px !important;
|
width: auto !important;
|
||||||
text-align: center !important;
|
text-align: center !important;
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -509,8 +509,9 @@
|
||||||
margin: 0 10px 0 0;
|
margin: 0 10px 0 0;
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
padding: 0 5px;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
width: 44px !important;
|
width: auto !important;
|
||||||
text-align: center !important;
|
text-align: center !important;
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue