149 lines
3.4 KiB
Vue
149 lines
3.4 KiB
Vue
<template>
|
|
<view>
|
|
<view class="search-box">
|
|
<view class="search-box-input">
|
|
<u-input placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search"
|
|
prefixIconStyle="font-size: 24px;color: #909399;" border="true">
|
|
</u-input>
|
|
</view>
|
|
</view>
|
|
<view class="content">
|
|
<ShowShopList v-if="listId == 0" :isEdit="true" :showStyle="1" :shopInfoList="searchInfoList"></ShowShopList>
|
|
<SearchShopList v-if="listId == 1" :searchInfoList="searchInfoList" :is-edit="true" :showStyle="1">
|
|
</SearchShopList>
|
|
<ShowShopList v-if="listId == 3" :is-edit="true" :showStyle="2" :shopInfoList="searchInfoList"></ShowShopList>
|
|
<ShowShopList v-if="listId == 2" :is-edit="true" :showStyle="2" :shopInfoList="searchInfoList"></ShowShopList>
|
|
<ShowShopList v-if="listId == 4" :showStyle="0" :shopInfoList="matchList"></ShowShopList>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
titletext: '',
|
|
listId: '',
|
|
matchList: [],
|
|
shopInfoList: [],
|
|
searchInfoList: [],
|
|
matchListLength: '',
|
|
searchListLength: '',
|
|
pageSize: 5,
|
|
pageNum: 1,
|
|
matchPageSize: 5,
|
|
matchPageNum: 1,
|
|
}
|
|
},
|
|
onReachBottom() {
|
|
if (this.listId !== 4 && this.searchListLength !== 0) {
|
|
this.pageNum++
|
|
this.getMyPublished(this.listId + 1)
|
|
} else if (this.listId == 4 && this.matchListLength !== 0) {
|
|
this.matchPageNum++
|
|
this.getMatch()
|
|
}
|
|
},
|
|
methods: {
|
|
getMatch() {
|
|
this.$api.getMyMatch({
|
|
pageSize: this.matchPageSize,
|
|
pageNum: this.matchPageNum
|
|
}).then(res => {
|
|
if (res.data.code == 1) {
|
|
this.matchListLength = res.data.data.length
|
|
this.matchList = [...this.matchList, ...res.data.data[0]]
|
|
} else {
|
|
uni.$u.toast(res.data.msg)
|
|
}
|
|
})
|
|
},
|
|
getMyPublished(type) {
|
|
this.$api.getMyPublished({
|
|
type: type,
|
|
pageSize: this.pageSize,
|
|
pageNum: this.pageNum
|
|
}).then(res => {
|
|
console.log('发布信息', res);
|
|
console.log(type);
|
|
if (res.data.code == 1) {
|
|
this.searchListLength = res.data.data.length
|
|
this.searchInfoList = [...this.searchInfoList, ...res.data.data]
|
|
} else {
|
|
uni.$u.toast(res.data.msg)
|
|
}
|
|
})
|
|
}
|
|
},
|
|
onLoad: function(option) {
|
|
wx.setNavigationBarTitle({
|
|
title: option.titletext
|
|
})
|
|
this.titletext = option.titletext
|
|
if (this.titletext == '发布的店铺转让') {
|
|
this.listId = 0
|
|
this.getMyPublished(1)
|
|
}
|
|
if (this.titletext == '发布的找店选址') {
|
|
this.listId = 1
|
|
this.getMyPublished(2)
|
|
}
|
|
if (this.titletext == '发布的店铺出租') {
|
|
this.listId = 2
|
|
this.getMyPublished(3)
|
|
}
|
|
if (this.titletext == '发布的项目招商') {
|
|
this.listId = 3
|
|
this.getMyPublished(4)
|
|
}
|
|
|
|
if (this.titletext == '我的匹配') {
|
|
this.listId = 4
|
|
this.getMatch()
|
|
}
|
|
|
|
},
|
|
computed: {
|
|
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
.search-box {
|
|
position: relative;
|
|
z-index: 1;
|
|
left: 50%;
|
|
width: 84.6%;
|
|
transform: translateX(-50%);
|
|
|
|
.search-box-input {
|
|
border-radius: 12rpx;
|
|
margin-top: 20rpx;
|
|
background-color: #fff;
|
|
opacity: 0.85;
|
|
|
|
.u-border {
|
|
border: none;
|
|
|
|
.u-input__content {
|
|
height: 62rpx;
|
|
border-radius: 12rpx;
|
|
background-color: #fff;
|
|
|
|
.u-input__content__field-wrapper__field {
|
|
font-size: 26rpx !important;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
page {
|
|
background-color: #F8F8F8;
|
|
}
|
|
|
|
.content {
|
|
margin: 0 10px;
|
|
}
|
|
</style> |