You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
161 lines
3.1 KiB
161 lines
3.1 KiB
|
2 years ago
|
<template>
|
||
|
|
<view class="cotainer">
|
||
|
|
<view class="search">
|
||
|
|
<view class="search-area">
|
||
|
|
<input type="text" maxlength="20" focus confirm-type="search" placeholder-class="pclass"
|
||
|
|
v-model="keyword" @confirm="getPoints"/>
|
||
|
|
<view class="bg-base" @click="getPoints">搜索</view>
|
||
|
|
</view>
|
||
|
|
</view>
|
||
|
|
|
||
|
|
<view class="line">
|
||
|
|
<block v-if="pointers.length>0">
|
||
|
|
<view class="line-item" v-for="pointer in pointers" @click="toDetail(pointer.id)">
|
||
|
|
<view class="line-item-pointer">
|
||
|
|
<image class="line-item-pointer-img" :src="pointer.image.url" mode="">
|
||
|
|
</image>
|
||
|
|
<view class="">
|
||
|
|
<view class="line-item-pointer-title">{{pointer.name}}</view>
|
||
|
|
<view class="line-item-pointer-detail">点位详情</view>
|
||
|
|
</view>
|
||
|
|
</view>
|
||
|
|
</view>
|
||
|
|
</block>
|
||
|
|
<view v-else class="nodata">
|
||
|
|
<u-empty text="数据为空" mode="search"></u-empty>
|
||
|
|
</view>
|
||
|
|
</view>
|
||
|
|
<tabbar :currentPage="6"></tabbar>
|
||
|
|
</view>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
|
import tabbar from '@/components/tabbar/tabbar.vue'
|
||
|
|
export default {
|
||
|
|
components: {
|
||
|
|
tabbar
|
||
|
|
},
|
||
|
|
data() {
|
||
|
|
return {
|
||
|
|
keyword: '',
|
||
|
|
pointers: []
|
||
|
|
}
|
||
|
|
},
|
||
|
|
onLoad() {
|
||
|
|
// this.getPoints()
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
getPoints() {
|
||
|
|
this.pointers = []
|
||
|
|
this.$u.api.getPoints({
|
||
|
|
name:this.keyword
|
||
|
|
}).then((res) => {
|
||
|
|
this.pointers = res.points
|
||
|
|
})
|
||
|
|
|
||
|
|
},
|
||
|
|
toDetail(id) {
|
||
|
|
uni.navigateTo({
|
||
|
|
url: '/packages/detail/detail?id=' + id,
|
||
|
|
});
|
||
|
|
},
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<style lang="scss">
|
||
|
|
.cotainer{
|
||
|
|
padding-bottom:135rpx;
|
||
|
|
background-color: #f5f5f5;
|
||
|
|
}
|
||
|
|
.search{
|
||
|
|
position: fixed;
|
||
|
|
top:0;
|
||
|
|
left:0;
|
||
|
|
width:100%;
|
||
|
|
background-color: #f5f5f5;
|
||
|
|
z-index:9;
|
||
|
|
}
|
||
|
|
.search-area {
|
||
|
|
display: flex;
|
||
|
|
width:90%;
|
||
|
|
margin: 30rpx auto;
|
||
|
|
input {
|
||
|
|
padding: 20rpx 40rpx;
|
||
|
|
background-color: #fff;
|
||
|
|
border-radius: 40rpx 0 0 40rpx;
|
||
|
|
width: calc(100% - 160rpx);
|
||
|
|
height: 80rpx;
|
||
|
|
box-sizing: border-box;
|
||
|
|
}
|
||
|
|
|
||
|
|
.bg-base {
|
||
|
|
background-color: #dbd0ba;
|
||
|
|
color: #fff;
|
||
|
|
padding: 20rpx 40rpx;
|
||
|
|
height: 80rpx;
|
||
|
|
border-radius: 0 40rpx 40rpx 0;
|
||
|
|
width: 160rpx;
|
||
|
|
text-align: center;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
.line {
|
||
|
|
width: 90%;
|
||
|
|
margin: 30rpx auto;
|
||
|
|
height:calc(100vh - 200rpx);
|
||
|
|
background-color: #f5f5f5;
|
||
|
|
overflow: scroll;
|
||
|
|
padding-top: 120rpx;
|
||
|
|
position: relative;
|
||
|
|
.nodata{
|
||
|
|
position: absolute;
|
||
|
|
top:50%;
|
||
|
|
left:50%;
|
||
|
|
transform: translate(-50%,-50%);
|
||
|
|
}
|
||
|
|
&-item {
|
||
|
|
&-pointer {
|
||
|
|
display: flex;
|
||
|
|
align-items: center;
|
||
|
|
padding: 20rpx;
|
||
|
|
background-color: #fff;
|
||
|
|
border-radius: 20rpx;
|
||
|
|
// box-shadow: -2px -3rpx 12px rgba(0, 0, 0, 0.1);
|
||
|
|
margin-bottom: 30rpx;
|
||
|
|
width: 100%;
|
||
|
|
height: 180rpx;
|
||
|
|
|
||
|
|
&-img {
|
||
|
|
width: 165rpx;
|
||
|
|
height: 90rpx;
|
||
|
|
border-radius: 20rpx;
|
||
|
|
margin-right: 30rpx;
|
||
|
|
}
|
||
|
|
|
||
|
|
>view {
|
||
|
|
width: calc(100% - 200rpx)
|
||
|
|
}
|
||
|
|
|
||
|
|
&-title {
|
||
|
|
font-size: 32rpx;
|
||
|
|
color: #000;
|
||
|
|
}
|
||
|
|
|
||
|
|
&-detail {
|
||
|
|
color: #bc9766;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
&-icon {
|
||
|
|
width: 73rpx;
|
||
|
|
height: 73rpx;
|
||
|
|
position: absolute;
|
||
|
|
right: 30rpx;
|
||
|
|
bottom: 60rpx;
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</style>
|