parent
c5b11daed3
commit
dd3e5e53fc
@ -132,12 +132,6 @@
|
||||
</up-cell-group>
|
||||
|
||||
</view>
|
||||
<!-- <template #footer>
|
||||
<view>
|
||||
<wd-button size="small" style="margin-right: 8px;">评价</wd-button>
|
||||
<wd-button size="small" plain>立即使用</wd-button>
|
||||
</view>
|
||||
</template> -->
|
||||
</wd-card>
|
||||
|
||||
</view>
|
||||
@ -203,12 +197,12 @@
|
||||
<wd-calendar v-if="order_type===2" label="做宴日期" placeholder="请选择日期" prop="banquet_date" :formatter="formatter" :min-date="min_data"
|
||||
v-model="orderInfo.banquet_date" :rules="[{ required: false, pattern: /^\d{13}$/, message: '请选择日期' }]"
|
||||
@confirm="handleTimeConfirm" />
|
||||
|
||||
|
||||
<wd-input v-if="order_type===2" label="做宴桌数" placeholder="请输做宴桌数" prop="table_number" type="number" clearable
|
||||
v-model="orderInfo.table_number" :rules="[{ required: false, pattern: /^[1-9]\d*$/, message: '请输入有效的桌数' }]"
|
||||
placeholder-style="color: #999999; font-size: 14px;" />
|
||||
|
||||
|
||||
|
||||
|
||||
<wd-col-picker label="做宴地址" v-model="orderInfo.district_name" prop="district_name" :columns="area"
|
||||
:column-change="columnChange" placeholder="请填写做宴地址" @confirm="handleConfirm" :rules="[
|
||||
{
|
||||
@ -223,10 +217,6 @@
|
||||
message: '做宴地址不能为空,请填写'
|
||||
}
|
||||
]"></wd-col-picker>
|
||||
|
||||
|
||||
|
||||
|
||||
<wd-input label="详细地址" prop="street_name" clearable v-model="orderInfo.street_name" placeholder="请填写详细地址"
|
||||
:rules="[
|
||||
{
|
||||
@ -241,7 +231,7 @@
|
||||
<view class="pb-4" />
|
||||
<wd-button plain hairline custom-style="width: calc(100vw - 100rpx);"
|
||||
@click="handleSubmit(1)">确定预定(做席后再支付)</wd-button>
|
||||
<wd-button hairline custom-style="width: calc(100vw - 100rpx);" @click="handleSubmit(1)">付定金锁定订单</wd-button>
|
||||
<wd-button hairline custom-style="width: calc(100vw - 100rpx);" @click="handleSubmit(2)">付定金锁定订单</wd-button>
|
||||
|
||||
</wd-cell-group>
|
||||
</wd-form>
|
||||
@ -324,8 +314,6 @@
|
||||
},
|
||||
//表单验证
|
||||
handleSubmit(reservation_type) {
|
||||
// this.propShowOrder = true;
|
||||
// console.log(this.orderInfo);
|
||||
this.orderInfo.reservation_type = reservation_type; //付款类型
|
||||
this.$refs.form.validate()
|
||||
.then(({
|
||||
@ -334,7 +322,6 @@
|
||||
}) => {
|
||||
if (valid) {
|
||||
this.orderInfo.address = this.address_string + this.orderInfo.street_name;
|
||||
// console.log(this.orderInfo);
|
||||
this.addOrder();
|
||||
}
|
||||
})
|
||||
@ -349,7 +336,9 @@
|
||||
CommonApi.commonPost('/api/banquet/order/createOrder', this.orderInfo).catch((res) => {
|
||||
if (res.code === 1) {
|
||||
this.order_id = res.data.order_id;
|
||||
this.propShowOrder = true;
|
||||
uni.navigateTo({
|
||||
url: `/pages/banquet/order/detail?order_id=${res.data.order_id}`
|
||||
});
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
}
|
||||
@ -460,4 +449,4 @@
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
@ -1,29 +1,29 @@
|
||||
<style lang='scss'>
|
||||
.custom-count-down {
|
||||
display: inline-block;
|
||||
width: 22px;
|
||||
color: #ff3232;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
background-color: #ff404021;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.custom-count-down {
|
||||
display: inline-block;
|
||||
width: 22px;
|
||||
color: #ff3232;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
background-color: #ff404021;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.custom-count-down-colon {
|
||||
display: inline-block;
|
||||
margin: 0 4px;
|
||||
color: #ff4040;
|
||||
}
|
||||
.custom-count-down-colon {
|
||||
display: inline-block;
|
||||
margin: 0 4px;
|
||||
color: #ff4040;
|
||||
}
|
||||
|
||||
.cell-icon {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-right: 4px;
|
||||
background: url('https://img10.360buyimg.com/jmadvertisement/jfs/t1/71075/7/3762/1820/5d1f26d1E0d600b9e/a264c901943080ac.png') no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
.cell-icon {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-right: 4px;
|
||||
background: url('https://img10.360buyimg.com/jmadvertisement/jfs/t1/71075/7/3762/1820/5d1f26d1E0d600b9e/a264c901943080ac.png') no-repeat;
|
||||
background-size: cover;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view>
|
||||
@ -56,7 +56,6 @@
|
||||
</wd-count-down>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
</u-cell>
|
||||
|
||||
@ -73,8 +72,6 @@
|
||||
|
||||
</view>
|
||||
</u-radio-group>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="prop-flex-bottom">
|
||||
<up-button class="" style="" text="确认支付" type="primary" color="#59CB56" shape="circle" size="normal"
|
||||
@ -82,11 +79,8 @@
|
||||
</up-button>
|
||||
</view>
|
||||
</wd-cell-group>
|
||||
|
||||
</u-popup>
|
||||
|
||||
|
||||
|
||||
<view v-for="(matchedItems, index) in matchedItems_sp" :key="index">
|
||||
<wd-card>
|
||||
<template #title>
|
||||
@ -114,8 +108,8 @@
|
||||
</template>
|
||||
<template #title>
|
||||
<view class="h-60 flex">
|
||||
<up-text size="28rpx" :text="`${item.dishes_info.name}`" :flex1="true" align="left" wordWrap="normal"
|
||||
:show="true" prefixIcon="" customStyle="font-weight:bold"
|
||||
<up-text size="28rpx" :text="`${item.dishes_info.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" readonly :label="`¥${item.dishes_info.price}元`"></u-icon>
|
||||
@ -123,8 +117,8 @@
|
||||
</template>
|
||||
<template #label>
|
||||
<view class="h-60 flex color-gray">
|
||||
<up-text size="26rpx" :text="`${item.dishes_info.intro}`" :flex1="true" align="left" wordWrap="normal"
|
||||
:show="true" prefixIcon="" customStyle=""
|
||||
<up-text size="26rpx" :text="`${item.dishes_info.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" readonly :label="`X${item.number}`"></u-icon>
|
||||
@ -136,16 +130,12 @@
|
||||
|
||||
</view>
|
||||
<template #footer>
|
||||
<!-- <view>
|
||||
<wd-button size="small" style="margin-right: 8px;">评价</wd-button>
|
||||
<wd-button size="small" plain>立即使用</wd-button>
|
||||
</view> -->
|
||||
<view class="title font-size-32">
|
||||
<view>费用合计:</view>
|
||||
<view class="title-tip">
|
||||
<text class="font-size-32 color-red ">¥{{ orderInfo.final_price }}元</text>
|
||||
<view class="title font-size-32">
|
||||
<view>费用合计:</view>
|
||||
<view class="title-tip">
|
||||
<text class="font-size-32 color-red ">¥{{ orderInfo.final_price }}元</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</wd-card>
|
||||
|
||||
@ -180,16 +170,6 @@
|
||||
|
||||
<wd-form ref="form" :model="orderInfo" errorType="message">
|
||||
<wd-cell-group border>
|
||||
<!--
|
||||
<view class="pb-4" />
|
||||
<wd-input readonly label="联系姓名" prop="customer_name" clearable v-model="orderInfo.customer_name"
|
||||
placeholder="请填写联系姓名" />
|
||||
<wd-input readonly label="联系电话" prop="phone" clearable v-model="orderInfo.phone" placeholder="请填写联系电话" />
|
||||
<wd-input readonly label="宴席类型" prop="banquet_type" clearable v-model="orderInfo.banquet_type"
|
||||
placeholder="请填写详细地址" />
|
||||
<wd-textarea readonly auto-height label="详细地址" prop="address" clearable v-model="orderInfo.address"
|
||||
placeholder="请填写详细地址" />
|
||||
<wd-textarea readonly auto-height label="备注" v-model="orderInfo.remark" placeholder="请填写备注" /> -->
|
||||
<view class="pb-4" />
|
||||
<wd-button plain hairline custom-style="width: calc(100vw - 100rpx);" @click="payOrder(1)">确定支付</wd-button>
|
||||
<view class="pb-2" />
|
||||
@ -204,193 +184,109 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { useColPickerData, useModal } from '@/hooks'
|
||||
import { defineComponent } from "vue";
|
||||
import { CommonApi, UserApi } from "@/api";
|
||||
// import { setToken, getToken, isLogin } from '@/utils/auth';
|
||||
const { colPickerData, findChildrenByCode } = useColPickerData()
|
||||
export default defineComponent({
|
||||
data () {
|
||||
return {
|
||||
totalPrice: 0,
|
||||
server_user: {
|
||||
id: 0,
|
||||
phone: '',
|
||||
public_name: '',
|
||||
import { useColPickerData, useModal } from '@/hooks'
|
||||
import { defineComponent } from "vue";
|
||||
import { CommonApi, UserApi } from "@/api";
|
||||
const { colPickerData, findChildrenByCode } = useColPickerData()
|
||||
export default defineComponent({
|
||||
data() {
|
||||
return {
|
||||
totalPrice: 0,
|
||||
server_user: {
|
||||
id: 0,
|
||||
phone: '',
|
||||
public_name: '',
|
||||
},
|
||||
order_id: 0,
|
||||
address_string: '',
|
||||
banquetType: this.getBanquetType(),
|
||||
propShowOrder: false,
|
||||
orderInfo: [],
|
||||
matchedItems_sp: [],
|
||||
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.order_id = option.order_id;;
|
||||
this.orderInfo.order_id = option.order_id;
|
||||
this.getOrderDetail()
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.propShowOrder = false;
|
||||
},
|
||||
order_id: 0,
|
||||
address_string: '',
|
||||
banquetType: this.getBanquetType(),
|
||||
propShowOrder: false,
|
||||
// area: [],
|
||||
// value: [],
|
||||
orderInfo: [],
|
||||
// orderInfo: {
|
||||
// district_name: [],
|
||||
// street_name: '',
|
||||
// // cart_ids: [], 酒店
|
||||
// customer_name: '',
|
||||
// phone: '',
|
||||
// address: '',
|
||||
// remark: '',
|
||||
// banquet_type: '1',
|
||||
// reservation_type: 1,
|
||||
// order_id: 0,
|
||||
// // table_number: 0, 酒店
|
||||
// // banquet_date: '', 酒店
|
||||
// },
|
||||
matchedItems_sp: [],
|
||||
|
||||
};
|
||||
},
|
||||
onLoad (option) {
|
||||
this.order_id = option.id;;
|
||||
this.orderInfo.order_id = option.id;
|
||||
this.getOrderDetail()
|
||||
// this.getArea()
|
||||
},
|
||||
created () {
|
||||
|
||||
},
|
||||
methods: {
|
||||
close () {
|
||||
this.propShowOrder = false;
|
||||
},
|
||||
// //表单验证
|
||||
// handleSubmit (reservation_type) {
|
||||
// // console.log(this.orderInfo);
|
||||
// this.orderInfo.reservation_type = reservation_type; //付款类型
|
||||
// this.$refs.form.validate()
|
||||
// .then(({ valid, errors }) => {
|
||||
// if (valid) {
|
||||
// this.orderInfo.address = this.address_string + this.orderInfo.street_name;
|
||||
// console.log(this.orderInfo);
|
||||
// this.addOrder();
|
||||
// }
|
||||
// })
|
||||
// .catch((error) => {
|
||||
// console.log(error, 'error')
|
||||
// })
|
||||
|
||||
// },
|
||||
|
||||
|
||||
// 微信支付
|
||||
payOrder (type) {
|
||||
if (type === 1) {
|
||||
//支付订单
|
||||
CommonApi.commonPost('/api/banquet/order/pay', { order_id: this.order_id }).catch((res) => {
|
||||
if (res.code === 1) {
|
||||
// this.payOrder(res.data.order_id);
|
||||
// this.propShowOrder = true;
|
||||
console.log(res.data);
|
||||
wx.requestPayment({
|
||||
"timeStamp": res.data.timeStamp,
|
||||
"nonceStr": res.data.nonceStr,
|
||||
"package": res.data.package,
|
||||
"signType": res.data.signType,
|
||||
"paySign": res.data.paySign,
|
||||
"success": function (res) {
|
||||
console.log('success:' + JSON.stringify(res));
|
||||
},
|
||||
"fail": function (err) {
|
||||
console.log('fail:' + JSON.stringify(err));
|
||||
},
|
||||
"complete": function (res) {
|
||||
console.log('complete:' + JSON.stringify(res));
|
||||
}
|
||||
})
|
||||
// this.close();
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//取消订单
|
||||
CommonApi.commonPost('/api/banquet/order/cancel', { order_id: this.order_id }).catch((res) => {
|
||||
if (res.code === 1) {
|
||||
uni.$u.toast(res.msg);
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
// //获取地址
|
||||
// getArea () {
|
||||
// this.area = [colPickerData.map(item => ({
|
||||
// value: item.value,
|
||||
// label: item.text
|
||||
// }))];
|
||||
// },
|
||||
// //选择地址后--记录地址字符串
|
||||
// handleConfirm (value) {
|
||||
// this.address_string = value.selectedItems.map(item => item.label).join('')
|
||||
// },
|
||||
// //地址改版事件
|
||||
// columnChange ({ selectedItem, resolve, finish }) {
|
||||
// try {
|
||||
// const areaData = findChildrenByCode(colPickerData, selectedItem.value);
|
||||
// if (areaData && areaData.length) {
|
||||
// resolve(areaData.map(item => ({
|
||||
// value: item.value,
|
||||
// label: item.text
|
||||
// })));
|
||||
// } else {
|
||||
// finish();
|
||||
// }
|
||||
// } catch (error) {
|
||||
// console.error('处理列变更时出错:', error);
|
||||
// finish(); // 确保在发生错误时也能完成操作以避免卡顿
|
||||
// }
|
||||
// },
|
||||
//宴席类型
|
||||
getBanquetType () {
|
||||
CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => {
|
||||
if (res.code === 1) {
|
||||
res.data.forEach(item => {
|
||||
item.label = item.name;
|
||||
|
||||
// 微信支付
|
||||
payOrder(type) {
|
||||
if (type === 1) {
|
||||
//支付订单
|
||||
CommonApi.commonPost('/api/banquet/order/pay', { order_id: this.order_id }).catch((res) => {
|
||||
if (res.code === 1) {
|
||||
wx.requestPayment({
|
||||
"timeStamp": res.data.timeStamp,
|
||||
"nonceStr": res.data.nonceStr,
|
||||
"package": res.data.package,
|
||||
"signType": res.data.signType,
|
||||
"paySign": res.data.paySign,
|
||||
"success": function (res) {
|
||||
console.log('success:' + JSON.stringify(res));
|
||||
},
|
||||
"fail": function (err) {
|
||||
console.log('fail:' + JSON.stringify(err));
|
||||
},
|
||||
"complete": function (res) {
|
||||
console.log('complete:' + JSON.stringify(res));
|
||||
}
|
||||
})
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
this.banquetType = res.data;
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
//取消订单
|
||||
CommonApi.commonPost('/api/banquet/order/cancel', { order_id: this.order_id }).catch((res) => {
|
||||
if (res.code === 1) {
|
||||
uni.$u.toast(res.msg);
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
//宴席类型
|
||||
getBanquetType() {
|
||||
CommonApi.commonGet('/api/banquet/dishes/banquetType').catch((res) => {
|
||||
if (res.code === 1) {
|
||||
res.data.forEach(item => {
|
||||
item.label = item.name;
|
||||
|
||||
});
|
||||
this.banquetType = res.data;
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
// //购物车验证
|
||||
getOrderDetail() {
|
||||
CommonApi.commonGet('/api/banquet/order/detail', { order_id: this.order_id }).catch((res) => {
|
||||
if (res.code === 1) {
|
||||
this.matchedItems_sp = res.data.order_info;
|
||||
this.orderInfo = res.data.order;
|
||||
this.server_user.phone = res.data.server_info.certification.phone;
|
||||
this.server_user.public_name = res.data.server_info.certification.public_name;
|
||||
this.server_user.id = res.data.server_info.id;
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
//点击详情
|
||||
cookDetail(id : number) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/banquet/cook/detail?id=${id}`
|
||||
});
|
||||
},
|
||||
|
||||
},
|
||||
// //购物车验证
|
||||
getOrderDetail () {
|
||||
CommonApi.commonGet('/api/banquet/order/detail', { order_id: this.order_id }).catch((res) => {
|
||||
if (res.code === 1) {
|
||||
console.log(res)
|
||||
this.matchedItems_sp = res.data.order_info;
|
||||
|
||||
// this.totalPrice = res.data.total_price;
|
||||
this.orderInfo = res.data.order;
|
||||
this.server_user.phone = res.data.server_info.certification.phone;
|
||||
this.server_user.public_name = res.data.server_info.certification.public_name;
|
||||
this.server_user.id = res.data.server_info.id;
|
||||
// this.$refs.pagingRefSP?.complete(res.data);
|
||||
// console.log(res);
|
||||
} else {
|
||||
uni.$u.toast(res.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
//点击详情
|
||||
cookDetail (id: number) {
|
||||
// console.log(id);
|
||||
uni.navigateTo({
|
||||
url: `/pages/banquet/cook/detail?id=${id}`
|
||||
});
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user