食谱和食材蓝牙同步

This commit is contained in:
qcl_123 2025-12-04 15:02:07 +08:00
parent f9025b7902
commit 5d2992f4f8
57 changed files with 187 additions and 222 deletions

View File

@ -32,7 +32,7 @@
</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" @click="handleDetailNext" v-if="!stopblue">下一</view>
<view class="btn qingling" @click="handleqingling">清零</view>
</view>
<view>
@ -373,39 +373,26 @@
display: flex;
justify-content: center;
align-items: center;
width: 45%;
width: 48%;
padding: 30rpx 0;
border-radius: 20rpx;
background-color: #F8F8F8;
.val {
font-size: 50rpx;
font-size: 54rpx;
color: #F0AE43;
margin: 0 !important;
}
.unit {
padding: 10rpx;
margin-left: 30rpx;
margin-left: 20rpx;
font-size: 28rpx;
color: #fff;
border-radius: 8rpx;
background-color: #F0AE43;
}
}
.kcal {
font-size: 32rpx;
margin-top: 25px;
margin-left: 10px;
.val {
font-size: 40rpx;
color: #F0AE43;
margin-right: 10px !important;
}
}
}
.name {

View File

@ -288,7 +288,7 @@
.weight {
.val {
font-size: 50rpx;
font-size: 54rpx;
color: #F0AE43;
margin: 0 !important;
}
@ -302,20 +302,6 @@
background-color: #F0AE43;
}
}
.kcal {
font-size: 32rpx;
.val {
font-size: 50rpx;
color: #F0AE43;
margin: 0 !important;
}
.unit {
margin-left: 20rpx;
}
}
}
.tips {

View File

@ -64,7 +64,8 @@
<image src="/static/arrow-down.png"></image>
</view>
</view>
<view class="mic-icon" @touchstart="onVoiceTouchStart" @touchend="onVoiceTouchEnd" @touchcancel="cancelRecording">
<view class="mic-icon" @touchstart="onVoiceTouchStart" @touchend="onVoiceTouchEnd"
@touchcancel="cancelRecording">
<uni-icons type="mic-filled" size="20" color="#fff"></uni-icons>
语音搜索
</view>
@ -1148,7 +1149,9 @@
top: 80rpx;
}
.mubiao {
margin-top: 10px
}
}
.box_list {

View File

@ -64,9 +64,10 @@
<text>{{ActiveList.length||0}}</text>
<icon class="t-icon t-icon-canpan"></icon>
</view>
<view class="subbtn" @click="handlesubbtn"> 确定</view>
<!-- <view class="subbtn" @click="handlesubbtn"> 确定</view> -->
</view>
<view class="mic-icon" @touchstart="onVoiceTouchStart" @touchend="onVoiceTouchEnd">
<view class="mic-icon" @touchstart="onVoiceTouchStart" @touchend="onVoiceTouchEnd"
@touchcancel="cancelRecording">
<uni-icons type="mic-filled" size="20" :color="mic_touch ? '#777777' : '#fff'"></uni-icons>
语音搜索
</view>
@ -91,6 +92,22 @@
</view>
</view>
</view>
<!-- -->
<!-- 语音弹框 -->
<view class="wrapper" v-if="showAutoSearchDlg">
<view class="auto-search-dialog">
<view class="auto-search-inner">
<view class="voice-wave">
<view class="wave-bar"></view>
<view class="wave-bar"></view>
<view class="wave-bar"></view>
<view class="wave-bar"></view>
<view class="wave-bar"></view>
<view class="wave-bar"></view>
</view>
</view>
</view>
</view>
</view>
</template>
@ -158,6 +175,8 @@
handleDetail(ite, ind) {
let that = this
let list = []
let pages = getCurrentPages()
let prevPage = pages[pages.length - 2]
if (ind == 1) {
list.push(ite)
that.ActiveList = that.$tools.mergeAndDeduplicate(that.ActiveList, list, 'name')
@ -168,15 +187,16 @@
}
}
}
prevPage.$vm.getAddFood(that.ActiveList)
},
//
handleSerach() {
let that = this
that.search_list = []
if (that.search_value == "") {
that.$tools.msg("输入关键字后搜索")
return
}
that.search_list = []
that.$model.getFoodSearch({
page: that.page,
search_data: that.search_value
@ -207,7 +227,7 @@
//
onVoiceTouchStart() {
let that = this
that.mic_touch = true
that.showAutoSearchDlg = true
that.voiceManager.start({
duration: 60000,
lang: "zh_CN"
@ -216,9 +236,18 @@
//
onVoiceTouchEnd() {
let that = this
that.mic_touch = false
that.showAutoSearchDlg = false
that.voiceManager.stop()
},
//
cancelRecording() {
// #ifdef MP-WEIXIN
if (this.voiceManager) {
this.voiceManager.stop()
this.showAutoSearchDlg = false
}
// #endif
},
//
handlesubbtn() {
let that = this
@ -232,6 +261,9 @@
//
handledelactive(ite) {
let that = this
let pages = getCurrentPages()
let prevPage = pages[pages.length - 2]
prevPage.$vm.handledel(ite.id, "食材")
that.ActiveList.splice(that.ActiveList.indexOf(ite), 1);
},
}
@ -463,7 +495,7 @@
left: 0;
top: 0;
width: 100%;
height: 100%;
bottom: 75px;
background-color: rgba(0, 0, 0, 0.5);
z-index: 999;
@ -473,56 +505,15 @@
justify-content: space-between;
align-items: center;
position: relative;
width: 70%;
height: 350rpx;
padding: 80rpx 0;
width: 50%;
padding: 60rpx 0;
background-color: #fff;
border-radius: 20rpx;
box-shadow: 0 0 20rpx #ccc;
.close {
position: absolute;
left: 0;
right: 0;
bottom: -140rpx;
width: 90rpx;
margin: 0 auto;
}
}
text {
font-size: 32rpx;
width: 80%;
}
.mic-icon {
display: flex;
justify-content: center;
align-items: center;
width: 150rpx;
height: 150rpx;
border-radius: 50%;
border: 8rpx solid #777777;
}
.btn-wrap {
display: flex;
justify-content: space-around;
width: 90%;
.retry,
.confirm {
width: 190rpx;
height: 60rpx;
line-height: 60rpx;
text-align: center;
font-size: 28rpx;
border: 2rpx solid #777;
border-radius: 15rpx;
}
}
}
.activeList {
z-index: 12;
bottom: 200rpx;
@ -556,14 +547,14 @@
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20rpx 40rpx;
padding: 0 20rpx;
position: fixed;
bottom: 0;
bottom: 0rpx;
left: 0;
right: 0;
height: 90px;
z-index: 99;
flex-wrap: wrap;
height: 60px;
padding-bottom: 15px;
z-index: 15;
background-color: #fff;
overflow: hidden;
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
@ -577,9 +568,9 @@
line-height: 35px;
background-color: #f0ae43;
}
.jilu{
width: 100%;
.jilu {
width: 110px;
display: flex;
align-items: center;
justify-content: space-between;
@ -623,9 +614,9 @@
.mic-icon {
color: #fff;
width: 100%;
width: calc(100% - 120px);
padding: 8px 0;
background: $maincolor;
background: #3CB383;
display: flex;
align-items: center;
justify-content: center;

View File

@ -710,6 +710,7 @@
.active2 {
color: #8284f0;
font-weight: bold;
background: #ecedff;
}
.title2 {

View File

@ -44,7 +44,10 @@
<view class="jishiqi">
<view class="top">
<view class="date">{{foodInfo.date}}</view>
<view class="detail" @click="navTo('/pageTwo/count/everyDay?page=home')">查看详情</view>
<view class="detail" @click="navTo('/pageTwo/count/everyDay?page=home')">
<image src="/static/fenxi.png"></image>
营养分析
</view>
</view>
<view class="left">
<view class="chart-wrap">
@ -167,7 +170,8 @@
this.handTrue = false
this.$nextTick(() => {
this.handTrue = true
that.chartData.series[0].data = this.user.aud_id != "" ? Number(this.user.food_count.nutrients_four[0].proportion) / 100 : 0
that.chartData.series[0].data = this.user.aud_id != "" ? Number(this.user.food_count
.nutrients_four[0].proportion) / 100 : 0
})
return this.user.aud_id != "" ? this.user.food_count : this.configInfo.default_count_foot
}
@ -199,7 +203,8 @@
that.handTrue = false
this.$nextTick(() => {
that.handTrue = true
that.chartData.series[0].data = that.user.aud_id != ""?Number(that.user.food_count.nutrients_four[0].proportion) / 100:0
that.chartData.series[0].data = that.user.aud_id != "" ? Number(that.user.food_count
.nutrients_four[0].proportion) / 100 : 0
})
this.startWatching()
},
@ -418,11 +423,28 @@
}
.detail {
color: #fff;
color: #3CB383;
width: auto;
padding: 5px 20px;
background: $yellowcolor;
border-radius: 10px;
padding: 3px 10px;
background: #fff;
border-radius: 8px;
border: 1px solid #3CB383;
display: flex;
align-items: center;
image {
width: 44rpx;
height: 44rpx;
margin-right: 5px;
}
}
.left {
margin-top: -10px;
}
.right {
margin-top: 0;
}
}

View File

@ -133,6 +133,7 @@
handlecolse() {
console.log("取消搜索")
this.search_value = ""
this.search_list = []
},
//
handleSearchHistory(text) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<view class="weightPages data-v-53fa6103"><view class="table data-v-53fa6103"><view class="text data-v-53fa6103"><image src="/static/zhong.png" class="data-v-53fa6103"></image><text data-event-opts="{{[['tap',[['openBluetoothAdapter',['$event']]]]]}}" bindtap="__e" class="data-v-53fa6103">{{bleTipsText}}</text></view></view><view class="name data-v-53fa6103">{{name}}</view><view class="weight-wrap data-v-53fa6103"><view data-event-opts="{{[['tap',[['inputDialogToggle',['$event']]]]]}}" class="weight data-v-53fa6103" bindtap="__e"><text class="val data-v-53fa6103">{{weight==''?'0.0':weight}}</text><text class="unit data-v-53fa6103">{{unit}}</text></view><view class="weight data-v-53fa6103"><text class="val data-v-53fa6103">{{kcal?kcal:0}}</text><text class="unit data-v-53fa6103">kcal</text></view></view><view class="groupbtn data-v-53fa6103"><view class="btn danwei data-v-53fa6103"><view class="lan border-bottom data-v-53fa6103"><view class="right data-v-53fa6103"><picker mode="selector" range="{{unitList}}" range-key="name" value="{{unitListIndex}}" data-event-opts="{{[['change',[['changleUnits',['$event']]]]]}}" bindchange="__e" class="data-v-53fa6103"><view class="uni-input data-v-53fa6103">单位</view></picker></view></view></view><view data-event-opts="{{[['tap',[['handleDetailSub',['$event']]]]]}}" class="btn data-v-53fa6103" style="{{'width:'+(!stopblue?'20%':'45%')+';'}}" bindtap="__e">保存</view><block wx:if="{{!stopblue}}"><view data-event-opts="{{[['tap',[['handleDetailNext',['$event']]]]]}}" class="btn data-v-53fa6103" bindtap="__e">下一</view></block><view data-event-opts="{{[['tap',[['handleqingling',['$event']]]]]}}" class="btn qingling data-v-53fa6103" bindtap="__e">清零</view></view><view class="data-v-53fa6103"><uni-popup vue-id="2b524063-1" type="dialog" data-ref="popup" class="data-v-53fa6103 vue-ref" bind:__l="__l" vue-slots="{{['default']}}"><uni-popup-dialog vue-id="{{('2b524063-2')+','+('2b524063-1')}}" mode="input" title="重量" placeholder="请输入食物重量" data-event-opts="{{[['^close',[['close']]],['^confirm',[['confirm']]]]}}" bind:close="__e" bind:confirm="__e" class="data-v-53fa6103" bind:__l="__l"></uni-popup-dialog></uni-popup></view></view>
<view class="weightPages data-v-53fa6103"><view class="table data-v-53fa6103"><view class="text data-v-53fa6103"><image src="/static/zhong.png" class="data-v-53fa6103"></image><text data-event-opts="{{[['tap',[['openBluetoothAdapter',['$event']]]]]}}" bindtap="__e" class="data-v-53fa6103">{{bleTipsText}}</text></view></view><view class="name data-v-53fa6103">{{name}}</view><view class="weight-wrap data-v-53fa6103"><view data-event-opts="{{[['tap',[['inputDialogToggle',['$event']]]]]}}" class="weight data-v-53fa6103" bindtap="__e"><text class="val data-v-53fa6103">{{weight==''?'0.0':weight}}</text><text class="unit data-v-53fa6103">{{unit}}</text></view><view class="weight data-v-53fa6103"><text class="val data-v-53fa6103">{{kcal?kcal:0}}</text><text class="unit data-v-53fa6103">kcal</text></view></view><view class="groupbtn data-v-53fa6103"><view class="btn danwei data-v-53fa6103"><view class="lan border-bottom data-v-53fa6103"><view class="right data-v-53fa6103"><picker mode="selector" range="{{unitList}}" range-key="name" value="{{unitListIndex}}" data-event-opts="{{[['change',[['changleUnits',['$event']]]]]}}" bindchange="__e" class="data-v-53fa6103"><view class="uni-input data-v-53fa6103">单位</view></picker></view></view></view><view data-event-opts="{{[['tap',[['handleDetailSub',['$event']]]]]}}" class="btn data-v-53fa6103" style="{{'width:'+(!stopblue?'20%':'45%')+';'}}" bindtap="__e">保存</view><block wx:if="{{!stopblue}}"><view data-event-opts="{{[['tap',[['handleDetailNext',['$event']]]]]}}" class="btn data-v-53fa6103" bindtap="__e">下一</view></block><view data-event-opts="{{[['tap',[['handleqingling',['$event']]]]]}}" class="btn qingling data-v-53fa6103" bindtap="__e">清零</view></view><view class="data-v-53fa6103"><uni-popup vue-id="2b524063-1" type="dialog" data-ref="popup" class="data-v-53fa6103 vue-ref" bind:__l="__l" vue-slots="{{['default']}}"><uni-popup-dialog vue-id="{{('2b524063-2')+','+('2b524063-1')}}" mode="input" title="重量" placeholder="请输入食物重量" data-event-opts="{{[['^close',[['close']]],['^confirm',[['confirm']]]]}}" bind:close="__e" bind:confirm="__e" class="data-v-53fa6103" bind:__l="__l"></uni-popup-dialog></uni-popup></view></view>

View File

@ -117,34 +117,24 @@
display: flex;
justify-content: center;
align-items: center;
width: 45%;
width: 48%;
padding: 30rpx 0;
border-radius: 20rpx;
background-color: #F8F8F8;
}
.weightPages .weight-wrap .weight .val.data-v-53fa6103 {
font-size: 50rpx;
font-size: 54rpx;
color: #F0AE43;
margin: 0 !important;
}
.weightPages .weight-wrap .weight .unit.data-v-53fa6103 {
padding: 10rpx;
margin-left: 30rpx;
margin-left: 20rpx;
font-size: 28rpx;
color: #fff;
border-radius: 8rpx;
background-color: #F0AE43;
}
.weightPages .weight-wrap .kcal.data-v-53fa6103 {
font-size: 32rpx;
margin-top: 25px;
margin-left: 10px;
}
.weightPages .weight-wrap .kcal .val.data-v-53fa6103 {
font-size: 40rpx;
color: #F0AE43;
margin-right: 10px !important;
}
.weightPages .name.data-v-53fa6103 {
width: 100%;
text-align: center;

View File

@ -65,7 +65,7 @@ image.data-v-5fc22dca {
background-color: #F8F8F8;
}
.weightPages .weight-wrap .weight .val.data-v-5fc22dca {
font-size: 50rpx;
font-size: 54rpx;
color: #F0AE43;
margin: 0 !important;
}
@ -77,17 +77,6 @@ image.data-v-5fc22dca {
border-radius: 8rpx;
background-color: #F0AE43;
}
.weightPages .weight-wrap .kcal.data-v-5fc22dca {
font-size: 32rpx;
}
.weightPages .weight-wrap .kcal .val.data-v-5fc22dca {
font-size: 50rpx;
color: #F0AE43;
margin: 0 !important;
}
.weightPages .weight-wrap .kcal .unit.data-v-5fc22dca {
margin-left: 20rpx;
}
.weightPages .tips.data-v-5fc22dca {
font-size: 24rpx;
text-align: center;

View File

@ -548,6 +548,9 @@
height: 270rpx;
top: 80rpx;
}
.wrapper .box2 .jishiqi .mubiao.data-v-d4f38c70 {
margin-top: 10px;
}
.wrapper .box2 .box_list.data-v-d4f38c70 {
position: absolute;
left: 10px;

View File

@ -277,6 +277,8 @@ var _default = {
handleDetail: function handleDetail(ite, ind) {
var that = this;
var list = [];
var pages = getCurrentPages();
var prevPage = pages[pages.length - 2];
if (ind == 1) {
list.push(ite);
that.ActiveList = that.$tools.mergeAndDeduplicate(that.ActiveList, list, 'name');
@ -287,15 +289,16 @@ var _default = {
}
}
}
prevPage.$vm.getAddFood(that.ActiveList);
},
// 搜索
handleSerach: function handleSerach() {
var that = this;
that.search_list = [];
if (that.search_value == "") {
that.$tools.msg("输入关键字后搜索");
return;
}
that.search_list = [];
that.$model.getFoodSearch({
page: that.page,
search_data: that.search_value
@ -326,7 +329,7 @@ var _default = {
// 开始说话
onVoiceTouchStart: function onVoiceTouchStart() {
var that = this;
that.mic_touch = true;
that.showAutoSearchDlg = true;
that.voiceManager.start({
duration: 60000,
lang: "zh_CN"
@ -335,9 +338,16 @@ var _default = {
// 语音结束
onVoiceTouchEnd: function onVoiceTouchEnd() {
var that = this;
that.mic_touch = false;
that.showAutoSearchDlg = false;
that.voiceManager.stop();
},
// 取消录音
cancelRecording: function cancelRecording() {
if (this.voiceManager) {
this.voiceManager.stop();
this.showAutoSearchDlg = false;
}
},
// 购物车提交
handlesubbtn: function handlesubbtn() {
var that = this;
@ -351,6 +361,9 @@ var _default = {
//删除购物车食材
handledelactive: function handledelactive(ite) {
var that = this;
var pages = getCurrentPages();
var prevPage = pages[pages.length - 2];
prevPage.$vm.handledel(ite.id, "食材");
that.ActiveList.splice(that.ActiveList.indexOf(ite), 1);
}
}

File diff suppressed because one or more lines are too long

View File

@ -220,7 +220,7 @@
left: 0;
top: 0;
width: 100%;
height: 100%;
bottom: 75px;
background-color: rgba(0, 0, 0, 0.5);
z-index: 999;
}
@ -230,49 +230,12 @@
justify-content: space-between;
align-items: center;
position: relative;
width: 70%;
height: 350rpx;
padding: 80rpx 0;
width: 50%;
padding: 60rpx 0;
background-color: #fff;
border-radius: 20rpx;
box-shadow: 0 0 20rpx #ccc;
}
.auto-search-dialog .auto-search-inner .close.data-v-c58b4fba {
position: absolute;
left: 0;
right: 0;
bottom: -140rpx;
width: 90rpx;
margin: 0 auto;
}
.auto-search-dialog text.data-v-c58b4fba {
font-size: 32rpx;
width: 80%;
}
.auto-search-dialog .mic-icon.data-v-c58b4fba {
display: flex;
justify-content: center;
align-items: center;
width: 150rpx;
height: 150rpx;
border-radius: 50%;
border: 8rpx solid #777777;
}
.auto-search-dialog .btn-wrap.data-v-c58b4fba {
display: flex;
justify-content: space-around;
width: 90%;
}
.auto-search-dialog .btn-wrap .retry.data-v-c58b4fba,
.auto-search-dialog .btn-wrap .confirm.data-v-c58b4fba {
width: 190rpx;
height: 60rpx;
line-height: 60rpx;
text-align: center;
font-size: 28rpx;
border: 2rpx solid #777;
border-radius: 15rpx;
}
.activeList.data-v-c58b4fba {
z-index: 12;
bottom: 200rpx;
@ -299,14 +262,14 @@
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20rpx 40rpx;
padding: 0 20rpx;
position: fixed;
bottom: 0;
bottom: 0rpx;
left: 0;
right: 0;
height: 90px;
z-index: 99;
flex-wrap: wrap;
height: 60px;
padding-bottom: 15px;
z-index: 15;
background-color: #fff;
overflow: hidden;
box-shadow: 0px 1px 5px 2px #dfe2e1fc;
@ -321,7 +284,7 @@
background-color: #f0ae43;
}
.groupbtn .jilu.data-v-c58b4fba {
width: 100%;
width: 110px;
display: flex;
align-items: center;
justify-content: space-between;
@ -359,7 +322,7 @@
}
.mic-icon.data-v-c58b4fba {
color: #fff;
width: 100%;
width: calc(100% - 120px);
padding: 8px 0;
background: #3CB383;
display: flex;

View File

@ -319,6 +319,7 @@
.active2.data-v-4a383a52 {
color: #8284f0;
font-weight: bold;
background: #ecedff;
}
.title2.data-v-4a383a52 {
display: flex;

File diff suppressed because one or more lines are too long

View File

@ -150,11 +150,25 @@
font-weight: bold;
}
.jishiqi .detail.data-v-57280228 {
color: #fff;
color: #3CB383;
width: auto;
padding: 5px 20px;
background: #F7931E;
border-radius: 10px;
padding: 3px 10px;
background: #fff;
border-radius: 8px;
border: 1px solid #3CB383;
display: flex;
align-items: center;
}
.jishiqi .detail image.data-v-57280228 {
width: 44rpx;
height: 44rpx;
margin-right: 5px;
}
.jishiqi .left.data-v-57280228 {
margin-top: -10px;
}
.jishiqi .right.data-v-57280228 {
margin-top: 0;
}
.box1 .header.data-v-57280228 {
width: 100rpx;

View File

@ -254,6 +254,7 @@ var _default = {
handlecolse: function handlecolse() {
console.log("取消搜索");
this.search_value = "";
this.search_list = [];
},
// 历史搜索
handleSearchHistory: function handleSearchHistory(text) {