12 |
- (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/house/house"],{138:function(e,t,n){"use strict";(function(e,t){var o=n(4);n(26);o(n(25));var i=o(n(139));e.__webpack_require_UNI_MP_PLUGIN__=n,t(i.default)}).call(this,n(1)["default"],n(2)["createPage"])},139:function(e,t,n){"use strict";n.r(t);var o=n(140),i=n(142);for(var r in i)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(r);n(144);var a,s=n(32),u=Object(s["default"])(i["default"],o["render"],o["staticRenderFns"],!1,null,null,null,!1,o["components"],a);u.options.__file="pages/house/house.vue",t["default"]=u.exports},140:function(e,t,n){"use strict";n.r(t);var o=n(141);n.d(t,"render",(function(){return o["render"]})),n.d(t,"staticRenderFns",(function(){return o["staticRenderFns"]})),n.d(t,"recyclableRender",(function(){return o["recyclableRender"]})),n.d(t,"components",(function(){return o["components"]}))},141:function(e,t,n){"use strict";var o;n.r(t),n.d(t,"render",(function(){return i})),n.d(t,"staticRenderFns",(function(){return a})),n.d(t,"recyclableRender",(function(){return r})),n.d(t,"components",(function(){return o}));try{o={uniIcons:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(n.bind(null,460))},uniDateformat:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat")]).then(n.bind(null,540))},hbComment:function(){return n.e("uni_modules/hb-comment/components/hb-comment/hb-comment").then(n.bind(null,561))},uvSafeBottom:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uv-safe-bottom/components/uv-safe-bottom/uv-safe-bottom")]).then(n.bind(null,568))},uniPopup:function(){return n.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(n.bind(null,575))}}}catch(s){if(-1===s.message.indexOf("Cannot find module")||-1===s.message.indexOf(".vue"))throw s;console.error(s.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var i=function(){var e=this,t=e.$createElement,n=(e._self._c,e.$field.findTypeName("houseType",e.detail.roomTypeId)),o=e.$field.findTypeName("payWay",e.detail.payWay),i={portrait:e.detail.chargePersonPortrait,name:e.detail.chargePersonName},r=e.$field.findTypeNameByList("supportingFacilities",e.detail.supportingFacilities);e.$mp.data=Object.assign({},{$root:{g0:n,g1:o,a0:i,l0:r}})},r=!1,a=[];i._withStripped=!0},142:function(e,t,n){"use strict";n.r(t);var o=n(143),i=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(r);t["default"]=i.a},143:function(e,t,n){"use strict";(function(e){var o=n(4);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=o(n(11)),r=(n(38),n(59)),a=function(){n.e("components/common/avatar").then(function(){return resolve(n(582))}.bind(null,n)).catch(n.oe)},s={data:function(){var e;return e={detail:{area:0},houseId:15,responsibility:[],coordinates:[],latitude:39.90923,longitude:116.397428,mapContext:{},visitorList:[],startTime:"",commentData:{readNumer:0,commentSize:0,comment:[]},shareButton:!1},(0,i.default)(e,"coordinates",""),(0,i.default)(e,"videoUrl",""),e},components:{avatar:a},onLoad:function(e){e.houseId&&(this.houseId=e.houseId),this.coordinates=this.$store.getters.coordinates,this.startTime=(new Date).getTime()},onReady:function(){this.mapContext=e.createMapContext("map",this),this.init()},onUnload:function(){var e=(new Date).getTime(),t=e-this.startTime;t>1e4&&this.createVisitor()},onShareAppMessage:function(e){return{title:this.detail.name||""}},methods:{init:function(){var e=this;(0,r.getHouseDetailById)(this.houseId+"?coordinates="+this.coordinates).then((function(t){if(200===t.code){e.detail=t.data;var n=[],o=[];e.detail.picture&&(n=JSON.parse(e.detail.picture).map((function(e){return e["fileType"]="image",e}))),e.detail.video&&(o=JSON.parse(e.detail.video).map((function(e){return e["fileType"]="video",e["videoUrl"]=e.url,e["url"]=e.url+"?x-oss-process=video/snapshot,t_0,f_jpg",e}))),e.responsibility=o.concat(n),e.detail.coordinates&&(e.coordinates=e.detail.coordinates.split(","),e.latitude=e.coordinates[1],e.longitude=e.coordinates[0],e.addMarkers()),e.getVisitor(),e.getHouseEvaluate()}}))},getHouseEvaluate:function(){var e=this;(0,r.getHouseEvaluateListByPage)({currPage:1,pageSize:100,projectItemTargetRoomId:this.houseId}).then((function(t){200==t.code&&(e.commentData.commentSize=t.data.totalCount,e.commentData.comment=e.getTree(t.data.dataList.map((function(e){return{id:e.id,owner:!0,hasLike:!1,likeNum:2,avatarUrl:e.userPortrait,nickName:e.userName,content:e.content,parentId:e.parentId,createTime:e.date}}))))}))},openVideo:function(e){this.videoUrl=e.videoUrl,this.$refs.popup.open("center")},openImage:function(t){if("image"===t.fileType){var n=this.responsibility.filter((function(e){return"image"===e.fileType})),o=n.findIndex((function(e){return e.id==t.id}));e.previewImage({urls:n.map((function(e){return e.url})),current:o,longPressActions:{success:function(e){},fail:function(e){}}})}},getTree:function(e){var t=[],n={};return e.forEach((function(e){n[e.id]=e})),e.forEach((function(e){var o=n[e.parentId];o?(o.children||(o.children=[])).push(e):t.push(e)})),t},addEvaluate:function(e){var t=this;(0,r.insertEvaluate)({userId:this.$store.getters.user.userId,projectItemTargetRoomId:this.houseId,content:e.content,parentId:e.pId||0}).then((function(e){200==e.code&&(t.$toast("评价成功"),t.getHouseEvaluate(),t.$refs.hbComment.addComplete())}))},mp4Preview:function(){},del:function(){},like:function(){},tell:function(){this.detail.chargePersonPhone||this.$toast("该用户暂未提供手机号"),e.makePhoneCall({phoneNumber:this.detail.chargePersonPhone})},roomCollection:function(){var e=this;this.detail.roomCollection?(0,r.disableCollection)(this.houseId).then((function(t){return e.successCollection(t,"取消收藏")})):(0,r.collection)(this.houseId).then((function(t){return e.successCollection(t,"收藏成功")}))},successCollection:function(e,t){200===e.code&&(this.init(),this.$toast(t))},addMarkers:function(){var e=[{latitude:this.coordinates[1],longitude:this.coordinates[0]}],t=[];e.forEach((function(e,n){t.push(Object.assign({},{id:n+1,width:50,height:50,joinCluster:!0},e))})),this.mapContext.addMarkers({markers:t,clear:!1,complete:function(e){}})},getVisitor:function(){var e=this;(0,r.getVisitorByQuery)({currPage:1,pageSize:2,projectItemTargetRoomId:this.houseId}).then((function(t){200===t.code&&(e.visitorList=t.data.dataList)}))},createVisitor:function(){(0,r.insertVisitor)({userId:this.$store.getters.user.userId,projectItemTargetRoomId:this.houseId})},share:function(){e.createSelectorQuery().select("#shareButton").node().exec((function(e){console.log("res",e[0].node)}))}}};t.default=s}).call(this,n(2)["default"])},144:function(e,t,n){"use strict";n.r(t);var o=n(145),i=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(r);t["default"]=i.a},145:function(e,t,n){}},[[138,"common/runtime","common/vendor"]]]);
- //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/house/house.js.map
|