宴席2.1页面修改
Some checks are pending
deploy / deploy (push) Waiting to run

This commit is contained in:
sjeam 2025-08-13 16:38:33 +08:00
parent 192a365e06
commit 26d97d8461
4 changed files with 268 additions and 274 deletions

View File

@ -182,9 +182,9 @@
"needLogin": true
},
{
"path": "order/pay",
"path": "order/list",
"style": {
"navigationBarTitleText": "付款详情",
"navigationBarTitleText": "付款列表",
"navigationStyle": "custom"
},
"needLogin": true

View File

@ -33,7 +33,7 @@
</up-navbar>
<u-popup :show="propShowOrder" :round="10" mode="bottom" @close="close" customStyle="height:800rpx;">
<wd-form ref="form" :model="orderInfo" errorType="message">
<wd-cell-group border>
<view style="padding: 20rpx;">
<u-cell class="" style="line-height: 60rpx;" :border="true">
@ -46,7 +46,8 @@
<view style="display: inline-block;">
<wd-count-down :time="(30 * 60 * 60 * 1000)">
<template #default="{ current }">
<span class="custom-count-down">{{ current.hours > 10 ? current.hours : '0' + current.hours }}</span>
<span class="custom-count-down">{{ current.hours > 10 ? current.hours : '0' + current.hours
}}</span>
<span class="custom-count-down-colon">:</span>
<span class="custom-count-down">{{ current.minutes }}</span>
<span class="custom-count-down-colon">:</span>
@ -59,87 +60,72 @@
</template>
</u-cell>
<wd-cell-group>
<!-- <wd-cell title="微信支付" value="内容">
<template #icon>
<view class="cell-icon"></view>
12321
</template>
</wd-cell> -->
</wd-cell-group>
<u-alert :show-icon="true" title="微信支付" type="" effect="dark" description=""></u-alert>
<u-radio-group v-model="value">
<view class="h-60 flex">
<up-text size="28rpx" :text="` 680套餐`" :flex1="true" align="left" wordWrap="normal" :show="true"
prefixIcon="" customStyle="font-weight:bold"
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
<view class="h-60 flex" style="width: 100%; padding: 20rpx;">
<up-text size="36rpx" :text="`微信支付`" :flex1="true" align="left" wordWrap="normal" :show="true"
prefixIcon="weixin-fill" customStyle="font-weight:bold"
iconStyle="font-size:64rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
</up-text>
<!-- <u-icon slot="right" label-color="red" :label="`¥2000.00元`"></u-icon> -->
<!-- <u-icon size="48rpx" slot="right" label-color="red" :label="`¥2000.00元`"></u-icon> -->
<view style="display: inline-block; float:right">
<u-radio activeColor="#59CB56" label=""></u-radio>
<u-radio iconSize="36rpx" size="36rpx" activeColor="#59CB56" label=""></u-radio>
</view>
</view>
</u-radio-group>
</view>
<view class="prop-flex-bottom">
<up-button class="" style="" text="确认支付" type="primary" color="#59CB56" shape="circle" size="normal"
custom-style="width: calc(100vw - 100rpx);" @click="addOrder">
custom-style="width: calc(100vw - 100rpx);" @click="payOrder">
</up-button>
</view>
</wd-cell-group>
</wd-form>
</u-popup>
</u-popup>
<view v-for="(matchedItems, index) in matchedItems_sp" :key="index">
<wd-card>
<template #title>
<view class="title font-size-32 font-bold">
<view></view>
<view>{{ parseInt(index) + 1 }}</view>
<view class="title-tip">
<text class="font-size-32 color-red font-bold ">213213.00</text>
<!-- <text class="font-size-32 color-red font-bold ">213213.00</text> -->
</view>
</view>
<view class="title font-size-28 pt-4">
<view>做宴时段2025-11-12</view>
<view>做宴时段{{ matchedItems[0].banquet_date }}</view>
<view class="title-tip font-size-28">
做宴时段早上
做宴时段{{ matchedItems[0].banquet_time }}
</view>
</view>
</template>
<view class="content ">
<up-cell-group :border="false">
<view class="detail-box" v-for="(item, index) in matchedItems_sp" :key="index">
<view class="detail-box" style="border: none;padding: 0px;" v-for="(item, index) in matchedItems"
:key="index">
<u-cell :border="false">
<template #icon>
<wd-img :width="60" :height="60" :src="item.image" :enable-preview="true" :radius="8" :round=false
custom-class="margin-right-24" />
<wd-img :width="60" :height="60" :src="item.dishes.images[0]" :enable-preview="true" :radius="8"
:round=false custom-class="margin-right-24" />
</template>
<template #title>
<view class="h-60 flex">
<up-text size="28rpx" :text="`${item.name}680套餐`" :flex1="true" align="left" wordWrap="normal"
<up-text size="28rpx" :text="`${item.dishes.name}`" :flex1="true" align="left" wordWrap="normal"
:show="true" prefixIcon="" customStyle="font-weight:bold"
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
</up-text>
<u-icon slot="right" label-color="red" :label="`¥2000.00元`"></u-icon>
<u-icon slot="right" label-color="red" :label="`¥${item.dishes.price}元`"></u-icon>
</view>
</template>
<template #label>
<view class="h-60 flex color-gray">
<up-text size="26rpx" :text="`${item.intro}高级版-快速吸粉 | 周期一年`" :flex1="true" align="left"
wordWrap="normal" :show="true" prefixIcon="" customStyle=""
<up-text size="26rpx" :text="`${item.dishes.intro}`" :flex1="true" align="left" wordWrap="normal"
:show="true" prefixIcon="" customStyle=""
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
</up-text>
<u-icon slot="right" label-color="red" :label="`X30`"></u-icon>
<u-icon slot="right" label-color="red" :label="`X${item.number}`"></u-icon>
</view>
</template>
</u-cell>
@ -147,71 +133,106 @@
</up-cell-group>
</view>
<template #footer>
<!-- <view>
<!-- <template #footer>
<view>
<wd-button size="small" style="margin-right: 8px;">评价</wd-button>
<wd-button size="small" plain>立即使用</wd-button>
</view> -->
</template>
</view>
</template> -->
</wd-card>
</view>
<wd-card>
<template #title>
<view class="title font-size-32">
<view>费用合计</view>
<view class="title-tip">
<text class="font-size-32 color-red ">213213.00</text>
<text class="font-size-32 color-red ">{{ totalPrice }}</text>
</view>
</view>
</template>
</wd-card>
<wd-card title="厨师信息">
<view>厨师姓名{{ server_user.public_name }}</view>
<view>厨师联系方式{{ server_user.phone }}</view>
<template #footer>
<wd-button size="small" plain>查看详情</wd-button>
</template>
</wd-card>
<wd-card>
<template #title>
<u-alert :show-icon="true" title="温馨提示:请确认酒席需求" type="" effect="dark" description=" "></u-alert>
</template>
<view>1.(不交定金)如若厨师接到更高价订单可能会将您的订单取消</view>
<view>2.(付定金)如若厨师的做席档期存在冲突可能会致电与您沟通并推荐您更换厨师</view>
<view>3.如若档期冲突订单被厨师取消定金将原路返回请放心下单</view>
<view>4.在此感谢您对此平台以及厨师们的支持您的支持就是我们前进的最大动力</view>
<wd-form ref="form" :model="orderInfo" errorType="message">
<wd-cell-group border>
<u-cell class="" style="line-height: 60rpx;" :border="true">
<template #title>
</template>
</u-cell>
<u-alert :show-icon="true" title="温馨提示:请确认酒席需求" type="" effect="dark" description=" "></u-alert>
<view class="pb-4" />
<wd-input label="联系姓名" prop="name" clearable v-model="orderInfo.name" placeholder="请填写联系姓名" :rules="[
<wd-input label="联系姓名" prop="customer_name" clearable v-model="orderInfo.customer_name" placeholder="请填写联系姓名"
:rules="[
{
required: false,
validator: (value: string) => {
return /^[a-zA-Z0-9]+$/.test(value)
return /^[\u4e00-\u9fa5a-zA-Z0-9_]+$/.test(value)
},
message: '请输入姓名'
}
]" />
<wd-input label="联系电话" prop="phone" clearable v-model="orderInfo.phone" placeholder="请填写联系电话"
:rules="[{ required: false, pattern: /^1[3-9]\d{9}$/, message: '请输入有效手机号码' }]" />
<wd-select-picker label="宴席类型" prop="banquet_type" v-model="orderInfo.banquet_type" :columns="banquetType"
type="radio"
:rules="[
{
required: false,
validator: (value: string) => {
return /^[\u4e00-\u9fa5a-zA-Z0-9_]+$/.test(value)
},
message: '请选择宴席类型'
}
]"
></wd-select-picker>
<wd-col-picker label="做宴地址" v-model="orderInfo.district_name" prop="district_name" :columns="area"
:column-change="columnChange" placeholder="请填写做宴地址" @confirm="handleConfirm" :rules="[
{
required: false,
validator: (value: string) => {
return /^[a-zA-Z0-9]+$/.test(value)
if (value.length > 0) {
return true;
}
return false;
},
message: '请填写做宴地址'
message: '做宴地址不能为空,请填写'
}
]"></wd-col-picker>
<wd-input label="详细地址" prop="street_name" clearable v-model="orderInfo.street_name" placeholder="请填写详细地址"
:rules="[
{
required: false,
validator: (value: string) => {
return /^[a-zA-Z0-9]+$/.test(value)
return /^[\u4e00-\u9fa5a-zA-Z0-9_]+$/.test(value)
},
message: '请输入正确的玛卡巴卡'
message: '请输入详细地址'
}
]" />
<wd-textarea label="备注" v-model="orderInfo.total_num" placeholder="请填写备注" />
<wd-textarea label="备注" v-model="orderInfo.remark" placeholder="请填写备注" />
<wd-button plain hairline custom-style="width: calc(100vw - 100rpx);"
@click="handleSubmit">确定预定做席后再支付</wd-button>
<wd-button hairline custom-style="width: calc(100vw - 100rpx);" @click="handleSubmit">付定金锁定订单</wd-button>
@click="handleSubmit(1)">确定预定做席后再支付</wd-button>
<wd-button hairline custom-style="width: calc(100vw - 100rpx);" @click="handleSubmit(1)">付定金锁定订单</wd-button>
</wd-cell-group>
</wd-form>
@ -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);
}
});
}
},

