Browse Source

景点新增分类

master
shaojing 2 years ago
parent
commit
1bd999268a
  1. 4
      pages/component/SearchHeader.wxml
  2. 39
      pages/list/scene/index.js
  3. 23
      pages/list/scene/index.wxml
  4. 91
      pages/list/scene/index.wxss

4
pages/component/SearchHeader.wxml

@ -4,6 +4,10 @@
<view bindtap="indexFocus" class="search-box" style="margin-right:{{right + 5}}px;"> <view bindtap="indexFocus" class="search-box" style="margin-right:{{right + 5}}px;">
<icon class="iconfont icon-sousuo"></icon> <icon class="iconfont icon-sousuo"></icon>
<input bindfocus="inputFocus" placeholder-class="{{transparent==1?'phcolor':''}}" bindinput="searchInput" bindconfirm="search" class="weui-input" placeholder="搜索" /> <input bindfocus="inputFocus" placeholder-class="{{transparent==1?'phcolor':''}}" bindinput="searchInput" bindconfirm="search" class="weui-input" placeholder="搜索" />
<view wx:if="{{isScene!=1}}" style="display: flex;padding-right: 12rpx;">
<view style="color: #ccc;">|</view>
<view style="margin-left:22rpx;font-weight: 400;font-size: 29rpx;color: #0B898E;" bindtap="search">搜索</view>
</view>
</view> </view>
</view> </view>
</view> </view>

39
pages/list/scene/index.js

