From 77954561b159e171e7d858146a2e9e56006a9ddf Mon Sep 17 00:00:00 2001 From: JinxChen <2183691628@qq.com> Date: Tue, 10 May 2022 11:09:27 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feature=20-=20=E5=A2=9E=E5=8A=A0=20?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E9=AB=98=E5=BE=B7demo=20=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E7=82=B9=E6=98=AF=E5=90=A6=E5=9C=A8=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=A4=9A=E8=BE=B9=E5=BD=A2=E5=9B=B4=E6=A0=8F=E5=86=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +- src/config/models.js | 4 +- src/router/index.js | 5 +- src/views/gaode-demo/PointInRing.vue | 134 +++++++++++++++++++++++++++ 4 files changed, 148 insertions(+), 5 deletions(-) create mode 100644 src/views/gaode-demo/PointInRing.vue diff --git a/README.md b/README.md index a9b61fe..028bc25 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ @@ -91,4 +91,10 @@ feature ### v1.0.3 `2022.05.09` feature -- 增加 支付宝花呗支付页面 \ No newline at end of file +- 增加 支付宝花呗支付页面 + +### v1.0.4 +`2022.05.10` +feature +- 增加 一个高德demo 判断一个点是否在一个多边形围栏内 +- 增加 引入高德地图api \ No newline at end of file diff --git a/src/config/models.js b/src/config/models.js index 9b7042a..a7e5572 100644 --- a/src/config/models.js +++ b/src/config/models.js @@ -1,11 +1,11 @@ /* * @Date: 2021-11-20 10:26:39 * @LastEditors: JinxChen - * @LastEditTime: 2022-05-09 11:30:58 + * @LastEditTime: 2022-05-10 11:07:57 * @FilePath: \AntpayFrontEnd\src\config\models.js * @description: */ -export const VERSION_MODEL = '1.0.3'; //版本号 +export const VERSION_MODEL = '1.0.4'; //版本号 export const IMAGE_URL = { production: 'http://zfb.ssjlai.com/web/', test: 'http://zfb.ssjlai.com/web/', diff --git a/src/router/index.js b/src/router/index.js index f352ce6..7acadff 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,7 +1,7 @@ /* * @Date: 2022-01-19 10:08:26 * @LastEditors: JinxChen - * @LastEditTime: 2022-04-13 11:15:53 + * @LastEditTime: 2022-05-09 14:24:03 * @FilePath: \AntpayFrontEnd\src\router\index.js * @description: */ @@ -33,6 +33,9 @@ const routes = [ // 分销商模式- 信息录入 { path: '/form-dealers', name: 'form-dealers', component: resolve => require(['@/views/alipay-dealers/AlipayFormDealers'], resolve) }, + // 高德地图测试demo + { path: '/gaode-point-in-ring', name: 'gaode-point-in-ring', component: resolve => require(['@/views/gaode-demo/PointInRing'], resolve) }, + ]; diff --git a/src/views/gaode-demo/PointInRing.vue b/src/views/gaode-demo/PointInRing.vue new file mode 100644 index 0000000..5e1b467 --- /dev/null +++ b/src/views/gaode-demo/PointInRing.vue @@ -0,0 +1,134 @@ + + + + + From b2ba317a10f0ee0dbb461b62991b3e004a0fb4aa Mon Sep 17 00:00:00 2001 From: JinxChen <2183691628@qq.com> Date: Tue, 10 May 2022 11:09:56 +0800 Subject: [PATCH 2/2] =?UTF-8?q?-=20=E5=A2=9E=E5=8A=A0=20=E5=BC=95=E5=85=A5?= =?UTF-8?q?=E9=AB=98=E5=BE=B7=E5=9C=B0=E5=9B=BEapi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.js | 62 ++++++++++++++++++++-------------------- src/config/map/index.js | 49 +++++++++++++++++++++++++++++++ src/config/map/models.js | 13 +++++++++ vue.config.js | 7 ++++- 4 files changed, 99 insertions(+), 32 deletions(-) create mode 100644 src/config/map/index.js create mode 100644 src/config/map/models.js diff --git a/.eslintrc.js b/.eslintrc.js index 715be84..9e4e46d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,33 +1,33 @@ -/* - * @Date: 2022-01-19 10:08:26 - * @LastEditors: JinxChen - * @LastEditTime: 2022-01-19 10:29:11 - * @FilePath: \alipay-scan-code-front-end\.eslintrc.js - * @description: - */ module.exports = { - root: true, - env: { - node: true, - }, - extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"], - parserOptions: { - parser: "babel-eslint", - }, - rules: { - "no-console": process.env.NODE_ENV === "production" ? "off" : "off", - "no-debugger": process.env.NODE_ENV === "production" ? "off" : "off", - "prettier/prettier": "off", //关闭 prettier 验证 - }, - overrides: [ - { - files: [ - "**/__tests__/*.{j,t}s?(x)", - "**/tests/unit/**/*.spec.{j,t}s?(x)", - ], - env: { - jest: true, - }, + root: true, + env: { + node: true, + }, + extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"], + parserOptions: { + parser: "babel-eslint", + }, + rules: { + "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", + "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", + //关闭prettier + "prettier/prettier": "off", + // 关闭eslint语法检测 + "no-unused-vars":0, }, - ], -}; + globals: { + "AMap": "true", + "AMapUI": "true", + }, + overrides: [ + { + files: [ + "**/__tests__/*.{j,t}s?(x)", + "**/tests/unit/**/*.spec.{j,t}s?(x)", + ], + env: { + jest: true, + }, + }, + ], + }; diff --git a/src/config/map/index.js b/src/config/map/index.js new file mode 100644 index 0000000..3ebca2c --- /dev/null +++ b/src/config/map/index.js @@ -0,0 +1,49 @@ +/* + * @Date: 2022-01-14 09:15:21 + * @LastEditors: JinxChen + * @LastEditTime: 2022-05-10 10:24:06 + * @FilePath: \AntpayFrontEnd\src\config\map\index.js + * @description: + */ +import { AMapKey, AMapJsCode } from './models'; + +/** + * @param isSync 异步加载 + * @param plugins 字符串数组格式 [ 'AMap.Geocoder', ... ] + * @returns {Promise} + * @constructor + */ +export default function MapLoader(isSync = false, plugins = []) { + return new Promise((resolve, reject) => { + try { + if (window.AMap && (plugins === null || plugins === undefined || plugins.length === 0)) { + resolve(window.AMap) + } else { + let script = document.createElement('script'); + script.type = 'text/javascript'; + script.async = !isSync; + script.src = `https://webapi.amap.com/maps?v=1.4.15&callback=initAMap&key=${AMapKey}&plugin=AMap.BezierCurveEditor${plugins ? ',' + plugins.join(',') : ''}`; + script.onerror = reject; + document.head.appendChild(script); + + let script1 = document.createElement('script'); + script1.type = 'text/javascript'; + script1.async = false; + script1.src = 'https://webapi.amap.com/ui/1.0/main.js?v=1.0.11'; + script1.onerror = reject; + if (isSync) { + document.head.appendChild(script1); + } + } + window.initAMap = () => resolve(window.AMap); + + // JSAPI key搭配静态安全密钥以明文设置, 详情见: https://lbs.amap.com/api/jsapi-v2/guide/abc/load + window._AMapSecurityConfig = { + securityJsCode: `${AMapJsCode}`, + } + } catch (e) { + console.log(e); + } + + }) +} \ No newline at end of file diff --git a/src/config/map/models.js b/src/config/map/models.js new file mode 100644 index 0000000..2af5555 --- /dev/null +++ b/src/config/map/models.js @@ -0,0 +1,13 @@ +/* + * @Date: 2021-04-12 16:29:30 + * @LastEditors: JinxChen + * @LastEditTime: 2022-05-09 14:16:46 + * @FilePath: \AntpayFrontEnd\src\config\map\models.js + * @description: + */ +// 高德key +export const AMapKey = /* 'f7bc7e76645d2e84aa6bc62fdc5498a0' */ '6e4a6c39ea6d18b8dd3151baa3a7c0d5'; + + +//高德jscode +export const AMapJsCode = '6a421e1233cd12dd4899e373e11bb641'; \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index 0fffe71..548a1f9 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,7 +1,7 @@ /* * @Author: your name * @Date: 2020-04-15 10:00:32 - * @LastEditTime: 2022-04-08 15:01:09 + * @LastEditTime: 2022-05-10 09:59:17 * @LastEditors: JinxChen * @Description: In User Settings Edit * @FilePath: \AntpayFrontEnd\vue.config.js @@ -41,6 +41,11 @@ module.exports = { // Enable CSS modules for all css / pre-processor files. // This option does not affect *.vue files. requireModuleExtension: true }, + configureWebpack: { + externals: { + 'AMap': 'AMap' + } + }, chainWebpack: config => { // 该配置用来配置打包生成的文件是否带hash值后缀,该值默认为true, // 在模式为production的时候,打包出的js和css文件会自动添加hash值后缀。