|
@@ -1,5 +1,8 @@
|
|
|
<template>
|
|
|
<view class="content">
|
|
|
+ <view class="filter-box">
|
|
|
+ <u-search placeholder="请输入关键字" v-model="filterText" @search="setFilterText" @custom="setFilterText"></u-search>
|
|
|
+ </view>
|
|
|
<view class="venue-box">
|
|
|
<u-card :head-border-bottom="false" :foot-border-top="false" title-size="32" padding="0" margin="10px" v-for="(item, index) in venueList"
|
|
|
:key="index" class="venue-card" @click="goToVenueDetail(item)">
|
|
@@ -31,29 +34,47 @@
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ filterText: '',
|
|
|
venueList: []
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
|
- // 附件场馆
|
|
|
- NET.request(API.getVenueList, uni.getStorageSync('locationData'), 'POST').then(res => {
|
|
|
- this.venueList = res.data
|
|
|
- }).catch(error => {
|
|
|
- this.$refs.uTips.show({
|
|
|
- title: error.message,
|
|
|
- type: 'warning',
|
|
|
- })
|
|
|
- setTimeout(() => {
|
|
|
- uni.navigateBack()
|
|
|
- },1000)
|
|
|
- })
|
|
|
+ this.getAllVenue()
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 获取全部场馆
|
|
|
+ getAllVenue() {
|
|
|
+ // 附件场馆
|
|
|
+ NET.request(API.getVenueList, uni.getStorageSync('locationData'), 'POST').then(res => {
|
|
|
+ this.venueList = res.data
|
|
|
+ }).catch(error => {
|
|
|
+ this.$refs.uTips.show({
|
|
|
+ title: error.message,
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.navigateBack()
|
|
|
+ },1000)
|
|
|
+ })
|
|
|
+ },
|
|
|
// 跳转场馆详情
|
|
|
goToVenueDetail(item) {
|
|
|
uni.navigateTo({
|
|
|
url: '/pagesMember/venueDetail?id=' + item.id
|
|
|
});
|
|
|
+ },
|
|
|
+ setFilterText() {
|
|
|
+ if(this.filterText) {
|
|
|
+ let arr = []
|
|
|
+ this.venueList.forEach(item => {
|
|
|
+ if(item.name.indexOf(this.filterText) >= 0) {
|
|
|
+ arr.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.venueList = arr
|
|
|
+ } else {
|
|
|
+ this.getAllVenue()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -66,6 +87,12 @@
|
|
|
width: 100%;
|
|
|
float: left;
|
|
|
|
|
|
+ .filter-box {
|
|
|
+ height: 48px;
|
|
|
+ padding: 10px 15px;
|
|
|
+ background-color: #FFFFFF;
|
|
|
+ }
|
|
|
+
|
|
|
.venue-box {
|
|
|
width: 100vw;
|
|
|
float: left;
|