Browse Source

日期展示调整,活动日历日常版

master
shaojing 2 years ago
parent
commit
04f341cfce
  1. 3
      pages/component/newCalendar/index.wxml
  2. 8
      pages/component/newCalendar/index.wxss
  3. 4
      pages/index/index.wxml
  4. 3
      pages/list/activitynew/index.wxml
  5. 25
      pages/list/activitynew/index.wxss
  6. 5
      pages/order/components/date/index.js
  7. 2
      pages/order/components/date/index.wxml
  8. 30
      utils/filter.wxs
  9. 17
      utils/util.js

3
pages/component/newCalendar/index.wxml

@ -57,7 +57,8 @@
<image wx:if="{{currentViewType==='week'}}" src="https://static.ticket.sz-trip.com/uploads/20240327/8b5f8a284de3831392560c367f8c59ca.png" mode=""/> <image wx:if="{{currentViewType==='week'}}" src="https://static.ticket.sz-trip.com/uploads/20240327/8b5f8a284de3831392560c367f8c59ca.png" mode=""/>
<image wx:else src="https://static.ticket.sz-trip.com/uploads/20240327/d23c7a3d743e4fb9623c534adf10760b.png" mode=""/> <image wx:else src="https://static.ticket.sz-trip.com/uploads/20240327/d23c7a3d743e4fb9623c534adf10760b.png" mode=""/>
</view> </view>
<image wx:if="{{currentViewType==='month'}}" style="width: 180rpx;height: 157.33rpx;position: absolute;right: 0;bottom: 0;" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/calendar-bottom.png" mode=""/> <!-- 节假日花样 -->
<!-- <image wx:if="{{currentViewType==='month'}}" style="width: 180rpx;height: 157.33rpx;position: absolute;right: 0;bottom: 0;" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/calendar-bottom.png" mode=""/> -->
</view> </view>

8
pages/component/newCalendar/index.wxss

@ -8,11 +8,13 @@
/* width: 697rpx; */ /* width: 697rpx; */
/* margin: 0 auto; /* margin: 0 auto;
padding: 37rpx 22rpx 40rpx; */ padding: 37rpx 22rpx 40rpx; */
background-color: #FFD6B2; /* 节假日花样 */
/* background-color: #FFD6B2; */
margin: 0 auto; margin: 0 auto;
padding: 37rpx 22rpx 40rpx; padding: 37rpx 22rpx 40rpx;
background-image: url("https://static.ticket.sz-trip.com/jundaosuzhou/images/calendar-top.png"); /* 节假日花样 */
background-size: 100% 100%; /* background-image: url("https://static.ticket.sz-trip.com/jundaosuzhou/images/calendar-top.png");
background-size: 100% 100%; */
width: 90%; width: 90%;
height: 65.67rpx height: 65.67rpx
} }

4
pages/index/index.wxml

@ -458,12 +458,12 @@
<image src="https://static.ticket.sz-trip.com/uploads/20240428/be9d01a4552438a93681b1e6b3c1c783.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/uploads/20240428/be9d01a4552438a93681b1e6b3c1c783.png" mode="widthFix"></image>
<view>安全服务</view> <view>安全服务</view>
</view> </view>
<view bindtap="gotoUrl" data-event="comfort_click" data-title="高峰预警" <view bindtap="gotoUrl" data-event="comfort_click" data-title="景区舒适度"
data-url="https://m.cloud.sz-trip.com/ScenicComfort" class="pbservice-item ggfw" style="margin-right: 32.33rpx;"> data-url="https://m.cloud.sz-trip.com/ScenicComfort" class="pbservice-item ggfw" style="margin-right: 32.33rpx;">
<!-- <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb4.png" mode="widthFix"></image> --> <!-- <image src="https://static.ticket.sz-trip.com/xcxImages/pbservice/pb4.png" mode="widthFix"></image> -->
<!-- 元旦修改 --> <!-- 元旦修改 -->
<image src="https://static.ticket.sz-trip.com/uploads/20240428/9ad72c94d55ef5c94f942b8c91e63f83.png" mode="widthFix"></image> <image src="https://static.ticket.sz-trip.com/uploads/20240428/9ad72c94d55ef5c94f942b8c91e63f83.png" mode="widthFix"></image>
<view>高峰预警</view> <view>景区舒适度</view>
</view> </view>
<view bindtap="gotoUrl" data-event="xlqc" <view bindtap="gotoUrl" data-event="xlqc"
data-url="https://weixin.2500sz.net/zt/2023/07/luggage_storage/" class="pbservice-item ggfw" style="margin-right: 32.33rpx;"> data-url="https://weixin.2500sz.net/zt/2023/07/luggage_storage/" class="pbservice-item ggfw" style="margin-right: 32.33rpx;">

