房源信息模块
This commit is contained in:
@@ -7,20 +7,25 @@
|
||||
:actionStyle="actionStyle"></u-search>
|
||||
</view>
|
||||
</u-sticky>
|
||||
|
||||
{{ select }}
|
||||
<view class="order-total">
|
||||
<view class="pay-btn">
|
||||
<view class="btn">
|
||||
<u-button text="上架" plain size="small" @click="onPay(item.logId)"></u-button>
|
||||
<u-button text="上架" plain size="small" @click="onStatus(0)"></u-button>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<u-button text="下架" plain size="small" @click="onPay(item.logId)"></u-button>
|
||||
<u-button text="下架" plain size="small" @click="onStatus(1)"></u-button>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<u-button text="删除" plain size="small" @click="onPay(item.logId)"></u-button>
|
||||
<u-button text="删除" plain size="small" @click="onDel()"></u-button>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<u-button text="编辑" plain size="small" @click="onEdit()"></u-button>
|
||||
</view>
|
||||
<!-- <view class="btn">
|
||||
<u-button text="分享" plain size="small" @click="onPay(item.logId)"></u-button>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="btn" v-if="item.payStatus == 10">
|
||||
<u-button text="取消订单" size="small" @click="onRemove(item.logId)"></u-button>
|
||||
</view> -->
|
||||
@@ -33,39 +38,19 @@
|
||||
</u-radio-group>
|
||||
</view>
|
||||
<view class="list">
|
||||
<view class="item" @click="$push('sub_pages/house/detail?id=')">
|
||||
<view class="badge" @click="onBadge(1)"><u-badge :isDot="true" type="info" :bgColor="bgColor"></u-badge></view>
|
||||
<image class="image" src="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwr9ba.jpg"></image>
|
||||
<view class="info">
|
||||
<view class="title">整租·万科云城 2室1厅1卫</view>
|
||||
<view class="desc"><text>50.8m²|南</text></view>
|
||||
<view class="price">6600元/月</view>
|
||||
<block v-for="(item,index) in list" :key="index">
|
||||
<view class="item" @click="$push('sub_pages/house/add?id=' + item.houseId)">
|
||||
<view class="badge" @click.stop="onBadge(item.houseId)"><u-badge :isDot="true" type="info" :bgColor="item.houseId == selectId ? bgColor : ''"></u-badge></view>
|
||||
<image class="image" :src="item.files[0].url" mode="widthFix"></image>
|
||||
<view class="info">
|
||||
<view class="title">{{ item.houseTitle }}</view>
|
||||
<view class="desc"><text>{{ item.extent }}m²|{{ item.toward }}</text></view>
|
||||
<view class="price">{{ item.rent }}元/月</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item" @click="$push('sub_pages/house/detail?id=')">
|
||||
<image class="image" src="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwr9ba.jpg"></image>
|
||||
<view class="info">
|
||||
<view class="title">整租·万科云城 2室1厅1卫</view>
|
||||
<view class="desc"><text>50.8m²|南</text></view>
|
||||
<view class="price">6600元/月</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item" @click="$push('sub_pages/house/detail?id=')">
|
||||
<image class="image" src="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwr9ba.jpg"></image>
|
||||
<view class="info">
|
||||
<view class="title">整租·万科云城 2室1厅1卫</view>
|
||||
<view class="desc"><text>50.8m²|南</text></view>
|
||||
<view class="price">6600元/月</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item" @click="$push('sub_pages/house/detail?id=')">
|
||||
<image class="image" src="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwr9ba.jpg"></image>
|
||||
<view class="info">
|
||||
<view class="title">整租·万科云城 2室1厅1卫</view>
|
||||
<view class="desc"><text>50.8m²|南</text></view>
|
||||
<view class="price">6600元/月</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<u-empty mode="data" icon="https://file.wsdns.cn/empty/data.png" v-if="list.length == 0">
|
||||
</u-empty>
|
||||
</view>
|
||||
</view>
|
||||
<u-gap></u-gap>
|
||||
@@ -89,12 +74,19 @@
|
||||
import * as UserProfileApi from '@/api/love-user-profile.js'
|
||||
import * as UploadApi from '@/api/upload'
|
||||
import * as DictApi from '@/api/dict.js'
|
||||
import * as HouseInfoApi from '@/api/house-info.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
loadMore: true,
|
||||
status: '加载更多',
|
||||
page: 1,
|
||||
where: {},
|
||||
select: [],
|
||||
bgColor: '#ffffff'
|
||||
bgColor: '#ffffff',
|
||||
selectId: 0
|
||||
}
|
||||
},
|
||||
|
||||
@@ -102,6 +94,8 @@
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad() {
|
||||
this.list = []
|
||||
this.onRefreshList()
|
||||
// this.getDict()
|
||||
},
|
||||
|
||||
@@ -112,13 +106,74 @@
|
||||
// this.$refs.datetimePicker.setFormatter(this.formatter)
|
||||
},
|
||||
|
||||
// 触底函数
|
||||
onReachBottom() {
|
||||
console.log("触底函数: ");
|
||||
const app = this
|
||||
if (app.loadMore) {
|
||||
app.page = ++app.page;
|
||||
app.onRefreshList()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onRefreshList() {
|
||||
const app = this
|
||||
const userId = uni.getStorageSync('userId')
|
||||
app.where.page = app.page
|
||||
app.where.userId = userId
|
||||
return new Promise((resolve, reject) => {
|
||||
HouseInfoApi.pageHouseInfo(app.where)
|
||||
.then(result => {
|
||||
const list = result.data.list.map(d => {
|
||||
d.files = JSON.parse(d.files) || []
|
||||
return d
|
||||
})
|
||||
// 合并新数据
|
||||
app.list = app.list.concat(list)
|
||||
if (result.data.count > app.list.length) {
|
||||
app.canReset = true
|
||||
} else {
|
||||
app.canReset = false
|
||||
}
|
||||
console.log("app.list: ",app.list);
|
||||
resolve(list)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
onEdit(){
|
||||
const { selectId } = this
|
||||
if(selectId > 0){
|
||||
this.$push('sub_pages/house/add?id=' + selectId)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
onDel(){
|
||||
const app = this
|
||||
const { selectId } = this
|
||||
if(selectId > 0){
|
||||
HouseInfoApi.removeHouseInfo(selectId).then(res => {
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
onStatus(status){
|
||||
console.log('this.select: ',this.select);
|
||||
},
|
||||
|
||||
onSearch() {
|
||||
this.$push('/sub_pages/member/member', this.where)
|
||||
console.log('this.where: ',this.where);
|
||||
this.list = []
|
||||
this.page = 1
|
||||
this.onRefreshList()
|
||||
// this.$push('/sub_pages/member/member', this.where)
|
||||
},
|
||||
onBadge(id){
|
||||
this.selectId = id
|
||||
this.bgColor = '#ff0000'
|
||||
this.select.push(id)
|
||||
console.log('this.select: ',this.select);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -131,8 +186,6 @@
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.container {}
|
||||
|
||||
|
||||
.search-wrapper {
|
||||
display: flex;
|
||||
height: 64rpx;
|
||||
|
||||
Reference in New Issue
Block a user