Browse Source

更新下

master
Myth 5 years ago
parent
commit
9e16c6b54f
  1. 53
      pages/info/museumInfo/index.js
  2. 22
      pages/info/museumInfo/index.wxml
  3. 65
      pages/info/museumInfo/index.wxss
  4. 1
      pages/info/roadInfo/index.js
  5. 3
      pages/list/store/index.json
  6. 4
      pages/list/store/index.wxml
  7. 2
      pages/list/store/index.wxss
  8. 16
      pages/list/techan/index.js
  9. 3
      pages/list/techan/index.json
  10. 14
      pages/list/techan/index.wxml
  11. 1
      pages/list/techan/index.wxss
  12. 6
      project.private.config.json

53
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()
}
})

22
pages/info/museumInfo/index.wxml

@ -14,12 +14,34 @@
<view class="location"><text class="iconfont icon-location"></text>{{info.address}}</view>
<view class="location" style="margin-bottom:0"><text class="iconfont icon-dianhua2"></text>{{info.tel}}</view>
</view>
<view class="menu-box{{fixed?' menu-fixed':''}}" style="top:{{top}}px">
<view class="menu-item{{type==1?' active':''}}" bindtap="changeType" data-type="1">场馆介绍</view>
<view class="menu-item{{type==2?' active':''}}" bindtap="changeType" data-type="2">场馆活动</view>
</view>
<view style="height:102rpx;" wx:if="{{fixed}}"></view>
<view id="content">
<view wx:if="{{type==1}}">
<view class="detail-title">预订须知</view>
<rich-text wx:if="{{info}}" class="detail" nodes="{{tool.formateRichText(info.book_info)}}"></rich-text>
<view class="detail-title">场馆介绍</view>
<rich-text wx:if="{{info}}" class="detail" nodes="{{tool.formateRichText(info.content)}}"></rich-text>
<!-- <view class="detail" wx:if="{{info}}">{{info.open_time}}</view> -->
<view style="height:104rpx" wx:if="{{info.product_venue && info.product_venue.sku && info.product_venue.sku.length>0}}"></view>
</view>
<view wx:else>
<navigator url="../activityInfo/index?id={{item.id}}" class="activity-item" wx:for="{{actList}}">
<view class="activity-info">
<view class="textOver2">{{item.name || item.title}}</view>
<view>
<view class="textOver">{{item.from_platform}}</view>
<view class="textOver">{{item.begin_date}}—{{item.end_date}}</view>
</view>
</view>
<image src="{{item.post_url}}" mode="aspectFill"></image>
</navigator>
<view style="font-size:26rpx;text-align:center;line-height:200rpx;" wx:if="{{actList.length==0}}">暂无活动</view>
</view>
</view>
<view class="fixed-btn" wx:if="{{info.product_venue && info.product_venue.sku && info.product_venue.sku.length>0}}">
<view bindtap="order" class="btn">参观预约</view>
</view>

65
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;
}

1
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

3
pages/list/store/index.json

@ -1,5 +1,6 @@
{
"usingComponents": {
"title":"/pages/component/TitleHeader"
"title":"/pages/component/TitleHeader",
"common-image":"/pages/component/commonImage/index"
}
}

4
pages/list/store/index.wxml

@ -2,7 +2,7 @@
<!-- 非遗列表页面 -->
<!-- <wxs src="../../../../utils/filter.wxs" module="tool" /> -->
<title wx:if="{{info}}" title="{{info.supplier_name}}"></title>
<image wx:if="{{info}}" class="heaimg" src="{{info.banner_img}}" mode="widthFix"></image>
<common-image wx:if="{{info}}" class="heaimg" src="{{info.banner_img}}" mode="widthFix"></common-image>
<!-- <swiper class="swiper" wx:if="{{info.listImgs.length>0}}" indicator-dots="true" indicator-color="rgba(255,255,255,0.5)" indicator-active-color="white" autoplay="true" interval="5000" duration="500">
<block wx:for="{{info.listImgs}}" wx:key="*this">
<swiper-item>
@ -18,7 +18,7 @@
<view class="info-box">
<view class="title">{{item.title}}</view>
<view class="price-box">
<view class="price-box-left"><text>¥{{item.price/100}}</text><text wx:if="{{item.linethroughPrice}}" class="old-price">¥{{item.linethroughPrice/100}}</text></view>
<view class="price-box-left"><text>¥{{item.price/100}}</text><text wx:if="{{item.market_price}}" class="old-price">¥{{item.market_price/100}}</text></view>
<view class="btn">抢购</view>
</view>
</view>