@ -3,7 +3,6 @@ import commonApi from "../../../utils/https/common"
import util from "../../../utils/util" import util from "../../../utils/util"
let app = getApp() let app = getApp()
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
@ -13,7 +12,9 @@ Page({
latitude:"", latitude:"",
longitude:"", longitude:"",
keywords:'', keywords:'',
area_id:'' area_id:'',
navList:[],
navIndex:0,
}, },
/** /**
@ -37,12 +38,39 @@ Page({
latitude:res.latitude, latitude:res.latitude,
longitude:res.longitude longitude:res.longitude
}) })
that.getList() // that.getList()
}, },
fail:function(){ fail:function(){
that.getList() // that.getList()
} }
}) })
// 获取头部景点分类
commonApi._post("scene/get_scene_tags",{
pid:4
}).then(res=>{
this.setData({
navList:res.data
})
console.log(this.data.navList);
this.getList()
})
},
search:function(){
this.setData({
list:[],
total:1
})
this.getList()
},
changeType:function (e) {
console.log(e);
this.setData({
navIndex:e.currentTarget.dataset.index,
list:[],
total:1
})
console.log(this.data.navIndex);
this.getList()
}, },
search:function(e){ search:function(e){
this.setData(e.detail); this.setData(e.detail);
@ -60,7 +88,8 @@ Page({
let list = this.data.list; let list = this.data.list;
if(list.length>=this.data.total) return; if(list.length>=this.data.total) return;
commonApi._post("scene/get_scene_by_tag",{ commonApi._post("scene/get_scene_by_tag",{
tag_id:"4", // tag_id:"4",
tag_id:this.data.navList[this.data.navIndex].id,
limit:10, limit:10,
lon:this.data.longitude, lon:this.data.longitude,
lat:this.data.latitude, lat:this.data.latitude,

23
pages/list/scene/index.wxml

@ -5,25 +5,38 @@
<view class="hot-item" wx:for="{{10}}">产品产品产</view> <view class="hot-item" wx:for="{{10}}">产品产品产</view>
</view> --> </view> -->
<!-- <view style="height:100rpx"></view> --> <!-- <view style="height:100rpx"></view> -->
<image class="topImg" src="https://static.ticket.sz-trip.com/uploads/20240521/3022ab8f3d45444ead1e77f9a2112dc0.png" mode=""/>
<view class="navBox">
<view class="nav {{index == navIndex?'seld-nav':''}}" wx:for="{{navList}}" data-item="{{item}}" bindtap="changeType" data-index="{{index}}">
<image src="https://static.ticket.sz-trip.com{{item.icon}}" mode=""/>
<view class="{{index == navIndex?'seld-nav-text':'nav-text'}}">
{{item.name}}
</view>
</view>
</view>
<view style="height:30rpx"></view> <view style="height:30rpx"></view>
<view bindtap="gotoDetail" data-item="{{item}}" wx:for="{{list}}" url="/pages/info/sceneProductInfo/index?id={{item.id}}" class="item"> <view bindtap="gotoDetail" data-item="{{item}}" wx:for="{{list}}" url="/pages/info/sceneProductInfo/index?id={{item.id}}" class="item">
<image src="{{item.headimg}}" mode="aspectFill"></image> <image src="{{item.headimg}}" mode="aspectFill"></image>
<!-- <view class="no-text" wx:if="{{index<3 && keywords==''}}">NO.{{index+1}}</view> --> <!-- <view class="no-text" wx:if="{{index<3 && keywords==''}}">NO.{{index+1}}</view> -->
<view class="status-text" wx:if="{{item.garden_flag_text && item.garden_flag!=1}}">{{item.garden_flag_text}}</view> <!-- <view class="status-text" wx:if="{{item.garden_flag_text && item.garden_flag!=1}}">{{item.garden_flag_text}}</view> -->
<view class="right-info"> <view class="right-info">
<view class="title textOver2">{{item.title}}</view> <view class="title textOver2">{{item.title}}</view>
<view class="tags"> <view class="tags">
<view class="tag" wx:for="{{item.tags}}">{{item}}</view> <view class="tag" wx:for="{{item.tags}}">{{item}}</view>
</view> </view>
<view class="location textOver" style="width:432rpx"><text class="iconfont icon-location"></text>{{item.address}}</view> <!-- <view class="location textOver" style="width:432rpx"><text class="iconfont icon-location"></text>{{item.address}}</view> -->
<view class="price-box"> <view class="price-box">
<text wx:if="{{item.distance}}">距您直线距离{{item.distance}}</text> <view style="width: 280rpx;display: flex;align-items: center;font-weight: 400;font-size: 24rpx;color: #999999;" class="textOver">
<text wx:else></text> <text wx:if="{{item.distance}}">{{item.distance}}</text>
<text wx:else></text>
<view style="width: 1rpx;height: 21rpx;background: #999999;flex-shrink: 0;margin: 0 12rpx;"></view>
<view class="location">{{item.address}}</view>
</view>
<view class="price"><text>¥</text><text>{{item.price?item.price/100:0}}</text><text>起</text></view> <view class="price"><text>¥</text><text>{{item.price?item.price/100:0}}</text><text>起</text></view>
</view> </view>
</view> </view>
</view> </view>
<view wx:if="{{list.length==0}}" class="common-empty" style="z-index:-1"> <view wx:if="{{list.length==0}}" class="common-empty" style="z-index:-1;top: 220rpx;">
<image mode="widthFix" src="https://static.ticket.sz-trip.com/xcxImages/other/nodata.png"></image> <image mode="widthFix" src="https://static.ticket.sz-trip.com/xcxImages/other/nodata.png"></image>
<view>暂无内容</view> <view>暂无内容</view>
</view> </view>

91
pages/list/scene/index.wxss

@ -31,18 +31,18 @@
align-items: center; align-items: center;
margin: 40rpx 25rpx; margin: 40rpx 25rpx;
margin-top: 0; margin-top: 0;
justify-content: space-between; /* justify-content: space-between; */
position: relative; position: relative;
} }
.item .info { .item .info {
flex: 1; flex: 1;
} }
.item image { .item image {
width: 233rpx; width: 186rpx;
height: 233rpx; height: 186rpx;
border-radius: 11rpx; border-radius: 11rpx;
display: block; display: block;
margin-right: 24rpx; margin-right: 26rpx;
flex-shrink: 0; flex-shrink: 0;
} }
.item .no-text { .item .no-text {
@ -79,13 +79,16 @@
} }
.tag { .tag {
color: #0B898E; color: #0B898E;
font-size: 20rpx; font-size: 23rpx;
margin-right: 30rpx; margin-right: 20rpx;
position: relative; position: relative;
line-height: 20rpx; line-height: 32rpx;
white-space: nowrap; white-space: nowrap;
overflow-x: hidden; overflow-x: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
padding: 5rpx 9rpx;
background: #E6F3F3;
border-radius: 7rpx;
} }
.tags .tag::after { .tags .tag::after {
content: "1"; content: "1";
@ -124,4 +127,76 @@
.price-box .price text:nth-child(3){ .price-box .price text:nth-child(3){
font-size: 20rpx; font-size: 20rpx;
color: #8D8D8D; color: #8D8D8D;
} }
.topImg {
width: 750rpx;
height: 266.67rpx;
}
.navBox {
display: flex;
padding: 14.67rpx 0 9.33rpx 26rpx;
border-bottom: 1px solid #E0E0E0;
overflow-x: scroll;
flex-wrap: nowrap;
}
.nav {
display: flex;
flex-direction: column;
align-items: center;
margin-right: 30.67rpx;
padding: 12rpx 13.5rpx 16.67rpx;
flex-shrink: 0;
}
.seld-nav {
border-radius: 13rpx;
border: 1px solid #0B898E;
}
.nav image {
width: 80.67rpx;
height: 80.67rpx;
}
.nav-text {
font-weight: 500;
font-size: 27rpx;
color: #7C8594;
margin-top: 20.67rpx;
}
.seld-nav-text {
margin-top: 20.67rpx;
font-weight: bold;
font-size: 27rpx;
color: #0B898E;
}
.right-info {
padding: 10.67rpx 0 7.33rpx;
}
.title-box,.title-header{
background: #ffff;
}
.bg-box,.bg-box .title-header {
background: transparent;
color: #ccc;
}
.title-header {
position: fixed;
left: 0;
right: 0;
display: flex;
top: 0;
align-items: center;
justify-content: space-between;
font-size: 32rpx;
line-height: 90rpx;
z-index: 2;
}

Loading…
Cancel
Save