上传视频,页面调整
This commit is contained in:
@@ -121,7 +121,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</u-form-item>
|
||||
|
||||
|
||||
<u-form-item prop="images">
|
||||
<view class="his-head">
|
||||
<text class="title">房源照片</text>
|
||||
@@ -134,6 +134,18 @@
|
||||
</view>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item prop="images">
|
||||
<view class="his-head">
|
||||
<text class="title">房源视频</text>
|
||||
</view>
|
||||
<view class="form-wrapper">
|
||||
<view class="images">
|
||||
<u-upload :fileList="fileList2" :maxSize="31457280" :width="72" :height="72" accept="video"
|
||||
@afterRead="afterRead" @delete="deleteVideo" name="2" multiple :maxCount="1"></u-upload>
|
||||
</view>
|
||||
</view>
|
||||
</u-form-item>
|
||||
|
||||
<u-form-item prop="introduction">
|
||||
<view class="his-head">
|
||||
<text class="title">房源介绍</text>
|
||||
@@ -229,6 +241,7 @@
|
||||
status: 10
|
||||
},
|
||||
fileList1: [],
|
||||
fileList2: [],
|
||||
loading: false,
|
||||
// regionsData: [
|
||||
// ['广西壮族自治区','广东'],
|
||||
@@ -418,6 +431,7 @@
|
||||
app.disabled = true
|
||||
app.form.houseLabel = JSON.stringify(app.houseLabel)
|
||||
app.form.files = JSON.stringify(app.fileList1)
|
||||
app.form.videoUrl = app.fileList2[0]?app.fileList2[0].url: null
|
||||
const saveOrUpdate = app.selectId > 0 ? updateHouseInfo : addHouseInfo;
|
||||
saveOrUpdate(app.form).then(result => {
|
||||
app.$toast('保存成功')
|
||||
@@ -614,7 +628,7 @@
|
||||
this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
|
||||
status: 'success',
|
||||
message: '',
|
||||
url: result.url,
|
||||
url: event.name == 2 ?result.path: result.url,
|
||||
thumb: result.thumbUrl
|
||||
}))
|
||||
fileListLen++
|
||||
|
||||
@@ -3,12 +3,23 @@
|
||||
|
||||
<!-- 幻灯片 -->
|
||||
<view class="swiper">
|
||||
<u-swiper :list="swiperList" :height="250" :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 v-show="swiperType == 'image'">
|
||||
<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 = 'video'" :class="{active: swiperType == 'video'}" class="swiper-switch-item">视频</view>
|
||||
<view @click="swiperType = 'image'" :class="{active: swiperType == 'image'}" class="swiper-switch-item">图片</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 房源参数 -->
|
||||
<view class="house-info">
|
||||
@@ -16,14 +27,16 @@
|
||||
{{ form.houseTitle || '' }}
|
||||
<!-- 五象航洋城三室一厅采光好新房精装修三房一厅 采光好,乘诚意出售 -->
|
||||
</view>
|
||||
<view class="label">
|
||||
<view class="u-page__tag-item" v-for="tag in form.houseLabel">
|
||||
<u-tag :text="tag" type="primary" plain size="mini"></u-tag>
|
||||
<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>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="dict">
|
||||
<view class="dict-item">
|
||||
<text class="title">{{ form.monthlyRent || 0 }}元/月</text>
|
||||
<text class="title">{{ form.videoUrl.monthlyRent || 0 }}元/月</text>
|
||||
<text class="desc">月租</text>
|
||||
</view>
|
||||
<view class="dict-item">
|
||||
@@ -290,6 +303,7 @@
|
||||
borderRadius: '12rpx'
|
||||
},
|
||||
heart: false,
|
||||
swiperType: 'video',
|
||||
latitude: 39.909,
|
||||
longitude: 116.39742,
|
||||
covers: [{
|
||||
@@ -413,7 +427,6 @@
|
||||
.label {
|
||||
margin: 10rpx 0;
|
||||
display: flex;
|
||||
|
||||
.u-page__tag-item {
|
||||
margin-bottom: 10rpx;
|
||||
margin-right: 10rpx;
|
||||
@@ -587,4 +600,37 @@
|
||||
.demo-layout {
|
||||
color: #ff0000;
|
||||
}
|
||||
.video-box{
|
||||
width: 750rpx;
|
||||
height: 500rpx;
|
||||
text-align: center;
|
||||
.swiper-video {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
.swiper-switch{
|
||||
position: absolute;
|
||||
display: flex;
|
||||
border-radius: 20rpx;
|
||||
height: 40rpx;
|
||||
width: 200rpx;
|
||||
background-color: rgba(0, 0, 0, 0.35);
|
||||
left: 30rpx;
|
||||
bottom: 100rpx;
|
||||
&-item {
|
||||
color: #FFFFFF;
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
line-height: 40rpx;
|
||||
border-radius: 20rpx;
|
||||
&.active {
|
||||
background-color: #FFFFFF;
|
||||
color: #333333;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -44,7 +44,7 @@
|
||||
<u-tag :text="item.status == 0 ? '上架' : '下架'" plain
|
||||
:type="item.status == 0 ? 'success' : 'error'"></u-tag>
|
||||
</view>
|
||||
<image class="image" :src="item.files[0].url" mode="widthFix"></image>
|
||||
<image class="image" :src="item.files[0].url" mode="aspectFill"></image>
|
||||
<view class="info">
|
||||
<view class="title">{{ item.houseTitle }}</view>
|
||||
<view class="desc"><text>{{ item.extent }}m²|{{ item.toward }}</text></view>
|
||||
|
||||
Reference in New Issue
Block a user