Files
PropertyDeployment/resources/Web/WechatOwnerService/html/static/js/pages-hireRoom-hireRoom.2b9f4138.js
2025-12-09 22:41:31 +08:00

1 line
11 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-hireRoom-hireRoom"],{"0d2f":function(e,t,n){"use strict";n.r(t);var i=n("7ae2"),a=n.n(i);for(var s in i)["default"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(s);t["default"]=a.a},"1c90":function(e,t,n){var i=n("bddb");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);var a=n("967d").default;a("cb886d22",i,!0,{sourceMap:!1,shadowMode:!1})},5458:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){}));var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("v-uni-view",[n("v-uni-view",{staticClass:"block__title"},[e._v("房屋信息")]),n("v-uni-view",{staticClass:"cu-form-group"},[n("v-uni-view",{staticClass:"title"},[e._v("出租标题")]),n("v-uni-input",{staticClass:"text-right",attrs:{placeholder:"如香格里拉豪华大单间"},model:{value:e.rentingTitle,callback:function(t){e.rentingTitle=t},expression:"rentingTitle"}})],1),n("v-uni-view",{staticClass:"cu-form-group"},[n("v-uni-view",{staticClass:"title"},[e._v("房屋信息")]),n("v-uni-picker",{attrs:{bindchange:"PickerChange",value:e.index,range:e.roomCloums},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.roomChange.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"picker"},[e._v(" "+e._s(e.roomName?e.roomName:"请选择")+" ")])],1)],1),""!=e.builtUpArea?n("v-uni-view",{staticClass:"cu-form-group"},[n("v-uni-view",{staticClass:"title"},[e._v("房屋面积")]),n("v-uni-input",{staticStyle:{"text-align":"right"},attrs:{disabled:"disabled"},model:{value:e.builtUpArea,callback:function(t){e.builtUpArea=t},expression:"builtUpArea"}})],1):e._e(),""!=e.apartment?n("v-uni-view",{staticClass:"cu-form-group"},[n("v-uni-view",{staticClass:"title"},[e._v("户型")]),n("v-uni-input",{staticStyle:{"text-align":"right"},attrs:{disabled:"disabled"},model:{value:e.apartment,callback:function(t){e.apartment=t},expression:"apartment"}})],1):e._e(),""!=e.layer?n("v-uni-view",{staticClass:"cu-form-group"},[n("v-uni-view",{staticClass:"title"},[e._v("楼层")]),n("v-uni-input",{staticStyle:{"text-align":"right"},attrs:{disabled:"disabled"},model:{value:e.layer,callback:function(t){e.layer=t},expression:"layer"}})],1):e._e(),n("v-uni-view",{staticClass:"block__title"},[e._v("出租信息")]),n("v-uni-view",{staticClass:"cu-form-group"},[n("v-uni-view",{staticClass:"title"},[e._v("付费类型")]),n("v-uni-picker",{attrs:{id:"paymentType",bindchange:"PickerChange",value:e.paymentTypeIndex,"range-key":"paymentTypeName",range:e.paymentTypes},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.paymentTypeChange.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"picker"},[e._v(" "+e._s(e.paymentTypes[e.paymentTypeIndex].paymentTypeName)+" ")])],1)],1),n("v-uni-view",{staticClass:"cu-form-group"},[n("v-uni-view",{staticClass:"title"},[e._v("租金")]),n("v-uni-input",{staticClass:"text-right",attrs:{placeholder:"请输入每月租金"},model:{value:e.price,callback:function(t){e.price=t},expression:"price"}})],1),n("v-uni-view",{staticClass:"cu-form-group"},[n("v-uni-view",{staticClass:"title"},[e._v("出租方式")]),n("v-uni-picker",{attrs:{id:"rentingType",bindchange:"PickerChange",value:e.rentingTypeIndex,"range-key":"rentingTypeName",range:e.rentingTypes},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.rentingTypeChange.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"picker"},[e._v(" "+e._s(e.rentingTypes[e.rentingTypeIndex].rentingTypeName)+" ")])],1)],1),n("v-uni-view",{staticClass:"cu-form-group"},[n("v-uni-view",{staticClass:"title"},[e._v("服务费")]),n("v-uni-input",{staticClass:"text-right",attrs:{disabled:"disabled"},model:{value:e.servicePrice,callback:function(t){e.servicePrice=t},expression:"servicePrice"}})],1),n("v-uni-view",{staticClass:"cu-form-group"},[n("v-uni-view",{staticClass:"title"},[e._v("入住日期")]),n("v-uni-picker",{attrs:{id:"checkIn",bindchange:"PickerChange",value:e.checkInIndex,"range-key":"checkInName",range:e.checkIns},on:{change:function(t){arguments[0]=t=e.$handleEvent(t),e.checkInChange.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"picker"},[e._v(" "+e._s(e.checkIns[e.checkInIndex].checkInName)+" ")])],1)],1),n("v-uni-view",{staticClass:"cu-form-group margin-top"},[n("v-uni-textarea",{attrs:{placeholder:"请输入描述信息"},model:{value:e.rentingDesc,callback:function(t){e.rentingDesc=t},expression:"rentingDesc"}})],1),n("v-uni-view",{staticClass:"block__title"},[e._v("相关图片")]),n("v-uni-view",{staticClass:"cu-bar bg-white "},[n("v-uni-view",{staticClass:"action"},[e._v(" 图片上传 ")]),n("v-uni-view",{staticClass:"action"},[e._v(" "+e._s(e.imgList.length)+"/4 ")])],1),n("v-uni-view",{staticClass:"cu-form-group"},[n("v-uni-view",{staticClass:"grid col-4 grid-square flex-sub"},[e._l(e.imgList,(function(t,i){return n("v-uni-view",{key:i,staticClass:"bg-img",attrs:{bindtap:"ViewImage","data-url":e.imgList[i]}},[n("v-uni-image",{attrs:{src:e.imgList[i],mode:"aspectFill"}}),n("v-uni-view",{staticClass:"cu-tag bg-red",attrs:{"data-index":i},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.deleteImage(i)}}},[n("v-uni-text",{staticClass:"cuIcon-close"})],1)],1)})),e.imgList.length<4?n("v-uni-view",{staticClass:"solids",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.ChooseImage.apply(void 0,arguments)}}},[n("v-uni-text",{staticClass:"cuIcon-cameraadd"})],1):e._e()],2)],1),n("v-uni-view",{staticClass:"button_up_blank"}),n("v-uni-view",{staticClass:"flex flex-direction"},[n("v-uni-button",{staticClass:"cu-btn bg-green margin-tb-sm lg",on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.submitHireRoom()}}},[e._v("提交")])],1)],1)},a=[]},"766f":function(e,t,n){"use strict";n("6a54");var i=n("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.appointmentRoom=function(e){return new Promise((function(t,n){var i="";""==e.tenantName?i="名称不能为空":""==e.tenantSex?i="性别不能空":""==e.tenantTel?i="手机号不能为空":""==e.appointmentTime?i="请填写预约时间":""==e.appointmentRoomId&&(i="预约房屋为空"),""!=i?n(i):(0,a.request)({url:s.default.saveRentingAppointment,method:"POST",data:e,success:function(e){var i=e.data;0!=i.code?n(i.msg):t(i)},fail:function(e){n("服务异常")}})}))},t.getRentingPool=function(e){return new Promise((function(t,n){(0,a.request)({url:s.default.queryRentingPool,method:"GET",data:e,success:function(e){var i=e.data;0==i.code?t(i.data):n(i.msg)},fail:function(e){n(e)}})}))},t.getRooms=function(e){return new Promise((function(t,n){(0,a.request)({url:s.default.queryRoomsByOwner,method:"GET",data:e,success:function(e){t(e.data)},fail:function(e){n(e)}})}))},t.hireRoom=function(e){return new Promise((function(t,n){var i="";""==e.rentingName?i="出租标题不能为空":""==e.roomId?i="请选择房屋":""==e.communityId?i="未找到小区信息":""==e.price?i="请填写租金(元)":""==e.paymentType?i="请选择付费类型":""==e.rentingConfigId?i="请选择出租方式":""==e.rentingDesc?i="请填写出租说明":e.photos.length<1?i="请选择图片":""==e.checkIn&&(i="请选择入住日期"),""!=i?n(i):(0,a.request)({url:s.default.saveRentingPool,method:"POST",data:e,success:function(e){var i=e.data;0!=i.code?n(i.msg):t(i)},fail:function(e){n("服务异常")}})}))},t.queryRentingConfig=function(){return new Promise((function(e,t){(0,a.request)({url:s.default.queryRentingConfig,method:"GET",data:{page:1,row:10},success:function(n){var i=n.data;0==i.code?e(i.data):t(i.msg)},fail:function(e){t(e)}})}))},n("bf0f");var a=n("a7bc"),s=i(n("79d4"));i(n("bce4")),n("1803")},"7ae2":function(e,t,n){"use strict";n("6a54");var i=n("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,n("fd3c"),n("aa9c"),n("bf0f"),n("2797"),n("dd2b");i(n("d5d0"));var a=n("766f"),s=i(n("cc73")),o=n("1c9a"),c={data:function(){return{rooms:[],apartment:"",builtUpArea:"",layer:"",price:"",roomCloums:[],roomIdArr:[],roomName:"",roomId:"",roomShow:!1,imgList:[],userTel:"",userName:"",photos:[],communityId:"",communityName:"",paymentTypes:[{id:"1001",paymentTypeName:"押一付一"},{id:"2002",paymentTypeName:"押一付三"},{id:"3003",paymentTypeName:"押一付六"}],paymentTypeIndex:0,paymentType:"1001",paymentTypeName:"",checkIns:[{id:"1001",checkInName:"立即入住"},{id:"2002",checkInName:"预约"}],checkInIndex:0,checkIn:"1001",checkInName:"",rentingTypes:[],rentingTypeIndex:0,rentingType:"",rentingTypeName:"",rentingConfigId:"",servicePrice:"",rentingDesc:"",rentingTitle:""}},onLoad:function(e){var t=this;this.vc.onLoad(e),(0,a.getRooms)({communityId:(0,o.getCommunityId)()}).then((function(e){var n=e.rooms;t.rooms=n;var i=[],a=[];n.map((function(e){i.push(e.floorNum+"号楼"+e.unitNum+"单元"+e.roomNum+"室"),a.push(e.roomId)})),t.roomCloums=i,t.roomIdArr=a})),this._loadRentingTypes()},onShareAppMessage:function(){},methods:{submitHireRoom:function(){var e=this,t={rentingTitle:this.rentingTitle,roomId:this.roomId,communityId:this.communityId,communityName:this.communityName,price:this.price,paymentType:this.paymentType,rentingConfigId:this.rentingConfigId,photos:[],rentingDesc:this.rentingDesc,ownerTel:this.userTel,ownerName:this.userName,state:"0",checkIn:this.checkIn},n=this.photos;n.forEach((function(e){t.photos.push({photo:e})})),(0,a.hireRoom)(t).then((function(t){e.vc.navigateBack()}),(function(e){console.log(e),uni.showToast({icon:"none",title:e})}))},deleteImage:function(e){console.log(e);var t=this.$data.imgList;t.splice(e,1)},ChooseImage:function(e){var t=this;wx.chooseImage({count:4,sizeType:["original","compressed"],sourceType:["album"],success:function(e){console.log(e),t.$data.imgList.push(e.tempFilePaths[0]);var n="";s.default.urlTobase64(e.tempFilePaths[0]).then((function(e){n=e,console.log("base64",n),t.photos.push(n)}))}})},roomChange:function(e){var t=this;this.roomId=this.roomIdArr[e.detail.value],this.roomName=this.roomCloums[e.detail.value],this.rooms.forEach((function(e){e.roomId==t.roomId&&(t.apartment=e.apartment,t.builtUpArea=e.builtUpArea,t.layer=e.layer)}))},paymentTypeChange:function(e){this.paymentTypeIndex=e.target.value;var t=this.paymentTypes[this.paymentTypeIndex];this.paymentType=t.id,this.paymentTypeName=t.paymentTypeName},_loadRentingTypes:function(){var e=this;(0,a.queryRentingConfig)().then((function(t){if(e.rentingTypes=t,t.length>0){var n=t[0];e.rentingConfigId=n.rentingConfigId,e.servicePrice=(n.servicePrice*n.serviceOwnerRate).toFixed(2)+"元"}}))},rentingTypeChange:function(e){this.rentingTypeIndex=e.target.value;var t=this.rentingTypes[this.rentingTypeIndex];this.rentingConfigId=t.rentingConfigId,this.rentingTypeName=t.rentingTypeName,this.servicePrice=(t.servicePrice*t.serviceOwnerRate).toFixed(2)+"元"},checkInChange:function(e){this.checkInIndex=e.target.value;var t=this.checkIns[this.checkInIndex];this.checkIn=t.id}}};t.default=c},a285:function(e,t,n){"use strict";var i=n("1c90"),a=n.n(i);a.a},bddb:function(e,t,n){var i=n("c86c");t=i(!1),t.push([e.i,".block__title[data-v-6cead896]{margin:0;font-weight:400;font-size:14px;color:rgba(69,90,100,.6);padding:%?40?% %?30?% %?20?%}.button_up_blank[data-v-6cead896]{height:%?40?%}",""]),e.exports=t},c88b:function(e,t,n){"use strict";n.r(t);var i=n("5458"),a=n("0d2f");for(var s in a)["default"].indexOf(s)<0&&function(e){n.d(t,e,(function(){return a[e]}))}(s);n("a285");var o=n("828b"),c=Object(o["a"])(a["default"],i["b"],i["c"],!1,null,"6cead896",null,!1,i["a"],void 0);t["default"]=c.exports}}]);