对接中文版

This commit is contained in:
qcl_123 2026-04-11 11:37:58 +08:00
parent 485e2f72c5
commit cb877e3811
356 changed files with 6230 additions and 6727 deletions

221
App.vue
View File

@ -1,132 +1,109 @@
<script>
let platform = ""
let SystemVersion = ""
export default {
data() {
return {}
},
onLaunch: function() {
let that = this
// apk
// #ifdef APP-PLUS||APP
uni.getSystemInfo({
success(e) {
platform = e.platform
that.$store.commit('changePhoneInfo', {
platform: e.platform
})
}
})
if (platform === 'ios') { // ios
uni.onNetworkStatusChange(function(res) {
if (res.isConnected == true) {
that.handleoginversion()
}
});
}
plus.runtime.getProperty(plus.runtime.appid, function(info) {
uni.setStorageSync('VERSION', info.version)
SystemVersion = info.version
export default {
data() {
return {}
},
onLaunch: function() {
let that = this
// apk
// #ifdef APP-PLUS||APP
uni.getSystemInfo({
success(e) {
platform = e.platform
that.$store.commit('changePhoneInfo', {
info: info
platform: e.platform
})
})
// #endif
that.handleoginversion()
console.log('App Launch')
},
onShow: function() {
uni.switchTab({
url: "/pages/index/index"
})
},
onHide: function() {
console.log('App Hide')
// #ifdef APP-PLUS||APP
uni.offNetworkStatusChange(function(res) {
console.log("取消网络监听")
})
// #endif
},
methods: {
//
handleoginversion() {
let that = this
that.$model.getLoginVersion({}).then(res => {
// let language = res.data.language == "zh" ? 'zh-Hans' : res.data.language
let language = "zh"
uni.setLocale(language)
that.$i18n.locale = language
that.$store.commit('changeLocale', language)
uni.setStorageSync('language', language)
that.$store.dispatch("getHomeConfig") //
if (res.code == 0) {
that.$tools.handleUserList()
} else {
uni.setStorageSync('token', "")
uni.setStorageSync('aan_id', null)
// #ifdef APP-PLUS||APP
setTimeout(() => {
uni.reLaunch({
url: '/body/login/login',
})
}, 500);
// #endif
}
// #ifdef APP-PLUS||APP
that.$store.commit('changePhoneInfo', {
versionUrl: res.data
})
//
let version = that.$tools.compareVersions(SystemVersion, res.data.version)
console.log("是否登录及版本号", res, res.data.version, SystemVersion, version)
if (version == -1) { // 01-1
uni.showModal({
title: '发现新版本',
content: '检查到新版本' + res.data.version + ',是否更新?',
cancelText: that.$t('btnSancellation'),
confirmText: that.$t('btnConfirm'),
success: (modalRes) => {
if (modalRes.confirm) { //
if (platform === 'android') { //
uni.setStorageSync('VERSION', res.data.version)
uni.navigateTo({
url: "/body/me/about"
})
} else { //ios
plus.runtime.launchApplication({
action: `itms-apps://itunes.apple.com/cn/app/id6654906497?mt=8`
})
}
} else {
that.$tools.msg("稍后可在'关于我们'内更新程序!")
}
}
});
}
// #endif
}).catch(error => {
// console.error('Error fetching data:', error);
});
},
// handleTabBarItem() {
// let that = this
// uni.setTabBarItem({
// index: 0,
// text: that.$t('titleHome')
// })
// uni.setTabBarItem({
// index: 1,
// text: that.$t('titleCount')
// })
// uni.setTabBarItem({
// index: 2,
// text: that.$t('titleMe')
// })
// }
}
})
if (platform === 'ios') { // ios
uni.onNetworkStatusChange(function(res) {
if (res.isConnected == true) {
that.handleoginversion()
}
});
}
plus.runtime.getProperty(plus.runtime.appid, function(info) {
uni.setStorageSync('VERSION', info.version)
SystemVersion = info.version
that.$store.commit('changePhoneInfo', {
info: info
})
})
// #endif
that.handleoginversion()
console.log('App Launch')
},
onShow: function() {
let that = this
that.handleTabBarItem()
uni.switchTab({
url: "/pages/index/index"
})
},
onHide: function() {
console.log('App Hide')
// #ifdef APP-PLUS||APP
uni.offNetworkStatusChange(function(res) {
console.log("取消网络监听")
})
// #endif
},
methods: {
//
handleoginversion() {
let that = this
that.$model.getLoginVersion({}).then(res => {
let language = res.data.language
uni.setLocale(language)
that.$i18n.locale = language
that.$store.commit('changeLocale', language)
uni.setStorageSync('language', language)
that.$store.dispatch("getCardAllList") //
that.$store.dispatch("getPublicRecord") //
that.$store.dispatch("getHomeConfig") //
if (res.code == 0) {
that.$tools.handleUserList()
} else {
uni.setStorageSync('token', "")
uni.setStorageSync('aan_id', null)
setTimeout(() => {
uni.reLaunch({
url: '/body/login/login',
})
}, 500);
}
that.$store.commit('changePhoneInfo', {
versionUrl: res.data
})
return that.$tools.compareVersions(SystemVersion, res.data.version)
}).catch(error => {
// console.error('Error fetching data:', error);
});
},
handleTabBarItem() {
let that = this
uni.setTabBarItem({
index: 0,
text: that.$t('titleHealth')
})
uni.setTabBarItem({
index: 1,
text: that.$t('titleDiet')
})
uni.setTabBarItem({
index: 2,
text: that.$t('titleExercise')
})
uni.setTabBarItem({
index: 3,
text: that.$t('titleMe')
})
},
}
}
</script>
<style lang="scss">

View File

@ -169,6 +169,9 @@
onLoad(options) {
let that = this
that.handleList()
uni.setNavigationBarTitle({
title: this.$t('titleEveryMeal')
})
},
methods: {
handleList() {

View File

@ -247,6 +247,8 @@
let that = this
uni.showModal({
content: that.$t("WhetherTodelete") + item.name,
cancelText: that.$t("btnSancellation"),//
confirmText: that.$t("btnConfirm"),//
success: (res) => {
if (res.confirm) {
this.$model.delCEatAction({

View File

@ -450,6 +450,8 @@
let that = this
uni.showModal({
content: this.$t('WhetherTodelete') + ite.name,
cancelText: that.$t("btnSancellation"),//
confirmText: that.$t("btnConfirm"),//
success: (res) => {
if (res.confirm) {
this.$model.delCEatAction({

View File

@ -69,6 +69,9 @@
}
},
onLoad() {
uni.setNavigationBarTitle({
title: this.$t('titleSet')
});
this.handleList()
},
components: {

View File

@ -21,7 +21,7 @@
</view>
<view class="title title2">
<view class="">菜谱类型</view>
<view class="">{{$t('RecipeType')}}</view>
<view>{{menu[cookIndex].name}}</view>
</view>
<!-- 食材 -->
@ -36,7 +36,7 @@
</view>
<view class="close" @click="handleWeight">
<image src="../../static/lianjie.png"></image>
连接测量
{{$t('linkWeighing')}}
</view>
</view>
<view class="foodlist">
@ -71,7 +71,7 @@
<view class="item" @click="handleCang()">
<uni-icons :type="info.collect_status=='yes'?'heart-filled':'heart'" size="20"
:color="info.collect_status=='yes'?'red':'#999'"></uni-icons>
<text>收藏</text>
<text>{{$t('Collection')}}</text>
</view>
<!-- <view class="item" v-if="type=='我的菜谱'" @click="handleEdit()">
<icon class="iconfont icon-bianji"></icon>
@ -89,12 +89,12 @@
<icon class="iconfont icon-error" @click='isBle = false'></icon>
<view class="foodlist" @click.stop>
<view class="text">
<text style="width: 30%;">食材</text>
<text style="width: 18%;">建议</text>
<text style="width: 30%;">{{$t('Ingredients')}}</text>
<text style="width: 18%;">{{$t('Suggestions')}}</text>
<view class="kcal">
<text>重量</text>
<text>热量</text>
<text>重秤</text>
<text>{{$t('Weight')}}</text>
<text>{{$t('Calories')}}</text>
<text>{{$t('remeasure2')}}</text>
</view>
</view>
<view class="item" v-for="(ite,ind) in info.tags[0].list" :key="ind"
@ -105,7 +105,7 @@
{{ite.weight}}{{ite.unit}}
</view>
<view class="kcal" v-if="activeType.id&&activeType.id ==ite.id&&!ite.newweight">
正在测量...
{{$t('CurrentlyWeighing')}}...
</view>
<view class="kcal" v-else>
<view class="num" v-if="ite.newweight">
@ -114,8 +114,7 @@
<view class="num" v-if="ite.newkcal">
{{ite.newkcal}}
</view>
<view class="refreshempty
" @click="handlechongzhi(ite,ind)" v-if="ite.newweight">
<view class="refreshempty" @click="handlechongzhi(ite,ind)" v-if="ite.newweight">
<uni-icons type="refreshempty" size="22"></uni-icons>
</view>
</view>
@ -131,14 +130,14 @@
</view>
<view class="saveFood" v-if="showSaveFood">
<view class="saveFoodInner">
<view class="title">是否保存至计食为今日饮食</view>
<view class="title">{{$t('TodayMeals')}}</view>
<view class="types">
<view class="type-item" :class="{'active':selectSaveType == index}" v-for="(item,index) in foodItem"
:key="index" @click="selectSaveType=index">{{item.name}}</view>
</view>
<view class="btn-wrap">
<view class="confirm" @click="confirmSaveFood">确定</view>
<view class="cancel" @click="showSaveFood=false">取消</view>
<view class="confirm" @click="confirmSaveFood">{{$t('Save')}}</view>
<view class="cancel" @click="showSaveFood=false">{{$t('btnSancellation')}}</view>
</view>
</view>
</view>
@ -187,14 +186,9 @@
},
onLoad(options) {
let that = this
let info = {}
if (options && options.info) {
info = JSON.parse(options.info)
that.type = info.pageName
that.info = info
} else {
that.type = options.title
}
uni.setNavigationBarTitle({
title: that.$t('titleDetail')
});
that.id = options.id
that.handleHomeInfo(options.id)
},
@ -303,7 +297,7 @@
time: that.$tools.getDate("start")
})
uni.showToast({
title: '保存成功',
title:that.$t("SavedSuccessfully"),
icon: 'success'
})
that.$store.commit("changehomeCard", 1);
@ -332,30 +326,6 @@
url: "/Food/me/menuEdit?info=" + JSON.stringify(this.info)
})
},
handledel() {
let that = this
uni.showModal({
title: '友情提示',
content: '是否删除当前菜谱?',
success: function(res) {
if (res.confirm) {
that.$model.getMyCookbookDel({
aud_id: that.user.aud_id,
cookbook_id: that.id,
}).then((res) => {
if (res.code != 0) {
that.$tools.msg(res.message)
return
}
that.$tools.msg("删除成功")
uni.navigateBack()
})
} else if (res.cancel) {
that.$tools.msg("您已取消操作!");
}
},
})
}
}
}
</script>

View File

@ -22,10 +22,10 @@
</view>
</view>
</view>
<view class="endtext" v-if="(!lastPage || page >= lastPage)&&menuList.length"> 到底了看看别的吧 </view>
<view class="endtext" v-if="(!lastPage || page >= lastPage)&&menuList.length"> {{$t('msgBottom')}} </view>
<view v-if="!menuList.length" class="nolist">
<icon class="iconfont icon-wancan"></icon>
<text>还没有记录哦</text>
<image src="../../static/none.png"></image>
<text>{{$t('msgNoMoreData')}}</text>
</view>
</view>
</template>
@ -54,11 +54,10 @@
return this.user
}
},
onLoad(option) {
onLoad() {
let that = this
that.type = option.pageName
uni.setNavigationBarTitle({
title: option.pageName
title: that.$t('infoMyCollection')
});
},
@ -73,7 +72,7 @@
let that = this
if (!this.lastPage || this.page >= this.lastPage) {
uni.showToast({
title: '没有更多数据!',
title: that.$t('noMoreData'),
icon: 'none'
})
return
@ -97,7 +96,7 @@
//
handleDetail(id) {
uni.navigateTo({
url: "/Food/me/menudetail?id=" + id + '&title=' + this.type
url: "/Food/me/menudetail?id=" + id
})
},
//

View File

@ -1,7 +1,7 @@
<template>
<view class="content">
<!-- 列表 -->
<view class="box">
<view class="box" v-if="infoList.length">
<view class="list" v-for="(item,ind) in infoList" :key="ind" @click="handleDetail(item)">
<view class="time">{{item.time}}</view>
<view class="kcal">
@ -14,11 +14,12 @@
</view>
</view>
<view class="endtext" v-if="!lastPage || page >= lastPage"> {{$t('msgBottom')}} </view>
<view v-if="!infoList.length" class="nolist">
<icon class="iconfont icon-wancan"></icon>
<text>{{$t('msgNoMoreData')}}</text>
</view>
</view>
<view v-if="!infoList.length" class="nolist">
<image src="../../static/none.png"></image>
<text>{{$t('msgNoMoreData')}}</text>
</view>
</view>
</template>
@ -83,8 +84,8 @@
aud_id: that.user.aud_id,
time: item.time
})
uni.navigateTo({
url: '/Food/me/recordetail'
uni.switchTab({
url: '/pages/count/count'
});
}

View File

@ -1,35 +0,0 @@
<template>
<view>
<food></food>
</view>
</template>
<script>
import {
mapState
} from "vuex";
import food from "@/components/foodIndex/foodHome.vue"
export default {
data() {
return {}
},
components: {
food,
},
computed: {
...mapState(["user", "countFoodInfo"]),
foodInfo() {
return this.countFoodInfo
}
},
onLoad(options) {
let that = this
},
methods: {
}
}
</script>
<style scoped lang="scss">
</style>

View File

@ -13,16 +13,17 @@
<text class="overflow">{{it.create_user_nickname}}</text>
</view>
<view class="zan">
<uni-icons :type="it.is_me_like_it=='yes'?'heart-filled':'heart'" size="20" :color="it.is_me_like_it=='yes'?'red':'#999'"></uni-icons>
<uni-icons :type="it.is_me_like_it=='yes'?'heart-filled':'heart'" size="20"
:color="it.is_me_like_it=='yes'?'red':'#999'"></uni-icons>
<text>{{it.likes_num}}</text>
</view>
</view>
</view>
</view>
<view class="endtext" v-if="!lastPage || Page >= lastPage"> 到底了看看别的吧 </view>
<view class="endtext" v-if="!lastPage || Page >= lastPage"> {{$t('msgBottom')}} </view>
<view v-if="!food_search_list.length" class="nolist">
<icon class="iconfont icon-wancan"></icon>
<text>还没有记录哦</text>
<text>{{$t('msgNoMoreData')}}</text>
</view>
</view>
</template>
@ -64,7 +65,7 @@
console.log("onReachBottom", this.lastPage)
if (!this.lastPage || this.Page >= this.lastPage) {
uni.showToast({
title: '没有更多数据!',
title: that.$t('noMoreData'),
icon: 'none'
})
return
@ -89,7 +90,7 @@
handleDetail(id) {
let that = this
if (that.user.aud_id == '') {
that.$tools.msg("完善资料后查看更多")
that.$tools.msg(that.$t("ImproveData"))
return
}
uni.navigateTo({

View File

@ -1,7 +1,7 @@
<template>
<view class="content">
<view class="search">
<input type="text" v-model="search_value" placeholder="输入关键字匹配食谱" />
<input type="text" v-model="search_value" :placeholder="$t('KeyWords')" />
<icon v-if="search_value" class="iconfont icon-error" @click="handlecolse"></icon>
<image src="/static/28.png" @click="handleSearchHistory(search_value)"></image>
</view>
@ -10,7 +10,7 @@
<!-- 历史搜索 -->
<view v-if="history_food.length" class="search-history">
<view class="title">
<view class="quan mr-5"></view>历史搜索
<view class="quan mr-5"></view>{{$t("HistoricalSearch")}}
</view>
<view class="button-container" @click="showAll =! showAll" v-if="history_food.length>8">
<image :src="showAll?'/static/arrow-up.png':'/static/arrow-down.png'"></image>
@ -26,7 +26,7 @@
<!-- 猜你想搜 -->
<view class="popular-container">
<view class="title">
<view class="quan mr-5"></view>猜你想搜
<view class="quan mr-5"></view>{{$t("wantSearch")}}
</view>
<view class="popular-food-item" v-for="(ite,index) in popular_food" :key="index">
<view class="food-title">{{ite.title}}</view>
@ -39,13 +39,13 @@
</view>
</view>
<!-- 语音 -->
<view class="footBtn">
<!-- <view class="footBtn">
<view class="mic-icon" @touchstart="onVoiceTouchStart" @touchend="onVoiceTouchEnd"
@touchcancel="cancelRecording">
<uni-icons type="mic-filled" size="20" color="#fff"></uni-icons>
语音搜索
</view>
</view>
</view> -->
<!-- 语音弹框 -->
<view class="wrapper" v-if="showAutoSearchDlg">
<view class="auto-search-dialog">
@ -68,7 +68,7 @@
import {
mapState
} from "vuex";
const plugin = requirePlugin("WechatSI")
// const plugin = requirePlugin("WechatSI")
export default {
data() {
return {
@ -91,19 +91,22 @@
// return this.configInfo.search_history.cookbook
// }
},
onShow() {
onLoad() {
this.handleList()
uni.setNavigationBarTitle({
title: this.$t('Search')
})
},
mounted() {
let that = this
that.voiceManager = plugin.getRecordRecognitionManager()
that.voiceManager.onStop = function(res) {
that.handleSearchHistory(res.result.replace('。', ''))
}
that.voiceManager.onError = function(res) {
console.error("error msg", res.retcode)
}
that.voiceManager.stop()
// that.voiceManager = plugin.getRecordRecognitionManager()
// that.voiceManager.onStop = function(res) {
// that.handleSearchHistory(res.result.replace('', ''))
// }
// that.voiceManager.onError = function(res) {
// console.error("error msg", res.retcode)
// }
// that.voiceManager.stop()
},
methods: {
//
@ -122,28 +125,28 @@
toggleShowAll() {
this.showAll = !this.showAll
},
onVoiceTouchStart() {
let that = this
that.showAutoSearchDlg = true
that.voiceManager.start({
duration: 60000,
lang: "zh_CN"
})
},
onVoiceTouchEnd() {
let that = this
that.showAutoSearchDlg = false
that.voiceManager.stop()
},
//
cancelRecording() {
// #ifdef MP-WEIXIN
if (this.voiceManager) {
this.voiceManager.stop()
this.showAutoSearchDlg = false
}
// #endif
},
// onVoiceTouchStart() {
// let that = this
// that.showAutoSearchDlg = true
// that.voiceManager.start({
// duration: 60000,
// lang: "zh_CN"
// })
// },
// onVoiceTouchEnd() {
// let that = this
// that.showAutoSearchDlg = false
// that.voiceManager.stop()
// },
// //
// cancelRecording() {
// // #ifdef MP-WEIXIN
// if (this.voiceManager) {
// this.voiceManager.stop()
// this.showAutoSearchDlg = false
// }
// // #endif
// },
handlecolse() {
console.log("取消搜索")
this.search_value = ""
@ -153,10 +156,10 @@
handleSearchHistory(text) {
let that = this
if (text == "") {
that.$tools.msg("输入关键字后搜索")
that.$tools.msg(that.$t("KeyWordsSearch"))
return
}
uni.navigateTo({
uni.redirectTo({
url: "/Food/search/list?name=" + text
})
}

View File

@ -32,7 +32,7 @@
<view class="line" v-else>
<view class="nolist">
<image src="../../static/none.png"></image>
<text>暂无数据请手动添加~</text>
<text>{{$t("msgNoMoreData")}}</text>
</view>
</view>
</view>
@ -57,7 +57,7 @@
<view class="box" v-else>
<view class="nolist">
<image src="../../static/none.png"></image>
<text>暂无数据</text>
<text>{{$t("msgNoMoreData")}}</text>
</view>
</view>
</view>
@ -68,28 +68,28 @@
<view class="val">
{{target_weight}}<text>kg</text>
</view>
<view class="name">目标体重<uni-icons class="iconfont icon-bianji" color="#FEC407"></uni-icons>
<view class="name">{{$t("target_weight")}}<uni-icons class="iconfont icon-bianji" color="#FEC407"></uni-icons>
</view>
</view>
<view class="item">
<view class="val">
{{Math.abs(calculate_val)}}<text>kg</text>
</view>
<view class="name" v-if="Number(calculate_val)>0">累计增重</view>
<view class="name" v-else>累计减重</view>
<view class="name" v-if="Number(calculate_val)>0">{{$t("cumulative_weight_gain")}}</view>
<view class="name" v-else>{{$t("cumulative_weight")}}</view>
</view>
<view class="item" @click="handleClick(2)">
<view class="val">
{{initial_weight}}<text>kg</text>
</view>
<view class="name">初始体重<uni-icons class="iconfont icon-bianji" color="#FEC407"></uni-icons>
<view class="name">{{$t("initial_weight")}}<uni-icons class="iconfont icon-bianji" color="#FEC407"></uni-icons>
</view>
</view>
<view class="item">
<view class="val">
{{calculate_time}}<text></text>
{{calculate_time}}<text></text>
</view>
<view class="name">减重天数</view>
<view class="name">{{$t("cumulative_day")}}</view>
</view>
</view>
</view>
@ -146,6 +146,9 @@
},
onLoad() {
let that = this
uni.setNavigationBarTitle({
title: this.$t('titleCharts')
})
that.handleLabelList(that.endDate, that.startDate)
// #ifdef APP-PLUS
that.fields = "time"
@ -203,12 +206,12 @@
let that = this
if (that.endTime) {
if (Date.parse(e.detail.value) > Date.parse(that.endTime)) {
that.$tools.msg("请选择正确的时间")
that.$tools.msg(that.$t("verifyBodyDate"))
return
}
} else {
if (Date.parse(e.detail.value) > Date.parse(that.endDate)) {
that.$tools.msg("请选择正确的时间")
that.$tools.msg(that.$t("verifyBodyDate"))
return
}
}
@ -221,12 +224,12 @@
let that = this
if (that.startTime) {
if (Date.parse(e.detail.value) < Date.parse(that.startTime)) {
that.$tools.msg("请选择正确的时间")
that.$tools.msg(that.$t("verifyBodyDate"))
return
}
} else {
if (Date.parse(e.detail.value) < Date.parse(that.startDate)) {
that.$tools.msg("请选择正确的时间")
that.$tools.msg(that.$t("verifyBodyDate"))
return
}
}

View File

@ -17,11 +17,11 @@
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<view class="endtext" v-if="!lastPage || page >= lastPage"> 到底了看看别的吧 </view>
<view class="endtext" v-if="!lastPage || page >= lastPage"> {{$t('msgBottom')}} </view>
</view>
<view class="nolist" v-if="!ranklist.length||!lastPage">
<image src="../../static/none.png"></image>
<text>暂无数据</text>
<text>{{$t('msgNoMoreData')}}</text>
</view>
</view>
</template>
@ -45,33 +45,40 @@
ranklist: [],
page: 1,
lastPage: '',
isActive: null,
}
},
onLoad(options) {
onLoad() {
let that = this
that.page = 1
that.lastPage = ""
that.ranklist = []
that.getList()
uni.setNavigationBarTitle({
title: this.$t('measuringRecord')
})
},
onReachBottom() {
let that = this
console.log("onReachBottom", this.lastPage)
if (!this.lastPage || this.page >= this.lastPage) {
uni.showToast({
title: '没有更多数据!',
title: that.$t('noMoreData'),
icon: 'none'
})
return
}
this.page++
this.getList(this.page)
this.getList()
},
methods: {
swipeClick(e, index) {
let that = this
let id = that.ranklist[index].id
uni.showModal({
title: '友情提示',
content: '是否删除当前测量记录?',
title: that.$t("msgTitle"),
content: that.$t("verifyDeleteHistory"),
cancelText: that.$t("btnSancellation"),//
confirmText: that.$t("btnConfirm"),//
success: function(res) {
if (res.confirm) {
that.$model.gethistorydelete({
@ -88,10 +95,10 @@
that.$store.dispatch("getResult", {
aud_id: that.user.aud_id
})
that.$tools.msg("删除成功")
that.$tools.msg(that.$t("msgDelete"))
})
} else if (res.cancel) {
that.$tools.msg("您已取消操作!");
that.$tools.msg(that.$t("msgCancel"));
}
},
})
@ -102,7 +109,7 @@
url: "/body/history/historyDetail?id=" + item.id
})
},
getList(page) {
getList() {
let that = this
that.$model.gethistory({
aud_id: that.user.aud_id,
@ -111,7 +118,7 @@
console.log("历史记录", res)
if (res.code != 0) return
let options = [{
text: '删除',
text: that.$t("btnDelete"),
style: {
backgroundColor: '#dd524d'
}
@ -123,10 +130,6 @@
this.lastPage = res.data.totalpage
})
},
handleEdit(id) {
let that = this
that.isActive = that.isActive == id ? null : id
},
}
}
</script>

View File

@ -35,6 +35,9 @@
// },
onLoad(options) {
let that = this
uni.setNavigationBarTitle({
title: this.$t('titleDetail')
})
that.id = options.id
that.getList()
},

View File

@ -20,9 +20,9 @@
<view class="val">{{item.value?item.value:'0'}}{{item.unit}}</view>
<view class="level">
<view class="btnf"
:style="{backgroundColor:(item.standard=='异常'?'#FFF':item.standard_color)}"
:class="[item.standard=='异常'?'btnC':'']">
{{item.standard=='异常'?'-':item.standard}}
:style="{backgroundColor:(item.standard=='异常'||item.standard==''?'#F8595D':item.standard_color)}"
:class="[item.standard=='异常'||item.standard==''?'btnC':'']">
{{item.standard=='异常'||item.standard==''?'-':item.standard}}
</view>
</view>
</view>
@ -30,7 +30,7 @@
<view class="desc">
<view v-if="item.description" class="ming size12">{{item.description}}</view>
<view :class="[item.standard_list.length?'statuevue':'']" v-if="item.standard_list">
<view class="bi" v-if="item.title!='基础代谢'">
<view class="bi" v-if="item.key_name!='kcal'">
<view :style="'left:'+item.offset+'%'" class="peobox">
<view class="xx"></view>
</view>
@ -43,7 +43,7 @@
</view>
<view v-else>
<view class="kcalClass" v-if="item.standard_list&&item.standard_list.length">
标准值:{{item.standard_list[0].max_val}}kcal
{{$t("StandardValue")}}:{{item.standard_list[0].max_val}}kcal
</view>
</view>
</view>
@ -78,7 +78,9 @@
},
onLoad(options) {
this.to = options.to
console.log("to", this.to)
uni.setNavigationBarTitle({
title: this.$t('bodyData')
})
this.handleResultDetail()
},
methods: {

View File

@ -4,30 +4,30 @@
<view class="login">
<view class="editem">
<view class="item">
<view class="text">手机号/邮箱</view>
<view class="text">{{$t("infoEmail")}}</view>
<view class="input">
<input v-model="phone" type="text"/>
<input v-model="phone" type="email" :placeholder="$t('verifyEmail')"/>
</view>
</view>
<view class="item ">
<view class="text">验证码</view>
<view class="text">{{$t("titleCode")}}</view>
<view class="input yanzhengma">
<input class="uni-input" v-model="code" />
<input class="uni-input" v-model="code" :placeholder="$t('verifyCode')"/>
<button class="code" type="none" @click="handleCode" v-model="code"
:disabled="disabled">{{second<60 ? second+'S后重发':'验证码'}}
:disabled="disabled">{{second<60 ? second+$t("titleSendCodeRetry"):$t("titleSendCode")}}
</button>
</view>
</view>
<view class="item">
<view class="text">密码</view>
<view class="text">{{$t("titlePassword")}}</view>
<view class="input">
<input class="uni-input" v-model="password" />
<input class="uni-input" v-model="password" :placeholder="$t('verifyPassword')"/>
</view>
</view>
<view class="item">
<view class="text">确认密码</view>
<view class="text">{{$t("titleConfirmPassword")}}</view>
<view class="input">
<input class="uni-input" v-model="password2" />
<input class="uni-input" v-model="password2" :placeholder="$t('verifyPasswordTwo')"/>
</view>
</view>
</view>
@ -39,7 +39,7 @@
</label>
</checkbox-group>
</view> -->
<view class="btnlogin" @click="handleTelLogin">确认</view>
<view class="btnlogin" @click="handleTelLogin">{{$t("btnSubmit")}}</view>
</view>
</view>
</template>
@ -59,7 +59,11 @@
}
},
onLoad(options) {
let that = this
this.type = options.type //1
uni.setNavigationBarTitle({
title: that.type=='register'?that.$t('titleRegister'):that.$t('titleSetPassword')
})
},
methods: {
checkboxChange(e) {
@ -68,40 +72,36 @@
//
handleTelLogin() {
let that = this
let phoneType = that.phone.indexOf("@") !== -1
if (that.value == 0) {
that.$tools.msg("请先确认勾选协议")
that.$tools.msg(that.$t("verifyAgreement"))
return
}
if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) {
that.$tools.msg("请输入正确的手机号")
return
}
if (phoneType && !(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) {
that.$tools.msg("请输入正确的邮箱")
if (!(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) {
that.$tools.msg(that.$t("verifyEmailCorrect"))
return
}
if (!that.code) {
that.$tools.msg("请填写验证码")
that.$tools.msg(that.$t("verifyCode"))
return
}
if (!that.password) {
that.$tools.msg("请填写密码")
that.$tools.msg(that.$t("verifyPassword"))
return
}
if (!that.password2) {
that.$tools.msg("请确认密码")
that.$tools.msg(that.$t("verifyPassword"))
return
}
if (that.password2 != that.password) {
that.$tools.msg("请确认两次密码填写一致")
that.$tools.msg(that.$t("verifyPasswordCorrect"))
return
}
let account = {
data: that.phone,
password: that.password,
c_password: that.password2,
code: that.code
confirm_password: that.password2,
code: that.code,
language: uni.getStorageSync('language')
}
let https = that.type == 'register' ? that.$model.getregister(account) : that.$model.getResetPassword(
account)
@ -114,7 +114,7 @@
uni.setStorageSync('token', res.data.token)
uni.setStorageSync('aan_id', res.data.aan_id)
that.$tools.handleUserList()
that.$tools.msg("设置成功,进入程序中")
that.$tools.msg(that.$t("msgSetPasswordSuccess"))
setTimeout(function() {
uni.reLaunch({
url: "/pages/index/index"
@ -125,19 +125,13 @@
//
handleCode() {
let that = this
let phoneType = that.phone.indexOf("@") !== -1
if (!phoneType && !(/^1[3456789]\d{9}$/.test(that.phone))) {
that.$tools.msg("请输入正确的手机号")
return
}
if (phoneType && !(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) {
that.$tools.msg("请输入正确的邮箱")
if (!(/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(that.phone))) {
that.$tools.msg(that.$t("verifyEmailCorrect"))
return
}
//
that.$model.getSendCode({
data: that.phone,
type: that.type
}).then(res => {
console.log(res)
if (res.code != 0) {
@ -155,7 +149,6 @@
}, 60000)
}).catch(err => {})
},
handlexieyi() {}
}
}
</script>
@ -181,23 +174,23 @@
}
.login {
width: calc(100% - 30px);
width: calc(100% - 60rpx);
height: auto;
background: #fff;
border-radius: 10px;
padding: 15px;
border-radius: 20rpx;
padding: 30rpx;
background-color: #fff;
z-index: 99;
// position: relative;
// margin-left: calc(10% - 40px);
// margin-left: calc(10% - 80rpx);
// box-shadow: 0px 1px 5px 2px #dfe2e1fc;
.title {
text-align: left;
color: #333;
font-size: 40rpx;
font-size: 40rpx;
font-weight: bold;
margin-bottom: 15px;
margin-bottom: 30rpx;
}
@ -215,51 +208,54 @@
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 15px;
margin-bottom: 20rpx;
flex-wrap: wrap;
.text {
width: 240rpx;
height: 40px;
line-height: 40px;
width: 100%;
height: 70rpx;
line-height: 70rpx;
font-size: 32rpx;
font-weight: bold;
}
.input {
width: calc(100% - 240rpx);
width: 100%;
height: 35px;
line-height: 35px;
display: flex;
position: relative;
border: #dfdfdf 1px solid;
border-radius: 5px;
padding: 0 10px;
padding: 0 20rpx;
background-color: #f7f7f7;
}
input {
height: 40px;
line-height: 40px;
height: 80rpx;
line-height: 80rpx;
position: absolute;
left: 10px;
left: 20rpx;
right: 0px;
z-index: 88;
font-size:28rpx;
font-size: 28rpx;
}
.yanzhengma {
input {
right: 220rpx;
font-size:28rpx;
right: 180px;
font-size: 28rpx;
}
}
}
.code {
width: 220rpx;
color: #333;
width: 180px;
background: #dfdfdf;
font-size: 28rpx;
margin: 0;
line-height: 40px;
line-height: 80rpx;
border-radius: 5px;
text-align: center;
position: absolute;
@ -291,12 +287,12 @@
.btnlogin {
width: 100%;
margin: 15px 0;
margin: 30rpx 0;
height: 42px;
line-height: 42px;
background: $btncolor;
font-weight: 700;
border-radius: 15px;
border-radius: 30rpx;
text-align: center;
color: #fff !important;
}

View File

@ -25,14 +25,14 @@
<view class="item">
<view class="text">{{$t("infoEmail")}}</view>
<view class="input">
<input v-model="phone" />
<input v-model="phone" type="email" :placeholder="$t('verifyEmail')"/>
</view>
</view>
<!-- 验证码登录 -->
<view class="item " v-if="isCode">
<view class="text">{{$t("titleCode")}}</view>
<view class="input yanzhengma">
<input class="uni-input" v-model="code" />
<input class="uni-input" v-model="code" :placeholder="$t('verifyCode')"/>
<button class="code" type="none" @click="handleCode" v-model="code"
:disabled="disabled">{{second<60 ? second+$t("titleSendCodeRetry"):$t("titleSendCode")}}
</button>
@ -42,7 +42,7 @@
<view class="item " v-else>
<view class="text">{{$t("titlePassword")}}</view>
<view class="input">
<input class="uni-input" v-model="password" />
<input class="uni-input" v-model="password" :placeholder="$t('verifyPassword')"/>
</view>
</view>
<view class="forget " v-if="!isCode">
@ -124,14 +124,18 @@
let that = this
uni.setTabBarItem({
index: 0,
text: that.$t('titleHome')
text: that.$t('titleHealth')
})
uni.setTabBarItem({
index: 1,
text: that.$t('titleCount')
text: that.$t('titleDiet')
})
uni.setTabBarItem({
index: 2,
text: that.$t('titleExercise')
})
uni.setTabBarItem({
index: 3,
text: that.$t('titleMe')
})
},
@ -299,4 +303,21 @@
border-radius: 50%;
}
}
.language {
position: absolute;
top: 0;
left: 15px;
background: #fff;
padding: 5px 20px;
border-radius: 10px;
picker {
width: 100%;
view {
display: flex;
align-items: center;
}
}
}
</style>

View File

@ -2,15 +2,16 @@
<view class="content">
<view class="info">
<view class="logo">
<image src="../../static/logo2.png"></image>
<view>Reedaw</view>
<image :src="configInfo.app_icon"></image>
<view>{{configInfo.app_name}}</view>
<text>V{{phoneInfo.info.version}}</text>
</view>
<view class="list">
<view class="item" @click="handleVersion">
<view class="left">{{$t("titleVersionUpdate")}}</view>
<view class="right">
<text class="new" v-if="version==-1">{{$t("titleNewVersion")}}{{phoneInfo.versionUrl.version}}</text>
<text class="new"
v-if="version==-1">{{$t("titleNewVersion")}}{{phoneInfo.versionUrl.version}}</text>
<uni-icons type="right"></uni-icons>
</view>
</view>
@ -37,10 +38,14 @@
}
},
computed: {
...mapState(["phoneInfo"]),
...mapState(["phoneInfo", "configInfo"]),
},
onLoad() {
let that = this
uni.setNavigationBarTitle({
title: this.$t('titleAboutUs')
});
console.log("11111111", phoneInfo)
if (!that.phoneInfo.versionUrl) {
that.handleoginversion()
} else {

View File

@ -48,6 +48,11 @@
computed: {
...mapState(["familayList"])
},
onLoad() {
uni.setNavigationBarTitle({
title: this.$t('titleManage')
});
},
onPullDownRefresh() {
let that = this
that.handleUserList()
@ -91,11 +96,10 @@
return
}
that.$store.commit('changeFamilay', res.data.user_list)
console.log("删除", that.id, uni.getStorageSync('userid'))
//
if (that.id == uni.getStorageSync('userid')) {
let userid = res.data.user_list[0].id
if (that.id == uni.getStorageSync('userid') || !res.data.user_list.length) {
let userid = !res.data.user_list.length ? "" : res.data.user_list[0].id
uni.setStorageSync('userid', userid)
that.$store.dispatch('getUserInfo', {
aud_id: userid
@ -105,17 +109,9 @@
aud_id: userid,
time: that.$tools.getDate("start")
})
//
that.$store.dispatch("getCardAllList", {
aud_id: userid
})
//
that.$store.dispatch("getResult", {
aud_id: userid
})
that.$store.dispatch("getPublicRecord", {
aud_id: userid
})
}
}).catch(err => {})
},

View File

@ -31,7 +31,8 @@
<view class="lan border-bottom">
<view class="left">{{$t('infoHeight')}}</view>
<view class="right">
<input name="name" class="mr-5" type="digit" v-model="memInfo.height" :placeholder="$t('verifyRecord')"/>CM
<input name="name" class="mr-5" type="digit" v-model="memInfo.height"
:placeholder="$t('verifyRecord')" />CM
<uni-icons type="clear" color="#999" v-if="memInfo.height" @click="memInfo.height=''"
size="20"></uni-icons>
</view>
@ -39,7 +40,8 @@
<view class="lan border-bottom">
<view class="left">{{$t('infoWeight')}}</view>
<view class="right">
<input name="name" type="digit" class="mr-5" v-model="memInfo.weight" :placeholder="$t('verifyRecord')" />KG
<input name="name" type="digit" class="mr-5" v-model="memInfo.weight"
:placeholder="$t('verifyRecord')" />KG
<uni-icons type="clear" color="#999" v-if="memInfo.weight" @click="memInfo.weight=''"
size="20"></uni-icons>
</view>
@ -49,7 +51,7 @@
<view class="right">
<picker mode="date" :end="endDate" @change="maskClick"
:value="memInfo.birthday?memInfo.birthday:endDate" :fields="fields">
<view class="uni-input">{{memInfo.birthday?memInfo.birthday:$t('verifyPicker')}}}}</view>
<view class="uni-input">{{memInfo.birthday?memInfo.birthday:$t('verifyPicker')}}</view>
<icon class="iconfont icon-arrow-down-bold"></icon>
</picker>
</view>
@ -60,7 +62,7 @@
<picker mode="selector" @change="changeClickType" :range="activityLevel" range-key="name"
:value="levelInd">
<view>
{{memInfo.activity_level?activityLevel[levelInd].name:$t('verifyRecord')}}}}
{{memInfo.activity_level?activityLevel[levelInd].name:$t('verifyRecord')}}
<icon class="iconfont icon-arrow-down-bold"></icon>
</view>
</picker>
@ -155,7 +157,7 @@
console.log("成功", res, that.isEdit, uni.getStorageSync('userid'))
if (res.code == 0) {
if (!that.isEdit) {
that.addID = res.aud_id
that.addID = res.data.aud_id
}
that.handleUserList()
} else {
@ -176,6 +178,7 @@
that.$store.commit('changeFamilay', res.data.user_list)
//
if (!that.isEdit) {
console.log('新增', that.addID)
let userid = that.addID
uni.setStorageSync('userid', that.addID)
that.$store.dispatch('getUserInfo', {

View File

@ -7,21 +7,21 @@
<image :src="depthInfo.user_data.head_pic"></image>
<view>
<text class="bold size14 name">{{depthInfo.user_data.nickname}}</text>
<text>性别:{{depthInfo.user_data.gender==2?'女':'男'}}</text>
<text>{{$t("infoGender")}}:{{depthInfo.user_data.gender==2?$t("infoWoman"):$t("infoMan")}}</text>
</view>
</view>
</view>
<view class="info">
<view class="text_l">
<text>年龄</text>
<text>{{$t("infoAge")}}</text>
<text class="size20 bold">{{depthInfo.user_data.age}}</text>
</view>
<view class="line text_c">
<text>身高</text>
<text>{{$t("infoHeight")}}</text>
<text class="size20 bold">{{depthInfo.user_data.height}}</text>
</view>
<view class="text_r">
<text class="text_c">体重</text>
<text class="text_c">{{$t("infoWeight")}}</text>
<text class="size20 bold">{{depthInfo.user_data.weight}}</text>
</view>
</view>
@ -33,7 +33,7 @@
</view>
<view class="score">
<text>{{depthInfo.user_data.score}}</text>
健康评分
{{$t("HealthScore")}}
</view>
</view>
</view>
@ -121,9 +121,9 @@
<view class="val">{{item.value?item.value:'0'}}{{item.unit}}</view>
<view class="level">
<view class="btnf"
:style="{backgroundColor:(item.standard=='异常'?'#FFF':item.standard_color)}"
:class="[item.standard=='异常'?'btnC':'']">
{{item.standard=='异常'?'-':item.standard}}
:style="{backgroundColor:(item.standard=='异常'||item.standard==''?'#F8595D':item.standard_color)}"
:class="[item.standard=='异常'||item.standard==''?'btnC':'']">
{{item.standard=='异常'||item.standard==''?'-':item.standard}}
</view>
</view>
</view>
@ -189,9 +189,9 @@
<view class="val">{{item.value?item.value:'0'}}{{item.unit}}</view>
<view class="level">
<view class="btnf"
:style="{backgroundColor:(item.standard=='异常'?'#FFF':item.standard_color)}"
:class="[item.standard=='异常'?'btnC':'']">
{{item.standard=='异常'?'-':item.standard}}
:style="{backgroundColor:(item.standard=='异常'||item.standard==''?'#F8595D':item.standard_color)}"
:class="[item.standard=='异常'||item.standard==''?'btnC':'']">
{{item.standard=='异常'||item.standard==''?'-':item.standard}}
</view>
</view>
</view>
@ -312,7 +312,7 @@
name: "",
},
subtitle: {
name: "体重(kg)"
name: this.$t("infoWeight") + "(kg)"
}
},
chartData: {},
@ -340,6 +340,9 @@
},
},
onLoad() {
uni.setNavigationBarTitle({
title: this.$t('titleDepthReport')
});
this.handleLabelList()
},
methods: {
@ -370,7 +373,7 @@
this.chartData2 = JSON.parse(JSON.stringify({
series: [{
name: "健康评分",
name: that.$t("HealthScore"),
data: Number(that.depthInfo.user_data.score) / 100
}]
}));
@ -458,7 +461,7 @@
}
}
.right {
width: 160px;
position: absolute;
@ -467,7 +470,7 @@
height: 100px;
overflow: hidden;
z-index: 999;
.rightChart {
width: 140px;
height: 140px;
@ -475,13 +478,13 @@
border-radius: 50%;
padding: 10px;
}
.charts-box {
width: 140px;
height: 140px;
margin-top: 0px;
}
.score {
position: absolute;
width: 140px;
@ -491,7 +494,7 @@
align-items: center;
justify-content: flex-end;
top: -5px;
text {
color: $maincolor;
font-size: 20px;

View File

@ -11,7 +11,7 @@
<view class="item ">
<view class="text">{{$t("titleCode")}}</view>
<view class="input yanzhengma">
<input class="uni-input" v-model="code" />
<input class="uni-input" v-model="code" :placeholder="$t('verifyCode')"/>
<button class="code" type="none" @click="handleCode" v-model="code"
:disabled="disabled">{{second<60 ? second+$t("titleSendCodeRetry"):$t("titleSendCode")}}
</button>
@ -45,8 +45,9 @@
let that = this
uni.showModal({
title: that.$t("msgTitle"),
confirmText: that.$t("btnDelete"),
content: that.$t("verifyDeleteAccount"),
cancelText: that.$t("btnSancellation"),//
confirmText: that.$t("btnConfirm"),//
success: function(res) {
if (res.confirm) {
that.$model.getDeleteAccount({
@ -54,7 +55,7 @@
}).then((res) => {
if (res.code != 0) return
that.$tools.msg(that.$t('msgDelete'));
uni.setStorageSync('token', null)
uni.setStorageSync('token', "")
uni.setStorageSync('aan_id', null)
uni.clearStorageSync()
setTimeout(() => {

View File

@ -5,13 +5,13 @@
<view class="item">
<view class="text">{{$t("infoEmail")}}</view>
<view class="input">
<input v-model="phone" :placeholder="$t('verifyEmail')" />
<input v-model="phone" type="email" :placeholder="$t('verifyEmail')" />
</view>
</view>
<view class="item ">
<view class="text">{{$t("titleCode")}}</view>
<view class="input yanzhengma">
<input class="uni-input" v-model="code" />
<input class="uni-input" v-model="code" :placeholder="$t('verifyCode')"/>
<button class="code" type="none" @click="handleCode" v-model="code"
:disabled="disabled">{{second<60 ? second+$t("titleSendCodeRetry"):$t("titleSendCode")}}
</button>
@ -50,7 +50,7 @@
onLoad() {
let that = this
uni.setNavigationBarTitle({
title: that.$t('titlePasswordEdit')
title: that.$t('titleSetPassword')
})
},
methods: {
@ -90,7 +90,7 @@
that.$tools.msg(that.$t('msgSetSuccess'))
that.$model.getloginOut({}).then((res) => {
if (res.code != 0) return
uni.setStorageSync('token', null)
uni.setStorageSync('token', "")
uni.setStorageSync('aan_id', null)
uni.clearStorageSync()
setTimeout(function() {

View File

@ -11,7 +11,7 @@
<view class="item ">
<view class="text">{{$t('titleCode')}}</view>
<view class="input yanzhengma">
<input class="uni-input" v-model="code" />
<input class="uni-input" v-model="code" :placeholder="$t('verifyCode')"/>
<button class="code" type="none" @click="handleCode" v-model="code"
:disabled="disabled">{{second<60 ? second+$t('titleSendCodeRetry'):$t('titleSendCode')}}
</button>

View File

@ -42,6 +42,11 @@
nickname: ""
};
},
onLoad() {
uni.setNavigationBarTitle({
title: this.$t('titleSet')
})
},
computed: {
...mapState(["accountNumber"]),
user() {

View File

@ -1,247 +0,0 @@
<template>
<view 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">
<view class="title">
<view class="bold">{{ite.name}}</view>
<view class="c999">
{{ite.time}}
<uni-icons type="right" class="ml-10" color="#999"></uni-icons>
</view>
</view>
<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>
</view>
<view class="charts" v-if="handTrue&&ite.curve_list.line.categories.length">
<qiun-data-charts type="area" :chartData="ite.curve_list.line" :Width="140" :Height="40"
:canvas2d="true" :canvasId="ite.key_name+ind" :opts="opts" :tapLegend="false"
:tooltipShow="false" />
</view>
</view>
<view class="Ideal c999" v-if="ite.ideal_weight">
<text>理想{{ite.name}}</text>
<text>{{ite.ideal_weight}}</text>
</view>
</view>
</view>
<!-- -->
<view class="function mt-15">
<view @click="handlerRecord">
<image src="/static/shoudong.png" mode="widthFix"></image>
</view>
<view @click="handReport">
<image src="/static/shendu.png" mode="widthFix"></image>
</view>
</view>
<!-- -->
<view class="tools">
<view class="item box_shadow" v-for="(ite,ind) in Measure.card_list" @click="handleTools(ite.key_name)">
<view class="top">
<image :src="ite.icon"></image>{{ite.name}}
</view>
<view class="number">
<text class="bold"
:class="[ite.key_name=='body_level'||ite.key_name=='body_type'?'size14':'size20']">{{ite.value}}</text>{{ite.unit}}
</view>
<view class="bold size14" :style="{'color':ite.standard_color}">{{ite.standard}}</view>
</view>
</view>
<!-- 手动记录 -->
<record></record>
</view>
</template>
<script>
import {
mapState
} from "vuex";
import record from '@/components/bodyIndex/record.vue';
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue'
export default {
components: {
record,
qiunDataCharts,
},
data() {
return {
handTrue: false,
Measure: {
card_list: [],
top_list: []
},
opts: {
padding: [5, 0, 0, 0],
dataLabel: false,
enableScroll: false,
xAxis: {
disabled: true,
axisLine: false,
disableGrid: true,
itemCount: 5
},
yAxis: {
gridType: "dash",
dashLength: 2,
disabled: true,
axisLine: false,
disableGrid: true,
},
}
};
},
computed: {
...mapState(["user", "MeasureResult"]),
info() {
return this.user
},
// Measure() {
// let that = this
// return this.MeasureResult
// }
},
watch: {
MeasureResult: {
handler(newVal, oldVal) {
let that = this
that.handTrue = false
this.$nextTick(() => {
that.handTrue = true
that.Measure = newVal
})
},
deep: true,
immediate: true
}
},
methods: {
//
handleTools(name) {
uni.navigateTo({
url: "/body/home/body?to=" + name
})
},
//
handReport() {
uni.navigateTo({
url: "/body/report/report"
})
},
//
handelCurveDetailed() {
let that = this
setTimeout(function() {
uni.navigateTo({
url: "/body/curve/curve"
})
}, 200)
},
//
handlerRecord() {
this.$store.commit('changeRecord', true)
},
}
}
</script>
<style scoped lang="scss">
.body {
background: #f7f7f7;
}
.info {
margin: 15px 10px;
padding: 10px;
height: auto;
overflow: hidden;
border-radius: 10px;
display: flex;
flex-wrap: wrap;
.title {
width: 100%;
display: flex;
justify-content: space-between;
}
.weight {
width: 100%;
display: flex;
margin-top: 10px;
justify-content: space-between;
.left {
width: 40%;
height: 60px;
display: flex;
align-items: center;
justify-content: space-between;
}
}
.target {
color: #999;
width: 100%;
display: flex;
justify-content: space-between;
}
}
.charts {
width: 50%;
height: 60px;
}
.function {
display: flex;
margin: 0 5px;
width: calc(100% - 10px);
justify-content: space-between;
view {
width: 50%;
}
image {
width: 100%;
}
}
.tools {
display: flex;
flex-wrap: wrap;
padding: 0 0 10px;
padding-left: 3%;
width: 97%;
background: #f7f7f7;
box-shadow: none;
justify-content: space-between;
.item {
width: 40%;
background: #fff;
margin-bottom: 15px;
border-radius: 10px;
padding: 10px 3%;
margin-right: 3%;
}
.top {
display: flex;
align-items: center;
image {
width: 22px;
height: 22px;
margin-right: 5px;
}
}
.number {
margin: 5px 0;
}
}
</style>

View File

@ -15,11 +15,11 @@
<view class="overflow">
{{item.nickname}}
</view>
<view class="dangqian" v-if="item.id == userinfo.aud_id">当前</view>
<view class="dangqian" v-if="item.id == userinfo.aud_id">{{$t("infoNowUser")}}</view>
</view>
<view class="info">
<view>{{item.gender==1?'男':'女'}}</view>
<view>{{item.age}}</view>
<view>{{item.gender==1?$t("infoMan"):$t("infoWoman")}}</view>
<view>{{item.age}}{{$t("infoAgeunit")}}</view>
</view>
</view>
</view>

View File

@ -2,24 +2,24 @@
<view v-if="isFirst" class="wrapper wrapperbg">
<view class="bg" @click="onTap">
<view class="edit" @click.stop>
<view class="title">初始体重</view>
<view class="title">{{$t("initial_weight")}}</view>
<view class="editem">
<view class="name">日期</view>
<view class="name">{{$t("titleDate")}}</view>
<view class="right">
<picker mode="date" :end="endDate" @change="changeLog" :fields="fields">
<view class="uni-input">{{regTime?regTime:'请选择'}}</view>
<view class="uni-input">{{regTime?regTime:$t("verifyPicker")}}</view>
<icon class="iconfont icon-arrow-down-bold"></icon>
</picker>
</view>
</view>
<view class="editem">
<view class="name">体重</view>
<view class="name">{{$t("infoWeight")}}</view>
<view class="right">
<input v-model="weight" type="digit" placeholder="请输入" />kg
<input v-model="weight" type="digit" :placeholder="$t('verifyWeight')" />kg
</view>
</view>
<view class="btn close" @click="onTap()">取消</view>
<view class="btn" @click="handleTarget">确定</view>
<view class="btn close" @click="onTap()">{{$t("btnSancellation")}}</view>
<view class="btn" @click="handleTarget">{{$t("btnConfirm")}}</view>
</view>
</view>
</view>
@ -60,11 +60,11 @@
handleTarget() {
let that = this
if (!that.regTime) {
that.$tools.msg("请选择测量日期")
that.$tools.msg(that.$t("verifyDate"))
return
}
if (!that.weight) {
that.$tools.msg("请输入测量体重")
that.$tools.msg(that.$t("verifyWeight"))
return
}
that.$model.getfirstweight({

View File

@ -2,12 +2,12 @@
<view class="wrapper" v-if="isRecord">
<view class="bg" @click="onTap">
<view class="edit" @click.stop>
<view class="title">手动记录</view>
<view class="title">{{$t("manualRecording")}}</view>
<view class="editem">
<view class="left">日期</view>
<view class="left">{{$t("titleDate")}}</view>
<view class="right">
<picker mode="date" :end="endDate" @change="changeLog" :fields="fields">
<view class="uni-input">{{regTime?regTime:'请选择'}}</view>
<view class="uni-input">{{regTime?regTime:$t("verifyPicker")}}</view>
<icon class="iconfont icon-arrow-down-bold"></icon>
</picker>
</view>
@ -15,26 +15,26 @@
<!-- 身体 -->
<view>
<view class="editem" v-if="userInfo&&userInfo.height">
<view class="name">身高</view>
<view class="name">{{$t("infoHeight")}}</view>
<view class="right">
<input type="digit" v-model="height" placeholder="请输入身高" />cm
<input type="digit" v-model="height" :placeholder="$t('verifyHeight')" />cm
</view>
</view>
<view class="editem" v-if="userInfo&&userInfo.weight">
<view class="name">体重</view>
<view class="name">{{$t("infoWeight")}}</view>
<view class="right">
<input type="digit" v-model="weight" placeholder="请输入体重">kg
<input type="digit" v-model="weight" :placeholder="$t('verifyWeight')">kg
</view>
</view>
<view class="editem" v-if="userInfo.stage==3">
<view class="left">头围</view>
<view class="left">{{$t("infoHead")}}</view>
<view class="right">
<input v-model="head" type="digit" placeholder="请输入" />cm
<input v-model="head" type="digit" :placeholder="$t('verifyHead')" />cm
</view>
</view>
</view>
<view class="btn close" @click="onTap()">取消</view>
<view class="btn" @click="handleinsertmeasure()">确定</view>
<view class="btn close" @click="onTap()">{{$t("btnSancellation")}}</view>
<view class="btn" @click="handleinsertmeasure()">{{$t("btnConfirm")}}</view>
</view>
</view>
</view>
@ -80,15 +80,15 @@
handleinsertmeasure() {
let that = this
if (!that.regTime) {
that.$tools.msg("请选择测量日期")
that.$tools.msg(that.$t('verifyBodyDate'))
return
}
if (!that.height) {
that.$tools.msg("请输入测量身高")
that.$tools.msg(that.$t('verifyHeight'))
return
}
if (!that.weight) {
that.$tools.msg("请输入测量体重")
that.$tools.msg(that.$t('verifyWeight'))
return
}
that.$model.getinsertmeasure({

View File

@ -2,15 +2,15 @@
<view v-if="isTarget" class="wrapper">
<view class="bg" @click="onTap">
<view class="edit" @click.stop>
<view class="title">目标体重</view>
<view class="title">{{$t("target_weight")}}</view>
<view class="editem">
<view class="left">目标体重</view>
<view class="left">{{$t("target_weight")}}</view>
<view class="right">
<input class="text" type="digit" placeholder="请输入" v-model="inputvalue" />kg
<input class="text" type="digit" :placeholder="$t('verifyRecord')" v-model="inputvalue" />kg
</view>
</view>
<view class="btn close" @click="onTap()">取消</view>
<view class="btn" @click="handleWeight">确定</view>
<view class="btn close" @click="onTap()">{{$t("btnSancellation")}}</view>
<view class="btn" @click="handleWeight">{{$t("btnConfirm")}}</view>
</view>
</view>
</view>
@ -40,7 +40,7 @@
handleWeight() {
let that = this
if (!that.inputvalue) {
that.$tools.msg("请输入目标体重")
that.$tools.msg(that.$t("justDta"))
return
}
that.$model.getTargetweight({
@ -51,9 +51,6 @@
that.$tools.msg(res.msg)
that.$store.commit("changeTarget", false);
that.$emit("handleLabelList", that.endDate, that.startDate)
// that.$store.dispatch('getUserInfo', {
// aud_id: that.user.aud_id
// })
that.inputvalue = ""
})
},

View File

@ -1,160 +0,0 @@
<template>
<view class="cardContent">
<view class="cardList">
<view class="caritem" @click="handleNavTol('/pageTwo/charts/charts')">
<image src="/static/q5.png"></image>
<view>曲线</view>
</view>
<view class="caritem" @click="handleNavTol('/pageTwo/compk/contrast')">
<image src="/static/q3.png"></image>
<view>数据对比</view>
</view>
<view class="caritem" @click="handlerRecord">
<image src="/static/q7.png"></image>
<view>添加记录</view>
</view>
<view class="caritem" @click="handleNavTol('/pageTwo/history/history')">
<image src="/static/q8.png"></image>
<view>历史记录</view>
</view>
</view>
<view class="cardListchosen">
<view class="item" v-for="(ite,ind) in cardList.chosen_fixed" @click="handleNavTol(ite.page_jump)">
<view class="info">
<image :src="ite.icon"></image>
<view>{{ite.name}}</view>
</view>
</view>
<view class="item" v-for="(ite,ind) in cardList.chosen_yes" @click="handleNavTol(ite.page_jump)">
<view class="info">
<image :src="ite.icon"></image>
<view>{{ite.name}}</view>
</view>
</view>
</view>
<view class="setCard" @click="handleSetCard">
工具设置
</view>
<!-- 手动记录 -->
<record></record>
</view>
</template>
<script>
import {
mapState
} from "vuex";
import record from '@/components/cardIndex/record.vue';
export default {
data() {
return {
}
},
components: {
record,
},
computed: {
...mapState(['user', "CardList"]),
endDate() {
return this.$tools.getDate("start")
},
startDate() {
return this.$tools.GetDateStr(-90);
},
cardList() {
return this.CardList
}
},
methods: {
//
handlerRecord() {
this.$store.commit('changeTsPublicRecord', true)
},
handleNavTol(url) {
uni.navigateTo({
url: url
})
},
handleSetCard() {
uni.navigateTo({
url: "/pageTwo/cardList/card"
})
}
}
}
</script>
<style scoped lang="scss">
.cardContent {
background: #F7F7F7;
padding: 5px 0 15PX;
}
.cardList {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
background: #fff;
margin: 10px;
padding: 10px;
border-radius: 10px;
.caritem {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
image {
width: 40px;
height: 40px;
}
}
}
.cardListchosen {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
margin: 15px 10px;
.item {
width: 47%;
background-color: #fff;
margin-bottom: 15px;
position: relative;
height: 60px;
line-height: 60px;
border-radius: 5px;
.info {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
image {
width: 30px;
height: 30px;
background-color: #f2f2f2;
margin-right: 10px;
border-radius: 50%;
}
}
}
}
.setCard {
color: $maincolor;
margin: 15px;
text-align: center;
border: 1px solid $maincolor;
border-radius: 10px;
height: 40px;
line-height: 40px;
background: #fff;
}
</style>

View File

@ -2,13 +2,13 @@
<view class="wrapper" v-if="isPublicRecord">
<view class="bg" @click="onTap">
<view class="edit" @click.stop>
<view class="title">添加记录</view>
<view class="title">{{$t("addRecord")}}</view>
<view class="editem">
<view class="left">选择项目</view>
<view class="left">{{$t("option")}}</view>
<view class="right">
<picker mode="selector" @change="bindPickerChange" :value="index" :range="publicRecordInfo"
range-key="name">
<view class="uni-input">{{index!=-1?publicRecordInfo[index].name:'请选择'}}</view>
<view class="uni-input">{{index!=-1?publicRecordInfo[index].name:$t("verifyPicker")}}</view>
<icon class="iconfont icon-arrow-down-bold"></icon>
</picker>
</view>
@ -21,7 +21,7 @@
<picker mode="date" :end="endDate" @change="changeLog($event,ind)" :fields="fields"
:value="RecordList[ind].value">
<view class="uni-input">
{{RecordList[ind].value?RecordList[ind].value:'请选择'}}
{{RecordList[ind].value?RecordList[ind].value:$t("verifyPicker")}}
</view>
<icon class="iconfont icon-arrow-down-bold"></icon>
</picker>
@ -31,27 +31,27 @@
<picker mode="multiSelector" :value="timesTndex" :range="timeList"
@change="bindTimeChange($event,ind)">
<view class="size16">
{{RecordList[ind].value?RecordList[ind].value:'请选择'}}{{ite.unit}}
{{RecordList[ind].value?RecordList[ind].value:$t("verifyPicker")}}{{ite.unit}}
</view>
</picker>
<uni-icons type="bottom" class="ml-15 c666"></uni-icons>
</view>
<!-- 数字输入框 -->
<view class="right" v-if="ite.type == 'number'">
<input type="number" v-model="ite.value" placeholder="请输入">{{ite.unit}}
<input type="number" v-model="ite.value" :placeholder="$t('verifyRecord')">{{ite.unit}}
</view>
<!-- 小数输入框 -->
<view class="right" v-if="ite.type == 'digit'">
<input type="digit" v-model="ite.value" placeholder="请输入">{{ite.unit}}
<input type="digit" v-model="ite.value" :placeholder="$t('verifyRecord')">{{ite.unit}}
</view>
<!-- 文本输入框 -->
<view class="right" v-if="ite.type == 'text'">
<input type="text" v-model="ite.value" placeholder="请输入">{{ite.unit}}
<input type="text" v-model="ite.value" :placeholder="$t('verifyRecord')">{{ite.unit}}
</view>
</view>
<view class="btn close" @click="onTap()">取消</view>
<view class="btn" @click="handlepublicmeasure">确定</view>
<view class="btn close" @click="onTap()">{{$t("btnSancellation")}}</view>
<view class="btn" @click="handlepublicmeasure">{{$t("btnConfirm")}}</view>
</view>
</view>
</view>
@ -123,12 +123,12 @@
handlepublicmeasure() {
let that = this
if (that.index == -1) {
that.$tools.msg("请选择项目")
that.$tools.msg(that.$t("verifyOption"))
return
}
for (let i = 0; i < that.RecordList.length; i++) {
if (that.RecordList[i].value == "") {
that.$tools.msg("请输入正确信息")
that.$tools.msg(that.$t("justDta"))
break;
}
break;

View File

@ -6,7 +6,7 @@
<text @click="openBluetoothAdapter">{{bleTipsText}}</text>
</view>
<view class="duan" @click="handleBack" v-if="isShow&&isConnection == 2">
断开连接
{{$t("Disconnect")}}
</view>
</view>
<view class="name">{{name}}</view>
@ -27,19 +27,19 @@
<view class="right">
<picker mode="selector" :range="unitA" @change="changleUnits" :value="unitListIndex">
<view class="uni-input">
单位
{{$t("UnitBtn")}}
</view>
</picker>
</view>
</view>
</view>
<view class="btn" @click="handleDetailSub" :style="{'width':!stopblue?'20%':'45%'}">保存</view>
<view class="btn" @click="handleDetailNext" v-if="!stopblue">下一味</view>
<view class="btn qingling" @click="handleqingling">清零</view>
<view class="btn" @click="handleDetailSub" :style="{'width':!stopblue?'20%':'45%'}">{{$t("Save")}}</view>
<view class="btn" @click="handleDetailNext" v-if="!stopblue">{{$t("nextFlavor")}}</view>
<view class="btn qingling" @click="handleqingling">{{$t("resetBtn")}}</view>
</view>
<view>
<uni-popup ref="popup" type="dialog">
<uni-popup-dialog mode="input" title="重量" placeholder="请输入食物重量" @close="close"
<uni-popup-dialog mode="input" :title="$t('Weight')" :placeholder="$t('RecordWeight')" @close="close"
@confirm="confirm"></uni-popup-dialog>
</uni-popup>
</view>
@ -137,7 +137,7 @@
if (that.isConnection != 1) return
that.kcal = ""
that.$store.commit('changeBluetoothValue', {
bleTipsText: "蓝牙搜索中",
bleTipsText: that.$t("SearchBluetooth"),
isConnectStatus: 0,
deviceId: "",
serviceId: "",
@ -173,7 +173,7 @@
that.$store.commit("changeBluetoothValue", {
foodType: 1,
isConnectStatus: 1,
bleTipsText: "连接超时,点击重新连接",
bleTipsText: that.$t("ConnectionTimeout"),
})
console.log('获取特征值失败:', JSON.stringify(res))
}
@ -193,7 +193,7 @@
serviceId: that.serviceId,
foodNotify: that.notify,
foodWrite: that.write,
bleTipsText: "测量中,请将食物放到秤上",
bleTipsText: that.$t("Measuring"),
isConnectStatus: 2
})
uni.onBLECharacteristicValueChange(function(res) {
@ -275,7 +275,7 @@
if (Number(that.weight) > 0) {
that.$emit("handleDetailSub", that.weight, that.unit, that.kcal)
} else {
that.$tools.msg("数据异常,请清零后重新测量!")
that.$tools.msg(that.$t("Remeasure"))
}
},
//
@ -284,7 +284,7 @@
if (Number(that.weight) > 0) {
that.$emit("handleDetailNext", that.weight, that.unit, that.kcal)
} else {
that.$tools.msg("数据异常,请清零后重新测量!")
that.$tools.msg(that.$t("Remeasure"))
}
},
changleUnits(e) {
@ -340,7 +340,7 @@
let that = this
that.unitA = that.$json.unitMinus
that.$store.commit("changeBluetoothValue", {
bleTipsText: "连接失败,点击重新连接",
bleTipsText: that.$t("ConnectionTimeout"),
unitList: that.$json.unitMinus,
isConnectStatus: 1,
foodType: 1

View File

@ -6,7 +6,7 @@
<text @click="openBluetoothAdapter">{{bleTipsText}}</text>
</view>
<view class="duan" @click="handleBack" v-if="isShow&&isConnection == 2">
断开连接
{{$t("Disconnect")}}
</view>
</view>
<!-- -->
@ -24,20 +24,20 @@
<view class="right">
<picker mode="selector" :range="unitA" @change="changleUnits" :value="unitListIndex">
<view class="uni-input">
单位
{{$t("UnitBtn")}}
</view>
</picker>
</view>
</view>
</view>
<view class="btn addbtn size14" @click="handlesub" v-if="btnType==2">保存</view>
<view class="btn addbtn size14" @click="handlesub" v-if="btnType==2">{{$t("Save")}}</view>
<view class="btn addbtn" @click="handleAddFood" v-if="btnType==1">+</view>
<view class="btn qingling" @click="handleqingling">清零</view>
<view class="btn qingling" @click="handleqingling">{{$t("resetBtn")}}</view>
</view>
<!-- -->
<view>
<uni-popup ref="popup" type="dialog">
<uni-popup-dialog mode="input" title="重量" placeholder="请输入食物重量" @close="close"
<uni-popup-dialog mode="input" :title="$t('Weight')" :placeholder="$t('RecordWeight')" @close="close"
@confirm="confirm"></uni-popup-dialog>
</uni-popup>
</view>
@ -127,7 +127,7 @@
if (that.isConnection != 1) return
that.kcal = ""
that.$store.commit('changeBluetoothValue', {
bleTipsText: "蓝牙搜索中",
bleTipsText: that.$t("SearchBluetooth"),
isConnectStatus: 0,
deviceId: "",
serviceId: "",
@ -164,7 +164,7 @@
that.$store.commit("changeBluetoothValue", {
foodType: 1,
isConnectStatus: 1,
bleTipsText: "连接超时,点击重新连接",
bleTipsText: that.$t("ConnectionTimeout"),
})
console.log('获取特征值失败:', JSON.stringify(res))
}
@ -184,7 +184,7 @@
serviceId: that.serviceId,
foodNotify: that.notify,
foodWrite: that.write,
bleTipsText: "测量中,请将食物放到秤上",
bleTipsText: that.$t("Measuring"),
isConnectStatus: 2
})
uni.onBLECharacteristicValueChange(function(res) {
@ -319,13 +319,13 @@
if (Number(that.weight) > 0) {
that.$emit("handleBle", that.weight, that.unit, that.kcal)
} else {
that.$tools.msg("数据异常,请清零后重新测量!")
that.$tools.msg(that.$t("Remeasure"))
}
},
handleBack() {
let that = this
that.$store.commit("changeBluetoothValue", {
bleTipsText: "连接失败,点击重新连接",
bleTipsText: that.$t("ConnectionTimeout"),
unitList: that.$json.unitMinus,
isConnectStatus: 1,
foodType: 1

View File

@ -1,476 +0,0 @@
<template>
<view class="content-box">
<!-- 日期选择 -->
<view class="data">
<picker mode="date" :end="endDate" @change="changeClickDate" :value="data?data:endDate">
<view>
{{data?data:"请选择"}}
<image src="/static/qie.png"></image>
</view>
</picker>
</view>
<!-- 称重 -->
<view class="blue-tooth" v-if="user.aud_id!=''">
<blue-tooth :btnType="btnType"></blue-tooth>
</view>
<!-- 能量摄入 -->
<view class="everyDay">
<view class="title">
<view><text class="quan"></text>热量摄入</view>
<view class="icon" @click="handleSet">
<uni-icons type="gear" size="26"></uni-icons>
</view>
</view>
<view class="jishiqi">
<view class="left">
<view class="chart-wrap">
<view class="charts-box" v-if="handTrue">
<qiun-data-charts type="arcbar" :chartData="chartData" :canvas2d="true"
canvasId="foodCharts01" />
</view>
<view class="center">
摄入
<text>{{foodInfo.nutrients_four[0].today_intake}}</text>
<view class="unit">Kcal</view>
</view>
</view>
<view class="mubiao">
目标<text>{{foodInfo.nutrients_four[0].suggestion}}</text>kcal
</view>
</view>
<view class="right">
<view class="item" v-for="(ite,ind) in foodInfo.nutrients_four.slice(1)">
<view class="left-icon">
<image :src="ite.icon"></image>
<view class="val" :style="{color:ite.color}">{{ite.proportion_fp||0}}%</view>
</view>
<view class="right-info">
<view class="right-info-top">
<text class="name">{{ite.name}}</text>
<text class="">
{{ite.today_intake||0}}/{{ite.suggestion||0}}g
</text>
</view>
<view class="right-info-bottom">
<view class="val" :style="{ width: ite.proportion + '%',background:ite.color}">
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 早午晚餐 -->
<view class="foodtools">
<view class="type" v-for="(item,index) in foodInfo.list">
<view class="title" @click="handledetail(index)">
<view class="text">
<image :src="item.icon"></image>
<view>{{item.name}}</view>
<text>{{item.val}}{{item.unit}}</text>
</view>
<view class="detail">
餐食详情
<uni-icons type="forward" size="20" color="#999"></uni-icons>
</view>
</view>
<view class="list">
<uni-swipe-action>
<uni-swipe-action-item v-for="(ite,ind) in item.list" :key="ind" :right-options="actionOptions"
@click="delAcitionItem(ite)">
<view class="item" @click="showFoodDetail(ite)">
<image :src="ite.pic_url" mode="aspectFill"></image>
<view class="weight">
<view>{{ite.name}}</view>
<view class="size12 c999">{{ite.weight}}<text>|</text>{{ite.val}}kcal</view>
</view>
</view>
</uni-swipe-action-item>
</uni-swipe-action>
<view class="add" @click="handleAddFood(item.name)">
<text>+</text>添加食物
</view>
</view>
</view>
</view>
<view class="fenxi" @click="navTo('/Food/count/everyDay?page=count')">
<image src="/static/fenxi.png"></image>
营养分析
</view>
<!-- 搜索 -->
<view class="serachBox">
<view class="title">
<view class="quan mr-5"></view>教你做
</view>
<view class="searchInput">
<div class="search-wrap" @click="navTo('/Food/search/search')">
<text>输入食材快速搜索菜谱</text>
<image src="/static/28.png"></image>
</div>
</view>
</view>
<!-- 营养含量分析 -->
<view v-if="drawerVisible" class="drawerVisible">
<view class="bgVisible" @click="handleDrawerClose"></view>
<view class="infoVisible">
<scroll-view style="height: 100%;" scroll-y="true">
<view class="foodDetail">
<view class="foodInfo">
<image :src="activeFoodDetail.pic_url" mode="aspectFill"></image>
<view class="info">
<view class="name">{{activeFoodDetail.name}}</view>
<view class="kcal">{{activeFoodDetail.val}}千卡</view>
</view>
</view>
<view class="foodContent">
<view class="title">热量和营养</view>
<view class="progress">
<div class="chart-wrap" v-if="chartVisible">
<qiun-data-charts type="ring" :opts="opts" :chartData="chartData2" :cHeight="280"
:cWidth="280" :canvas2d="true" canvasId="foodCharts02" />
</div>
<view class="info" v-if="activeFoodDetail.nutrients_four">
<view class="info-item"
v-for="(item,index) in activeFoodDetail.nutrients_four.slice(1)" :key="index">
<view class="color" :style="{'background-color':`${item.color}`}">
</view>
<view>{{item.name}}{{item.proportion}}%</view>
</view>
</view>
</view>
<view class="tips">
<text>营养素</text>
<text>{{activeFoodDetail.weight}}含量</text>
</view>
<view class="foodDetailList">
<view class="foodDetailItem" v-for="(item,index) in activeFoodDetail.nutrients_list"
:key="index">
<view class="name">{{item.name_ch}}</view>
<view class="value">{{item.value}}{{item.unit}}
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</view>
</view>
</template>
<script>
import {
mapState
} from "vuex";
import blueTooth from "@/components/foodIndex/bluetooth_food.vue"
import qiunDataCharts from '@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue';
export default {
name: "food",
data() {
return {
btnType: 1,
token: "",
index: 0,
opts: {
background: "transparent",
title: {
name: "",
},
},
chartData: {
series: [{
data: 0,
color: "#3CB383"
}]
},
data: '',
isBle: true,
handTrue: false,
chartData2: {},
activeFoodDetail: {},
drawerVisible: false,
chartVisible: false, //
actionOptions: [{
text: '删除',
style: {
backgroundColor: '#dd524d',
borderRadius: '10rpx'
}
}]
};
},
components: {
blueTooth,
qiunDataCharts
},
computed: {
...mapState(["configInfo", "user", "countFoodInfo", "bleValue"]),
info() {
return this.user
},
kcalVal() {
return this.configInfo.kcal_data
},
endDate() {
return this.$tools.getDate("start")
},
foodInfo() {
let that = this
that.handTrue = false
that.$nextTick(() => {
that.handTrue = true
that.chartData.series[0].data = that.user.aud_id ? Number(that.countFoodInfo.nutrients_four[0].proportion) / 100 : 0
})
that.data = that.user.aud_id ? that.countFoodInfo.date : that.$tools.getDate("start")
return that.user.aud_id ? that.countFoodInfo : that.configInfo.default_count_foot
}
},
methods: {
//
showFoodDetail(item) {
console.log("item", item)
let that = this
let chart_data = []
that.drawerVisible = true;
that.opts.color = []
that.activeFoodDetail = item
for (let i = 1; i < item.nutrients_four.length; ++i) {
that.opts.color.push(item.nutrients_four[i].color)
chart_data.push({
name: item.nutrients_four[i].name,
value: Number(item.nutrients_four[i].proportion),
})
}
that.opts.title.name = that.activeFoodDetail.val
that.chartData2 = JSON.parse(JSON.stringify({
series: [{
data: chart_data
}]
}));
that.$nextTick(() => {
//
setTimeout(() => {
that.chartVisible = true
}, 100)
})
},
//
handledetail(index) {
uni.navigateTo({
url: "/Food/count/everyMeal?index=" + index
})
},
//
handleSet() {
uni.navigateTo({
url: "/Food/count/setting"
})
},
changeClickDate(e) {
this.data = e.detail.value
this.$store.dispatch("getCountFoodInfo", {
aud_id: this.info.aud_id,
time: e.detail.value
})
},
//
handleAddFood(name) {
this.isShow = false
uni.navigateTo({
url: "/Food/count/search?name=" + name + "&time=" + this.date
})
},
//
navTo(url) {
uni.navigateTo({
url
})
},
handleDrawerClose() {
//
this.chartVisible = false
this.drawerVisible = false;
},
//
delAcitionItem(item) {
let that = this
uni.showModal({
content: `是否删除[${item.name}]`,
success: (res) => {
if (res.confirm) {
this.$model.delCEatAction({
aud_id: that.info.aud_id,
eat_log_id: item.id
}).then(res => {
//
if (that.foodInfo.date == that.info.food_count.date) {
that.$store.dispatch("getUserInfoFood")
} else {
that.$store.dispatch("getCountFoodInfo", {
aud_id: that.info.aud_id,
time: that.foodInfo.date
})
}
})
}
}
})
}
}
}
</script>
<style lang="scss" scoped>
.content-box {
padding-top: 15px;
padding-bottom: 15px;
background: #f7f7f7;
}
.serachBox {
position: initial;
margin-bottom: 10px;
height: auto;
overflow: hidden;
.searchInput {
background: #fff;
padding: 10px;
width: calc(100% - 20px);
position: initial;
margin: 10px 0;
border-radius: 10px;
}
}
.data {
width: 100%;
background: #fff;
height: 90rpx;
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
margin: 10px;
width: calc(100% - 20px);
border-radius: 10px;
margin-top: 0;
picker {
display: flex;
width: 100%;
height: 90rpx;
position: relative;
align-items: center;
justify-content: center;
font-weight: bold;
view {
width: 100%;
position: absolute;
left: 0;
top: 0;
display: flex;
bottom: 0;
align-items: center;
justify-content: center;
}
image {
width: 30rpx;
height: 30rpx;
margin-left: 10px;
}
}
}
.blue-tooth {
padding: 10px;
background: #fff;
border-radius: 10px;
margin: 0 10px;
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
}
.foodtools {
margin-top: 30rpx;
.type {
background: #fff;
border-radius: 20rpx;
padding: 20rpx;
margin: 0 20rpx 20rpx;
.title {
display: flex;
align-items: center;
justify-content: space-between;
image {
width: 60rpx;
height: 60rpx;
}
.text {
width: 50%;
display: flex;
align-items: center;
view {
font-size: 32rpx;
font-weight: bold;
margin: 0 20rpx;
}
}
.detail {
color: #999;
display: flex;
font-size: 24rpx;
align-items: center;
}
}
.list {
width: 100%;
margin-top: 30rpx;
.item {
display: flex;
padding: 20rpx 0;
border-bottom: 1px solid #f7f7f7;
image {
width: 90rpx;
height: 90rpx;
border-radius: 50%;
border: 1px solid #f7f7f7;
}
.weight {
display: flex;
flex-direction: column;
justify-content: space-between;
margin-left: 20rpx;
text {
margin: 0 20rpx;
color: #dfdfdf;
}
}
}
}
.add {
width: 100%;
margin-top: 20rpx;
text-align: center;
}
}
}
.charts-box {
width: 250rpx;
height: 250rpx;
}
</style>

View File

@ -3,7 +3,7 @@
<view class="serachBox">
<view class="serach-box">
<view class="searchInput">
<input placeholder="请输入..." class="city-serach-input" v-model="name" />
<input :placeholder="$t('verifyPicker')" class="city-serach-input" v-model="name" />
<icon v-if="name" class="iconfont icon-error" @click="handlecolse"></icon>
<view class="voice" v-if="voice && !name">
<uni-icons class="mic" type="mic-filled" size="26" @click="onMic"></uni-icons>
@ -11,7 +11,7 @@
</view>
</view>
<view class="searchBtn">
<view @click="handleSerach">搜索</view>
<view @click="handleSerach">{{$t("Search")}}</view>
</view>
</view>
</view>

View File

@ -4,7 +4,7 @@
<view class="pre" @click="changeMonth('pre')">
<uni-icons type="back" size="26"></uni-icons>
</view>
<view>{{y+''+formatNum(m)+'月'}}</view>
<view>{{y+'-'+formatNum(m)}}</view>
<view class="next" @click="changeMonth('next')">
<uni-icons type="forward" size="26"></uni-icons>
</view>

View File

@ -29,28 +29,47 @@
"verifyMobileCorrect": "请输入正确的手机号",
"verifyCode": "请输入验证码",
"verifyPassword": "请输入密码",
"verifyPasswordTwo": "请输入确认密码",
"verifyTime": "请输入用时",
"verifyPasswordTwo": "请确认密码",
"verifyPasswordCorrect": "请确认两次密码填写一致",
"verifyAgreement": "请先确认并勾选协议",
"verifyOutLogin": "是否退出登录?",
"verifyDeleteUser": "是否删除该成员?",
"verifyDeleteHistory": "是否删除当前测量记录?",
"verifyDeleteAccount": "删除成功后,该账号的所有关联信息将被清空且无法找回,是否删除?",
"btnConfirm": "确",
"btnConfirm": "确",
"btnSubmit": "提交",
"btnSancellation": "取消",
"btnContinue": "继续",
"btnBack": "返回",
"btnDelete": "删除",
"ConnectionTimeout": "连接超时,点击重新连接",
"ConnectionTimeout": "连接失败,点击重新连接",
"Measuring": "测量中,请将食物放到秤上",
"ConnectionSuccessful": "连接成功",
"connectingDevice": "请先连接设备",
"Weight": "重量",
"RecordWeight": "请输入食物重量",
"connectBluetooth": "蓝牙连接中",
"SearchBluetooth": "蓝牙搜索中",
"Remeasure": "数据异常,请重新测量!",
"reset": "数据异常,请清零后重新测量!",
"Disconnect": "断开连接",
"remeasure": "重新测量",
"StableWeight": "稳定重量",
"StableWeightText": "您的稳定体重是:",
"realTimeWeight": "实时重量",
"realTimeWeightText": "您的实时体重是:",
"heightText": "您的身高是",
"zeroBtn": "清零",
"LockBtn": "锁定",
"SaveResult": "保存结果",
"measureResultTips": "测量结果提示",
"nowWeight": "本次测量体重是",
"lastHeight": "上次测量身高是:",
"lastWeight": "上次测量体重是:",
"nowHeight": "本次测量身高是:",
"lastHead": "上次测量头围是:",
"errorOperation": "操作错误,请重新测量",
"Disconnect": "断开连接",
"resetBtn": "清零",
"UnitBtn": "单位",
"titleHome": "首页",
@ -65,7 +84,6 @@
"titleeveryDay": "营养分析",
"titleMe": "我的",
"titleDetail": "详情",
"titleBody": "目标",
"titleHistory": "饮食记录",
"titlePhone": "绑定手机号",
"titleEmail": "绑定邮箱",
@ -157,8 +175,147 @@
"st": "st:lb",
"titleHealth": "健康",
"titleDiet": "饮食",
"titleExercise": "运动",
"titleScore": "中招估分",
"titleStartScore": "开始估分",
"titleScoreResult": "本次估分成绩",
"titleDepthReport": "深度报告",
"infoHead": "头围",
"verifyHead": "请输入头围",
"verifyHeightDad": "请输入爸爸身高",
"verifyHeightMom": "请输入妈妈身高",
"verifyRecordType": "请选择测量项目",
"verifyRecordTime": "请输入时长",
"verifyRecordNumber": "请输入个数",
"measuringRecord": "测量记录",
"newVersion": "发现新版本",
"IsUpdate": "是否更新?",
"UpdateProgram":"稍后可在'关于我们'内更新程序!"
"msgCalculating": "计算中",
"titleSkipping": "跳绳数据",
"titlevVitalcapacity": "肺活量数据",
"titleCharts": "运动曲线",
"titleContrast": "数据对比",
"UpdateProgram": "稍后可在'关于我们'内更新程序!",
"lungsuctionspeed": "吸气速度",
"averagelungsuction": "平均吸气肺活量",
"isMarginal": "是否达标",
"today_jump_num": "今日个数",
"today_jump_time": "今日时长",
"today_jump_kcal": "卡路里",
"jumpFree": "自由跳",
"backwardCount": "倒计数",
"Countdown": "倒计时",
"jumpFreedom": "自由",
"jumpFreeDegree": "自由次数",
"jumpFreeNumber": "个数",
"jumpTargetDegree": "目标次数",
"jumpUnlimited": "无限制",
"jumpTarget": "调整目标",
"jumpTargetTime": "目标时长 分:秒",
"MinuteSecond": "分:秒",
"Consumed": "消耗",
"LongpressEnd": "长按结束",
"AverageSpeed": "平均速度",
"Unit": "个/分钟",
"Numberofinterrupts": "中断次数",
"Times": "次",
"LongestConsecutive": "最长连续",
"Number": "个",
"trainingsNumber": "训练个数",
"complete": "完成",
"instructStart": "开始",
"instructContinuous": "连续",
"instructStop": "停止",
"instructEnd": "结束",
"instructContinue": "继续",
"instructPause": "暂停",
"linkBluetoothFail": "连接已断开",
"deviceDisconnection": "训练过程中已与设备连接中断,请重新连接设备再开始训练",
"ToggleTrainingsTips": "训练过程中请勿切换训练,返回训练",
"NOComplete": "本次跳绳时间低于10秒记录将不会被保存",
"growthAdvice": "成长建议",
"nutrition": "营养",
"sleep": "睡眠",
"movement": "运动",
"emotion": "情绪",
"manualRecording": "手动记录",
"inheritHeighet.title": "身高预测",
"inheritHeighet.dad": "爸爸身高",
"inheritHeighet.mom": "妈妈身高",
"inheritHeighet.geneticheight": "当前标准身高",
"inheritHeighet.adultheight": "成年身高预测",
"inheritHeighet.tips0": "为保证数据准确定,请认真填写真实信息",
"inheritHeighet.tips1": "如果当前实际身高﹤当前标准身高",
"inheritHeighet.tips2": "孩子后天生长环境不利长高。请从饮食、睡眠、运动、情绪等方面排查。加强后天因素管理,让孩子处于最佳长高状态。",
"inheritHeighet.tips3": "如果当前实际身高﹥当前标准身高",
"inheritHeighet.tips4": "孩子后天生长环境有利长高。请继续保持加强后天因素管理孩子成年可比标准高10cm以上。",
"time": "时间(天)",
"weightdiff": "减重",
"weightdiffAugment": "增重",
"fatWdiff": "减脂",
"fatWdiffAugment": "增脂",
"changeData": "数据变化",
"trend": "趋势",
"before": "之前",
"after": "之后",
"target_weight": "目标体重",
"cumulative_weight_gain": "累计增重",
"cumulative_weight": "累计减重",
"initial_weight": "初始体重",
"cumulative_day": "减重天数",
"chartsDay": "当天",
"chartsMonth": "月度",
"chartsYear": "年度",
"recordType": "项目",
"recordTime": "时长",
"recordNumber": "个数",
"recordNumberFirst": "第一次",
"recordNumberSecond": "第二次",
"recordNumberThird": "第三次",
"linkBluetoothFail2": "蓝牙连接已断开,请重新连接后测量",
"Ideal": "理想",
"addRecord": "添加记录",
"HistoricalRcord": "历史记录",
"TimeSpent": "用时",
"minutes": "分钟",
"btnBMI": "立即计算",
"Record": "记录",
"depthReport": "深度报告",
"Enter": "进入",
"target": "目标",
"teach": "教你做",
"SearchRecipes": "输入食材快速搜索菜谱",
"RecipeType": "菜谱类型",
"linkWeighing": "连接测量",
"Collection": "收藏",
"Ingredients": "食材",
"Suggestions": "建议",
"Calories": "热量",
"remeasure2": "重秤",
"CurrentlyWeighing": "正在称重",
"TodayMeals": "是否保存为今日饮食",
"SavedSuccessfully": "保存成功",
"ImproveData": "完善资料后查看更多",
"KeyWords": "输入关键字匹配食谱",
"KeyWordsSearch": "输入关键字后搜索",
"nextFlavor": "下一味",
"option": "选择项目",
"verifyOption": "请选择项目",
"justDta": "请输入正确数据",
"infoNowUser": "当前",
"HealthScore": "健康评分",
"StandardValue": "标准值",
"bodyData": "身体数据",
"titleInheritHeighet": "身高预测",
"titleBmi": "BMI测评",
"linkBluetoothSuccess": "连接成功,请上称测量",
"onDeviceBluetoothTips": "请确定设备已开机",
"openDeviceeMeasureTips": "请确定手机蓝牙及位置信息已打开",
"msgSuccess": "测量成功",
"msgFail": "测量失败",
"msgResetData": "数据重置中",
"FatFailure":"体脂测量失败,是否保存本次测量结果?",
"waive":"放弃"
}

View File

@ -14,9 +14,6 @@ Vue.prototype.$model = model;
// 蓝牙js
import useBluetooth from "@/toolJs/Bluetooth.js";
Vue.prototype.$ble = useBluetooth;
//模拟数据
import video from '@/video.json'
Vue.prototype.$video = video;
// 语言

View File

@ -1,37 +1,37 @@
<template>
<view class="content">
<view class="editem">
<view class="name">身高</view>
<view class="name">{{$t("infoHeight")}}</view>
<view class="right">
<input type="digit" v-model="PostData.height" placeholder="请输入身高"
<input type="digit" v-model="PostData.height" :placeholder="$t('verifyHeight')"
placeholder-style="font-size:13px;color:#666" />cm
</view>
</view>
<view class="editem">
<view class="name">体重</view>
<view class="name">{{$t("infoWeight")}}</view>
<view class="right">
<input type="digit" v-model="PostData.weight" placeholder="请输入体重"
<input type="digit" v-model="PostData.weight" :placeholder="$t('verifyWeight')"
placeholder-style="font-size:13px;color:#666" />kg
</view>
</view>
<view class="editem">
<view class="name">性别</view>
<view class="name">{{$t("infoGender")}}</view>
<view class="right radio2">
<view class="radio" @click="PostData.sex = 1">
<uni-icons :type="PostData.sex==1?'checkbox-filled':'circle'" size="24"
:color="PostData.sex==1?'#fea606':'#dfdfdf'"></uni-icons>
:color="PostData.sex==1?'#fea606':'#dfdfdf'"></uni-icons>{{$t("infoMan")}}
</view>
<view class="radio ml-15" @click="PostData.sex = 2">
<uni-icons :type="PostData.sex==2?'checkbox-filled':'circle'" size="24"
:color="PostData.sex==2?'#fea606':'#dfdfdf'"></uni-icons>
:color="PostData.sex==2?'#fea606':'#dfdfdf'"></uni-icons>{{$t("infoWoman")}}
</view>
</view>
</view>
<view class="editem">
<view class="name">出生日期</view>
<view class="name">{{$t("infoBirthday")}}</view>
<view class="right">
<picker mode="date" :value="PostData.birthday" :end="endDate" @change="bindDateChange" :fields="fields">
<view class="text">{{PostData.birthday?PostData.birthday:"请选择出生日期"}}</view>
<view class="text">{{PostData.birthday?PostData.birthday:$t('verifyBirthday')}}</view>
<icon class="iconfont icon-arrow-down-bold"></icon>
</picker>
</view>
@ -66,13 +66,12 @@
</view>
</view>
<view class="tip">
BMI是身体质量指数,是目前国际上常用的衡量人体胖瘦程度以及是否健康的一个标准.
<view class="text" v-for="(ite,ind) in configInfo.literature.bmi_evaluation"
v-if="configInfo.literature.bmi_evaluation.length">
{{ite}}
</view>
</view>
<view class="btn mt-20" @click="submit"> 立即计算</view>
<view class="btn mt-20" @click="submit">{{$t("btnBMI")}}</view>
</view>
</template>
@ -110,6 +109,9 @@
},
onLoad() {
let that = this
uni.setNavigationBarTitle({
title: this.$t('titleBmi'),
})
// #ifdef APP-PLUS
that.fields = "time"
// #endif
@ -125,20 +127,20 @@
//bmi
submit() {
var that = this;
if (!that.PostData.weight) {
this.$tools.msg("请输入体重")
if (!that.PostData.height) {
this.$tools.msg(that.$t("verifyHeight"))
return;
}
if (!that.PostData.height) {
this.$tools.msg("请输入身高")
if (!that.PostData.weight) {
this.$tools.msg(that.$t("verifyWeight"))
return;
}
if (!that.PostData.sex) {
this.$tools.msg("请选择性别")
this.$tools.msg(that.$t("verifyGender"))
return;
}
if (!that.PostData.birthday) {
this.$tools.msg("请选择年龄")
this.$tools.msg(that.$t("verifyBirthday"))
return;
}
that.$model.calcbmi(that.PostData).then(res => {

View File

@ -10,9 +10,9 @@
</view>
<view class="TrendPage">
<view class="listC">
<view @click="handleActive(1)" :class="[active==1?'active':'']">当天</view>
<view @click="handleActive(2)" :class="[active==2?'active':'']">月度</view>
<view @click="handleActive(3)" :class="[active==3?'active':'']">年度</view>
<view @click="handleActive(1)" :class="[active==1?'active':'']">{{$t("chartsDay")}}</view>
<view @click="handleActive(2)" :class="[active==2?'active':'']">{{$t("chartsMonth")}}</view>
<view @click="handleActive(3)" :class="[active==3?'active':'']">{{$t("chartsYear")}}</view>
</view>
<view class="box">
<!-- 时间选择 -->
@ -33,7 +33,7 @@
<view class="line" v-else>
<view class="nolist">
<image src="../../static/none.png"></image>
<text>暂无数据请手动添加~</text>
<text>{{$t("msgNoMoreData")}}</text>
</view>
</view>
</view>
@ -53,6 +53,7 @@
return {
weightList: [],
handTrue: true,
index: 0,
active: 1,
time: "",
}
@ -75,6 +76,9 @@
},
onShow() {
let that = this
uni.setNavigationBarTitle({
title: this.$t('titleCharts'),
})
that.active = 1
that.index = 0
that.time = that.startDate
@ -86,7 +90,7 @@
that.index = ind
that.active = 1
that.time = that.startDate
that.handleActive(that.index)
that.handleActive(that.active)
},
getList() {
let that = this

View File

@ -43,7 +43,7 @@
</view>
</view>
<view class="pkclass" v-if="length==2">vs</view>
<view :class="{'active':length!=2}" class="btn" @click="handlePK">对比</view>
<view :class="{'active':length!=2}" class="btn" @click="handlePK">{{$t("titleContrast")}}</view>
</view>
</view>
</view>
@ -86,12 +86,16 @@
},
onLoad() {
let that = this
uni.setNavigationBarTitle({
title: that.$t('titleContrast')
})
that.handlonLoad()
},
methods: {
handlePageScrollTo(id, ind) {
let that = this
that.index = ind
that.isShow = false
that.handlonLoad()
},
handlonLoad() {
@ -166,7 +170,7 @@
handlePK() {
let that = this
if (that.isActive.length != 2) {
that.$tools.msg("请先选择数据!")
that.$tools.msg(that.$t('verifyBontrast'))
return
}
let info = {}
@ -217,8 +221,8 @@
padding: 0 15px;
}
}
.calendar{
.calendar {
margin-top: 50px;
}
</style>

View File

@ -7,30 +7,32 @@
<view class="right">
<view class="name">{{memInfo.name?memInfo.name:memInfo.nickname}}</view>
<view class="top">
<view>性别{{memInfo.gender=='0'?'未知':memInfo.gender=='1'?'男':'女'}}</view>
<view class="ml-15">年龄{{user.age}}</view>
<view>
{{$t("infoGender")}}{{memInfo.gender=='0'?$t("infoUnknown"):memInfo.gender=='1'?$t("infoMan"):$t("infoWoman")}}
</view>
<view class="ml-15">{{$t("infoAge")}}{{user.age}}{{$t("infoAgeunit")}}</view>
</view>
</view>
</view>
<view class="box" v-if="acd_id==2">
<view class="item">
<view>{{memInfo.day?memInfo.day:'0'}}</view>
<text>时间()</text>
<text>{{$t("time")}}</text>
</view>
<view class="item">
<view>{{memInfo.weightdiff?Math.abs(memInfo.weightdiff):0}}</view>
<text v-if="Number(memInfo.weightdiff)>0">增重(kg)</text>
<text v-else>减重(kg)</text>
<text v-if="Number(memInfo.weightdiff)>0">{{$t("weightdiffAugment")}}(kg)</text>
<text v-else>{{$t("weightdiff")}}(kg)</text>
</view>
<view class="item">
<view>{{memInfo.fat_wdiff?Math.abs(memInfo.fat_wdiff):0}}</view>
<text v-if="Number(memInfo.fat_wdiff)>0">增脂(kg)</text>
<text v-else>减脂(kg)</text>
<text v-if="Number(memInfo.fat_wdiff)>0">{{$t("fatWdiffAugment")}}(kg)</text>
<text v-else>{{$t("fatWdiff")}}(kg)</text>
</view>
<view class="time">
<view>
<uni-icons class="t-icon t-icon-shijian-mianxing-0"></uni-icons>{{memInfo.time}}
</view>数据变化
</view>{{$t("changeData")}}
</view>
</view>
<view class="boxTime" v-else>
@ -38,15 +40,15 @@
<uni-icons class="t-icon t-icon-shijian-mianxing-0 mr-10 size18"></uni-icons>
{{memInfo.time}}
</view>
数据变化
{{$t("changeData")}}
</view>
<view class="control">
<!-- 名称 -->
<view class="title">
<view class="name"></view>
<view>趋势</view>
<view>之前</view>
<view>之后</view>
<view>{{$t("trend")}}</view>
<view>{{$t("before")}}</view>
<view>{{$t("after")}}</view>
</view>
<view v-for="(ite,ind) in listStr" :key="ind" class="li">
<view class="name">
@ -54,8 +56,8 @@
</view>
<view class="num">
<text>{{ite.diffval}}</text>
<icon class="t-icon t-icon-xia" v-if="ite.diffval.includes('-')"></icon>
<icon class="t-icon t-icon-shang" v-else></icon>
<icon class="t-icon t-icon-xia" v-if="Number(ite.diffval)>0"></icon>
<icon class="t-icon t-icon-shang" v-if="Number(ite.diffval)<0"></icon>
<icon class="t-icon t-icon-hengxian"
v-if="!ite.diffval||ite.diffval=='0.00'||ite.diffval=='00:00:00'"></icon>
</view>
@ -89,6 +91,11 @@
computed: {
...mapState(["user"]),
},
onLoad() {
uni.setNavigationBarTitle({
title: this.$t('titleDetail'),
})
},
methods: {
handleSharepic(info) {
let that = this

View File

@ -6,34 +6,34 @@
<view>
<text class="weight">{{weight?weight:'0.00'}}</text>{{unit}}
</view>
<view class="typeInfo" v-if="typeInfo!=0">{{typeInfo==2?'稳定重量':'实时重量'}}</view>
<view class="typeInfo" v-if="typeInfo!=0">{{typeInfo==2?$t("StableWeight"):$t("realTimeWeight")}}</view>
</view>
<view class="btnGroup" v-if="isSave">
<view :class="[IsLing?'disabled':'btnClose']" @click="handleIsLing">清零</view>
<view class="baocun" @click="handleIsNum">锁定</view>
<view :class="[IsLing?'disabled':'btnClose']" @click="handleIsLing">{{$t("zeroBtn")}}</view>
<view class="baocun" @click="handleIsNum">{{$t("LockBtn")}}</view>
</view>
<view class="tips">
<text>提示</text>
<text>1.请确定设备是开机状态</text>
<text>2.请确定手机蓝牙位置信息已打开</text>
<text>{{$t("msgTitle")}}</text>
<text>1.{{$t("onDeviceBluetoothTips")}}</text>
<text>2.{{$t("openDeviceeMeasureTips")}}</text>
</view>
</view>
<!-- 手动记录 -->
<view class="wrapper" v-if="isHeight">
<view class="bg"></view>
<view class="Blue">
<view class="h4">测量结果提示</view>
<view class="h4">{{$t("measureResultTips")}}</view>
<view class="Blue-box">
本次测量体重是<text>{{weight}}{{unit}}</text>
{{$t("nowWeight")}}<text>{{weight}}{{unit}}</text>
</view>
<view class="Blue-box">
上次测量身高是<input v-model="height" type="digit" placeholder="请输入身高" />cm
{{$t("lastHeight")}}<input v-model="height" type="digit" :placeholder="$t('verifyHeight')" />cm
</view>
<view class="Blue-box" v-if="userInfo.stage==3">
上次测量头围是<input v-model="head" type="digit" placeholder="请输入头围" />cm
{{$t("lastHead")}}<input v-model="head" type="digit" :placeholder="$t('verifyHead')" />cm
</view>
<view class="Blue-btn Blue-close" @click="handleBack">重新测量</view>
<view class="Blue-btn" @click="handleGetMeasure">保存结果</view>
<view class="Blue-btn Blue-close" @click="handleBack">{{$t("remeasure")}}</view>
<view class="Blue-btn" @click="handleGetMeasure">{{$t("SaveResult")}}</view>
</view>
</view>
</view>
@ -90,7 +90,7 @@
isBluetoothTyle: function() {
let that = this
if (!that.isBluetoothTyle) {
that.$tools.showModal('蓝牙连接已断开,请重新连接后测量')
that.$tools.showModal(that.$t("linkBluetoothFail2"))
}
},
bleValue: {
@ -142,7 +142,7 @@
that.$store.commit("changeBluetoothValue", {
type: 1,
isConnectStatus: 2,
bleTipsText: "蓝牙连接成功,请上秤测量",
bleTipsText:that.$t("linkBluetoothSuccess"),
})
uni.notifyBLECharacteristicValueChange({
deviceId: that.deviceId,
@ -283,7 +283,7 @@
handleGetMeasure() {
let that = this
if (!that.height) {
this.$tools.msg("请输入身高")
this.$tools.msg(that.$t("verifyHeight"))
return
}
that.$model.getmeasurefunit({
@ -302,9 +302,9 @@
that.$store.dispatch("getResult", {
aud_id: that.user.aud_id
})
that.$tools.msg("测量成功")
that.$tools.msg(that.$t("msgSuccess"))
} else {
that.$tools.msg("测量失败")
that.$tools.msg(that.$t("msgFail"))
}
setTimeout(function() {
@ -329,7 +329,7 @@
success: res => {
console.log('下发指令成功', res.errMsg)
uni.showToast({
title: '数据重置中',
title: that.$t("msgResetData"),
icon: "none"
})
console.log("重置", that.typeInfo, that.weight)

View File

@ -7,24 +7,24 @@
<image src="/pageTwo/static/HC.png" class="image3"></image>
</view>
<view class="tips">
<view>提示</view>
<text>1.请确定设备已开机</text>
<text>2.请确定手机蓝牙及位置信息已打开</text>
<text>{{$t("msgTitle")}}</text>
<text>1.{{$t("onDeviceBluetoothTips")}}</text>
<text>2.{{$t("openDeviceeMeasureTips")}}</text>
</view>
</view>
<!-- 手动记录 -->
<view class="wrapper" v-if="isHeight">
<view class="bg"></view>
<view class="Blue">
<view class="h4">测量结果提示</view>
<view class="h4">{{$t("measureResultTips")}}</view>
<view class="Blue-box">
本次测量身高为<text>{{height}}{{unit}}</text>
{{$t("nowHeight")}}<text>{{height}}{{unit}}</text>
</view>
<view class="Blue-box">
上次测量体重为<input v-model="weight" type="digit" placeholder="请输入体重" />kg
{{$t("lastWeight")}}<input v-model="weight" type="digit" :placeholder="$t('verifyWeight')" />kg
</view>
<view class="Blue-btn Blue-close" @click="handleHeight">重新测量</view>
<view class="Blue-btn" @click="handleGetMeasure">保存测量结果</view>
<view class="Blue-btn Blue-close" @click="handleHeight">{{$t("remeasure")}}</view>
<view class="Blue-btn" @click="handleGetMeasure">{{$t("SaveResult")}}</view>
</view>
</view>
</view>
@ -78,7 +78,7 @@
isBluetoothTyle: function() {
let that = this
if (!that.isBluetoothTyle) {
that.$tools.showModal('蓝牙连接已断开,请重新连接后测量')
that.$tools.showModal(that.$t("linkBluetoothFail2"))
}
},
bleValue: {
@ -116,7 +116,7 @@
that.$store.commit("changeBluetoothValue", {
type: 1,
isConnectStatus: 2,
bleTipsText: "蓝牙连接成功,请开始测量",
bleTipsText: $t("linkBluetoothSuccess"),
})
uni.notifyBLECharacteristicValueChange({
deviceId: that.deviceId,
@ -167,7 +167,7 @@
that.unit = "ft"
}
if (Number(data) < 20) {
that.text = "操作错误,请重新测量"
that.text = that.$t("errorOperation")
} else {
if (unit == "2") {
let data1 = data / 12
@ -178,7 +178,7 @@
that.height2 = data
that.height = data
}
that.text = "您的身高是:" + 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)
@ -194,7 +194,7 @@
let that = this
let height = 0
if (!that.weight) {
that.$tools.msg("请输入体重")
that.$tools.msg(that.$t("verifyWeight"))
return
}
if (that.unit == 'ft') {
@ -217,9 +217,9 @@
that.$store.dispatch("getResult", {
aud_id: that.user.aud_id
})
that.$tools.msg("测量成功")
that.$tools.msg(that.$t("msgSuccess"))
} else {
that.$tools.msg("测量失败")
that.$tools.msg(that.$t("msgFail"))
}
setTimeout(function() {
uni.switchTab({

View File

@ -1,30 +1,30 @@
<template>
<view class="weightPages">
<view class="content ">
<view class="title">连接成功开始测量</view>
<view class="title">{{$t("linkBluetoothSuccess")}}</view>
<view class="text">{{text}}</view>
<view class="image">
<image src="/pageTwo/static/PCL.gif" class="image3"></image>
</view>
<view class="tips">
<view>提示</view>
<text>1.请确定设备已开机</text>
<text>2.请确定手机蓝牙及位置信息已打开</text>
<text>{{$t("msgTitle")}}:</text>
<text>1.{{$t("onDeviceBluetoothTips")}}</text>
<text>2.{{$t("openDeviceeMeasureTips")}}</text>
</view>
</view>
<!-- 手动记录 -->
<view class="wrapper" v-if="isHeight">
<view class="bg"></view>
<view class="Blue">
<view class="h4">测量结果提示</view>
<view class="h4">{{$t("measureResultTips")}}</view>
<view class="Blue-box">
本次测量体重为<text>{{weight}}{{unit}}</text>
{{$t("nowWeight")}}<text>{{weight}}{{unit}}</text>
</view>
<view class="Blue-box">
上次测量身高为<input v-model="height" type="digit" placeholder="请输入身高" />cm
{{$t("lastHeight")}}<input v-model="height" type="digit" :placeholder="$t('verifyHeight')" />cm
</view>
<view class="Blue-btn Blue-close" @click="handleBack">取消</view>
<view class="Blue-btn" @click="handleGetMeasure">保存测量结果</view>
<view class="Blue-btn Blue-close" @click="handleBack">{{$t("remeasure")}}</view>
<view class="Blue-btn" @click="handleGetMeasure">{{$t("SaveResult")}}</view>
</view>
</view>
</view>
@ -67,7 +67,7 @@
that.$store.commit("changeBluetoothValue", {
isFood: false,
isConnectStatus: 1,
bleTipsText: "点击重新连接",
bleTipsText: that.$t("ConnectionTimeout"),
})
that.$store.commit("changehomeCard", 0);
that.$ble.stopBluetoothDevicesDiscovery() //
@ -76,7 +76,7 @@
isBluetoothTyle: function() {
let that = this
if (!that.isBluetoothTyle) {
that.$tools.showModal('蓝牙连接已断开,请重新连接后测量')
that.$tools.showModal(that.$t("linkBluetoothFail2"))
}
},
stopblue: function() {
@ -120,9 +120,9 @@
data = data / 100
}
}
that.text = "您的实时体重是:" + data + that.unit
that.text = that.$t("realTimeWeight") + data + that.unit
if (type == "1") {
that.text = "您的稳定体重是:" + 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
@ -139,7 +139,7 @@
handleGetMeasure() {
let that = this
if (!that.height) {
this.$tools.msg("请输入身高")
this.$tools.msg(that.$t("verifyHeight"))
return
}
that.$model.getmeasurefunit({
@ -156,9 +156,9 @@
that.$store.dispatch("getResult", {
aud_id: that.user.aud_id
})
that.$tools.msg("测量成功")
that.$tools.msg(that.$t("msgSuccess"))
} else {
that.$tools.msg("测量失败")
that.$tools.msg(that.$t("msgFail"))
}
setTimeout(function() {
that.handleBack()

View File

@ -1,30 +1,30 @@
<template>
<view class="weightPages">
<view class="content ">
<view class="title">连接成功开始测量</view>
<view class="title">{{$t("linkBluetoothSuccess")}}</view>
<view class="text">{{text}}</view>
<view class="image">
<image src="/pageTwo/static/PCL.gif" class="image3"></image>
</view>
<view class="tips">
<view>提示</view>
<text>1.请确定设备已开机</text>
<text>2.请确定手机蓝牙及位置信息已打开</text>
<text>{{$t("msgTitle")}}:</text>
<text>1.{{$t("onDeviceBluetoothTips")}}</text>
<text>2.{{$t("openDeviceeMeasureTips")}}</text>
</view>
</view>
<!-- 手动记录 -->
<view class="wrapper" v-if="isHeight">
<view class="bg"></view>
<view class="Blue">
<view class="h4">测量结果提示</view>
<view class="h4">{{$t("measureResultTips")}}</view>
<view class="Blue-box">
本次测量体重为<text>{{weight}}{{unit}}</text>
{{$t("nowWeight")}}<text>{{weight}}{{unit}}</text>
</view>
<view class="Blue-box">
上次测量身高为<input v-model="height" type="digit" placeholder="请输入身高" />cm
{{$t("lastHeight")}}<input v-model="height" type="digit" :placeholder="$t('verifyHeight')" />cm
</view>
<view class="Blue-btn Blue-close" @click="handleBack">取消</view>
<view class="Blue-btn" @click="handleGetMeasure">保存测量结果</view>
<view class="Blue-btn Blue-close" @click="handleBack">{{$t("remeasure")}}</view>
<view class="Blue-btn" @click="handleGetMeasure">{{$t("SaveResult")}}</view>
</view>
</view>
</view>
@ -50,7 +50,7 @@
}
},
computed: {
...mapState(["user", "bleValue"]),
...mapState(["user", "bleValue", "isBluetoothTyle"]),
info() {
return this.user
},
@ -68,12 +68,18 @@
that.$store.commit("changeBluetoothValue", {
isFood: false,
isConnectStatus: 1,
bleTipsText: "点击重新连接",
bleTipsText: that.$t("ConnectionTimeout"),
})
that.$store.commit("changehomeCard", 0);
that.$ble.stopBluetoothDevicesDiscovery() //
},
watch: {
isBluetoothTyle: function() {
let that = this
if (!that.isBluetoothTyle) {
that.$tools.showModal(that.$t("linkBluetoothFail2"))
}
},
stopblue: function() {
let that = this
if (!that.stopblue) {
@ -125,14 +131,14 @@
if (status == "0") {
that.typeInfo = 0
that.stopblue = false
that.text = "您的实时体重是:" + 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 = "您的稳定体重是:" + weight + that.unit
that.text = that.$t("StableWeight")+ weight + that.unit
that.weight = weight
that.stopblue = true
that.$ble.stopBluetoothDevicesDiscovery() //
@ -147,7 +153,7 @@
handleGetMeasure() {
let that = this
if (!that.height) {
this.$tools.msg("请输入身高")
this.$tools.msg(that.$t("verifyHeight"))
return
}
that.$model.getmeasurefunit({
@ -164,9 +170,9 @@
that.$store.dispatch("getResult", {
aud_id: that.user.aud_id
})
that.$tools.msg("测量成功")
that.$tools.msg(that.$t("msgSuccess"))
} else {
that.$tools.msg("测量失败")
that.$tools.msg(that.$t("msgFail"))
}
setTimeout(function() {
that.handleBack()

View File

@ -1,30 +1,30 @@
<template>
<view class="weightPages">
<view class="content ">
<view class="title">连接成功开始测量</view>
<view class="title">{{$t("linkBluetoothSuccess")}}</view>
<view class="text">{{text}}</view>
<view class="image">
<image src="/pageTwo/static/PCL.gif" class="image3"></image>
</view>
<view class="tips">
<view>提示</view>
<text>1.请确定设备已开机</text>
<text>2.请确定手机蓝牙及位置信息已打开</text>
<text>{{$t("msgTitle")}}:</text>
<text>1.{{$t("onDeviceBluetoothTips")}}</text>
<text>2.{{$t("openDeviceeMeasureTips")}}</text>
</view>
</view>
<!-- 手动记录 -->
<view class="wrapper" v-if="isHeight">
<view class="bg"></view>
<view class="Blue">
<view class="h4">测量结果提示</view>
<view class="h4">{{$t("measureResultTips")}}</view>
<view class="Blue-box">
本次测量体重为<text>{{weight}}{{unit}}</text>
{{$t("nowWeight")}}<text>{{weight}}{{unit}}</text>
</view>
<view class="Blue-box">
上次测量身高为<input v-model="height" type="digit" placeholder="请输入身高" />cm
{{$t("lastHeight")}}<input v-model="height" type="digit" :placeholder="$t('verifyHeight')" />cm
</view>
<view class="Blue-btn Blue-close" @click="handleBack">取消</view>
<view class="Blue-btn" @click="handleGetMeasure">保存测量结果</view>
<view class="Blue-btn Blue-close" @click="handleBack">{{$t("remeasure")}}</view>
<view class="Blue-btn" @click="handleGetMeasure">{{$t("SaveResult")}}</view>
</view>
</view>
</view>
@ -69,9 +69,8 @@
that.$store.commit("changeBluetoothValue", {
isFood: false,
isConnectStatus: 1,
bleTipsText: "点击重新连接",
bleTipsText: that.$t("ConnectionTimeout"),
})
that.$store.commit("changehomeCard", 0);
that.$ble.stopBluetoothDevicesDiscovery() //
},
watch: {
@ -105,11 +104,11 @@
if (type == "d") {
that.typeInfo = 0
that.stopblue = false
that.text = "您的实时体重是:" + weight + 'kg'
that.text = that.$t("realTimeWeight") + weight + 'kg'
}
if (type == "e") {
that.typeInfo = 1
that.text = "您的稳定体重是:" + 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
@ -125,7 +124,7 @@
handleGetMeasure() {
let that = this
if (!that.height) {
this.$tools.msg("请输入身高")
this.$tools.msg(that.$t("verifyHeight"))
return
}
that.$model.getmeasurefunit({
@ -143,9 +142,9 @@
that.$store.dispatch("getResult", {
aud_id: that.user.aud_id
})
that.$tools.msg("测量成功")
that.$tools.msg(that.$t("msgSuccess"))
} else {
that.$tools.msg("测量失败")
that.$tools.msg(that.$t("msgFail"))
}
setTimeout(function() {
that.handleBack()

View File

@ -1,38 +1,38 @@
<template>
<view class="content skipping">
<!--自由训练 -->
<view class="title">{{info.active==1?'自由跳':info.active==2?'倒计时':'倒计数'}}</view>
<view class="title">{{info.active==1?$t("jumpFree"):info.active==2?$t("Countdown"):$t("backwardCount")}}</view>
<view class="skiptop">
<view class="item">
<view class="item-ite">{{info.active==1?'自由次数':info.active==2?"个数":'目标次数'}}<text>{{weight}}</text>
<view class="item-ite">{{info.active==1?$t("jumpFreeDegree"):info.active==2?$t("jumpFreeNumber"):$t("jumpTargetDegree")}}<text>{{weight}}</text>
</view>
<view class="item-ite">
{{info.active==2?'目标时长 分:秒':"分:秒"}}<text>{{time_m?time_m:'00'}}:{{time_s?time_s:'00'}}</text>
{{info.active==2?$t("jumpTargetTime"):$t("MinuteSecond")}}<text>{{time_m?time_m:'00'}}:{{time_s?time_s:'00'}}</text>
</view>
<view class="item-ite">消耗/kcal<text>{{Math.floor(kcal)}}</text></view>
<view class="item-ite">{{$t("Consumed")}}/kcal<text>{{Math.floor(kcal)}}</text></view>
</view>
</view>
<view class="image">
<image src="/pageTwo/static/t01.gif"></image>
</view>
<view class="end" @longpress="onlongpress">长按结束</view>
<view class="end" @longpress="onlongpress">{{$t("LongpressEnd")}}</view>
<!-- 报告 -->
<view class="wrapper" v-if="iswrapper">
<view class="bg">
<view class="edit">
<view class="editem">
<view>平均速度<text class="cyello Blue size20 mr-5">{{bpm.toFixed(1)}}</text>bpm</view>
<view class="size12 c999 ">(bpm=/分钟)</view>
<view>{{$t("AverageSpeed")}}<text class="cyello Blue size20 mr-5">{{bpm.toFixed(1)}}</text>bpm</view>
<view class="size12 c999 ">(bpm= {{$t("Unit")}})</view>
</view>
<view class="center">
<view class="left">
<image src="/pageTwo/static/duan.png"></image>
<view class="name">
<view>
中断次数
{{$t("Numberofinterrupts")}}
</view>
<view>
<text class="cyello Blue size20 mr-5">{{Bcount}}</text>
<text class="cyello Blue size20 mr-5">{{Bcount}}</text>{{$t("Times")}}
</view>
</view>
</view>
@ -41,20 +41,20 @@
<image src="/pageTwo/static/xu.png"></image>
<view class="name">
<view>
最长连续
{{$t("LongestConsecutive")}}
</view>
<view>
<text class="cyello Blue size20 mr-5">{{continuous}}</text>
<text class="cyello Blue size20 mr-5">{{continuous}}</text>{{$t("Number")}}
</view>
</view>
</view>
</view>
<view class="item">
<view class="item-ite"><text>{{weight}}</text>训练个数</view>
<view class="item-ite"><text>{{time_m?time_m:'00'}}:{{time_s?time_s:'00'}}</text>:</view>
<view class="item-ite"><text>{{Math.floor(kcal)}}</text>消耗/kcal</view>
<view class="item-ite"><text>{{weight}}</text>{{$t("trainingsNumber")}}</view>
<view class="item-ite"><text>{{time_m?time_m:'00'}}:{{time_s?time_s:'00'}}</text>{{$t("MinuteSecond")}}</view>
<view class="item-ite"><text>{{Math.floor(kcal)}}</text>{{$t("Consumed")}}/kcal</view>
</view>
<view class="btn" @click="handleTarget">完成</view>
<view class="btn" @click="handleTarget">{{$t("complete")}}</view>
</view>
</view>
</view>
@ -89,12 +89,8 @@
computed: {
...mapState(["bleValue", "user", "isBluetoothTyle"]),
},
onHide() {
console.log("PCT01返回onHide", innerAudioContext)
},
onLoad(options) {
let that = this
innerAudioContext = uni.createInnerAudioContext()
if (options && options.info) {
let info = options.info
that.info = JSON.parse(info)
@ -106,22 +102,20 @@
that.handleStart('连续')
}, 1200)
}
that.handleAudioStart()
},
onUnload: function() {
let that = this
innerAudioContext.destroy();
that.handleEnd()
console.log("PCT01返回onUnload", innerAudioContext)
},
watch: {
isBluetoothTyle: function() {
let that = this
if (!that.isBluetoothTyle) {
uni.showModal({
title: '连接已断开',
content: '训练过程中已与设备连接中断,请重新连接设备再开始训练',
title:that.$t("linkBluetoothFail"),
content: that.$t("deviceDisconnection"),
showCancel: false,
confirmText: that.$t("btnConfirm"),
success: function(res) {
if (res.confirm) {
that.handleTarget()
@ -131,22 +125,15 @@
console.log("蓝牙是否连接", that.isBluetoothTyle)
}
},
//
isStart: function() {
let that = this
if (that.isStart) {
that.handleAudio()
}
},
//
isToggle: function() {
let that = this
if (that.isToggle) {
uni.showModal({
title: '友情提示',
content: '训练过程中请勿切换训练,返回训练',
title: that.$t("msgTitle"),
content: that.$t("ToggleTrainingsTips"),
showCancel: false,
confirmText: that.$t("btnConfirm"),
success: function(res) {
if (res.confirm) {
setTimeout(function() {
@ -172,93 +159,8 @@
}, 400)
}
},
//
weight: function() {
let that = this
if (that.info.active == 1) {
that.$video.video.forEach(ite => {
if (Number(ite.name) == that.weight) {
innerAudioContext.autoplay = true;
innerAudioContext.loop = false;
innerAudioContext.src = ite.video;
innerAudioContext.play()
setTimeout(function() {
innerAudioContext.stop();
that.handleAudio()
}, 3000)
}
})
}
if (that.info.active == 2) {
let time = that.time_m * 60 + that.time_s
that.$video.video.forEach(ite => {
if ((Number(ite.name) == that.weight) && (Number(time) > 10)) {
innerAudioContext.autoplay = true;
innerAudioContext.loop = false;
innerAudioContext.src = ite.video;
innerAudioContext.play()
setTimeout(function() {
innerAudioContext.stop();
that.handleAudio()
}, 3000)
}
})
if (that.time_m == "00" && that.time_s == "10") {
innerAudioContext.autoplay = true;
innerAudioContext.loop = false;
innerAudioContext.src = '/pageTwo/static/time.mp3';
innerAudioContext.play()
setTimeout(function() {
innerAudioContext.stop();
that.handleAudio()
}, 3000)
}
}
if (that.info.active == 3) {
that.$video.video.forEach(ite => {
if ((Number(ite.name) == (Number(that.Ycount) - Number(that.weight))) && Number(that
.weight) != 0) {
innerAudioContext.autoplay = true;
innerAudioContext.loop = false;
innerAudioContext.src = ite.video;
innerAudioContext.play()
setTimeout(function() {
innerAudioContext.stop();
that.handleAudio()
}, 3000)
}
})
if (Number(that.weight) == 10) {
innerAudioContext.autoplay = true;
innerAudioContext.loop = false;
innerAudioContext.src = '/pageTwo/static/number.mp3';
innerAudioContext.play()
setTimeout(function() {
innerAudioContext.stop();
that.handleAudio()
}, 3000)
}
}
},
},
methods: {
handleAudioStart() {
let that = this
innerAudioContext.autoplay = true;
innerAudioContext.loop = false;
innerAudioContext.src = '/pageTwo/static/Start.mp3';
innerAudioContext.play()
setTimeout(function() {
innerAudioContext.stop();
that.handleAudio()
}, 5000)
},
handleAudio() {
innerAudioContext.autoplay = true;
innerAudioContext.loop = true;
innerAudioContext.src = '/pageTwo/static/flight.mp3';
innerAudioContext.play()
},
//
notifyBLECharacteristicValue() {
let that = this;
@ -346,14 +248,14 @@
console.log('短震动');
if (Number(that.time) < 10) {
uni.showModal({
title: '友情提示',
content: '本次跳绳时间低于10秒记录将不会被保存',
confirmText: "继续",
cancelText: "返回",
title: that.$t("msgTitle"),
content: that.$t("NOComplete"),
confirmText: that.$t("btnContinue"),
cancelText: that.$t("btnBack"),
success: function(res) {
if (res.cancel) {
that.isStart = false
innerAudioContext.stop();
// innerAudioContext.stop();
uni.navigateBack({ //
delta: 1
})
@ -402,7 +304,7 @@
}).then(res => {
console.log("保存", that.time, res)
that.isStart = false
innerAudioContext.stop()
// innerAudioContext.stop()
if (res.code == 0) {
that.bpm = that.weight / (that.time / 60)
that.iswrapper = true
@ -453,7 +355,7 @@
},
handleTarget() {
let that = this
innerAudioContext.stop();
// innerAudioContext.stop();
uni.navigateBack({ //
delta: 1
})

View File

@ -6,12 +6,12 @@
<view>
<text class="weight">{{weightPage?weightPage:'0.00'}}</text>
</view>
<view class="typeInfo" v-if="typeInfo!=0">{{typeInfo==2?'稳定重量':'实时重量'}}</view>
<view class="typeInfo" v-if="typeInfo!=0">{{typeInfo==2?$t('StableWeight'):$t('realTimeWeight')}}</view>
</view>
<view class="tips">
<text>提示</text>
<text>1.请确定设备是开机状态</text>
<text>2.请确定手机蓝牙位置信息已打开</text>
<text>{{$t("msgTitle")}}:</text>
<text>1.{{$t("onDeviceBluetoothTips")}}</text>
<text>2.{{$t("openDeviceeMeasureTips")}}</text>
</view>
</view>
</view>
@ -67,7 +67,7 @@
isBluetoothTyle() {
let that = this
if (!that.isBluetoothTyle) {
that.$tools.showModal('蓝牙连接已断开,请重新连接后测量')
that.$tools.showModal(that.$t("linkBluetoothFail2"))
}
},
bleValue: {
@ -88,10 +88,10 @@
if (that.imp == 0 || that.leftHandImp == 0 || that.rightHandImp ==
0 || that.leftFootImp == 0 || that.rightFootImp == 0) {
uni.showModal({
title: '提示',
content: "体脂测量失败,是否保存本次测量结果?",
cancelText: "放弃",
confirmText: "保存",
title: that.$t("msgTitle"),
content: that.$t("FatFailure"),
cancelText: that.$t("waive"),
confirmText: that.$t("Save"),
success(res) {
if (res.confirm) {
that.imp = 0
@ -131,7 +131,7 @@
that.$store.commit("changeBluetoothValue", {
type: 1,
isConnectStatus: 2,
bleTipsText: "蓝牙连接成功,请上秤测量",
bleTipsText: that.$t("linkBluetoothSuccess"),
})
uni.notifyBLECharacteristicValueChange({
deviceId: that.deviceId,
@ -259,7 +259,7 @@
handleGetMeasure() {
let that = this
if (!that.height) {
this.$tools.msg("请输入身高")
this.$tools.msg(that.$t("verifyHeight"))
return
}
that.$model.getmeasurefunit({
@ -281,9 +281,9 @@
that.$store.dispatch("getResult", {
aud_id: that.user.aud_id
})
that.$tools.msg("测量成功")
that.$tools.msg(that.$t("msgSuccess"))
} else {
that.$tools.msg("测量失败")
that.$tools.msg(that.$t("msgFail"))
}
setTimeout(function() {
uni.switchTab({

View File

@ -25,11 +25,11 @@
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<view class="endtext" v-if="!lastPage || page >= lastPage"> 到底了看看别的吧 </view>
<view class="endtext" v-if="!lastPage || page >= lastPage"> {{$t("msgBottom")}} </view>
</view>
<view class="nolist" v-if="!lastPage">
<image src="../../static/none.png"></image>
<text>暂无数据</text>
<text>{{$t("msgNoMoreData")}}</text>
</view>
</view>
</template>
@ -57,6 +57,9 @@
},
onLoad() {
let that = this
uni.setNavigationBarTitle({
title: this.$t('HistoricalRcord'),
})
that.$nextTick(() => {
that.getList()
})
@ -66,7 +69,7 @@
console.log("onReachBottom", this.lastPage)
if (!this.lastPage || this.page >= this.lastPage) {
uni.showToast({
title: '没有更多数据!',
title: that.$t("noMoreData"),
icon: 'none'
})
return
@ -79,8 +82,10 @@
let that = this
let id = that.ranklist[index].id
uni.showModal({
title: '友情提示',
content: '是否删除当前测量记录?',
title: that.$t("msgTitle"),
content: that.$t("verifyDeleteHistory"),
cancelText: that.$t("btnSancellation"), //
confirmText: that.$t("btnConfirm"), //
success: function(res) {
if (res.confirm) {
that.$model.getPublicHistoryDel({
@ -92,10 +97,10 @@
return
}
that.ranklist.splice(index, 1)
that.$tools.msg("删除成功")
that.$tools.msg(that.$t("msgDelete"))
})
} else if (res.cancel) {
that.$tools.msg("您已取消操作!");
that.$tools.msg(that.$t("msgCancel"));
}
},
})
@ -121,13 +126,13 @@
let that = this
that.$model.getPublicHistory({
aud_id: that.user.aud_id,
page: that.page,
page_num: that.page,
type: that.publicRecordInfo[that.index].key_word,
}).then((res) => {
console.log("历史记录", res)
if (res.code != 0) return
let options = [{
text: '删除',
text: that.$t("btnDelete"),
style: {
backgroundColor: '#dd524d'
}

View File

@ -36,6 +36,9 @@
// },
onLoad(options) {
let that = this
uni.setNavigationBarTitle({
title: this.$t('titleDetail'),
})
that.id = options.id
that.type = options.type
that.getList()

View File

@ -1,51 +1,51 @@
<template>
<view class="content">
<view class="top">
<text>成年身高预测</text>
为保证数据准确定请认真填写真实信息
<text>{{$t("inheritHeighet.title")}}</text>
{{$t("inheritHeighet.tips0")}}
</view>
<view class="table">
<view class="tr">
<view class="text">性别</view>
<view class="text">{{$t("infoGender")}}</view>
<view class="td">
<view class="radio">
<uni-icons :type="sex==1?'checkbox-filled':'circle'" @click="sex=1" size="24"
:color="sex==1?'#fea606':'#dfdfdf'"></uni-icons>
:color="sex==1?'#fea606':'#dfdfdf'"></uni-icons>{{$t("infoMan")}}
</view>
<view class="radio ml-10">
<uni-icons :type="sex==2?'checkbox-filled':'circle'" @click="sex=2" size="24"
:color="sex==2?'#fea606':'#dfdfdf'"></uni-icons>
:color="sex==2?'#fea606':'#dfdfdf'"></uni-icons>{{$t("infoWoman")}}
</view>
</view>
</view>
<view class="tr">
<view class="text">出生日期</view>
<view class="text">{{$t("infoBirthday")}}</view>
<view class="td">
<picker mode="date" :end="endDate" @change="maskClick" :value="birthday?birthday:endDate"
:fields="fields">
<view class="uni-input">
{{birthday?birthday:'请选择'}}
{{birthday?birthday:$t("verifyPicker")}}
<icon class="iconfont icon-arrow-down-bold"></icon>
</view>
</picker>
</view>
</view>
<view class="tr">
<view class="text">爸爸身高</view>
<view class="text">{{$t("inheritHeighet.dad")}}</view>
<view class="td">
<input class="input" type="digit" v-model="dadheight " placeholder="请输入">cm
<input class="input" type="digit" v-model="dadheight " :placeholder="$t('verifyPicker')">cm
</view>
</view>
<view class="tr">
<view class="text">妈妈身高</view>
<view class="text">{{$t("inheritHeighet.mom")}}</view>
<view class="td">
<input class="input" type="digit" v-model="momheight" placeholder="请输入">cm
<input class="input" type="digit" v-model="momheight" :placeholder="$t('verifyPicker')">cm
</view>
</view>
</view>
<view class="table table2">
<view class="text">当前标准身高</view>
<view class="text">成年身高预测</view>
<view class="text">{{$t("inheritHeighet.geneticheight")}}</view>
<view class="text">{{$t("inheritHeighet.adultheight")}}</view>
<view class="td">
<text>{{geneticheight}}</text>cm
</view>
@ -54,12 +54,12 @@
<text class="text2" v-if="errorvalue">±{{errorvalue}}</text> cm
</view>
</view>
<view class="btn mb-15" @click="handleClick">立即计算</view>
<view class="btn mb-15" @click="handleClick">{{$t("btnBMI")}}</view>
<view class="title mt-20">
<view class="h5">如果当前实际身高当前标准身高</view>
<view class="con">孩子后天生长环境不利长高请从饮食睡眠运动情绪等方面排查加强后天因素管理让孩子处于最佳长高状态</view>
<view class="h5">如果当前实际身高当前标准身高</view>
<view class="con">孩子后天生长环境有利长高请继续保持加强后天因素管理孩子成年可比标准高10cm以上</view>
<view class="h5">{{$t("inheritHeighet.tips1")}}</view>
<view class="con">{{$t("inheritHeighet.tips2")}}</view>
<view class="h5">{{$t("inheritHeighet.tips3")}}</view>
<view class="con">{{$t("inheritHeighet.tips4")}}</view>
<view class="con" v-for="(ite,ind) in configInfo.literature.height_prediction"
v-if="configInfo.literature.height_prediction.length">
{{ite}}
@ -94,6 +94,9 @@
},
onLoad() {
let that = this
uni.setNavigationBarTitle({
title: this.$t('inheritHeighet.title'),
})
// #ifdef APP-PLUS
that.fields = "time"
// #endif
@ -105,15 +108,19 @@
handleClick() {
let that = this
if (!that.dadheight) {
that.$tools.msg("请输入爸爸身高!");
that.$tools.msg(that.$t("verifyHeightDad"));
return
}
if (!that.momheight) {
that.$tools.msg("请输入妈妈身高!");
that.$tools.msg(that.$t("verifyHeightMom"));
return
}
if (!that.birthday) {
that.$tools.msg(that.$t("verifyBirthday"));
return
}
uni.showLoading({
title: '计算中'
title:that.$t("msgCalculating")
});
that.$model.GetPredictheight({
dadHeight: that.dadheight,

View File

@ -2,17 +2,15 @@
<view class="content">
<!-- -->
<view class="skiptop">
<!-- <view class="status" @click="$Bluetooth.handleDevicesMac(isdevice,acd_id)"><text>设备连接</text></view> -->
<view class="item">
<view class="item-ite">平均吸气肺活量<text>{{info?info.average:'--'}}</text></view>
<view class="item-ite">吸气速度<text>--</text></view>
<view class="item-ite">是否达标<text>{{info?info.level:'--'}}</text></view>
<view class="item-ite">{{$t("averagelungsuction")}}<text>{{info?info.average:'--'}}</text></view>
<view class="item-ite">{{$t("lungsuctionspeed")}}<text>--</text></view>
<view class="item-ite">{{$t("isMarginal")}}<text>{{info?info.level:'--'}}</text></view>
</view>
</view>
<!--自由训练 -->
<view class="box1">
<view class="time">{{info?info.time:''}}</view>
<!-- <view class="LiuS">吸气速度 <text class="cgreen ml-5">{{info?info.flow_val:'--'}}L/min</text></view> -->
<view class="item">
<view class="image">
<image src="../../static/bae.png" mode="widthFix"></image>
@ -27,10 +25,10 @@
</view>
</view>
</view>
<view class="val" v-if="info">
<!-- <view class="val" v-if="info">
<text>{{info.average}}</text>
吸气肺活量平均值
</view>
吸气肺活量平均值{{$t("infoGender")}}
</view> -->
</view>
</view>
</template>
@ -54,6 +52,9 @@
},
onLoad(options) {
let that = this
uni.setNavigationBarTitle({
title: this.$t('titlevVitalcapacity'),
})
that.$store.dispatch("getLungResult", {
aud_id: that.user.aud_id
})

View File

@ -1,26 +1,26 @@
<template>
<view class="content">
<view class="lan box_shadow" @click="visible = true">
<view class="left">地区</view>
<view class="right">{{region?region:'请选择'}}<uni-icons type="bottom"></uni-icons></view>
<view class="left">{{$t("infoAddress")}}:</view>
<view class="right">{{region?region:$t('verifyPicker')}}<uni-icons type="bottom"></uni-icons></view>
</view>
<view class="lan box_shadow">
<view class="left">性别</view>
<view class="left">{{$t("infoGender")}}:</view>
<view class="right">
<picker mode="selector" :range="sexItem" @change="onsexArr">
<view class="uni-input">{{gender==1?'男':'女'}}</view>
<view class="uni-input">{{gender==1?$t('infoMan'):$t('infoWoman')}}</view>
<icon class="iconfont icon-arrow-down-bold"></icon>
</picker>
</view>
</view>
<!-- 估分 -->
<view class="box">
<view class="title bold">本次估分成绩为</view>
<view class="title bold">{{$t("titleScoreResult")}}</view>
<view class="charts mt-15">
<qiun-data-charts type="arcbar" :chartData="chartData" :Height="140" :Width="140" :canvas2d="true" />
<view class="name">{{score?score:'--'}}</view>
</view>
<view class="title bold Max_score" v-if="Max_score">该地区体育总成绩为:{{Max_score}}</view>
<view class="title bold Max_score" v-if="Max_score">{{$t("MaxScore")}}:{{Max_score}}</view>
</view>
<!-- -->
<view v-if="selectllist.length" style="width: 100%;">
@ -47,18 +47,18 @@
<view class="weight">
<view class="input">
<!-- 整数类型 -->
<input type="number" v-model="it.value" confirm-type="done" placeholder="请输入"
<input type="number" v-model="it.value" confirm-type="done" :placeholder="$t('verifyRecord')"
v-if="it.type ==1" :style="{'color':it.inputStyle}"
@input="changeDisabled(it)" />
<!-- 小数类型 -->
<input type="digit" v-model="it.value" confirm-type="done" placeholder="请输入"
<input type="digit" v-model="it.value" confirm-type="done" :placeholder="$t('verifyRecord')"
maxlength="4" v-else-if="it.type ==2||it.type ==3"
:style="{'color':it.inputStyle}" @input="changeDisabled(it)" />
<!-- 分秒类型 -->
<picker mode="multiSelector" :range="timeList" @change="bindTimeChange($event,it)"
v-else-if="it.type ==4" :style="{'color':it.inputStyle}"
@input="changeDisabled(it)">
<view>{{it.value?it.value:'请选择'}}</view>
<view>{{it.value?it.value:$t('verifyPicker')}}</view>
<uni-icons type="down" color="#999" size="20" class="down"></uni-icons>
</picker>
<uni-icons type="clear" color="#999" v-if="it.value &&it.type !='4'"
@ -81,8 +81,8 @@
</view>
</view>
</view>
<view class="gfbtn" v-if="isSports" @click="handleNewScore()">重新估分</view>
<view class="gfbtn" @click="handlescore()" v-else>开始估分</view>
<view class="gfbtn" v-if="isSports" @click="handleNewScore()">{{$t("titleAnewScore")}}</view>
<view class="gfbtn" @click="handlescore()" v-else>{{$t("titleStartScore")}}</view>
</view>
<!-- -->
<view class="nolist" v-else>
@ -98,7 +98,7 @@
<!-- 单选 -->
<view class="edit" @click.stop>
<view class="title">请选择<text class="choice">({{List.length}}{{choice}})</text></view>
<view class="title">{{$t("verifyRecord")}}<text class="choice">({{List.length}}/{{choice}})</text></view>
<view class="item" v-for="(item, index) in List" :key="index" @click="toggle(item)">
<!-- d单选 -->
<uni-icons :type="isActive.name==item.name?'circle-filled':'circle'" size="22"
@ -115,16 +115,16 @@
</view>
</view>
</view>
<view class="btn close" @click="onTap">取消</view>
<view class="btn" @click="handleTarget">确定</view>
<view class="btn close" @click="onTap">{{$t("btnSancellation")}}</view>
<view class="btn" @click="handleTarget">{{$t("btnConfirm")}}</view>
</view>
</view>
<!-- -->
<view v-if="visible" class="visible" @click="visible=false">
<view @click.stop class="item">
<view class="groupBtn">
<view @click="visible=false">取消</view>
<view @click="handlesure()" class="sure">确定</view>
<view @click="visible=false">{{$t("btnSancellation")}}</view>
<view @click="handlesure()" class="sure">{{$t("btnConfirm")}}</view>
</view>
<picker-view @change="bindChange" :value="value" class="picker-view" :indicator-style="indicatorStyle">
<picker-view-column>
@ -157,14 +157,14 @@
isTips: false,
chartData: {
series: [{
name: "正确率",
name: "",
color: "#4687F9",
data: 0.8
}]
},
sexItem: [
"男",
"女"
this.$t("infoMan"),
this.$t("infoWoman")
],
value: [1, 0],
visible: false,
@ -187,7 +187,7 @@
timeList: [],
timesTndex: [0, 0],
isSports: false,
msg: "暂无信息",
msg: this.$t("msgNoMoreData"),
isresult: false,
choice: 0,
isRefresh: false,
@ -205,6 +205,9 @@
},
onLoad() {
let that = this
uni.setNavigationBarTitle({
title: this.$t('titleScore'),
})
that.province = that.configInfo.area_list
that.city = that.province[1].list
let defaultRegion = [that.province[that.value[0]].name, that.city[that.value[1]]]
@ -323,7 +326,7 @@
},
//
onsexArr(e) {
this.gender = this.sexItem[e.target.value] == "男" ? 1 : 2
this.gender = this.sexItem[e.target.value] == this.$t("infoMan") ? 1 : 2
},
//
handleActiveState(item, ite, ind) {

View File

@ -8,24 +8,26 @@
<image v-if="islink==2" src="../../static/dui.png"></image>
</view>
<view class="item">
<view class="item-ite">今日个数<text>{{info?info.today_jump_num:'--'}}</text></view>
<view class="item-ite">今日时长<text>{{info?info.today_jump_time:'--'}}</text></view>
<view class="item-ite">卡路里/kcal<text>{{info?info.today_jump_kcal:'--'}}</text></view>
<view class="item-ite">{{$t("today_jump_num")}}<text>{{info?info.today_jump_num:'--'}}</text></view>
<view class="item-ite">{{$t("today_jump_time")}}<text>{{info?info.today_jump_time:'--'}}</text>
</view>
<view class="item-ite">{{$t("today_jump_kcal")}}/kcal<text>{{info?info.today_jump_kcal:'--'}}</text>
</view>
</view>
</view>
<!-- -->
<view class="tabbar">
<view @click="active=1" :class="[active==1?'active':'']">自由跳</view>
<view @click="active=3" :class="[active==3?'active':'']">倒计数</view>
<view @click="active=2" :class="[active==2?'active':'']">倒计时</view>
<view @click="active=1" :class="[active==1?'active':'']">{{$t("jumpFree")}}</view>
<view @click="active=3" :class="[active==3?'active':'']">{{$t("backwardCount")}}</view>
<view @click="active=2" :class="[active==2?'active':'']">{{$t("Countdown")}}</view>
</view>
<!--自由训练 -->
<view class="box1 box" v-if="active==1">
<view class="item">
<text class="item-set item-set0">自由</text>
<text class="tips">无限制</text>
<text class="item-set item-set0">{{$t("jumpFreedom")}}</text>
<text class="tips">{{$t("jumpUnlimited")}}</text>
</view>
<view :class="[islink==2?'start':'start Nstart']" @click="handleStart(1)">开始</view>
<view :class="[islink==2?'start':'start Nstart']" @click="handleStart(1)">{{$t("instructStart")}}</view>
</view>
<!--定时训练 -->
<view class="box1 box" v-if="active==2">
@ -37,11 +39,11 @@
</view>
<view class="tips">
<picker mode="multiSelector" :range="timeList" :value="timesTndex" @change="bindTimeChange">
<view>调整目标</view>
<view>{{$t("jumpTarget")}}</view>
</picker>
</view>
</view>
<view :class="[islink==2?'start':'start Nstart']" @click="handleStart(2)">开始</view>
<view :class="[islink==2?'start':'start Nstart']" @click="handleStart(2)">{{$t("instructStart")}}</view>
</view>
<!--定数训练 -->
<view class="box1 box" v-if="active==3">
@ -52,9 +54,9 @@
<input type="number" v-model="weight" focus="true" v-else @blur="disabled=false">
<text @click="handleWeightEdit('加')"></text>
</view>
<text class="tips" @click="disabled=true">调整目标</text>
<text class="tips" @click="disabled=true">{{$t("jumpTarget")}}</text>
</view>
<view :class="[islink==2?'start':'start Nstart']" @click="handleStart(3)">开始</view>
<view :class="[islink==2?'start':'start Nstart']" @click="handleStart(3)">{{$t("instructStart")}}</view>
</view>
<!-- -->
</view>
@ -99,6 +101,9 @@
},
mounted() {
let that = this
uni.setNavigationBarTitle({
title: this.$t('titleSkipping'),
})
that.timeList = that.$tools.gethms()
that.time_m = that.timeList[0][1].substring(0, 2)
that.time_s = that.timeList[1][0].substring(0, 2)
@ -142,7 +147,7 @@
uni.$off("updateData")
setTimeout(() => {
uni.switchTab({
url: '/pages/index/index'
url: '/pages/card/card'
})
}, 300)
console.log("返回首页onUnload")
@ -152,7 +157,7 @@
let that = this
if (!that.isBluetoothTyle) {
that.$store.commit("changeBluetoothValue", {
bleTipsText: "连接失败,点击重新连接",
bleTipsText: that.$t('ConnectionTimeout'),
isConnectStatus: 1,
})
}
@ -176,7 +181,7 @@
let that = this
if (that.islink == 2) return
that.$store.commit('changeBluetoothValue', {
bleTipsText: "蓝牙搜索中",
bleTipsText: that.$t('SearchBluetooth'),
isConnectStatus: 0,
deviceId: "",
serviceId: "",
@ -247,7 +252,7 @@
serviceId: that.serviceId,
foodNotify: that.notify,
foodWrite: that.write,
bleTipsText: "连接成功",
bleTipsText: that.$t('ConnectionSuccessful'),
isConnectStatus: 2
})
uni.onBLECharacteristicValueChange(function(res) {
@ -301,7 +306,7 @@
let m = null
let send = null
if (that.islink != 2) {
that.$tools.msg("请先连接设备!")
that.$tools.msg(that.$t('connectingDevice'))
return
}
if (ind == 1) { // 1

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -50,8 +50,8 @@
"path": "login/login",
"style": {
"navigationBarTitleText": "登录",
"enablePullDownRefresh": false
// "navigationStyle": "custom"
"enablePullDownRefresh": false,
"navigationStyle": "custom"
}
}, {
"path": "home/body",
@ -196,11 +196,6 @@
"style": {
"navigationBarTitleText": "饮食记录"
}
}, {
"path": "me/recordetail",
"style": {
"navigationBarTitleText": "饮食详情"
}
}
]
},
@ -354,27 +349,26 @@
"selectedColor": "#54d87c",
"backgroundColor": "#fff",
"list": [{
"pagePath": "pages/index/index",
"iconPath": "static/shou.png",
"selectedIconPath": "static/shou2.png",
"text": "健康"
}, {
"pagePath": "pages/count/count",
"iconPath": "static/yinshi.png",
"selectedIconPath": "static/yinshi2.png",
"text": "饮食"
}, {
"pagePath": "pages/card/card",
"iconPath": "static/yundong.png",
"selectedIconPath": "static/yundong2.png",
"text": "运动"
},{
"pagePath": "pages/my/me",
"iconPath": "static/wo.png",
"selectedIconPath": "static/wo2.png",
"text": "我的"
}
]
"pagePath": "pages/index/index",
"iconPath": "static/shou.png",
"selectedIconPath": "static/shou2.png",
"text": "健康"
}, {
"pagePath": "pages/count/count",
"iconPath": "static/yinshi.png",
"selectedIconPath": "static/yinshi2.png",
"text": "饮食"
}, {
"pagePath": "pages/card/card",
"iconPath": "static/yundong.png",
"selectedIconPath": "static/yundong2.png",
"text": "运动"
}, {
"pagePath": "pages/my/me",
"iconPath": "static/wo.png",
"selectedIconPath": "static/wo2.png",
"text": "我的"
}]
},
"uniIdRouter": {}
}

View File

@ -3,19 +3,19 @@
<view class="cardList">
<view class="caritem" @click="handleNavTol('/pageTwo/charts/charts')">
<image src="/static/q5.png"></image>
<view>曲线</view>
<view>{{$t('titleCharts')}}</view>
</view>
<view class="caritem" @click="handleNavTol('/pageTwo/compk/contrast')">
<image src="/static/q3.png"></image>
<view>数据对比</view>
<view>{{$t('titleContrast')}}</view>
</view>
<view class="caritem" @click="handlerRecord">
<image src="/static/q7.png"></image>
<view>添加记录</view>
<view>{{$t('addRecord')}}</view>
</view>
<view class="caritem" @click="handleNavTol('/pageTwo/history/history')">
<image src="/static/q8.png"></image>
<view>历史记录</view>
<view>{{$t('HistoricalRcord')}}</view>
</view>
</view>
@ -23,20 +23,34 @@
<view class="item" v-for="(ite,ind) in cardList.chosen_fixed" @click="handleNavTol(ite.page_jump)">
<view class="info">
<image :src="ite.icon"></image>
<view>{{ite.name}}</view>
<text>{{ite.name}}</text>
</view>
</view>
<view class="item" v-for="(ite,ind) in cardList.chosen_yes" @click="handleNavTol(ite.page_jump)">
<view class="item" v-for="(ite,ind) in cardList.chosen_yes" @click="handleNavItem(ite)">
<view class="info">
<image :src="ite.icon"></image>
<view>{{ite.name}}</view>
<text>{{ite.name}}</text>
</view>
</view>
</view>
<!-- 通用卡片新增数据 -->
<view class="wrapper" v-if="isPublicCard">
<view class="bg" @click="onTap">
<view class="edit" @click.stop>
<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>
</view>
<view class="btn close" @click="onTap()">{{$t('btnSancellation')}}</view>
<view class="btn" @click="handlepublicmeasure">{{$t('btnConfirm')}}</view>
</view>
</view>
</view>
<!-- <view class="setCard" @click="handleSetCard">
工具设置
</view> -->
<!-- 手动记录 -->
<record></record>
</view>
</template>
@ -49,7 +63,10 @@
export default {
data() {
return {
name: "",
isPublicCard: false,
number: "",
key_word: ""
}
},
components: {
@ -67,17 +84,58 @@
return this.CardList
}
},
onLoad() {
let that = this
uni.setNavigationBarTitle({
title: this.$t('titleExercise'),
})
},
methods: {
//
handlerRecord() {
this.$store.commit('changeTsPublicRecord', true)
},
handleNavItem(ite) {
if (ite.page_jump) {
uni.navigateTo({
url: ite.page_jump
})
} else {
this.name = ite.name
this.key_word = ite.id
this.isPublicCard = true
}
},
handleNavTol(url) {
uni.navigateTo({
url: url
})
},
handlepublicmeasure() {
let that = this
if (!that.number) {
that.$tools.msg(that.$t('verifyTime'))
return
}
that.$model.getpublicmeasurecard({
aud_id: that.user.aud_id,
card_id: that.key_word,
time_m: that.number
}).then(res => {
if (res.code != 0) return
that.$tools.msg(res.msg)
that.number = ""
that.key_word = ""
that.isPublicCard = false
})
},
onTap() {
let that = this
that.name = ""
that.number = ""
that.key_word = ""
that.isPublicCard = false
},
handleSetCard() {
uni.navigateTo({
url: "/pageTwo/cardList/card"
@ -123,7 +181,7 @@
margin: 15px 10px;
.item {
width: 47%;
width: 48%;
background-color: #fff;
margin-bottom: 15px;
position: relative;
@ -132,22 +190,42 @@
border-radius: 5px;
.info {
width: 100%;
width: calc(100% - 20px);
padding: 0 10px;
display: flex;
align-items: center;
justify-content: center;
image {
width: 30px;
height: 30px;
background-color: #f2f2f2;
margin-right: 10px;
border-radius: 50%;
float: left;
margin-right: 10px;
}
text {
width: calc(100% - 35px);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
}
}
.btn {
width: 40%;
float: right;
margin-top: 15px;
background: $maincolor !important;
}
.close {
background: #dfdfdf !important;
float: left;
}
.setCard {
color: $maincolor;
margin: 15px;

View File

@ -4,7 +4,7 @@
<view class="data">
<picker mode="date" :end="endDate" @change="changeClickDate" :value="data?data:endDate">
<view>
{{data?data:"请选择"}}
{{data?data:$t("verifyPicker")}}
<image src="/static/qie.png"></image>
</view>
</picker>
@ -17,7 +17,7 @@
<!-- 能量摄入 -->
<view class="everyDay">
<view class="title">
<view><text class="quan"></text>热量摄入</view>
<view><text class="quan"></text>{{$t("countCalorieIntake")}}</view>
<view class="icon" @click="handleSet">
<uni-icons type="gear" size="26"></uni-icons>
</view>
@ -30,13 +30,13 @@
canvasId="foodCharts01" />
</view>
<view class="center">
摄入
{{$t("countIntake")}}
<text>{{foodInfo.nutrients_four[0].today_intake}}</text>
<view class="unit">Kcal</view>
</view>
</view>
<view class="mubiao">
目标<text>{{foodInfo.nutrients_four[0].suggestion}}</text>kcal
{{$t("target")}}<text>{{foodInfo.nutrients_four[0].suggestion}}</text>kcal
</view>
</view>
<view class="right">
@ -71,7 +71,7 @@
<text>{{item.val}}{{item.unit}}</text>
</view>
<view class="detail">
餐食详情
{{$t("titleEveryMeal")}}
<uni-icons type="forward" size="20" color="#999"></uni-icons>
</view>
</view>
@ -89,24 +89,24 @@
</uni-swipe-action-item>
</uni-swipe-action>
<view class="add" @click="handleAddFood(item.name)">
<text>+</text>添加食物
<text>+</text>{{$t("countAddFood")}}
</view>
</view>
</view>
</view>
<view class="fenxi" @click="navTo('/Food/count/everyDay?page=count')">
<image src="/static/fenxi.png"></image>
营养分析
{{$t("titleeveryDay")}}
</view>
<!-- 搜索 -->
<view class="serachBox">
<view class="title">
<view class="quan mr-5"></view>教你做
<view class="quan mr-5"></view>{{$t("teach")}}
</view>
<view class="searchInput">
<div class="search-wrap" @click="navTo('/Food/search/search')">
<text>输入食材快速搜索菜谱</text>
<text>{{$t("SearchRecipes")}}</text>
<image src="/static/28.png"></image>
</div>
</view>
@ -121,11 +121,11 @@
<image :src="activeFoodDetail.pic_url" mode="aspectFill"></image>
<view class="info">
<view class="name">{{activeFoodDetail.name}}</view>
<view class="kcal">{{activeFoodDetail.val}}千卡</view>
<view class="kcal">{{activeFoodDetail.val}}kcal</view>
</view>
</view>
<view class="foodContent">
<view class="title">热量和营养</view>
<view class="title">{{$t("CaloriesAndnutrients")}}</view>
<view class="progress">
<div class="chart-wrap" v-if="chartVisible">
<qiun-data-charts type="ring" :opts="opts" :chartData="chartData2" :cHeight="280"
@ -141,8 +141,8 @@
</view>
</view>
<view class="tips">
<text>营养素</text>
<text>{{activeFoodDetail.weight}}含量</text>
<text>{{$t("Nutrients")}}</text>
<text>{{activeFoodDetail.weight}}{{$t("Content")}}</text>
</view>
<view class="foodDetailList">
<view class="foodDetailItem" v-for="(item,index) in activeFoodDetail.nutrients_list"
@ -157,6 +157,13 @@
</scroll-view>
</view>
</view>
<view class="f_banner footbox" v-if="configInfo.bannerFoot.length">
<swiper class="swiper" circular="true">
<swiper-item v-for="(ite,index) in configInfo.bannerFoot" @click="$tools.NewsPtype(ite)">
<image :src="ite.pic" mode="aspectFill"></image>
</swiper-item>
</swiper>
</view>
</view>
</template>
@ -193,7 +200,7 @@
drawerVisible: false,
chartVisible: false, //
actionOptions: [{
text: '删除',
text: this.$t("btnDelete"),
style: {
backgroundColor: '#dd524d',
borderRadius: '10rpx'
@ -221,12 +228,29 @@
that.handTrue = false
that.$nextTick(() => {
that.handTrue = true
that.chartData.series[0].data = that.user.aud_id ? Number(that.countFoodInfo.nutrients_four[0].proportion) / 100 : 0
that.chartData.series[0].data = that.user.aud_id ? Number(that.countFoodInfo.nutrients_four[0]
.proportion) / 100 : 0
})
that.data = that.user.aud_id ? that.countFoodInfo.date : that.$tools.getDate("start")
return that.user.aud_id ? that.countFoodInfo : that.configInfo.default_count_foot
}
},
onLoad() {
let that = this
uni.setNavigationBarTitle({
title: this.$t('titleDiet'),
})
},
onPullDownRefresh() {
let that = this
that.$store.dispatch("getCountFoodInfo", {
aud_id: that.user.aud_id,
time: that.tools.getDate("start")
})
setTimeout(function() {
uni.stopPullDownRefresh();
}, 500);
},
methods: {
//
showFoodDetail(item) {
@ -297,7 +321,9 @@
delAcitionItem(item) {
let that = this
uni.showModal({
content: `是否删除[${item.name}]`,
content: that.$t("WhetherTodelete") + item.name + '',
cancelText: that.$t("btnSancellation"),//
confirmText: that.$t("btnConfirm"),//
success: (res) => {
if (res.confirm) {
this.$model.delCEatAction({
@ -469,8 +495,9 @@
}
}
}
.charts-box {
width: 250rpx;
height: 250rpx;
}
width: 250rpx;
height: 250rpx;
}
</style>

View File

@ -7,15 +7,16 @@
<view class="info" @click="handleAddUser(1)">
<view class="size18 bold">{{info.nickname}}</view>
<view class="mt-5">
<text class="mr-10">性别{{info.gender==1?'男':info.gender==2?'女':'未知'}}</text>
<text class="ml-10">年龄{{info.age}}</text>
<text
class="mr-10">{{$t("infoGender")}}{{info.gender==1?$t("infoMan"):info.gender==2?$t("infoWoman"):$t("infoUnknown")}}</text>
<text class="ml-10">{{$t("infoAge")}}{{info.age}}{{$t("infoAgeunit")}}</text>
</view>
</view>
<view class="t-icon t-icon-qiehuan1" @click="$store.commit('changeDrawe', true)"></view>
</view>
<view class="top top2" v-else @click="handleAddUser(2)">
<view class="info">
暂无成员请先添加~
{{$t("msgAddUser")}}~
</view>
<view class="add">
+
@ -30,7 +31,7 @@
</view>
<view class="header" v-else @click="handleLogin">
<view class="top top2">
登录后查看更多
{{$t("msgLoginTips")}}
</view>
</view>
<view v-if="token&&Measure.top_list.length" class="body">
@ -57,18 +58,26 @@
</view>
</view>
<view class="Ideal c999" v-if="ite.ideal_weight">
<text>理想{{ite.name}}</text>
<text>{{$t("LongestConsecutive")}}{{ite.name}}</text>
<text>{{ite.ideal_weight}}</text>
</view>
</view>
</view>
<!-- -->
<view class="function mt-15">
<view @click="handlerRecord">
<image src="/static/shoudong.png" mode="widthFix"></image>
</view>
<view @click="handReport">
<image src="/static/shendu.png" mode="widthFix"></image>
<view class="tools_g">
<view class="gongju" @click="handlerRecord">
<view class="right mr-15">
<text>{{$t("manualRecording")}}</text>
{{$t("Record")}}>
</view>
</view>
<view class="gongju2 " @click="handReport">
<view class="right mr-15">
<text>{{$t("depthReport")}}</text>
{{$t("Enter")}}>
</view>
</view>
</view>
</view>
<!-- -->
@ -85,14 +94,22 @@
<view class="bold size14" :style="{'color':ite.standard_color}">{{ite.standard}}</view>
</view>
</view>
<!-- 手动记录 -->
<record></record>
</view>
<view class="nolist" v-else>
<image src="/static/none.png"></image>
<text>暂无数据</text>
<text>{{$t("msgNoMoreData")}}</text>
</view>
<!-- -->
<view class="f_banner footbox" v-if="configInfo.banner.length">
<swiper class="swiper" circular="true">
<swiper-item v-for="(ite,index) in configInfo.banner" @click="$tools.NewsPtype(ite)">
<image :src="ite.pic" mode="aspectFit"></image>
</swiper-item>
</swiper>
</view>
<!-- -->
<!-- 手动记录 -->
<record></record>
<drawer @handleToolsIndex="handleToolsIndex(0)"></drawer>
</view>
</template>
@ -168,6 +185,9 @@
},
onLoad() {
let that = this
uni.setNavigationBarTitle({
title: this.$t('titleHealth'),
})
that.token = uni.getStorageSync("token")
console.log("token", that.token)
if (that.token && that.bleValue.isConnectStatus != 2) {
@ -199,7 +219,7 @@
let that = this
if (!that.isBluetoothTyle) {
that.$store.commit("changeBluetoothValue", {
bleTipsText: "重新连接",
bleTipsText: that.$t("ConnectionTimeout"),
isConnectStatus: 1,
})
}
@ -208,7 +228,7 @@
let that = this
if (!that.isConnected) {
that.$store.commit("changeBluetoothValue", {
bleTipsText: "重新连接",
bleTipsText: that.$t("ConnectionTimeout"),
isConnectStatus: 1,
})
}
@ -230,7 +250,7 @@
foodWrite: "",
unitList: that.$json.unitMinus,
foodType: 1,
bleTipsText: "蓝牙搜索中",
bleTipsText: that.$t("SearchBluetooth"),
isConnectStatus: 0,
})
that.$ble.openBluetoothAdapter()
@ -244,7 +264,7 @@
url: ind == 1 ? "/body/my/userInfo?info=" + JSON.stringify(this.user) : "/body/my/userInfo"
})
} else {
that.$tools("登录后查看更多")
that.$tools(that.$t("msgLoginTips"))
}
},
handleLogin() {
@ -289,7 +309,6 @@
.body {
background: #f7f7f7;
.info {
margin: 15px 10px;
padding: 10px;
@ -335,8 +354,8 @@
.function {
display: flex;
margin: 0 5px;
width: calc(100% - 10px);
margin: 0 10px;
width: calc(100% - 20px);
justify-content: space-between;
view {
@ -353,6 +372,7 @@
flex-wrap: wrap;
padding: 0 0 10px;
padding-left: 3%;
margin-bottom: 0;
width: 97%;
background: #f7f7f7;
box-shadow: none;
@ -464,4 +484,72 @@
left: calc(50% - 10px);
}
}
.tools_g {
width: 100% !important;
display: flex;
justify-content: space-between;
margin-bottom: 10px;
.gongju,
.gongju2 {
background: #fff;
display: flex;
width: 47% !important;
height: 70px;
align-items: center;
position: relative;
justify-content: flex-end;
background: url(@/static/g1.png) no-repeat;
background-size: 100% 100%;
.right {
font-size: 12px;
color: #F5AC3D;
text-align: right;
margin-right: 15px;
text {
display: block;
width: 100%;
font-size: 16px;
margin-bottom: 8px;
font-weight: bold;
}
}
}
.gongju::before {
content: "";
position: absolute;
width: 40px;
height: 40px;
left: 13px;
top: 16px;
background: url(@/static/g.png) no-repeat;
background-size: 100% 100%;
}
.gongju2 {
background: url(@/static/g2.png) no-repeat;
background-size: 100% 100%;
.right {
color: #63AB90;
}
}
.gongju2::before {
content: "";
position: absolute;
width: 40px;
height: 40px;
left: 10px;
top: 20px;
background: url(@/static/g02.png) no-repeat;
background-size: 100% 100%;
}
}
</style>

View File

@ -130,6 +130,9 @@
},
onLoad() {
let that = this
uni.setNavigationBarTitle({
title: this.$t('titleMe'),
})
that.token = uni.getStorageSync('token')
that.handleAccountNumber()
},
@ -210,14 +213,18 @@
let that = this
uni.setTabBarItem({
index: 0,
text: that.$t('titleHome')
text: that.$t('titleHealth')
})
uni.setTabBarItem({
index: 1,
text: that.$t('titleCount')
text: that.$t('titleDiet')
})
uni.setTabBarItem({
index: 2,
text: that.$t('titleExercise')
})
uni.setTabBarItem({
index: 3,
text: that.$t('titleMe')
})
},
@ -245,7 +252,7 @@
.content {
background-color: #F3F4F6;
padding: 15px;
min-height: 100vh;
min-height: calc(100vh - 30px);
}
.top {

View File

@ -53,12 +53,12 @@
// banner
.f_banner {
width: calc(100% - 20px);
height: 330rpx;
margin: 20rpx;
width: 100%;
height: 420rpx;
margin-bottom: 30rpx;
/deep/swiper {
height: 330rpx;
height: 420rpx;
}
image {
@ -617,11 +617,12 @@
.kcalClass {
width: 100%;
text-align: center;
font-size: 36rpx;
line-height: 55px;
margin: -20px auto;
width: 100%;
text-align: center;
font-size: 30rpx;
margin: 10px auto;
font-weight: bold;
color: #333;
}
.yichang {

View File

@ -568,12 +568,11 @@
}
.f_banner {
background-color: #f7f7f7;
width: 100% !important;
height: 450rpx;
margin: 30rpx auto;
height: 420rpx;
/deep/swiper {
height: 450rpx;
height: 420rpx;
}
image {

View File

@ -14,7 +14,7 @@
align-items: center;
justify-content: center;
position: relative;
top: 10px;
top: 75px;
z-index: 99;
margin-bottom: 15px;
@ -37,7 +37,7 @@
}
.login {
width: 86%;
width: calc(100% - 30px);
height: auto;
background: #fff;
border-radius: 10px;
@ -45,8 +45,8 @@
background-color: #fff;
z-index: 99;
position: absolute;
left: 7%;
top: 115px;
left: 15px;
top: calc(15% + 100px);
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
.title {
@ -112,7 +112,7 @@
}
.code {
width: 220rpx;
width: 340rpx;
background: #dfdfdf;
font-size: 28rpx;
margin: 0;

View File

@ -8,47 +8,6 @@ export default {
dispatch
}) {
return model.getHomeConfig({}).then(res => {
res.data.language_arr = [{
"name": "中文",
"val": "zh",
"key": "zh"
}, {
"name": "English",
"val": "en",
"key": "en"
}, {
"name": "日本語(Japanese)",
"val": "jp",
"key": "ja"
}, {
"name": "Français(French)",
"val": "fra",
"key": "fr"
}, {
"name": "Deutsch(German)",
"val": "de",
"key": "de"
}, {
"name": "한국어(Korean)",
"val": "kor",
"key": "ko"
}, {
"name": "Русский(Russian)",
"val": "ru",
"key": "ru"
}, {
"name": "Português(Portuguese)",
"val": "pt",
"key": "pt"
}, {
"name": "Español(Spanish)",
"val": "spa",
"key": "es"
}, {
"name": "Arabic(العربية)",
"val": "ara",
"key": "ar"
}]
commit('changeConfigInfo', res.data)
return res.data
})
@ -88,6 +47,23 @@ export default {
console.log("用户信息", res.data)
if (res.code != 0) {
tools.msg(res.msg)
commit('changeUser', {
id: "",
head_pic: null,
nickname: "",
birthday: "",
gender: 0,
sex: 0,
age: 0,
weight: "",
address: "",
measure_model: 0,
card_order: [],
food_count: {},
card_data_list: [],
target_current: {},
vitalcapacity_data: []
})
return
}
uni.setStorageSync('userid', res.data.aud_id)
@ -104,16 +80,18 @@ export default {
if (res.code == 0) {
commit('changeMeasureResult', res.data)
} else {
commit('changeMeasureResult', null)
commit('changeMeasureResult', {
card_list: [],
top_list: []
})
}
})
},
// 获取用户卡片
getCardAllList({
commit
},
account) {
return model.getCardAllList(account).then(res => {
commit
}) {
return model.getCardAllList({}).then(res => {
commit('changeCardList', res.data)
})
},
@ -128,9 +106,9 @@ export default {
},
getPublicRecord({
commit
}, account) {
}) {
let that = this
return model.getPublicRecord(account).then(res => {
return model.getPublicRecord({}).then(res => {
if (res.code == 0) {
commit('changePublicRecord', res.data)
}

View File

@ -27,9 +27,12 @@ export default new Vuex.Store({
},
// 配置接口
configInfo: {
app_icon: "",
app_name: "",
activity_level: [],
area_list: [],
banner: [],
bannerFoot: [],
meal_list: [],
language_arr: [],
literature: {

View File

@ -1,13 +1,15 @@
import $store from '@/store'
import useBluetooth from '@/toolJs/Bluetooth.js'
import $tools from '@/toolJs/tools.js'
import $data from '@/content.json'
import $model from '@/toolJs/model.js'
import messages from '@/language/index.js'
// // 蓝牙连接
let deviceId = ""
let deviceName = ""
let devicesList = []
let searchTimer = null
let Language = $store.state.setLocale
let $t = messages[Language]
export default {
unitInstruction,
convertToGrams,
@ -32,7 +34,7 @@ function openBluetoothAdapter() {
uni.openBluetoothAdapter({
success: e => {
$store.commit("changeBluetoothValue", {
bleTipsText: "蓝牙搜索中",
bleTipsText: $t.SearchBluetooth,
unitList: $data.unitMinus,
isConnectStatus: 0,
deviceId: "",
@ -42,7 +44,7 @@ function openBluetoothAdapter() {
},
fail: err => {
$store.commit("changeBluetoothValue", {
bleTipsText: "点击重新连接",
bleTipsText:$t.ConnectionTimeout,
unitList: $data.unitMinus,
isConnectStatus: 1,
deviceId: "",
@ -64,7 +66,7 @@ function startBluetoothDeviceDiscovery() {
if (!devicesList.length) {
clearTimeout(searchTimer);
$store.commit("changeBluetoothValue", {
bleTipsText: "点击重新连接",
bleTipsText: $t.ConnectionTimeout,
isConnectStatus: 1
});
}
@ -72,7 +74,7 @@ function startBluetoothDeviceDiscovery() {
},
fail: res => {
$store.commit("changeBluetoothValue", {
bleTipsText: "点击重新连接",
bleTipsText: $t.ConnectionTimeout,
isConnectStatus: 1
})
}
@ -199,7 +201,7 @@ function Bluetoothfilter(device) {
(device.localName && device.localName.toLowerCase().indexOf('pc-c02pro') != -1) ||
(device.localName && device.localName.toLowerCase().indexOf('pc-c09pro') != -1)) {
deviceName = 'CFC'
createBLEConnection("FFF0")
handleDevType(device)
return
}
}
@ -214,12 +216,12 @@ function handleDevType(device) {
createBLEConnection("FFF0")
} else {
devicesList = []
$tools.msg('设备未登记,请联系出售方进行系统认证')
$tools.msg(res.msg)
$store.commit("changeBluetoothValue", {
foodType: 1,
isFood: false,
isConnectStatus: 1,
bleTipsText: "点击重新连接",
bleTipsText: $t.ConnectionTimeout,
})
}
})
@ -237,7 +239,7 @@ function createBLEConnection(serviceId) {
$store.commit("changeBluetoothValue", {
foodType: 1,
isConnectStatus: 1,
bleTipsText: "点击重新连接",
bleTipsText: $t.ConnectionTimeout,
})
}
});
@ -261,7 +263,7 @@ function getBLEDeviceServices(serviceId) {
isConnectStatus: 0,
deviceId: deviceId,
serviceId: service.uuid,
bleTipsText: "蓝牙连接中",
bleTipsText: $t.connectBluetooth,
})
break;
}
@ -301,7 +303,7 @@ function getBLEDeviceServices(serviceId) {
$store.commit("changeBluetoothValue", {
foodType: 1,
isConnectStatus: 1,
bleTipsText: "点击重新连接",
bleTipsText: $t.ConnectionTimeout,
})
console.log('获取设备的UUID失败:', res)
}
@ -325,7 +327,7 @@ function closeBluetoothAdapter() {
foodWeight: 100,
unitList: $data.unitMinus,
isConnectStatus: 1,
bleTipsText: "点击重新连接",
bleTipsText: $t.ConnectionTimeout,
})
console.log('蓝牙模块关闭成功');
}
@ -361,23 +363,23 @@ function stopBluetoothDevicesDiscovery() {
function unitConversion(unit) {
if (unit == 'kg') {
return '千克'
return 'kg'
} else if (unit == '斤') {
return '斤'
} else if (unit == 'stlb') {
return 'stlb'
} else if (unit == 'lb') {
return ''
return 'lb'
} else if (unit == 'g') {
return ''
return 'g'
} else if (unit == 'ml') {
return '毫升'
return 'ml'
} else if (unit == 'Waterml') {
return 'Waterml'
} else if (unit == 'milkml') {
return 'milkml'
} else if (unit == 'oz') {
return '盎司'
return 'oz'
} else if (unit == 'floz') {
return 'floz'
} else if (unit == 'lboz') {

View File

@ -1,6 +1,6 @@
import tools from '@/toolJs/tools.js'
import store from '../store'
let baseUrl = "https://tc.pcxbc.com/reedaw"
let baseUrl = "https://tc.pcxbc.com/reedaw2"
// let baseUrl = "https://tc.pcxbc.com/testedition"
const httpRequest = (url, method = "get", data) => {
let httpDefaultOpts = {
@ -16,14 +16,14 @@ const httpRequest = (url, method = "get", data) => {
uni.request(httpDefaultOpts).then(
(res) => {
uni.hideLoading()
// console.log("request", url, res,)
console.log("request", url, res, )
if (res[1].data.code == 20001) {
uni.clearStorageSync()
uni.setStorageSync('token', null)
uni.setStorageSync('token', '')
uni.setStorageSync('aan_id', null)
setTimeout(function() {
uni.reLaunch({
url: "/pageTwo/login/login"
url: "/body/login/login"
})
}, 2000)
return
@ -45,6 +45,7 @@ const httpRequest = (url, method = "get", data) => {
return promise
};
function uploadFile(url, filePath) {
let promise = new Promise((resolve, reject) => {
uni.uploadFile({

View File

@ -1,6 +1,8 @@
import http from './https.js'
import tools from './tools.js'
import store from '@/store'
import messages from '@/language/index.js'
let $t = messages[uni.getLocale()]
export default {
// 登录
getonlogin(param) { // 登录
@ -94,7 +96,7 @@ export default {
return http.post("/get_user_list", param).then(res => {
if (res.data.user_list.length) {
let options = [{
text: '删除',
text: $t.btnDelete,
style: {
backgroundColor: '#dd524d'
}
@ -209,7 +211,7 @@ export default {
return res
})
},
// 卡片
getPublicRecord(param) { //手动记录内容
return http.post("/obtain_manual_record_content", param).then(res => {
return res
@ -220,6 +222,11 @@ export default {
return res
})
},
getpublicmeasurecard(param) { //卡片通用添加记录
return http.post("/exercise_type1_manual_record", param).then(res => {
return res
})
},
getPublicTrendList(param) { //工具曲线
return http.post("/card/curve_chart", param).then(res => {
@ -257,7 +264,7 @@ export default {
})
},
getPublicHistoryDel(param) { //工具历史删除
return http.post("/card/del_record", param).then(res => {
return http.post("/exercise_type1_del", param).then(res => {
return res
})
},

View File

@ -116,6 +116,8 @@ function compareVersions(version1, version2) {
return uni.showModal({
title: that.$t('newVersion'),
content: that.$t('newVersion') + version2 + that.$t('IsUpdate'),
cancelText: that.$t("btnSancellation"),//取消按钮文字
confirmText: that.$t("btnConfirm"),//确认按钮文字
success: (modalRes) => {
if (modalRes.confirm) { //确定更新
if (platform === 'android') { //安卓更新
@ -359,18 +361,10 @@ function handleUserList() {
aud_id: userid,
time: $tools.getDate("start")
})
// 全部卡片
$store.dispatch("getCardAllList", {
aud_id: userid
})
//
$store.dispatch("getResult", {
aud_id: userid
})
$store.dispatch("getPublicRecord", {
aud_id: userid
})
$store.commit("changehomeCard", 0);
}
}).catch(err => {})
}

File diff suppressed because one or more lines are too long

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