diff --git a/src/pages/banquet/combo/dishes_combo.vue b/src/pages/banquet/combo/dishes_combo.vue index 4b2358f..ab0045e 100644 --- a/src/pages/banquet/combo/dishes_combo.vue +++ b/src/pages/banquet/combo/dishes_combo.vue @@ -6,19 +6,19 @@ - + - {{ matchedItems_sc.name }} + {{ dishesDetail.name }} - {{ matchedItems_sc.intro }} + {{ dishesDetail.intro }} - - + + {{key}} @@ -42,7 +42,7 @@ - + @@ -59,27 +59,36 @@ id: 0, }, is_add: 0, - matchedItems_sc: [], + dishesDetail: [], imageList: [], - matchedItems_sp: [], }; }, onLoad(option) { this.search.id = option.id; this.is_add = option.is_add | 0; - this.getCategoryList() + this.getDetail() }, methods: { - //点击详情 - dishesDetail(item) { - uni.navigateTo({ - url: `/pages/banquet/combo/dishes?id=${item.id}&is_add=1` - }) + addCart() { + CommonApi.commonPost('/api/banquet/cart/add', { + server_user_id: this.dishesDetail.user_id, + dishes_id: this.dishesDetail.id, + number: 1, + buy_now: 1 + }).catch((res) => { + if (res.code === 1) { + uni.navigateTo({ + url: `/pages/banquet/combo/detail?id=${this.dishesDetail.user_id}&cart_ids=${res.data.cart_id}` + }) + } else { + uni.$u.toast(res.msg); + } + }); }, - getCategoryList() { + getDetail() { CommonApi.commonGet('/api/banquet/dishes/detail', this.search).catch((res) => { if (res.code === 1) { - this.matchedItems_sc = res.data; + this.dishesDetail = res.data; res.data.images.forEach(item => { this.imageList.push({ url: item, @@ -117,6 +126,7 @@ border-bottom-left-radius: 20rpx; border-bottom-right-radius: 20rpx; } + .buy-button { position: fixed; bottom: 0; diff --git a/src/pages/banquet/hotel/detail.vue b/src/pages/banquet/hotel/detail.vue index 7c313d9..6e4560a 100644 --- a/src/pages/banquet/hotel/detail.vue +++ b/src/pages/banquet/hotel/detail.vue @@ -5,72 +5,72 @@ :safeAreaInsetTop="true" :placeholder="true" :fixed="true"> - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - + + + - - + + + + + + 酒店展示视频 + + + + + + + + + + + + 推荐酒席套餐 + + + + + + + + + + + + + + + + + + + + + + + 下单预定 + + + + + + @@ -108,6 +108,22 @@ url: `/pages/banquet/combo/dishes_combo?id=${id}&is_add=1` }); }, + addCart(id) { + CommonApi.commonPost('/api/banquet/cart/add', { + server_user_id: this.dishesQuery.server_user_id, + dishes_id: id, + number: 1, + buy_now: 1 + }).catch((res) => { + if (res.code === 1) { + uni.navigateTo({ + url: `/pages/banquet/combo/detail?id=${this.dishesQuery.server_user_id}&cart_ids=${res.data.cart_id}` + }) + } else { + uni.$u.toast(res.msg); + } + }); + }, getHotelDetail() { UserApi.hotelDetailApi({ id: this.id }).catch((res) => { if (res.code === 1) { @@ -115,8 +131,7 @@ //轮播图是数组 this.imageList = res.data.certification.video ? [{ url: res.data.certification.video, - title: '展示视频', - poster: res.data.certification.video + title: '展示视频' }] : []; } else { uni.$u.toast(res.msg); @@ -149,3 +164,19 @@ } }); +