diff --git a/assets/common.scss b/assets/common.scss index bacb490..ddb13f0 100644 --- a/assets/common.scss +++ b/assets/common.scss @@ -205,11 +205,22 @@ page { font-size: 14px; font-weight: bold; overflow-y: scroll; + overflow-x: hidden; height: calc(100vh - 70px); .name { padding-left: 15px; + white-space: nowrap; + overflow-x: auto; + width: 160rpx; + font-size: 26rpx; } + .name::-webkit-scrollbar { + display: none; + width: 0; + height: 0; + color: transparent; + } .active { color: $maincolor; @@ -246,11 +257,10 @@ page { } .list { - display: flex; - flex-wrap: wrap; - align-items: center; - justify-content: space-between; - + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; image { width: 140rpx; height: 140rpx; @@ -260,7 +270,7 @@ page { text { display: block; text-align: center; - margin-bottom: 10px; + margin-bottom: 10px; } } } diff --git a/components/bluetooth_new.vue b/components/bluetooth_new.vue new file mode 100644 index 0000000..96739af --- /dev/null +++ b/components/bluetooth_new.vue @@ -0,0 +1,563 @@ + + + + + \ No newline at end of file diff --git a/components/food_item.vue b/components/food_item.vue new file mode 100644 index 0000000..00e68f7 --- /dev/null +++ b/components/food_item.vue @@ -0,0 +1,80 @@ + + + + + diff --git a/components/search.vue b/components/search.vue index c27334f..287aa65 100644 --- a/components/search.vue +++ b/components/search.vue @@ -5,6 +5,10 @@ + + + + 搜索 @@ -16,12 +20,22 @@ @@ -66,6 +92,21 @@ display: flex; z-index: 99999; } + .voice { + display: flex; + justify-content: flex-end; + align-items: center; + position: absolute; + right: 10px; + top: 0; + bottom: 0; + width: 150rpx; + display: flex; + z-index: 99999; + .mic { + margin-right: 10rpx; + } + } } .searchBtn { diff --git a/components/search2.vue b/components/search2.vue new file mode 100644 index 0000000..41e7298 --- /dev/null +++ b/components/search2.vue @@ -0,0 +1,103 @@ + + + + + diff --git a/manifest.json b/manifest.json index bfeca51..5d722a5 100644 --- a/manifest.json +++ b/manifest.json @@ -1,10 +1,11 @@ { "name" : "kitchendDevice", - "appid" : "__UNI__2494015", + "appid" : "__UNI__9A0614A", "description" : "", "versionName" : "1.0.0", "versionCode" : "100", "transformPx" : false, + "sassImplementationName" : "node-sass", /* 5+App特有相关 */ "app-plus" : { "usingComponents" : true, @@ -65,8 +66,12 @@ "plugins" : { "sdkPlugin" : { //这里是引用的插件名称 地图路线规划 - "version" : "2.3.4", //插件版本 + "version" : "2.4.0", //插件版本 "provider" : "wx17e93aad47cdae1a" //插件appid + }, + "WechatSI" : { + "version" : "0.3.6", + "provider" : "wx069ba97219f66d99" } } }, diff --git a/pageTwo/count/food.vue b/pageTwo/count/food.vue index 733a433..c36d9a4 100644 --- a/pageTwo/count/food.vue +++ b/pageTwo/count/food.vue @@ -1,587 +1,844 @@ \ No newline at end of file diff --git a/pageTwo/me/foodlist.vue b/pageTwo/me/foodlist.vue index 7ec12b5..31eb230 100644 --- a/pageTwo/me/foodlist.vue +++ b/pageTwo/me/foodlist.vue @@ -28,6 +28,7 @@ {{ite.name}} + @@ -70,7 +71,6 @@ menu3: [], menulist: [], ActiveList: [], - searchResults: [], page: 1, type: "", name: "", @@ -80,8 +80,17 @@ computed: { ...mapState(["foodList"]), menuTop() { - this.menu2 = this.foodList.length ? this.foodList[0].list : [] - return this.foodList + this.menu2 = this.foodList.length ? this.foodList[0].list : [], + console.log([...this.foodList, { + id: 4, + list: [], + name: '搜索' + }]) + return [...this.foodList, { + id: 4, + list: [], + name: '搜索' + }] }, }, onLoad(options) { @@ -176,22 +185,20 @@ let that = this let list = [] if (name != "") { - that.searchResults = [] - that.menu.forEach((item, index) => { - item.list.forEach((ite, ind) => { - ite.list.forEach((it, id) => { - if (it.name.indexOf(name) !== -1) { - that.searchResults.push(it) - return - } - }) - }) + that.$model.getFoodSearch({ + food_name: name + }).then(res => { + if (res.code != 0) { + uni.showToast({ + title: res.msg, + icon: 'error' + }) + return + } + that.index = 3 + that.menu2 = [] + that.menu3 = res.data }) - that.index = that.menu.findIndex(ite => ite.id == that.searchResults[0].one_id) - console.log("arr", that.searchResults, ) - } else { - that.index = 0 - that.searchResults = [] } }, @@ -236,47 +243,49 @@ position: relative; margin-top: 101px; height: calc(100vh - 101px) !important; - } - - .left { - top: 101px !important; - position: fixed; - background-color: #f7f7f7; - } - - .right { - top: 0px !important; - - .list { - display: flex; - flex-wrap: wrap; - } - - .item { - width: 29%; - border: 1px solid #dfdfdf; - display: flex; - align-items: center; - box-sizing: border-box; - justify-content: space-between; - height: 30px; - border-radius: 5px; - margin: 0 2% 10px; - padding: 0 5px; - - text { - margin-bottom: 0 !important; - } - } - - - .icon-xuanzhong { - color: $maincolor; - } - - .active0 { - border: 1px solid $maincolor; - } + + .left { + top: 101px !important; + position: fixed; + background-color: #f7f7f7; + height: calc(100vh - 100px); + } + + .right { + top: 0px !important; + height: calc(100vh - 100px); + + .list { + display: flex; + flex-wrap: wrap; + } + + .item { + width: 29%; + border: 1px solid #dfdfdf; + display: flex; + align-items: center; + box-sizing: border-box; + justify-content: space-between; + height: 30px; + border-radius: 5px; + margin: 0 2% 10px; + padding: 0 5px; + + text { + margin-bottom: 0 !important; + } + } + + + .icon-xuanzhong { + color: $maincolor; + } + + .active0 { + border: 1px solid $maincolor; + } + } } .activeList { @@ -298,7 +307,6 @@ // flex-wrap: wrap; .item { - width: 29%; border: 1px solid $maincolor; display: flex; justify-content: space-between; @@ -308,11 +316,12 @@ align-items: center; margin: 0 2% 10px; float: left; - padding: 0 5px; + padding: 0 10px; icon { color: $maincolor; font-size: 16px; + margin-left: 10rpx; } } } @@ -346,10 +355,11 @@ } .maxheight { - padding-bottom: 265rpx; - .left { - height: calc(100vh - 500rpx); + height: calc(100vh - 680rpx); } + .right { + height: calc(100vh - 680rpx); + } } \ No newline at end of file diff --git a/pageTwo/me/menudetail.vue b/pageTwo/me/menudetail.vue index 402574a..fedf287 100644 --- a/pageTwo/me/menudetail.vue +++ b/pageTwo/me/menudetail.vue @@ -1,605 +1,629 @@ \ No newline at end of file diff --git a/pages.json b/pages.json index 73a8a3a..a68ac0c 100644 --- a/pages.json +++ b/pages.json @@ -41,6 +41,13 @@ "style": { "navigationBarTitleText": "" } + }, + { + "path" : "pages/search/search", + "style" : + { + "navigationBarTitleText" : "搜索" + } } ], "subPackages": [{ diff --git a/pages/count/count.vue b/pages/count/count.vue index 8387357..1f46057 100644 --- a/pages/count/count.vue +++ b/pages/count/count.vue @@ -27,30 +27,32 @@ 还能吃 {{remaining_kcal}} + Kcal 建议摄入 {{suggestion.kcal}} + Kcal - 碳水化合物 + 碳水化合物(克) {{today_intake.carbohydrate}}/{{suggestion.carbohydrate}} - 蛋白质 + 蛋白质(克) {{today_intake.protein}}/{{suggestion.protein}} - 脂肪 + 脂肪(克) {{today_intake.fat}}/{{suggestion.fat}} @@ -411,6 +413,13 @@ font-size: 22px; font-weight: bold; } + .unit { + position: absolute; + font-size: 22px; + font-weight: bold; + bottom: 20rpx; + text-align: center; + } } } @@ -431,6 +440,14 @@ display: inline-block; margin-top: 5px; } + + .unit { + position: absolute; + font-size: 22px; + font-weight: bold; + bottom: 20rpx; + text-align: center; + } } } diff --git a/pages/index/index.vue b/pages/index/index.vue index a0fd565..3289046 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,276 +1,278 @@ \ No newline at end of file diff --git a/pages/menu/menu.vue b/pages/menu/menu.vue index 84ced2f..add300e 100644 --- a/pages/menu/menu.vue +++ b/pages/menu/menu.vue @@ -1,7 +1,7 @@