爱尚家接口合并到cms-api.websoft.top

This commit is contained in:
2025-03-05 17:21:00 +08:00
parent 5a030d5a30
commit 2c77a45e5d
23 changed files with 202 additions and 94 deletions

View File

@@ -72,7 +72,7 @@
</u-cell>
</u-form-item>
<u-form-item prop="propertyFees">
<u-cell title="物业费" :isLink="false">
<u-cell title="物业费(元/m²)" :isLink="false">
<u-input type="digit" slot="value" class="input" v-model="form.propertyFees"
inputAlign="right" maxlength="30" :border="false" placeholder="请输入物业费" />
</u-cell>
@@ -114,7 +114,7 @@
</u-cell>
</u-form-item>
<u-form-item prop="password">
<u-cell title="密码" :isLink="false">
<u-cell title="如何看房" :isLink="false">
<u-input slot="value" class="input" v-model="form.password" inputAlign="right"
maxlength="30" :border="false" placeholder="请输入房屋密码" />
</u-cell>
@@ -173,9 +173,17 @@
<text class="title">房源视频</text>
</view>
<view class="form-wrapper">
<view class="images">
<view class="video-box" style="position: relative;" v-if="form.videoUrl">
<view class="colse" style="position: absolute; top: 0; right: 30px; width: 26px; height: 26px;color: #000000; z-index: 88; font-size: 24px; background-color: #cccccc; display: flex;justify-content: center; align-items: center;" @click="closeVideo">
X
</view>
<video loop class="swiper-video" muted :autoplay="false" :src="form.videoUrl"></video>
</view>
<view v-else class="images" style="display: flex; flex-direction: column; justify-content: center; ">
<u-upload :fileList="fileList2" :maxSize="31457280" :width="72" :height="72" accept="video"
@afterRead="afterRead" @delete="deleteVideo" name="2" multiple :maxCount="1"></u-upload>
<text style="padding-left: 8px;">上传视频</text>
</view>
</view>
</u-form-item>
@@ -192,6 +200,18 @@
</view>
</u-form-item>
<u-form-item prop="introduction">
<view class="his-head">
<text class="title">管理员备注</text>
</view>
<view class="form-wrapper">
<view class="textarea">
<u--textarea v-model="form.comments" placeholder="请输备注"
:customStyle="{backgroundColor: '#f3f3f3'}" maxlength="200"></u--textarea>
</view>
</view>
</u-form-item>
<block v-if="dict">
<u-action-sheet :show="showSex" :actions="actions" title="请选择性别" description="请选择男或女"
@@ -653,6 +673,13 @@
closeToward() {
this.showToward = false
},
closeVideo(){
this.form.videoUrl = ''
updateHouseInfo(this.form).then(res => {
this.$toast('删除成功')
})
},
confirmRegion(e) {

View File

@@ -4,22 +4,24 @@
<!-- 幻灯片 -->
<view class="swiper">
<view v-show="swiperType == 'image'">
<u-swiper :list="swiperList" height="500rpx" :radius="0" @change="e => currentNum = e.current"
<u-swiper :list="swiperList" height="500rpx" :radius="0" @change="e => currentNum = e.current"
indicatorStyle="right: 20px; bottom: 50px" @click="click">
<view slot="indicator" class="indicator-num">
<text class="indicator-num__text">{{ currentNum + 1 }}/{{ swiperList.length }}</text>
</view>
</u-swiper>
</view>
<view class="video-box" v-show="swiperType == 'video'">
<video loop class="swiper-video" muted :autoplay="true" :src="form.videoUrl"></video>
</view>
<view class="swiper-switch">
<view @click="swiperType = 'image'" :class="{active: swiperType == 'image'}" class="swiper-switch-item">图片</view>
<view @click="swiperType = 'video'" :class="{active: swiperType == 'video'}" class="swiper-switch-item">视频</view>
<view @click="swiperType = 'image'" :class="{active: swiperType == 'image'}" class="swiper-switch-item">
图片</view>
<view @click="swiperType = 'video'" :class="{active: swiperType == 'video'}" class="swiper-switch-item">
视频</view>
</view>
<!-- 房源参数 -->
<view class="house-info">
@@ -29,9 +31,9 @@
</view>
<scroll-view scroll-x class="">
<view class="label">
<view class="u-page__tag-item" :key="index" v-for="(tag, index) in form.houseLabel">
<u-tag :text="tag" type="primary" plain size="mini"></u-tag>
</view>
<view class="u-page__tag-item" :key="index" v-for="(tag, index) in form.houseLabel">
<u-tag :text="tag" type="primary" plain size="mini"></u-tag>
</view>
</view>
</scroll-view>
<view class="dict">
@@ -69,7 +71,7 @@
/{{ form.region || '' }}
</view>
<view class="item col-1">
详细地址{{ form.address || '' }}
物业地址{{ form.address || '' }}
</view>
<view class="item col-2">
租金(/){{ form.rent || '' }}
@@ -78,10 +80,10 @@
房号{{ form.roomNumber || '' }}
</view>
<view v-if="isManager" class="item col-2">
密码{{ form.password || '' }}
如何看房{{ form.password || '' }}
</view>
<view v-if="isManager" class="item col-2">业主电话{{ form.phone || '' }}</view>
<view v-if="isManager" class="item col-2">物业费{{ form.propertyFees || '' }}</view>
<view v-if="isManager" class="item col-2" @click="makePhoneCall">业主电话{{ form.phone || '' }}</view>
<view class="item col-2">物业费(/){{ form.propertyFees || '' }}</view>
<!-- <view v-if="isManager" class="item col-2">租期{{ form.tenancy || '' }}</view> -->
<view class="item col-2" v-if="isManager">
佣金{{ form.commission || '' }}
@@ -153,7 +155,8 @@
<text v-else>收藏</text>
</view>
<view class="item">
<u-button icon="map" type="error" text="预约看房" disabled @click="$push('sub_pages/checkout/checkout?id=' + form.houseId)"></u-button>
<u-button icon="map" type="error" text="预约看房" disabled
@click="$push('sub_pages/checkout/checkout?id=' + form.houseId)"></u-button>
</view>
<view class="item">
<u-button icon="phone" type="primary" text="电话咨询" disabled @click="onCall()"></u-button>
@@ -319,25 +322,25 @@
onLoad(options) {
this.houseId = options.houseId
this.getHouseInfo()
if(options.user_id) {
if (options.user_id) {
getAgentUser(options.user_id).then(res => {
this.agentUser = res.data
})
}else {
} else {
DictApi.getDictionaryOptions({
dictCode: 'service'
}).then(res => {
this.phone = res.data[0].dictDataCode
})
}
getUser().then(res=>{
this.isManager = res.data.gradeId == 16
}).catch((err)=>{
getUser().then(res => {
this.isManager = res.data.gradeId == 16
}).catch((err) => {
console.log(err);
})
},
onShow() {},
onBackPress() {},
@@ -370,15 +373,15 @@
app.swiperList = app.form.files
app.form.houseLabel = JSON.parse(res.data.houseLabel) || []
// app.form.supporting = JSON.parse(res.data.supporting) || []
try{
try {
app.form.supporting = JSON.parse(app.form.supporting)
console.log('app.form.supporting: ',app.form.supporting);
}catch(e){
console.log('app.form.supporting: ', app.form.supporting);
} catch (e) {
console.log(e);
//TODO handle the exception
}
uni.$u.mpShare = {
title: `${app.form.houseTitle} ${app.form.monthlyRent}元/月 ${app.form.houseType} ${app.form.extent}`,
path: `sub_pages/house/detail?houseId=${app.form.houseId}&user_id=${uni.getStorageSync('userId')}`
@@ -393,7 +396,7 @@
HouseInfoApi.likeHouse({
houseId: this.form.houseId,
houseUserId: this.form.userId
}).then(res=>{
}).then(res => {
app.form.liked = res.data
})
},
@@ -402,13 +405,36 @@
uni.makePhoneCall({
phoneNumber: this.agentUser.phone
})
}else if(this.phone) {
} else if (this.phone) {
uni.makePhoneCall({
phoneNumber: this.phone
})
}
},
makePhoneCall() {
if (!this.form.phone) {
uni.showToast({
title: '暂无电话号码',
icon: 'none'
})
return
}
uni.makePhoneCall({
phoneNumber: this.form.phone,
success: () => {
console.log('拨打电话成功')
},
fail: (err) => {
console.log('拨打电话失败', err)
uni.showToast({
title: '拨打电话失败',
icon: 'none'
})
}
})
}
},
watch: {
@@ -478,6 +504,7 @@
.label {
margin: 10rpx 0;
display: flex;
.u-page__tag-item {
margin-bottom: 10rpx;
margin-right: 10rpx;
@@ -651,17 +678,20 @@
.demo-layout {
color: #ff0000;
}
.video-box{
.video-box {
width: 750rpx;
height: 500rpx;
text-align: center;
.swiper-video {
width: 100%;
height: 100%;
margin: auto;
margin: auto;
}
}
.swiper-switch{
.swiper-switch {
position: absolute;
display: flex;
border-radius: 20rpx;
@@ -670,6 +700,7 @@
background-color: rgba(0, 0, 0, 0.35);
left: 30rpx;
bottom: 100rpx;
&-item {
color: #FFFFFF;
flex: 1;
@@ -677,10 +708,11 @@
font-size: 24rpx;
line-height: 40rpx;
border-radius: 20rpx;
&.active {
background-color: #FFFFFF;
color: #333333;
}
}
}

View File

@@ -121,9 +121,9 @@
methods: {
onRefreshList() {
const app = this
const userId = uni.getStorageSync('userId')
// const userId = uni.getStorageSync('userId')
app.where.page = app.page
app.where.userId = userId
// app.where.userId = userId
return new Promise((resolve, reject) => {
HouseInfoApi.pageHouseInfo(app.where)
.then(result => {
@@ -404,4 +404,4 @@
opacity: 0.9;
}
}
</style>
</style>