接口替换

This commit is contained in:
zzyuan 2025-06-10 09:41:35 +08:00
parent 4775a863ed
commit 134c66a95e
10 changed files with 140 additions and 134 deletions

View File

@ -19,7 +19,7 @@ export function getCanteenListApi(data) {
*/
export function getAdvanceOrderStallApi(data) {
return request({
url: '/smart-canteen/cook/h5/list/reserve/canteen',
url: '/smart-canteen/cook_recipe_h5/reserve/canteen/shopstall/list',
method: 'get',
params: data
})
@ -31,7 +31,7 @@ export function getAdvanceOrderStallApi(data) {
*/
export function getlistReserveDateAPI(data) {
return request({
url: '/smart-canteen/menu_app_recipe/reserve-date/list',
url: '/smart-canteen/cook_recipe_h5/reserve-date/list',
method: 'post',
data
})
@ -42,7 +42,7 @@ export function getlistReserveDateAPI(data) {
*/
export function getAdvanceDetailListAPI(data) {
return request({
url: '/smart-canteen/cook/h5/reserve/recipe/detail',
url: '/smart-canteen/cook_recipe_h5/reserve/recipe/detail',
method: 'post',
data
})

View File

@ -5,9 +5,9 @@ import request from '@/utils/request'
*/
export function getWeekCookbookAPI(data) {
return request({
url: '/smart-canteen/cook/h5/list/week/canteen',
method: 'get',
params:data
url: '/smart-canteen/cook_recipe_h5/list/week/canteen',
method: 'post',
data:data
})
}
@ -16,9 +16,9 @@ export function getWeekCookbookAPI(data) {
*/
export function getWeekDetailListAPI(data) {
return request({
url: '/smart-canteen/cook/h5/week/recipe/detail',
method: 'get',
params:data
url: '/smart-canteen/cook_recipe_h5/week/recipe/detail',
method: 'post',
data:data
})
}
@ -27,7 +27,7 @@ export function getWeekDetailListAPI(data) {
*/
export function getMenudishesDetailAPI(data) {
return request({
url: '/smart-canteen/h5/menurecipe/detail',
url: '/smart-canteen/cook_recipe_h5/dishes/detail',
method: 'post',
data
})
@ -50,7 +50,7 @@ export function getMenuEvaluaorderAPI(data) {
//菜品收藏列表
export function getCollectionDishesAPI(data) {
return request({
url: '/smart-canteen/menu_collection_dishes/list',
url: '/smart-canteen/cook_collection_dishes/list',
method: 'get',
params:data
})
@ -59,7 +59,7 @@ export function getCollectionDishesAPI(data) {
//菜品收藏-添加
export function addCollectionDishesAPI(data) {
return request({
url: '/smart-canteen/menu_collection_dishes',
url: '/smart-canteen/cook_collection_dishes',
method: 'post',
data
})
@ -68,7 +68,7 @@ export function addCollectionDishesAPI(data) {
//菜品收藏-删除
export function delCollectionDishesAPI(data) {
return request({
url: '/smart-canteen/menu_collection_dishes/del/'+data.dishesIds,
url: '/smart-canteen/cook_collection_dishes/del/'+data.dishesIds,
method: 'post',
data
})

View File

@ -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',//董高文

View File

@ -72,27 +72,27 @@
</view>
<view class="nutrition-box-item">
<view>含量</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.calories||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.protein||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.fat||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.carbohydrate||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.dietaryFiber||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.cholesterol||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.carotene||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.calcium||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.sodium||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].calories||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].protein||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].fat||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].carbohydrate||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].dietaryFiber||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].cholesterol||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].carotene||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].calcium||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].sodium||'-'}}</view>
</view>
<view class="nutrition-box-item">
<view>NRV%</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.caloriesNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.proteinNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.fatNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.carbohydrateNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.dietaryFiberNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.cholesterolNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.caroteneNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.calciumNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.sodiumNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].caloriesNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].proteinNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].fatNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].carbohydrateNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].dietaryFiberNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].cholesterolNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].caroteneNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].calciumNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].sodiumNrv||'-'}}</view>
</view>
</view>
<view class="evaluate-box" v-if="hIndex==2">
@ -122,7 +122,7 @@
</view>
<view style="width: 100%;padding: 10rpx;padding-left: 20rpx;display: flex;align-items: center;" v-if="item.pictureList&&item.pictureList.length>0">
<view v-for="(imgItem,imgIndex) in item.pictureList" :key="imgIndex" style="margin-bottom: 10rpx;">
<image :src="item" mode="" style="width: 100rpx;height: 100rpx;"></image>
<image :src="imgItem" mode="" style="width: 100rpx;height: 100rpx;"></image>
</view>
</view>
<view style="width: 100%;padding: 10rpx;padding-left: 20rpx;">
@ -267,27 +267,25 @@ export default {
}
},
onLoad(options) {
options = JSON.parse(options.params)
console.log(options)
options = JSON.parse(options.params)
this.menuData = options
console.log(this.menuData)
this.newDate2 = this.menuData.orderDate
this.getMenudishesDetail()
// this.getMenuEvaluaorderList()
this.getMenuEvaluaorderList()
this.getMenuListData()
},
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;
this.dashesData = this.menuData;
let param = {
"userId": uni.getStorageSync('userId') ,
"dishesId": this.menuData.dishesDetailList[0].dishesId,
"detailId": this.menuData.detailId,
}
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=[]
@ -310,20 +308,15 @@ 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 getMenuEvaluaorderList(){
let param = {
// "current": 1,
// "size": 10,
"mealId": this.menuData.dishesId,
// "mealId": "383143288183459840",
"shopstallId": this.menuData.stallId,
// "shopstallId": "379082300370980864",
"searchType": "0",
"mealType": "1"
let param = {
"pageNum": 1,
"pageSize": 10,
"mealId": this.menuData.dishesDetailList[0].dishesId,
}
const res = await getMenuEvaluaorderAPI(param)
if(res.code==200){

View File

@ -115,9 +115,9 @@
title: '请选择要删除的商品!'
})
} else {
console.log(that.confirmList)
// console.log(that.confirmList)
let arr = that.confirmList.map(item=>item.dishesId)
console.log(arr)
// console.log(arr)
let param = {
"dishesIds":arr,
// "userId":uni.getStorageSync('userId'),

View File

@ -26,7 +26,7 @@
</view>
<view style="width: 100%;padding: 10rpx;padding-left: 20rpx;display: flex;align-items: center;" v-if="item.pictureList.length>0">
<view v-for="(imgItem,imgIndex) in item.pictureList" :key="imgIndex" style="margin-bottom: 10rpx;">
<image :src="item" mode="" style="width: 100rpx;height: 100rpx;"></image>
<image :src="imgItem" mode="" style="width: 100rpx;height: 100rpx;"></image>
</view>
</view>
<view style="width: 100%;padding: 10rpx;padding-left: 20rpx;">
@ -56,7 +56,8 @@ export default {
fontValue:uni.getStorageSync('fontSize') || 8,
menuData:{},
tabIndex: 0,
tabList: ['全部','有图','最新'],
tabList: ['全部'],
// tabList: ['','',''],
evaluaList:[],
//
pageNum: 1,
@ -81,20 +82,27 @@ export default {
},
async getMenuEvaluaorderList() {
let param = {
// "current": 1,
// "size": 10,
"mealId": this.menuData.dishesId,
"shopstallId": this.menuData.stallId,
"searchType": this.tabIndex+"",
"mealType": "1"
"pageNum": this.pageNum,
"pageSize": this.pageSize,
"mealId": this.menuData.dishesDetailList[0].dishesId,
}
const res = await getMenuEvaluaorderAPI(param)
console.log(res)
this.evaluaList = res.rows
console.log(res)
if(this.pageNum==1){
this.evaluaList = res.rows
}else{
this.evaluaList.push(...res.rows)
}
this.total = res.total
this.$forceUpdate()
},
//
onScrollTolower(){
console.log('?? ~ onReachBottom ~ ')
if(this.total>this.evaluaList.length){
this.pageNum++
this.getMenuEvaluaorderList()
}
},
//

View File

@ -58,27 +58,27 @@
</view>
<view class="nutrition-box-item">
<view>含量</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.calories||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.protein||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.fat||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.carbohydrate||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.dietaryFiber||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.cholesterol||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.carotene||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.calcium||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.sodium||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].calories||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].protein||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].fat||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].carbohydrate||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].dietaryFiber||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].cholesterol||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].carotene||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].calcium||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].sodium||'-'}}</view>
</view>
<view class="nutrition-box-item">
<view>NRV%</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.caloriesNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.proteinNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.fatNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.carbohydrateNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.dietaryFiberNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.cholesterolNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.caroteneNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.calciumNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].nutritionInfo.sodiumNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].caloriesNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].proteinNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].fatNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].carbohydrateNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].dietaryFiberNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].cholesterolNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].caroteneNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].calciumNrv||'-'}}</view>
<view>{{dashesData.dishesDetailList[0].sodiumNrv||'-'}}</view>
</view>
</view>
<view class="evaluate-box" v-if="hIndex==2">
@ -90,7 +90,7 @@
<text style="font-size: 24rpx;margin-left: 20rpx;" @click="goAllEvaluate">查看全部{{totalCount}}></text>
</view>
<view style="width: 100%;height: 40vh;padding: 20rpx;" v-if="totalCount>0">
<view v-for="(item,index) in evaluaList" :key="index" style="width: 100%;height: auto;border-bottom: 1px solid #ccc;">
<view v-for="(item,index) in evaluaList" :key="index" v-if="index<3" style="width: 100%;height: auto;border-bottom: 1px solid #ccc;">
<view style="width: 94%;margin: 10rpx auto;display: flex;">
<view style="width: 100rpx;height: 100rpx;margin: 10rpx;">
<image :src="item.custPhotoUrl? item.custPhotoUrl:'../../static/images/user.png'" mode="" style="width: 100rpx;height: 100rpx;"></image>
@ -108,7 +108,7 @@
</view>
<view style="width: 100%;padding: 10rpx;padding-left: 20rpx;display: flex;align-items: center;" v-if="item.pictureList&&item.pictureList.length>0">
<view v-for="(imgItem,imgIndex) in item.pictureList" :key="imgIndex" style="margin-bottom: 10rpx;">
<image :src="item" mode="" style="width: 100rpx;height: 100rpx;"></image>
<image :src="imgItem" mode="" style="width: 100rpx;height: 100rpx;"></image>
</view>
</view>
<view style="width: 100%;padding: 10rpx;padding-left: 20rpx;">
@ -141,26 +141,23 @@ export default {
},
onLoad(options) {
console.log(options)
this.menuData = JSON.parse(options.params)
this.menuData.stallId=options.stallId
this.menuData = JSON.parse(options.params)
this.getMenudishesDetail()
console.log(this.menuData)
this.getMenuEvaluaorderList()
this.getMenuEvaluaorderList()
},
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;
this.dashesData = this.menuData;
let param = {
"userId": uni.getStorageSync('userId'),
"dishesId": this.menuData.dishesDetailList[0].dishesId,
"detailId": this.menuData.detailId,
// "delFlag": 2
}
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=[]
@ -176,21 +173,16 @@ export default {
}
this.$forceUpdate()
// this.$modal.msgError("")
// }
// console.log(res)
}
console.log(res)
},
//
async getMenuEvaluaorderList(){
console.log(this.menuData)
let param = {
"current": 1,
"size": 10,
"mealId": this.menuData.dishesId,
// "mealId": "383143288183459840",
"shopstallId": this.menuData.stallId,
// "shopstallId": "379082300370980864",
"searchType": "3",
"mealType": "1"
"pageNum": 1,
"pageSize": 10,
"mealId": this.menuData.dishesDetailList[0].dishesId,
}
const res = await getMenuEvaluaorderAPI(param)
if(res.code==200){
@ -214,7 +206,7 @@ export default {
let param = {
"dishesId":this.dashesData.dishesDetailList[0].dishesId,
"userId":uni.getStorageSync('userId'),
"shopstallId":this.menuData.stallId
"stallId":this.menuData.stallId
}
const res = await addCollectionDishesAPI(param)
console.log(res)

View File

@ -74,8 +74,7 @@ export default {
onLoad(options) {
console.log(options)
options = JSON.parse(options.params)
this.recipeId=options.recipeId;
this.stallId=options.stallId;
this.recipeId=options.recipeId;
this.daysList = this.getRecentWeekDates()
this.getMenuListData()
},
@ -104,11 +103,25 @@ export default {
}
return weekDates;
},
// recipeType
handleRecipeType(type) {
if (type === 1) {
return '早餐'
} else if (type === 2) {
return '午餐'
} else if (type === 3) {
return '下午茶'
} else if (type === 4) {
return '晚餐'
}else if (type === 5) {
return '夜宵'
}
},
//
async getMenuListData() {
let param = {
"recipeId":this.recipeId,
"date":this.daysList[this.hIndex].data,
"applyDate":this.daysList[this.hIndex].data,
}
const res = await getWeekDetailListAPI(param)
console.log(res, '周菜谱')
@ -118,7 +131,7 @@ export default {
this.tabList=[]
//
this.menuData.forEach(item=>{//
this.tabList.push(item.mealtimeName)
this.tabList.push(this.handleRecipeType(item.mealtimeType))
})
this.changeTab(0)
}else{
@ -178,7 +191,7 @@ export default {
},
goMenuList(item){
uni.navigateTo({
url: `/pages/weeklyMenu/menuDetail?params=${JSON.stringify(item)}&stallId=${this.stallId}`
url: `/pages/weeklyMenu/menuDetail?params=${JSON.stringify(item)}`
})
}

View File

@ -13,18 +13,17 @@
<span v-if="n==4">推荐</span>
<span v-if="n==5">超赞</span>
</view>
</view>
<!-- 分项评分 -->
<view class="detail-rating">
<view class="rating-item" v-for="(item, index) in dishesList" :key="index">
<view class="rating-item" v-for="(item, index) in dishesList" :key="index">
<image :src="item.goodsImgUrl" style="width: 100rpx;height: 100rpx;"></image>
<text class="item-label">{{ item.goodsName }}</text>
<view class="hearts-row">
<u-icon v-for="n in 5" :key="n" :name="n <= item.starValue ? 'star-fill' : 'star-fill'"
:color="n <= item.starValue ? '#ff9933' : '#ccc'" size="36" @click="changStar(item,n)"></u-icon>
</view>
</view>
</view>
</view>
<!-- 评价输入 -->
<view class="comment-box">
@ -130,7 +129,7 @@ export default {
mealId:item.goodsId,
mealType:item.detailType,
starLevel:item.starValue,
description:"1"
description:this.description
}
return obj
})

View File

@ -139,16 +139,17 @@ export default {
},
//
onScrollTolower(){
console.log(this.tableList.length)
if(this.tabIndex==0){
if(this.total>this.tableList.length){
if(this.tabIndex==0){
this.pageNum++
this.getUnEvaluateList()
}else{
this.pageNum2++
this.getEvaluatedList()
}
this.pageNum++
this.getUnEvaluateList()
}
}else{
if(this.total2>this.tableList2.length){
this.pageNum2++
this.getEvaluatedList()
}
}
},
//
async getUnEvaluateList() {
@ -193,8 +194,8 @@ export default {
userId: uni.getStorageSync('userId'),
startDate: this.startDate,
endDate: this.endDate,
current: this.pageNum2,
size: this.pageSize2,
pageNum: this.pageNum2,
pageSize: this.pageSize2,
}
try {
const res = await getPageEvaluateListApi(params)