|
@@ -563,7 +563,7 @@ var promiseInterceptor = {
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
-var SYNC_API_RE = /^\$|__f__|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|rpx2px|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting|initUTS|requireUTS|registerUTS|getFacialRecognitionMetaInfo/;
|
|
|
|
|
|
|
+var SYNC_API_RE = /^\$|__f__|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|rpx2px|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo|getSystemSetting|getAppAuthorizeSetting|initUTS|requireUTS|registerUTS/;
|
|
|
var CONTEXT_API_RE = /^create|Manager$/;
|
|
var CONTEXT_API_RE = /^create|Manager$/;
|
|
|
|
|
|
|
|
// Context例外情况
|
|
// Context例外情况
|
|
@@ -1030,9 +1030,9 @@ function populateParameters(result) {
|
|
|
appVersion: "1.0.0",
|
|
appVersion: "1.0.0",
|
|
|
appVersionCode: "100",
|
|
appVersionCode: "100",
|
|
|
appLanguage: getAppLanguage(hostLanguage),
|
|
appLanguage: getAppLanguage(hostLanguage),
|
|
|
- uniCompileVersion: "4.85",
|
|
|
|
|
- uniCompilerVersion: "4.85",
|
|
|
|
|
- uniRuntimeVersion: "4.85",
|
|
|
|
|
|
|
+ uniCompileVersion: "4.76",
|
|
|
|
|
+ uniCompilerVersion: "4.76",
|
|
|
|
|
+ uniRuntimeVersion: "4.76",
|
|
|
uniPlatform: undefined || "mp-weixin",
|
|
uniPlatform: undefined || "mp-weixin",
|
|
|
deviceBrand: deviceBrand,
|
|
deviceBrand: deviceBrand,
|
|
|
deviceModel: model,
|
|
deviceModel: model,
|
|
@@ -1138,9 +1138,9 @@ var getAppBaseInfo = {
|
|
|
hostTheme: theme,
|
|
hostTheme: theme,
|
|
|
isUniAppX: false,
|
|
isUniAppX: false,
|
|
|
uniPlatform: undefined || "mp-weixin",
|
|
uniPlatform: undefined || "mp-weixin",
|
|
|
- uniCompileVersion: "4.85",
|
|
|
|
|
- uniCompilerVersion: "4.85",
|
|
|
|
|
- uniRuntimeVersion: "4.85"
|
|
|
|
|
|
|
+ uniCompileVersion: "4.76",
|
|
|
|
|
+ uniCompilerVersion: "4.76",
|
|
|
|
|
+ uniRuntimeVersion: "4.76"
|
|
|
}));
|
|
}));
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
@@ -3299,9 +3299,9 @@ function resolveLocaleChain(locale) {
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ 220:
|
|
/***/ 220:
|
|
|
-/*!*********************************************************************************************************************************!*\
|
|
|
|
|
- !*** D:/zhongshuweilai/zswl.zip/zswl/code/charge_miniapp/charge_miniapp/uni_modules/lime-painter/components/common/relation.js ***!
|
|
|
|
|
- \*********************************************************************************************************************************/
|
|
|
|
|
|
|
+/*!****************************************************************************************************!*\
|
|
|
|
|
+ !*** D:/code/charge-miniapp/charge_miniapp/uni_modules/lime-painter/components/common/relation.js ***!
|
|
|
|
|
+ \****************************************************************************************************/
|
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
@@ -3471,9 +3471,9 @@ function children(parent) {
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ 221:
|
|
/***/ 221:
|
|
|
-/*!*********************************************************************************************************************************!*\
|
|
|
|
|
- !*** D:/zhongshuweilai/zswl.zip/zswl/code/charge_miniapp/charge_miniapp/uni_modules/lime-painter/components/l-painter/props.js ***!
|
|
|
|
|
- \*********************************************************************************************************************************/
|
|
|
|
|
|
|
+/*!****************************************************************************************************!*\
|
|
|
|
|
+ !*** D:/code/charge-miniapp/charge_miniapp/uni_modules/lime-painter/components/l-painter/props.js ***!
|
|
|
|
|
+ \****************************************************************************************************/
|
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
@@ -3530,9 +3530,9 @@ exports.default = _default;
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ 222:
|
|
/***/ 222:
|
|
|
-/*!*********************************************************************************************************************************!*\
|
|
|
|
|
- !*** D:/zhongshuweilai/zswl.zip/zswl/code/charge_miniapp/charge_miniapp/uni_modules/lime-painter/components/l-painter/utils.js ***!
|
|
|
|
|
- \*********************************************************************************************************************************/
|
|
|
|
|
|
|
+/*!****************************************************************************************************!*\
|
|
|
|
|
+ !*** D:/code/charge-miniapp/charge_miniapp/uni_modules/lime-painter/components/l-painter/utils.js ***!
|
|
|
|
|
+ \****************************************************************************************************/
|
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
@@ -3820,9 +3820,9 @@ function getImageInfo(path, useCORS) {
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ 223:
|
|
/***/ 223:
|
|
|
-/*!***********************************************************************************************************************************!*\
|
|
|
|
|
- !*** D:/zhongshuweilai/zswl.zip/zswl/code/charge_miniapp/charge_miniapp/uni_modules/lime-painter/components/l-painter/painter.js ***!
|
|
|
|
|
- \***********************************************************************************************************************************/
|
|
|
|
|
|
|
+/*!******************************************************************************************************!*\
|
|
|
|
|
+ !*** D:/code/charge-miniapp/charge_miniapp/uni_modules/lime-painter/components/l-painter/painter.js ***!
|
|
|
|
|
+ \******************************************************************************************************/
|
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
@@ -12320,562 +12320,87 @@ internalMixin(Vue);
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ 26:
|
|
/***/ 26:
|
|
|
-/*!*************************************************************************************!*\
|
|
|
|
|
- !*** D:/zhongshuweilai/zswl.zip/zswl/code/charge_miniapp/charge_miniapp/pages.json ***!
|
|
|
|
|
- \*************************************************************************************/
|
|
|
|
|
|
|
+/*!********************************************************!*\
|
|
|
|
|
+ !*** D:/code/charge-miniapp/charge_miniapp/pages.json ***!
|
|
|
|
|
+ \********************************************************/
|
|
|
|
|
+/*! no static exports found */
|
|
|
|
|
+/***/ (function(module, exports) {
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+/***/ }),
|
|
|
|
|
+
|
|
|
|
|
+/***/ 3:
|
|
|
|
|
+/*!***********************************!*\
|
|
|
|
|
+ !*** (webpack)/buildin/global.js ***!
|
|
|
|
|
+ \***********************************/
|
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
|
/***/ (function(module, exports) {
|
|
/***/ (function(module, exports) {
|
|
|
|
|
|
|
|
|
|
+var g;
|
|
|
|
|
+
|
|
|
|
|
+// This works in non-strict mode
|
|
|
|
|
+g = (function() {
|
|
|
|
|
+ return this;
|
|
|
|
|
+})();
|
|
|
|
|
+
|
|
|
|
|
+try {
|
|
|
|
|
+ // This works if eval is allowed (see CSP)
|
|
|
|
|
+ g = g || new Function("return this")();
|
|
|
|
|
+} catch (e) {
|
|
|
|
|
+ // This works if the window reference is available
|
|
|
|
|
+ if (typeof window === "object") g = window;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// g can still be undefined, but nothing to do about it...
|
|
|
|
|
+// We return undefined, instead of nothing here, so it's
|
|
|
|
|
+// easier to handle this case. if(!global) { ...}
|
|
|
|
|
+
|
|
|
|
|
+module.exports = g;
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|
|
|
-/***/ 283:
|
|
|
|
|
-/*!***********************************************************************************************!*\
|
|
|
|
|
- !*** D:/zhongshuweilai/zswl.zip/zswl/code/charge_miniapp/charge_miniapp/static/js/bmap-wx.js ***!
|
|
|
|
|
- \***********************************************************************************************/
|
|
|
|
|
|
|
+/***/ 30:
|
|
|
|
|
+/*!**************************************************************!*\
|
|
|
|
|
+ !*** D:/code/charge-miniapp/charge_miniapp/static/js/api.js ***!
|
|
|
|
|
+ \**************************************************************/
|
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
-/* WEBPACK VAR INJECTION */(function(wx) {var _classCallCheck = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23);
|
|
|
|
|
-var _createClass = __webpack_require__(/*! @babel/runtime/helpers/createClass */ 24);
|
|
|
|
|
-/**
|
|
|
|
|
- * @file 微信小程序JSAPI
|
|
|
|
|
- * @author 崔健 cuijian03@baidu.com 2017.01.10
|
|
|
|
|
- * @update 邓淑芳 623996689@qq.com 2019.07.03
|
|
|
|
|
- */
|
|
|
|
|
-/**
|
|
|
|
|
- * 百度地图微信小程序API类
|
|
|
|
|
- *
|
|
|
|
|
- * @class
|
|
|
|
|
- */
|
|
|
|
|
-var BMapWX = /*#__PURE__*/function () {
|
|
|
|
|
- "use strict";
|
|
|
|
|
|
|
+"use strict";
|
|
|
|
|
+/* WEBPACK VAR INJECTION */(function(uni) {
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 百度地图微信小程序API类
|
|
|
|
|
- *
|
|
|
|
|
- * @constructor
|
|
|
|
|
- */
|
|
|
|
|
- function BMapWX(param) {
|
|
|
|
|
- _classCallCheck(this, BMapWX);
|
|
|
|
|
- this.ak = param["ak"];
|
|
|
|
|
- }
|
|
|
|
|
|
|
+var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
|
|
|
|
|
+Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
+ value: true
|
|
|
|
|
+});
|
|
|
|
|
+exports.default = void 0;
|
|
|
|
|
+var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 31));
|
|
|
|
|
+var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
|
|
|
|
|
+var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 33));
|
|
|
|
|
+var _app = _interopRequireDefault(__webpack_require__(/*! ./app */ 34));
|
|
|
|
|
+var _config = _interopRequireDefault(__webpack_require__(/*! ./config */ 35));
|
|
|
|
|
+function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
|
+function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
|
|
+var api = {};
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 使用微信接口进行定位
|
|
|
|
|
- *
|
|
|
|
|
- * @param {string} type 坐标类型
|
|
|
|
|
- * @param {Function} success 成功执行
|
|
|
|
|
- * @param {Function} fail 失败执行
|
|
|
|
|
- * @param {Function} complete 完成后执行
|
|
|
|
|
- */
|
|
|
|
|
- _createClass(BMapWX, [{
|
|
|
|
|
- key: "getWXLocation",
|
|
|
|
|
- value: function getWXLocation(type, success, fail, complete) {
|
|
|
|
|
- type = type || 'gcj02', success = success || function () {};
|
|
|
|
|
- fail = fail || function () {};
|
|
|
|
|
- complete = complete || function () {};
|
|
|
|
|
- wx.getLocation({
|
|
|
|
|
- type: type,
|
|
|
|
|
- success: success,
|
|
|
|
|
- fail: fail,
|
|
|
|
|
- complete: complete
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// 标志位:控制登录提示弹窗只显示一次
|
|
|
|
|
+var isLoginPromptShown = false;
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * POI周边检索
|
|
|
|
|
- *
|
|
|
|
|
- * @param {Object} param 检索配置
|
|
|
|
|
- * 参数对象结构可以参考
|
|
|
|
|
- * http://lbsyun.baidu.com/index.php?title=webapi/guide/webservice-placeapi
|
|
|
|
|
- */
|
|
|
|
|
- }, {
|
|
|
|
|
- key: "search",
|
|
|
|
|
- value: function search(param) {
|
|
|
|
|
- var that = this;
|
|
|
|
|
- param = param || {};
|
|
|
|
|
- var searchparam = {
|
|
|
|
|
- query: param["query"] || '生活服务$美食&酒店',
|
|
|
|
|
- scope: param["scope"] || 1,
|
|
|
|
|
- filter: param["filter"] || '',
|
|
|
|
|
- coord_type: param["coord_type"] || 2,
|
|
|
|
|
- page_size: param["page_size"] || 10,
|
|
|
|
|
- page_num: param["page_num"] || 0,
|
|
|
|
|
- output: param["output"] || 'json',
|
|
|
|
|
- ak: that.ak,
|
|
|
|
|
- sn: param["sn"] || '',
|
|
|
|
|
- timestamp: param["timestamp"] || '',
|
|
|
|
|
- radius: param["radius"] || 2000,
|
|
|
|
|
- ret_coordtype: 'gcj02ll'
|
|
|
|
|
- };
|
|
|
|
|
- var otherparam = {
|
|
|
|
|
- iconPath: param["iconPath"],
|
|
|
|
|
- iconTapPath: param["iconTapPath"],
|
|
|
|
|
- width: param["width"],
|
|
|
|
|
- height: param["height"],
|
|
|
|
|
- alpha: param["alpha"] || 1,
|
|
|
|
|
- success: param["success"] || function () {},
|
|
|
|
|
- fail: param["fail"] || function () {}
|
|
|
|
|
- };
|
|
|
|
|
- var type = 'gcj02';
|
|
|
|
|
- var locationsuccess = function locationsuccess(result) {
|
|
|
|
|
- searchparam["location"] = result["latitude"] + ',' + result["longitude"];
|
|
|
|
|
- wx.request({
|
|
|
|
|
- url: 'https://api.map.baidu.com/place/v2/search',
|
|
|
|
|
- data: searchparam,
|
|
|
|
|
- header: {
|
|
|
|
|
- "content-type": "application/json"
|
|
|
|
|
- },
|
|
|
|
|
- method: 'GET',
|
|
|
|
|
- success: function success(data) {
|
|
|
|
|
- var res = data["data"];
|
|
|
|
|
- if (res["status"] === 0) {
|
|
|
|
|
- var poiArr = res["results"];
|
|
|
|
|
- // outputRes 包含两个对象,
|
|
|
|
|
- // originalData为百度接口返回的原始数据
|
|
|
|
|
- // wxMarkerData为小程序规范的marker格式
|
|
|
|
|
- var outputRes = {};
|
|
|
|
|
- outputRes["originalData"] = res;
|
|
|
|
|
- outputRes["wxMarkerData"] = [];
|
|
|
|
|
- for (var i = 0; i < poiArr.length; i++) {
|
|
|
|
|
- outputRes["wxMarkerData"][i] = {
|
|
|
|
|
- id: i,
|
|
|
|
|
- latitude: poiArr[i]["location"]["lat"],
|
|
|
|
|
- longitude: poiArr[i]["location"]["lng"],
|
|
|
|
|
- title: poiArr[i]["name"],
|
|
|
|
|
- iconPath: otherparam["iconPath"],
|
|
|
|
|
- iconTapPath: otherparam["iconTapPath"],
|
|
|
|
|
- address: poiArr[i]["address"],
|
|
|
|
|
- telephone: poiArr[i]["telephone"],
|
|
|
|
|
- alpha: otherparam["alpha"],
|
|
|
|
|
- width: otherparam["width"],
|
|
|
|
|
- height: otherparam["height"]
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- otherparam.success(outputRes);
|
|
|
|
|
- } else {
|
|
|
|
|
- otherparam.fail({
|
|
|
|
|
- errMsg: res["message"],
|
|
|
|
|
- statusCode: res["status"]
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- fail: function fail(data) {
|
|
|
|
|
- otherparam.fail(data);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
- var locationfail = function locationfail(result) {
|
|
|
|
|
- otherparam.fail(result);
|
|
|
|
|
- };
|
|
|
|
|
- var locationcomplete = function locationcomplete(result) {};
|
|
|
|
|
- if (!param["location"]) {
|
|
|
|
|
- that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
|
|
|
|
|
- } else {
|
|
|
|
|
- var longitude = param.location.split(',')[1];
|
|
|
|
|
- var latitude = param.location.split(',')[0];
|
|
|
|
|
- var errMsg = 'input location';
|
|
|
|
|
- var res = {
|
|
|
|
|
- errMsg: errMsg,
|
|
|
|
|
- latitude: latitude,
|
|
|
|
|
- longitude: longitude
|
|
|
|
|
- };
|
|
|
|
|
- locationsuccess(res);
|
|
|
|
|
|
|
+// 网络请求封装
|
|
|
|
|
+var Request = function Request(opts) {
|
|
|
|
|
+ var originalComplete = opts.complete;
|
|
|
|
|
+ return new Promise(function (resolve, reject) {
|
|
|
|
|
+ uni.request(Object.assign({}, opts, {
|
|
|
|
|
+ complete: function complete(res) {
|
|
|
|
|
+ var hasSuccess = Boolean(res.errMsg == "request:ok" && res.statusCode >= 200 && res.statusCode < 300);
|
|
|
|
|
+ hasSuccess ? resolve(res.data) : reject(res);
|
|
|
|
|
+ if (originalComplete && typeof originalComplete == "function") originalComplete(res);
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * sug模糊检索
|
|
|
|
|
- *
|
|
|
|
|
- * @param {Object} param 检索配置
|
|
|
|
|
- * 参数对象结构可以参考
|
|
|
|
|
- * http://lbsyun.baidu.com/index.php?title=webapi/place-suggestion-api
|
|
|
|
|
- */
|
|
|
|
|
- }, {
|
|
|
|
|
- key: "suggestion",
|
|
|
|
|
- value: function suggestion(param) {
|
|
|
|
|
- var that = this;
|
|
|
|
|
- param = param || {};
|
|
|
|
|
- var suggestionparam = {
|
|
|
|
|
- query: param["query"] || '',
|
|
|
|
|
- region: param["region"] || '全国',
|
|
|
|
|
- city_limit: param["city_limit"] || false,
|
|
|
|
|
- output: param["output"] || 'json',
|
|
|
|
|
- ak: that.ak,
|
|
|
|
|
- sn: param["sn"] || '',
|
|
|
|
|
- timestamp: param["timestamp"] || '',
|
|
|
|
|
- ret_coordtype: 'gcj02ll'
|
|
|
|
|
- };
|
|
|
|
|
- var otherparam = {
|
|
|
|
|
- success: param["success"] || function () {},
|
|
|
|
|
- fail: param["fail"] || function () {}
|
|
|
|
|
- };
|
|
|
|
|
- wx.request({
|
|
|
|
|
- url: 'https://api.map.baidu.com/place/v2/suggestion',
|
|
|
|
|
- data: suggestionparam,
|
|
|
|
|
- header: {
|
|
|
|
|
- "content-type": "application/json"
|
|
|
|
|
- },
|
|
|
|
|
- method: 'GET',
|
|
|
|
|
- success: function success(data) {
|
|
|
|
|
- var res = data["data"];
|
|
|
|
|
- if (res["status"] === 0) {
|
|
|
|
|
- otherparam.success(res);
|
|
|
|
|
- } else {
|
|
|
|
|
- otherparam.fail({
|
|
|
|
|
- errMsg: res["message"],
|
|
|
|
|
- statusCode: res["status"]
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- fail: function fail(data) {
|
|
|
|
|
- otherparam.fail(data);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * rgc检索(逆地理编码:经纬度->地点描述)
|
|
|
|
|
- *
|
|
|
|
|
- * @param {Object} param 检索配置
|
|
|
|
|
- * 参数对象结构可以参考
|
|
|
|
|
- * https://lbs.baidu.com/index.php?title=webapi/guide/webservice-geocoding-abroad
|
|
|
|
|
- *
|
|
|
|
|
- */
|
|
|
|
|
- }, {
|
|
|
|
|
- key: "regeocoding",
|
|
|
|
|
- value: function regeocoding(param) {
|
|
|
|
|
- var that = this;
|
|
|
|
|
- param = param || {};
|
|
|
|
|
- var regeocodingparam = {
|
|
|
|
|
- coordtype: param["coordtype"] || 'gcj02ll',
|
|
|
|
|
- ret_coordtype: 'gcj02ll',
|
|
|
|
|
- radius: param["radius"] || 1000,
|
|
|
|
|
- ak: that.ak,
|
|
|
|
|
- sn: param["sn"] || '',
|
|
|
|
|
- output: param["output"] || 'json',
|
|
|
|
|
- callback: param["callback"] || function () {},
|
|
|
|
|
- extensions_poi: param["extensions_poi"] || 1,
|
|
|
|
|
- extensions_road: param["extensions_road"] || false,
|
|
|
|
|
- extensions_town: param["extensions_town"] || false,
|
|
|
|
|
- language: param["language"] || 'zh-CN',
|
|
|
|
|
- language_auto: param["language_auto"] || 0
|
|
|
|
|
- };
|
|
|
|
|
- var otherparam = {
|
|
|
|
|
- iconPath: param["iconPath"],
|
|
|
|
|
- iconTapPath: param["iconTapPath"],
|
|
|
|
|
- width: param["width"],
|
|
|
|
|
- height: param["height"],
|
|
|
|
|
- alpha: param["alpha"] || 1,
|
|
|
|
|
- success: param["success"] || function () {},
|
|
|
|
|
- fail: param["fail"] || function () {}
|
|
|
|
|
- };
|
|
|
|
|
- var type = 'gcj02';
|
|
|
|
|
- var locationsuccess = function locationsuccess(result) {
|
|
|
|
|
- regeocodingparam["location"] = result["latitude"] + ',' + result["longitude"];
|
|
|
|
|
- wx.request({
|
|
|
|
|
- url: 'https://api.map.baidu.com/reverse_geocoding/v3',
|
|
|
|
|
- data: regeocodingparam,
|
|
|
|
|
- header: {
|
|
|
|
|
- "content-type": "application/json"
|
|
|
|
|
- },
|
|
|
|
|
- method: 'GET',
|
|
|
|
|
- success: function success(data) {
|
|
|
|
|
- var res = data["data"];
|
|
|
|
|
- if (res["status"] === 0) {
|
|
|
|
|
- var poiObj = res["result"];
|
|
|
|
|
- // outputRes 包含两个对象:
|
|
|
|
|
- // originalData为百度接口返回的原始数据
|
|
|
|
|
- // wxMarkerData为小程序规范的marker格式
|
|
|
|
|
- var outputRes = {};
|
|
|
|
|
- outputRes["originalData"] = res;
|
|
|
|
|
- outputRes["wxMarkerData"] = [];
|
|
|
|
|
- outputRes["wxMarkerData"][0] = {
|
|
|
|
|
- id: 0,
|
|
|
|
|
- latitude: result["latitude"],
|
|
|
|
|
- longitude: result["longitude"],
|
|
|
|
|
- address: poiObj["formatted_address"],
|
|
|
|
|
- iconPath: otherparam["iconPath"],
|
|
|
|
|
- iconTapPath: otherparam["iconTapPath"],
|
|
|
|
|
- desc: poiObj["sematic_description"],
|
|
|
|
|
- business: poiObj["business"],
|
|
|
|
|
- alpha: otherparam["alpha"],
|
|
|
|
|
- width: otherparam["width"],
|
|
|
|
|
- height: otherparam["height"]
|
|
|
|
|
- };
|
|
|
|
|
- otherparam.success(outputRes);
|
|
|
|
|
- } else {
|
|
|
|
|
- otherparam.fail({
|
|
|
|
|
- errMsg: res["message"],
|
|
|
|
|
- statusCode: res["status"]
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- fail: function fail(data) {
|
|
|
|
|
- otherparam.fail(data);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
- var locationfail = function locationfail(result) {
|
|
|
|
|
- otherparam.fail(result);
|
|
|
|
|
- };
|
|
|
|
|
- var locationcomplete = function locationcomplete(result) {};
|
|
|
|
|
- if (!param["location"]) {
|
|
|
|
|
- that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
|
|
|
|
|
- } else {
|
|
|
|
|
- var longitude = param.location.split(',')[1];
|
|
|
|
|
- var latitude = param.location.split(',')[0];
|
|
|
|
|
- var errMsg = 'input location';
|
|
|
|
|
- var res = {
|
|
|
|
|
- errMsg: errMsg,
|
|
|
|
|
- latitude: latitude,
|
|
|
|
|
- longitude: longitude
|
|
|
|
|
- };
|
|
|
|
|
- locationsuccess(res);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * gc检索(地理编码:地点->经纬度)
|
|
|
|
|
- *
|
|
|
|
|
- * @param {Object} param 检索配置
|
|
|
|
|
- * 参数对象结构可以参考
|
|
|
|
|
- * https://lbs.baidu.com/index.php?title=webapi/guide/webservice-geocoding
|
|
|
|
|
- *
|
|
|
|
|
- */
|
|
|
|
|
- }, {
|
|
|
|
|
- key: "geocoding",
|
|
|
|
|
- value: function geocoding(param) {
|
|
|
|
|
- var that = this;
|
|
|
|
|
- param = param || {};
|
|
|
|
|
- var geocodingparam = {
|
|
|
|
|
- address: param["address"] || '',
|
|
|
|
|
- city: param["city"] || '',
|
|
|
|
|
- ret_coordtype: param["coordtype"] || 'gcj02ll',
|
|
|
|
|
- ak: that.ak,
|
|
|
|
|
- sn: param["sn"] || '',
|
|
|
|
|
- output: param["output"] || 'json',
|
|
|
|
|
- callback: param["callback"] || function () {}
|
|
|
|
|
- };
|
|
|
|
|
- var otherparam = {
|
|
|
|
|
- iconPath: param["iconPath"],
|
|
|
|
|
- iconTapPath: param["iconTapPath"],
|
|
|
|
|
- width: param["width"],
|
|
|
|
|
- height: param["height"],
|
|
|
|
|
- alpha: param["alpha"] || 1,
|
|
|
|
|
- success: param["success"] || function () {},
|
|
|
|
|
- fail: param["fail"] || function () {}
|
|
|
|
|
- };
|
|
|
|
|
- if (param["address"]) {
|
|
|
|
|
- wx.request({
|
|
|
|
|
- url: 'https://api.map.baidu.com/geocoding/v3',
|
|
|
|
|
- data: geocodingparam,
|
|
|
|
|
- header: {
|
|
|
|
|
- "content-type": "application/json"
|
|
|
|
|
- },
|
|
|
|
|
- method: 'GET',
|
|
|
|
|
- success: function success(data) {
|
|
|
|
|
- var res = data["data"];
|
|
|
|
|
- if (res["status"] === 0) {
|
|
|
|
|
- var poiObj = res["result"];
|
|
|
|
|
- // outputRes 包含两个对象:
|
|
|
|
|
- // originalData为百度接口返回的原始数据
|
|
|
|
|
- // wxMarkerData为小程序规范的marker格式
|
|
|
|
|
- var outputRes = res;
|
|
|
|
|
- outputRes["originalData"] = res;
|
|
|
|
|
- outputRes["wxMarkerData"] = [];
|
|
|
|
|
- outputRes["wxMarkerData"][0] = {
|
|
|
|
|
- id: 0,
|
|
|
|
|
- latitude: poiObj["location"]["lat"],
|
|
|
|
|
- longitude: poiObj["location"]["lng"],
|
|
|
|
|
- iconPath: otherparam["iconPath"],
|
|
|
|
|
- iconTapPath: otherparam["iconTapPath"],
|
|
|
|
|
- alpha: otherparam["alpha"],
|
|
|
|
|
- width: otherparam["width"],
|
|
|
|
|
- height: otherparam["height"]
|
|
|
|
|
- };
|
|
|
|
|
- otherparam.success(outputRes);
|
|
|
|
|
- } else {
|
|
|
|
|
- otherparam.fail({
|
|
|
|
|
- errMsg: res["message"],
|
|
|
|
|
- statusCode: res["status"]
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- fail: function fail(data) {
|
|
|
|
|
- otherparam.fail(data);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- } else {
|
|
|
|
|
- var errMsg = 'input address!';
|
|
|
|
|
- var res = {
|
|
|
|
|
- errMsg: errMsg
|
|
|
|
|
- };
|
|
|
|
|
- otherparam.fail(res);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 天气检索
|
|
|
|
|
- *
|
|
|
|
|
- * @param {Object} param 检索配置
|
|
|
|
|
- */
|
|
|
|
|
- }, {
|
|
|
|
|
- key: "weather",
|
|
|
|
|
- value: function weather(param) {
|
|
|
|
|
- var that = this;
|
|
|
|
|
- param = param || {};
|
|
|
|
|
- var weatherparam = {
|
|
|
|
|
- coord_type: param["coord_type"] || 'gcj02',
|
|
|
|
|
- output: param["output"] || 'json',
|
|
|
|
|
- ak: that.ak,
|
|
|
|
|
- sn: param["sn"] || '',
|
|
|
|
|
- timestamp: param["timestamp"] || ''
|
|
|
|
|
- };
|
|
|
|
|
- var otherparam = {
|
|
|
|
|
- success: param["success"] || function () {},
|
|
|
|
|
- fail: param["fail"] || function () {}
|
|
|
|
|
- };
|
|
|
|
|
- var type = 'gcj02';
|
|
|
|
|
- var locationsuccess = function locationsuccess(result) {
|
|
|
|
|
- weatherparam["location"] = result["longitude"] + ',' + result["latitude"];
|
|
|
|
|
- wx.request({
|
|
|
|
|
- url: 'https://api.map.baidu.com/telematics/v3/weather',
|
|
|
|
|
- data: weatherparam,
|
|
|
|
|
- header: {
|
|
|
|
|
- "content-type": "application/json"
|
|
|
|
|
- },
|
|
|
|
|
- method: 'GET',
|
|
|
|
|
- success: function success(data) {
|
|
|
|
|
- var res = data["data"];
|
|
|
|
|
- if (res["error"] === 0 && res["status"] === 'success') {
|
|
|
|
|
- var weatherArr = res["results"];
|
|
|
|
|
- // outputRes 包含两个对象,
|
|
|
|
|
- // originalData为百度接口返回的原始数据
|
|
|
|
|
- // wxMarkerData为小程序规范的marker格式
|
|
|
|
|
- var outputRes = {};
|
|
|
|
|
- outputRes["originalData"] = res;
|
|
|
|
|
- outputRes["currentWeather"] = [];
|
|
|
|
|
- outputRes["currentWeather"][0] = {
|
|
|
|
|
- currentCity: weatherArr[0]["currentCity"],
|
|
|
|
|
- pm25: weatherArr[0]["pm25"],
|
|
|
|
|
- date: weatherArr[0]["weather_data"][0]["date"],
|
|
|
|
|
- temperature: weatherArr[0]["weather_data"][0]["temperature"],
|
|
|
|
|
- weatherDesc: weatherArr[0]["weather_data"][0]["weather"],
|
|
|
|
|
- wind: weatherArr[0]["weather_data"][0]["wind"]
|
|
|
|
|
- };
|
|
|
|
|
- otherparam.success(outputRes);
|
|
|
|
|
- } else {
|
|
|
|
|
- otherparam.fail({
|
|
|
|
|
- errMsg: res["message"],
|
|
|
|
|
- statusCode: res["status"]
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- fail: function fail(data) {
|
|
|
|
|
- otherparam.fail(data);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
- var locationfail = function locationfail(result) {
|
|
|
|
|
- otherparam.fail(result);
|
|
|
|
|
- };
|
|
|
|
|
- var locationcomplete = function locationcomplete(result) {};
|
|
|
|
|
- if (!param["location"]) {
|
|
|
|
|
- that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
|
|
|
|
|
- } else {
|
|
|
|
|
- var longitude = param.location.split(',')[0];
|
|
|
|
|
- var latitude = param.location.split(',')[1];
|
|
|
|
|
- var errMsg = 'input location';
|
|
|
|
|
- var res = {
|
|
|
|
|
- errMsg: errMsg,
|
|
|
|
|
- latitude: latitude,
|
|
|
|
|
- longitude: longitude
|
|
|
|
|
- };
|
|
|
|
|
- locationsuccess(res);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }]);
|
|
|
|
|
- return BMapWX;
|
|
|
|
|
-}();
|
|
|
|
|
-module.exports.BMapWX = BMapWX;
|
|
|
|
|
-/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
|
|
|
|
|
-
|
|
|
|
|
-/***/ }),
|
|
|
|
|
-
|
|
|
|
|
-/***/ 3:
|
|
|
|
|
-/*!***********************************!*\
|
|
|
|
|
- !*** (webpack)/buildin/global.js ***!
|
|
|
|
|
- \***********************************/
|
|
|
|
|
-/*! no static exports found */
|
|
|
|
|
-/***/ (function(module, exports) {
|
|
|
|
|
-
|
|
|
|
|
-var g;
|
|
|
|
|
-
|
|
|
|
|
-// This works in non-strict mode
|
|
|
|
|
-g = (function() {
|
|
|
|
|
- return this;
|
|
|
|
|
-})();
|
|
|
|
|
-
|
|
|
|
|
-try {
|
|
|
|
|
- // This works if eval is allowed (see CSP)
|
|
|
|
|
- g = g || new Function("return this")();
|
|
|
|
|
-} catch (e) {
|
|
|
|
|
- // This works if the window reference is available
|
|
|
|
|
- if (typeof window === "object") g = window;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// g can still be undefined, but nothing to do about it...
|
|
|
|
|
-// We return undefined, instead of nothing here, so it's
|
|
|
|
|
-// easier to handle this case. if(!global) { ...}
|
|
|
|
|
-
|
|
|
|
|
-module.exports = g;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-/***/ }),
|
|
|
|
|
-
|
|
|
|
|
-/***/ 30:
|
|
|
|
|
-/*!*******************************************************************************************!*\
|
|
|
|
|
- !*** D:/zhongshuweilai/zswl.zip/zswl/code/charge_miniapp/charge_miniapp/static/js/api.js ***!
|
|
|
|
|
- \*******************************************************************************************/
|
|
|
|
|
-/*! no static exports found */
|
|
|
|
|
-/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
-
|
|
|
|
|
-"use strict";
|
|
|
|
|
-/* WEBPACK VAR INJECTION */(function(uni) {
|
|
|
|
|
-
|
|
|
|
|
-var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ 4);
|
|
|
|
|
-Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
- value: true
|
|
|
|
|
-});
|
|
|
|
|
-exports.default = void 0;
|
|
|
|
|
-var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ 31));
|
|
|
|
|
-var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ 11));
|
|
|
|
|
-var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ 33));
|
|
|
|
|
-var _app = _interopRequireDefault(__webpack_require__(/*! ./app */ 34));
|
|
|
|
|
-var _config = _interopRequireDefault(__webpack_require__(/*! ./config */ 35));
|
|
|
|
|
-function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
|
-function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
|
|
|
-var api = {};
|
|
|
|
|
-
|
|
|
|
|
-// 标志位:控制登录提示弹窗只显示一次
|
|
|
|
|
-var isLoginPromptShown = false;
|
|
|
|
|
-
|
|
|
|
|
-// 网络请求封装
|
|
|
|
|
-var Request = function Request(opts) {
|
|
|
|
|
- var originalComplete = opts.complete;
|
|
|
|
|
- return new Promise(function (resolve, reject) {
|
|
|
|
|
- uni.request(Object.assign({}, opts, {
|
|
|
|
|
- complete: function complete(res) {
|
|
|
|
|
- var hasSuccess = Boolean(res.errMsg == "request:ok" && res.statusCode >= 200 && res.statusCode < 300);
|
|
|
|
|
- hasSuccess ? resolve(res.data) : reject(res);
|
|
|
|
|
- if (originalComplete && typeof originalComplete == "function") originalComplete(res);
|
|
|
|
|
- }
|
|
|
|
|
- }));
|
|
|
|
|
- });
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ }));
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
// 路径拼接
|
|
// 路径拼接
|
|
|
var pathJoin = function pathJoin() {
|
|
var pathJoin = function pathJoin() {
|
|
@@ -13739,9 +13264,9 @@ module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exp
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ 34:
|
|
/***/ 34:
|
|
|
-/*!*******************************************************************************************!*\
|
|
|
|
|
- !*** D:/zhongshuweilai/zswl.zip/zswl/code/charge_miniapp/charge_miniapp/static/js/app.js ***!
|
|
|
|
|
- \*******************************************************************************************/
|
|
|
|
|
|
|
+/*!**************************************************************!*\
|
|
|
|
|
+ !*** D:/code/charge-miniapp/charge_miniapp/static/js/app.js ***!
|
|
|
|
|
+ \**************************************************************/
|
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
@@ -14372,9 +13897,9 @@ module.exports = app;
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ 35:
|
|
/***/ 35:
|
|
|
-/*!**********************************************************************************************!*\
|
|
|
|
|
- !*** D:/zhongshuweilai/zswl.zip/zswl/code/charge_miniapp/charge_miniapp/static/js/config.js ***!
|
|
|
|
|
- \**********************************************************************************************/
|
|
|
|
|
|
|
+/*!*****************************************************************!*\
|
|
|
|
|
+ !*** D:/code/charge-miniapp/charge_miniapp/static/js/config.js ***!
|
|
|
|
|
+ \*****************************************************************/
|
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
@@ -14401,8 +13926,8 @@ config.url = {
|
|
|
// request : 'http://192.168.110.3:80/',
|
|
// request : 'http://192.168.110.3:80/',
|
|
|
// request : 'http://192.168.1.253:80/',
|
|
// request : 'http://192.168.1.253:80/',
|
|
|
// request : 'http://120.78.228.211:8866/',
|
|
// request : 'http://120.78.228.211:8866/',
|
|
|
- request: "http://192.168.0.11:8989/",
|
|
|
|
|
- // request: "https://cd.admin.zswlgz.com/",
|
|
|
|
|
|
|
+ // request: "http://192.168.0.11:8989/",
|
|
|
|
|
+ request: "https://cd.admin.zswlgz.com/",
|
|
|
// request: "http://192.168.0.217:8989/",
|
|
// request: "http://192.168.0.217:8989/",
|
|
|
// request : 'https://charge.dev.hub.zswlgz.com/',
|
|
// request : 'https://charge.dev.hub.zswlgz.com/',
|
|
|
// 上传地址
|
|
// 上传地址
|
|
@@ -14462,9 +13987,9 @@ exports.default = _default;
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ 36:
|
|
/***/ 36:
|
|
|
-/*!******************************************************************************************************************!*\
|
|
|
|
|
- !*** D:/zhongshuweilai/zswl.zip/zswl/code/charge_miniapp/charge_miniapp/pages.json?{"type":"origin-pages-json"} ***!
|
|
|
|
|
- \******************************************************************************************************************/
|
|
|
|
|
|
|
+/*!*************************************************************************************!*\
|
|
|
|
|
+ !*** D:/code/charge-miniapp/charge_miniapp/pages.json?{"type":"origin-pages-json"} ***!
|
|
|
|
|
+ \*************************************************************************************/
|
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
@@ -14754,9 +14279,9 @@ module.exports = _interopRequireDefault, module.exports.__esModule = true, modul
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ 40:
|
|
/***/ 40:
|
|
|
-/*!***************************************************************************************************!*\
|
|
|
|
|
- !*** D:/zhongshuweilai/zswl.zip/zswl/code/charge_miniapp/charge_miniapp/uni.promisify.adaptor.js ***!
|
|
|
|
|
- \***************************************************************************************************/
|
|
|
|
|
|
|
+/*!**********************************************************************!*\
|
|
|
|
|
+ !*** D:/code/charge-miniapp/charge_miniapp/uni.promisify.adaptor.js ***!
|
|
|
|
|
+ \**********************************************************************/
|
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
@@ -14778,9 +14303,9 @@ uni.addInterceptor({
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ 41:
|
|
/***/ 41:
|
|
|
-/*!*********************************************************************************************!*\
|
|
|
|
|
- !*** D:/zhongshuweilai/zswl.zip/zswl/code/charge_miniapp/charge_miniapp/static/js/index.js ***!
|
|
|
|
|
- \*********************************************************************************************/
|
|
|
|
|
|
|
+/*!****************************************************************!*\
|
|
|
|
|
+ !*** D:/code/charge-miniapp/charge_miniapp/static/js/index.js ***!
|
|
|
|
|
+ \****************************************************************/
|
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
|
|
@@ -14823,9 +14348,9 @@ var _wxqrcode = _interopRequireDefault(__webpack_require__(/*! ./wxqrcode.js */
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ 42:
|
|
/***/ 42:
|
|
|
-/*!************************************************************************************************!*\
|
|
|
|
|
- !*** D:/zhongshuweilai/zswl.zip/zswl/code/charge_miniapp/charge_miniapp/static/js/wxqrcode.js ***!
|
|
|
|
|
- \************************************************************************************************/
|
|
|
|
|
|
|
+/*!*******************************************************************!*\
|
|
|
|
|
+ !*** D:/code/charge-miniapp/charge_miniapp/static/js/wxqrcode.js ***!
|
|
|
|
|
+ \*******************************************************************/
|
|
|
/*! no static exports found */
|
|
/*! no static exports found */
|
|
|
/***/ (function(module, exports) {
|
|
/***/ (function(module, exports) {
|
|
|
|
|
|
|
@@ -16012,117 +15537,592 @@ var gifImage = function gifImage(width, height) {
|
|
|
for (var i = 0; i < clearCode; i += 1) {
|
|
for (var i = 0; i < clearCode; i += 1) {
|
|
|
table.add(String.fromCharCode(i));
|
|
table.add(String.fromCharCode(i));
|
|
|
}
|
|
}
|
|
|
- table.add(String.fromCharCode(clearCode));
|
|
|
|
|
- table.add(String.fromCharCode(endCode));
|
|
|
|
|
- var byteOut = byteArrayOutputStream();
|
|
|
|
|
- var bitOut = bitOutputStream(byteOut);
|
|
|
|
|
|
|
+ table.add(String.fromCharCode(clearCode));
|
|
|
|
|
+ table.add(String.fromCharCode(endCode));
|
|
|
|
|
+ var byteOut = byteArrayOutputStream();
|
|
|
|
|
+ var bitOut = bitOutputStream(byteOut);
|
|
|
|
|
+
|
|
|
|
|
+ // clear code
|
|
|
|
|
+ bitOut.write(clearCode, bitLength);
|
|
|
|
|
+ var dataIndex = 0;
|
|
|
|
|
+ var s = String.fromCharCode(_data[dataIndex]);
|
|
|
|
|
+ dataIndex += 1;
|
|
|
|
|
+ while (dataIndex < _data.length) {
|
|
|
|
|
+ var c = String.fromCharCode(_data[dataIndex]);
|
|
|
|
|
+ dataIndex += 1;
|
|
|
|
|
+ if (table.contains(s + c)) {
|
|
|
|
|
+ s = s + c;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ bitOut.write(table.indexOf(s), bitLength);
|
|
|
|
|
+ if (table.size() < 0xfff) {
|
|
|
|
|
+ if (table.size() == 1 << bitLength) {
|
|
|
|
|
+ bitLength += 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ table.add(s + c);
|
|
|
|
|
+ }
|
|
|
|
|
+ s = c;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ bitOut.write(table.indexOf(s), bitLength);
|
|
|
|
|
+
|
|
|
|
|
+ // end code
|
|
|
|
|
+ bitOut.write(endCode, bitLength);
|
|
|
|
|
+ bitOut.flush();
|
|
|
|
|
+ return byteOut.toByteArray();
|
|
|
|
|
+ };
|
|
|
|
|
+ var lzwTable = function lzwTable() {
|
|
|
|
|
+ var _map = {};
|
|
|
|
|
+ var _size = 0;
|
|
|
|
|
+ var _this = {};
|
|
|
|
|
+ _this.add = function (key) {
|
|
|
|
|
+ if (_this.contains(key)) {
|
|
|
|
|
+ throw new Error('dup key:' + key);
|
|
|
|
|
+ }
|
|
|
|
|
+ _map[key] = _size;
|
|
|
|
|
+ _size += 1;
|
|
|
|
|
+ };
|
|
|
|
|
+ _this.size = function () {
|
|
|
|
|
+ return _size;
|
|
|
|
|
+ };
|
|
|
|
|
+ _this.indexOf = function (key) {
|
|
|
|
|
+ return _map[key];
|
|
|
|
|
+ };
|
|
|
|
|
+ _this.contains = function (key) {
|
|
|
|
|
+ return typeof _map[key] != 'undefined';
|
|
|
|
|
+ };
|
|
|
|
|
+ return _this;
|
|
|
|
|
+ };
|
|
|
|
|
+ return _this;
|
|
|
|
|
+};
|
|
|
|
|
+var createImgTag = function createImgTag(width, height, getPixel, alt) {
|
|
|
|
|
+ var gif = gifImage(width, height);
|
|
|
|
|
+ for (var y = 0; y < height; y += 1) {
|
|
|
|
|
+ for (var x = 0; x < width; x += 1) {
|
|
|
|
|
+ gif.setPixel(x, y, getPixel(x, y));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ var b = byteArrayOutputStream();
|
|
|
|
|
+ gif.write(b);
|
|
|
|
|
+ var base64 = base64EncodeOutputStream();
|
|
|
|
|
+ var bytes = b.toByteArray();
|
|
|
|
|
+ for (var i = 0; i < bytes.length; i += 1) {
|
|
|
|
|
+ base64.writeByte(bytes[i]);
|
|
|
|
|
+ }
|
|
|
|
|
+ base64.flush();
|
|
|
|
|
+ var img = '';
|
|
|
|
|
+ img += 'data:image/gif;base64,';
|
|
|
|
|
+ img += base64;
|
|
|
|
|
+ return img;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+//---------------------------------------------------------------------
|
|
|
|
|
+// returns qrcode function.
|
|
|
|
|
+
|
|
|
|
|
+var createQrCodeImg = function createQrCodeImg(text, options) {
|
|
|
|
|
+ options = options || {};
|
|
|
|
|
+ var typeNumber = options.typeNumber || 4;
|
|
|
|
|
+ var errorCorrectLevel = options.errorCorrectLevel || 'M';
|
|
|
|
|
+ var size = options.size || 500;
|
|
|
|
|
+ var qr;
|
|
|
|
|
+ try {
|
|
|
|
|
+ qr = qrcode(typeNumber, errorCorrectLevel || 'M');
|
|
|
|
|
+ qr.addData(text);
|
|
|
|
|
+ qr.make();
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ if (typeNumber >= 40) {
|
|
|
|
|
+ throw new Error('Text too long to encode');
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return createQrCodeImg(text, {
|
|
|
|
|
+ size: size,
|
|
|
|
|
+ errorCorrectLevel: errorCorrectLevel,
|
|
|
|
|
+ typeNumber: typeNumber + 1
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // calc cellsize and margin
|
|
|
|
|
+ var cellsize = parseInt(size / qr.getModuleCount());
|
|
|
|
|
+ var margin = parseInt((size - qr.getModuleCount() * cellsize) / 2);
|
|
|
|
|
+ return qr.createImgTag(cellsize, margin, size);
|
|
|
|
|
+};
|
|
|
|
|
+module.exports = {
|
|
|
|
|
+ create: createQrCodeImg
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+/***/ }),
|
|
|
|
|
+
|
|
|
|
|
+/***/ 49:
|
|
|
|
|
+/*!******************************************************************!*\
|
|
|
|
|
+ !*** D:/code/charge-miniapp/charge_miniapp/static/js/bmap-wx.js ***!
|
|
|
|
|
+ \******************************************************************/
|
|
|
|
|
+/*! no static exports found */
|
|
|
|
|
+/***/ (function(module, exports, __webpack_require__) {
|
|
|
|
|
+
|
|
|
|
|
+/* WEBPACK VAR INJECTION */(function(wx) {var _classCallCheck = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ 23);
|
|
|
|
|
+var _createClass = __webpack_require__(/*! @babel/runtime/helpers/createClass */ 24);
|
|
|
|
|
+/**
|
|
|
|
|
+ * @file 微信小程序JSAPI
|
|
|
|
|
+ * @author 崔健 cuijian03@baidu.com 2017.01.10
|
|
|
|
|
+ * @update 邓淑芳 623996689@qq.com 2019.07.03
|
|
|
|
|
+ */
|
|
|
|
|
+/**
|
|
|
|
|
+ * 百度地图微信小程序API类
|
|
|
|
|
+ *
|
|
|
|
|
+ * @class
|
|
|
|
|
+ */
|
|
|
|
|
+var BMapWX = /*#__PURE__*/function () {
|
|
|
|
|
+ "use strict";
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 百度地图微信小程序API类
|
|
|
|
|
+ *
|
|
|
|
|
+ * @constructor
|
|
|
|
|
+ */
|
|
|
|
|
+ function BMapWX(param) {
|
|
|
|
|
+ _classCallCheck(this, BMapWX);
|
|
|
|
|
+ this.ak = param["ak"];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 使用微信接口进行定位
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {string} type 坐标类型
|
|
|
|
|
+ * @param {Function} success 成功执行
|
|
|
|
|
+ * @param {Function} fail 失败执行
|
|
|
|
|
+ * @param {Function} complete 完成后执行
|
|
|
|
|
+ */
|
|
|
|
|
+ _createClass(BMapWX, [{
|
|
|
|
|
+ key: "getWXLocation",
|
|
|
|
|
+ value: function getWXLocation(type, success, fail, complete) {
|
|
|
|
|
+ type = type || 'gcj02', success = success || function () {};
|
|
|
|
|
+ fail = fail || function () {};
|
|
|
|
|
+ complete = complete || function () {};
|
|
|
|
|
+ wx.getLocation({
|
|
|
|
|
+ type: type,
|
|
|
|
|
+ success: success,
|
|
|
|
|
+ fail: fail,
|
|
|
|
|
+ complete: complete
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- // clear code
|
|
|
|
|
- bitOut.write(clearCode, bitLength);
|
|
|
|
|
- var dataIndex = 0;
|
|
|
|
|
- var s = String.fromCharCode(_data[dataIndex]);
|
|
|
|
|
- dataIndex += 1;
|
|
|
|
|
- while (dataIndex < _data.length) {
|
|
|
|
|
- var c = String.fromCharCode(_data[dataIndex]);
|
|
|
|
|
- dataIndex += 1;
|
|
|
|
|
- if (table.contains(s + c)) {
|
|
|
|
|
- s = s + c;
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * POI周边检索
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {Object} param 检索配置
|
|
|
|
|
+ * 参数对象结构可以参考
|
|
|
|
|
+ * http://lbsyun.baidu.com/index.php?title=webapi/guide/webservice-placeapi
|
|
|
|
|
+ */
|
|
|
|
|
+ }, {
|
|
|
|
|
+ key: "search",
|
|
|
|
|
+ value: function search(param) {
|
|
|
|
|
+ var that = this;
|
|
|
|
|
+ param = param || {};
|
|
|
|
|
+ var searchparam = {
|
|
|
|
|
+ query: param["query"] || '生活服务$美食&酒店',
|
|
|
|
|
+ scope: param["scope"] || 1,
|
|
|
|
|
+ filter: param["filter"] || '',
|
|
|
|
|
+ coord_type: param["coord_type"] || 2,
|
|
|
|
|
+ page_size: param["page_size"] || 10,
|
|
|
|
|
+ page_num: param["page_num"] || 0,
|
|
|
|
|
+ output: param["output"] || 'json',
|
|
|
|
|
+ ak: that.ak,
|
|
|
|
|
+ sn: param["sn"] || '',
|
|
|
|
|
+ timestamp: param["timestamp"] || '',
|
|
|
|
|
+ radius: param["radius"] || 2000,
|
|
|
|
|
+ ret_coordtype: 'gcj02ll'
|
|
|
|
|
+ };
|
|
|
|
|
+ var otherparam = {
|
|
|
|
|
+ iconPath: param["iconPath"],
|
|
|
|
|
+ iconTapPath: param["iconTapPath"],
|
|
|
|
|
+ width: param["width"],
|
|
|
|
|
+ height: param["height"],
|
|
|
|
|
+ alpha: param["alpha"] || 1,
|
|
|
|
|
+ success: param["success"] || function () {},
|
|
|
|
|
+ fail: param["fail"] || function () {}
|
|
|
|
|
+ };
|
|
|
|
|
+ var type = 'gcj02';
|
|
|
|
|
+ var locationsuccess = function locationsuccess(result) {
|
|
|
|
|
+ searchparam["location"] = result["latitude"] + ',' + result["longitude"];
|
|
|
|
|
+ wx.request({
|
|
|
|
|
+ url: 'https://api.map.baidu.com/place/v2/search',
|
|
|
|
|
+ data: searchparam,
|
|
|
|
|
+ header: {
|
|
|
|
|
+ "content-type": "application/json"
|
|
|
|
|
+ },
|
|
|
|
|
+ method: 'GET',
|
|
|
|
|
+ success: function success(data) {
|
|
|
|
|
+ var res = data["data"];
|
|
|
|
|
+ if (res["status"] === 0) {
|
|
|
|
|
+ var poiArr = res["results"];
|
|
|
|
|
+ // outputRes 包含两个对象,
|
|
|
|
|
+ // originalData为百度接口返回的原始数据
|
|
|
|
|
+ // wxMarkerData为小程序规范的marker格式
|
|
|
|
|
+ var outputRes = {};
|
|
|
|
|
+ outputRes["originalData"] = res;
|
|
|
|
|
+ outputRes["wxMarkerData"] = [];
|
|
|
|
|
+ for (var i = 0; i < poiArr.length; i++) {
|
|
|
|
|
+ outputRes["wxMarkerData"][i] = {
|
|
|
|
|
+ id: i,
|
|
|
|
|
+ latitude: poiArr[i]["location"]["lat"],
|
|
|
|
|
+ longitude: poiArr[i]["location"]["lng"],
|
|
|
|
|
+ title: poiArr[i]["name"],
|
|
|
|
|
+ iconPath: otherparam["iconPath"],
|
|
|
|
|
+ iconTapPath: otherparam["iconTapPath"],
|
|
|
|
|
+ address: poiArr[i]["address"],
|
|
|
|
|
+ telephone: poiArr[i]["telephone"],
|
|
|
|
|
+ alpha: otherparam["alpha"],
|
|
|
|
|
+ width: otherparam["width"],
|
|
|
|
|
+ height: otherparam["height"]
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ otherparam.success(outputRes);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ otherparam.fail({
|
|
|
|
|
+ errMsg: res["message"],
|
|
|
|
|
+ statusCode: res["status"]
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: function fail(data) {
|
|
|
|
|
+ otherparam.fail(data);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ var locationfail = function locationfail(result) {
|
|
|
|
|
+ otherparam.fail(result);
|
|
|
|
|
+ };
|
|
|
|
|
+ var locationcomplete = function locationcomplete(result) {};
|
|
|
|
|
+ if (!param["location"]) {
|
|
|
|
|
+ that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
|
|
|
} else {
|
|
} else {
|
|
|
- bitOut.write(table.indexOf(s), bitLength);
|
|
|
|
|
- if (table.size() < 0xfff) {
|
|
|
|
|
- if (table.size() == 1 << bitLength) {
|
|
|
|
|
- bitLength += 1;
|
|
|
|
|
|
|
+ var longitude = param.location.split(',')[1];
|
|
|
|
|
+ var latitude = param.location.split(',')[0];
|
|
|
|
|
+ var errMsg = 'input location';
|
|
|
|
|
+ var res = {
|
|
|
|
|
+ errMsg: errMsg,
|
|
|
|
|
+ latitude: latitude,
|
|
|
|
|
+ longitude: longitude
|
|
|
|
|
+ };
|
|
|
|
|
+ locationsuccess(res);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * sug模糊检索
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {Object} param 检索配置
|
|
|
|
|
+ * 参数对象结构可以参考
|
|
|
|
|
+ * http://lbsyun.baidu.com/index.php?title=webapi/place-suggestion-api
|
|
|
|
|
+ */
|
|
|
|
|
+ }, {
|
|
|
|
|
+ key: "suggestion",
|
|
|
|
|
+ value: function suggestion(param) {
|
|
|
|
|
+ var that = this;
|
|
|
|
|
+ param = param || {};
|
|
|
|
|
+ var suggestionparam = {
|
|
|
|
|
+ query: param["query"] || '',
|
|
|
|
|
+ region: param["region"] || '全国',
|
|
|
|
|
+ city_limit: param["city_limit"] || false,
|
|
|
|
|
+ output: param["output"] || 'json',
|
|
|
|
|
+ ak: that.ak,
|
|
|
|
|
+ sn: param["sn"] || '',
|
|
|
|
|
+ timestamp: param["timestamp"] || '',
|
|
|
|
|
+ ret_coordtype: 'gcj02ll'
|
|
|
|
|
+ };
|
|
|
|
|
+ var otherparam = {
|
|
|
|
|
+ success: param["success"] || function () {},
|
|
|
|
|
+ fail: param["fail"] || function () {}
|
|
|
|
|
+ };
|
|
|
|
|
+ wx.request({
|
|
|
|
|
+ url: 'https://api.map.baidu.com/place/v2/suggestion',
|
|
|
|
|
+ data: suggestionparam,
|
|
|
|
|
+ header: {
|
|
|
|
|
+ "content-type": "application/json"
|
|
|
|
|
+ },
|
|
|
|
|
+ method: 'GET',
|
|
|
|
|
+ success: function success(data) {
|
|
|
|
|
+ var res = data["data"];
|
|
|
|
|
+ if (res["status"] === 0) {
|
|
|
|
|
+ otherparam.success(res);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ otherparam.fail({
|
|
|
|
|
+ errMsg: res["message"],
|
|
|
|
|
+ statusCode: res["status"]
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
- table.add(s + c);
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: function fail(data) {
|
|
|
|
|
+ otherparam.fail(data);
|
|
|
}
|
|
}
|
|
|
- s = c;
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * rgc检索(逆地理编码:经纬度->地点描述)
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {Object} param 检索配置
|
|
|
|
|
+ * 参数对象结构可以参考
|
|
|
|
|
+ * https://lbs.baidu.com/index.php?title=webapi/guide/webservice-geocoding-abroad
|
|
|
|
|
+ *
|
|
|
|
|
+ */
|
|
|
|
|
+ }, {
|
|
|
|
|
+ key: "regeocoding",
|
|
|
|
|
+ value: function regeocoding(param) {
|
|
|
|
|
+ var that = this;
|
|
|
|
|
+ param = param || {};
|
|
|
|
|
+ var regeocodingparam = {
|
|
|
|
|
+ coordtype: param["coordtype"] || 'gcj02ll',
|
|
|
|
|
+ ret_coordtype: 'gcj02ll',
|
|
|
|
|
+ radius: param["radius"] || 1000,
|
|
|
|
|
+ ak: that.ak,
|
|
|
|
|
+ sn: param["sn"] || '',
|
|
|
|
|
+ output: param["output"] || 'json',
|
|
|
|
|
+ callback: param["callback"] || function () {},
|
|
|
|
|
+ extensions_poi: param["extensions_poi"] || 1,
|
|
|
|
|
+ extensions_road: param["extensions_road"] || false,
|
|
|
|
|
+ extensions_town: param["extensions_town"] || false,
|
|
|
|
|
+ language: param["language"] || 'zh-CN',
|
|
|
|
|
+ language_auto: param["language_auto"] || 0
|
|
|
|
|
+ };
|
|
|
|
|
+ var otherparam = {
|
|
|
|
|
+ iconPath: param["iconPath"],
|
|
|
|
|
+ iconTapPath: param["iconTapPath"],
|
|
|
|
|
+ width: param["width"],
|
|
|
|
|
+ height: param["height"],
|
|
|
|
|
+ alpha: param["alpha"] || 1,
|
|
|
|
|
+ success: param["success"] || function () {},
|
|
|
|
|
+ fail: param["fail"] || function () {}
|
|
|
|
|
+ };
|
|
|
|
|
+ var type = 'gcj02';
|
|
|
|
|
+ var locationsuccess = function locationsuccess(result) {
|
|
|
|
|
+ regeocodingparam["location"] = result["latitude"] + ',' + result["longitude"];
|
|
|
|
|
+ wx.request({
|
|
|
|
|
+ url: 'https://api.map.baidu.com/reverse_geocoding/v3',
|
|
|
|
|
+ data: regeocodingparam,
|
|
|
|
|
+ header: {
|
|
|
|
|
+ "content-type": "application/json"
|
|
|
|
|
+ },
|
|
|
|
|
+ method: 'GET',
|
|
|
|
|
+ success: function success(data) {
|
|
|
|
|
+ var res = data["data"];
|
|
|
|
|
+ if (res["status"] === 0) {
|
|
|
|
|
+ var poiObj = res["result"];
|
|
|
|
|
+ // outputRes 包含两个对象:
|
|
|
|
|
+ // originalData为百度接口返回的原始数据
|
|
|
|
|
+ // wxMarkerData为小程序规范的marker格式
|
|
|
|
|
+ var outputRes = {};
|
|
|
|
|
+ outputRes["originalData"] = res;
|
|
|
|
|
+ outputRes["wxMarkerData"] = [];
|
|
|
|
|
+ outputRes["wxMarkerData"][0] = {
|
|
|
|
|
+ id: 0,
|
|
|
|
|
+ latitude: result["latitude"],
|
|
|
|
|
+ longitude: result["longitude"],
|
|
|
|
|
+ address: poiObj["formatted_address"],
|
|
|
|
|
+ iconPath: otherparam["iconPath"],
|
|
|
|
|
+ iconTapPath: otherparam["iconTapPath"],
|
|
|
|
|
+ desc: poiObj["sematic_description"],
|
|
|
|
|
+ business: poiObj["business"],
|
|
|
|
|
+ alpha: otherparam["alpha"],
|
|
|
|
|
+ width: otherparam["width"],
|
|
|
|
|
+ height: otherparam["height"]
|
|
|
|
|
+ };
|
|
|
|
|
+ otherparam.success(outputRes);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ otherparam.fail({
|
|
|
|
|
+ errMsg: res["message"],
|
|
|
|
|
+ statusCode: res["status"]
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: function fail(data) {
|
|
|
|
|
+ otherparam.fail(data);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ var locationfail = function locationfail(result) {
|
|
|
|
|
+ otherparam.fail(result);
|
|
|
|
|
+ };
|
|
|
|
|
+ var locationcomplete = function locationcomplete(result) {};
|
|
|
|
|
+ if (!param["location"]) {
|
|
|
|
|
+ that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ var longitude = param.location.split(',')[1];
|
|
|
|
|
+ var latitude = param.location.split(',')[0];
|
|
|
|
|
+ var errMsg = 'input location';
|
|
|
|
|
+ var res = {
|
|
|
|
|
+ errMsg: errMsg,
|
|
|
|
|
+ latitude: latitude,
|
|
|
|
|
+ longitude: longitude
|
|
|
|
|
+ };
|
|
|
|
|
+ locationsuccess(res);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- bitOut.write(table.indexOf(s), bitLength);
|
|
|
|
|
|
|
|
|
|
- // end code
|
|
|
|
|
- bitOut.write(endCode, bitLength);
|
|
|
|
|
- bitOut.flush();
|
|
|
|
|
- return byteOut.toByteArray();
|
|
|
|
|
- };
|
|
|
|
|
- var lzwTable = function lzwTable() {
|
|
|
|
|
- var _map = {};
|
|
|
|
|
- var _size = 0;
|
|
|
|
|
- var _this = {};
|
|
|
|
|
- _this.add = function (key) {
|
|
|
|
|
- if (_this.contains(key)) {
|
|
|
|
|
- throw new Error('dup key:' + key);
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * gc检索(地理编码:地点->经纬度)
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {Object} param 检索配置
|
|
|
|
|
+ * 参数对象结构可以参考
|
|
|
|
|
+ * https://lbs.baidu.com/index.php?title=webapi/guide/webservice-geocoding
|
|
|
|
|
+ *
|
|
|
|
|
+ */
|
|
|
|
|
+ }, {
|
|
|
|
|
+ key: "geocoding",
|
|
|
|
|
+ value: function geocoding(param) {
|
|
|
|
|
+ var that = this;
|
|
|
|
|
+ param = param || {};
|
|
|
|
|
+ var geocodingparam = {
|
|
|
|
|
+ address: param["address"] || '',
|
|
|
|
|
+ city: param["city"] || '',
|
|
|
|
|
+ ret_coordtype: param["coordtype"] || 'gcj02ll',
|
|
|
|
|
+ ak: that.ak,
|
|
|
|
|
+ sn: param["sn"] || '',
|
|
|
|
|
+ output: param["output"] || 'json',
|
|
|
|
|
+ callback: param["callback"] || function () {}
|
|
|
|
|
+ };
|
|
|
|
|
+ var otherparam = {
|
|
|
|
|
+ iconPath: param["iconPath"],
|
|
|
|
|
+ iconTapPath: param["iconTapPath"],
|
|
|
|
|
+ width: param["width"],
|
|
|
|
|
+ height: param["height"],
|
|
|
|
|
+ alpha: param["alpha"] || 1,
|
|
|
|
|
+ success: param["success"] || function () {},
|
|
|
|
|
+ fail: param["fail"] || function () {}
|
|
|
|
|
+ };
|
|
|
|
|
+ if (param["address"]) {
|
|
|
|
|
+ wx.request({
|
|
|
|
|
+ url: 'https://api.map.baidu.com/geocoding/v3',
|
|
|
|
|
+ data: geocodingparam,
|
|
|
|
|
+ header: {
|
|
|
|
|
+ "content-type": "application/json"
|
|
|
|
|
+ },
|
|
|
|
|
+ method: 'GET',
|
|
|
|
|
+ success: function success(data) {
|
|
|
|
|
+ var res = data["data"];
|
|
|
|
|
+ if (res["status"] === 0) {
|
|
|
|
|
+ var poiObj = res["result"];
|
|
|
|
|
+ // outputRes 包含两个对象:
|
|
|
|
|
+ // originalData为百度接口返回的原始数据
|
|
|
|
|
+ // wxMarkerData为小程序规范的marker格式
|
|
|
|
|
+ var outputRes = res;
|
|
|
|
|
+ outputRes["originalData"] = res;
|
|
|
|
|
+ outputRes["wxMarkerData"] = [];
|
|
|
|
|
+ outputRes["wxMarkerData"][0] = {
|
|
|
|
|
+ id: 0,
|
|
|
|
|
+ latitude: poiObj["location"]["lat"],
|
|
|
|
|
+ longitude: poiObj["location"]["lng"],
|
|
|
|
|
+ iconPath: otherparam["iconPath"],
|
|
|
|
|
+ iconTapPath: otherparam["iconTapPath"],
|
|
|
|
|
+ alpha: otherparam["alpha"],
|
|
|
|
|
+ width: otherparam["width"],
|
|
|
|
|
+ height: otherparam["height"]
|
|
|
|
|
+ };
|
|
|
|
|
+ otherparam.success(outputRes);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ otherparam.fail({
|
|
|
|
|
+ errMsg: res["message"],
|
|
|
|
|
+ statusCode: res["status"]
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: function fail(data) {
|
|
|
|
|
+ otherparam.fail(data);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ var errMsg = 'input address!';
|
|
|
|
|
+ var res = {
|
|
|
|
|
+ errMsg: errMsg
|
|
|
|
|
+ };
|
|
|
|
|
+ otherparam.fail(res);
|
|
|
}
|
|
}
|
|
|
- _map[key] = _size;
|
|
|
|
|
- _size += 1;
|
|
|
|
|
- };
|
|
|
|
|
- _this.size = function () {
|
|
|
|
|
- return _size;
|
|
|
|
|
- };
|
|
|
|
|
- _this.indexOf = function (key) {
|
|
|
|
|
- return _map[key];
|
|
|
|
|
- };
|
|
|
|
|
- _this.contains = function (key) {
|
|
|
|
|
- return typeof _map[key] != 'undefined';
|
|
|
|
|
- };
|
|
|
|
|
- return _this;
|
|
|
|
|
- };
|
|
|
|
|
- return _this;
|
|
|
|
|
-};
|
|
|
|
|
-var createImgTag = function createImgTag(width, height, getPixel, alt) {
|
|
|
|
|
- var gif = gifImage(width, height);
|
|
|
|
|
- for (var y = 0; y < height; y += 1) {
|
|
|
|
|
- for (var x = 0; x < width; x += 1) {
|
|
|
|
|
- gif.setPixel(x, y, getPixel(x, y));
|
|
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- var b = byteArrayOutputStream();
|
|
|
|
|
- gif.write(b);
|
|
|
|
|
- var base64 = base64EncodeOutputStream();
|
|
|
|
|
- var bytes = b.toByteArray();
|
|
|
|
|
- for (var i = 0; i < bytes.length; i += 1) {
|
|
|
|
|
- base64.writeByte(bytes[i]);
|
|
|
|
|
- }
|
|
|
|
|
- base64.flush();
|
|
|
|
|
- var img = '';
|
|
|
|
|
- img += 'data:image/gif;base64,';
|
|
|
|
|
- img += base64;
|
|
|
|
|
- return img;
|
|
|
|
|
-};
|
|
|
|
|
|
|
|
|
|
-//---------------------------------------------------------------------
|
|
|
|
|
-// returns qrcode function.
|
|
|
|
|
-
|
|
|
|
|
-var createQrCodeImg = function createQrCodeImg(text, options) {
|
|
|
|
|
- options = options || {};
|
|
|
|
|
- var typeNumber = options.typeNumber || 4;
|
|
|
|
|
- var errorCorrectLevel = options.errorCorrectLevel || 'M';
|
|
|
|
|
- var size = options.size || 500;
|
|
|
|
|
- var qr;
|
|
|
|
|
- try {
|
|
|
|
|
- qr = qrcode(typeNumber, errorCorrectLevel || 'M');
|
|
|
|
|
- qr.addData(text);
|
|
|
|
|
- qr.make();
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- if (typeNumber >= 40) {
|
|
|
|
|
- throw new Error('Text too long to encode');
|
|
|
|
|
- } else {
|
|
|
|
|
- return createQrCodeImg(text, {
|
|
|
|
|
- size: size,
|
|
|
|
|
- errorCorrectLevel: errorCorrectLevel,
|
|
|
|
|
- typeNumber: typeNumber + 1
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 天气检索
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {Object} param 检索配置
|
|
|
|
|
+ */
|
|
|
|
|
+ }, {
|
|
|
|
|
+ key: "weather",
|
|
|
|
|
+ value: function weather(param) {
|
|
|
|
|
+ var that = this;
|
|
|
|
|
+ param = param || {};
|
|
|
|
|
+ var weatherparam = {
|
|
|
|
|
+ coord_type: param["coord_type"] || 'gcj02',
|
|
|
|
|
+ output: param["output"] || 'json',
|
|
|
|
|
+ ak: that.ak,
|
|
|
|
|
+ sn: param["sn"] || '',
|
|
|
|
|
+ timestamp: param["timestamp"] || ''
|
|
|
|
|
+ };
|
|
|
|
|
+ var otherparam = {
|
|
|
|
|
+ success: param["success"] || function () {},
|
|
|
|
|
+ fail: param["fail"] || function () {}
|
|
|
|
|
+ };
|
|
|
|
|
+ var type = 'gcj02';
|
|
|
|
|
+ var locationsuccess = function locationsuccess(result) {
|
|
|
|
|
+ weatherparam["location"] = result["longitude"] + ',' + result["latitude"];
|
|
|
|
|
+ wx.request({
|
|
|
|
|
+ url: 'https://api.map.baidu.com/telematics/v3/weather',
|
|
|
|
|
+ data: weatherparam,
|
|
|
|
|
+ header: {
|
|
|
|
|
+ "content-type": "application/json"
|
|
|
|
|
+ },
|
|
|
|
|
+ method: 'GET',
|
|
|
|
|
+ success: function success(data) {
|
|
|
|
|
+ var res = data["data"];
|
|
|
|
|
+ if (res["error"] === 0 && res["status"] === 'success') {
|
|
|
|
|
+ var weatherArr = res["results"];
|
|
|
|
|
+ // outputRes 包含两个对象,
|
|
|
|
|
+ // originalData为百度接口返回的原始数据
|
|
|
|
|
+ // wxMarkerData为小程序规范的marker格式
|
|
|
|
|
+ var outputRes = {};
|
|
|
|
|
+ outputRes["originalData"] = res;
|
|
|
|
|
+ outputRes["currentWeather"] = [];
|
|
|
|
|
+ outputRes["currentWeather"][0] = {
|
|
|
|
|
+ currentCity: weatherArr[0]["currentCity"],
|
|
|
|
|
+ pm25: weatherArr[0]["pm25"],
|
|
|
|
|
+ date: weatherArr[0]["weather_data"][0]["date"],
|
|
|
|
|
+ temperature: weatherArr[0]["weather_data"][0]["temperature"],
|
|
|
|
|
+ weatherDesc: weatherArr[0]["weather_data"][0]["weather"],
|
|
|
|
|
+ wind: weatherArr[0]["weather_data"][0]["wind"]
|
|
|
|
|
+ };
|
|
|
|
|
+ otherparam.success(outputRes);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ otherparam.fail({
|
|
|
|
|
+ errMsg: res["message"],
|
|
|
|
|
+ statusCode: res["status"]
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: function fail(data) {
|
|
|
|
|
+ otherparam.fail(data);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ var locationfail = function locationfail(result) {
|
|
|
|
|
+ otherparam.fail(result);
|
|
|
|
|
+ };
|
|
|
|
|
+ var locationcomplete = function locationcomplete(result) {};
|
|
|
|
|
+ if (!param["location"]) {
|
|
|
|
|
+ that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ var longitude = param.location.split(',')[0];
|
|
|
|
|
+ var latitude = param.location.split(',')[1];
|
|
|
|
|
+ var errMsg = 'input location';
|
|
|
|
|
+ var res = {
|
|
|
|
|
+ errMsg: errMsg,
|
|
|
|
|
+ latitude: latitude,
|
|
|
|
|
+ longitude: longitude
|
|
|
|
|
+ };
|
|
|
|
|
+ locationsuccess(res);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // calc cellsize and margin
|
|
|
|
|
- var cellsize = parseInt(size / qr.getModuleCount());
|
|
|
|
|
- var margin = parseInt((size - qr.getModuleCount() * cellsize) / 2);
|
|
|
|
|
- return qr.createImgTag(cellsize, margin, size);
|
|
|
|
|
-};
|
|
|
|
|
-module.exports = {
|
|
|
|
|
- create: createQrCodeImg
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ }]);
|
|
|
|
|
+ return BMapWX;
|
|
|
|
|
+}();
|
|
|
|
|
+module.exports.BMapWX = BMapWX;
|
|
|
|
|
+/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/wx.js */ 1)["default"]))
|
|
|
|
|
|
|
|
/***/ }),
|
|
/***/ }),
|
|
|
|
|
|