diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 2c55a1c..ea3a3db 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -241,9 +241,9 @@ 博物馆查询 - + - 团队预约 + 团体预约 diff --git a/pages/info/museumInfo/index.js b/pages/info/museumInfo/index.js index 33ef036..6d78047 100644 --- a/pages/info/museumInfo/index.js +++ b/pages/info/museumInfo/index.js @@ -409,7 +409,8 @@ Page({ sku: this.data.info.product_venue.sku[0], infoDate: this.data.date, infoTime: this.data.time, - isGroup: this.data.isGroup + isGroup: this.data.isGroup, + isTeam: this.data.info.team_order } wx.navigateTo({ url: '/pages/order/scene/index?type=museum' diff --git a/pages/info/museumInfo/index.wxml b/pages/info/museumInfo/index.wxml index e7bafd6..c34659b 100644 --- a/pages/info/museumInfo/index.wxml +++ b/pages/info/museumInfo/index.wxml @@ -1,20 +1,28 @@ - + + - + + {{info.title}}(团体预约) - + + {{info.title}} {{info.address}} {{info.tel}} + + + {{info.address}} + {{info.tel}} + 场馆介绍 场馆活动 @@ -22,7 +30,8 @@ - + 预订须知 场馆介绍 @@ -43,12 +52,13 @@ 暂无活动 - + - 参观预约 + 参观预约 - + @@ -59,15 +69,22 @@ 保存到相册 diff --git a/pages/info/museumInfo/index.wxss b/pages/info/museumInfo/index.wxss index f22fea6..9e55f09 100644 --- a/pages/info/museumInfo/index.wxss +++ b/pages/info/museumInfo/index.wxss @@ -1,9 +1,23 @@ /* pages/info/museumInfo/index.wxss */ -.swiper,.swiper image { +.swiper, +.swiper image { width: 100%; height: 330rpx; display: block; } + +.swiper { + position: relative; +} + +.swiper .title { + position: absolute; + left: 30rpx; + bottom: 20rpx; + box-sizing: border-box; + color: #FFFFFF; +} + .info { margin: 0 25rpx; margin-top: -30rpx; @@ -14,20 +28,24 @@ border-radius: 13rpx; padding: 30rpx; } + .info .title { font-size: 31rpx; color: #000; margin-bottom: 20rpx; } + .info .location { color: #999999; font-size: 24rpx; margin-bottom: 20rpx; } + .info .location .iconfont { margin-right: 10rpx; font-size: 26rpx; } + .detail-title { font-weight: 500; font-size: 35rpx; @@ -35,10 +53,12 @@ margin: 26rpx; margin-top: 45rpx; } + .detail { display: block; padding: 26rpx; } + .fixed-btn { position: fixed; left: 0; @@ -51,6 +71,7 @@ align-items: center; justify-content: center; } + .fixed-btn .btn { width: 391rpx; line-height: 73rpx; @@ -61,6 +82,16 @@ font-size: 31rpx; font-weight: 500; } + +.fixed-btn .btn.team { + width: 100%; + box-sizing: border-box; + height: 100%; + line-height: 104rpx; + background-color: #0B898E; + border-radius: 0; +} + .menu-box { display: flex; align-items: center; @@ -68,28 +99,32 @@ height: 100rpx; border-bottom: 1rpx solid #CCCCCC; } + .menu-item { font-size: 35rpx; line-height: 100rpx; position: relative; } + .menu-item.active { font-size: 37rpx; font-weight: bold; } + .menu-item.active::after { - content:"!"; + content: "!"; font-size: 0; display: block; position: absolute; width: 66rpx; height: 7rpx; background: #0B898E; - border-radius: 3rpx; + border-radius: 3rpx; left: 50%; margin-left: -33rpx; top: 93rpx; } + .activity-item { display: flex; background: #F4F4F4; @@ -101,6 +136,7 @@ position: relative; justify-content: space-between; } + .end-box { position: absolute; right: 22rpx; @@ -114,16 +150,19 @@ color: #fff; font-size: 36rpx; } + .activity-item .textOver2 { font-size: 31rpx; color: #333; } + .activity-info { display: flex; height: 193rpx; flex-direction: column; justify-content: space-between; } + .activity-item image { flex-shrink: 0; display: block; @@ -131,13 +170,15 @@ height: 193rpx; margin-left: 15rpx; } + .activity-info .textOver { margin-bottom: 10rpx; } + .menu-fixed { position: fixed; left: 0; - background:white; + background: white; right: 0; } @@ -148,6 +189,7 @@ bottom: 0; width: 100%; } + .mask-content .icon-close { position: absolute; right: 40rpx; @@ -163,10 +205,12 @@ align-items: center; justify-content: center; } + .share-img { display: block; width: 551rpx; } + .share-tips { width: 426rpx; height: 150rpx; @@ -182,12 +226,14 @@ text-align: center; line-height: 40rpx; } + .share-tips .img { display: block; width: 55rpx; margin: 0 auto; margin-bottom: 4rpx; } + .tipimg { position: absolute; left: 50%; @@ -201,11 +247,13 @@ justify-content: center; top: 34rpx; } + .tipimg image { width: 21rpx; display: block; - + } + .save-btn { width: 403rpx; line-height: 77rpx; @@ -216,4 +264,25 @@ font-size: 31rpx; font-weight: 500; margin-top: 50rpx; +} + +.team_info { + position: relative; + z-index: 1; + background: #FFFFFF; + box-shadow: 0px 0px 16rpx 0px rgba(6, 0, 1, 0.1); + border-radius: 13rpx; + padding: 30rpx; +} + +.team_info .location { + color: #666666; + font-size: 24rpx; + margin-bottom: 20rpx; +} + +.team_info .location .iconfont { + margin-right: 10rpx; + font-size: 26rpx; + color: #0B898E; } \ No newline at end of file diff --git a/pages/order/components/date/index.js b/pages/order/components/date/index.js index d5e9f41..902fe26 100644 --- a/pages/order/components/date/index.js +++ b/pages/order/components/date/index.js @@ -11,9 +11,14 @@ Component({ addGlobalClass: true }, properties: { - product:{ - type:Object, - default:{} + product: { + type: Object, + default: {} + }, + // 是否是团体预约的场馆 + isTeam: { + type: Number, + default: 0 } }, @@ -21,97 +26,97 @@ Component({ * 组件的初始数据 */ data: { - threeDays:[], - activeDate:"", - datelist:[], - showMoreDateFlag:false, - moreFlag:true, - timelist:[], - timeIndex:0, - isSzMuseum:false, - kjIdCom:null, - gpIdCom:null + threeDays: [], + activeDate: "", + datelist: [], + showMoreDateFlag: false, + moreFlag: true, + timelist: [], + timeIndex: 0, + isSzMuseum: false, + kjIdCom: null, + gpIdCom: null }, lifetimes: { - attached: function() { + attached: function () { this.setData({ - kjIdCom:app.globalData.kjId, - gpIdCom:app.globalData.gp_id || app.globalData.team_id + kjIdCom: app.globalData.kjId, + gpIdCom: app.globalData.gp_id || app.globalData.team_id }) // 在组件实例进入页面节点树时执行 - let product = app.globalData.product,today = util.formatDate(new Date()),end_date = util.formatDate(new Date(new Date().getTime() + 60 * 24 * 60 * 60 * 1000)); - if(product.product.title.indexOf("苏州博物馆")!=-1){ + let product = app.globalData.product, today = util.formatDate(new Date()), end_date = util.formatDate(new Date(new Date().getTime() + 60 * 24 * 60 * 60 * 1000)); + if (product.product.title.indexOf("苏州博物馆") != -1) { this.setData({ - isSzMuseum:true + isSzMuseum: true }) } - commonApi.user_post("token/check").then(res=>{ - if(res.code==1){ + commonApi.user_post("token/check").then(res => { + if (res.code == 1) { // 获取价格日历 - commonApi.user_post("product/product_date_price",{ - start_date:today, - end_date:end_date, - sku_id:product.sku.id - }).then(res=>{ + commonApi.user_post("product/product_date_price", { + start_date: today, + end_date: end_date, + sku_id: product.sku.id + }).then(res => { // 如果之前已经在详情页面选择了日期的话 默认日期不能是第一个有库存的日期了 - if(app.globalData.product.infoDate){ - let dateIndex = res.data.slice(0,3).findIndex(item=>item.date==app.globalData.product.infoDate.date) + if (app.globalData.product.infoDate) { + let dateIndex = res.data.slice(0, 3).findIndex(item => item.date == app.globalData.product.infoDate.date) // if(!app.globalData.product.infoDate.short_date){ // app.globalData.product.infoDate.short_date = app.globalData.product.infoDate.date.split("-").splice(1,2).join("-") // } this.setData({ - activeDate:app.globalData.product.infoDate, - moreFlag:dateIndex!=-1 + activeDate: app.globalData.product.infoDate, + moreFlag: dateIndex != -1 }) this.getTimeStock() - this.triggerEvent("onChangeDate",app.globalData.product.infoDate) + this.triggerEvent("onChangeDate", app.globalData.product.infoDate) } else { - for(let i=0;i0){ - res.data[i].short_date = res.data[i].date.split("-").splice(1,2).join("-") + for (let i = 0; i < res.data.length; i++) { + if (res.data[i].stock > 0) { + res.data[i].short_date = res.data[i].date.split("-").splice(1, 2).join("-") this.setData({ - activeDate:res.data[i] + activeDate: res.data[i] }) this.getTimeStock() - this.triggerEvent("onChangeDate",this.data.activeDate) + this.triggerEvent("onChangeDate", this.data.activeDate) break; } } } - if(this.data.gpIdCom){ + if (this.data.gpIdCom) { // 拼团的话 价格日历无效 所有价格都是sku里面的event_price - res.data.map(item=>{ + res.data.map(item => { item.price = product.sku.event_price }) } - + this.setData({ - datelist:res.data + datelist: res.data }) - + this.setData({ - threeDays:res.data.slice(0,3) + threeDays: res.data.slice(0, 3) }) - let index = this.data.threeDays.findIndex(item=>item.date==this.data.activeDate.date) + let index = this.data.threeDays.findIndex(item => item.date == this.data.activeDate.date) this.setData({ - moreFlag:index!=-1 + moreFlag: index != -1 }) console.log(res) }) } }) - + }, - detached: function() { + detached: function () { // 在组件实例被从页面节点树移除时执行 }, }, - pageLifetimes:{ - show:function(){ + pageLifetimes: { + show: function () { this.setData({ - kjIdCom:app.globalData.kjId, - gpIdCom:app.globalData.gp_id || app.globalData.team_id + kjIdCom: app.globalData.kjId, + gpIdCom: app.globalData.gp_id || app.globalData.team_id }) } }, @@ -119,82 +124,82 @@ Component({ * 组件的方法列表 */ methods: { - showMoreDate:function(){ + showMoreDate: function () { this.setData({ - showMoreDateFlag:true + showMoreDateFlag: true }) }, - hideCalendar:function(){ + hideCalendar: function () { this.setData({ - showMoreDateFlag:false + showMoreDateFlag: false }) }, - changeDate:function(e){ + changeDate: function (e) { let date = e.currentTarget.dataset.date; - if(date.stock<=0) return; - if(date.stock==null) return; - if(date.price==null) return; + if (date.stock <= 0) return; + if (date.stock == null) return; + if (date.price == null) return; this.setData({ - activeDate:date, - moreFlag:true + activeDate: date, + moreFlag: true }) - this.triggerEvent("onChangeDate",this.data.activeDate) + this.triggerEvent("onChangeDate", this.data.activeDate) this.getTimeStock() }, // 修改日期 - onTapDay:function(e){ - let threeDays = this.data.threeDays,flag=false; - threeDays.map(item=>{ - if(item.date==e.detail.date){ + onTapDay: function (e) { + let threeDays = this.data.threeDays, flag = false; + threeDays.map(item => { + if (item.date == e.detail.date) { flag = true } }) - e.detail.short_date = e.detail.date.substr(5,5); + e.detail.short_date = e.detail.date.substr(5, 5); this.setData({ - activeDate:e.detail, - showMoreDateFlag:false, - moreFlag:flag + activeDate: e.detail, + showMoreDateFlag: false, + moreFlag: flag }) - this.triggerEvent("onChangeDate",this.data.activeDate) + this.triggerEvent("onChangeDate", this.data.activeDate) this.getTimeStock() }, - getTimeStock:function(){ - if(this.data.activeDate.is_time_stock!=true) return; - commonApi.user_post("product/product_timestock_price",{ - date:this.data.activeDate.date, - sku_id:this.data.activeDate.sku_id?this.data.activeDate.sku_id:app.globalData.product.sku.id - }).then(res=>{ + getTimeStock: function () { + if (this.data.activeDate.is_time_stock != true) return; + commonApi.user_post("product/product_timestock_price", { + date: this.data.activeDate.date, + sku_id: this.data.activeDate.sku_id ? this.data.activeDate.sku_id : app.globalData.product.sku.id + }).then(res => { let timeIndex = -1; - if(app.globalData.product.infoTime){ - this.triggerEvent("onChangeTime",app.globalData.product.infoTime); - timeIndex = res.data.findIndex(item=>item.start_time==app.globalData.product.infoTime.start_time) + if (app.globalData.product.infoTime) { + this.triggerEvent("onChangeTime", app.globalData.product.infoTime); + timeIndex = res.data.findIndex(item => item.start_time == app.globalData.product.infoTime.start_time) this.setData({ - timelist:res.data, - timeIndex:timeIndex + timelist: res.data, + timeIndex: timeIndex }) return; } - for(let i=0;i0){ + for (let i = 0; i < res.data.length; i++) { + if (res.data[i].stock_number > 0) { timeIndex = i; break; } } this.setData({ - timelist:res.data, - timeIndex:timeIndex + timelist: res.data, + timeIndex: timeIndex }) - this.triggerEvent("onChangeTime",this.data.timelist[this.data.timeIndex]) + this.triggerEvent("onChangeTime", this.data.timelist[this.data.timeIndex]) }) }, - selectTime:function(e){ - if(this.data.timelist[e.currentTarget.dataset.index].stock_number!=0){ + selectTime: function (e) { + if (this.data.timelist[e.currentTarget.dataset.index].stock_number != 0) { this.setData({ - timeIndex:e.currentTarget.dataset.index + timeIndex: e.currentTarget.dataset.index }) - this.triggerEvent("onChangeTime",this.data.timelist[this.data.timeIndex]) + this.triggerEvent("onChangeTime", this.data.timelist[this.data.timeIndex]) } - + } } }) diff --git a/pages/order/components/date/index.wxml b/pages/order/components/date/index.wxml index 6db7808..a3c9f45 100644 --- a/pages/order/components/date/index.wxml +++ b/pages/order/components/date/index.wxml @@ -4,7 +4,7 @@ {{item.date}} - {{item.price==0 || kjIdCom?'免费':('¥'+item.price/100)}} + {{item.price==0 || kjIdCom?'免费':('¥'+item.price/100)}} 售罄 diff --git a/pages/pbService/group/index.wxml b/pages/pbService/group/index.wxml index 56f08eb..78d5528 100644 --- a/pages/pbService/group/index.wxml +++ b/pages/pbService/group/index.wxml @@ -11,7 +11,7 @@ - {{item.title}} + {{item.title}}(团体预约) 电话:{{item.tel}} {{item.address}} diff --git a/project.private.config.json b/project.private.config.json index df272a0..8a0affc 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -61,8 +61,8 @@ "scene": null }, { - "name": "我的", - "pathName": "pages/user/user", + "name": "团体预约场馆", + "pathName": "pages/pbService/group/index", "query": "", "scene": null }