|
@@ -4,19 +4,23 @@
|
|
|
<view class="form">
|
|
<view class="form">
|
|
|
<view class="flex">
|
|
<view class="flex">
|
|
|
<view class="need">*</view>
|
|
<view class="need">*</view>
|
|
|
- <view>请选择小区</view>
|
|
|
|
|
|
|
+ <view>所在小区</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="bg-gray padding-20 " @click="residentialShow=true">
|
|
|
|
|
|
|
+ <view class="bg-gray padding-20">
|
|
|
<input disabled type="text" placeholder="请选择您所在的小区" v-model="data.residentialName" />
|
|
<input disabled type="text" placeholder="请选择您所在的小区" v-model="data.residentialName" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="form">
|
|
<view class="form">
|
|
|
<view class="flex">
|
|
<view class="flex">
|
|
|
<view class="need">*</view>
|
|
<view class="need">*</view>
|
|
|
- <view>报修位置</view>
|
|
|
|
|
|
|
+ <view>报修地点</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="bg-gray padding-20 ">
|
|
|
|
|
- <input type="text" placeholder="请输入报修的具体位置" v-model="data.reportPosition" />
|
|
|
|
|
|
|
+ <view class="bg-gray padding-20 margin-top-20" style="position: relative;">
|
|
|
|
|
+ <input placeholder="报修地点" v-model="data.reportPosition" />
|
|
|
|
|
+ <view @click.stop="roomShow=true" class="cu-btn df bg-blue radius"
|
|
|
|
|
+ style="position: absolute;right: 10rpx;top: 0;bottom: 0;margin:auto;z-index: 99;">
|
|
|
|
|
+ 选择我的房屋
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="form ">
|
|
<view class="form ">
|
|
@@ -24,8 +28,12 @@
|
|
|
<view class="need">*</view>
|
|
<view class="need">*</view>
|
|
|
<view>联系方式</view>
|
|
<view>联系方式</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="bg-gray padding-20 ">
|
|
|
|
|
|
|
+ <view class="bg-gray padding-20 " style="position: relative;">
|
|
|
<input maxlength="11" type="number" placeholder="请输入您的联系方式" v-model="data.reportorPhone" />
|
|
<input maxlength="11" type="number" placeholder="请输入您的联系方式" v-model="data.reportorPhone" />
|
|
|
|
|
+ <button class="cu-btn df bg-blue radius" @getphonenumber="getPhoneNumber" open-type="getPhoneNumber"
|
|
|
|
|
+ style="position: absolute;right: 10rpx;top: 0;bottom: 0;margin:auto;z-index: 99;">
|
|
|
|
|
+ 获取微信电话
|
|
|
|
|
+ </button>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="form">
|
|
<view class="form">
|
|
@@ -37,22 +45,13 @@
|
|
|
<input disabled type="number" placeholder="请选择预约时间" v-model="dateTimeStr" />
|
|
<input disabled type="number" placeholder="请选择预约时间" v-model="dateTimeStr" />
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="form">
|
|
|
|
|
- <view class="flex">
|
|
|
|
|
- <view class="need">*</view>
|
|
|
|
|
- <view>故障简述</view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="bg-gray padding-20 ">
|
|
|
|
|
- <input type="text" placeholder="请输入故障简述" v-model="data.repairName" />
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="card ">
|
|
<view class="card ">
|
|
|
<view class="form" style="height: 320rpx;">
|
|
<view class="form" style="height: 320rpx;">
|
|
|
<view class="bg-gray padding-10">
|
|
<view class="bg-gray padding-10">
|
|
|
- <u-input v-model="data.reportDetail" type="textarea" maxlength="100" height="240"
|
|
|
|
|
- placeholder="故障详细描述" style="width: 100%;line-height: 50rpx;" />
|
|
|
|
|
|
|
+ <u-input v-model="data.reportDetail" type="textarea" maxlength="100" height="240" placeholder="故障描述(必填)"
|
|
|
|
|
+ style="width: 100%;line-height: 50rpx;" />
|
|
|
<view class="text-right text-df text-gray padding-top-10">
|
|
<view class="text-right text-df text-gray padding-top-10">
|
|
|
{{data.reportDetail.length}} / 100
|
|
{{data.reportDetail.length}} / 100
|
|
|
</view>
|
|
</view>
|
|
@@ -80,17 +79,18 @@
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view style="height: 160rpx;"></view>
|
|
<view style="height: 160rpx;"></view>
|
|
|
- <view style="z-index: 999;" class="footer-fixed" :style="{'margin-bottom': safeAreaBottom+'rpx'}" @click="submit">
|
|
|
|
|
|
|
+ <view style="z-index: 999;" class="footer-fixed" :style="{'margin-bottom': safeAreaBottom+'rpx'}"
|
|
|
|
|
+ @click="submit">
|
|
|
<view class="cu-btn flex text-lg bg-red-btn" style="padding: 46rpx 0;">
|
|
<view class="cu-btn flex text-lg bg-red-btn" style="padding: 46rpx 0;">
|
|
|
确定提交
|
|
确定提交
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<u-mask z-index="99999" :show="maskShow" @click="maskShow = false">
|
|
<u-mask z-index="99999" :show="maskShow" @click="maskShow = false">
|
|
|
<view style="margin: 20rpx;" @click.stop="">
|
|
<view style="margin: 20rpx;" @click.stop="">
|
|
|
<textarea @confirm="confirm" @keyboardheightchange="keyboardheightchange" v-model="data.reportDetail"
|
|
<textarea @confirm="confirm" @keyboardheightchange="keyboardheightchange" v-model="data.reportDetail"
|
|
|
value="" style="background-color: #FFFFFF;width: 100%;padding: 20rpx;box-sizing: border-box;"
|
|
value="" style="background-color: #FFFFFF;width: 100%;padding: 20rpx;box-sizing: border-box;"
|
|
|
- placeholder="请填写故障描述(必填)" />
|
|
|
|
|
|
|
+ placeholder="请对您的问题进行描述(必填)" />
|
|
|
<view class="bg-white text-right text-df text-gray padding-10">
|
|
<view class="bg-white text-right text-df text-gray padding-10">
|
|
|
{{data.reportDetail.length}} / 100
|
|
{{data.reportDetail.length}} / 100
|
|
|
</view>
|
|
</view>
|
|
@@ -100,39 +100,37 @@
|
|
|
<time-selector @getDateTime="timeConfirm"></time-selector>
|
|
<time-selector @getDateTime="timeConfirm"></time-selector>
|
|
|
</u-popup>
|
|
</u-popup>
|
|
|
|
|
|
|
|
- <u-select :default-value="defaultValue" value-name="residentialId" label-name="residentialName"
|
|
|
|
|
- @confirm="residentialConfirm" z-index="9999999" v-model="residentialShow" :list="residentialList">
|
|
|
|
|
- </u-select>
|
|
|
|
|
|
|
+ <u-select v-model="roomShow" :list="roomList" @confirm="roomChange" label-name="fullRoomName"
|
|
|
|
|
+ value-name="fullRoomName"></u-select>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import timeSelector from '@/comps/mp-time/index.vue';
|
|
import timeSelector from '@/comps/mp-time/index.vue';
|
|
|
var app = getApp()
|
|
var app = getApp()
|
|
|
- var that;
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
timeSelector
|
|
timeSelector
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- defaultValue: [],
|
|
|
|
|
|
|
+ sessionKey:'',
|
|
|
platform: '',
|
|
platform: '',
|
|
|
maskShow: false,
|
|
maskShow: false,
|
|
|
//图片回显
|
|
//图片回显
|
|
|
imgList: [],
|
|
imgList: [],
|
|
|
data: {
|
|
data: {
|
|
|
//上报人
|
|
//上报人
|
|
|
- reportor:'',
|
|
|
|
|
|
|
+ reportor: '',
|
|
|
//保修电话
|
|
//保修电话
|
|
|
- reportorPhone:'',
|
|
|
|
|
- repairName:'',
|
|
|
|
|
|
|
+ reportorPhone: '',
|
|
|
|
|
+ repairName: '',
|
|
|
//故障详情描述
|
|
//故障详情描述
|
|
|
reportDetail: '',
|
|
reportDetail: '',
|
|
|
//报事来源,1:小程序,2:后台
|
|
//报事来源,1:小程序,2:后台
|
|
|
- reportSource:1,
|
|
|
|
|
|
|
+ reportSource: 1,
|
|
|
//故障位置
|
|
//故障位置
|
|
|
- reportPosition: '',
|
|
|
|
|
|
|
+ reportPosition: '',
|
|
|
//处理状态:待处理
|
|
//处理状态:待处理
|
|
|
handleStatus: 0,
|
|
handleStatus: 0,
|
|
|
//小区id
|
|
//小区id
|
|
@@ -144,8 +142,14 @@
|
|
|
endTime: '',
|
|
endTime: '',
|
|
|
},
|
|
},
|
|
|
base64_image: [],
|
|
base64_image: [],
|
|
|
|
|
+
|
|
|
|
|
+ roomList: [],
|
|
|
|
|
+ roomShow: false,
|
|
|
|
|
+
|
|
|
residentialShow: false,
|
|
residentialShow: false,
|
|
|
|
|
+ defaultValue: [],
|
|
|
residentialList: [],
|
|
residentialList: [],
|
|
|
|
|
+
|
|
|
timeShow: false,
|
|
timeShow: false,
|
|
|
dateTimeStr: ''
|
|
dateTimeStr: ''
|
|
|
}
|
|
}
|
|
@@ -157,28 +161,75 @@
|
|
|
this.data.reportorPhone = getApp().globalData.member.phone
|
|
this.data.reportorPhone = getApp().globalData.member.phone
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ getPhoneNumber(e) {
|
|
|
|
|
+ if (e.detail.errMsg == "getPhoneNumber:ok") {
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ sessionKey: this.sessionKey,
|
|
|
|
|
+ encryptedData: e.detail.encryptedData,
|
|
|
|
|
+ iv: e.detail.iv
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$http.getOpenData(params).then(res => {
|
|
|
|
|
+ this.data.reportorPhone = res.data.purePhoneNumber
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$u.toast('获取手机号失败')
|
|
|
|
|
+ },
|
|
|
|
|
+ async getSessionKey(){
|
|
|
|
|
+ let jsCode = await new Promise((resolve, reject) => {
|
|
|
|
|
+ uni.login({
|
|
|
|
|
+ provider: 'weixin',
|
|
|
|
|
+ success: res => {
|
|
|
|
|
+ resolve(res.code);
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: err => {
|
|
|
|
|
+ reject(err);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ js_code: jsCode,
|
|
|
|
|
+ name: 'community',
|
|
|
|
|
+ app_type: 1
|
|
|
|
|
+ };
|
|
|
|
|
+ let res = await this.$http.getOpenid(params);
|
|
|
|
|
+ this.sessionKey = res.data.session_key
|
|
|
|
|
+ },
|
|
|
initData() {
|
|
initData() {
|
|
|
- that = this
|
|
|
|
|
|
|
+ this.getSessionKey()
|
|
|
//判断是ios还是安卓,ios键盘上移会挤压遮挡层
|
|
//判断是ios还是安卓,ios键盘上移会挤压遮挡层
|
|
|
this.platform = this.$u.os() || "android"
|
|
this.platform = this.$u.os() || "android"
|
|
|
- this.data.memberId=app.globalData.member.id
|
|
|
|
|
|
|
+ this.data.memberId = app.globalData.member.id
|
|
|
if (this.$isEmpty(this.data.memberId)) {
|
|
if (this.$isEmpty(this.data.memberId)) {
|
|
|
this.$dialog.showModalAndBack('系统异常')
|
|
this.$dialog.showModalAndBack('系统异常')
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
//获取用户的userid
|
|
//获取用户的userid
|
|
|
- this.data.reportor = app.globalData.member?app.globalData.member.name:'未知'
|
|
|
|
|
- //从缓存中获取房屋列表
|
|
|
|
|
- this.residentialList = uni.getStorageSync("residentialList")//从缓存中获取默认的小区名字和小区id
|
|
|
|
|
|
|
+ this.data.reportor = app.globalData.member ? app.globalData.member.name : '未知'
|
|
|
//从缓存中获取默认的小区名字和小区id
|
|
//从缓存中获取默认的小区名字和小区id
|
|
|
this.data.residentialName = uni.getStorageSync("plotName")
|
|
this.data.residentialName = uni.getStorageSync("plotName")
|
|
|
this.data.residentialId = uni.getStorageSync("residentialId")
|
|
this.data.residentialId = uni.getStorageSync("residentialId")
|
|
|
- //社区选择器的默认值
|
|
|
|
|
- this.residentialList.forEach((item, index) => {
|
|
|
|
|
- if (item.residentialId === this.data.residentialId) {
|
|
|
|
|
- this.defaultValue.push(index)
|
|
|
|
|
- return
|
|
|
|
|
|
|
+ //获取我的房间
|
|
|
|
|
+ this.getRoomByMemberId()
|
|
|
|
|
+ },
|
|
|
|
|
+ roomChange(e) {
|
|
|
|
|
+ this.data.reportPosition = e[0].value
|
|
|
|
|
+ },
|
|
|
|
|
+ getRoomByMemberId() {
|
|
|
|
|
+ let memberId = this.vuex_member.id
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ residentialId: uni.getStorageSync('residentialId'),
|
|
|
|
|
+ id: memberId
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$http.getRoomByMemberId(params).then(res => {
|
|
|
|
|
+ if (res.data.success) {
|
|
|
|
|
+ this.roomList = res.data.data
|
|
|
|
|
+ this.roomList.forEach(item => {
|
|
|
|
|
+ item.fullRoomName = item.residentialName + "-" + item.buildingName + "-" + item
|
|
|
|
|
+ .unitName + "-" + item.name
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
submit() {
|
|
submit() {
|
|
@@ -187,7 +238,7 @@
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
if (this.$isEmpty(this.data.reportPosition)) {
|
|
if (this.$isEmpty(this.data.reportPosition)) {
|
|
|
- this.$u.toast("请填写具体位置")
|
|
|
|
|
|
|
+ this.$u.toast("请输入报修的具体地点")
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
if (this.$isEmpty(this.data.reportorPhone)) {
|
|
if (this.$isEmpty(this.data.reportorPhone)) {
|
|
@@ -207,14 +258,14 @@
|
|
|
this.$u.toast("开始时间不能小于结束时间")
|
|
this.$u.toast("开始时间不能小于结束时间")
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- if (this.$isEmpty(this.data.repairName)) {
|
|
|
|
|
- this.$u.toast("请输入故障简述")
|
|
|
|
|
|
|
+ if (this.$isEmpty(this.data.reportDetail)) {
|
|
|
|
|
+ this.$u.toast("请对您的问题进行描述")
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
this.data.pic = this.base64_image.join(",")
|
|
this.data.pic = this.base64_image.join(",")
|
|
|
- that.$http.addEstateRepair(this.data).then(res => {
|
|
|
|
|
|
|
+ this.$http.addEstateRepair(this.data).then(res => {
|
|
|
if (res.data.success) {
|
|
if (res.data.success) {
|
|
|
- app.globalData.oneFailHint("提交成功");
|
|
|
|
|
|
|
+ this.$dialog.showModalAndBack('提交成功')
|
|
|
} else {
|
|
} else {
|
|
|
app.globalData.oneFailHint("提交失败");
|
|
app.globalData.oneFailHint("提交失败");
|
|
|
}
|
|
}
|
|
@@ -229,10 +280,6 @@
|
|
|
confirm() {
|
|
confirm() {
|
|
|
this.maskShow = false
|
|
this.maskShow = false
|
|
|
},
|
|
},
|
|
|
- residentialConfirm(e) {
|
|
|
|
|
- this.data.residentialId = e[0].value
|
|
|
|
|
- this.data.residentialName = e[0].label
|
|
|
|
|
- },
|
|
|
|
|
keyboardheightchange(e) {
|
|
keyboardheightchange(e) {
|
|
|
if (e.detail.height == 0) {
|
|
if (e.detail.height == 0) {
|
|
|
this.maskShow = false
|
|
this.maskShow = false
|