3
pages/list/activitynew/index.wxml

@ -3,7 +3,8 @@
<!-- <image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/calendar-top.png" mode=""/> --> <!-- <image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/calendar-top.png" mode=""/> -->
<new-calendar wx:if="{{type!=4}}" bind:selectDate="selectDate"></new-calendar> <new-calendar wx:if="{{type!=4}}" bind:selectDate="selectDate"></new-calendar>
<view class="top-fixed-box"> <view class="top-fixed-box">
<image class="bg-pic" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/calendar-center.png" mode="widthFix"/> <!-- 节假日花样 -->
<!-- <image class="bg-pic" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/calendar-center.png" mode="widthFix"/> -->
<view class="acitivity-search-box"> <view class="acitivity-search-box">
<picker mode="selector" value="{{area}}" range="{{areas}}" range-key="area_name" bindchange="changeArea" wx:if="{{type!=4}}"> <picker mode="selector" value="{{area}}" range="{{areas}}" range-key="area_name" bindchange="changeArea" wx:if="{{type!=4}}">
<view class="picker"> <view class="picker">

25
pages/list/activitynew/index.wxss

@ -1,8 +1,9 @@
/* pages/activity/index.wxss */ /* pages/activity/index.wxss */
page { page {
/* background: #F2F2F2; */ background: #F2F2F2;
background: #FFD6B2; /* 节假日花样 */
/* background: #FFD6B2; */
} }
.types { .types {
/* justify-content: space-between; */ /* justify-content: space-between; */
@ -204,7 +205,7 @@ background: rgba(11, 137, 142, .1);
} }
.end-mask { .end-mask {
position: absolute; position: absolute;
right: 22rpx; right: 30rpx;
/* top: 27rpx; */ /* top: 27rpx; */
text-align: center; text-align: center;
width: 320rpx; width: 320rpx;
@ -319,7 +320,9 @@ background: rgba(11, 137, 142, .1);
flex-shrink: 0; flex-shrink: 0;
line-height: 40rpx; line-height: 40rpx;
border-left: 1rpx solid #ccc; border-left: 1rpx solid #ccc;
color: #DE4126; color: #0B898E;
/* 节假日花样 */
/* color: #DE4126; */
} }
.new-top-search-box { .new-top-search-box {
display: flex; display: flex;
@ -355,18 +358,20 @@ flex-shrink: 0;
} }
.types-item-active { .types-item-active {
padding: 0 25rpx; padding: 0 25rpx;
/* height: 57rpx; */ height: 57rpx;
height: 68rpx; /* 节假日花样 */
line-height: 58rpx; /* height: 68rpx; */
line-height: 57rpx;
display: inline-block; display: inline-block;
/* background: #0B898E; */ background: #0B898E;
color: #FFFFFF; color: #FFFFFF;
border-radius: 27rpx; border-radius: 27rpx;
margin-right: 13rpx; margin-right: 13rpx;
flex-shrink: 0; flex-shrink: 0;
background-image: url("https://static.ticket.sz-trip.com/jundaosuzhou/images/calendar-bg.png"); /* 节假日花样 */
/* background-image: url("https://static.ticket.sz-trip.com/jundaosuzhou/images/calendar-bg.png");
background-size: 100% 100%; background-size: 100% 100%;
margin-top: -5rpx; margin-top: -5rpx; */
text-align: center; text-align: center;
} }
/* 不显示滚动条 */ /* 不显示滚动条 */

5
pages/order/components/date/index.js

