diff --git a/api/order/index.js b/api/order/index.js index c30db03..2ce3dbb 100644 --- a/api/order/index.js +++ b/api/order/index.js @@ -51,7 +51,7 @@ export function getOrderInfoAPI(data) { */ export function addMenuEvaluaOrderApi(data) { return request({ - url: '/smart-canteen/menu_evalua_order', + url: '/smart-canteen/cook_evalua_order', method: 'post', data }) @@ -63,7 +63,7 @@ export function addMenuEvaluaOrderApi(data) { */ export function getPageEvaluateListApi(data) { return request({ - url: '/smart-canteen/menu_evalua_order/list', + url: '/smart-canteen/cook_evalua_order/list', method: 'get', params: data }) diff --git a/pages/advanceOrder/dishDetail.vue b/pages/advanceOrder/dishDetail.vue index 71320dd..90fa96f 100644 --- a/pages/advanceOrder/dishDetail.vue +++ b/pages/advanceOrder/dishDetail.vue @@ -2,7 +2,7 @@ - + @@ -15,14 +15,14 @@ {{ dashesData.quantity || 0 }} @@ -66,78 +66,33 @@ 脂肪(份) 碳水化合物(份) 膳食纤维(份) - 胆固醇(份) - - - 钙(份) - - 钠(份) - + 胆固醇(份) + 钙(份) + 钠(份) 含量 - {{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||'-'}} - + {{dashesData.dishesDetailList[0].nutritionInfo.calories||'-'}} + {{dashesData.dishesDetailList[0].nutritionInfo.protein||'-'}} + {{dashesData.dishesDetailList[0].nutritionInfo.fat||'-'}} + {{dashesData.dishesDetailList[0].nutritionInfo.carbohydrate||'-'}} + {{dashesData.dishesDetailList[0].nutritionInfo.dietaryFiber||'-'}} + {{dashesData.dishesDetailList[0].nutritionInfo.cholesterol||'-'}} + {{dashesData.dishesDetailList[0].nutritionInfo.carotene||'-'}} + {{dashesData.dishesDetailList[0].nutritionInfo.calcium||'-'}} + {{dashesData.dishesDetailList[0].nutritionInfo.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||'-'}} - + {{dashesData.dishesDetailList[0].nutritionInfo.caloriesNrv||'-'}} + {{dashesData.dishesDetailList[0].nutritionInfo.proteinNrv||'-'}} + {{dashesData.dishesDetailList[0].nutritionInfo.fatNrv||'-'}} + {{dashesData.dishesDetailList[0].nutritionInfo.carbohydrateNrv||'-'}} + {{dashesData.dishesDetailList[0].nutritionInfo.dietaryFiberNrv||'-'}} + {{dashesData.dishesDetailList[0].nutritionInfo.cholesterolNrv||'-'}} + {{dashesData.dishesDetailList[0].nutritionInfo.caroteneNrv||'-'}} + {{dashesData.dishesDetailList[0].nutritionInfo.calciumNrv||'-'}} + {{dashesData.dishesDetailList[0].nutritionInfo.sodiumNrv||'-'}} @@ -246,7 +201,7 @@ {{ food.quantity || 0 }} @@ -324,15 +279,16 @@ export default { methods: { //获取菜品详情 async getMenudishesDetail(){ - let param = { - "userId": uni.getStorageSync('userId') , - "detailId": this.menuData.recipeDetailId, - "baseDishesId": this.menuData.baseDishesId, - // "delFlag": 2 - } - const res = await getMenudishesDetailAPI(param) - if(res.code==200){ - this.dashesData = res.data; + // let param = { + // "userId": uni.getStorageSync('userId') , + // "detailId": this.menuData.recipeDetailId, + // "baseDishesId": this.menuData.baseDishesId, + // // "delFlag": 2 + // } + // const res = await getMenudishesDetailAPI(param) + // if(res.code==200){ + // this.dashesData = res.data; + this.dashesData = this.menuData; if(this.dashesData.materialList&&this.dashesData.materialList.length>0){ let arr1=[] let arr2=[] @@ -355,8 +311,8 @@ export default { this.$set(this.dashesData, 'prefPrice', this.dashesData.dishesDetailList[0].prefPrice) this.$set(this.dashesData, 'dishesId', this.dashesData.dishesDetailList[0].dishesId) this.$forceUpdate() - } - console.log(res,'获取菜品详情') + // } + // console.log(res,'获取菜品详情') }, async getMenuEvaluaCount() { let param = { @@ -466,7 +422,7 @@ export default { menuItem.typeList.forEach(detail => { detail.dishesList.forEach(food => { this.shoppingCartList.forEach(cartItem=>{ - if(food.dishesId==cartItem.goodsId){ + if(food.dishesId==cartItem.goodsId){ let obj = { "detailType": food.detailType, "goodsId": cartItem.goodsId, @@ -500,8 +456,13 @@ export default { this.$set(cartItem, 'limitNum', food.dishesDetailList[0].limitNum) this.$set(cartItem, 'prefPrice', food.dishesDetailList[0].prefPrice) if(cartItem.orderDate == this.newDate2){//存在且时间一致 - this.$set(food, 'quantity', cartItem.quantity) - this.$set(cartItem,'isDfficacy', 1) //有效 + if(cartItem.recipeId==this.menuData.recipeId){ + this.$set(food, 'quantity', cartItem.quantity) + this.$set(cartItem,'isDfficacy', 1) //有效 + }else{ + this.$set(food, 'quantity', 0) + this.$set(cartItem,'isDfficacy', 0) //失效 + } }else{//日期不一致 this.$set(food, 'quantity', 0) this.$set(cartItem,'isDfficacy', 0) //失效 @@ -509,7 +470,11 @@ export default { } if(cartItem.dishesId==this.dashesData.dishesId){ if(cartItem.orderDate == this.newDate2){ - this.$set(this.dashesData, 'quantity', cartItem.quantity) + if(cartItem.recipeId==this.menuData.recipeId){ + this.$set(this.dashesData, 'quantity', cartItem.quantity) + }else{ + this.$set(this.dashesData, 'quantity', 0) + } }else{ this.$set(this.dashesData, 'quantity', 0) } diff --git a/pages/advanceOrder/index.vue b/pages/advanceOrder/index.vue index 0df65d5..72a364c 100644 --- a/pages/advanceOrder/index.vue +++ b/pages/advanceOrder/index.vue @@ -58,14 +58,14 @@ {{ item.quantity || 0 }} @@ -146,7 +146,7 @@ {{ food.quantity || 0 }} @@ -439,8 +439,13 @@ export default { this.$set(cartItem, 'limitNum', food.dishesDetailList[0].limitNum) this.$set(cartItem, 'prefPrice', food.dishesDetailList[0].prefPrice) if(cartItem.orderDate == this.newDate2){//存在且时间一致 - this.$set(food, 'quantity', cartItem.quantity) - this.$set(cartItem,'isDfficacy', 1) //有效 + if(cartItem.recipeId==this.recipeId){ + this.$set(food, 'quantity', cartItem.quantity) + this.$set(cartItem,'isDfficacy', 1) //有效 + }else{ + this.$set(food, 'quantity', 0) + this.$set(cartItem,'isDfficacy', 0) //失效 + } }else{//日期不一致 this.$set(food, 'quantity', 0) this.$set(cartItem,'isDfficacy', 0) //失效 diff --git a/pages/work/evaluate.vue b/pages/work/evaluate.vue index e4d027a..9c74c5f 100644 --- a/pages/work/evaluate.vue +++ b/pages/work/evaluate.vue @@ -140,11 +140,11 @@ export default { }) let param ={ "description":this.description, - "ordId":this.dishesData.orderId, - "orderType":this.dishesData.orderType, + "orderId":this.dishesData.orderId, + "orderEvaluaType":this.dishesData.orderType, // "orderEvaluaType":1, "starLevel": this.starLevel, - "shopstallId":this.dishesData.stallId, + "stallId":this.dishesData.stallId, "detailList":arr, "pictureList":arr2 }