modification.js 6.4 KB

12
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/fourBase/modification"],{777:function(e,n,t){"use strict";(function(e,n){var a=t(4);t(26);a(t(25));var o=a(t(778));e.__webpack_require_UNI_MP_PLUGIN__=t,n(o.default)}).call(this,t(1)["default"],t(2)["createPage"])},778:function(e,n,t){"use strict";t.r(n);var a=t(779),o=t(781);for(var s in o)["default"].indexOf(s)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(s);t(783);var i,r=t(32),c=Object(r["default"])(o["default"],a["render"],a["staticRenderFns"],!1,null,null,null,!1,a["components"],i);c.options.__file="pages/fourBase/modification.vue",n["default"]=c.exports},779:function(e,n,t){"use strict";t.r(n);var a=t(780);t.d(n,"render",(function(){return a["render"]})),t.d(n,"staticRenderFns",(function(){return a["staticRenderFns"]})),t.d(n,"recyclableRender",(function(){return a["recyclableRender"]})),t.d(n,"components",(function(){return a["components"]}))},780:function(e,n,t){"use strict";var a;t.r(n),t.d(n,"render",(function(){return o})),t.d(n,"staticRenderFns",(function(){return i})),t.d(n,"recyclableRender",(function(){return s})),t.d(n,"components",(function(){return a}));try{a={uniNavBar:function(){return t.e("components/uni-nav-bar/uni-nav-bar").then(t.bind(null,1212))},uIcon:function(){return t.e("uview-ui/components/u-icon/u-icon").then(t.bind(null,1176))}}}catch(r){if(-1===r.message.indexOf("Cannot find module")||-1===r.message.indexOf(".vue"))throw r;console.error(r.message),console.error("1. 排查组件名称拼写是否正确"),console.error("2. 排查组件是否符合 easycom 规范,文档:https://uniapp.dcloud.net.cn/collocation/pages?id=easycom"),console.error("3. 若组件不符合 easycom 规范,需手动引入,并在 components 中注册该组件")}var o=function(){var e=this,n=e.$createElement;e._self._c},s=!1,i=[];o._withStripped=!0},781:function(e,n,t){"use strict";t.r(n);var a=t(782),o=t.n(a);for(var s in a)["default"].indexOf(s)<0&&function(e){t.d(n,e,(function(){return a[e]}))}(s);n["default"]=o.a},782:function(e,n,t){"use strict";(function(e){var a=t(4);Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=a(t(41)),s=a(t(43)),i=function(){t.e("components/ksp-image-cutter/ksp-image-cutter").then(function(){return resolve(t(1233))}.bind(null,t)).catch(t.oe)},r={components:{kpsImageCutter:i},data:function(){return{base_id:[],baseobj:[],baseinfo:{base_name:"",base_charge:"",base_phone:"",base_img:"",base_area:"",base_equip:"",base_describe:"",lng:"",lat:""},city:"",imgs:"",baseobjtf:!0}},methods:{addbase:function(){var n=this;return(0,s.default)(o.default.mark((function t(){var a;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,n.$myRequest({url:"/api/api_gateway?method=base.bases.base_list",data:n.baseinfo,ret:"modify"});case 2:a=t.sent,console.log(a),a&&e.showToast({title:"修改成功",duration:2e3,icon:"none"});case 5:case"end":return t.stop()}}),t)})))()},ybase:function(){var e=this;return(0,s.default)(o.default.mark((function n(){var t;return o.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,e.$myRequest({url:"/api/api_gateway?method=base.bases.base_map_list",data:{base_id:e.baseinfo.base_id}});case 2:t=n.sent,e.base_id=t,console.log(t);case 5:case"end":return n.stop()}}),n)})))()},clickLeft:function(){e.navigateTo({url:"./index"}),e.removeStorage({key:"typeid"}),e.removeStorage({key:"location"})},binding:function(){e.navigateTo({url:"./allocation?base_id="+this.baseinfo.base_id})},gainimg:function(){var n=this;e.chooseImage({count:1,sizeType:["original","compressed"],sourceType:["album","camera"],success:function(e){n.imgs=e.tempFilePaths[0]}})},map:function(){e.navigateTo({url:"city"})},tijiao:function(){if(""==this.baseinfo.base_img)e.showToast({title:"请选择基地图片",duration:2e3,icon:"none"});else if(""==this.baseinfo.base_name)e.showToast({title:"请填写正基地名称",duration:2e3,icon:"none"});else if(""==this.baseinfo.base_charge)e.showToast({title:"请填写基地负责人",duration:2e3,icon:"none"});else if(""==this.baseinfo.base_phone)e.showToast({title:"请填写手机号",duration:2e3,icon:"none"});else if(""==this.baseinfo.base_area)e.showToast({title:"请填写基地面积",duration:2e3,icon:"none"});else if(""==this.baseinfo.lng)e.showToast({title:"请选择基地地址",duration:2e3,icon:"none"});else if(""==this.baseinfo.base_id)e.showToast({title:"请绑定基地设备",duration:2e3,icon:"none"});else if(/^1[23456789]\d{9}$/.test(this.baseinfo.base_phone)){if(!this.baseobjtf){for(var n=[],t=0;t<this.baseobj.length;t++)n.push(this.baseobj[t].arr);this.baseinfo.base_equip=n.join("#")}console.log(this.baseinfo),this.addbase(),e.removeStorage({key:"typeid"}),e.removeStorage({key:"location"})}else e.showToast({title:"请填写正确的手机号",duration:2e3,icon:"none"})},selectaddress:function(n,t){var a=this;e.request({type:"GET",url:"https://restapi.amap.com/v3/geocode/regeo?output=JSON&location="+t+","+n+"&key=27273b81090f78759e4057f94474516f&radius=1000&extensions=all",dataType:"json",complete:function(e){console.log(e),a.city=e.data.regeocode.formatted_address}})},onok:function(n){var t=this;e.uploadFile({url:"https://wx.hnyfwlw.com/api/api_gateway?method=base.bases.base_photo",filePath:n.path,name:"img_file",formData:{user:"test"},success:function(e){t.baseinfo.base_img=JSON.parse(e.data).data.src}}),this.imgs=""},oncancle:function(){this.imgs=""}},onLoad:function(e){console.log(JSON.parse(e.id)),this.baseinfo=JSON.parse(e.id),this.baseinfo.base_id=JSON.parse(e.id).id,this.baseinfo.ret="modify",delete this.baseinfo.id,this.selectaddress(this.baseinfo.lat,this.baseinfo.lng),this.ybase()},onShow:function(){var n=this;e.getStorage({key:"location",success:function(e){console.log(e.data),n.selectaddress(e.data[1],e.data[0]),n.baseinfo.lat=e.data[1],n.baseinfo.lng=e.data[0]}}),e.getStorage({key:"typeid",success:function(e){n.baseobjtf=!1,console.log(JSON.parse(e.data));var t=[];for(var a in JSON.parse(e.data)){console.log(a);for(var o=0;o<JSON.parse(e.data)[a].length;o++){var s={name:a,arr:JSON.parse(e.data)[a][o]};t.push(s)}}console.log(t),n.baseobj=t}})}};n.default=r}).call(this,t(2)["default"])},783:function(e,n,t){"use strict";t.r(n);var a=t(784),o=t.n(a);for(var s in a)["default"].indexOf(s)<0&&function(e){t.d(n,e,(function(){return a[e]}))}(s);n["default"]=o.a},784:function(e,n,t){}},[[777,"common/runtime","common/vendor"]]]);
  2. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/fourBase/modification.js.map