house.js 5.5 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/house/house"],{"1f99":function(t,e,n){},"70df":function(t,e,n){"use strict";(function(t,e){var i=n("47a9");n("7748");i(n("3240"));var o=i(n("7113"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(o.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},7113:function(t,e,n){"use strict";n.r(e);var i=n("c031"),o=n("f509");for(var a in o)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(a);n("e029");var r=n("828b"),s=Object(r["a"])(o["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],void 0);e["default"]=s.exports},ab55:function(t,e,n){"use strict";(function(t){var i=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=i(n("7ca3")),a=(n("6806"),n("2ecb")),r={data:function(){var t;return t={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,o.default)(t,"coordinates",""),(0,o.default)(t,"videoUrl",""),t},onLoad:function(t){t.houseId&&(this.houseId=t.houseId),this.coordinates=this.$store.getters.coordinates,this.startTime=(new Date).getTime()},onReady:function(){this.mapContext=t.createMapContext("map",this),this.init()},onUnload:function(){var t=(new Date).getTime(),e=t-this.startTime;e>1e4&&this.createVisitor()},onShareAppMessage:function(t){return{title:this.detail.name||""}},methods:{init:function(){var t=this;(0,a.getHouseDetailById)(this.houseId+"?coordinates="+this.coordinates).then((function(e){if(200===e.code){t.detail=e.data;var n=[],i=[];t.detail.picture&&(n=JSON.parse(t.detail.picture).map((function(t){return t["fileType"]="image",t}))),t.detail.video&&(i=JSON.parse(t.detail.video).map((function(t){return t["fileType"]="video",t["videoUrl"]=t.url,t["url"]=t.url+"?x-oss-process=video/snapshot,t_0,f_jpg",t}))),t.responsibility=i.concat(n),t.detail.coordinates&&(t.coordinates=t.detail.coordinates.split(","),t.latitude=t.coordinates[1],t.longitude=t.coordinates[0],t.addMarkers()),t.getVisitor(),t.getHouseEvaluate()}}))},getHouseEvaluate:function(){var t=this;(0,a.getHouseEvaluateListByPage)({currPage:1,pageSize:100,projectItemTargetRoomId:this.houseId}).then((function(e){200==e.code&&(t.commentData.commentSize=e.data.totalCount,t.commentData.comment=t.getTree(e.data.dataList.map((function(t){return{id:t.id,owner:!0,hasLike:!1,likeNum:2,avatarUrl:t.userPortrait,nickName:t.userName,content:t.content,parentId:t.parentId,createTime:t.date}}))))}))},openVideo:function(t){this.videoUrl=t.videoUrl,this.$refs.popup.open("center")},getTree:function(t){var e=[],n={};return t.forEach((function(t){n[t.id]=t})),t.forEach((function(t){var i=n[t.parentId];i?(i.children||(i.children=[])).push(t):e.push(t)})),e},addEvaluate:function(t){var e=this;(0,a.insertEvaluate)({userId:this.$store.getters.user.userId,projectItemTargetRoomId:this.houseId,content:t.content,parentId:t.pId||0}).then((function(t){200==t.code&&(e.$toast("评价成功"),e.getHouseEvaluate(),e.$refs.hbComment.addComplete())}))},mp4Preview:function(){},del:function(){},like:function(){},tell:function(){t.makePhoneCall({phoneNumber:"17601274604"})},roomCollection:function(){var t=this;this.detail.roomCollection?(0,a.disableCollection)(this.houseId).then((function(e){return t.successCollection(e,"取消收藏")})):(0,a.collection)(this.houseId).then((function(e){return t.successCollection(e,"收藏成功")}))},successCollection:function(t,e){200===t.code&&(this.init(),this.$toast(e))},addMarkers:function(){var t=[{latitude:this.coordinates[1],longitude:this.coordinates[0]}],e=[];t.forEach((function(t,n){e.push(Object.assign({},{id:n+1,width:50,height:50,joinCluster:!0},t))})),this.mapContext.addMarkers({markers:e,clear:!1,complete:function(t){}})},getVisitor:function(){var t=this;(0,a.getVisitorByQuery)({currPage:1,pageSize:2,projectItemTargetRoomId:this.houseId}).then((function(e){200===e.code&&(t.visitorList=e.data.dataList)}))},createVisitor:function(){(0,a.insertVisitor)({userId:this.$store.getters.user.userId,projectItemTargetRoomId:this.houseId})},share:function(){t.createSelectorQuery().select("#shareButton").node().exec((function(t){console.log("res",t[0].node)}))}}};e.default=r}).call(this,n("df3c")["default"])},c031:function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return a})),n.d(e,"a",(function(){return i}));var i={uniIcons:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uni-icons/components/uni-icons/uni-icons")]).then(n.bind(null,"3d33"))},uniDateformat:function(){return Promise.all([n.e("common/vendor"),n.e("uni_modules/uni-dateformat/components/uni-dateformat/uni-dateformat")]).then(n.bind(null,"2a9e"))},hbComment:function(){return n.e("uni_modules/hb-comment/components/hb-comment/hb-comment").then(n.bind(null,"1030"))},uniPopup:function(){return n.e("uni_modules/uni-popup/components/uni-popup/uni-popup").then(n.bind(null,"786a"))}},o=function(){var t=this.$createElement,e=(this._self._c,this.$field.findTypeName("houseType",this.detail.roomTypeId)),n=this.$field.findTypeName("payWay",this.detail.payWay),i=this.$field.findTypeNameByList("supportingFacilities",this.detail.supportingFacilities);this.$mp.data=Object.assign({},{$root:{g0:e,g1:n,l0:i}})},a=[]},e029:function(t,e,n){"use strict";var i=n("1f99"),o=n.n(i);o.a},f509:function(t,e,n){"use strict";n.r(e);var i=n("ab55"),o=n.n(i);for(var a in i)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(a);e["default"]=o.a}},[["70df","common/runtime","common/vendor"]]]);