调整宴席订单日期选择组件
Some checks are pending
deploy / deploy (push) Waiting to run

This commit is contained in:
lewis 2025-08-16 17:47:15 +08:00
parent 2ae9c80165
commit 6e2f3666d3
7 changed files with 490 additions and 530 deletions

View File

@ -110,10 +110,7 @@
"navigationStyle": "custom" "navigationStyle": "custom"
}, },
"needLogin": true "needLogin": true
}, }
] ]
}, },
{ {

View File

@ -39,7 +39,8 @@
<u-cell class="" style="line-height: 60rpx;" :border="true"> <u-cell class="" style="line-height: 60rpx;" :border="true">
<template #title> <template #title>
<view class="h-50 p-2 align-center font-blod" @click="close"> <view class="h-50 p-2 align-center font-blod" @click="close">
支付金额 <wd-text size="36rpx" bold :text="`${pre_price}`" mode="price" type="error" prefix="¥" suffix="元" /> 支付金额 <wd-text size="36rpx" bold :text="`${pre_price}`" mode="price" type="error" prefix="¥"
suffix="元" />
</view> </view>
<view class="h-50 p-2 align-center"> <view class="h-50 p-2 align-center">
剩余时间 剩余时间
@ -142,9 +143,10 @@
<template #title> <template #title>
<view class="title font-size-32"> <view class="title font-size-32">
<view>费用合计</view> <view>费用合计</view>
<view class="title-tip " > <view class="title-tip ">
<text v-if="oder_type===1" class="font-size-32 font-bold color-red">{{ totalPrice }}</text> <text v-if="oder_type===1" class="font-size-32 font-bold color-red">{{ totalPrice }}</text>
<text v-else class="font-size-32 font-bold color-red">{{ matchedItems_sp[0][0].dishes.price *orderInfo.table_number }}</text> <text v-else
class="font-size-32 font-bold color-red">{{ matchedItems_sp[0][0].dishes.price *orderInfo.table_number }}</text>
</view> </view>
</view> </view>
@ -186,8 +188,7 @@
:rules="[{ required: false, pattern: /^1[3-9]\d{9}$/, message: '请输入有效手机号码' }]" /> :rules="[{ required: false, pattern: /^1[3-9]\d{9}$/, message: '请输入有效手机号码' }]" />
<wd-select-picker label="宴席类型" prop="banquet_type" v-model="orderInfo.banquet_type" :columns="banquetType" <wd-select-picker label="宴席类型" prop="banquet_type" v-model="orderInfo.banquet_type" :columns="banquetType"
type="radio" type="radio" :rules="[
:rules="[
{ {
required: false, required: false,
validator: (value: string) => { validator: (value: string) => {
@ -196,11 +197,8 @@
message: '请选择宴席类型' message: '请选择宴席类型'
} }
]"></wd-select-picker> ]"></wd-select-picker>
<wd-input v-if="order_type===2" label="做宴日期" placeholder="请选择日期" prop="banquet_date"
v-model="orderInfo.banquet_date" readonly @click="showDatePicker = true" />
<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 <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: '请输入有效的桌数' }]" v-model="orderInfo.table_number" :rules="[{ required: false, pattern: /^[1-9]\d*$/, message: '请输入有效的桌数' }]"
@ -244,6 +242,8 @@
<!-- <wd-button size="small" plain>查看详情</wd-button> --> <!-- <wd-button size="small" plain>查看详情</wd-button> -->
</template> </template>
</wd-card> </wd-card>
<up-calendar :show="showDatePicker" showLunar @confirm="pickDate"
@close="showDatePicker = false" closeOnClickOverlay></up-calendar>
</view> </view>
</template> </template>
@ -293,10 +293,11 @@
reservation_type: 1, reservation_type: 1,
server_user_id: 0, server_user_id: 0,
table_number: 1, // table_number: 1, //
banquet_date: [], // banquet_date: '', //
}, },
matchedItems_sp: [], matchedItems_sp: [],
}; showDatePicker: false
}
}, },
onLoad(option) { onLoad(option) {
this.server_user_id = option.id;; this.server_user_id = option.id;;
@ -307,11 +308,12 @@
this.orderInfo.server_user_id = option.id; this.orderInfo.server_user_id = option.id;
this.getCartCheck() this.getCartCheck()
this.getArea() this.getArea()
},
created() {
}, },
methods: { methods: {
pickDate(e) {
this.orderInfo.banquet_date = e[0]
this.showDatePicker = false
},
close() { close() {
this.propShowOrder = false; this.propShowOrder = false;
}, },
@ -331,7 +333,6 @@
.catch((error) => { .catch((error) => {
console.log(error, 'error') console.log(error, 'error')
}) })
}, },
// //
@ -350,7 +351,6 @@
// //
payOrder() { payOrder() {
CommonApi.commonPost('/api/banquet/order/pay', { CommonApi.commonPost('/api/banquet/order/pay', {
order_id: this.order_id order_id: this.order_id
}).catch((res) => { }).catch((res) => {
@ -371,15 +371,10 @@
console.log('complete:' + JSON.stringify(res)); console.log('complete:' + JSON.stringify(res));
} }
}) })
console.log(res.data);
// this.close();
} else { } else {
uni.$u.toast(res.msg); uni.$u.toast(res.msg);
} }
}); });
}, },
// //
getArea() { getArea() {
@ -430,13 +425,18 @@
}, },
// // // //
getCartCheck() { getCartCheck() {
CommonApi.commonPost('/api/banquet/order/check', { let query = {
server_user_id: this.server_user_id server_user_id: this.server_user_id,
}).catch((res) => { cart_ids: 0
}
if (this.order_type == 2 && this.orderInfo.cart_ids > 0) {
query.cart_ids = this.orderInfo.cart_ids
}
CommonApi.commonPost('/api/banquet/order/check', query).catch((res) => {
if (res.code === 1) { if (res.code === 1) {
this.matchedItems_sp = res.data.cart_list; this.matchedItems_sp = res.data.cart_list;
this.totalPrice = res.data.total_price; this.totalPrice = res.data.total_price;
this.pre_price = this.totalPrice>=1000?1000:this.totalPrice; this.pre_price = this.totalPrice >= 1000 ? 1000 : this.totalPrice;
this.server_user.phone = res.data.server_user.certification.phone; this.server_user.phone = res.data.server_user.certification.phone;
this.server_user.public_name = res.data.server_user.certification.public_name; this.server_user.public_name = res.data.server_user.certification.public_name;
this.$refs.pagingRefSP?.complete(res.data); this.$refs.pagingRefSP?.complete(res.data);

View File

@ -1,8 +1,8 @@
<style lang='scss'> <style lang='scss'>
html, html,
body { body {
height: 0px; height: 0px;
} }
</style> </style>
<template> <template>
<view> <view>
@ -21,9 +21,8 @@ body {
<scroll-view style="height: 1000rpx;" scroll-y="true"> <scroll-view style="height: 1000rpx;" scroll-y="true">
<u-alert :show-icon="true" title="温馨提示:确定前请检查日期时间段" type="" effect="dark" description=" "></u-alert> <u-alert :show-icon="true" title="温馨提示:确定前请检查日期时间段" type="" effect="dark" description=" "></u-alert>
<view class="pb-4" /> <view class="pb-4" />
<wd-calendar label="做宴日期" placeholder="请选择日期" prop="date" :formatter="formatter" :min-date="min_data" <wd-input label="做宴日期" placeholder="请选择日期" prop="date"
v-model="orderInfo.date" :rules="[{ required: false, pattern: /^\d{13}$/, message: '请选择日期' }]" v-model="orderInfo.date" readonly @click="showDatePicker = true" />
@confirm="handleTimeConfirm" />
<wd-select-picker label="做宴时段" v-model="orderInfo.columns" :columns="columns" <wd-select-picker label="做宴时段" v-model="orderInfo.columns" :columns="columns"
type="radio"></wd-select-picker> type="radio"></wd-select-picker>
@ -53,8 +52,6 @@ body {
searchIconColor="#909399" color="#606266" placeholderColor="#909399" searchIcon="search" margin="10rpx" searchIconColor="#909399" color="#606266" placeholderColor="#909399" searchIcon="search" margin="10rpx"
maxlength="-1" height="60rpx" @change="searchSP()"> maxlength="-1" height="60rpx" @change="searchSP()">
</up-search> </up-search>
<!-- <view style="width: calc(100vw - 180rpx);display: inline-block;"> -->
<!-- <view > -->
<wd-tabs v-model="currentTab" @change="handleChange" auto-line-width color="#59CB56" lineWidth="80rpx"> <wd-tabs v-model="currentTab" @change="handleChange" auto-line-width color="#59CB56" lineWidth="80rpx">
<block v-for="(item, index) in menu_list" :key="item"> <block v-for="(item, index) in menu_list" :key="item">
<wd-tab :title="`第${index + 1}餐`" :name="index" setActive="item.name" <wd-tab :title="`第${index + 1}餐`" :name="index" setActive="item.name"
@ -140,25 +137,28 @@ body {
<up-button class="" style="" text="选好了" type="primary" color="#59CB56" shape="circle" size="small" <up-button class="" style="" text="选好了" type="primary" color="#59CB56" shape="circle" size="small"
custom-style="width:200rpx;float:right;margin-right:0rpx;" @click="handleConfirm" /> custom-style="width:200rpx;float:right;margin-right:0rpx;" @click="handleConfirm" />
</view> </view>
<up-calendar :show="showDatePicker" showLunar @confirm="pickDate"
@close="showDatePicker = false" closeOnClickOverlay></up-calendar>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
// useColPickerData // useColPickerData
// //
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 { get } from 'http'; import { get } from 'http';
// import { badgeProps } from '@/uni_modules/wot-design-uni/components/wd-badge/types'; // import { badgeProps } from '@/uni_modules/wot-design-uni/components/wd-badge/types';
// import { setToken, getToken, isLogin } from '@/utils/auth'; // 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 {
showDatePicker: false,
badgeProps: { badgeProps: {
title: '普通数值', title: '普通数值',
badgeProps: { badgeProps: {
@ -182,14 +182,14 @@ export default defineComponent({
orderInfo: { orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: [], date: '',
columns: '早上', columns: '早上',
number: 1, number: 1,
}, },
newOrderInfo: { newOrderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: [], date: '',
columns: '早上', columns: '早上',
number: 1, number: 1,
@ -205,7 +205,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: [], date: '',
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -214,7 +214,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: [], date: '',
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -223,7 +223,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: [], date: '',
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -232,7 +232,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: [], date: '',
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -241,7 +241,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: [], date: '',
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -250,7 +250,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: [], date: '',
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -259,7 +259,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: [], date: '',
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -268,7 +268,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: [], date: '',
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -277,7 +277,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: [], date: '',
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -286,7 +286,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: [], date: '',
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -295,7 +295,7 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: [], date: '',
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
@ -304,41 +304,35 @@ export default defineComponent({
name: '第1餐', orderInfo: { name: '第1餐', orderInfo: {
id: 0, id: 0,
is_set: 0, is_set: 0,
date: [], date: '',
columns: '早上', columns: '早上',
number: 1, number: 1,
} }
}, },
], ],
columns: [{ value: '早上', label: '早上' }, { value: '中午', label: '中午' }, { value: '晚上', label: '晚上' }], columns: [{ value: '早上', label: '早上' }, { value: '中午', label: '中午' }, { value: '晚上', label: '晚上' }],
// keyword_sp: '',
// categoryIndex: 0,
childrenIndex: 0, childrenIndex: 0,
// categoryList: [],
tabList: [], tabList: [],
good_list: [], good_list: [],
matchedItems_sp: [], matchedItems_sp: [],
}; };
}, },
onLoad (option) { onLoad(option) {
// console.log(option);
this.search.server_user_id = option.id; this.search.server_user_id = option.id;
this.getCategoryList() this.getCategoryList()
},
created () {
}, },
methods: { methods: {
addGoods () { pickDate(e) {
this.orderInfo.date = e[0]
this.showDatePicker = false
},
addGoods() {
// //
var new_menu_name = '第' + parseInt(this.menu_list.length + 1) + '餐'; var new_menu_name = '第' + parseInt(this.menu_list.length + 1) + '餐';
this.menu_list.push({ name: new_menu_name, orderInfo: this.newOrderInfo }); this.menu_list.push({ name: new_menu_name, orderInfo: this.newOrderInfo });
}, },
delGoods() {
delGoods () {
if (this.menu_list.length === 1) { if (this.menu_list.length === 1) {
return uni.$u.toast('至少要保留一个餐项'); return uni.$u.toast('至少要保留一个餐项');
} }
@ -361,11 +355,9 @@ export default defineComponent({
} }
}, },
}); });
}, },
// //
handleChange () { handleChange() {
this.$nextTick(() => { this.$nextTick(() => {
this.handleClickCategory(this.currentTab) this.handleClickCategory(this.currentTab)
this.menu_name = this.menu_list[this.currentTab].name; // menu_name this.menu_name = this.menu_list[this.currentTab].name; // menu_name
@ -375,7 +367,7 @@ export default defineComponent({
}, },
// //
addOrder () { addOrder() {
this.$refs.form.validate() this.$refs.form.validate()
.then(({ valid, errors }) => { .then(({ valid, errors }) => {
if (valid) { if (valid) {
@ -391,19 +383,19 @@ export default defineComponent({
console.log(error, 'error') console.log(error, 'error')
}) })
}, },
close () { close() {
this.propShowOrder = false; this.propShowOrder = false;
}, },
handleSubmit () { handleSubmit() {
this.propShowOrder = true; this.propShowOrder = true;
}, },
// //
handleConfirm () { handleConfirm() {
if(this.set_num===0){ if (this.set_num === 0) {
this.$u.toast('未添加购物车'); this.$u.toast('未添加购物车');
}else{ } else {
uni.navigateTo({ uni.navigateTo({
url: `/pages/banquet/combo/detail?id=${this.search.server_user_id}` url: `/pages/banquet/combo/detail?id=${this.search.server_user_id}`
}); });
@ -411,7 +403,7 @@ export default defineComponent({
}, },
formatter (day) { formatter(day) {
const date = new Date(day.date) const date = new Date(day.date)
const now = new Date() const now = new Date()
const year = date.getFullYear() const year = date.getFullYear()
@ -424,8 +416,6 @@ export default defineComponent({
if (year === nowYear && month === nowMonth && da === nowDa) { if (year === nowYear && month === nowMonth && da === nowDa) {
day.topInfo = '今天' day.topInfo = '今天'
} }
// const disabledDates = ['2025-08-05', '2023-08-15'];
// const formattedDate = `${year}-${month}-${da}`;
if (this.isDisabledDate.includes(day.date)) { if (this.isDisabledDate.includes(day.date)) {
day.topInfo = '已预定'; day.topInfo = '已预定';
day.disabled = true; // day.disabled = true; //
@ -434,23 +424,20 @@ export default defineComponent({
return day return day
}, },
handleTimeConfirm (res) { handleTimeConfirm(res) {
// console.log(res.value)
this.orderInfo.date = res.value this.orderInfo.date = res.value
}, },
// //
handleClickCategory (index: number) { handleClickCategory(index : number) {
this.getCategoryList(); this.getCategoryList();
}, },
handleChildrenClick (index: number) { handleChildrenClick(index : number) {
this.childrenIndex = index; this.childrenIndex = index;
this.$refs.pagingRefSP?.reload(); this.$refs.pagingRefSP?.reload();
}, },
// //
getCartCheck () { getCartCheck() {
CommonApi.commonPost('/api/banquet/order/check', { server_user_id: this.search.server_user_id }).catch((res) => { CommonApi.commonPost('/api/banquet/order/check', { server_user_id: this.search.server_user_id }).catch((res) => {
var num = 0; var num = 0;
// var index = -1; // var index = -1;
@ -478,7 +465,7 @@ export default defineComponent({
name: '第' + num + '餐', orderInfo: { name: '第' + num + '餐', orderInfo: {
id: 0, id: 0,
is_set: is_set_cart, is_set: is_set_cart,
date: res.data.cart_list[val][0].banquet_date ? new Date(res.data.cart_list[val][0].banquet_date).getTime() : [], date: res.data.cart_list[val][0].banquet_date ? res.data.cart_list[val][0].banquet_date : '',
columns: res.data.cart_list[val][0].banquet_time ? res.data.cart_list[val][0].banquet_time : '早上', 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, number: res.data.cart_list[val][0].table_number ? res.data.cart_list[val][0].table_number : 1,
} }
@ -491,7 +478,6 @@ export default defineComponent({
} else { } else {
this.orderInfo = this.menu_list[this.currentTab].orderInfo; // orderInfo -- this.orderInfo = this.menu_list[this.currentTab].orderInfo; // orderInfo --
} }
// console.log(this.orderInfo);
this.totalPrice = res.data.total_price; this.totalPrice = res.data.total_price;
} else { } else {
// uni.$u.toast(res.msg); // uni.$u.toast(res.msg);
@ -499,13 +485,12 @@ export default defineComponent({
}); });
}, },
getCategoryList () { getCategoryList() {
CommonApi.commonGet('/api/banquet/dishes/category', { CommonApi.commonGet('/api/banquet/dishes/category', {
server_user_id: this.search.server_user_id, server_user_id: this.search.server_user_id,
index: this.currentTab index: this.currentTab
}).catch((res) => { }).catch((res) => {
if (res.code === 1) { if (res.code === 1) {
// this.categoryList = res.data;
this.tabList = res.data; this.tabList = res.data;
this.search.category_id = this.tabList[0].id; this.search.category_id = this.tabList[0].id;
this.getCartCheck() // this.getCartCheck() //
@ -515,20 +500,17 @@ export default defineComponent({
}); });
}, },
// //
searchSP () { searchSP() {
this.$refs.pagingRefSP?.reload(); this.$refs.pagingRefSP?.reload();
}, },
// //
changeSP (pageNo: number) { changeSP(pageNo : number) {
this.search.category_id = this.tabList[this.childrenIndex] ? this.tabList[this.childrenIndex].id : 0; this.search.category_id = this.tabList[this.childrenIndex] ? this.tabList[this.childrenIndex].id : 0;
// console.log(pageNo);
this.search.page = pageNo; this.search.page = pageNo;
this.search.index = this.currentTab; this.search.index = this.currentTab;
CommonApi.commonGet('/api/banquet/dishes/list', this.search).catch((res) => { CommonApi.commonGet('/api/banquet/dishes/list', this.search).catch((res) => {
if (res.code === 1) { if (res.code === 1) {
// this.matchedItems_sp = res.data;
this.$refs.pagingRefSP?.complete(res.data); this.$refs.pagingRefSP?.complete(res.data);
// console.log(res);
} else { } else {
uni.$u.toast(res.msg); uni.$u.toast(res.msg);
} }
@ -536,8 +518,7 @@ export default defineComponent({
}, },
// //
dishesDetail (item) { dishesDetail(item) {
console.log(item);
if (item.type === 1) { if (item.type === 1) {
uni.navigateTo({ uni.navigateTo({
url: `/pages/banquet/combo/dishes?id=${item.id}` url: `/pages/banquet/combo/dishes?id=${item.id}`
@ -551,8 +532,7 @@ export default defineComponent({
}, },
// //
addCart (e) { addCart(e) {
console.log(e);
CommonApi.commonPost('/api/banquet/cart/add', { CommonApi.commonPost('/api/banquet/cart/add', {
server_user_id: this.search.server_user_id, server_user_id: this.search.server_user_id,
index: this.currentTab, index: this.currentTab,
@ -571,7 +551,7 @@ export default defineComponent({
} }
}); });
}, },
delCart (id) { delCart(id) {
CommonApi.commonPost('/api/banquet/cart/delete', { CommonApi.commonPost('/api/banquet/cart/delete', {
id: id, id: id,
}).catch((res) => { }).catch((res) => {
@ -584,11 +564,11 @@ export default defineComponent({
}); });
}, },
// -- // --
editCart () { editCart() {
CommonApi.commonPost('/api/banquet/cart/edit', { CommonApi.commonPost('/api/banquet/cart/edit', {
server_user_id: this.search.server_user_id, server_user_id: this.search.server_user_id,
index: this.currentTab, index: this.currentTab,
date: this.formatDate(this.orderInfo.date), date: this.orderInfo.date,
time: this.orderInfo.columns, time: this.orderInfo.columns,
number: this.orderInfo.number, number: this.orderInfo.number,
@ -601,19 +581,8 @@ export default defineComponent({
} }
}); });
}, },
// Y-m-d
formatDate (timestamp: number) {
const date = new Date(timestamp);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const formattedDate = `${year}-${month}-${day}`;
console.log('格式化后的日期:', formattedDate);
return formattedDate;
},
}, },
}); });
</script> </script>

View File

@ -107,14 +107,9 @@
}; };
}, },
onLoad(option) { onLoad(option) {
// console.log(option);
this.search.id = option.id; this.search.id = option.id;
this.is_add = option.is_add | 0; this.is_add = option.is_add | 0;
this.getChefDetail() this.getChefDetail()
// this.changeSP()
},
created() {
}, },
methods: { methods: {
// //

View File

@ -42,28 +42,25 @@
<up-line color="#F2F2F2"></up-line> <up-line color="#F2F2F2"></up-line>
</view> </view>
<view class="p-[20rpx]"> <view class="p-[20rpx]">
<view class="u-flex my-[20rpx]" v-for="(item, index) in dishesList" :key="index" @click="gotoDishesDetai(item.id)"> <view class="u-flex my-[20rpx]" v-for="(item, index) in dishesList" :key="index"
@click="gotoDishesDetai(item.id)">
<view class=""> <view class="">
<wd-img width="200rpx" height="200rpx" :src="item.images[0]" :enable-preview="false" :radius="8" :round=false <wd-img width="200rpx" height="200rpx" :src="item.images[0]" :enable-preview="false" :radius="8"
custom-class="margin-right-24" /> :round=false custom-class="margin-right-24" />
</view> </view>
<view class=""> <view class="u-flex u-flex-items-baseline u-flex-wrap">
<up-text size="32rpx" :text="`${item.name}`" :flex1="true" align="left" wordWrap="normal" :show="true" <view class="font-bold text-[32rpx]">
prefixIcon="" customStyle="font-weight:bold" iconStyle="font-size:28rpx;color:#59CB56;margin-right:10rpx;" {{item.name}}
lines="1" decoration="none">
</up-text>
<view class="h-50 u-flex color-gray">
<up-text size="" :text="`${item.intro}`" :flex1="true" align="left" wordWrap="normal" :show="true"
prefixIcon="" customStyle="font-size:24rpx"
iconStyle="font-size:24rpx;color:#59CB56;margin-right:10rpx;" lines="3" decoration="none">
</up-text>
</view> </view>
<view class="h-50 u-flex color-gray"> <view class="text-[24rpx]">
{{item.intro}}
</view>
<view class="text-[32rpx]">
<wd-text :text="item.price" mode="price" type="error" prefix="¥" /> <wd-text :text="item.price" mode="price" type="error" prefix="¥" />
</view> </view>
<view class="h-20 u-flex flex color-gray"> <view class="u-flex w-full u-flex-items-center u-flex-between">
<wd-text size="24rpx" :text="item.line_price" mode="price" decoration="line-through" prefix="¥" /> <wd-text size="24rpx" :text="item.line_price" mode="price" decoration="line-through" prefix="¥" />
<view style="margin-top: -20rpx;"> <view class="mt-[-20rpx]">
<wd-button size="small" @click="addCart(item.id)" @click.stop>下单预定</wd-button> <wd-button size="small" @click="addCart(item.id)" @click.stop>下单预定</wd-button>
</view> </view>
</view> </view>
@ -175,6 +172,7 @@
background-color: white; background-color: white;
border-radius: 20rpx; border-radius: 20rpx;
} }
.title-align { .title-align {
height: 130rpx; height: 130rpx;
line-height: 130rpx; line-height: 130rpx;

View File

@ -203,8 +203,8 @@ export default defineComponent({
}; };
}, },
onLoad (option) { onLoad (option) {
this.order_id = option.id;; this.order_id = option.order_id;;
this.orderInfo.order_id = option.id; this.orderInfo.order_id = option.order_id;
this.getOrderDetail() this.getOrderDetail()
}, },
methods: { methods: {

View File

@ -213,6 +213,7 @@ async function wechatLogin () {
// } // }
// }); // });
userStore.login({ account: account.value, code: event.code }).catch((res) => { userStore.login({ account: account.value, code: event.code }).catch((res) => {
console.log(res);
if (res.code === 1) { if (res.code === 1) {
// const token = res.data.token; // const token = res.data.token;
// if (token) { // if (token) {