@ -36,7 +36,10 @@ Component({
isSzMuseum: false, isSzMuseum: false,
kjIdCom: null, kjIdCom: null,
gpIdCom: null, gpIdCom: null,
date_price:0 date_price:0,
today:util.formatDate(new Date()),
tomorrow:util.formatMing(new Date()),
afterTom:util.formatHou(new Date()),
}, },
lifetimes: { lifetimes: {
attached: function () { attached: function () {

2
pages/order/components/date/index.wxml

@ -4,7 +4,7 @@
<view class="box-title">使用日期</view> <view class="box-title">使用日期</view>
<view class="dates-boxes"> <view class="dates-boxes">
<view bindtap="changeDate" data-date="{{item}}" class="date-item{{activeDate.date==item.date?' active':''}}{{(item.stock<=0 || item.stock==null || item.price==null)?' disable':''}}" wx:for-index="index" wx:for="{{threeDays}}"> <view bindtap="changeDate" data-date="{{item}}" class="date-item{{activeDate.date==item.date?' active':''}}{{(item.stock<=0 || item.stock==null || item.price==null)?' disable':''}}" wx:for-index="index" wx:for="{{threeDays}}">
<view>{{tool.showAllSeldDate(item.date,index)}}</view> <view>{{tool.showAllSeldDate(item.date,index,today,tomorrow,afterTom)}}</view>
<view class="price" wx:if="{{ !isTeam && item.stock==-1 || item.stock==null}}">不可定</view> <view class="price" wx:if="{{ !isTeam && item.stock==-1 || item.stock==null}}">不可定</view>
<view class="price" wx:elif="{{ !isTeam && item.stock!=0 && item.stock!=null && item.price!=null}}">{{item.price==0 || kjIdCom?'免费':('¥'+item.price/100)}}</view> <view class="price" wx:elif="{{ !isTeam && item.stock!=0 && item.stock!=null && item.price!=null}}">{{item.price==0 || kjIdCom?'免费':('¥'+item.price/100)}}</view>
<!-- <view class="price" wx:if="{{item.stock==null || item.price==null}}">不可定</view> --> <!-- <view class="price" wx:if="{{item.stock==null || item.price==null}}">不可定</view> -->

30
utils/filter.wxs

@ -26,18 +26,28 @@ var gotoUrl = function(item){
return str; return str;
} }
// 价格日历显示返回 // 价格日历显示返回
var showAllSeldDate = function (date, index) { var showAllSeldDate = function (date, index,today,tomorrow,afterTom) {
// return date.substring(5, 10) // return date.substring(5, 10)
switch (index) { console.log('tool的',date,today,tomorrow,afterTom);
case 0: if (date == today) {
return '今天' + date.substring(5, 10) return '今天' + date.substring(5, 10)
case 1: }else if (date == tomorrow) {
return '明天' + date.substring(5, 10) return '明天' + date.substring(5, 10)
case 2: }else if (date == afterTom) {
return '后天' + date.substring(5, 10) return '后天' + date.substring(5, 10)
default: }else {
return date.substring(5, 10) return date.substring(5, 10)
} }
// switch (index) {
// case 0:
// return '今天' + date.substring(5, 10)
// case 1:
// return '明天' + date.substring(5, 10)
// case 2:
// return '后天' + date.substring(5, 10)
// default:
// return date.substring(5, 10)
// }
} }
var toFix = function(value) { var toFix = function(value) {
return (value / 100).toFixed(2); return (value / 100).toFixed(2);

17
utils/util.js

@ -16,6 +16,19 @@ const formatDate = date => {
const day = date.getDate() const day = date.getDate()
return [year, month, day].map(formatNumber).join('-'); return [year, month, day].map(formatNumber).join('-');
} }
const formatMing = date => {
var tomorrow = new Date(date.getTime() + 24 * 60 * 60 * 1000) // 获取明天的日期
var tomorrowDate = tomorrow.getDate(); // 获取明天的日期数字
var tomorrowMonth = tomorrow.getMonth() + 1; // 获取明天的月份(注意:月份是从0开始计算的,所以要加1)
var tomorrowYear = tomorrow.getFullYear();
return [tomorrowYear, tomorrowMonth, tomorrowDate].map(formatNumber).join('-');
}
const formatHou= date => {
date.setDate(date.getDate() + 2);
// 格式化日期为YYYY-MM-DD
var houtian = date.getFullYear() + '-' + ('0' + (date.getMonth() + 1)).slice(-2) + '-' + ('0' + date.getDate()).slice(-2);
return houtian
}
const formatNumber = n => { const formatNumber = n => {
n = n.toString() n = n.toString()
@ -444,5 +457,7 @@ module.exports = {
gotoOrder:gotoOrder, gotoOrder:gotoOrder,
orderMoreTime:orderMoreTime, orderMoreTime:orderMoreTime,
goKjOrder:goKjOrder, goKjOrder:goKjOrder,
pagePoint: pagePoint pagePoint: pagePoint,
formatMing:formatMing,
formatHou:formatHou
} }

Loading…
Cancel
Save