提交 7c88b774 authored 作者: 宋雄's avatar 宋雄

对接接口

上级 1452ba4a
<script>
export default {
globalData: {
isMobieDevice: true,
physicalInvoiceList: [] // 新增物理发票信息
houseInfo: {},
configData: {
openid: '',
sessionKey: '',
unionid: null
},
user_phone: '',
registerInfo: {
propertyName: '',
propertyCode: '',
platformName: '',
platformCode: '',
buildingId: '',
buildingName: '',
unitId: '',
unitName: '',
roomId: '',
roomName: '',
buildingStatus: '',
buildingType: '',
isDefault: 0,
relationShip: '',
residentName: '',
residentPhone: '',
sex: '',
certificateType: '',
certificateNo: ''
},
maintenanceInfo: {
repairAddress: '',
repairArticle: '',
repairTitle: '',
ownerPhone: '',
reservationTime: '',
repairDesc: '',
repairPhoto: []
},
complaintInfo: {
// complaintThem: '',
// userName: '',
// userPhone: '',
// problemDesc: '',
// complaintImg: []
complaintImg: "http://192.168.0.118:9999/sys/common/static/scott/pic/DZaw29g8jc2g8517134094d63c4f033b196de2d131c5_1686290068976.jpg,http://192.168.0.118:9999/sys/common/static/scott/pic/Zagv670TpdYHaf63c87fc76c404e7e94bcb7470a353d_1686290068677.jpg,http://192.168.0.118:9999/sys/common/static/scott/pic/rYyK6iZ8EKNEdf951feec766be4346aed5987fee273b_1686290068684.png",
complaintTheme: "邻居装修太吵",
problemDesc: "邻居每天两三点装修,太不厚道",
userId: "1666361228882726913",
userName: "张三",
userPhone: "13119098978"
}
},
onLaunch: function() {
//小程序自动更新
......@@ -33,13 +81,13 @@
}
});
}
let _this = this;
wx.getSystemInfo({
success: function(res) {
let platform = res.platform
_this.globalData.isMobieDevice = platform == "ios" || platform == "android" || platform == "devtools"
}
})
// let _this = this;
// wx.getSystemInfo({
// success: function(res) {
// let platform = res.platform
// _this.globalData.isMobieDevice = platform == "ios" || platform == "android" || platform == "devtools"
// }
// })
},
onShow: function() {
console.log('App Show')
......
<template>
<view>
<uni-popup ref="authorization" background-color="#fff">
<view class="content-page" @touchmove="stopTouchMove">
<view class="img-box">
<!-- <image style="width: 100rpx; height: 100rpx;margin:22rpx;" mode="aspectFill" :src="`${serverConfig.pictureURL}/images/logo.png`"></image> -->
</view>
<view class="text">为了更完美的体验,请授权获取电话</view>
<button class="login-btn" type="primary" open-type="getPhoneNumber" @getphonenumber="onGetPhoneNumber" hover-class="none">手机号登录/注册</button>
<view class="refuse" @click="refuse">取消</view>
</view>
</uni-popup>
</view>
</template>
<script>
import {
analysisMobileApi,
getPropertyLoginApi,
bindingUserInfoApi
} from "@/config/api.js"
import serverConfig from "@/config/server_config.js";
export default {
data() {
return {
serverConfig,
configData: {
openid: '',
sessionKey: '',
unionid: null
}
}
},
onReady() {
const userOpenId = uni.getStorageSync('openid');
if(!userOpenId) {
wx.login({
success (res) {
if (res.code) {
getPropertyLoginApi({code: res.code}).then(row=> {
if(row.code === 200) {
getApp().globalData.configData = {...row.result}
}
})
}
}
})
}
},
methods: {
onOpenLogin() {
this.$refs.authorization.open('center')
},
stopTouchMove() {
return false
},
refuse() {
this.$emit('refuse')
this.$refs.authorization.close()
uni.showToast({
icon: "none",
title: '您拒绝了授权,登录失败!'
})
},
//获取手机号
async onGetPhoneNumber(e) {
if (e.detail.errMsg === "getPhoneNumber:fail user deny") { //用户决绝授权
//拒绝授权后弹出一些提示
uni.showModal({
content: '您拒绝了授权,登录失败!',
showCancel: false
})
} else { //允许授权
let res = await analysisMobileApi({
code: e.detail.code,
iv: e.detail.iv,
encryptedData: e.detail.encryptedData,
sessionKey: getApp().globalData.configData.sessionKey
})
if (res.code === 200 && res.result) {
this.onbindingUserInfo(res.result.purePhoneNumber)
getApp().globalData.userPhone = res.result.purePhoneNumber
}
}
},
// 绑定用户
async onbindingUserInfo(phone) {
const { openid } = getApp().globalData.configData;
let res = await bindingUserInfoApi({openId: openid, phone})
if(res.code === 200 && res.result) {
uni.setStorageSync('openid', res.result.communityUser.openid);
uni.setStorageSync('user_phone', res.result.communityUser.phone);
let userType = res.result.communityUser.userType
if(userType === '1') { // 业主
this.$emit('loginEnd', res.result.communityOwners)
} else { // 维修员
this.$emit('loginEnd', res.result.employeeVos)
}
this.$refs.authorization.close()
}
}
}
}
</script>
<style lang="scss">
.content-page {
width: 100vw;
height: 100vh;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
.img-box {
width: 144rpx;
height: 144rpx;
border: 2rpx solid #E4E6E9;
border-radius: 50%;
margin-top: 200rpx;
}
.text {
font-size: 28rpx;
color: #3D3D3D;
line-height: 50rpx;
margin-top: 50rpx;
}
.login-btn {
width: 578rpx;
height: 80rpx;
line-height: 80rpx;
font-size: 28rpx;
color: #FFFFFF;
background: #6799F1;
border-radius: 200rpx;
margin-top: 72rpx;
}
.refuse {
font-size: 28rpx;
color: #767676;
line-height: 33rpx;
margin-top: 34rpx;
}
}
</style>
<template>
<checkbox-group @change="changePolicy">
<label>
<view class="policy-box">
<checkbox value="true" :checked="checked" color="#1677FF" style="transform:scale(0.8)" />
<text class="text">我已阅读并同意</text>
<text class="policy" @click.stop="readAgreement">《用户服务协议》</text>
<text class="text"></text>
<text class="policy" @click.stop="readPolicy">《隐私政策》</text>
</view>
</label>
</checkbox-group>
</template>
<script>
export default {
props: {
checked: {
type: Boolean,
default: false
}
},
methods: {
changePolicy(e) {
this.$emit('change', e.detail.value.length)
},
readPolicy() {
uni.navigateTo({
url: '/pages/policy/policy'
})
},
readAgreement() {
uni.navigateTo({
url: '/pages/policy/agreement'
})
}
}
}
</script>
<style lang="scss">
.policy-box {
padding: 0 30rpx;
font-size: 14px;
vertical-align: middle;
.text {
color: #191A23;
vertical-align: middle;
}
.policy {
color: #1677FF;
vertical-align: middle;
}
}
</style>
差异被折叠。
......@@ -5,10 +5,7 @@ const http = new Request()
http.setConfig((config) => { /* config 为默认全局配置*/
config.baseURL = serverConfig.baseURL;
config.header = {
'Content-Type': 'application/json;charset=UTF-8',
'platform_code': serverConfig.platform_code,
'platform_name': serverConfig.platform_name,
'platform_short_code': serverConfig.platform_short_code
'Content-Type': 'application/json;charset=UTF-8'
}
return config
})
......@@ -19,8 +16,8 @@ http.interceptors.request.use((config) => { // 可使用async await 做异步操
...config.header,
}
//获取存储的token
const token = uni.getStorageSync('token');
config.header['X-Token'] = token;
// const token = uni.getStorageSync('token');
// config.header['X-Token'] = token;
// 根据custom参数中配置的是否需要loading
if (config.custom.load) {
loginPopupNum ++
......@@ -41,7 +38,7 @@ http.interceptors.response.use((response) => {
uni.hideLoading();
}
}, 30)
if(response.data.success) {
if(Array.isArray(response.data) || response.data.success) {
return response.data
} else {
setTimeout(()=> {
......
......@@ -2,11 +2,8 @@
* 接口参数
*/
const serverConfig = {
// baseURL: "http://192.168.0.117:8760",
baseURL: "https://www.goldcloudy.com", /* 根域名 */
// baseURL: "http://114.67.111.37:8001", /* 根域名 */
platform_code: 'P00001',
platform_name: encodeURI('四川金路智云数字科技有限公司'),
platform_short_code: 'P00001'
baseURL: "http://192.168.0.118:9999",
// baseURL: "http://220.203.25.212:9999", /* 根域名 */
// baseURL: "http://114.67.111.37:8001" /* 根域名 */
}
export default serverConfig
\ No newline at end of file
......@@ -2,31 +2,17 @@
<view class="container">
<view class="page">
<view class="complaints">
<view class="information" @click="toDetail()">
<view class="title yellow">小区垃圾桶太少<view class="tag">待处理</view>
<view class="information" v-for="item in maintenanceList" :key="item.id" @click="toDetail(item.id)">
<view class="title" :class="item.handleStatus === 'finish' ? 'gray' : 'yellow'">{{item.complaintTheme}}<view class="tag">{{item.statusName}}</view>
</view>
<view class="content">
<view class="item">
<view class="name">投诉人</view>
<view class="detail">张三123 156****7800 </view>
<view class="detail">{{item.userName}} {{item.userPhone}}</view>
</view>
<view class="item">
<view class="name">投诉时间</view>
<view class="detail">2022年3月12日</view>
</view>
</view>
</view>
<view class="information" @click="toDetail()">
<view class="title gray">浴霸不出水了<view class="tag">已完成</view>
</view>
<view class="content">
<view class="item">
<view class="name">投诉人</view>
<view class="detail">张三123 156****7800 </view>
</view>
<view class="item">
<view class="name">投诉时间</view>
<view class="detail">2022年3月12日</view>
<view class="detail">{{item.complaintTime}}</view>
</view>
</view>
</view>
......@@ -39,24 +25,44 @@
</template>
<script>
import {
getCommunityComplaintListApi,
} from '@/config/api.js'
import {Moment} from '@/utils/moment.js'
const handleStatus = {
waitPending: '待处理',
finish: '处理完成'
}
export default {
data() {
return {}
return {
maintenanceList: []
}
},
methods: {
toDetail() {
toDetail(id) {
uni.navigateTo({
url: '/pages/complaintsDetail/index',
url: '/pages/complaintsDetail/index?id=' + id
});
},
toEditor() {
uni.navigateTo({
url: '/pages/complaintsAdd/index',
});
},
async getList() {
let {result} = await getCommunityComplaintListApi({userId: getApp().globalData.houseInfo.id})
this.maintenanceList = result.records.map(item=> {
return {
...item,
statusName: handleStatus[item.handleStatus],
complaintTime: new Moment(new Date(item.createTime).getTime()).format('YYYY-MM-DD HH:mm'),
}
})
}
},
onLoad() {
this.getList()
},
onShow() {
......@@ -110,26 +116,6 @@
}
}
.red {
border-left: 2px solid #F42E2E;
.tag {
color: #F42E2E;
border: 1px solid #F42E2E;
background-color: #FFF5F5;
}
}
.green {
border-left: 2px solid #10D680;
.tag {
color: #10D680;
border: 1px solid #10D680;
background-color: #F1FFF9;
}
}
.gray {
border-left: 2px solid #B6B6BA;
......
......@@ -9,7 +9,7 @@
<view class="asterisk">*</view>投诉主题
</view>
<view class="form-item-fr">
<input class="form-item-tit" v-model="formData.name1" focus placeholder="请输入投诉主题" />
<input class="form-item-tit" v-model="formData.complaintTheme" focus placeholder="请输入投诉主题" />
</view>
</view>
<view class="form-item">
......@@ -17,8 +17,7 @@
<view class="asterisk">*</view>投诉人姓名
</view>
<view class="form-item-fr">
<view class="form-item-tit">张三</view>
<uni-icons type="forward" color="#E4E4EA"></uni-icons>
<input class="form-item-tit" v-model="formData.userName" focus placeholder="请输入投诉人姓名" />
</view>
</view>
<view class="form-item">
......@@ -26,21 +25,19 @@
<view class="asterisk">*</view>手机号码
</view>
<view class="form-item-fr">
<view class="form-item-tit">18888888888</view>
<uni-icons type="forward" color="#E4E4EA"></uni-icons>
<input class="form-item-tit" v-model="formData.userPhone" focus placeholder="请输入手机号码" />
</view>
</view>
<view class="form-item-text">
<view class="title">问题描述</view>
<view class="textarea">
<uni-easyinput type="textarea" v-model="baseFormData.introduction"
placeholder="请输入问题描述" /></uni-easyinput>
<uni-easyinput type="textarea" v-model="formData.problemDesc" placeholder="请输入问题描述" />
</view>
</view>
<view class="form-item-text">
<view class="title">问题图片(最多传三张)</view>
<view class="picker">
<uni-file-picker limit="3"></uni-file-picker>
<uni-file-picker file-mediatype="image" limit="3" @select="onSelectImage"></uni-file-picker>
</view>
</view>
</uni-forms>
......@@ -53,24 +50,88 @@
</template>
<script>
import {
uploadFile,
addCommunityComplaintApi
} from '@/config/api.js'
import serverConfig from "@/config/server_config.js";
export default {
data() {
return {
formData: {
name: '',
},
datetimesingle: '',
complaintTheme: '邻居装修太吵',
userName: '张三',
userPhone: '13119098978',
problemDesc: '邻居每天两三点装修,太不厚道',
complaintImg: []
}
}
},
methods: {
toAudit() {
}
async toAudit() {
// let complaintImg = this.formData.complaintImg.map(item=>item.url).join(',')
// let data =await addCommunityComplaintApi({
// ...this.formData,
// complaintImg,
// userId: getApp().globalData.houseInfo.id
// })
// getApp().globalData.complaintInfo = {
// ...this.formData,
// complaintImg,
// repairStatus: 'waitAudit'
// }
// setTimeout(()=> {
// uni.showToast({
// title: '提交成功!',
// icon: 'none'
// });
// setTimeout(()=> {
uni.navigateTo({
url: '/pages/complaintsDetail/index',
});
// }, 1500)
// }, 30)
},
onLoad() {
uploadImage(path) {
return new Promise((resolve, reject)=> {
uploadFile({
filePath: path,
name: 'file',
formData: { //其他需要携带的参数
'biz': 'scott/pic'
}
}).then(({message})=> {
resolve(message)
}).catch(err=> {
reject(err)
})
})
},
onShow() {
onSelectImage(e) {
let serveList = []
e.tempFilePaths.forEach(url=> {
serveList.push(this.uploadImage(url))
})
Promise.all(serveList).then(data=> {
let list = data.map(url=> {
let chunk = url.split('.')
return {
url: serverConfig.baseURL + '/sys/common/static/' + url,
name: chunk[0],
extname: chunk[1]
}
})
this.formData.complaintImg = this.formData.complaintImg.concat(list)
}).catch(err=> {
setTimeout(()=> {
uni.showToast({
title: '上传失败,请重试!',
icon: 'none'
});
}, 30)
console.log(err)
})
}
}
}
</script>
......
......@@ -3,37 +3,36 @@
<view class="page">
<view class="complaints">
<view class="information">
<view class="title">小区垃圾桶太少</view>
<view class="title">{{complaintsDetail.complaintThem || ''}}</view>
<view class="content">
<view class="item">
<view class="name">投诉人</view>
<view class="detail">张三123</view>
<view class="detail">{{complaintsDetail.userName || ''}}</view>
</view>
<view class="item">
<view class="name">投诉时间</view>
<view class="detail">2020年3月12日</view>
<view class="detail">{{complaintsDetail.complaintTime || ''}}</view>
</view>
<view class="item">
<view class="name">联系方式</view>
<view class="detail">16589000078</view>
<view class="detail">{{complaintsDetail.userPhone || ''}}</view>
</view>
<view class="item text">
<view class="name">问题描述</view>
<view class="detail">校区垃圾桶太少,导致每次丢垃校区垃圾桶太少,导致每次丢垃校区垃圾桶太少,导致每次丢垃校区垃圾桶太少,导致每次丢垃</view>
<view class="detail">{{complaintsDetail.problemDesc || ''}}</view>
</view>
<view class="item">
<view class="name">状态</view>
<view class="detail"><view class="tag">已处理</view></view>
<view class="detail" :class="item.handleStatus === 'finish' ? 'gray' : 'yellow'"><view class="tag">{{complaintsDetail.statusName}}</view></view>
</view>
<view class="item text">
<view class="item text" v-if="complaintsDetail.handleStatus === 'finish'">
<view class="name">处理结果</view>
<view class="detail">已安排在3、5栋门前增加垃圾桶</view>
<view class="detail">{{complaintsDetail.handleResult}}</view>
</view>
<view class="item text">
<view class="name">附件</view>
<view class="image">
<image src="../../static/images/img02.png" class="icon"></image>
<image src="../../static/images/img03.png" class="icon"></image>
<image v-for="(item,index) in complaintsDetail.complaintImg" :key="index" :src="item" class="icon"></image>
</view>
</view>
</view>
......@@ -44,13 +43,52 @@
</template>
<script>
import {
getCommunityComplaintDetailApi
} from '@/config/api.js'
import {Moment} from '@/utils/moment.js'
const handleStatus = {
waitPending: '待处理',
finish: '处理完成'
}
export default {
data() {
return {}
return {
complaintsDetail: {
complaintThem: '',
userName: '',
userPhone: '',
problemDesc: '',
handleStatus: '',
statusName: '',
complaintImg: []
}
}
},
methods: {},
onLoad() {
methods: {
async getDetail(id) {
let {result} = await getCommunityComplaintDetailApi({id})
this.complaintsDetail = {
...result,
complaintImg: result.complaintImg.split(','),
complaintTime: new Moment(new Date(result.createTime).getTime()).format('YYYY-MM-DD HH:mm'),
statusName: handleStatus[result.handleStatus]
}
}
},
onLoad(options) {
if(options.id) {
this.getDetail(options.id)
} else {
let complaintsDetail = getApp().globalData.complaintInfo
this.complaintsDetail = {
...complaintsDetail,
complaintImg: complaintsDetail.complaintImg.split(','),
complaintTime: new Moment().format('YYYY-MM-DD HH:mm'),
handleStatus: 'waitPending',
statusName: '待处理'
}
}
},
onShow() {
......@@ -101,6 +139,17 @@
width: 65%;
font-size: 28rpx;
color: #373737;
&.yellow .tag {
color: #F1BD4D;
border: 1px solid #F1BD4D;
background-color: #FFFCF6;
}
&.gray .tag {
color: #B6B6BA;
border: 1px solid #B6B6BA;
background-color: #F8F8F8;
}
.tag {
height: 40rpx;
line-height: 40rpx;
......@@ -108,9 +157,6 @@
padding: 2rpx 20rpx;
border-radius: 30rpx;
display: inline-block;
color: #B6B6BA;
border: 1px solid #B6B6BA;
background-color: #F8F8F8;
}
}
}
......
差异被折叠。
......@@ -32,8 +32,8 @@
<view class="form-item">
<view class="form-item-fl">物业公司</view>
<view class="form-item-fr">
<picker @change="bindPickerChange" :value="index" :range="array" class="form-item-tit">
<view class="uni-input">{{array[index] || '请选择'}}</view>
<picker @change="e=>bindPickerChange(e, 'property')" range-key="propertyName" :value="settledKey" :range="settledList" class="form-item-tit">
<view class="uni-input">{{settledList[settledKey].propertyName || '请选择'}}</view>
</picker>
<uni-icons type="forward" color="#E4E4EA"></uni-icons>
</view>
......@@ -41,35 +41,17 @@
<view class="form-item">
<view class="form-item-fl">小区</view>
<view class="form-item-fr">
<picker @change="bindPickerChange" :value="index" :range="array" class="form-item-tit">
<view class="uni-input">{{array[index] || '请选择'}}</view>
<picker @change="e=>bindPickerChange(e, 'company')" range-key="communityName" :value="companyKey" :range="companyList" class="form-item-tit">
<view class="uni-input">{{companyList[companyKey].communityName || '请选择'}}</view>
</picker>
<uni-icons type="forward" color="#E4E4EA"></uni-icons>
</view>
</view>
<view class="form-item">
<view class="form-item-fl">楼栋</view>
<view class="form-item-fl">房屋</view>
<view class="form-item-fr">
<picker @change="bindPickerChange" :value="index" :range="array" class="form-item-tit">
<view class="uni-input">{{array[index] || '请选择'}}</view>
</picker>
<uni-icons type="forward" color="#E4E4EA"></uni-icons>
</view>
</view>
<view class="form-item">
<view class="form-item-fl">单元</view>
<view class="form-item-fr">
<picker @change="bindPickerChange" :value="index" :range="array" class="form-item-tit">
<view class="uni-input">{{array[index] || '请选择'}}</view>
</picker>
<uni-icons type="forward" color="#E4E4EA"></uni-icons>
</view>
</view>
<view class="form-item">
<view class="form-item-fl">户号</view>
<view class="form-item-fr">
<picker @change="bindPickerChange" :value="index" :range="array" class="form-item-tit">
<view class="uni-input">{{array[index] || '请选择'}}</view>
<picker mode="multiSelector" :range="houseList" range-key="name" :value="houseRoomKey" @change="houseKeyChange" @columnchange="colChange" class="form-item-tit">
<view class="uni-input">{{houseRoomName || '请选择'}}</view>
</picker>
<uni-icons type="forward" color="#E4E4EA"></uni-icons>
</view>
......@@ -77,8 +59,8 @@
<view class="form-item">
<view class="form-item-fl">房屋状态</view>
<view class="form-item-fr">
<picker @change="bindPickerChange" :value="index" :range="array" class="form-item-tit">
<view class="uni-input">{{array[index] || '请选择'}}</view>
<picker @change="e=>bindPickerChange(e, 'status')" range-key="label" :value="statusKey" :range="statusList" class="form-item-tit">
<view class="uni-input">{{statusList[statusKey].label || '请选择'}}</view>
</picker>
<uni-icons type="forward" color="#E4E4EA"></uni-icons>
</view>
......@@ -86,8 +68,8 @@
<view class="form-item">
<view class="form-item-fl">房屋用途</view>
<view class="form-item-fr">
<picker @change="bindPickerChange" :value="index" :range="array" class="form-item-tit">
<view class="uni-input">{{array[index] || '请选择'}}</view>
<picker @change="e=>bindPickerChange(e, 'type')" range-key="label" :value="typeKey" :range="typeList" class="form-item-tit">
<view class="uni-input">{{typeList[typeKey].label || '请选择'}}</view>
</picker>
<uni-icons type="forward" color="#E4E4EA"></uni-icons>
</view>
......@@ -95,7 +77,7 @@
<view class="form-item">
<view class="form-item-fl">设为默认房屋</view>
<view class="form-item-fr">
<switch checked color="#6A59F2" style="transform:scale(0.7)" />
<switch :checked="isDefault" color="#6A59F2" style="transform:scale(0.7)" />
</view>
</view>
</uni-forms>
......@@ -108,30 +90,174 @@
</template>
<script>
export default {
import {
getSettledListApi,
getCompanyListApi,
getBuildingListApi,
getCommunityUnitListApi,
getCommunityRoomListApi,
getDictItemsApi
} from '@/config/api.js'
const house = {
propertyName: '',
propertyCode: '',
platformName: '',
platformCode: '',
buildingId: '',
buildingName: '',
unitId: '',
unitName: '',
roomId: '',
roomName: '',
buildingStatus: '',
buildingType: '',
isDefault: 0
}
export default {
data() {
return {
index: '',
array: ['选择一', '选择二', '选择三']
settledList: [],
settledKey: '',
companyList: [],
companyKey: '',
houseList: [[], [], []],
houseRoomKey: [0, 0 , 0],
houseRoomName: '',
statusList: [],
statusKey: '',
typeList: [],
typeKey: '',
isDefault: true
}
},
watch: {
houseRoomKey: {
handler(newV, oldName) {
house.buildingId = this.houseList[0][newV[0]].id
house.buildingName = this.houseList[0][newV[0]].name
house.unitId = this.houseList[1][newV[1]].id
house.unitName = this.houseList[1][newV[1]].name
house.roomId = this.houseList[2][newV[2]].id
house.roomName = this.houseList[2][newV[2]].name
this.houseRoomName = `${this.houseList[0][newV[0]].name} ${this.houseList[1][newV[1]].name} ${this.houseList[2][newV[2]].name}`
},
deep: true
}
},
methods: {
bindPickerChange: function(e) {
this.index = e.detail.value
bindPickerChange(e, type) {
switch(type) {
case 'property':
this.settledKey = Number(e.detail.value)
house.propertyName = this.settledList[this.settledKey].propertyName
house.propertyCode = this.settledList[this.settledKey].propertyCode
this.ongetCompanyList(house.propertyCode)
break;
case 'company':
this.companyKey = Number(e.detail.value)
house.platformName = this.companyList[this.companyKey].communityName
house.platformCode = this.companyList[this.companyKey].communityCode
this.ongetBuildingList(house.platformCode)
break;
case 'status':
this.statusKey = Number(e.detail.value)
house.buildingStatus = this.statusList[this.statusKey].value
break;
case 'type':
this.typeKey = Number(e.detail.value)
house.buildingType = this.statusList[this.typeKey].value
break;
default:
break
}
},
async ongetSettledList() {
let {result} = await getSettledListApi({}, {custom: {load: false}})
this.settledList = result
},
async ongetCompanyList(platformCode) {
let {result} = await getCompanyListApi({platformCode}, {custom: {load: false}})
this.companyList = result
},
async ongetBuildingList(platformCode) {
let {result} = await getBuildingListApi({platformCode}, {custom: {load: false}})
let buildingList = result.map(item=> {
return {
...item,
name: item.buildingName
}
})
this.houseList[0] = new Array().concat([...buildingList])
// this.houseList[0].push(...buildingList)
if(buildingList.length) this.ongetCommunityList()
},
async ongetCommunityList() {
let platformCode = this.houseList[0][this.houseRoomKey[0]].platformCode
let id = this.houseList[0][this.houseRoomKey[0]].id
let {result} = await getCommunityUnitListApi({platformCode, id}, {custom: {load: false}})
let communityList = result.map(item=> {
return {
...item,
name: item.unitName
}
})
this.houseList[1] = new Array().concat([...communityList])
this.ongetHouseList()
},
async ongetHouseList() {
let platformCode = this.houseList[1][this.houseRoomKey[1]].platformCode
let id = this.houseList[1][this.houseRoomKey[1]].id
let {result} = await getCommunityRoomListApi({platformCode, id}, {custom: {load: false}})
let houseList = result.map(item=> {
return {
...item,
name: item.roomNum
}
})
this.houseList[2] = new Array().concat([...houseList])
this.$forceUpdate();
},
ongetDictItems(name) {
return getDictItemsApi(name)
},
colChange(node) {
if(node.detail.column === 0) {
this.houseRoomKey[1] = 0
this.houseRoomKey[0] = node.detail.value
this.ongetCommunityList()
}
if(node.detail.column === 1) {
this.houseRoomKey[2] = 0
this.houseRoomKey[1] = node.detail.value
this.ongetHouseList()
}
},
houseKeyChange(e) {
this.houseRoomKey = e.detail.value
},
toNext() {
house.isDefault = this.isDefault ? 1 : 0
let registerInfo = getApp().globalData.registerInfo
getApp().globalData.registerInfo = {...registerInfo, ...house}
uni.navigateTo({
url: '/pages/housingResidents/index',
});
}
},
onLoad() {
async onLoad() {
this.ongetSettledList()
this.statusList = await this.ongetDictItems('house_status')
this.typeList = await this.ongetDictItems('house_purpose')
},
onShow() {
}
}
}
</script>
<style>
page {
......
......@@ -4,7 +4,7 @@
<view class="housing">
<view class="audit">
<view class="uni-icons"><uni-icons type="more-filled" size="25" color="#F6C864"></uni-icons></view>
<view class="name">房屋审核中,请耐心等待</view>
<view class="name">房屋{{statusTitle}}</view>
</view>
<view class="steps">
<view class="item active">
......@@ -36,23 +36,23 @@
<view class="content">
<view class="item">
<view class="name">物业公司</view>
<view class="detail">广州市南航碧桂园物业公司</view>
<view class="detail">{{userHouse.propertyName || ''}}</view>
</view>
<view class="item">
<view class="name">小区</view>
<view class="detail">广州市南航碧桂园小区</view>
<view class="detail">{{userHouse.platformName || ''}}</view>
</view>
<view class="item">
<view class="name">间号</view>
<view class="detail">101栋2单元402123</view>
<view class="name"></view>
<view class="detail">{{userHouse.buildingName ? (userHouse.buildingName + userHouse.unitName + userHouse.roomName) : ''}}</view>
</view>
<view class="item">
<view class="name">业主</view>
<view class="detail">张三</view>
<view class="name">房间状态</view>
<view class="detail">{{filterbuildingCode(userHouse.buildingStatus, statusList)}}</view>
</view>
<view class="item">
<view class="name">间状态</view>
<view class="detail">租赁</view>
<view class="name">屋用途</view>
<view class="detail">{{filterbuildingCode(userHouse.buildingType, typeList)}}</view>
</view>
</view>
</view>
......@@ -60,42 +60,35 @@
<view class="title">住户信息</view>
<view class="content">
<view class="item">
<view class="name">业主姓名 </view>
<view class="detail">张三</view>
<view class="name">与业主关系</view>
<view class="detail">{{filterbuildingCode(userHouse.relationShip, relationShipList)}}</view>
</view>
<view class="item">
<view class="name">{{userHouse.relationShip === '1' ? '业主' : '住户'}}姓名</view>
<view class="detail">{{userHouse.residentName}}</view>
</view>
<view class="item">
<view class="name">手机号码</view>
<view class="detail">15619009090</view>
<view class="detail">{{userHouse.residentPhone || ''}}</view>
</view>
<view class="item">
<view class="name">住户性别</view>
<view class="detail"></view>
<view class="name">性别</view>
<view class="detail">{{userHouse.sex ? '女' : '男'}}</view>
</view>
<view class="item">
<view class="name">证件类型</view>
<view class="detail">身份证</view>
<view class="detail">{{filterbuildingCode(userHouse.certificateType, certificateList)}}</view>
</view>
<view class="item">
<view class="name">证件号码</view>
<view class="detail">371538199608080987</view>
<view class="detail">{{userHouse.certificateNo || ''}}</view>
</view>
<view class="item">
<view class="name">与业主关系</view>
<view class="detail">租户</view>
</view>
<view class="item">
<view class="name">住户姓名</view>
<view class="detail">李四</view>
</view>
<view class="item">
<view class="name">住户手机号码</view>
<view class="detail">15619009090</view>
</view>
</view>
</view>
<template v-if="userHouse.auditStatus === 'refuse'">
<view class="form-submit" @click="toEditor()">修改</view>
<view class="form-delete" @click="deleteDialog">删除</view>
</template>
</view>
</view>
<uni-popup ref="popup" type="dialog">
......@@ -106,32 +99,89 @@
</template>
<script>
export default {
import {
getDictItemsApi,
queryByOpenIddApi,
deleteByOpenIdApi
} from '@/config/api.js'
export default {
data() {
return {}
return {
statusList: [],
typeList: [],
relationShipList: [
{label: '本人', value: '1'},
{label: '租户', value: '2'},
{label: '亲人', value: '3'},
{label: '朋友', value: '4'}
],
certificateList: [
{label: '身份证', value: '1'},
{label: '港澳通行证', value: '2'},
{label: '护照', value: '3'}
],
userHouse: {}
}
},
computed: {
statusTitle() {
if(this.userHouse.auditStatus === 'waitAudit') return '审核中,请耐心等待'
if(this.userHouse.auditStatus === 'refuse') return '已驳回,请确认'
return ''
}
},
methods: {
filterbuildingCode(code, list) {
if(!code) return
let row = list.find(item=>item.value === code)
return row ? row.label : ''
},
deleteDialog() {
this.$refs.popup.open()
},
dialogConfirm() {
async dialogConfirm() {
let data = await deleteByOpenIdApi({id: this.userHouse.id})
setTimeout(()=> {
uni.showToast({
icon: "none",
title: '删除成功!'
})
setTimeout(()=> {
uni.switchTab({
url: '/pages/home/index'
})
}, 1500)
}, 50)
},
dialogClose() {
this.$refs.popup.close()
},
toEditor() {
getApp().globalData.registerInfo = {...this.userHouse}
uni.navigateTo({
url: '/pages/housingResidents/index',
url: '/pages/housing/index',
});
},
async getHouseInfo(id) {
let {result} = await queryByOpenIddApi({id})
this.userHouse = {...result}
}
},
onLoad() {
async onLoad(options) {
let data = getApp().globalData.registerInfo
if(data.propertyCode && data.residentName) {
this.userHouse = {...data}
console.log(this.userHouse)
} else {
this.getHouseInfo(options.id)
}
this.statusList = await getDictItemsApi('house_status')
this.typeList = await getDictItemsApi('house_purpose')
},
onShow() {
}
}
}
</script>
<style>
page {
......
......@@ -31,26 +31,29 @@
<uni-forms>
<view class="form-item">
<view class="form-item-fl">
<view class="asterisk">*</view>业主姓名
<view class="asterisk">*</view>与业主关系
</view>
<view class="form-item-fr">
<input class="form-item-tit" v-model="formData.name" focus placeholder="请输入真实姓名" />
<picker @change="e=>bindPickerChange(e, 'relationShip')" range-key="label" :value="formData.relationShip" :range="relationShipList" class="form-item-tit">
<view class="uni-input">{{relationShipList[Number(formData.relationShip)].label || '请选择与业主关系'}}</view>
</picker>
<uni-icons type="forward" color="#E4E4EA"></uni-icons>
</view>
</view>
<view class="form-item">
<view class="form-item-fl">
<view class="asterisk">*</view>联系方式
<view class="asterisk">*</view>{{formData.relationShip === '1' ? '业主' : '住户'}}姓名
</view>
<view class="form-item-fr">
<input class="form-item-tit" v-model="formData.name1" focus placeholder="请输入手机号码" />
<input class="form-item-tit" readonly v-model="formData.residentName" focus placeholder="请输入姓名" />
</view>
</view>
<view class="form-item">
<view class="form-item-fl">
<view class="asterisk"></view>住户性别
<view class="asterisk">*</view>联系方式
</view>
<view class="form-item-fr">
<uni-data-checkbox v-model="formData.sex" :localdata="sexs" class="form-item-tit" />
<input class="form-item-tit" v-model="formData.residentPhone" focus placeholder="请输入手机号码" />
</view>
</view>
<view class="form-item">
......@@ -58,9 +61,8 @@
<view class="asterisk"></view>证件类型
</view>
<view class="form-item-fr">
<picker @change="bindPickerChange" :value="formData.name2" :range="array"
class="form-item-tit">
<view class="uni-input">{{array[index] || '请选择证件类型'}}</view>
<picker @change="e=>bindPickerChange(e, 'certificate')" range-key="label" :value="formData.certificateType" :range="certificateList" class="form-item-tit">
<view class="uni-input">{{certificateList[formData.certificateType].label || '请选择证件类型'}}</view>
</picker>
<uni-icons type="forward" color="#E4E4EA"></uni-icons>
</view>
......@@ -70,35 +72,15 @@
<view class="asterisk"></view>证件号码
</view>
<view class="form-item-fr">
<input class="form-item-tit" v-model="formData.name1" focus placeholder="请输入证件号码" />
<input class="form-item-tit" v-model="formData.certificateNo" focus placeholder="请输入证件号码" />
</view>
</view>
<view class="form-item">
<view class="form-item-fl">
<view class="asterisk">*</view>与业主关系
</view>
<view class="form-item-fr">
<picker @change="bindPickerChange" :value="formData.name2" :range="array"
class="form-item-tit">
<view class="uni-input">{{array[index] || '请选择与业主关系'}}</view>
</picker>
<uni-icons type="forward" color="#E4E4EA"></uni-icons>
</view>
</view>
<view class="form-item">
<view class="form-item-fl">
<view class="asterisk">*</view>住户姓名
</view>
<view class="form-item-fr">
<input class="form-item-tit" v-model="formData.name" focus placeholder="请输入住户姓名" />
</view>
</view>
<view class="form-item">
<view class="form-item-fl">
<view class="asterisk">*</view>住户手机号码
<view class="asterisk"></view>住户性别
</view>
<view class="form-item-fr">
<input class="form-item-tit" v-model="formData.name1" focus placeholder="请输入手机号码" />
<uni-data-checkbox v-model="formData.sex" :localdata="sexs" class="form-item-tit" />
</view>
</view>
</uni-forms>
......@@ -111,14 +93,19 @@
</template>
<script>
export default {
import {
postcommunityOwnerAddApi
} from '@/config/api.js'
export default {
data() {
return {
formData: {
name: '',
name1: '',
relationShip: '1',
residentName: '',
residentPhone: '',
sex: '',
name2: '',
certificateType: '',
certificateNo: ''
},
sexs: [{
text: '男',
......@@ -128,27 +115,51 @@
value: 1
}],
index: '',
array: ['选择一', '选择二', '选择三']
relationShipList: [
{label: '本人', value: '1'},
{label: '租户', value: '2'},
{label: '亲人', value: '3'},
{label: '朋友', value: '4'}
],
certificateList: [
{label: '身份证', value: '1'},
{label: '港澳通行证', value: '2'},
{label: '护照', value: '3'}
]
}
},
methods: {
bindPickerChange: function(e) {
this.index = e.detail.value
bindPickerChange(e, type) {
if(type === 'certificate') {
this.formData.certificateType = e.detail.value
} else {
this.formData.relationShip = e.detail.value
}
},
toAudit() {
let data = getApp().globalData.registerInfo
postcommunityOwnerAddApi({ ...data, ...this.formData}).then(res=> {
getApp().globalData.registerInfo = { ...data, ...this.formData}
console.log(getApp().globalData.registerInfo)
uni.showToast({
icon: "none",
title: res.message
})
setTimeout(()=> {
uni.navigateTo({
url: '/pages/housingAudit/index',
});
}, 1500)
})
}
},
onLoad() {
this.formData.residentPhone = uni.getStorageSync('user_phone')
},
onShow() {
}
}
}
</script>
<style>
page {
......
......@@ -2,73 +2,21 @@
<view class="container">
<view class="page">
<view class="maintenance">
<view class="information">
<view class="title green">浴霸不出水了<view class="tag">待派单</view>
<view class="information" v-for="item in maintenanceList" :key="item.id" @click="onDetail(item.id)">
<view class="title" :class="item.color">{{item.repairTitle}}<view class="tag">{{item.statusName}}</view>
</view>
<view class="content">
<view class="item">
<view class="name">报修地址</view>
<view class="detail">汉江之星小区101栋2单元401</view>
<view class="detail">{{item.repairAddress}}</view>
</view>
<view class="item">
<view class="name">报修物品</view>
<view class="detail">水暖-浴霸</view>
<view class="detail">{{item.repairArticle}}</view>
</view>
<view class="item">
<view class="name">预约上门时间</view>
<view class="detail">2021/09/09 13:00 - 14:00</view>
</view>
</view>
</view>
<view class="information">
<view class="title red">浴霸不出水了<view class="tag">维修中</view>
</view>
<view class="content">
<view class="item">
<view class="name">报修地址</view>
<view class="detail">汉江之星小区101栋2单元401</view>
</view>
<view class="item">
<view class="name">报修物品</view>
<view class="detail">水暖-浴霸</view>
</view>
<view class="item">
<view class="name">预约上门时间</view>
<view class="detail">2021/09/09 13:00 - 14:00</view>
</view>
<view class="item">
<view class="name">维修员</view>
<view class="detail">张三</view>
</view>
<view class="item">
<view class="name">联系方式</view>
<view class="detail">15415234562</view>
</view>
</view>
</view>
<view class="information">
<view class="title gray">浴霸不出水了<view class="tag">已完成</view>
</view>
<view class="content">
<view class="item">
<view class="name">报修地址</view>
<view class="detail">汉江之星小区101栋2单元401</view>
</view>
<view class="item">
<view class="name">报修物品</view>
<view class="detail">水暖-浴霸</view>
</view>
<view class="item">
<view class="name">预约上门时间</view>
<view class="detail">2021/09/09 13:00 - 14:00</view>
</view>
<view class="item">
<view class="name">维修员</view>
<view class="detail">张三</view>
</view>
<view class="item">
<view class="name">联系方式</view>
<view class="detail">15415234562</view>
<view class="detail">{{item.reservationTime}}</view>
</view>
</view>
</view>
......@@ -81,24 +29,66 @@
</template>
<script>
export default {
import {
getCommunityRepairListApi,
} from '@/config/api.js'
let statusList = {
waitAudit: {
name: '待审核',
color: 'green'
},
waitDispatch: {
name: '待派单',
color: 'yellow'
},
inRepair: {
name: '维修中',
color: 'blue'
},
finish: {
name: '已完成',
color: 'gray'
},
refuse: {
name: '审核驳回',
color: 'red'
}
}
export default {
data() {
return {}
return {
maintenanceList: []
}
},
methods: {
toEditor() {
uni.navigateTo({
url: '/pages/maintenanceAdd/index',
});
},
async getList() {
let {result} = await getCommunityRepairListApi({ownerId: getApp().globalData.houseInfo.id})
this.maintenanceList = result.records.map(item=> {
return {
...item,
statusName: statusList[item.repairStatus].name,
color: statusList[item.repairStatus].color
}
})
},
onDetail(id) {
uni.navigateTo({
url: `/pages/maintenanceAaudit/index?id=${id}`
});
}
},
onLoad() {
this.getList()
},
onShow() {
}
}
}
</script>
<style>
page {
......@@ -148,6 +138,26 @@
}
}
.yellow {
border-left: 2px solid #F1BD4D;
.tag {
color: #F1BD4D;
border: 1px solid #F1BD4D;
background-color: #FFFCF6;
}
}
.blue {
border-left: 2px solid #6A59F2;
.tag {
color: #6A59F2;
border: 1px solid #6A59F2;
background-color: #F6F5FF;
}
}
.green {
border-left: 2px solid #10D680;
......
......@@ -5,7 +5,7 @@
<view class="audit">
<view class="uni-icons"><uni-icons type="checkmarkempty" size="25" color="#F6C864"></uni-icons>
</view>
<view class="name">您的维修提交成功,请耐心等待</view>
<view class="name">您的维修{{statusName}},请耐心等待</view>
</view>
<view class="steps-landscape">
<view class="title">维修流程</view>
......@@ -16,39 +16,40 @@
<view class="content">
<view class="item">
<view class="name">报修地址</view>
<view class="detail">汉江之星小区01栋2单元402</view>
<view class="detail">{{formModel.repairAddress}}</view>
</view>
<view class="item">
<view class="name">维修物品</view>
<view class="detail">电梯</view>
<view class="detail">{{formModel.repairArticle}}</view>
</view>
<view class="item">
<view class="name">标题</view>
<view class="detail">电梯坏了</view>
<view class="detail">{{formModel.repairTitle}}</view>
</view>
<view class="item">
<view class="name">手机号码</view>
<view class="detail">16589000078</view>
<view class="detail">{{formModel.ownerPhone}}</view>
</view>
<view class="item">
<view class="name">预约上门时间</view>
<view class="detail">2022/09/09 14: 00 -16:00</view>
<view class="detail">{{formModel.reservationTime}}</view>
</view>
<view class="item text">
<view class="name">问题描述</view>
<view class="detail">9月9号上午电梯突然无法运行9月9号上午电梯突然无法运行9月9号上午电梯突然无法运行</view>
<view class="detail">{{formModel.repairDesc}}</view>
</view>
<view class="item text">
<view class="name">附件</view>
<view class="image">
<image src="../../static/images/img02.png" class="icon"></image>
<image src="../../static/images/img03.png" class="icon"></image>
<image v-for="(url, index) in imageList" :key="index" :src="url" class="icon"></image>
</view>
</view>
</view>
</view>
<template v-if="formModel.repairStatus === 'refuse'">
<view class="form-submit" @click="toEditor()">修改</view>
<view class="form-delete" @click="deleteDialog">删除</view>
</template>
</view>
</view>
<uni-popup ref="popup" type="dialog">
......@@ -59,9 +60,24 @@
</template>
<script>
import {
getCommunityRepairDetailApi,
deleteCommunityRepairApi
} from '@/config/api.js'
const statusName = {
waitAudit: '待审核',
waitDispatch: '待派单',
inRepair: '维修中',
finish: '已完成',
refuse: '审核驳回'
}
import serverConfig from "@/config/server_config.js";
export default {
data() {
return {
statusName: '',
formModel: {},
imageList: [],
active: 1,
list2: [{
title: '提交维修申请',
......@@ -73,21 +89,62 @@
}
},
methods: {
async getDetail(id) {
let {result} = await getCommunityRepairDetailApi({id})
this.statusName = statusName[result.repairStatus]
this.formModel = {...result}
this.imageList = result.repairPhoto.split(',')
},
deleteDialog() {
this.$refs.popup.open()
},
dialogConfirm() {},
async dialogConfirm() {
await deleteCommunityRepairApi({id: this.formModel.id})
setTimeout(()=> {
uni.showToast({
title: '删除成功!',
icon: 'none'
});
// 页面重载
const pages = getCurrentPages()
// 声明一个pages使用getCurrentPages方法
const curPage = pages[pages.length - 1]
// 声明一个当前页面
// curPage.onLoad(curPage.options) // 传入参数
setTimeout(()=> {
uni.navigateBack();
}, 1500)
}, 30)
},
dialogClose() {
this.$refs.popup.close()
},
toEditor() {
getApp().globalData.maintenanceInfo = {
...this.formModel,
repairPhoto: this.formModel.repairPhoto.split(',').map(url=>{
let chunk = url.split('.')
return {
url: serverConfig.baseURL + '/sys/common/static/' + url,
name: chunk[0],
extname: chunk[1]
}
})
}
uni.navigateTo({
url: '/pages/maintenanceAdd/index',
url: '/pages/maintenanceAdd/index?type=edit',
});
}
},
onLoad() {
onLoad(option) {
if(option.id) {
this.getDetail(option.id)
} else {
let result = getApp().globalData.maintenanceInfo
this.statusName = statusName[result.repairStatus]
this.formModel = {...result}
this.imageList = result.repairPhoto.split(',')
}
},
onShow() {
......
......@@ -9,8 +9,7 @@
<view class="asterisk">*</view>报修位置
</view>
<view class="form-item-fr">
<view class="form-item-tit">汉江之星小区</view>
<uni-icons type="forward" color="#E4E4EA"></uni-icons>
<input class="form-item-tit" v-model="formData.repairAddress" focus placeholder="请输入报修位置" />
</view>
</view>
<view class="form-item">
......@@ -18,7 +17,7 @@
<view class="asterisk">*</view>报修物品
</view>
<view class="form-item-fr">
<input class="form-item-tit" v-model="formData.name1" focus placeholder="请输入报修物品" />
<input class="form-item-tit" v-model="formData.repairArticle" placeholder="请输入报修物品" />
</view>
</view>
<view class="form-item">
......@@ -26,23 +25,23 @@
<view class="asterisk"></view>标题
</view>
<view class="form-item-fr">
<input class="form-item-tit" v-model="formData.name1" focus placeholder="请输入标题" />
<input class="form-item-tit" v-model="formData.repairTitle" placeholder="请输入标题" />
</view>
</view>
<view class="form-item">
<!-- <view class="form-item">
<view class="form-item-fl">
<view class="asterisk"></view>证件号码
</view>
<view class="form-item-fr">
<input class="form-item-tit" v-model="formData.name1" focus placeholder="请输入证件号码" />
</view>
<input class="form-item-tit" v-model="formData.name1" placeholder="请输入证件号码" />
</view>
</view> -->
<view class="form-item">
<view class="form-item-fl">
<view class="asterisk">*</view>手机号码
</view>
<view class="form-item-fr">
<input class="form-item-tit" v-model="formData.name1" focus placeholder="请输入手机号码" />
<input class="form-item-tit" v-model="formData.ownerPhone" placeholder="请输入手机号码" />
</view>
</view>
<view class="form-item">
......@@ -50,51 +49,181 @@
<view class="asterisk">*</view>预约上门时间
</view>
<view class="form-item-fr">
<uni-datetime-picker type="datetime" v-model="datetimesingle" :border="false" />
<uni-datetime-picker type="datetime" v-model="formData.reservationTime" return-type="timestamp" :hide-second="true" :clear-icon="false" :icon="false" :border="false" />
<uni-icons type="forward" color="#E4E4EA"></uni-icons>
</view>
</view>
<view class="form-item-text">
<view class="title">问题描述</view>
<view class="textarea">
<uni-easyinput type="textarea" v-model="baseFormData.introduction"
placeholder="请输入问题描述" /></uni-easyinput>
<uni-easyinput type="textarea" v-model="formData.repairDesc" placeholder="请输入问题描述" />
</view>
</view>
<view class="form-item-text">
<view class="title">问题图片(最多传三张)</view>
<view class="picker">
<uni-file-picker limit="3"></uni-file-picker>
<uni-file-picker v-model="formData.repairPhoto" file-mediatype="image" limit="3" @select="onSelectImage"></uni-file-picker>
</view>
</view>
</uni-forms>
</view>
<view class="form-submit" @click="toAudit()">下一步</view>
<view class="form-submit" @click="toAudit()">{{isPageEdit ? '确认' : '下一步'}}</view>
</view>
</view>
</view>
</template>
<script>
import {
uploadFile,
addCommunityRepairApi,
editCommunityRepairApi
} from '@/config/api.js'
import {Moment} from '@/utils/moment.js'
import serverConfig from "@/config/server_config.js";
export default {
data() {
return {
isPageEdit: false,
formData: {
name: '',
repairAddress: '',
repairArticle: '',
repairTitle: '',
ownerPhone: '',
reservationTime: '',
repairDesc: '',
repairPhoto: []
},
datetimesingle: '',
}
},
methods: {
toAudit() {
async toAudit() {
console.log(new Moment(this.formData.reservationTime, 'YYYY-MM-DD HH-mm'))
return
let repairPhoto = this.formData.repairPhoto.map(item=>item.url).join(',')
if(this.isPageEdit) { // 编辑
let data =await editCommunityRepairApi({
...this.formData,
repairPhoto,
ownerId: getApp().globalData.houseInfo.id
})
// getApp().globalData.maintenanceInfo = {
// ...this.formData,
// repairPhoto,
// repairStatus: 'waitAudit',
// reservationTime: new Moment(this.formData.reservationTime, 'YYYY-MM-DD HH-mm')
// }
// setTimeout(()=> {
// uni.showToast({
// title: '编辑成功!',
// icon: 'none'
// });
// setTimeout(()=> {
// uni.navigateTo({
// url: '/pages/maintenanceAaudit/index',
// });
// }, 1500)
// }, 30)
} else {
let data =await addCommunityRepairApi({
...this.formData,
repairPhoto,
ownerId: getApp().globalData.houseInfo.id
})
// getApp().globalData.maintenanceInfo = {
// ...this.formData,
// repairPhoto,
// repairStatus: 'waitAudit',
// reservationTime: new Moment(this.formData.reservationTime, 'YYYY-MM-DD HH-mm')
// }
// setTimeout(()=> {
// uni.showToast({
// title: '提交成功!',
// icon: 'none'
// });
// setTimeout(()=> {
// uni.navigateTo({
// url: '/pages/maintenanceAaudit/index',
// });
// }, 1500)
// }, 30)
}
getApp().globalData.maintenanceInfo = {
...this.formData,
repairPhoto,
repairStatus: 'waitAudit',
reservationTime: new Moment(this.formData.reservationTime, 'YYYY-MM-DD HH-mm')
}
setTimeout(()=> {
uni.showToast({
title: `${this.isPageEdit ? '编辑' : '提交'}成功!`,
icon: 'none'
});
setTimeout(()=> {
uni.navigateTo({
url: '/pages/maintenanceAaudit/index',
});
}, 1500)
}, 30)
},
uploadImage(path) {
return new Promise((resolve, reject)=> {
uploadFile({
filePath: path,
name: 'file',
formData: { //其他需要携带的参数
'biz': 'scott/pic'
}
}).then(({message})=> {
resolve(message)
}).catch(err=> {
reject(err)
})
})
},
onLoad() {
// // 选择上传触发函数
onSelectImage(e) {
let serveList = []
e.tempFilePaths.forEach(url=> {
serveList.push(this.uploadImage(url))
})
Promise.all(serveList).then(data=> {
let list = data.map(url=> {
let chunk = url.split('.')
return {
url: serverConfig.baseURL + '/sys/common/static/' + url,
name: chunk[0],
extname: chunk[1]
}
})
this.formData.repairPhoto = this.formData.repairPhoto.concat(list)
setTimeout(()=> {
uni.showToast({
title: '上传成功!',
icon: 'none'
});
}, 30)
}).catch(err=> {
setTimeout(()=> {
uni.showToast({
title: '上传失败,请重试!',
icon: 'none'
});
}, 30)
console.log(err)
})
},
// 移出图片函数
async deletephoto(){
this.form.attachment = ''
},
},
onLoad(option) {
if(option.type === 'edit') {
this.isPageEdit = true
this.formData = getApp().globalData.maintenanceInfo
}
},
onShow() {
......
......@@ -2,6 +2,17 @@
<view class="container">
<view class="page">
<view class="message">
<view class="item" v-for="(item, index) in noticeList" :key="item.id" @click="toDetail(item.id, index)">
<view class="top">
<view class="title">
<view class="point" v-if="item.noticeStatus === '0'"></view>
<image src="../../static/images/img01.png" class="icon"></image>
<view class="name">{{item.noticeTitle}}</view>
</view>
<image src="../../static/images/icon_more.png" class="arrow"></image>
</view>
<view class="con">{{item.noticeContent}}</view>
</view>
<view class="item" @click="toDetail()">
<view class="top">
<view class="title">
......@@ -48,26 +59,36 @@
</template>
<script>
export default {
import {
getUserNoticeListApi
} from '@/config/api.js'
export default {
data() {
return {
noticeList: []
}
},
methods: {
toDetail() {
toDetail(id, index) {
if(this.noticeList[index].noticeStatus === '0') {
this.noticeList[index].noticeStatus = '1'
}
uni.navigateTo({
url: '/pages/messageDetails/index',
url: '/pages/messageDetails/index?id=' + id,
});
},
async getList(noticeUserId) {
let {result} = await getUserNoticeListApi({noticeUserId})
this.noticeList = result.records
}
},
onLoad() {
onLoad(option) {
this.getList(option.id)
},
onShow() {
}
}
}
</script>
<style>
page {
......
......@@ -2,7 +2,7 @@
<view class="container">
<view class="page">
<view class="news-details">
<view class="title">维修申请状态更新通知<!-- <view class="tag">非常紧急</view> -->
<view class="title">{{info.noticeTitle || ''}}<!-- <view class="tag">非常紧急</view> -->
</view>
<view class="time">来源:物业服务中心 2020/09/08</view>
<view class="content"><rich-text :nodes="content"></rich-text></view>
......@@ -13,23 +13,36 @@
</template>
<script>
export default {
import {
getUserNoticeDetailApi,
updateStatusApi
} from '@/config/api.js'
export default {
data() {
return {
info: {},
content: '本报5月28日讯 为巩固老旧小区改造成果,健全和完善长效管理机制,近日,青岛市城市管理委员会印发了《加强老旧小区改造后物业管理工作方案》(以下简称《方案》)。《方案》明确,今年列入改造计划的470余个老旧小区实行物业管理全覆盖,通过嵌入式开展环卫保洁、环境秩序等全要素整治,综合提升老旧小区环境品质。同时将划分物业管理区域、选举产生业主委员会或居民委员会、选聘物业企业、筹措房屋专项维修资金等事项作为老旧小区改造的前置条件。力争用三年时间推动老旧小区改造后物业服务由“低水平、保基本”向“高质量、全覆盖”转变升级。《方案》指老旧小区改造前应根据房屋、环境、配套设施和房屋产权的状况、长效管理服务需求以及业主消费意愿等实际情况,合理规划物业管理区域。通过召开业主大会选举产生业主委员会或由居委会代行职责,组织召开业主大会决策老旧小区改造后物业管理模式,采取专业化物业服务和社区托管、社会组织代管、居民自管等分类管理方式,实现老旧小区改造后物业管理全覆盖,同步确定房屋专项维修资金的补交、续交及使用,为老旧小区改造后实施长效管理提供资金保障,切实巩固老旧小区改造成果。为确保工作有效落实,在强化保障上,《方案》提出了各区(市)政府可结合实际给予财政补助,补助范围、补助期限、补助标准及方式由区(市)政府自行确定。可利用国有平台企业盘活闲置资产,物业企业通过开展助老、助餐、零售等经营用于服务小区及周边业主,所得收益可以用于补助老旧小区物业服务经费的不足。对自愿投资改造、接管改造后老旧小区签订物业服务合同5年及以上且业主满意度较高的物业企业,区(市)政府可给予有关支持,并给予信用加分。另一方面,结合老旧小区改造工作,建立完善青岛市智慧物业管理服务平台中老旧小区信息大数据,加大前端感知设备的配建力度。引导业主、物业企业积极使用平台,逐步提升物业管理服务的智慧化水平。'
}
},
methods: {
toDetail(id) {
uni.navigateTo({
url: '/pages/messageDetails/index?id=' + id,
});
},
onLoad() {
async getDetail(id) {
let {result} = await getUserNoticeDetailApi({id})
this.info = result
updateStatusApi({...result})
}
},
onLoad(option) {
this.getDetail(option.id)
},
onShow() {
}
}
}
</script>
<style lang="scss" scoped>
......
......@@ -21,7 +21,7 @@
</view>
<image src="../../static/images/icon_more.png" class="arrow"></image>
</view>
<view class="item">
<view class="item" @click="onDetail('/pages/maintenance/index')">
<view class="left">
<image src="../../static/images/user03.png" class="icon"></image>
<div class="title">我的报修</div>
......@@ -76,7 +76,9 @@
}
},
methods: {
onDetail(url) {
uni.navigateTo({url});
}
},
onLoad() {
......
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论