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