diff --git a/src/pages.json b/src/pages.json index c4baea3..153210d 100644 --- a/src/pages.json +++ b/src/pages.json @@ -182,9 +182,9 @@ "needLogin": true }, { - "path": "order/pay", + "path": "order/list", "style": { - "navigationBarTitleText": "付款详情", + "navigationBarTitleText": "付款列表", "navigationStyle": "custom" }, "needLogin": true diff --git a/src/pages/banquet/combo/detail.vue b/src/pages/banquet/combo/detail.vue index 1f75029..1ac442d 100644 --- a/src/pages/banquet/combo/detail.vue +++ b/src/pages/banquet/combo/detail.vue @@ -33,185 +33,206 @@ - - - - - + - + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - + + --> + + + + + + + 厨师姓名:{{ server_user.public_name }} + 厨师联系方式:{{ server_user.phone }} + + + + + 1.(不交定金)如若厨师接到更高价订单,可能会将您的订单取消。 + 2.(付定金)如若厨师的做席档期存在冲突,可能会致电与您沟通,并推荐您更换厨师。 + 3.如若档期冲突订单被厨师取消,定金将原路返回,请放心下单。 + 4.在此,感谢您对此平台以及厨师们的支持,您的支持就是我们前进的最大动力。 + - - - - - - + + + + + + + - + 确定预定(做席后再支付) - 付定金锁定订单 + @click="handleSubmit(1)">确定预定(做席后再支付) + 付定金锁定订单 @@ -233,37 +254,40 @@ const { colPickerData, findChildrenByCode } = useColPickerData() export default defineComponent({ data () { return { - search: { - category_id: '', - keyword: '', - page: 1, - limit: 10, + totalPrice: 0, + server_user: { + phone: '', + public_name: '', }, + server_user_id: 0, + + address_string: '', + banquetType: this.getBanquetType(), propShowOrder: false, area: [], value: [], orderInfo: { - name: '', - phone: '', district_name: [], street_name: '', + // cart_ids: [], 酒店 + customer_name: '', + phone: '', + address: '', remark: '', + banquet_type: '', + reservation_type: 1, + server_user_id: 0, + // table_number: 0, 酒店 + // banquet_date: '', 酒店 }, - // keyword_sp: '', - categoryIndex: 0, - childrenIndex: 0, - categoryList: [], - tabList: [], - good_list: [], matchedItems_sp: [], }; }, - onLoad () { - // if (isLogin()) { - this.getCategoryList() - // } - this.changeSP(1) + onLoad (option) { + this.server_user_id = option.id;; + this.orderInfo.server_user_id = option.id; + this.getCartCheck() this.getArea() }, created () { @@ -273,38 +297,51 @@ export default defineComponent({ close () { this.propShowOrder = false; }, - handleSubmit () { - this.propShowOrder = true; - }, - //确认当餐信息 - addOrder () { + //表单验证 + handleSubmit (reservation_type) { + // console.log(this.orderInfo); + this.orderInfo.reservation_type = reservation_type; //付款类型 this.$refs.form.validate() .then(({ valid, errors }) => { if (valid) { - this.menu_list[this.currentTab].is_set = 1; - this.menu_list[this.currentTab].orderInfo = this.orderInfo; - // this.menu_list[this.currentTab].orderInfo.columns = this.columns[this.currentTab].value; - // this.menu_list[this.currentTab].orderInfo.total_price = this.totalPrice; - this.close(); - + this.orderInfo.address = this.address_string+this.orderInfo.street_name; + console.log(this.orderInfo); + this.addOrder(); } }) .catch((error) => { console.log(error, 'error') }) + }, + //提交订单 + addOrder () { + CommonApi.commonPost('/api/banquet/order/createOrder', this.orderInfo).catch((res) => { + if (res.code === 1) { + this.propShowOrder = true; + } else { + uni.$u.toast(res.msg); + } + }); + }, + + // 微信支付 + payOrder() { + this.close(); + }, + //获取地址 getArea () { this.area = [colPickerData.map(item => ({ value: item.value, label: item.text }))]; }, - + //选择地址后--记录地址字符串 handleConfirm (value) { - console.log(value) - console.log(this.value) + this.address_string = value.selectedItems.map(item => item.label).join('') }, + //地址改版事件 columnChange ({ selectedItem, resolve, finish }) { try { const areaData = findChildrenByCode(colPickerData, selectedItem.value); @@ -321,69 +358,36 @@ export default defineComponent({ finish(); // 确保在发生错误时也能完成操作以避免卡顿 } }, - - handleClickCategory (index: number) { - this.categoryIndex = index; - this.tabList = this.categoryList[index].children; - this.handleChildrenClick(0); - }, - handleChildrenClick (index: number) { - this.childrenIndex = index; - this.search.category_id = this.tabList[index].id; - this.$refs.pagingRefSP?.reload(); - }, - - getCategoryList () { - CommonApi.commonGet('/api/dishes/category').catch((res) => { + //宴席类型 + getBanquetType () { + CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => { if (res.code === 1) { - this.categoryList = res.data; - this.handleClickCategory(0) + this.banquetType = res.data; + res.data.forEach(item => { + item.label = item.name; + + }); } else { uni.$u.toast(res.msg); } }); }, - //搜索事件 - searchSP () { - this.$refs.pagingRefSP?.reload(); - // this.changeSP(1); - }, - //列表分页 - changeSP (pageNo: number) { - console.log(pageNo); - this.search.page = pageNo; - CommonApi.commonGet('/api/dishes/dishes', this.search).catch((res) => { + // //购物车验证 + getCartCheck () { + CommonApi.commonPost('/api/banquet/order/check', { server_user_id: this.server_user_id }).catch((res) => { if (res.code === 1) { - this.matchedItems_sp = res.data; + this.matchedItems_sp = res.data.cart_list; + this.totalPrice = res.data.total_price; + this.server_user.phone = res.data.server_user.certification.phone; + this.server_user.public_name = res.data.server_user.certification.public_name; this.$refs.pagingRefSP?.complete(res.data); // console.log(res); } else { uni.$u.toast(res.msg); } }); - - }, - //点击详情 - goodsDetail (id: number) { - console.log(id); - uni.navigateTo({ - url: `/pages/common/goods/detail?id=${id}&is_add=1` - }); }, - //加入购物车 - addCart (id) { - CommonApi.commonPost('/api/cart/add', { - buy_now: false, - dishes_id: id, - }).catch((res) => { - if (res.code === 1) { - uni.$u.toast('加入购物车成功'); - } else { - uni.$u.toast(res.msg); - } - }); - } }, diff --git a/src/pages/banquet/combo/index.vue b/src/pages/banquet/combo/index.vue index 1a36c66..0254c92 100644 --- a/src/pages/banquet/combo/index.vue +++ b/src/pages/banquet/combo/index.vue @@ -57,9 +57,9 @@ body { - - + + @@ -122,7 +122,7 @@ body { {{ orderInfo.is_set ? '修改餐标' : '设置餐标' }} - +