View File

@ -57,8 +57,8 @@ body {
<!-- <view > -->
<wd-tabs v-model="currentTab" @change="handleChange" auto-line-width color="#59CB56" lineWidth="80rpx">
<block v-for="(item, index) in menu_list" :key="item">
<wd-tab :title="`第${index + 1}餐`" :name="index" setActive="item.name" :badge-props="
item.orderInfo.is_set===1 ? { modelValue: '已选', max: 99, right: '-20rpx' } : { modelValue: '', max: 99, right: '-20rpx' }"></wd-tab>
<wd-tab :title="`第${index + 1}餐`" :name="index" setActive="item.name"
:badge-props="item.orderInfo.is_set === 1 ? { modelValue: '已选', max: 99, right: '-20rpx' } : { modelValue: '', max: 99, right: '-20rpx' }"></wd-tab>
</block>
</wd-tabs>
@ -182,14 +182,14 @@ export default defineComponent({
orderInfo: {
id: 0,
is_set: 0,
date: '',
date: [],
columns: '早上',
number: 1,
},
newOrderInfo: {
id: 0,
is_set: 0,
date: '',
date: [],
columns: '早上',
number: 1,
@ -205,7 +205,7 @@ export default defineComponent({
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
date: [],
columns: '早上',
number: 1,
}
@ -214,7 +214,7 @@ export default defineComponent({
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
date: [],
columns: '早上',
number: 1,
}
@ -223,7 +223,7 @@ export default defineComponent({
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
date: [],
columns: '早上',
number: 1,
}
@ -232,7 +232,7 @@ export default defineComponent({
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
date: [],
columns: '早上',
number: 1,
}
@ -241,7 +241,7 @@ export default defineComponent({
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
date: [],
columns: '早上',
number: 1,
}
@ -250,7 +250,7 @@ export default defineComponent({
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
date: [],
columns: '早上',
number: 1,
}
@ -259,7 +259,7 @@ export default defineComponent({
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
date: [],
columns: '早上',
number: 1,
}
@ -268,7 +268,7 @@ export default defineComponent({
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
date: [],
columns: '早上',
number: 1,
}
@ -277,7 +277,7 @@ export default defineComponent({
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
date: [],
columns: '早上',
number: 1,
}
@ -286,7 +286,7 @@ export default defineComponent({
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
date: [],
columns: '早上',
number: 1,
}
@ -295,7 +295,7 @@ export default defineComponent({
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
date: [],
columns: '早上',
number: 1,
}
@ -304,7 +304,7 @@ export default defineComponent({
name: '第1餐', orderInfo: {
id: 0,
is_set: 0,
date: '',
date: [],
columns: '早上',
number: 1,
}
@ -339,7 +339,6 @@ export default defineComponent({
},
delGoods () {
if (this.menu_list.length === 1) {
return uni.$u.toast('至少要保留一个餐项');
}
@ -356,15 +355,6 @@ export default defineComponent({
if (index !== undefined && index >= 0 && index < this.menu_list.length) {
this.menu_list.splice(index, 1);
}
// CommonApi.commonPost('/api/user/deleteAddress', { id: id }).catch((res) => {
// if (res.code === 1) {
// // this.propShowAddress = false;
// this.getAddressInfoListData();
// } else {
// uni.$u.toast(res.msg);
// }
// });
}
else if (res.cancel) {
// console.log('');
@ -379,6 +369,7 @@ export default defineComponent({
this.$nextTick(() => {
this.handleClickCategory(this.currentTab)
this.menu_name = this.menu_list[this.currentTab].name; // menu_name
this.searchSP()
// this.orderInfo = this.menu_list[this.currentTab].orderInfo; // orderInfo
});
},
@ -409,17 +400,11 @@ export default defineComponent({
//
handleConfirm () {
// console.log(value)
console.log(this.set_num);
// var id = 1;
// uni.navigateTo({
// url: `/pages/banquet/combo/detail?id=${id}`
// });
uni.navigateTo({
url: `/pages/banquet/combo/detail?id=${this.search.server_user_id}`
});
},
formatter (day) {
const date = new Date(day.date)
const now = new Date()
@ -451,50 +436,56 @@ export default defineComponent({
//
handleClickCategory (index: number) {
// console.log(index);
// this.categoryIndex = index;
// this.tabList = this.categoryList[index].children;
// this.handleChildrenClick(0);
this.getCategoryList();
},
handleChildrenClick (index: number) {
this.childrenIndex = index;
// this.search.category_id = this.tabList[this.childrenIndex].id;
this.$refs.pagingRefSP?.reload();
},
//
getCartCheck () {
CommonApi.commonPost('/api/banquet/order/check', { server_user_id: this.search.server_user_id }).catch((res) => {
var num = 0;
// var index = -1;
var is_set_cart = 0;
var newCartList = [];
this.set_num = 0;
for (let val in this.menu_list) { //
this.menu_list[val].orderInfo.is_set = 0;
}
//--
if (res.code === 1) {
for (let val in res.data.cart_list) {
// console.log(res.data.cart_list[val][0]);
num++;
// index++;
is_set_cart = res.data.cart_list[val][0].banquet_date ? 1 : 0; //
if (is_set_cart) {
this.set_num += 1;
}
this.menu_list[res.data.cart_list[val][0].index].orderInfo.is_set = is_set_cart;
//
if (this.currentTab === res.data.cart_list[val][0].index) {
newCartList.push({
name: '第' + num + '餐', orderInfo: {
id: 0,
is_set: is_set_cart,
date: new Date(res.data.cart_list[val][0].banquet_date).getTime(),
date: res.data.cart_list[val][0].banquet_date ? new Date(res.data.cart_list[val][0].banquet_date).getTime() : [],
columns: res.data.cart_list[val][0].banquet_time ? res.data.cart_list[val][0].banquet_time : '早上',
number: res.data.cart_list[val][0].table_number ? res.data.cart_list[val][0].table_number : 1,
}
})
this.menu_list[val].orderInfo.is_set = is_set_cart;
}
//--
if (num > 0 && newCartList[this.currentTab]) {
this.orderInfo = newCartList[this.currentTab].orderInfo; // orderInfo --
}
if (newCartList.length > 0) {
this.orderInfo = newCartList[0].orderInfo; // orderInfo --
} else {
this.orderInfo = this.menu_list[this.currentTab].orderInfo; // orderInfo --
}
// console.log(this.orderInfo);
this.totalPrice = res.data.total_price;
} else {
// uni.$u.toast(res.msg);
@ -520,7 +511,6 @@ export default defineComponent({
//
searchSP () {
this.$refs.pagingRefSP?.reload();
// this.changeSP(1);
},
//
changeSP (pageNo: number) {
@ -580,7 +570,7 @@ export default defineComponent({
}
});
},
// --
editCart () {
CommonApi.commonPost('/api/banquet/cart/edit', {
server_user_id: this.search.server_user_id,