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. 22
      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:else src="https://static.ticket.sz-trip.com/uploads/20240327/d23c7a3d743e4fb9623c534adf10760b.png" mode=""/>
</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>

8
pages/component/newCalendar/index.wxss

@ -8,11 +8,13 @@
/* width: 697rpx; */
/* margin: 0 auto;
padding: 37rpx 22rpx 40rpx; */
background-color: #FFD6B2;
/* 节假日花样 */
/* background-color: #FFD6B2; */
margin: 0 auto;
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%;
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>
<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;">
<!-- <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>
<view>高峰预警</view>
<view>景区舒适度</view>
</view>
<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;">

3
pages/list/activitynew/index.wxml

@ -3,7 +3,8 @@
<!-- <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>
<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">
<picker mode="selector" value="{{area}}" range="{{areas}}" range-key="area_name" bindchange="changeArea" wx:if="{{type!=4}}">
<view class="picker">

25
pages/list/activitynew/index.wxss

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

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

@ -36,7 +36,10 @@ Component({
isSzMuseum: false,
kjIdCom: 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: {
attached: function () {

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

@ -4,7 +4,7 @@
<view class="box-title">使用日期</view>
<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>{{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: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> -->

22
utils/filter.wxs

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

17
utils/util.js

@ -16,6 +16,19 @@ const formatDate = date => {
const day = date.getDate()
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 => {
n = n.toString()
@ -444,5 +457,7 @@ module.exports = {
gotoOrder:gotoOrder,
orderMoreTime:orderMoreTime,
goKjOrder:goKjOrder,
pagePoint: pagePoint
pagePoint: pagePoint,
formatMing:formatMing,
formatHou:formatHou
}

Loading…
Cancel
Save