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