1 |
- require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesinfo/user/index"],{"4cd0":function(e,n,t){"use strict";t.r(n);var r=t("b77e"),u=t.n(r);for(var a in r)"default"!==a&&function(e){t.d(n,e,(function(){return r[e]}))}(a);n["default"]=u.a},"5a6d":function(e,n,t){"use strict";(function(e){t("d69c");r(t("66fd"));var n=r(t("fe14"));function r(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=t,e(n.default)}).call(this,t("543d")["createPage"])},"738c":function(e,n,t){"use strict";t.d(n,"b",(function(){return u})),t.d(n,"c",(function(){return a})),t.d(n,"a",(function(){return r}));var r={uniSection:function(){return t.e("uni_modules/uni-section/components/uni-section/uni-section").then(t.bind(null,"9d71"))},uniForms:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uni-forms/components/uni-forms/uni-forms")]).then(t.bind(null,"53df"))},uniFormsItem:function(){return t.e("uni_modules/uni-forms/components/uni-forms-item/uni-forms-item").then(t.bind(null,"1709"))},uniEasyinput:function(){return t.e("uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput").then(t.bind(null,"d966"))},uniDataCheckbox:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uni-data-checkbox/components/uni-data-checkbox/uni-data-checkbox")]).then(t.bind(null,"d3fb"))},uniDatetimePicker:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker")]).then(t.bind(null,"8c8e"))},uniDataPicker:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uni-data-picker/components/uni-data-picker/uni-data-picker")]).then(t.bind(null,"12e2"))},uniDataSelect:function(){return Promise.all([t.e("common/vendor"),t.e("uni_modules/uni-data-select/components/uni-data-select/uni-data-select")]).then(t.bind(null,"9777"))}},u=function(){var e=this,n=e.$createElement;e._self._c},a=[]},b77e:function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=i(t("a34a")),u=i(t("a630")),a=i(t("b583"));function i(e){return e&&e.__esModule?e:{default:e}}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function c(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?o(Object(t),!0).forEach((function(n){s(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function s(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function f(e,n,t,r,u,a,i){try{var o=e[a](i),c=o.value}catch(s){return void t(s)}o.done?n(c):Promise.resolve(c).then(r,u)}function l(e){return function(){var n=this,t=arguments;return new Promise((function(r,u){var a=e.apply(n,t);function i(e){f(a,r,u,i,o,"next",e)}function o(e){f(a,r,u,i,o,"throw",e)}i(void 0)}))}}var d=e.getAccountInfoSync().miniProgram.appId,h={data:function(){return{role:"",path:null,formData:{},sexs:[{text:"男",value:0},{text:"女",value:1}],items:[],pickerMap:{text:"label",value:"interId"},range:[],house:{},building:[],unit:"",rules:{name:{rules:[{required:!0,errorMessage:"姓名不能为空"}]},sex:{rules:[{required:!0,errorMessage:"性别不能为空"}]},phone:{rules:[{required:!0,errorMessage:"电话不能为空"}]}}}},mounted:function(){var n=this;return l(r.default.mark((function t(){var a;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,u.default.addrTreeSelect();case 2:a=t.sent,n.items=a.data,n.role=e.getStorageSync("role"),"guest"!==n.role&&n.queryInfo();case 6:case"end":return t.stop()}}),t)})))()},methods:{queryInfo:function(){var e=this;return l(r.default.mark((function n(){var t,a,i,o,s,f,l,d;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,u.default.getUser();case 2:if(t=n.sent,e.formData=t.data,a=t.data,i=a.estateId,o=a.buildingId,s=a.unit,f=a.floor,l=a.houseId,!i){n.next=10;break}return n.next=8,u.default.buildingList({estateId:i});case 8:d=n.sent,e.range=d.rows.map((function(e){return c(c({},e),{},{text:"".concat(e.number,"栋"),value:e.buildingId})}));case 10:if(!o){n.next=13;break}return n.next=13,e.selectChange(o);case 13:if(!s){n.next=16;break}return n.next=16,e.unitChange(s);case 16:if(!f){n.next=19;break}return n.next=19,e.floorChange(f);case 19:if(!l){n.next=22;break}return n.next=22,e.houseChange(l);case 22:case"end":return n.stop()}}),n)})))()},decryptPhoneNumber:function(e){var n=this;return l(r.default.mark((function t(){var u;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,a.default.getPhone({code:e.detail.code,appid:d});case 2:u=t.sent,n.$set(n.formData,"phone",u.phone_info.phoneNumber);case 4:case"end":return t.stop()}}),t)})))()},onchange:function(e){var n=this;return l(r.default.mark((function t(){var a,i;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=e.detail.value[e.detail.value.length-1].value,t.next=3,u.default.buildingList({estateId:a});case 3:i=t.sent,n.range=i.rows.map((function(e){return c(c({},e),{},{text:"".concat(e.number,"栋"),value:e.buildingId})}));case 5:case"end":return t.stop()}}),t)})))()},onnodeclick:function(e){},selectChange:function(e){var n=this;return l(r.default.mark((function t(){var a,i,o,s;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e&&""!=e){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,u.default.houseList({buildingId:e});case 4:if(a=t.sent,n.building=a.rows,i=[],o=a.rows.filter((function(e){return null!==e.unit})).map((function(e){return c(c({},e),{},{text:"".concat(e.unit,"单元"),value:e.unit})})),s=a.rows.filter((function(e){return null!==e.number})).map((function(e){return c(c({},e),{},{text:"".concat(e.number,"号"),value:e.number})})),!(o&&o.length>0)){t.next=13;break}return o.forEach((function(e){var n=i.find((function(n){return n.unit==e.unit}));n||i.push(e)})),n.$set(n.house,"unit",i),t.abrupt("return");case 13:if(!(s&&s.length>0)){t.next=17;break}return s.forEach((function(e){var n=i.find((function(n){return n.number==e.number}));n||i.push(e)})),n.$set(n.house,"number",i),t.abrupt("return");case 17:case"end":return t.stop()}}),t)})))()},unitChange:function(e){this.unit=e;var n=[],t=this.building.filter((function(n){return n.unit==e})).map((function(e){return c(c({},e),{},{text:"".concat(e.floor,"层"),value:e.floor})}));t.forEach((function(e){var t=n.find((function(n){return n.floor==e.floor}));t||n.push(e)})),this.$set(this.house,"floor",n)},floorChange:function(e){var n=this,t=[],r=this.building.filter((function(t){return t.floor==e&&t.unit==n.unit})).map((function(e){return c(c({},e),{},{text:"".concat(e.number,"号"),value:e.houseId})}));r.forEach((function(e){var n=t.find((function(n){return n.number==e.number}));n||t.push(e)})),this.$set(this.house,"number",t)},houseChange:function(e){if(e&&""!=e){var n=this.house.number.find((function(n){return n.houseId==e}));n&&(this.formData.deptId=n.deptId)}},submit:function(n){var t=this;return l(r.default.mark((function a(){return r.default.wrap((function(a){while(1)switch(a.prev=a.next){case 0:t.$refs[n].validate(function(){var n=l(r.default.mark((function n(a,i){var o;return r.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(a){n.next=17;break}if("guest"!=t.role){n.next=12;break}return n.next=4,u.default.addUser(t.formData);case 4:o=n.sent,e.setStorageSync("token",o.data.token),e.setStorageSync("userinfo",o.data.user),e.setStorageSync("role",o.data.role),e.showToast({title:"添加成功",duration:2e3}),t.path&&null!==t.path&&e.redirectTo({url:t.path}),n.next=16;break;case 12:return n.next=14,u.default.updateUser(t.formData);case 14:n.sent,e.showToast({title:"修改成功",duration:2e3});case 16:e.navigateBack();case 17:case"end":return n.stop()}}),n)})));return function(e,t){return n.apply(this,arguments)}}());case 1:case"end":return a.stop()}}),a)})))()}},onLoad:function(e){this.path,e.path}};n.default=h}).call(this,t("543d")["default"])},d5f1:function(e,n,t){},fe14:function(e,n,t){"use strict";t.r(n);var r=t("738c"),u=t("4cd0");for(var a in u)"default"!==a&&function(e){t.d(n,e,(function(){return u[e]}))}(a);t("ff26");var i,o=t("f0c5"),c=Object(o["a"])(u["default"],r["b"],r["c"],!1,null,null,null,!1,r["a"],i);n["default"]=c.exports},ff26:function(e,n,t){"use strict";var r=t("d5f1"),u=t.n(r);u.a}},[["5a6d","common/runtime","common/vendor","pagesinfo/common/vendor"]]]);
|