parent
c5b11daed3
commit
dd3e5e53fc
@ -132,12 +132,6 @@
|
|||||||
</up-cell-group>
|
</up-cell-group>
|
||||||
|
|
||||||
</view>
|
</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>
|
</wd-card>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
@ -223,10 +217,6 @@
|
|||||||
message: '做宴地址不能为空,请填写'
|
message: '做宴地址不能为空,请填写'
|
||||||
}
|
}
|
||||||
]"></wd-col-picker>
|
]"></wd-col-picker>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<wd-input label="详细地址" prop="street_name" clearable v-model="orderInfo.street_name" placeholder="请填写详细地址"
|
<wd-input label="详细地址" prop="street_name" clearable v-model="orderInfo.street_name" placeholder="请填写详细地址"
|
||||||
:rules="[
|
:rules="[
|
||||||
{
|
{
|
||||||
@ -241,7 +231,7 @@
|
|||||||
<view class="pb-4" />
|
<view class="pb-4" />
|
||||||
<wd-button plain hairline custom-style="width: calc(100vw - 100rpx);"
|
<wd-button plain hairline custom-style="width: calc(100vw - 100rpx);"
|
||||||
@click="handleSubmit(1)">确定预定(做席后再支付)</wd-button>
|
@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-cell-group>
|
||||||
</wd-form>
|
</wd-form>
|
||||||
@ -324,8 +314,6 @@
|
|||||||
},
|
},
|
||||||
//表单验证
|
//表单验证
|
||||||
handleSubmit(reservation_type) {
|
handleSubmit(reservation_type) {
|
||||||
// this.propShowOrder = true;
|
|
||||||
// console.log(this.orderInfo);
|
|
||||||
this.orderInfo.reservation_type = reservation_type; //付款类型
|
this.orderInfo.reservation_type = reservation_type; //付款类型
|
||||||
this.$refs.form.validate()
|
this.$refs.form.validate()
|
||||||
.then(({
|
.then(({
|
||||||
@ -334,7 +322,6 @@
|
|||||||
}) => {
|
}) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.orderInfo.address = this.address_string + this.orderInfo.street_name;
|
this.orderInfo.address = this.address_string + this.orderInfo.street_name;
|
||||||
// console.log(this.orderInfo);
|
|
||||||
this.addOrder();
|
this.addOrder();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -349,7 +336,9 @@
|
|||||||
CommonApi.commonPost('/api/banquet/order/createOrder', this.orderInfo).catch((res) => {
|
CommonApi.commonPost('/api/banquet/order/createOrder', this.orderInfo).catch((res) => {
|
||||||
if (res.code === 1) {
|
if (res.code === 1) {
|
||||||
this.order_id = res.data.order_id;
|
this.order_id = res.data.order_id;
|
||||||
this.propShowOrder = true;
|
uni.navigateTo({
|
||||||
|
url: `/pages/banquet/order/detail?order_id=${res.data.order_id}`
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.$u.toast(res.msg);
|
uni.$u.toast(res.msg);
|
||||||
}
|
}
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
<style lang='scss'>
|
<style lang='scss'>
|
||||||
.custom-count-down {
|
.custom-count-down {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 22px;
|
width: 22px;
|
||||||
color: #ff3232;
|
color: #ff3232;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-color: #ff404021;
|
background-color: #ff404021;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-count-down-colon {
|
.custom-count-down-colon {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin: 0 4px;
|
margin: 0 4px;
|
||||||
color: #ff4040;
|
color: #ff4040;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cell-icon {
|
.cell-icon {
|
||||||
display: block;
|
display: block;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
background: url('https://img10.360buyimg.com/jmadvertisement/jfs/t1/71075/7/3762/1820/5d1f26d1E0d600b9e/a264c901943080ac.png') no-repeat;
|
background: url('https://img10.360buyimg.com/jmadvertisement/jfs/t1/71075/7/3762/1820/5d1f26d1E0d600b9e/a264c901943080ac.png') no-repeat;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
@ -56,7 +56,6 @@
|
|||||||
</wd-count-down>
|
</wd-count-down>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</u-cell>
|
</u-cell>
|
||||||
|
|
||||||
@ -73,8 +72,6 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
</u-radio-group>
|
</u-radio-group>
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="prop-flex-bottom">
|
<view class="prop-flex-bottom">
|
||||||
<up-button class="" style="" text="确认支付" type="primary" color="#59CB56" shape="circle" size="normal"
|
<up-button class="" style="" text="确认支付" type="primary" color="#59CB56" shape="circle" size="normal"
|
||||||
@ -82,11 +79,8 @@
|
|||||||
</up-button>
|
</up-button>
|
||||||
</view>
|
</view>
|
||||||
</wd-cell-group>
|
</wd-cell-group>
|
||||||
|
|
||||||
</u-popup>
|
</u-popup>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view v-for="(matchedItems, index) in matchedItems_sp" :key="index">
|
<view v-for="(matchedItems, index) in matchedItems_sp" :key="index">
|
||||||
<wd-card>
|
<wd-card>
|
||||||
<template #title>
|
<template #title>
|
||||||
@ -114,8 +108,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #title>
|
<template #title>
|
||||||
<view class="h-60 flex">
|
<view class="h-60 flex">
|
||||||
<up-text size="28rpx" :text="`${item.dishes_info.name}`" :flex1="true" align="left" wordWrap="normal"
|
<up-text size="28rpx" :text="`${item.dishes_info.name}`" :flex1="true" align="left"
|
||||||
:show="true" prefixIcon="" customStyle="font-weight:bold"
|
wordWrap="normal" :show="true" prefixIcon="" customStyle="font-weight:bold"
|
||||||
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
|
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
|
||||||
</up-text>
|
</up-text>
|
||||||
<u-icon slot="right" label-color="red" readonly :label="`¥${item.dishes_info.price}元`"></u-icon>
|
<u-icon slot="right" label-color="red" readonly :label="`¥${item.dishes_info.price}元`"></u-icon>
|
||||||
@ -123,8 +117,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #label>
|
<template #label>
|
||||||
<view class="h-60 flex color-gray">
|
<view class="h-60 flex color-gray">
|
||||||
<up-text size="26rpx" :text="`${item.dishes_info.intro}`" :flex1="true" align="left" wordWrap="normal"
|
<up-text size="26rpx" :text="`${item.dishes_info.intro}`" :flex1="true" align="left"
|
||||||
:show="true" prefixIcon="" customStyle=""
|
wordWrap="normal" :show="true" prefixIcon="" customStyle=""
|
||||||
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
|
iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" lines="1" decoration="none">
|
||||||
</up-text>
|
</up-text>
|
||||||
<u-icon slot="right" label-color="red" readonly :label="`X${item.number}`"></u-icon>
|
<u-icon slot="right" label-color="red" readonly :label="`X${item.number}`"></u-icon>
|
||||||
@ -136,16 +130,12 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<!-- <view>
|
<view class="title font-size-32">
|
||||||
<wd-button size="small" style="margin-right: 8px;">评价</wd-button>
|
<view>费用合计:</view>
|
||||||
<wd-button size="small" plain>立即使用</wd-button>
|
<view class="title-tip">
|
||||||
</view> -->
|
<text class="font-size-32 color-red ">¥{{ orderInfo.final_price }}元</text>
|
||||||
<view class="title font-size-32">
|
</view>
|
||||||
<view>费用合计:</view>
|
|
||||||
<view class="title-tip">
|
|
||||||
<text class="font-size-32 color-red ">¥{{ orderInfo.final_price }}元</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
</wd-card>
|
</wd-card>
|
||||||
|
|
||||||
@ -180,16 +170,6 @@
|
|||||||
|
|
||||||
<wd-form ref="form" :model="orderInfo" errorType="message">
|
<wd-form ref="form" :model="orderInfo" errorType="message">
|
||||||
<wd-cell-group border>
|
<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" />
|
<view class="pb-4" />
|
||||||
<wd-button plain hairline custom-style="width: calc(100vw - 100rpx);" @click="payOrder(1)">确定支付</wd-button>
|
<wd-button plain hairline custom-style="width: calc(100vw - 100rpx);" @click="payOrder(1)">确定支付</wd-button>
|
||||||
<view class="pb-2" />
|
<view class="pb-2" />
|
||||||
@ -204,193 +184,109 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { useColPickerData, useModal } from '@/hooks'
|
import { useColPickerData, useModal } from '@/hooks'
|
||||||
import { defineComponent } from "vue";
|
import { defineComponent } from "vue";
|
||||||
import { CommonApi, UserApi } from "@/api";
|
import { CommonApi, UserApi } from "@/api";
|
||||||
// import { setToken, getToken, isLogin } from '@/utils/auth';
|
const { colPickerData, findChildrenByCode } = useColPickerData()
|
||||||
const { colPickerData, findChildrenByCode } = useColPickerData()
|
export default defineComponent({
|
||||||
export default defineComponent({
|
data() {
|
||||||
data () {
|
return {
|
||||||
return {
|
totalPrice: 0,
|
||||||
totalPrice: 0,
|
server_user: {
|
||||||
server_user: {
|
id: 0,
|
||||||
id: 0,
|
phone: '',
|
||||||
phone: '',
|
public_name: '',
|
||||||
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: '',
|
payOrder(type) {
|
||||||
banquetType: this.getBanquetType(),
|
if (type === 1) {
|
||||||
propShowOrder: false,
|
//支付订单
|
||||||
// area: [],
|
CommonApi.commonPost('/api/banquet/order/pay', { order_id: this.order_id }).catch((res) => {
|
||||||
// value: [],
|
if (res.code === 1) {
|
||||||
orderInfo: [],
|
wx.requestPayment({
|
||||||
// orderInfo: {
|
"timeStamp": res.data.timeStamp,
|
||||||
// district_name: [],
|
"nonceStr": res.data.nonceStr,
|
||||||
// street_name: '',
|
"package": res.data.package,
|
||||||
// // cart_ids: [], 酒店
|
"signType": res.data.signType,
|
||||||
// customer_name: '',
|
"paySign": res.data.paySign,
|
||||||
// phone: '',
|
"success": function (res) {
|
||||||
// address: '',
|
console.log('success:' + JSON.stringify(res));
|
||||||
// remark: '',
|
},
|
||||||
// banquet_type: '1',
|
"fail": function (err) {
|
||||||
// reservation_type: 1,
|
console.log('fail:' + JSON.stringify(err));
|
||||||
// order_id: 0,
|
},
|
||||||
// // table_number: 0, 酒店
|
"complete": function (res) {
|
||||||
// // banquet_date: '', 酒店
|
console.log('complete:' + JSON.stringify(res));
|
||||||
// },
|
}
|
||||||
matchedItems_sp: [],
|
})
|
||||||
|
} else {
|
||||||
};
|
uni.$u.toast(res.msg);
|
||||||
},
|
}
|
||||||
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;
|
|
||||||
|
|
||||||
});
|
});
|
||||||
this.banquetType = res.data;
|
|
||||||
} else {
|
} 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>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user