接口替换

This commit is contained in:
zzyuan 2025-06-03 11:23:21 +08:00
parent 3efdac97b1
commit 1dfb9fe483
8 changed files with 70 additions and 65 deletions

View File

@ -19,7 +19,7 @@ export function getCanteenListApi(data) {
*/
export function getAdvanceOrderStallApi(data) {
return request({
url: '/smart-canteen/menu_app_recipe/reserve/canteen/shopstall/list',
url: '/smart-canteen/cook/h5/list/reserve/canteen',
method: 'get',
params: data
})
@ -42,7 +42,7 @@ export function getlistReserveDateAPI(data) {
*/
export function getAdvanceDetailListAPI(data) {
return request({
url: '/smart-canteen/menu_app_recipe/reserve/recipe/detail',
url: '/smart-canteen/cook/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/h5/menurecipe/list/week/canteen',
method: 'post',
data
url: '/smart-canteen/cook/h5/list/week/canteen',
method: 'get',
params:data
})
}
@ -16,7 +16,7 @@ export function getWeekCookbookAPI(data) {
*/
export function getWeekDetailListAPI(data) {
return request({
url: '/smart-canteen/h5/menurecipe/week/recipe/detail',
url: '/smart-canteen/cook/h5/week/recipe/detail',
method: 'get',
params:data
})

View File

@ -11,7 +11,7 @@
{{(menuData.dishesDetailList[0].prefPrice/100).toFixed(2)}}
</view>
<view style="display: flex;align-items: center;" v-if="dashesData.surplusNum>0">
<view style="display: flex;align-items: center;" v-if="dashesData.remanentNum>0">
<u-icon
v-if="dashesData.quantity>0"
name="../../static/images/delete.png"
@ -20,12 +20,12 @@
/>
<span style="margin: 0 10px;font-size: 28rpx;">{{ dashesData.quantity || 0 }}</span>
<u-icon
v-if="dashesData.quantity < dashesData.restrictNum"
v-if="dashesData.quantity < dashesData.limitNum"
name="../../static/images/add.png"
size="16"
@click="handleFoodNum(2, dashesData)"
/>
<u-icon v-if="dashesData.quantity == dashesData.restrictNum" name="../../static/images/no-add.png" size="16" />
<u-icon v-if="dashesData.quantity == dashesData.limitNum" name="../../static/images/no-add.png" size="16" />
</view>
</view>
<view style="width: 100%;height: 30px;display: flex;align-items: center;justify-content: space-between;">
@ -232,8 +232,8 @@
<view class="meal-name" :style="{color:(food.orderDate!=newDate2? '#747474':'#000')}">{{ food.goodsName }}{{ food.mealtimeName }}</view>
<view class="sale-num" :style="{color:(food.orderDate!=newDate2? '#747474':'#000')}">月销 {{ food.monthlySales||0 }}</view>
<view class="num-cont" :style="{color:(food.orderDate!=newDate2? '#ffbe89':'#ff6816')}">
<span style="margin-right: 5px">{{ '库存' + food.surplusNum }}</span>
<span>{{ '限购' + food.restrictNum }}</span>
<span style="margin-right: 5px">{{ '库存' + food.remanentNum }}</span>
<span>{{ '限购' + food.limitNum }}</span>
</view>
<view class="sale-price" :style="{color:(food.orderDate!=newDate2? '#ffbe89':'#ff6816')}">
<span style="font-size: 20rpx"></span>
@ -252,7 +252,7 @@
<span class="cont-num">{{ food.quantity || 0 }}</span>
<view style="width: 40rpx;" @click="handleFoodNum(2, food)">
<u-icon
v-if="food.quantity<food.restrictNum"
v-if="food.quantity<food.limitNum"
name="../../static/images/add2.png"
size="18"
/>
@ -349,8 +349,8 @@ export default {
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)
this.$set(this.dashesData, 'surplusNum', this.dashesData.dishesDetailList[0].surplusNum)
this.$set(this.dashesData, 'restrictNum', this.dashesData.dishesDetailList[0].restrictNum)
this.$set(this.dashesData, 'remanentNum', this.dashesData.dishesDetailList[0].remanentNum)
this.$set(this.dashesData, 'limitNum', this.dashesData.dishesDetailList[0].limitNum)
this.$set(this.dashesData, 'dishesPrice', this.dashesData.dishesDetailList[0].dishesPrice)
this.$set(this.dashesData, 'prefPrice', this.dashesData.dishesDetailList[0].prefPrice)
this.$set(this.dashesData, 'dishesId', this.dashesData.dishesDetailList[0].dishesId)
@ -409,8 +409,8 @@ export default {
this.$set(food, 'quantity', 0)
this.$set(food, 'monthlySales', food.dishesDetailList[0].monthlySales)
this.$set(food, 'goodProbability', food.dishesDetailList[0].goodProbability)
this.$set(food, 'surplusNum', food.dishesDetailList[0].surplusNum)
this.$set(food, 'restrictNum', food.dishesDetailList[0].restrictNum)
this.$set(food, 'remanentNum', food.dishesDetailList[0].remanentNum)
this.$set(food, 'limitNum', food.dishesDetailList[0].limitNum)
this.$set(food, 'dishesPrice', food.dishesDetailList[0].dishesPrice)
this.$set(food, 'prefPrice', food.dishesDetailList[0].prefPrice)
this.$set(food, 'dishesId', food.dishesDetailList[0].dishesId)
@ -457,8 +457,8 @@ export default {
this.shoppingCartList = res.data;
this.shoppingCartList.forEach(item => {
item.isDfficacy = 0
item.surplusNum = 0
item.restrictNum = 0
item.remanentNum = 0
item.limitNum = 0
item.prefPrice = 0
item.monthlySales = 0
})
@ -485,10 +485,10 @@ export default {
"orderDate": cartItem.orderDate,
"orderType": cartItem.orderType,
"prefPrice": food.dishesDetailList[0].prefPrice,
"restrictNum": food.dishesDetailList[0].restrictNum,
"limitNum": food.dishesDetailList[0].limitNum,
"shoppingCartId": cartItem.shoppingCartId,
"sizeType": cartItem.sizeType,
"surplusNum": cartItem.surplusNum
"remanentNum": cartItem.remanentNum
}
this.$set(cartItem, 'orderDetailList', [obj])
this.$set(cartItem, 'mealtimeName', food.mealtimeName)
@ -497,8 +497,8 @@ export default {
this.$set(cartItem, 'detailId', food.detailId)
this.$set(cartItem, 'detailType', food.detailType)
this.$set(cartItem, 'dishesId', food.dishesDetailList[0].dishesId)
this.$set(cartItem, 'surplusNum', food.dishesDetailList[0].surplusNum)
this.$set(cartItem, 'restrictNum', food.dishesDetailList[0].restrictNum)
this.$set(cartItem, 'remanentNum', food.dishesDetailList[0].remanentNum)
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)
@ -539,7 +539,7 @@ export default {
}
}
} else {
if (food.quantity < food.restrictNum) {
if (food.quantity < food.limitNum) {
if(!this.isHandle){
this.addShopCart(food)
}

View File

@ -30,7 +30,7 @@
<view :id="'scroll'+typeitem.typeId" style="margin: 20rpx 10rpx;font-weight: bold;font-size: 32rpx;">{{typeitem.typeName}}</view>
<view class="scroll-right-item" v-for="(item,index) in typeitem.dishesList" :key="index">
<view style="width: 100%;display: flex;align-items: center;height: 100%;">
<view style="width: 160rpx;height: 160rpx;" @click="goMenuDetail(item)" v-if="item.surplusNum>0">
<view style="width: 160rpx;height: 160rpx;" @click="goMenuDetail(item)" v-if="item.remanentNum>0">
<image class="image" :src="item.dishesImgUrl"></image>
</view>
<view style="width: 160rpx;height: 160rpx;position: relative;background: rgba(0,0,0,0.1);" @click="goMenuDetail(item)" v-else>
@ -40,22 +40,22 @@
<view style="width: 65%;height: 100%; display: flex;position: relative;">
<view class="center-cont" @click="goMenuDetail(item)">
<view class="meal-name" style="margin-bottom: 10rpx;font-weight: bold;" :style="{color:(item.surplusNum==0? '#747474':'#000')}">{{ item.dishesName }}</view>
<view class="meal-name" style="margin-bottom: 10rpx;font-weight: bold;" :style="{color:(item.remanentNum==0? '#747474':'#000')}">{{ item.dishesName }}</view>
<view class="sale-num" style="margin-bottom: 10rpx;">
<text>月销 {{ item.monthlySales||0 }}</text>
<text style="margin-left: 20rpx;">好评率{{ item.goodProbability||0 }}%</text>
</view>
<view class="num-cont" style="margin-bottom: 10rpx;" :style="{color:(item.surplusNum==0? '#ffbe89':'#ff6816')}">
<span style="margin-right: 5px;" :style="{borderColor:(item.surplusNum==0? '#ffbe89':'#ff6816')}">{{ '库存' + item.surplusNum }}</span>
<span :style="{borderColor:(item.surplusNum==0? '#ffbe89':'#ff6816')}">{{ '限购' + item.restrictNum }}</span>
<view class="num-cont" style="margin-bottom: 10rpx;" :style="{color:(item.remanentNum==0? '#ffbe89':'#ff6816')}">
<span style="margin-right: 5px;" :style="{borderColor:(item.remanentNum==0? '#ffbe89':'#ff6816')}">{{ '库存' + item.remanentNum }}</span>
<span :style="{borderColor:(item.remanentNum==0? '#ffbe89':'#ff6816')}">{{ '限购' + item.limitNum }}</span>
</view>
<view class="sale-price" style="margin-bottom: 10rpx;" :style="{color:(item.surplusNum==0? '#ffbe89':'#ff6816')}">
<view class="sale-price" style="margin-bottom: 10rpx;" :style="{color:(item.remanentNum==0? '#ffbe89':'#ff6816')}">
<span style="font-size: 20rpx"></span>
<span style="font-size: 32rpx">{{ (item.dishesDetailList[0].prefPrice/100).toFixed(2) }}</span>
<span style="font-size: 20rpx;color: #666;font-weight: 400;text-decoration: line-through;margin-left: 10rpx;">{{ (item.dishesDetailList[0].dishesPrice/100).toFixed(2) }}</span>
</view>
</view>
<view class="right-cont" v-if="item.surplusNum!=0">
<view class="right-cont" v-if="item.remanentNum!=0">
<u-icon v-if="item.quantity > 0"
name="../../static/images/delete.png"
size="16"
@ -63,12 +63,12 @@
/>
<span style="margin: 0 10px;font-size: 28rpx;">{{ item.quantity || 0 }}</span>
<u-icon
v-if="item.quantity < item.restrictNum"
v-if="item.quantity < item.limitNum"
name="../../static/images/add.png"
size="16"
@click="handleFoodNum(2, item)"
/>
<u-icon v-if="item.quantity == item.restrictNum" name="../../static/images/no-add.png" size="16" />
<u-icon v-if="item.quantity == item.limitNum" name="../../static/images/no-add.png" size="16" />
</view>
</view>
</view>
@ -132,8 +132,8 @@
<view class="meal-name" :style="{color:(food.orderDate!=newDate2? '#747474':'#000')}">{{ food.goodsName }} {{ food.mealtimeName }}</view>
<view class="sale-num" :style="{color:(food.orderDate!=newDate2? '#747474':'#000')}">月销 {{ food.monthlySales||0 }}</view>
<view class="num-cont" :style="{color:(food.orderDate!=newDate2? '#ffbe89':'#ff6816')}">
<span style="margin-right: 5px">{{ '库存' + food.surplusNum }}</span>
<span>{{ '限购' + food.restrictNum }}</span>
<span style="margin-right: 5px">{{ '库存' + food.remanentNum }}</span>
<span>{{ '限购' + food.limitNum }}</span>
</view>
<view class="sale-price" :style="{color:(food.orderDate!=newDate2? '#ffbe89':'#ff6816')}">
<span style="font-size: 20rpx"></span>
@ -152,7 +152,7 @@
<span class="cont-num">{{ food.quantity || 0 }}</span>
<view style="width: 40rpx;" @click="handleFoodNum(2, food)">
<u-icon
v-if="food.quantity<food.restrictNum"
v-if="food.quantity<food.limitNum"
name="../../static/images/add2.png"
size="18"
/>
@ -237,19 +237,22 @@ export default {
methods: {
//
async getReserveDate(){
let param = {
"reserveLimitDayNum": "1",
"ifAllowReserveToday": "1"
}
const res = await getlistReserveDateAPI(param)
this.getNowFormatDate(res.data[0])
this.getNowFormatDate2(res.data[0])
// let param = {
// "reserveLimitDayNum": "1",
// "ifAllowReserveToday": "1"
// }
// const res = await getlistReserveDateAPI(param)
// this.getNowFormatDate(res.data[0])
// this.getNowFormatDate2(res.data[0])
this.getNowFormatDate()
this.getNowFormatDate2()
//
this.getMenuListData()
},
//
getNowFormatDate(data) {
let date = new Date(data)
// let date = new Date(data)
let date = new Date()
let year = date.getFullYear()
let month = (date.getMonth() + 1).toString().padStart(2, '0')
let day = date.getDate().toString().padStart(2, '0')
@ -259,7 +262,8 @@ export default {
},
// 2025-01-03
getNowFormatDate2(data) {
let date = new Date(data)
// let date = new Date(data)
let date = new Date()
let year = date.getFullYear()
let month = (date.getMonth() + 1).toString().padStart(2, '0')
let day = date.getDate().toString().padStart(2, '0')
@ -286,8 +290,8 @@ export default {
this.$set(food, 'quantity', 0)
this.$set(food, 'monthlySales', food.dishesDetailList[0].monthlySales)
this.$set(food, 'goodProbability', food.dishesDetailList[0].goodProbability)
this.$set(food, 'surplusNum', food.dishesDetailList[0].surplusNum)
this.$set(food, 'restrictNum', food.dishesDetailList[0].restrictNum)
this.$set(food, 'remanentNum', food.dishesDetailList[0].remanentNum)
this.$set(food, 'limitNum', food.dishesDetailList[0].limitNum)
this.$set(food, 'dishesPrice', food.dishesDetailList[0].dishesPrice)
this.$set(food, 'prefPrice', food.dishesDetailList[0].prefPrice)
this.$set(food, 'dishesId', food.dishesDetailList[0].dishesId)
@ -389,8 +393,8 @@ export default {
// console.log(this.shoppingCartList)
this.shoppingCartList.forEach(item => {
item.isDfficacy = 0
item.surplusNum = 0
item.restrictNum = 0
item.remanentNum = 0
item.limitNum = 0
item.prefPrice = 0
item.monthlySales = 0
})
@ -420,10 +424,10 @@ export default {
"orderDate": cartItem.orderDate,
"orderType": cartItem.orderType,
"prefPrice": food.dishesDetailList[0].prefPrice,
"restrictNum": food.dishesDetailList[0].restrictNum,
"limitNum": food.dishesDetailList[0].limitNum,
"shoppingCartId": cartItem.shoppingCartId,
"sizeType": cartItem.sizeType,
"surplusNum": cartItem.surplusNum
"remanentNum": cartItem.remanentNum
}
this.$set(cartItem, 'orderDetailList', [obj])
this.$set(cartItem, 'mealtimeName', food.mealtimeName)
@ -432,8 +436,8 @@ export default {
this.$set(cartItem, 'detailId', food.detailId)
this.$set(cartItem, 'detailType', food.detailType)
this.$set(cartItem, 'dishesId', food.dishesDetailList[0].dishesId)
this.$set(cartItem, 'surplusNum', food.dishesDetailList[0].surplusNum)
this.$set(cartItem, 'restrictNum', food.dishesDetailList[0].restrictNum)
this.$set(cartItem, 'remanentNum', food.dishesDetailList[0].remanentNum)
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)
@ -468,7 +472,7 @@ export default {
}
}
} else {
if (food.quantity < food.restrictNum) {
if (food.quantity < food.limitNum) {
if(!this.isHandle){
this.addShopCart(food)
}

View File

@ -14,11 +14,10 @@
<view class="title">{{item.createBy}}</view>
</view>
<view class="desc">{{ item.content }}</view>
<!-- <view class="img-box" v-for="(imgItem,imgIndex) in item.complaintPictureList" :key="imgIndex"> -->
<view class="img-box">
<view style="width: 110rpx;height: 110rpx;margin-right: 20rpx;">
<image :src="item.complaintPicture" mode="" style="width: 100rpx;height: 100rpx;"></image>
</view>
<view class="img-box">
<view v-for="(imgItem,imgIndex) in item.suggestionPictures" :key="imgIndex" style="width: 110rpx;height: 110rpx;margin-right: 20rpx;">
<image :src="imgItem.imgUrl" mode="" style="width: 100rpx;height: 100rpx;"></image>
</view>
</view>
<view class="time">{{ item.createTime }}</view>
</view>

View File

@ -53,7 +53,7 @@
:fileList="fileList"
@afterRead="afterRead"
@delete="deletePic"
:maxCount="1"
:maxCount="5"
multiple
>
<view class="upload-btn">
@ -167,12 +167,15 @@ export default {
}
let arr = []
this.fileList.forEach(item=>{
arr.push(item.url)
let obj = {
imgUrl:item.url
}
arr.push(obj)
})
let param = {
"canteenId": this.canteenId,
"canteenName": this.canteenName,
"complaintPicture": arr[0],
"suggestionPictures": arr,
"content": this.content,
"contactTel": this.contactInfo,
"userId": uni.getStorageSync('userId')

View File

@ -189,6 +189,7 @@ export default {
this.menuData = JSON.parse(options.params)
this.menuData.stallId=options.stallId
this.getMenudishesDetail()
console.log(this.menuData)
// this.getMenuEvaluaorderList()
// this.getMenuEvaluaCount()
@ -246,9 +247,7 @@ export default {
}
const res = await getMenuEvaluaorderAPI(param)
if(res.code==200){
this.evaluaList = res.data.evaluaList||[]
// this.dashesData = res.data;
// this.$forceUpdate()
this.evaluaList = res.data.evaluaList||[]
}
console.log(res)
},

View File

@ -108,7 +108,7 @@ export default {
async getMenuListData() {
let param = {
"recipeId":this.recipeId,
"applyDate":this.daysList[this.hIndex].data,
"date":this.daysList[this.hIndex].data,
}
const res = await getWeekDetailListAPI(param)
console.log(res, '周菜谱')