1
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user