Commit f8d9f636 by 张立顺

fix bug

1 parent 269c5020
...@@ -12,11 +12,11 @@ PUBLISH_PATH = '/' ...@@ -12,11 +12,11 @@ PUBLISH_PATH = '/'
# VITE_APP_API_URL = 'https://aus.glsx.com.cn/app/api/' # VITE_APP_API_URL = 'https://aus.glsx.com.cn/app/api/'
# VITE_APP_API_BASE_URL = 'https://aus.glsx.com.cn/app/' # VITE_APP_API_BASE_URL = 'https://aus.glsx.com.cn/app/'
# VITE_APP_API_URL = 'https://aus.test.glsx.com.cn/app/api/' VITE_APP_API_URL = 'https://aus.test.glsx.com.cn/app/api/'
# VITE_APP_API_BASE_URL = 'https://aus.test.glsx.com.cn/app/' VITE_APP_API_BASE_URL = 'https://aus.test.glsx.com.cn/app/'
VITE_APP_API_URL = 'http://192.168.1.125:6901/api/' # VITE_APP_API_URL = 'http://192.168.1.125:6901/api/'
VITE_APP_API_BASE_URL = 'http://192.168.1.125:6901/' # VITE_APP_API_BASE_URL = 'http://192.168.1.125:6901/'
# 优惠券相关 CDN 图:`{BASE}/{文件名}`,与 dj-aus 小程序资源路径对齐 # 优惠券相关 CDN 图:`{BASE}/{文件名}`,与 dj-aus 小程序资源路径对齐
VITE_APP_COUPON_IMAGE_BASE_URL=https://img01.glsx.com.cn/weapp/resource/dj-aus/images/coupon VITE_APP_COUPON_IMAGE_BASE_URL=https://img01.glsx.com.cn/weapp/resource/dj-aus/images/coupon
......
...@@ -83,9 +83,14 @@ const MOCK_COUPON_POPUP_HTTP_BODY: CouponPopupApiEnvelope = { ...@@ -83,9 +83,14 @@ const MOCK_COUPON_POPUP_HTTP_BODY: CouponPopupApiEnvelope = {
message: "操作成功", message: "操作成功",
}; };
/**
* 首页 `GET coupon/popup`:为 true 时使用本文件 `MOCK_COUPON_POPUP_HTTP_BODY`,不发请求;
* 为 false(默认)时走真实 `axios.get('coupon/popup')`。
*/
const COUPON_POPUP_HTTP_MOCK_ENABLED = false;
function couponPopupUsesHttpMock(): boolean { function couponPopupUsesHttpMock(): boolean {
const v = import.meta.env.VITE_MOCK_COUPON_POPUP; return COUPON_POPUP_HTTP_MOCK_ENABLED;
return v === "true" || v === "1";
} }
/** GET coupon/order-coupons/{orderId}:`mockOrderCouponsEnvelope.json`(仅开发构建,见 `orderCouponsDevMock.ts`) */ /** GET coupon/order-coupons/{orderId}:`mockOrderCouponsEnvelope.json`(仅开发构建,见 `orderCouponsDevMock.ts`) */
......
...@@ -29,49 +29,54 @@ function workOrderKeys(orderId: number): EventTrackingBusinessKeyVO[] { ...@@ -29,49 +29,54 @@ function workOrderKeys(orderId: number): EventTrackingBusinessKeyVO[] {
return [{ businessType: "WORK_ORDER", businessKey: String(orderId) }]; return [{ businessType: "WORK_ORDER", businessKey: String(orderId) }];
} }
/** 首页权益弹窗主按钮(我知道了 / 一键收下) */ /** 与 GET coupon/popup 的 `popupType` 一致;上报为 NUMBER */
function couponPopupTypeNumber(popupType: number): number {
if (typeof popupType === "number" && Number.isFinite(popupType)) {
return popupType;
}
const n = Number(popupType);
return Number.isFinite(n) ? n : 0;
}
/**
* 首页弹窗:`popup_type`(NUMBER);`coupon_id`(STRING) 仅一条,多券用英文逗号拼接。
*/
function couponPopupCommonParams(
popupType: number,
couponIds: readonly string[]
): EventTrackingParamVO[] {
const pt = couponPopupTypeNumber(popupType);
const ids = [...couponIds].map((id) => (id ?? "").trim()).filter((id) => id.length > 0);
return [
strParam("popup_type", pt, "NUMBER"),
strParam("coupon_id", ids.length > 0 ? ids.join(",") : "", "STRING"),
];
}
/** 首页权益弹窗主按钮(文档 Coupon_Popup_Click) */
export function trackCouponPopupClick( export function trackCouponPopupClick(
axios: AxiosStatic, axios: AxiosStatic,
popupType: "transfer" | "distribute", popupType: number,
couponIdsJoined: string couponIds: readonly string[]
): void { ): void {
voidBatch(axios, [ voidBatch(axios, [
{ {
eventCode: "coupon_popup_click", eventCode: "coupon_popup_click",
params: [ params: couponPopupCommonParams(popupType, couponIds),
strParam("popup_type", popupType),
strParam("coupon_id", couponIdsJoined),
],
}, },
]); ]);
} }
/** 蒙层关闭 / 关闭按钮关闭弹窗(非主按钮) */ /** 蒙层 / 右上角关闭;文档 Coupon_Popup_Close → `eventCode` 小写下划线;参数与 click 一致 */
export function trackCouponPopupClose( export function trackCouponPopupClose(
axios: AxiosStatic, axios: AxiosStatic,
popupType: "transfer" | "distribute" popupType: number,
couponIds: readonly string[]
): void { ): void {
voidBatch(axios, [ voidBatch(axios, [
{ {
eventCode: "coupon_popup_close", eventCode: "coupon_popup_close",
params: [strParam("popup_type", popupType)], params: couponPopupCommonParams(popupType, couponIds),
},
]);
}
/** 弹窗曝光(替代原 SCRM Coupon_Popup_Show,口径统一到新接口) */
export function trackCouponPopupShow(
axios: AxiosStatic,
popupType: "transfer" | "distribute",
couponIdsJoined: string
): void {
voidBatch(axios, [
{
eventCode: "coupon_popup_show",
params: [
strParam("popup_type", popupType),
strParam("coupon_id", couponIdsJoined),
],
}, },
]); ]);
} }
......
...@@ -12,6 +12,10 @@ export default { ...@@ -12,6 +12,10 @@ export default {
formatNumber(value: number, fractionDigits = 2): string { formatNumber(value: number, fractionDigits = 2): string {
return value.toFixed(fractionDigits); return value.toFixed(fractionDigits);
}, },
/** 优惠券面额/抵扣展示:固定两位小数,与订单合同选券等保持一致 */
formatCouponMoney(value: number): string {
return value.toFixed(2);
},
formatCities(cityCodes: string[]): string[] { formatCities(cityCodes: string[]): string[] {
const cityList = areaList.city_list; const cityList = areaList.city_list;
const provinceList = areaList.province_list; const provinceList = areaList.province_list;
......
...@@ -62,7 +62,6 @@ import type { CouponPopupItem, ParsedCouponPopup } from "@/api/CouponController" ...@@ -62,7 +62,6 @@ import type { CouponPopupItem, ParsedCouponPopup } from "@/api/CouponController"
import { import {
trackCouponPopupClick, trackCouponPopupClick,
trackCouponPopupClose, trackCouponPopupClose,
trackCouponPopupShow,
} from "@/common/eventTracking"; } from "@/common/eventTracking";
import { couponImageUrl } from "@/common/couponImageUrl"; import { couponImageUrl } from "@/common/couponImageUrl";
...@@ -204,10 +203,11 @@ export default class CouponHomeBenefitPopup extends Vue { ...@@ -204,10 +203,11 @@ export default class CouponHomeBenefitPopup extends Vue {
if (!Number.isFinite(x)) { if (!Number.isFinite(x)) {
return "0"; return "0";
} }
if (x % 1 === 0) { return x.toLocaleString("zh-CN", {
return Math.round(x).toLocaleString("zh-CN"); useGrouping: true,
} minimumFractionDigits: 0,
return x.toLocaleString("zh-CN", { minimumFractionDigits: 2, maximumFractionDigits: 2 }); maximumFractionDigits: 2,
});
} }
formatValidEndDate(raw: string): string { formatValidEndDate(raw: string): string {
...@@ -259,31 +259,29 @@ export default class CouponHomeBenefitPopup extends Vue { ...@@ -259,31 +259,29 @@ export default class CouponHomeBenefitPopup extends Vue {
return "activity"; return "activity";
} }
private analyticsPopupType(): "transfer" | "distribute" { /** 埋点 `popup_type`:直接使用接口下发的 `popupType` */
return this.payload?.popupType === 1 ? "transfer" : "distribute"; private analyticsPopupTypeField(): number {
const pt = this.payload?.popupType;
if (typeof pt === "number" && Number.isFinite(pt)) {
return pt;
}
const n = Number(pt);
return Number.isFinite(n) ? n : 0;
} }
private analyticsCouponIdsJoined(): string { /** 埋点:弹窗内所有券实例 ID(顺序与 couponList 一致) */
private analyticsCouponIds(): string[] {
return (this.payload?.couponList ?? []) return (this.payload?.couponList ?? [])
.map((c) => c.couponId) .map((c) => (c.couponId ?? "").trim())
.filter(Boolean) .filter(Boolean);
.join(",");
} }
private dismissPopupShell(): void { private dismissPopupShell(): void {
this.popupRef?.close?.("center"); this.popupRef?.close?.("center");
} }
/** 父级 show=true 且带有 payload 时打开 uni-popup(曝光埋点 + 重试 open) */ /** 父级 show=true 且带有 payload 时打开 uni-popup(重试 open) */
private presentWhenShown(): void { private presentWhenShown(): void {
const p = this.payload;
if (p != null) {
trackCouponPopupShow(
this.axios as AxiosStatic,
this.analyticsPopupType(),
this.analyticsCouponIdsJoined(),
);
}
this.scheduleUniPopupOpen(); this.scheduleUniPopupOpen();
} }
...@@ -294,7 +292,8 @@ export default class CouponHomeBenefitPopup extends Vue { ...@@ -294,7 +292,8 @@ export default class CouponHomeBenefitPopup extends Vue {
} }
trackCouponPopupClose( trackCouponPopupClose(
this.axios as AxiosStatic, this.axios as AxiosStatic,
this.analyticsPopupType(), this.analyticsPopupTypeField(),
this.analyticsCouponIds(),
); );
this.$emit("close"); this.$emit("close");
} }
...@@ -306,7 +305,8 @@ export default class CouponHomeBenefitPopup extends Vue { ...@@ -306,7 +305,8 @@ export default class CouponHomeBenefitPopup extends Vue {
} }
trackCouponPopupClose( trackCouponPopupClose(
this.axios as AxiosStatic, this.axios as AxiosStatic,
this.analyticsPopupType(), this.analyticsPopupTypeField(),
this.analyticsCouponIds(),
); );
this.popupRef?.close?.("center"); this.popupRef?.close?.("center");
this.$emit("close"); this.$emit("close");
...@@ -353,14 +353,15 @@ export default class CouponHomeBenefitPopup extends Vue { ...@@ -353,14 +353,15 @@ export default class CouponHomeBenefitPopup extends Vue {
}); });
} }
/** 文档 Coupon_Popup_Click → `coupon_popup_click`;用户点主按钮(我知道了 / 一键收下) */
onConfirm(): void { onConfirm(): void {
if (!this.payload) { if (!this.payload) {
return; return;
} }
trackCouponPopupClick( trackCouponPopupClick(
this.axios as AxiosStatic, this.axios as AxiosStatic,
this.analyticsPopupType(), this.analyticsPopupTypeField(),
this.analyticsCouponIdsJoined(), this.analyticsCouponIds(),
); );
this.popupRef?.close("center"); this.popupRef?.close("center");
this.$emit("close"); this.$emit("close");
...@@ -417,7 +418,7 @@ export default class CouponHomeBenefitPopup extends Vue { ...@@ -417,7 +418,7 @@ export default class CouponHomeBenefitPopup extends Vue {
.benefit-title { .benefit-title {
display: block; display: block;
text-align: center; text-align: center;
font-size: 19px; font-size: 26px;
font-weight: 600; font-weight: 600;
color: #000; color: #000;
margin-bottom: 8px; margin-bottom: 8px;
...@@ -454,7 +455,8 @@ export default class CouponHomeBenefitPopup extends Vue { ...@@ -454,7 +455,8 @@ export default class CouponHomeBenefitPopup extends Vue {
} }
.coupon-ticket__amt { .coupon-ticket__amt {
min-width: 100px; width: 76px;
height: 76px;
flex-shrink: 0; flex-shrink: 0;
background: #fff0f0; background: #fff0f0;
display: flex; display: flex;
...@@ -470,6 +472,7 @@ export default class CouponHomeBenefitPopup extends Vue { ...@@ -470,6 +472,7 @@ export default class CouponHomeBenefitPopup extends Vue {
} }
.coupon-ticket__y { .coupon-ticket__y {
font-family: "numberNor", sans-serif;
font-size: 20px; font-size: 20px;
font-weight: 700; font-weight: 700;
color: #ff5500; color: #ff5500;
...@@ -477,6 +480,7 @@ export default class CouponHomeBenefitPopup extends Vue { ...@@ -477,6 +480,7 @@ export default class CouponHomeBenefitPopup extends Vue {
} }
.coupon-ticket__num { .coupon-ticket__num {
font-family: "numberNor", sans-serif;
font-size: 20px; font-size: 20px;
font-weight: 700; font-weight: 700;
color: #ff5500; color: #ff5500;
......
...@@ -6,23 +6,23 @@ interface ImportMetaEnv { ...@@ -6,23 +6,23 @@ interface ImportMetaEnv {
readonly VITE_APP_EVENT_TRACKING_PATH?: string; readonly VITE_APP_EVENT_TRACKING_PATH?: string;
} }
declare module '*.vue' { declare module "*.vue" {
import {DefineComponent} from 'vue' import { DefineComponent } from "vue";
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any> const component: DefineComponent<{}, {}, any>;
export default component export default component;
} }
/** /**
* 自定义类型申明 * 自定义类型申明
*/ */
declare module '@vue/runtime-core' { declare module "@vue/runtime-core" {
interface ComponentCustomProperties { interface ComponentCustomProperties {
$filters: any, $filters: any;
$auth: AuthService, $auth: AuthService;
$apiUrl: string, $apiUrl: string;
$store: Store<any>, $store: Store<any>;
$goBack: () => void, $goBack: () => void;
axios: any, axios: any;
} }
} }
@import "./styles/number-nor-font.scss";
$grey: #F5F5F5; $grey: #F5F5F5;
$theme-color: #1890FF; $theme-color: #1890FF;
......
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
<view class="param-item"> <view class="param-item">
<text class="param-value"> {{ this.i18n('usageType', this.vehicle.ownership.usageType) <text class="param-value"> {{ this.i18n('usageType', this.vehicle.ownership.usageType)
}}</text> }}</text>
<text class="param-label">使用性质</text> <text class="param-label">使用性质</text>
</view> </view>
<view class="param-item"> <view class="param-item">
...@@ -271,7 +271,7 @@ ...@@ -271,7 +271,7 @@
<text class="balance-title">{{ auctionVehicle.auction.auctionType === 'LIGHT' ? '明拍进行中' : <text class="balance-title">{{ auctionVehicle.auction.auctionType === 'LIGHT' ? '明拍进行中' :
'暗拍进行中' '暗拍进行中'
}}</text> }}</text>
</view> </view>
<view class="section-card auction-card"> <view class="section-card auction-card">
<text class="section-title">拍卖信息</text> <text class="section-title">拍卖信息</text>
...@@ -297,7 +297,7 @@ ...@@ -297,7 +297,7 @@
<view v-if="auctionVehicle.auction.auctionType === 'LIGHT'"> <view v-if="auctionVehicle.auction.auctionType === 'LIGHT'">
<text class="price-color-current">¥{{ $filters.formatNumber(auctionVehicle.highestPrice <text class="price-color-current">¥{{ $filters.formatNumber(auctionVehicle.highestPrice
/ 10000) / 10000)
}}</text> }}</text>
<text class="price-unit">万元</text> <text class="price-unit">万元</text>
</view> </view>
<text class="price-color-current" <text class="price-color-current"
...@@ -1850,10 +1850,11 @@ export default class AuctionVehiclePage extends Vue { ...@@ -1850,10 +1850,11 @@ export default class AuctionVehiclePage extends Vue {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
word-break: break-word; word-break: break-word;
font-size: 17px; font-size: 20px;
font-weight: 600; font-weight: 600;
color: #323233; color: #323233;
line-height: 24px; line-height: 28px;
text-align: center;
margin-bottom: 12px; margin-bottom: 12px;
// padding-right: 28px; // padding-right: 28px;
} }
......
...@@ -61,11 +61,10 @@ ...@@ -61,11 +61,10 @@
</view> </view>
</view> </view>
</view> </view>
<view v-if="item.status !== 1" class="coupon-card__aside"> <view v-if="item.status === 2 || item.status === 3" class="coupon-card__aside">
<view class="coupon-card__stamp"> <view class="coupon-card__stamp">
<view class="coupon-card__stamp-line" /> <image class="coupon-card__stamp-img" :src="stampImageSrc(item.status)"
<text class="coupon-card__stamp-text">{{ stampLabel(item.status) }}</text> mode="aspectFit" />
<view class="coupon-card__stamp-line" />
</view> </view>
</view> </view>
</view> </view>
...@@ -128,6 +127,7 @@ import { ...@@ -128,6 +127,7 @@ import {
} from "@/api/CouponController"; } from "@/api/CouponController";
import type { AxiosStatic } from "axios"; import type { AxiosStatic } from "axios";
import { trackCouponRuleClick } from "@/common/eventTracking"; import { trackCouponRuleClick } from "@/common/eventTracking";
import { couponImageUrl } from "@/common/couponImageUrl";
type CouponTabKey = "unused" | "verified" | "expired"; type CouponTabKey = "unused" | "verified" | "expired";
...@@ -139,7 +139,7 @@ interface CouponTabSlice { ...@@ -139,7 +139,7 @@ interface CouponTabSlice {
loadingMore: boolean; loadingMore: boolean;
} }
/** 与 CouponAccountRespVO.status 一致:1 待使用 / 2 已核销 / 3 已失效 / 4 已退回 */ /** 与 CouponAccountRespVO.status 一致:1 待使用 / 2 已核销 / 3 已失效 / 4 已退回;列表侧栏印章图仅 2、3 */
type CouponTabStatus = 1 | 2 | 3 | 4; type CouponTabStatus = 1 | 2 | 3 | 4;
/** 列表卡片视图模型(由 CouponAccountRespVO 映射) */ /** 列表卡片视图模型(由 CouponAccountRespVO 映射) */
...@@ -336,10 +336,10 @@ export default class CouponPage extends Vue { ...@@ -336,10 +336,10 @@ export default class CouponPage extends Vue {
return "coupon-card--expired"; return "coupon-card--expired";
} }
stampLabel(status: CouponTabStatus): string { stampImageSrc(status: CouponTabStatus): string {
if (status === 2) return "已核销"; if (status === 2) return couponImageUrl("Redeemed.png");
if (status === 4) return "已退回"; if (status === 3) return couponImageUrl("Expired.png");
return "已过期"; return "";
} }
deductionTypeLabel(deductionType: number): string { deductionTypeLabel(deductionType: number): string {
...@@ -348,8 +348,8 @@ export default class CouponPage extends Vue { ...@@ -348,8 +348,8 @@ export default class CouponPage extends Vue {
} }
formatFaceAmount(amount: number): string { formatFaceAmount(amount: number): string {
const f = this.$filters?.formatNumber; const f = this.$filters?.formatCouponMoney;
if (typeof f === "function") return f(amount, 0); if (typeof f === "function") return f(amount);
return String(amount); return String(amount);
} }
...@@ -514,6 +514,7 @@ export default class CouponPage extends Vue { ...@@ -514,6 +514,7 @@ export default class CouponPage extends Vue {
} }
.coupon-card__currency { .coupon-card__currency {
font-family: "numberNor", sans-serif;
font-size: 14px; font-size: 14px;
font-weight: 600; font-weight: 600;
margin-right: 2px; margin-right: 2px;
...@@ -532,6 +533,7 @@ export default class CouponPage extends Vue { ...@@ -532,6 +533,7 @@ export default class CouponPage extends Vue {
} }
.coupon-card__amount-num { .coupon-card__amount-num {
font-family: "numberNor", sans-serif;
font-size: 22px; font-size: 22px;
font-weight: 700; font-weight: 700;
line-height: 1; line-height: 1;
...@@ -710,32 +712,18 @@ export default class CouponPage extends Vue { ...@@ -710,32 +712,18 @@ export default class CouponPage extends Vue {
.coupon-card__stamp { .coupon-card__stamp {
width: 56px; width: 56px;
height: 56px; height: 56px;
border-radius: 50%;
border: 2px solid #c8c9cc;
display: flex; display: flex;
flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
transform: rotate(-14deg);
box-sizing: border-box; box-sizing: border-box;
} }
.coupon-card__stamp-line { .coupon-card__stamp-img {
width: 28px; width: 56px;
height: 1px; height: 56px;
background: #c8c9cc;
flex-shrink: 0; flex-shrink: 0;
} }
.coupon-card__stamp-text {
font-size: 10px;
color: #969799;
font-weight: 600;
padding: 4px 0;
line-height: 1.2;
text-align: center;
}
.coupon-card__instruction { .coupon-card__instruction {
border-top: 1px solid #e7ebf4; border-top: 1px solid #e7ebf4;
padding: 6px; padding: 6px;
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
class="coupon-row-value coupon-row-value--muted">处理中…</text> class="coupon-row-value coupon-row-value--muted">处理中…</text>
<template v-else> <template v-else>
<text class="coupon-row-value" :class="couponRowValueClass">{{ couponRowRightText <text class="coupon-row-value" :class="couponRowValueClass">{{ couponRowRightText
}}</text> }}</text>
<text v-if="couponRowShowUseBtn" class="coupon-row-use-btn" <text v-if="couponRowShowUseBtn" class="coupon-row-use-btn"
@click.stop="onOpenCouponVerifyDialog">立即使用</text> @click.stop="onOpenCouponVerifyDialog">立即使用</text>
</template> </template>
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
<view class="contract-coupon-card__amount-row"> <view class="contract-coupon-card__amount-row">
<text class="contract-coupon-card__currency">¥</text> <text class="contract-coupon-card__currency">¥</text>
<text class="contract-coupon-card__face">{{ formatCouponAmount(item.faceAmount) <text class="contract-coupon-card__face">{{ formatCouponAmount(item.faceAmount)
}}</text> }}</text>
</view> </view>
<text class="contract-coupon-card__cap">最高抵扣¥{{ <text class="contract-coupon-card__cap">最高抵扣¥{{
formatCouponAmount(item.actualDeduction) }}</text> formatCouponAmount(item.actualDeduction) }}</text>
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
:class="item.deductionType === 2 ? 'contract-coupon-card__tag--commission' : 'contract-coupon-card__tag--car'"> :class="item.deductionType === 2 ? 'contract-coupon-card__tag--commission' : 'contract-coupon-card__tag--car'">
{{ deductionTypeLabel(item.deductionType) }}</view> {{ deductionTypeLabel(item.deductionType) }}</view>
<text class="contract-coupon-card__period">有效期至{{ formatValidEnd(item.validEndTime) <text class="contract-coupon-card__period">有效期至{{ formatValidEnd(item.validEndTime)
}}</text> }}</text>
</view> </view>
<view class="contract-coupon-card__radio"> <view class="contract-coupon-card__radio">
<view class="coupon-radio coupon-radio--lg" <view class="coupon-radio coupon-radio--lg"
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<view class="contract-coupon-card__amount-row"> <view class="contract-coupon-card__amount-row">
<text class="contract-coupon-card__currency">¥</text> <text class="contract-coupon-card__currency">¥</text>
<text class="contract-coupon-card__face">{{ formatCouponAmount(u.faceAmount) <text class="contract-coupon-card__face">{{ formatCouponAmount(u.faceAmount)
}}</text> }}</text>
</view> </view>
<text class="contract-coupon-card__cap">最高抵扣¥{{ <text class="contract-coupon-card__cap">最高抵扣¥{{
formatCouponAmount(u.actualDeduction) }}</text> formatCouponAmount(u.actualDeduction) }}</text>
...@@ -162,11 +162,11 @@ ...@@ -162,11 +162,11 @@
:class="u.deductionType === 2 ? 'contract-coupon-card__tag--commission' : 'contract-coupon-card__tag--car'"> :class="u.deductionType === 2 ? 'contract-coupon-card__tag--commission' : 'contract-coupon-card__tag--car'">
{{ deductionTypeLabel(u.deductionType) }}</view> {{ deductionTypeLabel(u.deductionType) }}</view>
<text class="contract-coupon-card__period">有效期至{{ formatValidEnd(u.validEndTime) <text class="contract-coupon-card__period">有效期至{{ formatValidEnd(u.validEndTime)
}}</text> }}</text>
</view> </view>
<view class="contract-coupon-card__stamp"> <view class="contract-coupon-card__stamp">
<text class="contract-coupon-card__stamp-txt">{{ u.unavailableReason || '不可用' <text class="contract-coupon-card__stamp-txt">{{ u.unavailableReason || '不可用'
}}</text> }}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
z-index="10002"> z-index="10002">
<view class="coupon-verify-dialog"> <view class="coupon-verify-dialog">
<image class="coupon-verify-dialog__illu" :src="couponVerifyDialogIlluSrc" mode="widthFix" /> <image class="coupon-verify-dialog__illu" :src="couponVerifyDialogIlluSrc" mode="widthFix" />
<!-- <text class="coupon-verify-dialog__title">确认核销优惠券吗</text> --> <text class="coupon-verify-dialog__title">确认核销优惠券吗</text>
<view class="coupon-verify-dialog__btn coupon-verify-dialog__btn--outline" <view class="coupon-verify-dialog__btn coupon-verify-dialog__btn--outline"
:class="{ 'coupon-verify-dialog__btn--disabled': couponVerifyLoading }" :class="{ 'coupon-verify-dialog__btn--disabled': couponVerifyLoading }"
@click="onCouponVerifyDismiss"> @click="onCouponVerifyDismiss">
...@@ -192,7 +192,7 @@ ...@@ -192,7 +192,7 @@
@click="onCouponVerifyConfirm"> @click="onCouponVerifyConfirm">
<text class="coupon-verify-dialog__btn-txt coupon-verify-dialog__btn-txt--inv">{{ <text class="coupon-verify-dialog__btn-txt coupon-verify-dialog__btn-txt--inv">{{
couponVerifyLoading ? "核销中…" : "确认核销" couponVerifyLoading ? "核销中…" : "确认核销"
}}</text> }}</text>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
...@@ -530,8 +530,8 @@ export default class ContractPage extends Vue { ...@@ -530,8 +530,8 @@ export default class ContractPage extends Vue {
} }
formatCouponAmount(n: number): string { formatCouponAmount(n: number): string {
const f = (this as unknown as { $filters?: { formatNumber?: (v: number, d?: number) => string } }).$filters const f = (this as unknown as { $filters?: { formatCouponMoney?: (v: number) => string } }).$filters
?.formatNumber; ?.formatCouponMoney;
if (typeof f === "function") return f(n); if (typeof f === "function") return f(n);
return String(n); return String(n);
} }
...@@ -547,7 +547,7 @@ export default class ContractPage extends Vue { ...@@ -547,7 +547,7 @@ export default class ContractPage extends Vue {
return "抵扣车款"; return "抵扣车款";
} }
/** 核销接口业务成功:`order_pay_submit_click`(立即使用链路) */ /** `order_pay_submit_click`:仅「立即使用」确认后核销成功上报(须在调用 coupon/verify 成功回调内);「查看购车合同」核销不上报 */
private emitOrderPaySubmitOnVerifySuccess( private emitOrderPaySubmitOnVerifySuccess(
couponId: string, couponId: string,
actualDeductionRaw: unknown actualDeductionRaw: unknown
...@@ -802,10 +802,6 @@ export default class ContractPage extends Vue { ...@@ -802,10 +802,6 @@ export default class ContractPage extends Vue {
}); });
return; return;
} }
this.emitOrderPaySubmitOnVerifySuccess(
couponId,
parsed.data?.actualDeduction
);
if ( if (
parsed.data?.actualDeduction != null && parsed.data?.actualDeduction != null &&
parsed.data.actualDeduction >= 0 parsed.data.actualDeduction >= 0
...@@ -1201,14 +1197,31 @@ export default class ContractPage extends Vue { ...@@ -1201,14 +1197,31 @@ export default class ContractPage extends Vue {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: 14px 4px; padding: 14px 16px;
margin-bottom: 8px; margin-bottom: 12px;
border-bottom: 1px solid #f2f3f5; box-sizing: border-box;
background-color: #fff;
border: 1px solid #ebedf0;
border-radius: 10px;
} }
.coupon-sheet__no-use-txt { .coupon-sheet__no-use-txt {
font-size: 15px; font-size: 15px;
color: #323233; color: #323233;
line-height: 22px;
}
/* 稿:细灰描边空心圆;与下方券卡大号勾选样式区分 */
.coupon-sheet__no-use .coupon-radio {
width: 20px;
height: 20px;
border: 1px solid #dcdee0;
background-color: #fff;
}
.coupon-sheet__no-use .coupon-radio--on {
border: 1px solid #ff6010;
background-color: #ff6010;
} }
.coupon-radio { .coupon-radio {
...@@ -1293,12 +1306,14 @@ export default class ContractPage extends Vue { ...@@ -1293,12 +1306,14 @@ export default class ContractPage extends Vue {
} }
.contract-coupon-card__currency { .contract-coupon-card__currency {
font-family: "numberNor", sans-serif;
font-size: 22px; font-size: 22px;
color: #ff6010; color: #ff6010;
font-weight: 700; font-weight: 700;
} }
.contract-coupon-card__face { .contract-coupon-card__face {
font-family: "numberNor", sans-serif;
font-size: 22px; font-size: 22px;
font-weight: 700; font-weight: 700;
color: #ff6010; color: #ff6010;
......
@font-face {
font-family: "numberNor";
src: url("https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat/font/D-DIN-PRO-500-Medium.ttf");
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!