2
pages/list/store/index.wxss

@ -6,7 +6,7 @@
width: 100%;
height: 246rpx;
}
.heaimg {
.heaimg image{
display: block;
margin: 25rpx;
width: calc(100% - 50rpx);

16
pages/list/techan/index.js

@ -9,7 +9,7 @@ Page({
data: {
list:[],
total:1,
type:2,
type:3,
keywords:""
},
@ -27,6 +27,16 @@ Page({
})
this.getList();
},
gotoDetail:function(e){
let id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '../store/index?id='+id,
})
},
gotoProduct:function(e){
let item = e.currentTarget.dataset.item;
util.gotoDetail(item)
},
changeType:function(e){
this.setData({
type:e.currentTarget.dataset.type,
@ -56,10 +66,6 @@ Page({
})
})
},
gotoDetail:function(e){
let item = e.currentTarget.dataset.item;
util.gotoDetail(item);
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

3
pages/list/techan/index.json

@ -1,5 +1,6 @@
{
"usingComponents": {
"title":"/pages/component/TitleHeader"
"title":"/pages/component/TitleHeader",
"common-image":"/pages/component/commonImage/index"
}
}

14
pages/list/techan/index.wxml

@ -2,18 +2,18 @@
<!-- 非遗列表页面 -->
<!-- <wxs src="../../../../utils/filter.wxs" module="tool" /> -->
<title title="文创特产"></title>
<image class="heaimg" src="https://static.ticket.sz-trip.com/xcxImages/techan/top.png" mode="widthFix"></image>
<image class="heaimg" src="https://static.ticket.sz-trip.com/xcxImages/techan/top1.png" mode="widthFix"></image>
<view style="position:relative;margin-top: -107rpx;">
<image mode="widthFix" class="classimg" src="https://static.ticket.sz-trip.com/xcxImages/techan/class.png"></image>
<view class="type-text" bindtap="changeType" data-type="2"><text>特</text><text>产</text></view>
<view class="type-text" bindtap="changeType" data-type="3" style="left:auto;right:135rpx"><text>文</text><text>创</text></view>
<view class="type-text" bindtap="changeType" data-type="3"><text>特</text><text>产</text></view>
<view class="type-text" bindtap="changeType" data-type="2" style="left:auto;right:135rpx"><text>文</text><text>创</text></view>
</view>
<view class="list">
<view class="item" wx:for="{{list}}">
<view bindtap="gotoDetail" data-id="{{item.id}}" class="item" wx:for="{{list}}">
<view class="top-info">
<image mode="aspectFill" src="{{item.headimg}}"></image>
<common-image mode="aspectFill" src="{{item.headimg}}"></common-image>
<view class="supplier-info">
<view class="supplier-name">{{item.supplier_name}}</view>
<view class="supplier-name textOver">{{item.supplier_name}}</view>
<view class="supplier-tags">
<view class="supplier-tag textOver" wx:for="{{item.display_tags}}">{{item}}</view>
</view>
@ -22,7 +22,7 @@
<view class="supplier-price"><text>¥</text><text>{{item.start_price/100}}</text><text>起</text></view>
</view>
<view class="product-list">
<view class="product-item" wx:for="{{item.product}}">
<view catchtap="gotoProduct" data-item="{{item}}" class="product-item" wx:for="{{item.product}}">
<image src="{{item.headimg}}" mode="aspectFill"></image>
<view class="product-title textOver2">{{item.title}}</view>
<view class="supplier-price"><text>¥</text><text style="font-size:30rpx">{{item.price/100}}</text><text class="market_price">{{item.market_price/100}}</text></view>

1
pages/list/techan/index.wxss

@ -57,6 +57,7 @@ page {
height: 136rpx;
justify-content: space-around;
flex: 1;
width: 300rpx;
}
.supplier-tags {
display: flex;

6
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
}
]
}

Loading…
Cancel
Save