global.webpackJsonp([5],{ /***/ 333: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _vue = __webpack_require__(1); var _vue2 = _interopRequireDefault(_vue); var _index = __webpack_require__(334); var _index2 = _interopRequireDefault(_index); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var app = new _vue2.default(_index2.default); app.$mount(); exports.default = { config: { navigationBarTitleText: '社区定位' } }; /***/ }), /***/ 334: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_mpvue_loader_lib_selector_type_script_index_0_index_vue__ = __webpack_require__(336); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_mpvue_loader_lib_selector_type_script_index_0_index_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_mpvue_loader_lib_selector_type_script_index_0_index_vue__); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_mpvue_loader_lib_template_compiler_index_id_data_v_12349754_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_mpvue_loader_lib_selector_type_template_index_0_index_vue__ = __webpack_require__(337); var disposed = false function injectStyle (ssrContext) { if (disposed) return __webpack_require__(335) } var normalizeComponent = __webpack_require__(0) /* script */ /* template */ /* styles */ var __vue_styles__ = injectStyle /* scopeId */ var __vue_scopeId__ = "data-v-12349754" /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_mpvue_loader_lib_selector_type_script_index_0_index_vue___default.a, __WEBPACK_IMPORTED_MODULE_1__node_modules_mpvue_loader_lib_template_compiler_index_id_data_v_12349754_hasScoped_true_transformToRequire_video_src_source_src_img_src_image_xlink_href_node_modules_mpvue_loader_lib_selector_type_template_index_0_index_vue__["a" /* default */], __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) Component.options.__file = "src\\pages\\test\\index.vue" if (Component.esModule && Object.keys(Component.esModule).some(function (key) {return key !== "default" && key.substr(0, 2) !== "__"})) {console.error("named exports are not supported in *.vue files.")} if (Component.options.functional) {console.error("[vue-loader] index.vue: functional components are not supported with templates, they should use render functions.")} /* hot reload */ if (false) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), false) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-12349754", Component.options) } else { hotAPI.reload("data-v-12349754", Component.options) } module.hot.dispose(function (data) { disposed = true }) })()} /* harmony default export */ __webpack_exports__["default"] = (Component.exports); /***/ }), /***/ 335: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), /***/ 336: /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _stringify = __webpack_require__(35); var _stringify2 = _interopRequireDefault(_stringify); var _promise = __webpack_require__(12); var _promise2 = _interopRequireDefault(_promise); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // exports.default = { data: function data() { return { text: '', hasHandleAuth: false, street: { columnOne: [], index: 0, arrStruct: [], label: '点击选择街道' }, community: { columnOne: [], index: 0, arrStruct: [], label: '点击选择社区' } }; }, methods: { canIGetPos: function canIGetPos() { var _this = this; return new _promise2.default(function (resolve) { wx.showLoading({ title: '加载中' }); wx.request({ url: _this.rootUrl + '/law/position', success: function success(res) { wx.hideLoading(); resolve(res.data); } }); }); }, canICheckin: function canICheckin() { var _this2 = this; this.canIGetPos().then(function (res) { if (res === 0) { wx.showModal({ title: '您已进行过定位', icon: 'none' }); wx.navigateBack({ delta: 1 }); } else { wx.showModal({ title: '', content: '若之前已经完成过收集,则不需要重新收集,请点击取消!\n 若未完成过收集,请点击确认', success: function success(res) { if (res.confirm) { wx.showModal({ title: '', content: '确定要定位吗?', success: function success(res) { if (res.confirm) { if (_this2.community.label == '点击选择社区') { wx.showModal({ title: '定位失败', content: '请选择您当前所在的街道和社区', showCancel: false }); } else { _this2.getLocation(); } } } }); } } }); } }); }, getLocation: function getLocation() { var _this3 = this; wx.showLoading({ title: '正在定位' }); var lat = void 0, lng = void 0; wx.getLocation({ type: 'gcj02', success: function success(res) { lat = res.latitude; lng = res.longitude; wx.request({ url: _this3.rootUrl + '/local/add', header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'POST', data: { // sessionID: wx.getStorageSync('sessionID'), SCID: _this3.community.arrStruct[_this3.community.index].value, latit: lat, longi: lng // localName: formatted_address, // remark: this.text }, success: function success(res) { if (res.statusCode == '500') { _this3.service.getUnionId(_this3.rootAvatar, _this3.rootUrl).then(function (res) { _this3.getLocation(); }); } else { wx.hideLoading(); if (res.data != -2) { wx.showToast({ title: '定位成功' }); wx.navigateBack({ delta: 1 }); } else { wx.showModal({ title: '定位失败', content: '已超过当日定位次数上限', showCancel: false }); } } } }); // wx.request({ // url: 'https://api.map.baidu.com/geocoder/v2/', // data: { // ak: 'AnWpq9Kc3C8cq5CCGAzsq3NxpBkxRnl0', // location: `${lat},${lng}`, // coordtype: 'gcj02ll', // output: 'json' // }, // success: res => { // const formatted_address = res.data.result.formatted_address // wx.request({ // url: this.rootUrl + '/local/add', // header: {'content-type': 'application/x-www-form-urlencoded'}, // method: 'POST', // data: { // // sessionID: wx.getStorageSync('sessionID'), // SCID: this.community.arrStruct[this.community.index].value, // latit: lat, // longi: lng, // // localName: formatted_address, // // remark: this.text // }, // success: res => { // if (res.statusCode == '500') { // this.service.getUnionId(this.rootAvatar, this.rootUrl).then(res => { // this.getLocation() // }) // } else { // wx.hideLoading() // if (res.data != -2) { // wx.showToast({title: '定位成功'}) // } else { // wx.showModal({ // title: '定位失败', // content: '已超过当日定位次数上限', // showCancel: false // }) // } // } // } // }) // } // }) }, fail: function fail(err) { var authSetting = void 0; wx.getSetting({ success: function success(res) { authSetting = res.authSetting['scope.userLocation']; console.log(authSetting); }, complete: function complete() { if (authSetting) { if (_this3.hasHandleAuth) { _this3.getLocation(); } else { var realName = wx.getStorageSync('userInfo').nickName; _this3.service.UploadBug(_this3.rootUrl, 'test/getLocation/' + realName, (0, _stringify2.default)(err)); wx.showModal({ title: '定位失败', content: '微信未获得位置权限\n请在您手机的系统设置-权限管理中,打开微信的位置信息获取权限', showCancel: false, success: function success(res) { if (res.confirm) { wx.hideLoading(); } } }); } } else { wx.hideLoading(); wx.showModal({ title: '授权请求', content: '您已拒绝小程序获取地理位置,若要使用定位功能,请重新授权', showCancel: false, success: function success(res) { if (res.confirm) { wx.openSetting({ success: function success(res) { if (res.authSetting['scope.userLocation']) { _this3.hasHandleAuth = true; _this3.getLocation(); } } }); } } }); } } }); } }); }, getCommunity: function getCommunity() { var _this4 = this; if (arguments[0] !== 'first') { wx.showLoading({ title: '加载社区列表' }); } wx.request({ url: this.rootUrl + '/comm/getbyid/' + this.street.arrStruct[this.street.index].value, success: function success(res) { _this4.community.columnOne = res.data.map(function (v) { return v.comm_Name; }); _this4.community.arrStruct = res.data.map(function (v) { return { label: v.comm_Name, value: v.scid }; }); wx.hideLoading(); } }); }, pickerConfirm: function pickerConfirm(e, s) { switch (s) { case 'street': { this.street.index = e.mp.detail.value; this.street.label = this.street.columnOne[this.street.index]; this.getCommunity(); break; } case 'community': { this.community.index = e.mp.detail.value; this.community.label = this.community.columnOne[this.community.index]; break; } } } }, onLoad: function onLoad() { var _this5 = this; wx.request({ url: this.rootUrl + '/street/all', success: function success(res) { _this5.street.columnOne = res.data.map(function (v) { return v.street_Name; }); _this5.street.arrStruct = res.data.map(function (v) { return { label: v.street_Name, value: v.ssid }; }); _this5.getCommunity('first'); } }); } }; /***/ }), /***/ 337: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h; return _c('div', { staticClass: "root" }, [_c('div', { staticClass: "baseinfo-box" }, [_c('div', { staticClass: "list-input between" }, [_c('span', [_vm._v("当前街道")]), _vm._v(" "), _c('picker', { attrs: { "value": _vm.street.index, "range": _vm.street.columnOne, "eventid": '0' }, on: { "change": function($event) { _vm.pickerConfirm($event, 'street') } } }, [_c('div', { attrs: { "hover-class": "hover" } }, [_vm._v(_vm._s(_vm.street.label))])])], 1), _vm._v(" "), _c('div', { staticClass: "list-input between" }, [_c('span', [_vm._v("当前社区")]), _vm._v(" "), _c('picker', { attrs: { "value": _vm.community.index, "range": _vm.community.columnOne, "eventid": '1' }, on: { "change": function($event) { _vm.pickerConfirm($event, 'community') } } }, [_c('div', { attrs: { "hover-class": "hover" } }, [_vm._v(_vm._s(_vm.community.label))])])], 1), _vm._v(" "), _c('div', { staticClass: "tip" }, [_vm._v("社区定位功能用于收集社区经纬定信息,为本社区打卡提供定位数据。此菜单仅在以下条件下才开启,并只收集一次即可:"), _c('br'), _vm._v("a. 新加入的社区需要定位数据。"), _c('br'), _vm._v("b. 社区定位不准确,需要重新定位。"), _c('br'), _vm._v("c. 社区搬家需要重新定位经纬度。")], 1), _vm._v(" "), _c('div', { staticClass: "tip strong" }, [_vm._v("定位时请确认您正在所选社区的办公室门口或方圆50米内。")]), _vm._v(" "), _c('div', { staticClass: "commit", attrs: { "eventid": '2' }, on: { "tap": _vm.canICheckin } }, [_c('div', [_vm._v("定位")])])])]) } var staticRenderFns = [] render._withStripped = true var esExports = { render: render, staticRenderFns: staticRenderFns } /* harmony default export */ __webpack_exports__["a"] = (esExports); if (false) { module.hot.accept() if (module.hot.data) { require("vue-hot-reload-api").rerender("data-v-12349754", esExports) } } /***/ }) },[333]); //# sourceMappingURL=main.js.map