办公室配套

This commit is contained in:
weicw
2023-09-04 17:59:29 +08:00
parent a45034680e
commit d93010e6fc
4 changed files with 27 additions and 20 deletions

View File

@@ -50,10 +50,10 @@
// 2. 连接聊天服务器 // 2. 连接聊天服务器
if (token) { if (token) {
store.dispatch('GetUserInfo') store.dispatch('GetUserInfo')
store.dispatch('ConnectSocket', { // store.dispatch('ConnectSocket', {
userId: store.getters.userId, // userId: store.getters.userId,
token // token
}) // })
} }
// 3. 获取配置信息 // 3. 获取配置信息
RedisApi.getConfig().then(res => { RedisApi.getConfig().then(res => {

View File

@@ -118,7 +118,7 @@
</view> --> </view> -->
<view class="my-service"> <view class="my-service">
<u-cell-group v-if="userInfo.gradeId == 15" :border="false"> <u-cell-group v-if="userInfo.gradeId == 16" :border="false">
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv2os.png" isLink title="房源管理" @click="$push('sub_pages/house/house')"></u-cell> <u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv2os.png" isLink title="房源管理" @click="$push('sub_pages/house/house')"></u-cell>
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26y.png" isLink title="访客记录"></u-cell> <u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26y.png" isLink title="访客记录"></u-cell>
<u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x.png" isLink title="浏览历史"></u-cell> <u-cell icon="https://oss-aishangjia.oss-cn-shenzhen.aliyuncs.com/v2_rwv26x.png" isLink title="浏览历史"></u-cell>

View File

@@ -146,13 +146,9 @@
<text class="title">办公室配套</text> <text class="title">办公室配套</text>
</view> </view>
<view class="form-wrapper"> <view class="form-wrapper">
<view class="house-label" v-if="dict"> <view class="textarea">
<view class="u-page__tag-item" v-for="(item, index) in dict.supporting[0]" :key="index"> <u--textarea v-model="form.supporting" placeholder="请输入办公室配套"
<u-tag :text="`${item}`" type="info" :plain="inArr(item)" :name="index" :customStyle="{backgroundColor: '#f3f3f3'}" maxlength="200"></u--textarea>
:bgColor="inArr(item) ? '' : '#fd8008'" :borderColor="inArr(item) ? '' : '#fd8008'"
@click="onHouseLabel(item)">
</u-tag>
</view>
</view> </view>
</view> </view>
</u-form-item> </u-form-item>
@@ -353,6 +349,7 @@
DictApi.listDictionary().then(res => { DictApi.listDictionary().then(res => {
this.dict = res.data; this.dict = res.data;
}) })
}, },
getHouse(id){ getHouse(id){
const app = this const app = this
@@ -362,6 +359,8 @@
app.form = res.data app.form = res.data
app.houseLabel = JSON.parse(app.form.houseLabel) || [] app.houseLabel = JSON.parse(app.form.houseLabel) || []
app.fileList1 = JSON.parse(app.form.files) || [] app.fileList1 = JSON.parse(app.form.files) || []
}) })
}, },
onChangeTab(e) { onChangeTab(e) {
@@ -478,11 +477,13 @@
const app = this const app = this
if (app.disabled === true) return if (app.disabled === true) return
console.log("app.tempFile: ", app.tempFile); console.log("app.tempFile: ", app.tempFile);
const supporting = this.supportingData.filter(item=>item.checked)
this.$refs.uForm.validate().then(() => { this.$refs.uForm.validate().then(() => {
app.disabled = true app.disabled = true
app.form.houseLabel = JSON.stringify(app.houseLabel) app.form.houseLabel = JSON.stringify(app.houseLabel)
app.form.files = JSON.stringify(app.fileList1) app.form.files = JSON.stringify(app.fileList1)
app.form.videoUrl = app.fileList2[0]?app.fileList2[0].url: null app.form.videoUrl = app.fileList2[0]?app.fileList2[0].url: null
app.form.supporting = JSON.stringify(supporting)
const saveOrUpdate = app.selectId > 0 ? updateHouseInfo : addHouseInfo; const saveOrUpdate = app.selectId > 0 ? updateHouseInfo : addHouseInfo;
saveOrUpdate(app.form).then(result => { saveOrUpdate(app.form).then(result => {
app.$toast('保存成功') app.$toast('保存成功')
@@ -553,6 +554,9 @@
app.houseLabel.push(text) app.houseLabel.push(text)
} }
}, },
onSupportingLabel(item) {
item.checked = !item.checked
},
inArr(text) { inArr(text) {
const { const {
houseLabel houseLabel

View File

@@ -98,13 +98,8 @@
<view class="title"> <view class="title">
办公室配套 办公室配套
</view> </view>
<view class="field-list"> <view class="about">
<u-grid :border="false" col="5" @click="click"> {{form.supporting}}
<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> </view>
</view> </view>
@@ -329,7 +324,7 @@
}) })
} }
getUser().then(res=>{ getUser().then(res=>{
this.isManager = res.data.gradeId == 15 this.isManager = res.data.gradeId == 16
}).catch((err)=>{ }).catch((err)=>{
console.log(err); console.log(err);
}) })
@@ -355,6 +350,14 @@
app.form.houseLabel = JSON.parse(res.data.houseLabel) || [] app.form.houseLabel = JSON.parse(res.data.houseLabel) || []
// app.form.supporting = JSON.parse(res.data.supporting) || [] // 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 = { uni.$u.mpShare = {
title: `${app.form.houseTitle} ${app.form.monthlyRent}元/月 ${app.form.houseType} ${app.form.extent}`, 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')}` path: `sub_pages/house/detail?houseId=${app.form.houseId}&user_id=${uni.getStorageSync('userId')}`