This commit is contained in:
2026-03-27 10:15:51 +08:00
parent 230bb76f63
commit 2c00299634
19 changed files with 1001 additions and 1172 deletions

View File

@ -69,7 +69,7 @@
<image class="right-icon" :src="`${imgPrefix}right-arrow.png`" mode="widthFix"></image>
</view>
<text class="nightFee">以下区域需收取调度费奉贤区嘉定区青浦区松江区崇明区金山区</text>
<!-- <text class="nightFee">以下区域需收取调度费奉贤区嘉定区青浦区松江区崇明区金山区</text> -->
</template>
<!-- 价格-->

View File

@ -4,7 +4,7 @@
<view class="body-container">
<scroll-view class="scroll-view" :scroll-y="true">
<view class="form-content">
<view class="order-tab-list">
<!-- <view class="order-tab-list">
<view :class="orderType === ORDER_TYPE_RESERVATION ? 'activeItem' : 'tabItem'"
@click.stop="selectOrderType(ORDER_TYPE_RESERVATION)">
预约单
@ -13,13 +13,13 @@
@click.stop="selectOrderType(ORDER_TYPE_SITE)">
现场单
</view>
</view>
</view> -->
<view class="reservation-info-container">
<!-- 其他内容 -->
<view class="formWrapper">
<view class="info-top-view" v-if="orderType != ORDER_TYPE_RESERVATION">
<!-- <view class="info-top-view" v-if="orderType != ORDER_TYPE_RESERVATION">
<view class="top">
<view class="title-view">
<text class="required">*</text>
@ -32,9 +32,9 @@
@click="scanCode" />
</view>
</view>
</view>
</view> -->
<view class="form-section form-section-pet">
<!-- <view class="form-section form-section-pet">
<view class="form-label-row">
<text class="required">*</text>
<text class="form-label">选择宠物</text>
@ -55,7 +55,7 @@
<text class="add-pet-text">添加宠物</text>
</view>
</view>
</view>
</view> -->
<!-- <info-cell key="weight" cell-type="text" title="宠物重量区间" :info="petInfo.weight_name"
placeholder='先选择宠物' :is-can-click="false" />
<info-cell v-if="selectedPetType === PET_TYPE_CAT" key="mofa" cell-type="text" title="宠物毛发"
@ -79,12 +79,12 @@
</view>
<view class="payFooter">
<view class="leftPay">
<view class="priceWrapper">
<!-- <view class="priceWrapper">
<text class="text">预估</text>
<text class="unitText">
¥<text class="price">{{ totalDisplayPrice }}</text>
</text>
</view>
</view> -->
<!-- <view class="vipPrice" v-if="discount === 0">
<view>
<image :src="`${imgPrefix}vipPrice.png`" mode="widthFix"
@ -95,8 +95,8 @@
</view>
</view> -->
</view>
<view class="payBtn" @click.stop="paymentConfirm">
下一步
<view class="payBtn" @click.stop="writeOff">
预约
</view>
</view>
</view>
@ -185,6 +185,65 @@ export default {
}
},
methods: {
// 核销按钮点击处理
async writeOff () {
try {
// 调用核销 API
const result = await tt.verifyCertificates({
// 唯一标识,防止重复提交(重要!)
verifyToken: `${Date.now()}_${Math.random()}`,
// 当前核销的门店ID
poiId: this.data.currentPoiId,
// 要核销的订单和券列表
orderList: [
{
orderId: '100238388744094', // 订单ID
certificateList: [ // 本次要核销的券
'724375050697789', // 普通团购券
// 次卡需要特殊格式
{
code: '723733187837987',
times: 2 // 本次核销2次
}
]
}
],
// 【必填】核销成功后跳转的页面
orderEntrySchema: {
path: 'pages/order/detail', // 你的订单详情页路径
params: JSON.stringify({ orderId: 'xxx' })
},
// 成功回调仅代表API调用成功
success: (res) => {
console.log('API调用成功', res);
// 需要遍历确认每个券的核销结果
const verifyResults = res.orderVerifyResults;
const allSuccess = verifyResults.every(item => item.resultCode === 0);
if (allSuccess) {
tt.showToast({ title: '核销成功' });
// 刷新页面或跳转
} else {
tt.showToast({ title: '部分核销失败', icon: 'none' });
}
},
// 失败回调
fail: (err) => {
console.error('核销失败', err);
tt.showToast({ title: '核销失败,请重试', icon: 'none' });
}
});
} catch (error) {
console.error('调用异常', error);
}
},
getPetShortName(pet) {
const n = pet.name || pet.pet_name || pet.pet_nickname || '';
return n.length > 2 ? n.slice(0, 2) + '…' : n.slice(0, 2);