diff --git a/pages/info/museumInfo/index.js b/pages/info/museumInfo/index.js index 727eac6..884cb27 100644 --- a/pages/info/museumInfo/index.js +++ b/pages/info/museumInfo/index.js @@ -1,19 +1,32 @@ // pages/info/museumInfo/index.js import commonApi from "../../../utils/https/common" let app = getApp() +let device = wx.getSystemInfoSync(); +const ratio = device.windowWidth / 750; +let rect = wx.getMenuButtonBoundingClientRect(); +let height = (rect.top - device.statusBarHeight) * 2 + rect.height + device.statusBarHeight; Page({ /** * 页面的初始数据 */ data: { - info:null + top:height, + info:null, + type:1, + actList:[], + actTotal:1, + id:null, + fixed:false }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { + this.setData({ + id:options.id + }) commonApi._post("scene/detail_for_venue",{ id:options.id }).then(res=>{ @@ -23,6 +36,26 @@ Page({ }) this.BroswerRecord(); }) + this.getAct() + }, + getAct:function(){ + if(this.data.actList.length>=this.data.actTotal) return; + commonApi._post('scene/get_scene_act_list',{ + scene_id:this.data.id, + page_no:1, + page_num:100 + }).then(res=>{ + this.setData({ + actList:this.data.actList.concat(res.data.rows), + actTotal:res.data.total + }) + console.log(res) + }) + }, + changeType:function(e){ + this.setData({ + type:e.currentTarget.dataset.type + }) }, BroswerRecord:function(){ setTimeout(()=>{ @@ -94,7 +127,7 @@ Page({ * 页面上拉触底事件的处理函数 */ onReachBottom: function () { - + this.getAct() }, /** @@ -102,5 +135,21 @@ Page({ */ onShareAppMessage: function () { + }, + onPageScroll:function(e){ + let topHeight = this.data.top + (102 * ratio),that = this; + wx.createSelectorQuery().select('#content').boundingClientRect(function(rect){ + if(rect.top<=topHeight){ + // 此时应该把menus固定在顶部 + that.setData({ + fixed:true + }) + } + else{ + that.setData({ + fixed:false + }) + } + }).exec() } }) \ No newline at end of file diff --git a/pages/info/museumInfo/index.wxml b/pages/info/museumInfo/index.wxml index 8a0e878..e100c60 100644 --- a/pages/info/museumInfo/index.wxml +++ b/pages/info/museumInfo/index.wxml @@ -14,12 +14,34 @@ {{info.address}} {{info.tel}} -预订须知 - -场馆介绍 - - - + + 场馆介绍 + 场馆活动 + + + + + 预订须知 + + 场馆介绍 + + + + + + + + {{item.name || item.title}} + + {{item.from_platform}} + {{item.begin_date}}—{{item.end_date}} + + + + + 暂无活动 + + 参观预约 diff --git a/pages/info/museumInfo/index.wxss b/pages/info/museumInfo/index.wxss index a7d1f20..5a17e7b 100644 --- a/pages/info/museumInfo/index.wxss +++ b/pages/info/museumInfo/index.wxss @@ -61,3 +61,68 @@ font-size: 31rpx; font-weight: 500; } +.menu-box { + display: flex; + align-items: center; + justify-content: space-around; + 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:"!"; + font-size: 0; + display: block; + position: absolute; + width: 66rpx; + height: 7rpx; + background: #0B898E; + border-radius: 3rpx; + left: 50%; + margin-left: -33rpx; + top: 93rpx; +} +.activity-item { + display: flex; + background: #F4F4F4; + border-radius: 10rpx; + margin: 27rpx; + font-size: 24rpx; + color: #999999; + padding: 22rpx; + justify-content: space-between; +} +.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; + width: 287rpx; + height: 193rpx; + margin-left: 15rpx; +} +.activity-info .textOver { + margin-bottom: 10rpx; +} +.menu-fixed { + position: fixed; + left: 0; + background:white; + right: 0; +} \ No newline at end of file diff --git a/pages/info/roadInfo/index.js b/pages/info/roadInfo/index.js index 140ab62..1519e85 100644 --- a/pages/info/roadInfo/index.js +++ b/pages/info/roadInfo/index.js @@ -23,7 +23,6 @@ Page({ onLoad: function (options) { let rect = wx.getMenuButtonBoundingClientRect(); let height = (rect.top - device.statusBarHeight) * 2 + rect.height + device.statusBarHeight; - console.log(height) this.setData({ top:height, id:options.id diff --git a/pages/list/store/index.json b/pages/list/store/index.json index 35cf02f..eb3533f 100644 --- a/pages/list/store/index.json +++ b/pages/list/store/index.json @@ -1,5 +1,6 @@ { "usingComponents": { - "title":"/pages/component/TitleHeader" + "title":"/pages/component/TitleHeader", + "common-image":"/pages/component/commonImage/index" } } \ No newline at end of file diff --git a/pages/list/store/index.wxml b/pages/list/store/index.wxml index c9ba429..544dfa4 100644 --- a/pages/list/store/index.wxml +++ b/pages/list/store/index.wxml @@ -2,7 +2,7 @@ - + - + - - + + - + - + - {{item.supplier_name}} + {{item.supplier_name}} {{item}} @@ -22,7 +22,7 @@ {{item.start_price/100}} - + {{item.title}} {{item.price/100}}{{item.market_price/100}} diff --git a/pages/list/techan/index.wxss b/pages/list/techan/index.wxss index 7de5326..5e76619 100644 --- a/pages/list/techan/index.wxss +++ b/pages/list/techan/index.wxss @@ -57,6 +57,7 @@ page { height: 136rpx; justify-content: space-around; flex: 1; + width: 300rpx; } .supplier-tags { display: flex; diff --git a/project.private.config.json b/project.private.config.json index c80aceb..2018df8 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -53,6 +53,12 @@ "pathName": "pages/pbService/PRpark/index", "query": "type=2", "scene": null + }, + { + "name": "pages/info/museumInfo/index", + "pathName": "pages/info/museumInfo/index", + "query": "id=10973", + "scene": null } ] }