提交 424aad59 authored 作者: 宋雄's avatar 宋雄

bug修复

上级 49660586
......@@ -57,48 +57,7 @@ http.interceptors.response.use((response) => {
uni.hideLoading();
}
}, 30)
//未登录时清空缓存跳转
if(response.statusCode == 401){
let token = uni.getStorageSync('token')
if(token) {
return new Promise((gloabResolve, gloabReject)=> {
http.get('/jwt/refreshCustomerWxToken', {
params: {
token
}
}).then(({content}) => {
uni.setStorageSync('token', content.body.token);
const config = response.config
if(config.method === "POST") {
let cb = new Promise((resolve, reject)=> {
http.post(config.url, {...config.params}, {custom: config.custom})
.then(res=> { resolve(res) })
.catch(err=> { reject(err) })
})
gloabResolve(cb)
}
if(config.method === "GET") {
let cb = new Promise((resolve, reject)=> {
http.get(config.url, {...config.params}, {custom: config.custom})
.then(res=> { resolve(res) })
.catch(err=> { reject(err) })
})
gloabResolve(cb)
}
}).catch(err => {
gloabReject(err)
})
})
} else {
uni.showToast({
title: '请登录',
icon: 'error',
duration: 2000
})
}
} else {
return Promise.reject(response)
}
return Promise.reject(response)
})
export { http }
\ No newline at end of file
......@@ -2,9 +2,9 @@
* 接口参数
*/
const serverConfig = {
baseURL: "https://life.cloud.hjxbc.cn",
// baseURL: "https://life.cloud.hjxbc.cn",
imageURL: "https://life.cloud.hjxbc.cn/sys/common/static/",
// baseURL: "http://192.168.0.100:9999",
baseURL: "http://192.168.0.100:9999",
// baseURL: "http://192.168.0.119:9999",
// baseURL: "http://220.203.25.212:9999", /* 根域名 */
// baseURL: "http://114.67.111.37:8001" /* 根域名 */
......
......@@ -33,7 +33,7 @@
})
}
this.info = result
this.content = result.noticeContent
this.content = result.noticeContent.replace(/\<img/gi, '<img style="max-width:100%;height:auto"')
}
},
onLoad(option) {
......@@ -80,6 +80,10 @@
font-size: 28rpx;
color: #6A696D;
line-height: 60rpx;
word-break: break-all;
img {
max-width: 100%;
}
}
}
</style>
\ No newline at end of file
......@@ -31,7 +31,10 @@
},
onChangeHouse(item) {
getApp().globalData.registerInfo = {}
if(item.communityCode === this.currentHouseCode) return
// if(item.communityCode === this.currentHouseCode) return
uni.setStorageSync('user_type', '1')
uni.setStorageSync('property_code', item.platformCode)
uni.setStorageSync('property_name', item.platformName)
uni.setStorageSync('platform_code', item.communityCode)
uni.setStorageSync('platform_name', item.communityName)
uni.reLaunch({
......@@ -48,14 +51,14 @@
}
},
onLoad() {
this.currentHouseCode = uni.getStorageSync('platform_code')
this.currentHouseCode = uni.getStorageSync('platform_code') || ''
let type = uni.getStorageSync('user_type')
if(type === '1') {
this.getList()
} else {
if(type === '2') {
let data = uni.getStorageSync('user_house_list')
houseAllList = JSON.parse(data)
this.houseList = [...houseAllList]
} else {
this.getList()
}
}
}
......
......@@ -17,7 +17,7 @@
<view class="asterisk">*</view>投诉人姓名
</view>
<view class="form-item-fr">
<input class="form-item-tit" v-model="formData.userName" focus placeholder="请输入投诉人姓名" />
<input class="form-item-tit" v-model="formData.userName" placeholder="请输入投诉人姓名" />
</view>
</view>
<view class="form-item">
......@@ -25,14 +25,13 @@
<view class="asterisk">*</view>手机号码
</view>
<view class="form-item-fr">
<input class="form-item-tit" v-model="formData.userPhone" focus placeholder="请输入手机号码" />
<input class="form-item-tit" v-model="formData.userPhone" placeholder="请输入手机号码" />
</view>
</view>
<view class="form-item-text">
<view class="title">问题描述</view>
<view class="textarea-box">
<!-- <uni-easyinput type="textarea" v-model="formData.problemDesc" placeholder="请输入问题描述" /> -->
<textarea class="textarea" :maxlength="200" v-model="formData.problemDesc" auto-height placeholder="请输入问题描述" />
<textarea class="textarea" placeholder-style="font-size:14px" :maxlength="200" v-model="formData.problemDesc" auto-height placeholder="请输入问题描述" />
</view>
</view>
<view class="form-item-text">
......@@ -44,7 +43,7 @@
</uni-forms>
</view>
<view class="form-submit" @click="toAudit()">提交</view>
<button class="form-submit" :loading="isSubmit" :disabled="isSubmit" @click="toAudit()">提交</button>
</view>
</view>
</view>
......@@ -65,7 +64,8 @@
userPhone: '',
problemDesc: ''
},
filePathsList: []
filePathsList: [],
isSubmit: false
}
},
methods: {
......@@ -99,6 +99,7 @@
})
return
}
this.isSubmit = true
let complaintImg = this.filePathsList.map(item=>item.url).join(',')
let data = await addCommunityComplaintApi({
...this.formData,
......@@ -116,6 +117,7 @@
icon: 'none'
});
setTimeout(()=> {
this.isSubmit = false
uni.redirectTo({
url: '/pages/complaintsDetail/index',
});
......@@ -246,6 +248,7 @@
background-color: #F8F8F8;
border-radius: 5px;
.textarea {
font-size: 30rpx;
width: 100%;
min-height: 200rpx;
padding: 5px 10px;
......
......@@ -7,7 +7,7 @@
<image mode="aspectFill" src="../../static/images/icon_up.png" class="icon"></image>
</view>
<view class="nav-top" v-else>
<view class="title" @click="quickEntry">{{waitList.length ? '认证中…' : '请认证'}}</view>
<view class="title" @click="quickEntry">请选择小区</view>
</view>
</view>
<view class="banner">
......@@ -215,108 +215,111 @@
}
},
toCommunity() {
if(this.houseInfo.platformCode) {
uni.navigateTo({
url: `/pages/community/index?code=${this.houseInfo.platformCode}`
});
}
uni.navigateTo({
url: `/pages/community/index?code=${this.houseInfo.platformCode}`
});
},
quickEntry(type) {
let isLogin = uni.getStorageSync('openid')
let isLogin = uni.getStorageSync('openid') // 登录了
if (!!isLogin) {
let currentHouseVerify = getApp().globalData.currentHouseVerify
if(currentHouseVerify) {
if (type == 1) {
uni.navigateTo({
url: '/pages/message/index'
});
} else if (type == 2) {
if(this.waitList.length) {
let propertyCode = uni.getStorageSync('property_code') // 选择了小区
if(propertyCode) {
let currentHouseVerify = getApp().globalData.currentHouseVerify
if(currentHouseVerify) {
if (type == 1) {
uni.navigateTo({
url: `/pages/housingAudit/index?id=${this.waitList[0].id}`
url: '/pages/message/index'
});
} else {
} else if (type == 2) {
if(this.waitList.length) {
uni.navigateTo({
url: `/pages/housingAudit/index?id=${this.waitList[0].id}`
});
} else {
uni.navigateTo({
url: '/pages/housing/index'
});
}
} else if (type == 3) {
uni.navigateTo({
url: '/pages/housing/index'
url: '/pages/payCost/index',
});
}
} else if (type == 3) {
uni.navigateTo({
url: '/pages/payCost/index',
});
} else if (type == 4) {
uni.navigateTo({
url: '/pages/maintenance/index'
});
} else if (type == 5) {
uni.navigateTo({
url: '/pages/complaints/index'
});
} else if (type == 6) {
uni.navigateTo({
url: '/pages/announcement/index'
});
} else if (type == 7) {
uni.navigateTo({
url: `/pages/payCostProperty/index?code=SFLX00001`
});
} else if (type == 8) {
uni.navigateTo({
url: '/pages/myReceipt/index'
});
}
} else {
if(this.waitList.length) {
if(type == 2) {
} else if (type == 4) {
uni.navigateTo({
url: '/pages/maintenance/index'
});
} else if (type == 5) {
uni.navigateTo({
url: '/pages/complaints/index'
});
} else if (type == 6) {
uni.navigateTo({
url: '/pages/announcement/index'
});
} else if (type == 7) {
uni.navigateTo({
url: `/pages/payCostProperty/index?code=SFLX00001`
});
} else if (type == 8) {
uni.navigateTo({
url: `/pages/housingAudit/index?id=${this.waitList[0].id}`
url: '/pages/myReceipt/index'
});
}
} else {
if(this.waitList.length) {
if(type == 2) {
uni.navigateTo({
url: `/pages/housingAudit/index?id=${this.waitList[0].id}`
});
} else {
if(this.isRefuse) {
uni.showToast({
icon: "none",
title: "您的房屋认证已被驳回,请确认!"
})
if(timer) clearTimeout(timer)
timer = null
timer = setTimeout(()=> {
uni.navigateTo({
url: `/pages/housingAudit/index?id=${this.waitList[0].id}`
});
}, 1500)
} else {
uni.showToast({
icon: "none",
title: "您的房屋认证正在审核中,请稍等!"
})
if(timer) clearTimeout(timer)
timer = null
timer = setTimeout(()=> {
uni.navigateTo({
url: `/pages/housingAudit/index?id=${this.waitList[0].id}`
});
}, 1500)
}
}
} else {
if(this.isRefuse) {
uni.showToast({
icon: "none",
title: "您的房屋认证已被驳回,请确认!"
})
if(timer) clearTimeout(timer)
timer = null
timer = setTimeout(()=> {
uni.navigateTo({
url: `/pages/housingAudit/index?id=${this.waitList[0].id}`
});
}, 1500)
if(type == 2) {
uni.navigateTo({
url: '/pages/housing/index',
});
} else {
uni.showToast({
icon: "none",
title: "您的房屋认证正在审核中,请稍等!"
title: '暂未查到业主信息,请认证!'
})
if(timer) clearTimeout(timer)
timer = null
timer = setTimeout(()=> {
uni.navigateTo({
url: `/pages/housingAudit/index?id=${this.waitList[0].id}`
url: '/pages/housing/index',
});
}, 1500)
}
}
} else {
if(type == 2) {
uni.navigateTo({
url: '/pages/housing/index',
});
} else {
uni.showToast({
icon: "none",
title: '暂未查到业主信息,请认证!'
})
if(timer) clearTimeout(timer)
timer = null
timer = setTimeout(()=> {
uni.navigateTo({
url: '/pages/housing/index',
});
}, 1500)
}
}
} else {
this.toCommunity()
}
} else {
uni.hideTabBar()
......@@ -335,6 +338,7 @@
async getUserInfo() {
let openId = uni.getStorageSync('openid')
let phone = uni.getStorageSync('user_phone')
getApp().globalData.registerInfo = {}
let {result} = await queryCommunityRoomByUnitIdApi({openId, phone})
if(result) {
let type = uni.getStorageSync('user_type')
......@@ -405,7 +409,6 @@
if(type === '2') { // 进入设备管理员
if(result.employeeVos && result.employeeVos.comList && result.employeeVos.comList.length) {
this.userType = '2'
uni.setStorageSync('user_type', '2')
uni.setStorageSync('user_name', result.employeeVos.employeeName)
let employeeAvatar = result.employeeVos.employeeAvatar ? `${serverConfig.imageURL}${result.employeeVos.employeeAvatar}` : ''
uni.setStorageSync('user_avatar', employeeAvatar)
......@@ -444,6 +447,8 @@
let houseData = result.communityOwners
getApp().globalData.currentHouseVerify = false
this.userType = '0'
uni.setStorageSync('property_code', houseData[0].propertyCode)
uni.setStorageSync('property_name', houseData[0].propertyName)
uni.setStorageSync('platform_code', houseData[0].platformCode)
uni.setStorageSync('platform_name', houseData[0].platformName)
this.houseInfo = {
......@@ -471,6 +476,8 @@
platformCode: passHouse[0].platformCode,
platformName: passHouse[0].platformName
}
uni.setStorageSync('property_code', passHouse[0].propertyCode)
uni.setStorageSync('property_name', passHouse[0].propertyName)
uni.setStorageSync('platform_code', passHouse[0].platformCode)
uni.setStorageSync('platform_name', passHouse[0].platformName)
this.waitList = houseData.filter(item=>(item.auditStatus !== 'auditPass' && item.platformCode === passHouse[0].platformCode))
......@@ -483,6 +490,8 @@
platformCode: houseData[0].platformCode,
platformName: houseData[0].platformName
}
uni.setStorageSync('property_code', houseData[0].propertyCode)
uni.setStorageSync('property_name', houseData[0].propertyName)
uni.setStorageSync('platform_code', houseData[0].platformCode)
uni.setStorageSync('platform_name', houseData[0].platformName)
this.waitList = houseData.filter(item=>(item.auditStatus !== 'auditPass' && item.platformCode === houseData[0].platformCode))
......
差异被折叠。
......@@ -105,7 +105,7 @@
</uni-forms>
</view>
<view class="form-submit" @click="toAudit()">提交审核</view>
<button class="form-submit" :loading="isSubmit" :disabled="isSubmit" @click="toAudit()">提交审核</button>
</view>
</view>
</view>
......@@ -116,7 +116,7 @@ import {
postcommunityOwnerAddApi,
postcommunityOwnerEditApi
} from '@/config/api.js'
import {isMoble} from '@/utils/util'
import {isMoble, isValidIDCard, isValidPassport, isValidPermit} from '@/utils/util'
export default {
data() {
return {
......@@ -147,7 +147,8 @@ export default {
{label: '港澳通行证', value: '2'},
{label: '护照', value: '3'}
],
certificateIndex: 0
certificateIndex: 0,
isSubmit: false
}
},
methods: {
......@@ -186,6 +187,29 @@ export default {
})
return
}
if(this.formData.certificateNo) {
if(this.certificateIndex === 0 && !isValidIDCard(this.formData.certificateNo)) {
uni.showToast({
title: '请输入正确的身份证',
icon: 'none'
})
return
}
if(this.certificateIndex === 1 && !isValidPermit(this.formData.certificateNo)) {
uni.showToast({
title: '请输入正确的港澳通行证',
icon: 'none'
})
return
}
if(this.certificateIndex === 2 && !isValidPassport(this.formData.certificateNo)) {
uni.showToast({
title: '请输入正确的护照',
icon: 'none'
})
return
}
}
if(this.relationShipIndex === 0) {
this.formData.residentName = this.formData.ownerName
this.formData.residentPhone = this.formData.ownerPhone
......@@ -198,6 +222,7 @@ export default {
return
}
}
this.isSubmit = true
this.formData.relationShip = this.relationShipList[this.relationShipIndex].value
this.formData.certificateType = this.certificateList[this.certificateIndex].value
this.formData['auditStatus'] = 'waitAudit'
......@@ -212,12 +237,15 @@ export default {
title: res.message
})
setTimeout(()=> {
this.isSubmit = false
uni.navigateTo({
url: '/pages/housingAudit/index',
});
}, 1500)
}, 30)
}
}).catch(err=> {
this.isSubmit = false
})
} else {
postcommunityOwnerAddApi({ ...data, ...this.formData}).then(res=> {
......@@ -230,12 +258,15 @@ export default {
title: res.message
})
setTimeout(()=> {
this.isSubmit = false
uni.navigateTo({
url: '/pages/housingAudit/index',
});
}, 1500)
}, 30)
}
}).catch(err=> {
this.isSubmit = false
})
}
}
......
......@@ -37,7 +37,7 @@ let statusList = {
waitDispatch: { name: '待维修', color: 'green' }, // 带派单
waitReceive: { name: '待维修', color: 'green' }, // 待接单
initiateRefuse: { name: '已驳回', color: 'red' }, // 提单驳回
finishRefuse: { name: '已驳回', color: 'red' }, // 回单驳回
finishRefuse: { name: '维修中', color: 'blue' }, // 回单驳回
inRepair: { name: '维修中', color: 'blue' }, // 维修中
finishWaitAudit: { name: '维修中', color: 'blue' }, // 回单待审核
finishAuditPass: { name: '已完成', color: 'gray' } // 完成
......
<template>
<view class="container">
<view class="page">
<view class="page" v-if="formModel">
<view class="housing">
<view class="audit">
<view class="uni-icons">
......@@ -71,6 +71,7 @@
<uni-popup-dialog type="error" cancelText="关闭" confirmText="同意" title="删除信息" content="确定要删除此信息吗?!"
@confirm="dialogConfirm" @close="dialogClose"></uni-popup-dialog>
</uni-popup>
<no-data :show="formModel === null" text="此报修已被删除"></no-data>
</view>
</template>
......@@ -80,7 +81,9 @@
deleteCommunityRepairApi
} from '@/config/api.js'
import serverConfig from "@/config/server_config.js";
import noData from '@/components/no-data/no-data'
export default {
components: {noData},
data() {
return {
statusType: 0,
......@@ -94,6 +97,7 @@
watch: {
formModel: {
handler(newV) {
if(!newV) return
let status = newV.repairStatus
if(['initiateWaitAudit', 'waitDispatch', 'waitReceive'].includes(status)) {
this.statusType = 1
......@@ -107,7 +111,7 @@
desc: '派单中'
})
}
if(['initiateRefuse', 'finishRefuse'].includes(status)) {
if(['initiateRefuse'].includes(status)) {
this.statusType = 2
this.stepActive = 1
this.statusName = '您的维修被驳回,请重新提交'
......@@ -119,7 +123,7 @@
desc: newV.auditOpinion + ' ' + newV.updateTime
})
}
if(['inRepair', 'finishWaitAudit'].includes(status)) {
if(['finishRefuse', 'inRepair', 'finishWaitAudit'].includes(status)) {
this.statusType = 1
this.stepActive = 2
this.statusName = '维修员正在维修中,请耐心等待'
......@@ -159,11 +163,14 @@
},
methods: {
async getDetail(id) {
let {result} = await getCommunityRepairDetailApi({id})
this.formModel = {...result}
let maintenanceImg = result.repairPhoto ? result.repairPhoto.split(',') : []
this.imageList = maintenanceImg.map(item=> `${serverConfig.imageURL}${item}`)
// this.imageList = result.repairPhoto ? result.repairPhoto.split(',') : []
try {
let {result} = await getCommunityRepairDetailApi({id})
this.formModel = {...result}
let maintenanceImg = result.repairPhoto ? result.repairPhoto.split(',') : []
this.imageList = maintenanceImg.map(item=> `${serverConfig.imageURL}${item}`)
} catch(err) {
this.formModel = null
}
},
deleteDialog() {
this.$refs.popup.open()
......@@ -228,9 +235,6 @@
let maintenanceImg = result.repairPhoto ? result.repairPhoto.split(',') : []
this.imageList = maintenanceImg.map(item=> `${serverConfig.imageURL}${item}`)
}
},
onShow() {
}
}
</script>
......
......@@ -9,7 +9,7 @@
<view class="asterisk">*</view>标题
</view>
<view class="form-item-fr">
<input class="form-item-tit" v-model="formData.repairTitle" placeholder="请输入标题" />
<input class="form-item-tit" v-model="formData.repairTitle" focus placeholder="请输入标题" />
</view>
</view>
<view class="form-item">
......@@ -17,7 +17,7 @@
<view class="asterisk">*</view>报修位置
</view>
<view class="form-item-fr">
<input class="form-item-tit" v-model="formData.repairAddress" focus placeholder="请输入报修位置" />
<input class="form-item-tit" v-model="formData.repairAddress" placeholder="请输入报修位置" />
</view>
</view>
<view class="form-item">
......@@ -55,8 +55,8 @@
</view>
<view class="form-item-text">
<view class="title">问题描述</view>
<view class="textarea">
<uni-easyinput type="textarea" :clearable="false" v-model="formData.repairDesc" placeholder="请输入问题描述" />
<view class="textarea-box">
<textarea class="textarea" :maxlength="200" placeholder-style="font-size:14px" v-model="formData.repairDesc" auto-height placeholder="请输入问题描述" />
</view>
</view>
<view class="form-item-text">
......@@ -68,7 +68,7 @@
</uni-forms>
</view>
<view class="form-submit" @click="toAudit()">{{isPageEdit ? '确认' : '下一步'}}</view>
<button class="form-submit" :loading="isSubmit" :disabled="isSubmit" @click="toAudit()">{{isPageEdit ? '确认' : '下一步'}}</button>
</view>
</view>
</view>
......@@ -96,7 +96,8 @@
ownerPhone: '',
repairDesc: ''
},
filePathsList: []
filePathsList: [],
isSubmit: false
}
},
methods: {
......@@ -136,6 +137,7 @@
})
return
}
this.isSubmit = true
// let repairPhoto = this.formData.repairPhoto.map(item=>item.url).join(',')
let repairPhoto = this.filePathsList.map(item=>item.url).join(',')
if(this.isPageEdit) { // 编辑
......@@ -144,9 +146,6 @@
repairPhoto,
repairStatus: 'initiateWaitAudit'
})
// var pages = getCurrentPages();
// var page = pages[pages.length - 3];
// page.$vm.getList()
uni.$emit('change-maintenance');
setTimeout(()=> {
uni.showToast({
......@@ -154,6 +153,7 @@
icon: 'none'
});
setTimeout(()=> {
this.isSubmit = false
uni.navigateBack({delta: 2});
}, 1500)
}, 30)
......@@ -175,6 +175,7 @@
icon: 'none'
});
setTimeout(()=> {
this.isSubmit = false
uni.redirectTo({
url: '/pages/maintenanceAaudit/index',
});
......@@ -337,8 +338,16 @@
color: #373737;
margin-left: 10rpx;
}
.textarea{
.textarea-box {
background-color: #F8F8F8;
border-radius: 5px;
.textarea {
font-size: 30rpx;
width: 100%;
min-height: 200rpx;
padding: 5px 10px;
box-sizing: border-box;
}
}
}
}
......
<template>
<view class="container">
<view class="page">
<view class="page" v-if="noticeList.length">
<view class="item" v-for="(item, index) in noticeList" :key="item.id" @click="toDetail(item, 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>
......@@ -47,8 +46,11 @@ export default {
}
if(this.noticeList[index].noticeStatus === '0') {
this.noticeList[index].noticeStatus = '1'
updateStatusApi({id: row.id, noticeUserId: row.noticeUserId}) // 更改消息状态
var pages = getCurrentPages();
var page = pages[pages.length - 2];
page.$vm.communityInfo.noticeNotRead -= 1
}
updateStatusApi({id: row.id, noticeUserId: row.noticeUserId}) // 更改消息状态
},
async getList() {
let {result} = await getUserNoticeListApi()
......
......@@ -38,6 +38,24 @@ export const hasPerm = perm=> {
/* 是否电话号码 */
export const isMoble = phone=> {
const reg = /^1(3|4|5|7|8)\d{9}$/
const reg = /^1(3|4|5|6|7|8|9)\d{9}$/
return reg.test(phone)
}
/* 是否身份证号 */
export const isValidIDCard = idCard=> {
const reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
return reg.test(idCard)
}
/* 是否护照 */
export const isValidPassport = passport=> {
const reg= /(^[EeKkGgDdSsPpHh]\d{8}$)|(^(([Ee][a-fA-F])|([DdSsPp][Ee])|([Kk][Jj])|([Mm][Aa])|(1[45]))\d{7}$)/; //护照(包括香港和澳门)
return reg.test(passport)
}
/* 是否港澳通行证 */
export const isValidPermit = permit=> {
const reg = /^[HMhm]{1}([0-9]{10}|[0-9]{8})$/; //港澳通行证
return reg.test(permit)
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论