参数修改-预定餐
This commit is contained in:
parent
1dfb9fe483
commit
64b4419784
|
|
@ -53,7 +53,7 @@ export function getAdvanceDetailListAPI(data) {
|
|||
*/
|
||||
export function addAdvancehoppingCartAPI(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/shopping_cart/add',
|
||||
url: '/smart-canteen/order_cart/add',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
|
|
@ -64,7 +64,7 @@ export function addAdvancehoppingCartAPI(data) {
|
|||
*/
|
||||
export function updateAdvancehoppingCartAPI(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/shopping_cart/edit',
|
||||
url: '/smart-canteen/order_cart/edit',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
|
|
@ -74,7 +74,7 @@ export function updateAdvancehoppingCartAPI(data) {
|
|||
*/
|
||||
export function clearAdvancehoppingCartAPI(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/shopping_cart/remove',
|
||||
url: '/smart-canteen/order_cart/remove',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
|
|
@ -85,7 +85,7 @@ export function clearAdvancehoppingCartAPI(data) {
|
|||
*/
|
||||
export function getShoppingCartListAPI(data) {
|
||||
return request({
|
||||
url: '/smart-canteen/shopping_cart/list',
|
||||
url: '/smart-canteen/order_cart/list',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ export default {
|
|||
async getMenudishesDetail(){
|
||||
let param = {
|
||||
"userId": uni.getStorageSync('userId') ,
|
||||
"detailId": this.menuData.detailId,
|
||||
"detailId": this.menuData.recipeDetailId,
|
||||
"baseDishesId": this.menuData.baseDishesId,
|
||||
// "delFlag": 2
|
||||
}
|
||||
|
|
@ -468,15 +468,14 @@ export default {
|
|||
this.shoppingCartList.forEach(cartItem=>{
|
||||
if(food.dishesId==cartItem.goodsId){
|
||||
let obj = {
|
||||
"detailId": food.detailId,
|
||||
"detailType": food.detailType,
|
||||
"goodsId": cartItem.goodsId,
|
||||
"goodsImgUrl": food.dishesImgUrl,//图片地址
|
||||
"goodsName": cartItem.goodsName,
|
||||
"mealtimeName": food.mealtimeName,
|
||||
"mealtimeType": food.mealtimeType,
|
||||
"menuDetailId": food.detailId,
|
||||
"menuId": cartItem.menuId,
|
||||
"recipeDetailId": food.recipeDetailId,
|
||||
"recipeId": cartItem.recipeId,
|
||||
"quantity": cartItem.quantity,
|
||||
"salePrice": food.dishesDetailList[0].dishesPrice,
|
||||
"discountPrice": food.dishesDetailList[0].prefPrice,
|
||||
|
|
@ -486,7 +485,7 @@ export default {
|
|||
"orderType": cartItem.orderType,
|
||||
"prefPrice": food.dishesDetailList[0].prefPrice,
|
||||
"limitNum": food.dishesDetailList[0].limitNum,
|
||||
"shoppingCartId": cartItem.shoppingCartId,
|
||||
"cartId": cartItem.cartId,
|
||||
"sizeType": cartItem.sizeType,
|
||||
"remanentNum": cartItem.remanentNum
|
||||
}
|
||||
|
|
@ -494,7 +493,7 @@ export default {
|
|||
this.$set(cartItem, 'mealtimeName', food.mealtimeName)
|
||||
this.$set(cartItem, 'goodsImgUrl', food.dishesImgUrl)
|
||||
this.$set(cartItem, 'monthlySales', food.dishesDetailList[0].monthlySales)
|
||||
this.$set(cartItem, 'detailId', food.detailId)
|
||||
this.$set(cartItem, 'recipeDetailId', food.recipeDetailId)
|
||||
this.$set(cartItem, 'detailType', food.detailType)
|
||||
this.$set(cartItem, 'dishesId', food.dishesDetailList[0].dishesId)
|
||||
this.$set(cartItem, 'remanentNum', food.dishesDetailList[0].remanentNum)
|
||||
|
|
@ -558,10 +557,10 @@ export default {
|
|||
"canteenId":this.menuData.canteenId,
|
||||
"stallId":this.menuData.stallId,
|
||||
"mealtimeType":this.menuData.mealtimeType,
|
||||
"menuId":this.menuData.recipeId,
|
||||
"recipeId":this.menuData.recipeId,
|
||||
"goodsId":item.dishesId,
|
||||
"goodsName":item.goodsName||item.dishesName,
|
||||
"detailId":this.menuData.detailId,
|
||||
"recipeDetailId":this.menuData.recipeDetailId,
|
||||
"detailType":this.menuData.detailType,
|
||||
"quantity":item.quantity+1
|
||||
}
|
||||
|
|
@ -569,7 +568,7 @@ export default {
|
|||
console.log(this.shoppingCartList)
|
||||
this.shoppingCartList.forEach(cartItem=>{
|
||||
if(item.dishesId==cartItem.goodsId){
|
||||
param.shoppingCartId=cartItem.shoppingCartId
|
||||
param.cartId=cartItem.cartId
|
||||
}
|
||||
})
|
||||
console.log(param)
|
||||
|
|
@ -586,12 +585,12 @@ export default {
|
|||
if(item.quantity>0){
|
||||
let param = {
|
||||
"userId":uni.getStorageSync('userId'),
|
||||
"shoppingCartId":'',
|
||||
"cartId":'',
|
||||
"quantity":item.quantity
|
||||
}
|
||||
this.shoppingCartList.forEach(cartItem=>{
|
||||
if(item.dishesId==cartItem.goodsId){
|
||||
param.shoppingCartId=cartItem.shoppingCartId
|
||||
param.cartId=cartItem.cartId
|
||||
}
|
||||
})
|
||||
console.log(param)
|
||||
|
|
@ -602,11 +601,11 @@ export default {
|
|||
}else{
|
||||
let param = {
|
||||
"userId":uni.getStorageSync('userId'),
|
||||
"shoppingCartIds":[],
|
||||
"cartIds":[],
|
||||
}
|
||||
this.shoppingCartList.forEach(cartItem=>{
|
||||
if(item.dishesId==cartItem.goodsId){
|
||||
param.shoppingCartIds=[cartItem.shoppingCartId]
|
||||
param.cartIds=[cartItem.cartId]
|
||||
}
|
||||
})
|
||||
const res = await clearAdvancehoppingCartAPI(param)
|
||||
|
|
@ -619,7 +618,7 @@ export default {
|
|||
async delFood(e,item){
|
||||
let param = {
|
||||
"userId":uni.getStorageSync('userId'),
|
||||
"shoppingCartIds":[item.shoppingCartId],
|
||||
"cartIds":[item.cartId],
|
||||
}
|
||||
console.log(param)
|
||||
const res = await clearAdvancehoppingCartAPI(param)
|
||||
|
|
@ -631,7 +630,7 @@ export default {
|
|||
clearCar(){
|
||||
let arr = []
|
||||
this.shoppingCartList.forEach(cartItem=>{
|
||||
arr.push(cartItem.shoppingCartId)
|
||||
arr.push(cartItem.cartId)
|
||||
})
|
||||
if(arr.length==0){
|
||||
uni.showToast({
|
||||
|
|
@ -642,7 +641,7 @@ export default {
|
|||
try {
|
||||
let param = {
|
||||
"userId":uni.getStorageSync('userId'),
|
||||
"shoppingCartIds":arr,
|
||||
"cartIds":arr,
|
||||
}
|
||||
// console.log(param)
|
||||
clearAdvancehoppingCartAPI(param).then(res => {
|
||||
|
|
|
|||
|
|
@ -406,16 +406,15 @@ export default {
|
|||
this.shoppingCartList.forEach(cartItem=>{
|
||||
if(food.dishesId==cartItem.goodsId){
|
||||
if(food.mealtimeType==cartItem.mealtimeType){
|
||||
let obj = {
|
||||
"detailId": food.detailId,
|
||||
let obj = {
|
||||
"detailType": food.detailType,
|
||||
"goodsId": cartItem.goodsId,
|
||||
"goodsImgUrl": food.dishesImgUrl,//图片地址
|
||||
"goodsName": cartItem.goodsName,
|
||||
"mealtimeName": food.mealtimeName,
|
||||
"mealtimeType": food.mealtimeType,
|
||||
"menuDetailId": food.detailId,
|
||||
"menuId": cartItem.menuId,
|
||||
"recipeDetailId": food.recipeDetailId,
|
||||
"recipeId": cartItem.recipeId,
|
||||
"quantity": cartItem.quantity,
|
||||
"salePrice": food.dishesDetailList[0].dishesPrice,
|
||||
"discountPrice": food.dishesDetailList[0].prefPrice,
|
||||
|
|
@ -425,7 +424,7 @@ export default {
|
|||
"orderType": cartItem.orderType,
|
||||
"prefPrice": food.dishesDetailList[0].prefPrice,
|
||||
"limitNum": food.dishesDetailList[0].limitNum,
|
||||
"shoppingCartId": cartItem.shoppingCartId,
|
||||
"cartId": cartItem.cartId,
|
||||
"sizeType": cartItem.sizeType,
|
||||
"remanentNum": cartItem.remanentNum
|
||||
}
|
||||
|
|
@ -433,7 +432,7 @@ export default {
|
|||
this.$set(cartItem, 'mealtimeName', food.mealtimeName)
|
||||
this.$set(cartItem, 'goodsImgUrl', food.dishesImgUrl)
|
||||
this.$set(cartItem, 'monthlySales', food.dishesDetailList[0].monthlySales)
|
||||
this.$set(cartItem, 'detailId', food.detailId)
|
||||
this.$set(cartItem, 'recipeDetailId', food.recipeDetailId)
|
||||
this.$set(cartItem, 'detailType', food.detailType)
|
||||
this.$set(cartItem, 'dishesId', food.dishesDetailList[0].dishesId)
|
||||
this.$set(cartItem, 'remanentNum', food.dishesDetailList[0].remanentNum)
|
||||
|
|
@ -490,17 +489,17 @@ export default {
|
|||
"canteenId":this.canteenId,
|
||||
"stallId":this.stallId,
|
||||
"mealtimeType":item.mealtimeType,
|
||||
"menuId":this.recipeId,
|
||||
"recipeId":this.recipeId,
|
||||
"goodsId":item.dishesId,
|
||||
"goodsName":item.goodsName||item.dishesName,
|
||||
"detailId":item.detailId,
|
||||
"recipeDetailId":item.recipeDetailId,
|
||||
"detailType":item.detailType,
|
||||
"quantity":item.quantity+1
|
||||
}
|
||||
this.shoppingCartList.forEach(cartItem=>{
|
||||
if(item.dishesId==cartItem.goodsId){
|
||||
if(item.mealtimeType==cartItem.mealtimeType){
|
||||
param.shoppingCartId=cartItem.shoppingCartId
|
||||
param.cartId=cartItem.cartId
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -519,12 +518,12 @@ export default {
|
|||
if(item.quantity>0){
|
||||
let param = {
|
||||
"userId":uni.getStorageSync('userId'),
|
||||
"shoppingCartId":'',
|
||||
"cartId":'',
|
||||
"quantity":item.quantity
|
||||
}
|
||||
this.shoppingCartList.forEach(cartItem=>{
|
||||
if(item.dishesId==cartItem.goodsId){
|
||||
param.shoppingCartId=cartItem.shoppingCartId
|
||||
param.cartId=cartItem.cartId
|
||||
}
|
||||
})
|
||||
console.log(param)
|
||||
|
|
@ -535,11 +534,11 @@ export default {
|
|||
}else{
|
||||
let param = {
|
||||
"userId":uni.getStorageSync('userId'),
|
||||
"shoppingCartIds":[],
|
||||
"cartIds":[],
|
||||
}
|
||||
this.shoppingCartList.forEach(cartItem=>{
|
||||
if(item.dishesId==cartItem.goodsId){
|
||||
param.shoppingCartIds=[cartItem.shoppingCartId]
|
||||
param.cartIds=[cartItem.cartId]
|
||||
}
|
||||
})
|
||||
const res = await clearAdvancehoppingCartAPI(param)
|
||||
|
|
@ -553,7 +552,7 @@ export default {
|
|||
async delFood(e,item){
|
||||
let param = {
|
||||
"userId":uni.getStorageSync('userId'),
|
||||
"shoppingCartIds":[item.shoppingCartId],
|
||||
"cartIds":[item.cartId],
|
||||
}
|
||||
console.log(param)
|
||||
const res = await clearAdvancehoppingCartAPI(param)
|
||||
|
|
@ -565,7 +564,7 @@ export default {
|
|||
clearCar(){
|
||||
let arr = []
|
||||
this.shoppingCartList.forEach(cartItem=>{
|
||||
arr.push(cartItem.shoppingCartId)
|
||||
arr.push(cartItem.cartId)
|
||||
})
|
||||
if(arr.length==0){
|
||||
uni.showToast({
|
||||
|
|
@ -576,7 +575,7 @@ export default {
|
|||
try {
|
||||
let param = {
|
||||
"userId":uni.getStorageSync('userId'),
|
||||
"shoppingCartIds":arr,
|
||||
"cartIds":arr,
|
||||
}
|
||||
// console.log(param)
|
||||
clearAdvancehoppingCartAPI(param).then(res => {
|
||||
|
|
|
|||
|
|
@ -241,11 +241,11 @@ export default {
|
|||
async clearShoppingCart(){
|
||||
let param = {
|
||||
"userId":uni.getStorageSync('userId'),
|
||||
"shoppingCartIds":[],
|
||||
"cartIds":[],
|
||||
}
|
||||
console.log(this.shoppingCartList)
|
||||
this.shoppingCartList.forEach(cartItem=>{
|
||||
param.shoppingCartIds.push(cartItem.shoppingCartId)
|
||||
param.cartIds.push(cartItem.cartId)
|
||||
})
|
||||
console.log(param)
|
||||
const res = await clearAdvancehoppingCartAPI(param)
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ export default {
|
|||
async getMenudishesDetail(){
|
||||
let param = {
|
||||
"userId": uni.getStorageSync('userId') ,
|
||||
"detailId": this.menuData.detailId,
|
||||
"detailId": this.menuData.recipeDetailId,
|
||||
"baseDishesId": this.menuData.baseDishesId,
|
||||
// "delFlag": 2
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue