办公室配套
This commit is contained in:
@@ -146,13 +146,9 @@
|
||||
<text class="title">办公室配套</text>
|
||||
</view>
|
||||
<view class="form-wrapper">
|
||||
<view class="house-label" v-if="dict">
|
||||
<view class="u-page__tag-item" v-for="(item, index) in dict.supporting[0]" :key="index">
|
||||
<u-tag :text="`${item}`" type="info" :plain="inArr(item)" :name="index"
|
||||
:bgColor="inArr(item) ? '' : '#fd8008'" :borderColor="inArr(item) ? '' : '#fd8008'"
|
||||
@click="onHouseLabel(item)">
|
||||
</u-tag>
|
||||
</view>
|
||||
<view class="textarea">
|
||||
<u--textarea v-model="form.supporting" placeholder="请输入办公室配套"
|
||||
:customStyle="{backgroundColor: '#f3f3f3'}" maxlength="200"></u--textarea>
|
||||
</view>
|
||||
</view>
|
||||
</u-form-item>
|
||||
@@ -353,6 +349,7 @@
|
||||
DictApi.listDictionary().then(res => {
|
||||
this.dict = res.data;
|
||||
})
|
||||
|
||||
},
|
||||
getHouse(id){
|
||||
const app = this
|
||||
@@ -362,6 +359,8 @@
|
||||
app.form = res.data
|
||||
app.houseLabel = JSON.parse(app.form.houseLabel) || []
|
||||
app.fileList1 = JSON.parse(app.form.files) || []
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
onChangeTab(e) {
|
||||
@@ -478,11 +477,13 @@
|
||||
const app = this
|
||||
if (app.disabled === true) return
|
||||
console.log("app.tempFile: ", app.tempFile);
|
||||
const supporting = this.supportingData.filter(item=>item.checked)
|
||||
this.$refs.uForm.validate().then(() => {
|
||||
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
|
||||
app.form.supporting = JSON.stringify(supporting)
|
||||
const saveOrUpdate = app.selectId > 0 ? updateHouseInfo : addHouseInfo;
|
||||
saveOrUpdate(app.form).then(result => {
|
||||
app.$toast('保存成功')
|
||||
@@ -553,6 +554,9 @@
|
||||
app.houseLabel.push(text)
|
||||
}
|
||||
},
|
||||
onSupportingLabel(item) {
|
||||
item.checked = !item.checked
|
||||
},
|
||||
inArr(text) {
|
||||
const {
|
||||
houseLabel
|
||||
|
||||
@@ -98,13 +98,8 @@
|
||||
<view class="title">
|
||||
办公室配套
|
||||
</view>
|
||||
<view class="field-list">
|
||||
<u-grid :border="false" col="5" @click="click">
|
||||
<u-grid-item v-for="(baseListItem,baseListIndex) in form.supporting" :key="baseListIndex">
|
||||
<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="baseListItem.name" :size="22"></u-icon>
|
||||
<text class="grid-text">{{baseListItem.title}}</text>
|
||||
</u-grid-item>
|
||||
</u-grid>
|
||||
<view class="about">
|
||||
{{form.supporting}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -329,7 +324,7 @@
|
||||
})
|
||||
}
|
||||
getUser().then(res=>{
|
||||
this.isManager = res.data.gradeId == 15
|
||||
this.isManager = res.data.gradeId == 16
|
||||
}).catch((err)=>{
|
||||
console.log(err);
|
||||
})
|
||||
@@ -355,6 +350,14 @@
|
||||
app.form.houseLabel = JSON.parse(res.data.houseLabel) || []
|
||||
// app.form.supporting = JSON.parse(res.data.supporting) || []
|
||||
|
||||
try{
|
||||
app.form.supporting = JSON.parse(app.form.supporting)
|
||||
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}m²`,
|
||||
path: `sub_pages/house/detail?houseId=${app.form.houseId}&user_id=${uni.getStorageSync('userId')}`
|
||||
|
||||
Reference in New Issue
Block a user