Browse Source

分时拙政园7天

master
jiazhipeng 8 months ago
parent
commit
8e5a112e4c
  1. 22
      pages/info/sceneProductInfo/index.js
  2. 4
      pages/info/sceneProductInfo/index.wxml
  3. 9
      pages/order/scene/index.js
  4. 2
      pages/order/scene/index.wxml
  5. 9
      subPackages/gwcOrder/index.js
  6. 2
      subPackages/gwcOrder/index.wxml
  7. 14
      utils/filter.wxs

22
pages/info/sceneProductInfo/index.js

@ -60,6 +60,8 @@ Page({
skuShowIndex: 0, skuShowIndex: 0,
skuShowDomId: "", skuShowDomId: "",
skuDays: 30,
}, },
/** /**
@ -98,6 +100,12 @@ Page({
return; return;
} }
res.data.display_tags = (res.data.display_tags ? res.data.display_tags.split(",") : []).splice(0, 2); 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的 那么取指定的 // 如果是带有指定good_id的 那么取指定的
if (options.gid) { if (options.gid) {
let pItem = res.data.product.find(item => item.id == 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.listimg = res.data.listimg?res.data.listimg.split(","):[];
res.data.product.map(product => { // res.data.product.map(product => {
product.sku.map(sku => { // product.sku.map(sku => {
sku.display_tags = (sku.display_tags ? sku.display_tags.split(",") : []).splice(0, 2); // sku.display_tags = (sku.display_tags ? sku.display_tags.split(",") : []).splice(0, 2);
sku.display_tags_str = sku.display_tags.join(' | ') // sku.display_tags_str = sku.display_tags.join(' | ')
}) // })
}) // })
this.setData({ this.setData({
info: res.data info: res.data
}) })
@ -835,7 +843,7 @@ Page({
if (ticket_type != 2) { if (ticket_type != 2) {
let today = util.formatDate(new Date()), 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", { commonApi.user_post("product/product_date_price", {
start_date: today, start_date: today,
end_date: end_date, end_date: end_date,

4
pages/info/sceneProductInfo/index.wxml

@ -71,7 +71,7 @@
<view class="product-left textOver"> <view class="product-left textOver">
<view class="product-tags"> <view class="product-tags">
<!-- <view class="product-tag textOver" wx:for="{{sku.display_tags}}">{{item}}</view> --> <!-- <view class="product-tag textOver" wx:for="{{sku.display_tags}}">{{item}}</view> -->
<view class="product-tag textOver" >{{sku.display_tags_str}}</view> <view class="product-tag textOver" >{{tool.filterTag(sku.display_tags,",",2,false)}}</view>
</view> </view>
<view class="order-tip-text" bindtap="selectDate" data-sku="{{sku}}" data-product="{{item}}" <view class="order-tip-text" bindtap="selectDate" data-sku="{{sku}}" data-product="{{item}}"
@ -163,7 +163,7 @@
<scroll-view class="mask-scroll-content" scroll-y scroll-into-view="{{skuShowDomId}}" scroll-with-animation> <scroll-view class="mask-scroll-content" scroll-y scroll-into-view="{{skuShowDomId}}" scroll-with-animation>
<date id="sku-show-0" wx:if="{{showDate2}}" bind:onChangeDate="changeDate" bind:onChangeTime="changeTime" <date id="sku-show-0" wx:if="{{showDate2}}" bind:onChangeDate="changeDate" bind:onChangeTime="changeTime"
product="{{product}}" datePrice="{{skuPriceDate}}" endDays="{{30}}"></date> product="{{product}}" datePrice="{{skuPriceDate}}" endDays="{{skuDays}}"></date>
<view id="sku-show-1" class="orderNotice" wx:if="{{orderSku}}"> <view id="sku-show-1" class="orderNotice" wx:if="{{orderSku}}">
<view style="font-weight: 500;font-size: 15px;color: #000000;margin-bottom: 26rpx;">预订须知</view> <view style="font-weight: 500;font-size: 15px;color: #000000;margin-bottom: 26rpx;">预订须知</view>

9
pages/order/scene/index.js

@ -45,7 +45,9 @@ Page({
showDate:false, showDate:false,
showDate2:false, showDate2:false,
showYhq:null, showYhq:null,
couponFlag:false couponFlag:false,
skuDays: 30,
}, },
/** /**
@ -102,6 +104,11 @@ Page({
} catch(e) {} } catch(e) {}
// app.globalData.product.sku.display_tags_str = app.globalData.product.sku.display_tags.split(",").splice(0, 2).join(" | "); // 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({ this.setData({
product: app.globalData.product, 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) 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)

2
pages/order/scene/index.wxml

@ -135,7 +135,7 @@
<view class="mask-bg" bindtap="hideDate"></view> <view class="mask-bg" bindtap="hideDate"></view>
<view class="mask-content2"> <view class="mask-content2">
<view class="iconfont icon-close" bindtap="hideDate"></view> <view class="iconfont icon-close" bindtap="hideDate"></view>
<date wx:if="{{showDate2}}" bind:onChangeDate="changeDate" bind:onChangeTime="changeTime" product="{{product}}" endDays="{{30}}"></date> <date wx:if="{{showDate2}}" bind:onChangeDate="changeDate" bind:onChangeTime="changeTime" product="{{product}}" endDays="{{skuDays}}"></date>
<view class="bottom-box"> <view class="bottom-box">
<view> <view>
合计: <text class="totalPrice">{{price}}</text> 合计: <text class="totalPrice">{{price}}</text>

9
subPackages/gwcOrder/index.js

@ -36,7 +36,9 @@ Page({
is_authentication:1, // 是否实名,0否1是,默认实名 is_authentication:1, // 是否实名,0否1是,默认实名
phone:'', //不实名时传的手机号 phone:'', //不实名时传的手机号
is_real_name:1, // 是否是一证一票,0否1是, is_real_name:1, // 是否是一证一票,0否1是,
status:false status:false,
skuDays: 30,
}, },
/** /**
@ -74,7 +76,10 @@ Page({
this.setData({ this.setData({
productNum: app.globalData.product.num == null ? 1 : app.globalData.product.num 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({ this.setData({
product: app.globalData.product, product: app.globalData.product,
singlePrice: this.data.gp_id ? app.globalData.product.sku.event_price : app.globalData.product.sku.price singlePrice: this.data.gp_id ? app.globalData.product.sku.event_price : app.globalData.product.sku.price

2
subPackages/gwcOrder/index.wxml

@ -6,7 +6,7 @@
<view class="product-price" wx:if="{{type=='museum' || type=='activity'}}">免费</view> <view class="product-price" wx:if="{{type=='museum' || type=='activity'}}">免费</view>
</view> </view>
<date wx:if="{{isLogin && type!='activity' && ticket_type == 1}}" bind:onChangeDate="changeDate" bind:onChangeTime="changeTime" <date wx:if="{{isLogin && type!='activity' && ticket_type == 1}}" bind:onChangeDate="changeDate" bind:onChangeTime="changeTime"
product="{{product}}"></date> product="{{product}}" endDays="{{skuDays}}"></date>
<view class="box" wx:if="{{product && product.isGroup==1}}"> <view class="box" wx:if="{{product && product.isGroup==1}}">
<view class="box-title"> <view class="box-title">
<view style="flex-shrink:0">团体主体名称:</view> <view style="flex-shrink:0">团体主体名称:</view>

14
utils/filter.wxs

@ -52,9 +52,21 @@ var showAllSeldDate = function (date, index,today,tomorrow,afterTom) {
var toFix = function(value) { var toFix = function(value) {
return (value / 100).toFixed(2); 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 = { module.exports = {
formateRichText:formateRichText, formateRichText:formateRichText,
gotoUrl:gotoUrl, gotoUrl:gotoUrl,
toFix:toFix, toFix:toFix,
showAllSeldDate:showAllSeldDate showAllSeldDate:showAllSeldDate,
filterTag: filterTag
}; };
Loading…
Cancel
Save