Browse Source

博物馆,电影

master
nige 3 years ago
parent
commit
42a5925ddd
  1. 2
      app.js
  2. 29
      pages/list/activitynew/index.js
  3. 12
      pages/list/activitynew/index.wxml
  4. 29
      pages/list/activitynew/index.wxss
  5. 7
      pages/list/museum/index.js

2
app.js

@ -21,7 +21,7 @@ App({
unique_key: "wechatxcx" unique_key: "wechatxcx"
}).then(res => { }).then(res => {
let data = JSON.parse(res.data); let data = JSON.parse(res.data);
data.isTest = data.isTest86? true : false; data.isTest = data.isTest87? true : false;
this.globalData.configJson = data this.globalData.configJson = data
}).then(() => { }).then(() => {
// 获取ui配置文件 // 获取ui配置文件

29
pages/list/activitynew/index.js

@ -26,13 +26,17 @@ Page({
lat: "", lat: "",
lon: "", lon: "",
keywords: "", keywords: "",
realKeywords: "" realKeywords: "",
movieAreas:[],
movieArea:0
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.getMovieArea()
let d = new Date(); let d = new Date();
let month = d.getMonth() + 1, let month = d.getMonth() + 1,
day = d.getDate(); day = d.getDate();
@ -86,6 +90,18 @@ Page({
console.log(this.data.type); console.log(this.data.type);
this.getList(); this.getList();
}, },
getMovieArea(){
commonApi._post("act/get_suzhou_areas_syt").then(res => {
res.data.unshift({
area_id: "",
area_title: "苏州市"
})
this.setData({
movieAreas:res.data
})
this.getList()
})
},
changeArea: function (e) { changeArea: function (e) {
this.setData({ this.setData({
area: e.detail.value, area: e.detail.value,
@ -241,6 +257,7 @@ Page({
data.lon = this.data.lon; data.lon = this.data.lon;
data.is_price_sort = this.data.sort == 'price'; data.is_price_sort = this.data.sort == 'price';
data.is_distance_sort = this.data.sort == 'distance'; data.is_distance_sort = this.data.sort == 'distance';
data.city_code=this.data.movieAreas[this.data.movieArea].area_id||""
} }
// if(this.data.movieType==1){ // if(this.data.movieType==1){
// data.queryDate = this.data.date // data.queryDate = this.data.date
@ -317,6 +334,16 @@ Page({
}) })
this.getList(); this.getList();
}, },
setCity(e){
this.setData({
movieArea: e.detail.value,
list: [],
total: 1,
pageNo: 1,
moreFlag: true
})
this.getList()
},
changeMovieType: function (e) { changeMovieType: function (e) {
let type = e.currentTarget.dataset.type; let type = e.currentTarget.dataset.type;
this.setData({ this.setData({

12
pages/list/activitynew/index.wxml

@ -74,8 +74,16 @@
<!-- <view bindtap="changeMovieType" data-type='3' class="movie-type {{movieType==3?'active':''}}">即将上映</view> --> <!-- <view bindtap="changeMovieType" data-type='3' class="movie-type {{movieType==3?'active':''}}">即将上映</view> -->
</view> </view>
<view class="sort-box" wx:if="{{type==4 && movieType==2}}"> <view class="sort-box" wx:if="{{type==4 && movieType==2}}">
<view class="{{sort=='distance'?'active':''}}" bindtap="setSort" data-sort="distance">离我最近</view> <picker class="m-sort" mode="selector" value="{{movieArea}}" range="{{movieAreas}}" range-key="area_title" bindchange="setCity">
<view class="{{sort=='price'?'active':''}}" bindtap="setSort" data-sort="price">价格最低</view> <view class="m-picker">
<view class="active">{{movieAreas[movieArea].area_title}}</view>
<view class="sjx">
</view>
</view>
</picker>
<view class="{{sort=='distance'?'active':''}} m-sort" bindtap="setSort" data-sort="distance">离我最近</view>
<view class="{{sort=='price'?'active':''}} m-sort" bindtap="setSort" data-sort="price">价格最低</view>
</view> </view>
<view wx:if="{{list.length>0 && type!=4}}" style="background:#0B898E;padding:1rpx 0"> <view wx:if="{{list.length>0 && type!=4}}" style="background:#0B898E;padding:1rpx 0">
<view wx:for="{{list}}" bindtap="gotoDetail" data-item="{{item}}" class="activity-item-out"> <view wx:for="{{list}}" bindtap="gotoDetail" data-item="{{item}}" class="activity-item-out">

29
pages/list/activitynew/index.wxss

@ -147,6 +147,25 @@ background: rgba(11, 137, 142, .1);
flex-shrink: 0; flex-shrink: 0;
margin-left: 10rpx; margin-left: 10rpx;
} }
.m-picker {
display: flex;
color: #0B898E;
}
.sjx{
width: 0;
height: 0;
border-top: 9rpx solid #fff;
border-right: 9rpx solid transparent;
border-left: 9rpx solid transparent;
border-bottom: 9rpx solid transparent;
margin-top:16rpx;
margin-left: 8rpx;
}
.m-sort{
width: 130rpx;
text-align: center;
}
.activity-search-bg { .activity-search-bg {
width: 422rpx; width: 422rpx;
height: 56rpx; height: 56rpx;
@ -248,16 +267,14 @@ background: rgba(11, 137, 142, .1);
} }
.sort-box { .sort-box {
display: flex; display: flex;
justify-content: flex-end; justify-content: space-between;
padding: 30rpx; margin: 20rpx 0 50rpx 0;
padding-top: 0;
background: #0B898E; background: #0B898E;
color: #D8D8D8; color: #D8D8D8;
font-size: 26rpx; font-size: 26rpx;
padding: 0 60rpx 0 70rpx;
} }
.sort-box view:nth-child(1){
margin-right: 50rpx;
}
.sort-box view.active { .sort-box view.active {
color: #fff; color: #fff;
} }

7
pages/list/museum/index.js

@ -32,6 +32,13 @@ Page({
util.gotoDetail(item,1); util.gotoDetail(item,1);
}, },
gotoDetailOther: function(e) { gotoDetailOther: function(e) {
if (e.currentTarget.dataset.id==44703) {
wx.navigateToMiniProgram({
appId: 'wxfef80ee1ab7e58a2',
path: 'pages/inners/main'
})
return;
}
wx.navigateTo({ wx.navigateTo({
url: '/pages/info/museumInfo/index?id='+e.currentTarget.dataset.id url: '/pages/info/museumInfo/index?id='+e.currentTarget.dataset.id
}) })

Loading…
Cancel
Save