From 8e5a112e4c02eb7d8570d5d21318e28fc638bea1 Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Tue, 2 Sep 2025 14:40:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E6=97=B6=E6=8B=99=E6=94=BF=E5=9B=AD7?= =?UTF-8?q?=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/info/sceneProductInfo/index.js | 22 +++++++++++++++------- pages/info/sceneProductInfo/index.wxml | 4 ++-- pages/order/scene/index.js | 9 ++++++++- pages/order/scene/index.wxml | 2 +- subPackages/gwcOrder/index.js | 9 +++++++-- subPackages/gwcOrder/index.wxml | 2 +- utils/filter.wxs | 14 +++++++++++++- 7 files changed, 47 insertions(+), 15 deletions(-) diff --git a/pages/info/sceneProductInfo/index.js b/pages/info/sceneProductInfo/index.js index 3384f5b..fe8ccb4 100644 --- a/pages/info/sceneProductInfo/index.js +++ b/pages/info/sceneProductInfo/index.js @@ -60,6 +60,8 @@ Page({ skuShowIndex: 0, skuShowDomId: "", + + skuDays: 30, }, /** @@ -98,6 +100,12 @@ Page({ return; } res.data.display_tags = (res.data.display_tags ? res.data.display_tags.split(",") : []).splice(0, 2); + // 拙政园分时7天 + if(options.id == 5442) { + this.setData({skuDays: 7}) + } + + // 如果是带有指定good_id的 那么取指定的 if (options.gid) { let pItem = res.data.product.find(item => item.id == options.gid); @@ -174,12 +182,12 @@ Page({ // res.data.listimg = res.data.listimg?res.data.listimg.split(","):[]; - res.data.product.map(product => { - product.sku.map(sku => { - sku.display_tags = (sku.display_tags ? sku.display_tags.split(",") : []).splice(0, 2); - sku.display_tags_str = sku.display_tags.join(' | ') - }) - }) + // res.data.product.map(product => { + // product.sku.map(sku => { + // sku.display_tags = (sku.display_tags ? sku.display_tags.split(",") : []).splice(0, 2); + // sku.display_tags_str = sku.display_tags.join(' | ') + // }) + // }) this.setData({ info: res.data }) @@ -835,7 +843,7 @@ Page({ if (ticket_type != 2) { let today = util.formatDate(new Date()), - end_date = util.formatDate(new Date(new Date().getTime() + 30 * 24 * 60 * 60 * 1000)); + end_date = util.formatDate(new Date(new Date().getTime() + this.data.skuDays * 24 * 60 * 60 * 1000)); commonApi.user_post("product/product_date_price", { start_date: today, end_date: end_date, diff --git a/pages/info/sceneProductInfo/index.wxml b/pages/info/sceneProductInfo/index.wxml index dd8b99d..50826b8 100644 --- a/pages/info/sceneProductInfo/index.wxml +++ b/pages/info/sceneProductInfo/index.wxml @@ -71,7 +71,7 @@ - {{sku.display_tags_str}} + {{tool.filterTag(sku.display_tags,",",2,false)}} + product="{{product}}" datePrice="{{skuPriceDate}}" endDays="{{skuDays}}"> 预订须知 diff --git a/pages/order/scene/index.js b/pages/order/scene/index.js index 3cbd68f..2a00084 100644 --- a/pages/order/scene/index.js +++ b/pages/order/scene/index.js @@ -45,7 +45,9 @@ Page({ showDate:false, showDate2:false, showYhq:null, - couponFlag:false + couponFlag:false, + + skuDays: 30, }, /** @@ -102,6 +104,11 @@ Page({ } catch(e) {} // app.globalData.product.sku.display_tags_str = app.globalData.product.sku.display_tags.split(",").splice(0, 2).join(" | "); } + if (this.data.product.product.scene_id == 5442) { + this.setData({skuDays: 7}) + } + + this.setData({ product: app.globalData.product, singlePrice: app.globalData.product.date?app.globalData.product.date.price :(this.data.gp_id ? app.globalData.product.sku.event_price : app.globalData.product.sku.price) diff --git a/pages/order/scene/index.wxml b/pages/order/scene/index.wxml index aab8015..2fabf39 100644 --- a/pages/order/scene/index.wxml +++ b/pages/order/scene/index.wxml @@ -135,7 +135,7 @@ - + 合计: {{price}} diff --git a/subPackages/gwcOrder/index.js b/subPackages/gwcOrder/index.js index 485496a..54365f0 100644 --- a/subPackages/gwcOrder/index.js +++ b/subPackages/gwcOrder/index.js @@ -36,7 +36,9 @@ Page({ is_authentication:1, // 是否实名,0否1是,默认实名 phone:'', //不实名时传的手机号 is_real_name:1, // 是否是一证一票,0否1是, - status:false + status:false, + + skuDays: 30, }, /** @@ -74,7 +76,10 @@ Page({ this.setData({ productNum: app.globalData.product.num == null ? 1 : app.globalData.product.num }) - } + } + if (this.data.product.product.scene_id == 5442) { + this.setData({skuDays: 7}) + } this.setData({ product: app.globalData.product, singlePrice: this.data.gp_id ? app.globalData.product.sku.event_price : app.globalData.product.sku.price diff --git a/subPackages/gwcOrder/index.wxml b/subPackages/gwcOrder/index.wxml index 2c27939..81db641 100644 --- a/subPackages/gwcOrder/index.wxml +++ b/subPackages/gwcOrder/index.wxml @@ -6,7 +6,7 @@ 免费 + product="{{product}}" endDays="{{skuDays}}"> 团体主体名称: diff --git a/utils/filter.wxs b/utils/filter.wxs index 6a3c348..2821b85 100644 --- a/utils/filter.wxs +++ b/utils/filter.wxs @@ -52,9 +52,21 @@ var showAllSeldDate = function (date, index,today,tomorrow,afterTom) { var toFix = function(value) { return (value / 100).toFixed(2); }; + + var filterTag = function (tagStr, splitStr = "," ,arrNum = 2, needArr=false) { + if (!tagStr) return ''; // 处理空值 + var arr = tagStr.split(splitStr); // 拆分字符串 + var limited = arr.slice(0, arrNum); // 只取前2个 + if (needArr) { + return limited + } + return limited.join(' | '); // 拼接成字符串 + }; + module.exports = { formateRichText:formateRichText, gotoUrl:gotoUrl, toFix:toFix, - showAllSeldDate:showAllSeldDate + showAllSeldDate:showAllSeldDate, + filterTag: filterTag }; \ No newline at end of file