From d5a92e1daeff842eecc903c21ac1f8b67f7a8b56 Mon Sep 17 00:00:00 2001 From: zoujing Date: Wed, 12 Aug 2026 11:49:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=99=AF=E5=8C=BA=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E5=8F=8A=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85=E5=A4=B4=E5=9B=BE?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E4=BC=98=E5=8C=96=E8=B0=83=E6=95=B4=EF=BC=8C?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=BD=AE=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tickets/components/ProductDetail.vue | 35 ++++++----- .../tickets/components/TicketHome.vue | 40 +++++-------- .../tickets/components/TicketMediaSwiper.vue | 58 +++++++++++++++++++ .../tickets/view-contract.test.mjs | 38 +++++++++--- 4 files changed, 120 insertions(+), 51 deletions(-) create mode 100644 src/pages-service/tickets/components/TicketMediaSwiper.vue diff --git a/src/pages-service/tickets/components/ProductDetail.vue b/src/pages-service/tickets/components/ProductDetail.vue index 27db41b..139761a 100644 --- a/src/pages-service/tickets/components/ProductDetail.vue +++ b/src/pages-service/tickets/components/ProductDetail.vue @@ -2,24 +2,15 @@ - - 1 / {{ productImages.length }} + 暂无商品图片 - - - - {{ product.fulfillmentLabel }} @@ -32,7 +23,7 @@ @@ -52,7 +43,7 @@ 优惠价 - {{ currencySymbol }}{{ product.startingPrice }} + {{ currencySymbol }}{{ product.startingPrice }} {{ product.bookingButtonText || '去预订' }} @@ -64,15 +55,23 @@ diff --git a/src/pages-service/tickets/view-contract.test.mjs b/src/pages-service/tickets/view-contract.test.mjs index 646a949..b9d7f7f 100644 --- a/src/pages-service/tickets/view-contract.test.mjs +++ b/src/pages-service/tickets/view-contract.test.mjs @@ -155,13 +155,16 @@ test("TicketHome consumes scenic home response fields directly", async () => { ); }); -test("TicketHome renders MP4 cover images as background videos", async () => { - const source = await readTicketFile("components/TicketHome.vue"); +test("tickets use a local indicator-free media swiper", async () => { + const source = await readTicketFile("components/TicketMediaSwiper.vue"); - assert.match( - source, - / { assert.match(source, /:show-mute-btn="false"/); assert.match(source, /:enable-progress-gesture="false"/); assert.match(source, /object-fit="cover"/); - assert.match(source, //); assert.match(source, /url\.trim\(\)\.split\(\/\[\?\#\]\/\)\[0\]/); - assert.match(source, /toLowerCase\(\)\.endsWith\('\.mp4'\)/); + assert.match(source, /toLowerCase\(\)\.endsWith\("\.mp4"\)/); +}); + +test("TicketHome prefers mediaList and falls back to coverImage", async () => { + const source = await readTicketFile("components/TicketHome.vue"); + + assert.match(source, /import TicketMediaSwiper from "\.\/TicketMediaSwiper\.vue"/); + assert.match(source, //); + assert.match(source, /if \(mediaList\.length\) return mediaList/); + assert.match(source, /props\.homeData\.coverImage/); + assert.doesNotMatch(source, /