Files
wdsxh/unpackage/dist/build/mp-weixin/pages/component/diy/memberMapDiy.js
2026-04-29 15:33:58 +08:00

11 lines
8.5 KiB
JavaScript

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/component/diy/memberMapDiy"],{"0a25":function(t,e,i){"use strict";i.d(e,"b",(function(){return o})),i.d(e,"c",(function(){return a})),i.d(e,"a",(function(){return n}));var n={uniTransition:function(){return Promise.all([i.e("common/vendor"),i.e("uni_modules/uni-transition/components/uni-transition/uni-transition")]).then(i.bind(null,"a292"))}},o=function(){var t=this,e=t.$createElement,i=(t._self._c,t.loadEnd?2==t.showCategory.styleMode&&t.classifyList.length:null),n=t.loadEnd&&i?t.selectClassify.length:null,o=t.loadEnd&&i?t.selectClassify.length:null,a=t.loadEnd&&i?t.__map(t.classifyList,(function(e,i){var n=t.__get_orig(e),o=t.selectClassify.includes(e.id),a=t.selectClassify.includes(e.id);return{$orig:n,g3:o,g4:a}})):null,s=t.loadEnd&&!i?t.classifyList.length:null,r=t.loadEnd&&!i&&s?t.selectClassify.length:null,l=t.loadEnd&&!i&&s?t.selectClassify.length:null,u=t.loadEnd&&!i&&s?t.__map(t.classifyList,(function(e,i){var n=t.__get_orig(e),o=t.selectClassify.includes(e.id),a=t.selectClassify.includes(e.id);return{$orig:n,g8:o,g9:a}})):null,c=t.loadEnd?t.memberList.length:null,d=t.loadEnd&&c?t.__map(t.memberList,(function(e,i){var n=t.__get_orig(e),o=Number(e.id);return{$orig:n,m0:o}})):null,h=t.loadEnd&&2==t.showCategory.styleMode&&t.isExpandCategory2?t.selectClassify.length:null,g=t.loadEnd&&2==t.showCategory.styleMode&&t.isExpandCategory2?t.selectClassify.length:null,p=t.loadEnd&&2==t.showCategory.styleMode&&t.isExpandCategory2?t.__map(t.classifyList,(function(e,i){var n=t.__get_orig(e),o=t.selectClassify.includes(e.id),a=t.selectClassify.includes(e.id);return{$orig:n,g13:o,g14:a}})):null;t.$mp.data=Object.assign({},{$root:{g0:i,g1:n,g2:o,l0:a,g5:s,g6:r,g7:l,l1:u,g10:c,l2:d,g11:h,g12:g,l3:p}})},a=[]},"0b3a":function(t,e,i){"use strict";var n=i("6d18"),o=i.n(n);o.a},"14b8":function(t,e,i){"use strict";i.r(e);var n=i("81a5"),o=i.n(n);for(var a in n)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(a);e["default"]=o.a},"1c8e":function(t,e,i){"use strict";i.r(e);var n=i("0a25"),o=i("14b8");for(var a in o)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return o[t]}))}(a);i("0b3a");var s=i("828b"),r=Object(s["a"])(o["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);e["default"]=r.exports},"6d18":function(t,e,i){},"81a5":function(t,e,i){"use strict";(function(t){var n=i("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n(i("af34")),a=n(i("f5e9")),s={name:"memberMapDiy",props:["showMap","showCategory","spaceHeight"],data:function(){return{loadEnd:!1,classifyList:[],selectClassify:[],page:1,limit:100,hasMore:!1,memberList:[],markersList:[],includePoints:[],loadTimer:null,toPageTimer:null,isExpandCategory1:!0,isExpandCategory2:!1,componentHeight:0}},computed:{mapItemBorderRadius:function(){return t.upx2px(2*this.showMap.itemBorderRadius)+"px"},mapHeight:function(){return 2==this.showMap.heightType?t.upx2px(2*this.showMap.height)+"px":"100%"},mapBorderRadius:function(){return t.upx2px(2*this.showMap.borderRadius)+"px"},mapPadding:function(){return"".concat(t.upx2px(2*this.showMap.paddingTop),"px ").concat(t.upx2px(2*this.showMap.paddingLeft),"px")},categoryBorderRadius:function(){return t.upx2px(2*this.showCategory.borderRadius)+"px"},categoryMaxHeight:function(){var e=0;return 2==this.showMap.heightType?(e=this.showMap.height-2*this.showCategory.marginTop,t.upx2px(2*e)+"px"):(e=2*this.showCategory.marginTop,t.upx2px(2*e)+"px")},categoryMarginTop:function(){return"".concat(t.upx2px(2*this.showCategory.marginTop),"px")},categoryMarginLeft:function(){return"".concat(t.upx2px(2*this.showCategory.marginLeft),"px")},categoryIconDown:function(){return a.default.svgToUrl("expand",this.showCategory.expandColor)},categoryPaddingTop:function(){return"".concat(t.upx2px(2*this.showCategory.paddingTop),"px")},categoryPaddingLeft:function(){return"".concat(t.upx2px(2*this.showCategory.paddingLeft),"px")},categoryItemSpace:function(){return t.upx2px(2*this.showCategory.itemSpace)+"px"},categoryBtnBorderRadius:function(){return t.upx2px(2*this.showCategory.btnBorderRadius)+"px"},categoryBtnPadding:function(){return"".concat(t.upx2px(2*this.showCategory.btnPaddingTop),"px ").concat(t.upx2px(2*this.showCategory.btnPaddingLeft),"px")}},watch:{showCategory:{handler:function(t){t&&(this.getClassifyList(),this.getMemberList())},immediate:!0,deep:!0}},destroyed:function(){this.loadTimer&&clearTimeout(this.loadTimer),this.toPageTimer&&clearTimeout(this.toPageTimer)},methods:{getMemberList:function(){var e=this,i={type:this.showCategory.type};this.selectClassify.length&&(1==this.showCategory.type?i.member_level_id=this.selectClassify.join(","):2==this.showCategory.type?i.industry_category_id=this.selectClassify.join(","):3==this.showCategory.type&&(i.institution_id=this.selectClassify.join(","))),this.$util.request("member.memberMapList",i).then((function(i){if(1==i.code){e.memberList=i.data||[];var n=[];i.data.forEach((function(t){t.latitude&&t.longitude&&n.push({id:Number(t.id),latitude:t.latitude,longitude:t.longitude,iconPath:"/static/point.png",width:20,height:20,customCallout:{anchorX:0,anchorY:28,display:"ALWAYS"}})})),e.markersList=n;var o=i.data.filter((function(t){return t.latitude&&t.longitude})).map((function(t){return{latitude:t.latitude,longitude:t.longitude}}));e._mapContext=t.createMapContext("map",e),e._mapContext.initMarkerCluster({enableDefaultStyle:!1,zoomOnClick:!0,gridSize:60}),e._mapContext.includePoints({padding:[100,100,100,100],points:o})}else t.showToast({title:i.msg,icon:"none"})})).catch((function(t){console.error("获取会员列表 ",t)}))},calculateBounds:function(t){if(!t||0===t.length)return null;var e=1/0,i=-1/0,n=1/0,o=-1/0;t.forEach((function(t){var a=t.latitude,s=t.longitude;e=Math.min(e,a),i=Math.max(i,a),n=Math.min(n,s),o=Math.max(o,s)}));var a=i-e,s=o-n,r=.4*a,l=.3*a,u=.3*s,c=.3*s;return e-=l,i+=r,n-=u,o+=c,[{latitude:e,longitude:n},{latitude:i,longitude:o}]},getClassifyList:function(){var e=this,i=function(){e.loadEnd=!0,setTimeout((function(){t.createSelectorQuery().in(e).select(".diy-member-map").boundingClientRect((function(t){e.componentHeight=null===t||void 0===t?void 0:t.height})).exec()}),200)};2==this.showCategory.type?this.getIndustry((function(){i()})):3==this.showCategory.type?(this.page=1,this.getInstitution((function(){i()}))):this.getMemberLevel((function(){i()}))},getMemberLevel:function(e){var i=this;this.$util.request("member.level").then((function(n){1==n.code?(i.classifyList=n.data||[],e&&e()):(e&&e(),t.showToast({title:n.msg,icon:"none"}))})).catch((function(t){e&&e(),console.error("获取会员级别 ",t)}))},getIndustry:function(e){var i=this;this.$util.request("member.industry").then((function(n){1==n.code?(i.classifyList=n.data||[],e&&e()):(e&&e(),t.showToast({title:n.msg,icon:"none"}))})).catch((function(t){e&&e(),console.error("获取行业分类 ",t)}))},getInstitution:function(e){var i=this;this.$util.request("institution.list",{page:this.page,limit:this.limit}).then((function(n){if(1==n.code){var a=n.data.data;i.hasMore=i.page<n.data.total/i.limit,i.classifyList=1==i.page?a:[].concat((0,o.default)(i.classifyList),(0,o.default)(a)),e&&e()}else e&&e(),t.showToast({title:n.msg,icon:"none"})})).catch((function(t){e&&e(),console.error("获取机构列表",t)}))},scrollBottom:function(){this.hasMore&&(this.page++,this.getInstitution())},changeClassify:function(t){var e=this;if(-1==t)this.selectClassify=[];else{var i=this.selectClassify.findIndex((function(e){return e==t}));i>-1?this.$delete(this.selectClassify,i):this.selectClassify.push(t)}this.loadTimer&&clearTimeout(this.loadTimer),this.loadTimer=setTimeout((function(){e.getMemberList()}),400)},toMemberDetails:function(t){var e=this;this.toPageTimer&&clearTimeout(this.toPageTimer),this.toPageTimer=setTimeout((function(){e.$util.toPage({mode:1,path:"/pages/member/details?id="+t.detail.markerId})}),50)},handleExpand:function(e){var i=this;t.createSelectorQuery().in(this).select(".diy-member-map").boundingClientRect((function(t){i.componentHeight=null===t||void 0===t?void 0:t.height})).exec(),2==this.showCategory.styleMode?this.isExpandCategory2=1==e:this.isExpandCategory1=!this.isExpandCategory1}}};e.default=s}).call(this,i("df3c")["default"])}}]);
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'pages/component/diy/memberMapDiy-create-component',
{
'pages/component/diy/memberMapDiy-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('df3c')['createComponent'](__webpack_require__("1c8e"))
})
},
[['pages/component/diy/memberMapDiy-create-component']]
]);