| | |
| | | /** 免费入住:超过免费天数后的折扣文案(如「门市价9折」,没配折扣时为空)。 */ |
| | | discountText: string |
| | | benefitText: string |
| | | /** 观影权益(票包兑换码):核销时回传的兑换码、票包名与有效期。 */ |
| | | verifyCode: string |
| | | packageName: string |
| | | merchantName: string |
| | | validEnd: string |
| | | } |
| | | |
| | | export type VerificationConfirmResult = { |
| | |
| | | freeStayTotalCount: data.freeStayTotalCount != null ? Number(data.freeStayTotalCount) : 0, |
| | | freeStayRemainingCount: data.freeStayRemainingCount != null ? Number(data.freeStayRemainingCount) : 0, |
| | | discountText: data.discountText != null ? '' + data.discountText : '', |
| | | benefitText: data.benefitText != null ? '' + data.benefitText : '' |
| | | benefitText: data.benefitText != null ? '' + data.benefitText : '', |
| | | verifyCode: data.verifyCode != null ? '' + data.verifyCode : '', |
| | | packageName: data.packageName != null ? '' + data.packageName : '', |
| | | merchantName: data.merchantName != null ? '' + data.merchantName : '', |
| | | validEnd: data.validEnd != null ? '' + data.validEnd : '' |
| | | } |
| | | onSuccess(result, traceId) |
| | | }, onError) |
| | | } |
| | | |
| | | /** |
| | | * 观影权益核销:票包兑换码(后台批量生成、绑影城)在现场扫码核销。 |
| | | * |
| | | * 走的是后台「权益核销」接口:它会校验码属于当前商户、未核销、未过期,并把票包码池与领取记录 |
| | | * 一起置为已核销,同时写下核销记录(后台「电影票管理-领取记录」能实时看到)。 |
| | | */ |
| | | export const verifyBenefitCode = ( |
| | | verifyCode: string, |
| | | idempotencyKey: string, |
| | | onSuccess: (result: VerificationConfirmResult, traceId: string) => void, |
| | | onError: (error: HttpError) => void |
| | | ): (() => void) => request<VerificationConfirmResult>({ |
| | | path: getApiEndpoint('benefitVerificationVerify'), |
| | | method: 'POST', |
| | | idempotencyKey: idempotencyKey, |
| | | data: { benefitType: 'MOVIE_TICKET', verifyCode: verifyCode } |
| | | }, onSuccess, onError) |
| | | |
| | | /** 免费入住券核销:不涉及支付,只扣券次数。订单核销走 confirmMerchantOrderVerification。 */ |
| | | export const confirmVerificationCode = ( |
| | | verificationId: string, |