|
@@ -44,7 +44,7 @@
|
|
|
<view class="title">演出日期</view>
|
|
|
<view class="date-list u-flex">
|
|
|
<view class="date-item" :class="{active:dateIndex==index}" @click="dateClick(index)" v-for="(date,index) in dateList" :key="index">
|
|
|
- <view class="name">{{ date.name }}</view>
|
|
|
+ <view class="name">{{ date.name || ' ' }}</view>
|
|
|
<view class="date">{{ date.month }} - {{ date.day }}</view>
|
|
|
</view>
|
|
|
<view class="date-item more-date u-flex u-row-center" @click="calendarShow = true">
|
|
@@ -124,6 +124,7 @@
|
|
|
</view>
|
|
|
<u-calendar
|
|
|
ref="calendar"
|
|
|
+ :formatter="formatter"
|
|
|
:maxDate="maxDate"
|
|
|
:show="calendarShow"
|
|
|
color="#EF1010"
|
|
@@ -167,6 +168,7 @@
|
|
|
month = month < 10 ? `0${month}` : month
|
|
|
const date = d.getDate()
|
|
|
// 日历
|
|
|
+ let parentThis= null;
|
|
|
export default {
|
|
|
mixins:[systemInfo],
|
|
|
data() {
|
|
@@ -195,12 +197,13 @@
|
|
|
posterSrc:'',
|
|
|
performInfo:{},//节目详情
|
|
|
formerNotice:{},//节目观影须知
|
|
|
-
|
|
|
+ ticketDay:[{day:'2023-12-05',ishave:false},{day:'2023-12-06',ishave:false},{day:'2023-12-07',ishave:true},{day:'2023-12-08',ishave:false}],//有票的日期
|
|
|
}
|
|
|
},
|
|
|
onShow() {
|
|
|
},
|
|
|
onLoad(page) {
|
|
|
+ parentThis = this;
|
|
|
console.log('page',page);
|
|
|
this.performId = page.id;
|
|
|
this.getPerformData();
|
|
@@ -211,6 +214,10 @@
|
|
|
this.getPerformerNotice();
|
|
|
|
|
|
},
|
|
|
+ onReady() {
|
|
|
+ // 如果需要兼容微信小程序的话,需要用此写法
|
|
|
+ this.$refs.calendar.setFormatter(this.formatter);
|
|
|
+ },
|
|
|
methods: {
|
|
|
leftClick(e){
|
|
|
let pages = getCurrentPages();
|
|
@@ -270,17 +277,34 @@
|
|
|
console.log('getPoster',err);
|
|
|
})
|
|
|
},
|
|
|
- setDate(firstDay){
|
|
|
+ formatter: (day) => {
|
|
|
+ // console.log('day',day);
|
|
|
+ // console.log('thisthisthisthisthisthisthisthisthis',parentThis);
|
|
|
+ // console.log('==================================',day.date.toISOString().split('T')[0]);
|
|
|
+ let ticket = parentThis.ticketDay.find(item => item.day === day.date.toISOString().split('T')[0]);
|
|
|
+ if(ticket&&ticket.ishave){
|
|
|
+ day.bottomInfo = '有票'
|
|
|
+ day.dot = true
|
|
|
+ }else if(ticket){
|
|
|
+ day.dot = true
|
|
|
+ }
|
|
|
+ return day
|
|
|
+ },
|
|
|
+ setDate(firstDay,isSelect){
|
|
|
+ if(this.ticketDay[0]&&!isSelect){
|
|
|
+ firstDay = new Date(this.ticketDay[0].day);
|
|
|
+ }
|
|
|
+ // console.log('this.dateListthis.dateListthis.dateListthis.dateList',this.dateList);
|
|
|
+ // 前端写演出日期(今天,明天,后天)
|
|
|
let today = firstDay;
|
|
|
let tomorrow = new Date();
|
|
|
tomorrow.setDate(today.getDate() + 1);
|
|
|
let afterTomorrow = new Date();
|
|
|
afterTomorrow.setDate(today.getDate() + 2);
|
|
|
-
|
|
|
this.dateList = [
|
|
|
- { year: today.getFullYear(), month: today.getMonth() + 1, day: today.getDate(),name:'今天' },
|
|
|
- { year: tomorrow.getFullYear(), month: tomorrow.getMonth() + 1, day: tomorrow.getDate() ,name:'明天'},
|
|
|
- { year: afterTomorrow.getFullYear(), month: afterTomorrow.getMonth() + 1, day: afterTomorrow.getDate(),name:'后天' }
|
|
|
+ { year: today.getFullYear(), month: today.getMonth() + 1, day: today.getDate(),name:'日期' },
|
|
|
+ { year: tomorrow.getFullYear(), month: tomorrow.getMonth() + 1, day: tomorrow.getDate() ,name:'日期'},
|
|
|
+ { year: afterTomorrow.getFullYear(), month: afterTomorrow.getMonth() + 1, day: afterTomorrow.getDate(),name:'日期' }
|
|
|
];
|
|
|
|
|
|
this.getTimes()
|
|
@@ -295,7 +319,7 @@
|
|
|
},
|
|
|
confirmCalendar(e){
|
|
|
// console.log('confirmCalendar',e);
|
|
|
- this.setDate( new Date(e) );
|
|
|
+ this.setDate( new Date(e),true );
|
|
|
this.dateIndex = 0;
|
|
|
// console.log('maxDate',this.maxDate);
|
|
|
// console.log('dateList',this.dateList);
|