crm_second_opening_mini/pages/nearby/nearby.js

1 line
5.9 KiB
JavaScript

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/nearby/nearby"],{2353:function(e,t,n){"use strict";n.r(t);var i=n("2999"),o=n.n(i);for(var a in i)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(a);t["default"]=o.a},2999:function(e,t,n){"use strict";(function(e){var i=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o,a,u=i(n("9523")),s=n("0c59"),c=n("dc92"),r=n("76dd"),d=n("db68"),l=n("f785"),f={components:{uniTabbar:function(){n.e("components/tabbar/tabbar").then(function(){return resolve(n("c4bc"))}.bind(null,n)).catch(n.oe)}},data:function(){return{BASE_IMG_URL:s.BASE_IMG_URL,tipNumber:null,latitude:"",longitude:"",covers:[],typeList:["全部客户","我的客户","下属负责的客户"],typeIndex:null,nearList:[{id:0,name:"附近1KM",num:1},{id:1,name:"附近3KM",num:3},{id:2,name:"附近5KM",num:5},{id:3,name:"附近10KM",num:10},{id:4,name:"附近30KM",num:30},{id:5,name:"附近200KM",num:200},{id:6,name:"附近400KM",num:400},{id:7,name:"附近600KM",num:600},{id:8,name:"附近800KM",num:800},{id:9,name:"全部",num:1e6}],nearIndex:2,showMask:!1,maskType:1,address:"",list:[],showList:!0,liInfo:{},liId:"",isFullScreen:!0,name:"",otherArr:[],height:"400rpx",mapHeight:"400rpx"}},onLoad:function(){var t=this;e.getSystemInfo({success:function(e){var n=750/e.screenWidth,i=e.windowHeight*n-200;t.mapHeight=i+"rpx";var o=e.windowHeight*n-750;t.height=o+"rpx"}}),this.getKey()},onShow:function(){this.getTip()},methods:{getKey:function(){var t=this;(0,l.netMapKey)().then((function(i){i.data.map_key?(o=n("cb23"),a=new o({key:i.data.map_key}),t.getAddressinfo()):e.showToast({title:"请在后台配置地图key",icon:"none"})}))},getTip:function(){var t=this;(0,d.netAgentList)().then((function(n){t.tipNumber=n.data.total,e.setStorageSync("token",n.data.userinfo.token),e.setStorageSync("roleType",n.data.userinfo.role_type),e.setStorageSync("rules",n.data.userinfo.rules)}))},searchName:function(e){this.name=e,this.getKehuList()},getAddressinfo:function(){var t=this;e.getLocation({type:"gcj02",success:function(e){var n;t.longitude=e.longitude,t.latitude=e.latitude;var i=[{id:0,latitude:e.latitude,longitude:e.longitude,iconPath:"../../static/selfweizhi.png",width:20,height:20,label:(n={content:"自己所在位置",bgColor:"#fff",fontSize:12},(0,u.default)(n,"bgColor","#03aa96"),(0,u.default)(n,"color","#fff"),(0,u.default)(n,"padding",5),(0,u.default)(n,"textAlign","center"),(0,u.default)(n,"borderRadius",10),n)}];t.covers=i,t.getKehuList(),a.reverseGeocoder({location:{longitude:e.longitude,latitude:e.latitude},success:function(e){t.address=e.result.address},fail:function(e){console.log("12465",e)}})},fail:function(t){"getLocation:fail auth deny"==t.errMsg&&e.showToast({title:"请允许使用位置信息",icon:"none"})}})},getKehuList:function(){var e=this,t={lng:this.longitude,lat:this.latitude,type:this.typeIndex,name:this.name,distance:this.nearList[this.nearIndex]?this.nearList[this.nearIndex].num:""};(0,c.netNearKehuList)(t).then((function(t){e.list=t.data,e.handleCover(t.data)}))},handleCover:function(e){var t=this;e.forEach((function(e,n){3==e.type&&t.otherArr.push(e.id);var i=[];i=i.concat(t.covers),i.push({id:e.id,latitude:e.lat,longitude:e.lng,iconPath:0==e.type?"../../static/selfweizhi.png":1==e.type?"../../static/weizhi.png":2==e.type?"../../static/greenweizhi.png":"../../static/otherweizhi.png",width:20,height:20,label:{content:e.name,fontSize:12,bgColor:0==e.type||1==e.type?"#03aa96":2==e.type?"#2cee99":"#fe1212",color:"#fff",padding:5,textAlign:"center",borderRadius:10}}),t.covers=i}))},changeLiInfo:function(e){var t=this,n=e.detail.markerId;0!=n&&-1==this.otherArr.indexOf(n)&&(this.isFullScreen=!1,this.showList=!1,this.list.forEach((function(e){e.id==n&&(t.liInfo=e)})))},backList:function(){this.showList=!0},showAll:function(){this.showMask=!0,this.maskType=1},changeType:function(e){this.typeIndex=e.detail.value,this.getKehuList()},changeNear:function(e){this.nearIndex=e.detail.value,this.getKehuList()},lookMap:function(t){e.openLocation({latitude:Number(t.lat),longitude:Number(t.lng),success:function(e){console.log(e)},fail:function(e){console.log(e)}})},toMore:function(t){e.navigateTo({url:"/pages/index/groupCompany/groupCompany?id="+t+"&type=1"})},toGroupCompany:function(t){var n=this;e.showModal({title:"是否确定领取公池客户",content:"领取后长时间未跟进,客户将自动转为公共客户",success:function(i){i.confirm&&(0,r.netReceiveKehu)({customer_id:t.id}).then((function(i){e.showToast({title:i.msg,icon:"none"}),setTimeout((function(){n.getKehuList();var e=t.id,i=n.list;i.forEach((function(t){t.id==e&&(n.liInfo=t)}))}),2e3)}))}})}}};t.default=f}).call(this,n("543d")["default"])},"6c32":function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return i}));var i={uSearch:function(){return n.e("uview-ui/components/u-search/u-search").then(n.bind(null,"d3fc"))},uEmpty:function(){return n.e("uview-ui/components/u-empty/u-empty").then(n.bind(null,"38b8"))}},o=function(){var e=this,t=e.$createElement,n=(e._self._c,e.showList?e.list.length:null);e._isMounted||(e.e0=function(t){e.isFullScreen=!1},e.e1=function(t){e.isFullScreen=!0}),e.$mp.data=Object.assign({},{$root:{g0:n}})},a=[]},d07d:function(e,t,n){},d809:function(e,t,n){"use strict";var i=n("e1e2"),o=n.n(i);o.a},e1e2:function(e,t,n){},ea8a:function(e,t,n){"use strict";(function(e,t){var i=n("4ea4");n("8886");i(n("66fd"));var o=i(n("ec90"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(o.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},ec90:function(e,t,n){"use strict";n.r(t);var i=n("6c32"),o=n("2353");for(var a in o)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(a);n("f0be"),n("d809");var u=n("f0c5"),s=Object(u["a"])(o["default"],i["b"],i["c"],!1,null,"b54eeec0",null,!1,i["a"],void 0);t["default"]=s.exports},f0be:function(e,t,n){"use strict";var i=n("d07d"),o=n.n(i);o.a}},[["ea8a","common/runtime","common/vendor"]]]);