From 4c50efb6dd65f24697e8a0feeddef91fb6bc866d Mon Sep 17 00:00:00 2001 From: shaojing <2901156235@qq.com> Date: Wed, 24 Apr 2024 16:51:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=97=A5=E5=8E=86=EF=BC=8C?= =?UTF-8?q?=E6=96=87=E6=97=85=E9=89=B4=E8=B5=8F=EF=BC=8C=E5=85=AC=E5=85=B1?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=EF=BC=8C=E4=BA=BA=E5=B7=A5=E5=AE=A2=E6=9C=8D?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=EF=BC=8C=E7=B2=BE=E5=BD=A9=E5=9B=9E=E9=A1=BE?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 2 +- pages/component/newCalendar/index.js | 164 ++++++++++++++++++++----- pages/component/newCalendar/index.wxml | 17 +-- pages/component/newCalendar/index.wxss | 19 ++- pages/index/index.wxml | 146 +++++++++++----------- pages/list/activitynew/index.js | 11 ++ pages/list/activitynew/index.wxml | 45 ++++--- pages/list/activitynew/index.wxss | 66 ++++++++-- pages/pbService/activity/index.js | 19 ++- pages/pbService/activity/index.wxml | 3 + pages/pbService/activity/index.wxss | 2 +- pages/pbService/index.wxml | 26 ++-- pages/user/service/list/index.wxml | 3 +- pages/user/user.wxml | 3 +- 14 files changed, 361 insertions(+), 165 deletions(-) diff --git a/app.js b/app.js index 845ff83..3c1f567 100644 --- a/app.js +++ b/app.js @@ -21,7 +21,7 @@ App({ unique_key: "wechatxcx" }).then(res => { let data = JSON.parse(res.data); - data.isTest = data.isTest111? true : false; + data.isTest = data.isTest112? true : false; this.globalData.configJson = data }).then(() => { // 获取ui配置文件 diff --git a/pages/component/newCalendar/index.js b/pages/component/newCalendar/index.js index 7473118..5bc7fe1 100644 --- a/pages/component/newCalendar/index.js +++ b/pages/component/newCalendar/index.js @@ -1,5 +1,6 @@ // components/xx-calendar/xx-calendar.js import calendarFormatter from "./xx_calendar"; +import commonApi from "../../../utils/https/common" Component({ /** * 组件的属性列表 @@ -26,7 +27,10 @@ Component({ nextMonthDays: [], //下一个月 weekDay:[], //周 日期list activeDateStr:'', // 当前日期, - currentViewType: 'week' //当前选中的是周还是月 + currentViewType: 'week', //当前选中的是周还是月 + holidayList:[], //节假日 + holidayList2:['2024/01/01','2024/02/10','2024/04/04', '2024/05/01', '2024/06/10','2024/09/17','2024/10/01'], // 节假日() + // lisClickNext: true, // 是否可以点下一周 }, /** @@ -40,7 +44,6 @@ Component({ /** 总方法 */ //创建日期 createDays(year, month) { - if( this.data.currentViewType === "month" ) { this.getLastMonthDays(year, month) this.getNowMonthDays(year, month) @@ -53,6 +56,9 @@ Component({ /** 视图收起/展开 */ toggleMode() { + if ((this.data.currentViewType === 'week' && this.data.weekDay.some(s => s.year === 2025)) || (this.data.currentViewType === 'week' && this.data.weekDay.some(s => s.year === 2023))) { + return + } this.setData({ currentViewType: this.data.currentViewType === "month" ? "week" : "month", }) @@ -124,18 +130,22 @@ Component({ } // 当前月数据 let festival = calendarFormatter.getFestival(timer) // 返回当前节假日名称, 不是节日返回 '工作日' + let realDate = new Date()  +                let realMonth = realDate.getMonth() + 1 + let _time = `${years}/${+months < 10 ? '0'+months : months}/${+day2 < 10 ? '0'+day2 :day2}` + console.log(this.data.holidayList2.includes(_time)) nowMonthDays.push({ date: i, //几号 week: this.data.weeksArr[new Date(year, month - 1, i).getDay()], //星期几 time, + _time, color: false, - day: ['工作日', '周末'].includes(festival) || festival.indexOf('补') > -1 ? newdate : festival, + day: newdate, // day: ['工作日', '周末'].includes(festival) || festival.indexOf('补') > -1 || [如果有不想展示的日期,放这里].includes(timer) ? newdate : festival, - - isNowMonthDay: (month == nowMonth && i == nowDay) ? "isNowMonthDay" : "", - isHoliday: calendarFormatter.isHoliday(timer), // 判断是否是休息日 是的话返回true, 不是的话返回false - - }); + isNowMonthDay: (month == realMonth && i == nowDay) ? "isNowMonthDay" : "", + isHoliday: this.data.holidayList.find(s => s.date == _time ), // 判断是否是休息日 是的话返回true, 不是的话返回false + holidayList2: this.data.holidayList2.includes(_time) + }); } this.data.use_date_arr.forEach(ele => { ele = ele.replace(/\-/g, "/") @@ -192,6 +202,9 @@ Component({ year = (parseInt(month) + 1) > 12 ? year + 1 : year month = (parseInt(month) + 1) > 12 ? 1 : parseInt(month) + 1 } + if (year != this.data.year) { + return + } this.setData({ year, month, @@ -200,23 +213,106 @@ Component({ }) this.createDays(year, month) } else { - let type = e.currentTarget.dataset.type //类型 - let newActiveDateStr = this.getActiveDateStrByWeek(this.data.activeDateStr, type) + let { + year, + month, + nowDay + } = this.data + let type = e.currentTarget.dataset.type //类型 + if ((type == 'next' && this.data.weekDay[0].year === 2025) || (type == 'prev' && this.data.weekDay[0].year === 2023)) { + return + } + // if (type == 'next' && this.data.weekDay[0].year === 2025) { + // // debugger + // return + // } + // let newActiveDateStr = this.getActiveDateStrByWeek(this.data.activeDateStr, type) + let newActiveDateStr = this.getActiveDateStrByWeek(this.data.weekDay[6].dateStr, type) + // debugger this.getWeekData(newActiveDateStr) - this.setData({ - activeDateStr: newActiveDateStr, - }) + console.log(this.data.weekDay); + // this.data.lisClickNext = this.data.weekDay.every(s => s.year == 2024) } }, - + + // 获取节假日 + getHoliday(){ + commonApi._post("pbservice/Actcalendar/getHoliday",{year:this.data.year}).then(res => { + // console.log(res); + this.setData({ + holidayList: res.data + }) +  this.data.holidayList = this.data.holidayList.map(item=> { + if (item.name == '清明节') { + return { +   ...item, + color:'#009EA3', +   background:'#DAF0EE' + } + }else if (item.name == '劳动节') { + return { +   ...item, + color:'#DE4126', +   background:'#FFECDB' + } + }else if (item.name == '春节') { + return { +   ...item, + color:'#D10000', +   background:'#FAE3E3' + } + }else if (item.name == '元旦') { + return { +   ...item, + color:'#EB3300', +   background:'#FFDED9' + } + }else if (item.name == '端午节') { + return { +   ...item, + color:'#0B8E3F', +   background:'#CEEDDB' + } + }else if (item.name == '国庆节') { + return { +   ...item, + color:'#D41E1E', +   background:'#FFE8E8' + } + }else if (item.name == '中秋节') { + return { +   ...item, + color:'#FF8E24', +   background:'#FFF3DB' + } + } else { + return { +   ...item, + color:'#fff', +   background:'#fff' + } + } + }) + console.log('------------------------------',this.data.holidayList); + let { + year, + month, + nowDay + } = this.data + this.setData({ + activeDateStr: `${year}/${month}/${nowDay}` + }) + this.createDays(year, month, nowDay) + }) + }, /** 获取周视图数据 */ getWeekData(defaultDate) { /** 是否是从周一开始 */ const isStartFromMonday = this.properties.startDay === "monday" if (!defaultDate) { defaultDate = this.data.activeDateStr - } + } const YEAR = new Date(defaultDate).getFullYear() const MONTH = new Date(defaultDate).getMonth() + 1 const DATE = new Date(defaultDate).getDate() @@ -231,7 +327,7 @@ Component({ let lastDay = new Date(YEAR, MONTH, 0) /** 当月最后一天是几号 */ let lastDate = lastDay.getDate() - +// debugger var ret = [] /** 前面有几天 */ let preCount = isStartFromMonday ? WEEK - 1 : WEEK @@ -272,19 +368,26 @@ Component({ month, nowDay } = this.data +  let realMonth =new Date().getMonth() + 1 // 当前周数据 let festival = calendarFormatter.getFestival(`${showYear}-${showMonth}-${showDate}`) // 返回当前节假日名称, 不是节日返回 '工作日' + // debugger ret.push({ year: showYear, month: showMonth, date: showDate, calDate: date, - day: ['工作日', '周末'].includes(festival) || festival.indexOf('补') > -1 ? newdate : festival, + day: newdate, dateStr: `${showYear}/${showMonth}/${showDate}`, - isNowMonthDay: (month == showMonth && nowDay == showDate) ? "isNowMonthDay" : "", - isHoliday: calendarFormatter.isHoliday(`${showYear}-${showMonth}-${showDate}`), // 判断是否是休息日 是的话返回true, 不是的话返回false + isNowMonthDay: ( realMonth  == showMonth && nowDay == showDate) ? "isNowMonthDay" : "", + isHoliday: this.data.holidayList.find(s => s.date === `${showYear}/${+showMonth < 10 ? '0'+showMonth : showMonth}/${+showDate < 10 ? '0'+showDate :showDate}` ), + holidayList2: this.data.holidayList2.includes(`${showYear}/${+showMonth < 10 ? '0'+showMonth : showMonth}/${+showDate < 10 ? '0'+showDate :showDate}` ) + // `${showYear}/${showMonth}/${showDate}` + // isHoliday: calendarFormatter.isHoliday(`${showYear}-${showMonth}-${showDate}`), // 判断是否是休息日 是的话返回true, 不是的话返回false }) - } + } + console.log(ret); + // debugger this.setData({ weekDay: ret, year: YEAR, @@ -335,8 +438,13 @@ Component({ selectDate(e){ let type = e.currentTarget.dataset.type //选择的时间类型 let index = e.currentTarget.dataset.index //选择的下标 - // let date = e.currentTarget.dataset.item.time //选择的下标 - let date = e.currentTarget.dataset.item.dateStr //选择的下标 + let date + if (this.data.currentViewType == 'week') { + date = e.currentTarget.dataset.item.dateStr //选择的下标 + type = 'weekDay' + } else { + date = e.currentTarget.dataset.item.time //选择的下标 + } let selectDate = date.replace(/\//g, "-") console.log("选择的时间", selectDate) // 自定义事件,父组件调用,回调 选择的时间selectDate @@ -345,6 +453,7 @@ Component({ this.data[type]?.forEach(item => { item.isNowMonthDay = '' }) + console.log(index,this.data,[type]); this.data[type]?.forEach((item, idx) => { if (index == idx) { item.isNowMonthDay = (item.time == new Date().toLocaleDateString() ? "isNowMonthDay" : "isNotNowMonthDay"); //判断当前选中的日期是否是当前时间 @@ -364,15 +473,8 @@ Component({ }, }, ready() { - let { - year, - month, - nowDay - } = this.data - this.setData({ - activeDateStr: `${year}/${month}/${nowDay}` - }) - this.createDays(year, month, nowDay) + this.getHoliday() + } }) \ No newline at end of file diff --git a/pages/component/newCalendar/index.wxml b/pages/component/newCalendar/index.wxml index 0f8b87b..4ee36f8 100644 --- a/pages/component/newCalendar/index.wxml +++ b/pages/component/newCalendar/index.wxml @@ -10,9 +10,9 @@ {{year}}年 {{month}}月 - + 下一月 - 下一周 + 下一周 @@ -32,14 +32,15 @@ - - - - {{item.date}} + + + + {{item.date}} - - {{item.day}} + + {{ item.isHoliday.name}} + {{ item.day}} diff --git a/pages/component/newCalendar/index.wxss b/pages/component/newCalendar/index.wxss index c1fabb5..4c61809 100644 --- a/pages/component/newCalendar/index.wxss +++ b/pages/component/newCalendar/index.wxss @@ -70,7 +70,7 @@ } .mouth-date .day-nongli{ font-size: 18rpx; - color: #888888; + /* color: #888888; */ margin-bottom: 6rpx; } .mouth-date .color{ @@ -93,11 +93,15 @@ padding-bottom: 8rpx; } .mouth-date .active{ - background-color: #0B898E; + background-color: #0B898E !important; } + + .mouth-date .active text{ - color: #fff; + color: #fff !important; } + + .mouth-date .active .day-text{ font-weight: 600; } @@ -114,6 +118,15 @@ position: relative; /* color: #e1856e; */ } +.holidayactive { + position: relative; +} +.day-text .xiu { + font-size: 6px; + position: absolute; + right: 5px; + top: 5px; +} .holiday .xiu { font-size: 6px; position: absolute; diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 9de722f..d96ad95 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -230,13 +230,85 @@ - + 非遗鉴赏 + + + + + 数字博物馆 + + + + + + 公共文化资源库 + + + + + + 云上文博会 + + + + + + 云上观展 + + + + + + 精彩回顾 + + + + + + 文旅单位 + + + + + + 书仓 + + + + + + 苏影通 + + + + + + 视觉中心 + - - - - - 数字博物馆 - - - - - - 云上文博会 - - - - - - 文旅单位 - - - - - - 书香借阅 - - - - - - 公共文化资源库 - - - - - - 苏影通 - - - - - - 云上观展 - - - - - - 精彩回顾 - - - - - - 视觉中心 - diff --git a/pages/list/activitynew/index.js b/pages/list/activitynew/index.js index e70edcf..381f693 100644 --- a/pages/list/activitynew/index.js +++ b/pages/list/activitynew/index.js @@ -82,6 +82,17 @@ Page({ }) }) }, + selectDate: function (e) { + console.log(e.detail); + this.setData({ + date: e.detail, + pageNo: 1, + list: [], + total: 1, + moreFlag: true + }) + this.getList() + }, changeType: function (e) { this.setData({ type: e.currentTarget.dataset.type, diff --git a/pages/list/activitynew/index.wxml b/pages/list/activitynew/index.wxml index 19edc3b..a32bb9e 100644 --- a/pages/list/activitynew/index.wxml +++ b/pages/list/activitynew/index.wxml @@ -1,20 +1,30 @@ + - - + 搜索 - + + 全部 + 景区活动 + 演出 + 展览 + 电影 + 文化惠民 + 其他 + + - + + @@ -89,22 +99,23 @@ 离我最近 价格最低 - - - + + + + {{item.name || item.title}} {{item.begin_date}}—{{item.end_date}} - {{item.detail_address?item.detail_address:""}} + {{item.from_platform}} + - 已结束 - {{item.from_platform}} + - + @@ -131,7 +142,7 @@ - + 暂无内容 diff --git a/pages/list/activitynew/index.wxss b/pages/list/activitynew/index.wxss index e2f4f27..1a91b9b 100644 --- a/pages/list/activitynew/index.wxss +++ b/pages/list/activitynew/index.wxss @@ -1,14 +1,14 @@ /* pages/activity/index.wxss */ page { - background: #fff; + background: #F2F2F2; } .types { /* justify-content: space-between; */ background: #fff; display: flex; color: #666; - width: 750rpx; + width: 697rpx; overflow-x: scroll; border-bottom: 1rpx solid #d8d8d8; font-size: 0; @@ -121,11 +121,18 @@ background: rgba(11, 137, 142, .1); } .top-fixed-box { background: #FFF; + width: 697rpx; + margin: 0 auto; + border-radius: 20rpx; + margin-top: 20rpx; } .activity-list { - padding: 0 24rpx; - background: #0B898E; + width: 697rpx; + /* padding: 0 24rpx; */ + /* background: #0B898E; */ + background: #FFFFFF; min-height:1300rpx; + margin: 0 auto; } .acitivity-search-box { display: flex; @@ -133,6 +140,7 @@ background: rgba(11, 137, 142, .1); margin-bottom: 0; justify-content: space-between; align-items: center; + padding-top: 30rpx; } .acitivity-search-box .picker { margin-right: 30rpx; @@ -188,13 +196,14 @@ background: rgba(11, 137, 142, .1); display: flex; align-items: center; justify-content: space-between; - padding: 27rpx 22rpx; + padding: 10rpx 22rpx; + /* padding: 27rpx 22rpx; */ position: relative; } .end-mask { position: absolute; right: 22rpx; - top: 27rpx; + /* top: 27rpx; */ text-align: center; width: 320rpx; height: 220rpx; @@ -228,17 +237,20 @@ background: rgba(11, 137, 142, .1); display: flex; flex-direction: column; justify-content: space-between; - font-size: 23rpx; - color: #999; + /* font-size: 23rpx; + color: #999; */ flex: 1; min-height: 220rpx; - margin-right: 28rpx; + /* margin-right: 28rpx; */ + font-size: 24rpx; + color: #666; } .activity-title { font-weight: 500; font-size: 31rpx; line-height: 45rpx; - color: #333; + color: #000; + /* color: #333; */ } .movie-types { @@ -318,4 +330,38 @@ flex-shrink: 0; padding: 6rpx 20rpx; border-radius: 40rpx; margin-left: 10rpx; +} +.types-box { + /* margin-top: 31rpx; */ + font-size: 28rpx; + color: #000; + font-weight: 500; + display: flex; + overflow-x: scroll; + padding: 31rpx 30rpx 30rpx; +} +.types-item { + border: 1px solid #999999; + border-radius: 27rpx; + height: 53rpx; + padding: 0 25rpx; + display: inline-block; + line-height: 53rpx; + margin-right: 13rpx; + flex-shrink: 0; +} +.types-item-active { + padding: 0 25rpx; + height: 57rpx; + line-height: 57rpx; + display: inline-block; + background: #0B898E; + color: #FFFFFF; + border-radius: 27rpx; + margin-right: 13rpx; + flex-shrink: 0; +} +/* 不显示滚动条 */ +.types-box::-webkit-scrollbar { + display: none; } \ No newline at end of file diff --git a/pages/pbService/activity/index.js b/pages/pbService/activity/index.js index ff44eab..9c9d916 100644 --- a/pages/pbService/activity/index.js +++ b/pages/pbService/activity/index.js @@ -10,10 +10,12 @@ Page({ list:[], page:1, total:1, - navList: [{title: '精彩2023', year: 2023}, {title: '往期回顾', year: 2022}], + navList: [{title: '精彩2024', year: 2024}, {title: '往期回顾', year: 2023}], navIndex: 0, sNavIndex:0, - sNavList:[{title: '回顾2022', year: 2022}, {title: '回顾2021', year: 2021}] + sNavList:[{title: '回顾2023', year: 2023},{title: '回顾2022', year: 2022}, {title: '回顾2021', year: 2021}], + last_page:0, + current_page:1 }, /** @@ -26,7 +28,8 @@ Page({ this.setData({ page:0, list:[], - navIndex:e.currentTarget.dataset.index + navIndex:e.currentTarget.dataset.index, + last_page:0 }) this.getList() }, @@ -34,12 +37,14 @@ Page({ this.setData({ page:0, list:[], - sNavIndex:e.currentTarget.dataset.index + sNavIndex:e.currentTarget.dataset.index, + last_page:0 }) this.getList() }, getList:function(){ - if(this.data.list.length>=this.data.total) return; + // if(this.data.list.length>=this.data.total) return; + if(this.data.current_page == this.data.last_page) return; https._post("review/getList",{ limit:10, page:this.data.page, @@ -48,7 +53,9 @@ Page({ this.setData({ total:res.data.total, list:this.data.list.concat(res.data.data), - page:this.data.page+1 + page:this.data.page+1, + last_page:res.data.last_page, + current_page: res.data.current_page }) }) }, diff --git a/pages/pbService/activity/index.wxml b/pages/pbService/activity/index.wxml index 13cb93c..74bb0a7 100644 --- a/pages/pbService/activity/index.wxml +++ b/pages/pbService/activity/index.wxml @@ -19,3 +19,6 @@ + + 没有更多了 + diff --git a/pages/pbService/activity/index.wxss b/pages/pbService/activity/index.wxss index 55e544c..00f42f3 100644 --- a/pages/pbService/activity/index.wxss +++ b/pages/pbService/activity/index.wxss @@ -73,7 +73,7 @@ page { display: flex; align-items: center; justify-content: space-between; - padding: 0 122rpx; + padding: 0 42rpx; margin-top: 45rpx; } .s_item{ diff --git a/pages/pbService/index.wxml b/pages/pbService/index.wxml index d92ec0e..78cdec0 100644 --- a/pages/pbService/index.wxml +++ b/pages/pbService/index.wxml @@ -9,10 +9,10 @@ 苏康码 --> - - - 安全服务 + + + 景区舒适度 @@ -24,10 +24,10 @@ 找厕所 - - - 景区舒适度 + + + 安全服务 即将跳转人工在线客服 - 客服服务时间:08:30-17:30 + 客服服务时间:8:30-11:30, + 13:00-17:30 如遇紧急情况可拨打 0512-66555111 即将跳转人工客服 - 客服服务时间:08:30-17:30 + 客服服务时间:08:30-17:30, + 13:00-17:30