diff --git a/api/index/index.js b/api/index/index.js index b505808..9ee921c 100644 --- a/api/index/index.js +++ b/api/index/index.js @@ -119,6 +119,17 @@ export function getCarouselImageListApi(data) { } +/** + * @data 标题 + */ +export function getBaseSettingByKeyApi(data) { + return request({ + url: '/smart-canteen/android/baseSetting/getBaseSettingByKey', + method: 'post', + data:data + }) +} + diff --git a/config.js b/config.js index 7730e30..7d3c335 100644 --- a/config.js +++ b/config.js @@ -4,9 +4,9 @@ module.exports = { // baseUrl: 'http://192.168.0.39:21995', // #ifdef H5 // baseUrl: '/canteen/dev-api', - // baseUrl: '/dev-api', + baseUrl: '/dev-api', // baseUrl: 'http://192.168.0.244:38380',//测试 - baseUrl: 'http://192.168.0.244:48380',//测试 + // baseUrl: 'http://192.168.0.244:48380',//测试 // baseUrl: 'http://192.168.0.244:58580',//测试 // baseUrl: 'http://192.168.2.82:58080',//张天强 // baseUrl: 'http://192.168.2.69:58080',//董高文 diff --git a/pages/advanceOrder/dishDetail.vue b/pages/advanceOrder/dishDetail.vue index dbbd0ed..6035945 100644 --- a/pages/advanceOrder/dishDetail.vue +++ b/pages/advanceOrder/dishDetail.vue @@ -37,56 +37,107 @@ - - 菜品简介 - {{dashesData.intro||'-'}} + + 菜品简介 + {{dashesData.intro||'-'}} - - 主料 - - + + 主料 + + {{dashesData.mainMaterialStr||'-'}} + - - 辅料 - - + + 辅料 + + {{dashesData.subMaterialStr||'-'}} + - + - 项目(份) + 项目(份) 热量(份) 蛋白质(份) 脂肪(份) 碳水化合物(份) 膳食纤维(份) 胆固醇(份) + + 钙(份) + 钠(份) + - 含量 - - - - - - - - - - - - - - - - + 含量 + {{dashesData.dishesDetailList[0].calories||'-'}} + {{dashesData.dishesDetailList[0].protein||'-'}} + {{dashesData.dishesDetailList[0].fat||'-'}} + {{dashesData.dishesDetailList[0].carbohydrate||'-'}} + {{dashesData.dishesDetailList[0].dietaryFiber||'-'}} + {{dashesData.dishesDetailList[0].cholesterol||'-'}} + + {{dashesData.dishesDetailList[0].carotene||'-'}} + + + {{dashesData.dishesDetailList[0].calcium||'-'}} + + {{dashesData.dishesDetailList[0].sodium||'-'}} + NRV% - - - - - - - - - - - - - - - - + {{dashesData.dishesDetailList[0].caloriesNrv||'-'}} + {{dashesData.dishesDetailList[0].proteinNrv||'-'}} + {{dashesData.dishesDetailList[0].fatNrv||'-'}} + {{dashesData.dishesDetailList[0].carbohydrateNrv||'-'}} + {{dashesData.dishesDetailList[0].dietaryFiberNrv||'-'}} + {{dashesData.dishesDetailList[0].cholesterolNrv||'-'}} + + {{dashesData.dishesDetailList[0].caroteneNrv||'-'}} + + + {{dashesData.dishesDetailList[0].calciumNrv||'-'}} + + {{dashesData.dishesDetailList[0].sodiumNrv||'-'}} + @@ -282,6 +333,19 @@ export default { const res = await getMenudishesDetailAPI(param) if(res.code==200){ this.dashesData = res.data; + if(this.dashesData.materialList&&this.dashesData.materialList.length>0){ + let arr1=[] + let arr2=[] + this.dashesData.materialList.forEach(item=>{ + if(item.materialType==1){ arr1.push(item.materialName) } + if(item.materialType==2){ arr2.push(item.materialName) } + }) + this.dashesData.mainMaterialStr = arr1.join("、") + this.dashesData.subMaterialStr = arr2.join("、") + }else{ + this.dashesData.mainMaterialStr = "" + this.dashesData.subMaterialStr = "" + } this.$set(this.dashesData, 'quantity', 0) this.$set(this.dashesData, 'monthlySales', this.dashesData.dishesDetailList[0].monthlySales) this.$set(this.dashesData, 'goodProbability', this.dashesData.dishesDetailList[0].goodProbability) diff --git a/pages/advanceOrder/index.vue b/pages/advanceOrder/index.vue index 7666cf1..969a3d6 100644 --- a/pages/advanceOrder/index.vue +++ b/pages/advanceOrder/index.vue @@ -215,6 +215,7 @@ export default { active: 1, // 1 自取 2 外卖 // canteenName: '宏源工业园/本周菜谱', canteenType: '自取', // 1 自取 2 外卖 + isHandle:false } }, onLoad(options) { @@ -227,11 +228,10 @@ export default { this.recipeId=options.recipeId; }, onShow() { - //获取预定日期 - this.getReserveDate() + setTimeout(()=>{ - //获取预定餐菜谱 - this.getMenuListData() + //获取预定日期 + this.getReserveDate() },200) }, methods: { @@ -244,6 +244,7 @@ export default { const res = await getlistReserveDateAPI(param) this.getNowFormatDate(res.data[0]) this.getNowFormatDate2(res.data[0]) + //获取预定餐菜谱 this.getMenuListData() }, // 获取当前时间 @@ -269,7 +270,7 @@ export default { async getMenuListData() { let param = { "recipeId":this.recipeId, - "applyDate":this.newDate2, + "applyDate":this.newDate2, // "applyDate":"2025-04-18", } const res = await getAdvanceDetailListAPI(param) @@ -443,35 +444,41 @@ export default { } console.log(cartItem) } - } + } }) }) }) }) console.log(this.shoppingCartList) + this.isHandle = false //计算总价 this.handleTotalPrice() }else{ + this.isHandle = false this.shoppingCartList = [] } }, //菜谱加减操作 - handleFoodNum(type, food) { - console.log(food) + handleFoodNum(type, food) { if (type === 1) { if (food.quantity > 0) { - food.quantity-- - this.delShopCart(food) + if(!this.isHandle){ + food.quantity-- + this.delShopCart(food) + } } } else { if (food.quantity < food.restrictNum) { - this.addShopCart(food) + if(!this.isHandle){ + this.addShopCart(food) + } } } }, async addShopCart(item){ console.log('?? ~ handleFoodNum ~ type', "新增") console.log(item) + this.isHandle = true let param = { "userId":uni.getStorageSync('userId'), "orderType": 2, @@ -504,6 +511,7 @@ export default { async delShopCart(item){ console.log('?? ~ handleFoodNum ~ type', "减少") console.log(item) + this.isHandle = true if(item.quantity>0){ let param = { "userId":uni.getStorageSync('userId'), diff --git a/pages/index.vue b/pages/index.vue index 0c4f6d8..594ad7e 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -12,7 +12,7 @@ > --> - 皖送e餐 + {{AppTitle}} 关怀版 @@ -91,7 +91,7 @@