├── OneSideProgram
├── .eslintignore
├── config
│ ├── prod.env.js
│ ├── dev.env.js
│ └── index.js
├── static
│ ├── images
│ │ ├── add.png
│ │ ├── job.png
│ │ ├── my.png
│ │ ├── logo.png
│ │ └── location.png
│ └── libs
│ │ └── qqmap-wx-jssdk.js
├── src
│ ├── pages
│ │ ├── my
│ │ │ ├── main.js
│ │ │ └── index.vue
│ │ ├── search
│ │ │ ├── main.js
│ │ │ └── index.vue
│ │ ├── add
│ │ │ ├── main.js
│ │ │ └── index.vue
│ │ └── index
│ │ │ ├── main.js
│ │ │ └── index.vue
│ ├── api
│ │ └── index.js
│ ├── components
│ │ └── card.vue
│ ├── app.json
│ ├── store
│ │ ├── modules
│ │ │ └── index.js
│ │ └── index.js
│ ├── main.js
│ ├── utils
│ │ ├── request.js
│ │ └── index.js
│ └── App.vue
├── .postcssrc.js
├── .editorconfig
├── project.swan.json
├── package.swan.json
├── .gitignore
├── index.html
├── build
│ ├── dev-client.js
│ ├── vue-loader.conf.js
│ ├── build.js
│ ├── check-versions.js
│ ├── webpack.dev.conf.js
│ ├── utils.js
│ ├── dev-server.js
│ ├── webpack.prod.conf.js
│ └── webpack.base.conf.js
├── .babelrc
├── README.md
├── .eslintrc.js
├── project.config.json
└── package.json
├── README.md
└── .gitignore
/OneSideProgram/.eslintignore:
--------------------------------------------------------------------------------
1 | build/*.js
2 | config/*.js
3 |
--------------------------------------------------------------------------------
/OneSideProgram/config/prod.env.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | NODE_ENV: '"production"'
3 | }
4 |
--------------------------------------------------------------------------------
/OneSideProgram/static/images/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/guhuilin/MiniProgram/HEAD/OneSideProgram/static/images/add.png
--------------------------------------------------------------------------------
/OneSideProgram/static/images/job.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/guhuilin/MiniProgram/HEAD/OneSideProgram/static/images/job.png
--------------------------------------------------------------------------------
/OneSideProgram/static/images/my.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/guhuilin/MiniProgram/HEAD/OneSideProgram/static/images/my.png
--------------------------------------------------------------------------------
/OneSideProgram/static/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/guhuilin/MiniProgram/HEAD/OneSideProgram/static/images/logo.png
--------------------------------------------------------------------------------
/OneSideProgram/static/images/location.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/guhuilin/MiniProgram/HEAD/OneSideProgram/static/images/location.png
--------------------------------------------------------------------------------
/OneSideProgram/src/pages/my/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './index'
3 |
4 |
5 | const app = new Vue(App)
6 | app.$mount()
7 |
--------------------------------------------------------------------------------
/OneSideProgram/src/pages/search/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './index'
3 |
4 | const app = new Vue(App)
5 | app.$mount()
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 微信小程序MiniProgram
2 | >> 旨在熟悉小程序的操作以及一些方法的使用
3 | > - 框架构建以mpvue+elementUI做的
4 | > - map地图的使用,定位,导航,测算距离
5 | > - vuex + localStorage管理数据
6 | > - 走了一遍审核, 发布, 上线的流程
7 |
--------------------------------------------------------------------------------
/OneSideProgram/.postcssrc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | "plugins": {
5 | "postcss-mpvue-wxss": {}
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/OneSideProgram/config/dev.env.js:
--------------------------------------------------------------------------------
1 | var merge = require('webpack-merge')
2 | var prodEnv = require('./prod.env')
3 |
4 | module.exports = merge(prodEnv, {
5 | NODE_ENV: '"development"'
6 | })
7 |
--------------------------------------------------------------------------------
/OneSideProgram/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/OneSideProgram/src/api/index.js:
--------------------------------------------------------------------------------
1 | import request from '@/utils/request';
2 |
3 | // 登陆接口
4 | export let login = code=>{
5 | return request.post('http://169.254.12.68:7001/user/code2session', {
6 | code
7 | })
8 | }
9 |
--------------------------------------------------------------------------------
/OneSideProgram/project.swan.json:
--------------------------------------------------------------------------------
1 | {
2 | "appid": "testappid",
3 | "setting": {
4 | "urlCheck": false
5 | },
6 | "condition": {
7 | "swan": {
8 | "current": -1,
9 | "list": []
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/OneSideProgram/package.swan.json:
--------------------------------------------------------------------------------
1 | {
2 | "appid": "wx3375420e2c184d34",
3 | "setting": {
4 | "urlCheck": false
5 | },
6 | "condition": {
7 | "swan": {
8 | "current": -1,
9 | "list": []
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/OneSideProgram/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | dist/
4 | server/
5 | npm-debug.log*
6 | yarn-debug.log*
7 | yarn-error.log*
8 |
9 | # Editor directories and files
10 | .idea
11 | *.suo
12 | *.ntvs*
13 | *.njsproj
14 | *.sln
15 |
--------------------------------------------------------------------------------
/OneSideProgram/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | sign
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/OneSideProgram/src/components/card.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
14 |
15 |
20 |
--------------------------------------------------------------------------------
/OneSideProgram/src/pages/add/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './index'
3 |
4 | // add this to handle exception
5 | Vue.config.errorHandler = function (err) {
6 | if (console && console.error) {
7 | console.error(err)
8 | }
9 | }
10 |
11 | const app = new Vue(App)
12 | app.$mount()
13 |
--------------------------------------------------------------------------------
/OneSideProgram/build/dev-client.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | require('eventsource-polyfill')
3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
4 |
5 | hotClient.subscribe(function (event) {
6 | if (event.action === 'reload') {
7 | window.location.reload()
8 | }
9 | })
10 |
--------------------------------------------------------------------------------
/OneSideProgram/src/pages/index/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './index'
3 |
4 | // add this to handle exception
5 | Vue.config.errorHandler = function (err) {
6 | if (console && console.error) {
7 | console.error(err)
8 | }
9 | }
10 |
11 | const app = new Vue(App)
12 | app.$mount()
13 |
--------------------------------------------------------------------------------
/OneSideProgram/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["env", {
4 | "modules": false,
5 | "targets": {
6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7 | }
8 | }],
9 | "stage-2"
10 | ],
11 | "plugins": ["transform-runtime"],
12 | "env": {
13 | "test": {
14 | "presets": ["env", "stage-2"],
15 | "plugins": ["istanbul"]
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/OneSideProgram/src/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/main",
4 | "pages/search/main",
5 | "pages/my/main",
6 | "pages/add/main"
7 | ],
8 | "permission": {
9 | "scope.userLocation": {
10 | "desc": "你的位置信息将用于小程序地图定位"
11 | }
12 | },
13 | "window": {
14 | "backgroundTextStyle": "light",
15 | "navigationBarBackgroundColor": "#fff",
16 | "navigationBarTitleText": "一面而就",
17 | "navigationBarTextStyle": "black"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/OneSideProgram/src/store/modules/index.js:
--------------------------------------------------------------------------------
1 | const state = {
2 | count: 1
3 | };
4 |
5 | const getters = {
6 |
7 | };
8 |
9 | // 同步改变
10 | const mutations = {
11 | changeCount(state, payload){
12 | console.log('state...', state, payload);
13 | payload === '+'?state.count++: state.count--;
14 | }
15 | };
16 |
17 | // 异步改变
18 | const actions = {
19 |
20 | };
21 |
22 | export default {
23 | // 命名空间
24 | namespaced: true,
25 | state,
26 | getters,
27 | mutations,
28 | actions
29 | }
30 |
--------------------------------------------------------------------------------
/OneSideProgram/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App'
3 | // 引入store
4 | import store from '@/store/index'
5 | // 引入QQMap
6 | import QQMapWx from '../static/libs/qqmap-wx-jssdk.js'
7 |
8 | Vue.config.productionTip = false
9 | App.mpType = 'app'
10 |
11 | // 挂载store到原型链上
12 | Vue.prototype.$store = store;
13 | // 挂载QQMap到原型上
14 | var $map = new QQMapWx({
15 | key: 'X7RBZ-MMOKR-UQEWJ-WSCXC-IVXVK-IFFLL'
16 | })
17 | Vue.prototype.$map = $map;
18 |
19 | const app = new Vue(App)
20 | app.$mount()
21 |
--------------------------------------------------------------------------------
/OneSideProgram/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import Vuex from 'vuex';
3 | import createLogger from 'vuex/dist/logger';
4 |
5 | // 挂载modules
6 | import index from './modules/index'
7 |
8 | Vue.use(Vuex);
9 |
10 | export default new Vuex.Store({
11 | modules: {
12 | index
13 | },
14 | state: {
15 | info: {} // 用户信息
16 | },
17 | mutations: {
18 | // 更新全局的state
19 | updateState(state, payload){
20 | state.info = payload;
21 | }
22 | },
23 | plugins: [createLogger()]
24 | })
25 |
--------------------------------------------------------------------------------
/OneSideProgram/build/vue-loader.conf.js:
--------------------------------------------------------------------------------
1 | var utils = require('./utils')
2 | var config = require('../config')
3 | // var isProduction = process.env.NODE_ENV === 'production'
4 | // for mp
5 | var isProduction = true
6 |
7 | module.exports = {
8 | loaders: utils.cssLoaders({
9 | sourceMap: isProduction
10 | ? config.build.productionSourceMap
11 | : config.dev.cssSourceMap,
12 | extract: isProduction
13 | }),
14 | transformToRequire: {
15 | video: 'src',
16 | source: 'src',
17 | img: 'src',
18 | image: 'xlink:href'
19 | },
20 | fileExt: config.build.fileExt
21 | }
22 |
--------------------------------------------------------------------------------
/OneSideProgram/README.md:
--------------------------------------------------------------------------------
1 | # sign
2 |
3 | > 面试管理软件
4 |
5 | ## Build Setup
6 |
7 | ``` bash
8 | # 初始化项目
9 | vue init mpvue/mpvue-quickstart myproject
10 | cd myproject
11 |
12 | # 安装依赖
13 | yarn
14 |
15 | # 开发时构建
16 | npm dev
17 |
18 | # 打包构建
19 | npm build
20 |
21 | # 指定平台的开发时构建(微信、百度、头条、支付宝)
22 | npm dev:wx
23 | npm dev:swan
24 | npm dev:tt
25 | npm dev:my
26 |
27 | # 指定平台的打包构建
28 | npm build:wx
29 | npm build:swan
30 | npm build:tt
31 | npm build:my
32 |
33 | # 生成 bundle 分析报告
34 | npm run build --report
35 | ```
36 |
37 | For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
38 |
--------------------------------------------------------------------------------
/OneSideProgram/.eslintrc.js:
--------------------------------------------------------------------------------
1 | // http://eslint.org/docs/user-guide/configuring
2 |
3 | module.exports = {
4 | root: true,
5 | parser: 'babel-eslint',
6 | parserOptions: {
7 | sourceType: 'module'
8 | },
9 | env: {
10 | browser: false,
11 | node: true,
12 | es6: true
13 | },
14 | // https://github.com/standard/standard/blob/master/docs/RULES-en.md
15 | extends: 'standard',
16 | // required to lint *.vue files
17 | plugins: [
18 | 'html'
19 | ],
20 | // add your custom rules here
21 | 'rules': {
22 | // allow paren-less arrow functions
23 | 'arrow-parens': 0,
24 | // allow async-await
25 | 'generator-star-spacing': 0,
26 | // allow debugger during development
27 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
28 | },
29 | globals: {
30 | App: true,
31 | Page: true,
32 | wx: true,
33 | swan: true,
34 | tt: true,
35 | my: true,
36 | getApp: true,
37 | getPage: true,
38 | requirePlugin: true,
39 | mpvue: true,
40 | mpvuePlatform: true
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 |
8 | # Runtime data
9 | pids
10 | *.pid
11 | *.seed
12 | *.pid.lock
13 |
14 | # Directory for instrumented libs generated by jscoverage/JSCover
15 | lib-cov
16 |
17 | # Coverage directory used by tools like istanbul
18 | coverage
19 |
20 | # nyc test coverage
21 | .nyc_output
22 |
23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24 | .grunt
25 |
26 | # Bower dependency directory (https://bower.io/)
27 | bower_components
28 |
29 | # node-waf configuration
30 | .lock-wscript
31 |
32 | # Compiled binary addons (https://nodejs.org/api/addons.html)
33 | build/Release
34 |
35 | # Dependency directories
36 | node_modules/
37 | jspm_packages/
38 |
39 | # TypeScript v1 declaration files
40 | typings/
41 |
42 | # Optional npm cache directory
43 | .npm
44 |
45 | # Optional eslint cache
46 | .eslintcache
47 |
48 | # Optional REPL history
49 | .node_repl_history
50 |
51 | # Output of 'npm pack'
52 | *.tgz
53 |
54 | # Yarn Integrity file
55 | .yarn-integrity
56 |
57 | # dotenv environment variables file
58 | .env
59 |
60 | # next.js build output
61 | .next
62 |
--------------------------------------------------------------------------------
/OneSideProgram/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "项目配置文件。",
3 | "setting": {
4 | "urlCheck": false,
5 | "es6": true,
6 | "postcss": true,
7 | "minified": true,
8 | "newFeature": true,
9 | "autoAudits": false
10 | },
11 | "miniprogramRoot": "dist/wx/",
12 | "compileType": "miniprogram",
13 | "appid": "wx6c85dc0083b1569f",
14 | "projectname": "sign",
15 | "condition": {
16 | "search": {
17 | "current": -1,
18 | "list": []
19 | },
20 | "conversation": {
21 | "current": -1,
22 | "list": []
23 | },
24 | "plugin": {
25 | "current": -1,
26 | "list": []
27 | },
28 | "game": {
29 | "currentL": -1,
30 | "list": []
31 | },
32 | "miniprogram": {
33 | "current": 2,
34 | "list": [
35 | {
36 | "id": -1,
37 | "name": "匹配地址",
38 | "pathName": "pages/search/main",
39 | "query": "",
40 | "scene": null
41 | },
42 | {
43 | "id": -1,
44 | "name": "添加面试",
45 | "pathName": "pages/add/main",
46 | "query": "",
47 | "scene": null
48 | },
49 | {
50 | "id": -1,
51 | "name": "我的页面",
52 | "pathName": "pages/my/main",
53 | "scene": null
54 | }
55 | ]
56 | }
57 | }
58 | }
--------------------------------------------------------------------------------
/OneSideProgram/src/utils/request.js:
--------------------------------------------------------------------------------
1 | import Fly from "flyio/dist/npm/wx"
2 |
3 | export let fly = new Fly
4 |
5 | let cookies = {}
6 | const HOST = 'https://127.0.0.1' // 更改
7 | //添加请求拦截器
8 | fly.interceptors.request.use((request) => {
9 | // 把openid放在请求头部
10 | let openid = wx.getStorageSync('openid');
11 | if (openid){
12 | request.headers['openid'] = openid;
13 | }
14 | //给所有请求添加自定义header
15 | // request.headers["Cookie"] = map(cookies, (v, k) => k + '=' + v).join(';')
16 | //打印出请求体
17 | // console.log(request.body)
18 | //终止请求
19 | //var err=new Error("xxx")
20 | //err.request=request
21 | //return Promise.reject(new Error(""))
22 |
23 | //可以显式返回request, 也可以不返回,没有返回值时拦截器中默认返回request
24 | return request;
25 | })
26 |
27 | //添加响应拦截器,响应拦截器会在then/catch处理之前执行
28 | fly.interceptors.response.use(
29 | (response) => {
30 | if (response.request.url.indexOf(HOST) == 0) {
31 | let hcks = response.headers['set-cookie'] || response.headers['Set-Cookie']
32 | if (hcks != null) {
33 | hcks.forEach(v => {
34 | let ck = v.split(';')[0].split('=')
35 | cookies[ck[0]] = ck[1]
36 | })
37 | }
38 | }
39 | //只将请求结果的data字段返回
40 | return response.data
41 | },
42 | (err) => {
43 | //发生网络错误后会走到这里
44 | //return Promise.resolve("ssss")
45 | }
46 | )
47 |
48 | export default fly
49 |
50 |
--------------------------------------------------------------------------------
/OneSideProgram/build/build.js:
--------------------------------------------------------------------------------
1 | require('./check-versions')()
2 |
3 | process.env.NODE_ENV = 'production'
4 | process.env.PLATFORM = process.argv[process.argv.length - 1] || 'wx'
5 |
6 | var ora = require('ora')
7 | var rm = require('rimraf')
8 | var path = require('path')
9 | var chalk = require('chalk')
10 | var webpack = require('webpack')
11 | var config = require('../config')
12 | var webpackConfig = require('./webpack.prod.conf')
13 | var utils = require('./utils')
14 |
15 | var spinner = ora('building for production...')
16 | spinner.start()
17 |
18 | rm(path.join(config.build.assetsRoot, '*'), err => {
19 | if (err) throw err
20 | webpack(webpackConfig, function (err, stats) {
21 | spinner.stop()
22 | if (err) throw err
23 | if (process.env.PLATFORM === 'swan') {
24 | utils.writeFrameworkinfo()
25 | }
26 | process.stdout.write(stats.toString({
27 | colors: true,
28 | modules: false,
29 | children: false,
30 | chunks: false,
31 | chunkModules: false
32 | }) + '\n\n')
33 |
34 | if (stats.hasErrors()) {
35 | console.log(chalk.red(' Build failed with errors.\n'))
36 | process.exit(1)
37 | }
38 |
39 | console.log(chalk.cyan(' Build complete.\n'))
40 | console.log(chalk.yellow(
41 | ' Tip: built files are meant to be served over an HTTP server.\n' +
42 | ' Opening index.html over file:// won\'t work.\n'
43 | ))
44 | })
45 | })
46 |
--------------------------------------------------------------------------------
/OneSideProgram/build/check-versions.js:
--------------------------------------------------------------------------------
1 | var chalk = require('chalk')
2 | var semver = require('semver')
3 | var packageConfig = require('../package.json')
4 | var shell = require('shelljs')
5 | function exec (cmd) {
6 | return require('child_process').execSync(cmd).toString().trim()
7 | }
8 |
9 | var versionRequirements = [
10 | {
11 | name: 'node',
12 | currentVersion: semver.clean(process.version),
13 | versionRequirement: packageConfig.engines.node
14 | }
15 | ]
16 |
17 | if (shell.which('npm')) {
18 | versionRequirements.push({
19 | name: 'npm',
20 | currentVersion: exec('npm --version'),
21 | versionRequirement: packageConfig.engines.npm
22 | })
23 | }
24 |
25 | module.exports = function () {
26 | var warnings = []
27 | for (var i = 0; i < versionRequirements.length; i++) {
28 | var mod = versionRequirements[i]
29 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
30 | warnings.push(mod.name + ': ' +
31 | chalk.red(mod.currentVersion) + ' should be ' +
32 | chalk.green(mod.versionRequirement)
33 | )
34 | }
35 | }
36 |
37 | if (warnings.length) {
38 | console.log('')
39 | console.log(chalk.yellow('To use this template, you must update following to modules:'))
40 | console.log()
41 | for (var i = 0; i < warnings.length; i++) {
42 | var warning = warnings[i]
43 | console.log(' ' + warning)
44 | }
45 | console.log()
46 | process.exit(1)
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/OneSideProgram/src/App.vue:
--------------------------------------------------------------------------------
1 |
34 |
35 |
59 |
--------------------------------------------------------------------------------
/OneSideProgram/src/pages/my/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 | -
9 |
10 |
11 | 我的面试
12 |
13 | 〉
14 |
15 |
16 |
17 |
为了更好的使用我们的服务,我们需要获取你的手机号码
18 |
19 |
20 |
21 |
22 |
23 |
53 |
54 |
88 |
--------------------------------------------------------------------------------
/OneSideProgram/src/utils/index.js:
--------------------------------------------------------------------------------
1 | function formatNumber(n) {
2 | const str = n.toString()
3 | return str[1] ? str : `0${str}`
4 | }
5 |
6 | export function formatTime(date) {
7 | const year = date.getFullYear()
8 | const month = date.getMonth() + 1
9 | const day = date.getDate()
10 |
11 | const hour = date.getHours()
12 | const minute = date.getMinutes()
13 | const second = date.getSeconds()
14 |
15 | const t1 = [year, month, day].map(formatNumber).join('/')
16 | const t2 = [hour, minute, second].map(formatNumber).join(':')
17 |
18 | return `${t1} ${t2}`
19 | }
20 |
21 | // 获取用户定位
22 | export function getLocation() {
23 | return new Promise((resolve, reject) => {
24 | wx.getLocation({
25 | type: 'gcj02',
26 | success(res) {
27 | resolve(res);
28 | }
29 | })
30 | })
31 | }
32 |
33 | /**
34 | * 通用授权逻辑
35 | * @export
36 | * @param {*} scope 权限信息
37 | * @param {*} callback 授权成功回调
38 | */
39 | export function getAuth(scope, callback) {
40 | wx.getSetting({
41 | success: res => {
42 | // 如果已授权
43 | if (res.authSetting[scope]) {
44 | callback();
45 | } else {
46 | wx.authorize({
47 | scope,
48 | success: callback,
49 | fail: () => {
50 | wx.showModal({
51 | title: '亲爱的用户', //提示的标题,
52 | content: '同意我们的授权,让我们为你提供更加优质的服务', //提示的内容,
53 | showCancel: false, //是否显示取消按钮,
54 | confirmText: '去设置', //确定按钮的文字,默认为取消,最多 4 个字符,
55 | confirmColor: '#3CC51F', //确定按钮的文字颜色
56 | success: res => {
57 | wx.openSetting()
58 | }
59 | })
60 | }
61 | })
62 | }
63 | }
64 | })
65 | }
66 |
67 | // 函数去抖
68 | export function debounce(func, delay){
69 | var timer=null;
70 | return function(){
71 | var context=this, args=arguments;
72 | clearTimeout(timer);
73 | timer=setTimeout(function(){
74 | func.apply(context,args);
75 | }, delay);
76 | }
77 | }
78 |
79 | export default {
80 | formatNumber,
81 | formatTime,
82 | getLocation,
83 | getAuth,
84 | debounce
85 | }
86 |
--------------------------------------------------------------------------------
/OneSideProgram/src/pages/search/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 | -
9 |
{{item.title}}
10 | {{item.address}}
11 |
12 |
13 |
14 |
15 |
16 |
62 |
63 |
97 |
--------------------------------------------------------------------------------
/OneSideProgram/config/index.js:
--------------------------------------------------------------------------------
1 | // see http://vuejs-templates.github.io/webpack for documentation.
2 | var path = require('path')
3 | var fileExtConfig = {
4 | swan: {
5 | template: 'swan',
6 | script: 'js',
7 | style: 'css',
8 | platform: 'swan'
9 | },
10 | tt: {
11 | template: 'ttml',
12 | script: 'js',
13 | style: 'ttss',
14 | platform: 'tt'
15 | },
16 | wx: {
17 | template: 'wxml',
18 | script: 'js',
19 | style: 'wxss',
20 | platform: 'wx'
21 | },
22 | my: {
23 | template: 'axml',
24 | script: 'js',
25 | style: 'acss',
26 | platform: 'my'
27 | }
28 | }
29 | var fileExt = fileExtConfig[process.env.PLATFORM]
30 |
31 | module.exports = {
32 | build: {
33 | env: require('./prod.env'),
34 | index: path.resolve(__dirname, `../dist/${fileExt.platform}/index.html`),
35 | assetsRoot: path.resolve(__dirname, `../dist/${fileExt.platform}`),
36 | assetsSubDirectory: '',
37 | assetsPublicPath: '/',
38 | productionSourceMap: false,
39 | // Gzip off by default as many popular static hosts such as
40 | // Surge or Netlify already gzip all static assets for you.
41 | // Before setting to `true`, make sure to:
42 | // npm install --save-dev compression-webpack-plugin
43 | productionGzip: false,
44 | productionGzipExtensions: ['js', 'css'],
45 | // Run the build command with an extra argument to
46 | // View the bundle analyzer report after build finishes:
47 | // `npm run build --report`
48 | // Set to `true` or `false` to always turn it on or off
49 | bundleAnalyzerReport: process.env.npm_config_report,
50 | fileExt: fileExt
51 | },
52 | dev: {
53 | env: require('./dev.env'),
54 | port: 8080,
55 | // 在小程序开发者工具中不需要自动打开浏览器
56 | autoOpenBrowser: false,
57 | assetsSubDirectory: '',
58 | assetsPublicPath: '/',
59 | proxyTable: {},
60 | // CSS Sourcemaps off by default because relative paths are "buggy"
61 | // with this option, according to the CSS-Loader README
62 | // (https://github.com/webpack/css-loader#sourcemaps)
63 | // In our experience, they generally work as expected,
64 | // just be aware of this issue when enabling this option.
65 | cssSourceMap: false,
66 | fileExt: fileExt
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/OneSideProgram/build/webpack.dev.conf.js:
--------------------------------------------------------------------------------
1 | var utils = require('./utils')
2 | var webpack = require('webpack')
3 | var config = require('../config')
4 | var merge = require('webpack-merge')
5 | var baseWebpackConfig = require('./webpack.base.conf')
6 | // var HtmlWebpackPlugin = require('html-webpack-plugin')
7 | var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
8 | var MpvueVendorPlugin = require('webpack-mpvue-vendor-plugin')
9 |
10 | // copy from ./webpack.prod.conf.js
11 | var path = require('path')
12 | var ExtractTextPlugin = require('extract-text-webpack-plugin')
13 | var CopyWebpackPlugin = require('copy-webpack-plugin')
14 | var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
15 |
16 | // add hot-reload related code to entry chunks
17 | // Object.keys(baseWebpackConfig.entry).forEach(function (name) {
18 | // baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
19 | // })
20 |
21 | module.exports = merge(baseWebpackConfig, {
22 | module: {
23 | rules: utils.styleLoaders({
24 | sourceMap: config.dev.cssSourceMap,
25 | extract: true
26 | })
27 | },
28 | // cheap-module-eval-source-map is faster for development
29 | // devtool: '#cheap-module-eval-source-map',
30 | // devtool: '#source-map',
31 | output: {
32 | path: config.build.assetsRoot,
33 | // filename: utils.assetsPath('[name].[chunkhash].js'),
34 | // chunkFilename: utils.assetsPath('[id].[chunkhash].js')
35 | filename: utils.assetsPath('[name].js'),
36 | chunkFilename: utils.assetsPath('[id].js')
37 | },
38 | plugins: [
39 | new webpack.DefinePlugin({
40 | 'process.env': config.dev.env
41 | }),
42 |
43 | // copy from ./webpack.prod.conf.js
44 | // extract css into its own file
45 | new ExtractTextPlugin({
46 | // filename: utils.assetsPath('[name].[contenthash].css')
47 | filename: utils.assetsPath(`[name].${config.dev.fileExt.style}`)
48 | }),
49 | // Compress extracted CSS. We are using this plugin so that possible
50 | // duplicated CSS from different components can be deduped.
51 | new OptimizeCSSPlugin({
52 | cssProcessorOptions: {
53 | safe: true
54 | }
55 | }),
56 | new webpack.optimize.CommonsChunkPlugin({
57 | name: 'common/vendor',
58 | minChunks: function (module, count) {
59 | // any required modules inside node_modules are extracted to vendor
60 | return (
61 | module.resource &&
62 | /\.js$/.test(module.resource) &&
63 | module.resource.indexOf('node_modules') >= 0
64 | ) || count > 1
65 | }
66 | }),
67 | new webpack.optimize.CommonsChunkPlugin({
68 | name: 'common/manifest',
69 | chunks: ['common/vendor']
70 | }),
71 | new MpvueVendorPlugin({
72 | platform: process.env.PLATFORM
73 | }),
74 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage
75 | // new webpack.HotModuleReplacementPlugin(),
76 | new webpack.NoEmitOnErrorsPlugin(),
77 | // https://github.com/ampedandwired/html-webpack-plugin
78 | // new HtmlWebpackPlugin({
79 | // filename: 'index.html',
80 | // template: 'index.html',
81 | // inject: true
82 | // }),
83 | new FriendlyErrorsPlugin()
84 | ]
85 | })
86 |
--------------------------------------------------------------------------------
/OneSideProgram/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "sign",
3 | "version": "1.0.0",
4 | "mpvueTemplateProjectVersion": "0.1.0",
5 | "description": "面试管理软件",
6 | "author": "jason <342690199@qq.com>",
7 | "private": true,
8 | "scripts": {
9 | "dev:wx": "node build/dev-server.js wx",
10 | "start:wx": "npm run dev:wx",
11 | "build:wx": "node build/build.js wx",
12 | "dev:swan": "node build/dev-server.js swan",
13 | "start:swan": "npm run dev:swan",
14 | "build:swan": "node build/build.js swan",
15 | "dev:tt": "node build/dev-server.js tt",
16 | "start:tt": "npm run dev:tt",
17 | "build:tt": "node build/build.js tt",
18 | "dev:my": "node build/dev-server.js my",
19 | "start:my": "npm run dev:my",
20 | "build:my": "node build/build.js my",
21 | "dev": "node build/dev-server.js wx",
22 | "start": "npm run dev",
23 | "build": "node build/build.js wx",
24 | "lint": "eslint --ext .js,.vue src"
25 | },
26 | "dependencies": {
27 | "flyio": "^0.6.14",
28 | "moment": "^2.24.0",
29 | "mpvue": "^2.0.0",
30 | "vuex": "^3.0.1"
31 | },
32 | "devDependencies": {
33 | "babel-core": "^6.22.1",
34 | "babel-eslint": "^8.2.3",
35 | "babel-loader": "^7.1.1",
36 | "babel-plugin-transform-runtime": "^6.22.0",
37 | "babel-preset-env": "^1.3.2",
38 | "babel-preset-stage-2": "^6.22.0",
39 | "babel-register": "^6.22.0",
40 | "chalk": "^2.4.0",
41 | "connect-history-api-fallback": "^1.3.0",
42 | "copy-webpack-plugin": "^4.5.1",
43 | "css-loader": "^0.28.11",
44 | "cssnano": "^3.10.0",
45 | "eslint": "^4.19.1",
46 | "eslint-config-standard": "^11.0.0",
47 | "eslint-friendly-formatter": "^4.0.1",
48 | "eslint-loader": "^2.0.0",
49 | "eslint-plugin-html": "^4.0.3",
50 | "eslint-plugin-import": "^2.11.0",
51 | "eslint-plugin-node": "^6.0.1",
52 | "eslint-plugin-promise": "^3.4.0",
53 | "eslint-plugin-standard": "^3.0.1",
54 | "eventsource-polyfill": "^0.9.6",
55 | "express": "^4.16.3",
56 | "extract-text-webpack-plugin": "^3.0.2",
57 | "file-loader": "^1.1.11",
58 | "friendly-errors-webpack-plugin": "^1.7.0",
59 | "glob": "^7.1.2",
60 | "html-webpack-plugin": "^3.2.0",
61 | "http-proxy-middleware": "^0.18.0",
62 | "mkdirp": "^0.5.1",
63 | "mpvue-loader": "^2.0.0",
64 | "mpvue-template-compiler": "^2.0.0",
65 | "mpvue-webpack-target": "^1.0.3",
66 | "node-sass": "^4.11.0",
67 | "optimize-css-assets-webpack-plugin": "^3.2.0",
68 | "ora": "^2.0.0",
69 | "portfinder": "^1.0.13",
70 | "postcss-loader": "^2.1.4",
71 | "postcss-mpvue-wxss": "^1.0.0",
72 | "prettier": "~1.12.1",
73 | "px2rpx-loader": "^0.1.10",
74 | "relative": "^3.0.2",
75 | "rimraf": "^2.6.0",
76 | "sass-loader": "^7.1.0",
77 | "semver": "^5.3.0",
78 | "shelljs": "^0.8.1",
79 | "uglifyjs-webpack-plugin": "^1.2.5",
80 | "url-loader": "^1.0.1",
81 | "vue-style-loader": "^4.1.0",
82 | "webpack": "^3.11.0",
83 | "webpack-bundle-analyzer": "^2.2.1",
84 | "webpack-dev-middleware-hard-disk": "^1.12.0",
85 | "webpack-merge": "^4.1.0",
86 | "webpack-mpvue-asset-plugin": "^2.0.0",
87 | "webpack-mpvue-vendor-plugin": "^2.0.0"
88 | },
89 | "engines": {
90 | "node": ">= 4.0.0",
91 | "npm": ">= 3.0.0"
92 | },
93 | "browserslist": [
94 | "> 1%",
95 | "last 2 versions",
96 | "not ie <= 8"
97 | ]
98 | }
99 |
--------------------------------------------------------------------------------
/OneSideProgram/build/utils.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var fs = require('fs')
3 | var config = require('../config')
4 | var ExtractTextPlugin = require('extract-text-webpack-plugin')
5 | var mpvueInfo = require('../node_modules/mpvue/package.json')
6 | var packageInfo = require('../package.json')
7 | var mkdirp = require('mkdirp')
8 |
9 | exports.assetsPath = function (_path) {
10 | var assetsSubDirectory = process.env.NODE_ENV === 'production'
11 | ? config.build.assetsSubDirectory
12 | : config.dev.assetsSubDirectory
13 | return path.posix.join(assetsSubDirectory, _path)
14 | }
15 |
16 | exports.cssLoaders = function (options) {
17 | options = options || {}
18 |
19 | var cssLoader = {
20 | loader: 'css-loader',
21 | options: {
22 | minimize: process.env.NODE_ENV === 'production',
23 | sourceMap: options.sourceMap
24 | }
25 | }
26 |
27 | var postcssLoader = {
28 | loader: 'postcss-loader',
29 | options: {
30 | sourceMap: true
31 | }
32 | }
33 |
34 | var px2rpxLoader = {
35 | loader: 'px2rpx-loader',
36 | options: {
37 | baseDpr: 1,
38 | rpxUnit: 0.5
39 | }
40 | }
41 |
42 | // generate loader string to be used with extract text plugin
43 | function generateLoaders (loader, loaderOptions) {
44 | var loaders = [cssLoader, px2rpxLoader, postcssLoader]
45 | if (loader) {
46 | loaders.push({
47 | loader: loader + '-loader',
48 | options: Object.assign({}, loaderOptions, {
49 | sourceMap: options.sourceMap
50 | })
51 | })
52 | }
53 |
54 | // Extract CSS when that option is specified
55 | // (which is the case during production build)
56 | if (options.extract) {
57 | return ExtractTextPlugin.extract({
58 | use: loaders,
59 | fallback: 'vue-style-loader'
60 | })
61 | } else {
62 | return ['vue-style-loader'].concat(loaders)
63 | }
64 | }
65 |
66 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html
67 | return {
68 | css: generateLoaders(),
69 | wxss: generateLoaders(),
70 | postcss: generateLoaders(),
71 | less: generateLoaders('less'),
72 | sass: generateLoaders('sass', { indentedSyntax: true }),
73 | scss: generateLoaders('sass'),
74 | stylus: generateLoaders('stylus'),
75 | styl: generateLoaders('stylus')
76 | }
77 | }
78 |
79 | // Generate loaders for standalone style files (outside of .vue)
80 | exports.styleLoaders = function (options) {
81 | var output = []
82 | var loaders = exports.cssLoaders(options)
83 | for (var extension in loaders) {
84 | var loader = loaders[extension]
85 | output.push({
86 | test: new RegExp('\\.' + extension + '$'),
87 | use: loader
88 | })
89 | }
90 | return output
91 | }
92 |
93 | const writeFile = async (filePath, content) => {
94 | let dir = path.dirname(filePath)
95 | let exist = fs.existsSync(dir)
96 | if (!exist) {
97 | await mkdirp(dir)
98 | }
99 | await fs.writeFileSync(filePath, content, 'utf8')
100 | }
101 |
102 | exports.writeFrameworkinfo = function () {
103 | var buildInfo = {
104 | 'toolName': mpvueInfo.name,
105 | 'toolFrameWorkVersion': mpvueInfo.version,
106 | 'toolCliVersion': packageInfo.mpvueTemplateProjectVersion || '',
107 | 'createTime': Date.now()
108 | }
109 |
110 | var content = JSON.stringify(buildInfo)
111 | var fileName = '.frameworkinfo'
112 | var rootDir = path.resolve(__dirname, `../${fileName}`)
113 | var distDir = path.resolve(config.build.assetsRoot, `./${fileName}`)
114 |
115 | writeFile(rootDir, content)
116 | writeFile(distDir, content)
117 | }
118 |
--------------------------------------------------------------------------------
/OneSideProgram/src/pages/index/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
106 |
107 |
154 |
--------------------------------------------------------------------------------
/OneSideProgram/build/dev-server.js:
--------------------------------------------------------------------------------
1 | require('./check-versions')()
2 |
3 | process.env.PLATFORM = process.argv[process.argv.length - 1] || 'wx'
4 | var config = require('../config')
5 | if (!process.env.NODE_ENV) {
6 | process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
7 | }
8 |
9 | // var opn = require('opn')
10 | var path = require('path')
11 | var express = require('express')
12 | var webpack = require('webpack')
13 | var proxyMiddleware = require('http-proxy-middleware')
14 | var portfinder = require('portfinder')
15 | var webpackConfig = require('./webpack.dev.conf')
16 | var utils = require('./utils')
17 |
18 | // default port where dev server listens for incoming traffic
19 | var port = process.env.PORT || config.dev.port
20 | // automatically open browser, if not set will be false
21 | var autoOpenBrowser = !!config.dev.autoOpenBrowser
22 | // Define HTTP proxies to your custom API backend
23 | // https://github.com/chimurai/http-proxy-middleware
24 | var proxyTable = config.dev.proxyTable
25 |
26 | var app = express()
27 | var compiler = webpack(webpackConfig)
28 | if (process.env.PLATFORM === 'swan') {
29 | utils.writeFrameworkinfo()
30 | }
31 |
32 | // var devMiddleware = require('webpack-dev-middleware')(compiler, {
33 | // publicPath: webpackConfig.output.publicPath,
34 | // quiet: true
35 | // })
36 |
37 | // var hotMiddleware = require('webpack-hot-middleware')(compiler, {
38 | // log: false,
39 | // heartbeat: 2000
40 | // })
41 | // force page reload when html-webpack-plugin template changes
42 | // compiler.plugin('compilation', function (compilation) {
43 | // compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
44 | // hotMiddleware.publish({ action: 'reload' })
45 | // cb()
46 | // })
47 | // })
48 |
49 | // proxy api requests
50 | Object.keys(proxyTable).forEach(function (context) {
51 | var options = proxyTable[context]
52 | if (typeof options === 'string') {
53 | options = { target: options }
54 | }
55 | app.use(proxyMiddleware(options.filter || context, options))
56 | })
57 |
58 | // handle fallback for HTML5 history API
59 | app.use(require('connect-history-api-fallback')())
60 |
61 | // serve webpack bundle output
62 | // app.use(devMiddleware)
63 |
64 | // enable hot-reload and state-preserving
65 | // compilation error display
66 | // app.use(hotMiddleware)
67 |
68 | // serve pure static assets
69 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
70 | app.use(staticPath, express.static('./static'))
71 |
72 | // var uri = 'http://localhost:' + port
73 |
74 | var _resolve
75 | var readyPromise = new Promise(resolve => {
76 | _resolve = resolve
77 | })
78 |
79 | // console.log('> Starting dev server...')
80 | // devMiddleware.waitUntilValid(() => {
81 | // console.log('> Listening at ' + uri + '\n')
82 | // // when env is testing, don't need open it
83 | // if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
84 | // opn(uri)
85 | // }
86 | // _resolve()
87 | // })
88 |
89 | module.exports = new Promise((resolve, reject) => {
90 | portfinder.basePort = port
91 | portfinder.getPortPromise()
92 | .then(newPort => {
93 | if (port !== newPort) {
94 | console.log(`${port}端口被占用,开启新端口${newPort}`)
95 | }
96 | var server = app.listen(newPort, 'localhost')
97 | // for 小程序的文件保存机制
98 | require('webpack-dev-middleware-hard-disk')(compiler, {
99 | publicPath: webpackConfig.output.publicPath,
100 | quiet: true
101 | })
102 | resolve({
103 | ready: readyPromise,
104 | close: () => {
105 | server.close()
106 | }
107 | })
108 | }).catch(error => {
109 | console.log('没有找到空闲端口,请打开任务管理器杀死进程端口再试', error)
110 | })
111 | })
112 |
--------------------------------------------------------------------------------
/OneSideProgram/src/pages/add/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
面试信息
4 |
29 |
备注信息
30 |
31 |
32 |
33 |
34 |
35 |
36 |
102 |
103 |
163 |
--------------------------------------------------------------------------------
/OneSideProgram/build/webpack.prod.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var utils = require('./utils')
3 | var webpack = require('webpack')
4 | var config = require('../config')
5 | var merge = require('webpack-merge')
6 | var baseWebpackConfig = require('./webpack.base.conf')
7 | var UglifyJsPlugin = require('uglifyjs-webpack-plugin')
8 | var CopyWebpackPlugin = require('copy-webpack-plugin')
9 | // var HtmlWebpackPlugin = require('html-webpack-plugin')
10 | var ExtractTextPlugin = require('extract-text-webpack-plugin')
11 | var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
12 | var MpvueVendorPlugin = require('webpack-mpvue-vendor-plugin')
13 | var env = config.build.env
14 |
15 | var webpackConfig = merge(baseWebpackConfig, {
16 | module: {
17 | rules: utils.styleLoaders({
18 | sourceMap: config.build.productionSourceMap,
19 | extract: true
20 | })
21 | },
22 | devtool: config.build.productionSourceMap ? '#source-map' : false,
23 | output: {
24 | path: config.build.assetsRoot,
25 | // filename: utils.assetsPath('[name].[chunkhash].js'),
26 | // chunkFilename: utils.assetsPath('[id].[chunkhash].js')
27 | filename: utils.assetsPath('[name].js'),
28 | chunkFilename: utils.assetsPath('[id].js')
29 | },
30 | plugins: [
31 | // http://vuejs.github.io/vue-loader/en/workflow/production.html
32 | new webpack.DefinePlugin({
33 | 'process.env': env
34 | }),
35 | // extract css into its own file
36 | new ExtractTextPlugin({
37 | // filename: utils.assetsPath('[name].[contenthash].css')
38 | filename: utils.assetsPath(`[name].${config.build.fileExt.style}`)
39 | }),
40 | // Compress extracted CSS. We are using this plugin so that possible
41 | // duplicated CSS from different components can be deduped.
42 | new OptimizeCSSPlugin({
43 | cssProcessorOptions: {
44 | safe: true
45 | }
46 | }),
47 | // generate dist index.html with correct asset hash for caching.
48 | // you can customize output by editing /index.html
49 | // see https://github.com/ampedandwired/html-webpack-plugin
50 | // new HtmlWebpackPlugin({
51 | // filename: config.build.index,
52 | // template: 'index.html',
53 | // inject: true,
54 | // minify: {
55 | // removeComments: true,
56 | // collapseWhitespace: true,
57 | // removeAttributeQuotes: true
58 | // // more options:
59 | // // https://github.com/kangax/html-minifier#options-quick-reference
60 | // },
61 | // // necessary to consistently work with multiple chunks via CommonsChunkPlugin
62 | // chunksSortMode: 'dependency'
63 | // }),
64 | // keep module.id stable when vender modules does not change
65 | new webpack.HashedModuleIdsPlugin(),
66 | // split vendor js into its own file
67 | new webpack.optimize.CommonsChunkPlugin({
68 | name: 'common/vendor',
69 | minChunks: function (module, count) {
70 | // any required modules inside node_modules are extracted to vendor
71 | return (
72 | module.resource &&
73 | /\.js$/.test(module.resource) &&
74 | module.resource.indexOf('node_modules') >= 0
75 | ) || count > 1
76 | }
77 | }),
78 | // extract webpack runtime and module manifest to its own file in order to
79 | // prevent vendor hash from being updated whenever app bundle is updated
80 | new webpack.optimize.CommonsChunkPlugin({
81 | name: 'common/manifest',
82 | chunks: ['common/vendor']
83 | }),
84 | new MpvueVendorPlugin({
85 | platform: process.env.PLATFORM
86 | })
87 | ]
88 | })
89 |
90 | // if (config.build.productionGzip) {
91 | // var CompressionWebpackPlugin = require('compression-webpack-plugin')
92 |
93 | // webpackConfig.plugins.push(
94 | // new CompressionWebpackPlugin({
95 | // asset: '[path].gz[query]',
96 | // algorithm: 'gzip',
97 | // test: new RegExp(
98 | // '\\.(' +
99 | // config.build.productionGzipExtensions.join('|') +
100 | // ')$'
101 | // ),
102 | // threshold: 10240,
103 | // minRatio: 0.8
104 | // })
105 | // )
106 | // }
107 |
108 | if (config.build.bundleAnalyzerReport) {
109 | var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
110 | webpackConfig.plugins.push(new BundleAnalyzerPlugin())
111 | }
112 |
113 | var useUglifyJs = process.env.PLATFORM !== 'swan'
114 | if (useUglifyJs) {
115 | webpackConfig.plugins.push(new UglifyJsPlugin({
116 | sourceMap: true
117 | }))
118 | }
119 |
120 | module.exports = webpackConfig
121 |
--------------------------------------------------------------------------------
/OneSideProgram/build/webpack.base.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var fs = require('fs')
3 | var utils = require('./utils')
4 | var config = require('../config')
5 | var webpack = require('webpack')
6 | var merge = require('webpack-merge')
7 | var vueLoaderConfig = require('./vue-loader.conf')
8 | var MpvuePlugin = require('webpack-mpvue-asset-plugin')
9 | var glob = require('glob')
10 | var CopyWebpackPlugin = require('copy-webpack-plugin')
11 | var relative = require('relative')
12 |
13 | function resolve (dir) {
14 | return path.join(__dirname, '..', dir)
15 | }
16 |
17 | function getEntry (rootSrc) {
18 | var map = {};
19 | glob.sync(rootSrc + '/pages/**/main.js')
20 | .forEach(file => {
21 | var key = relative(rootSrc, file).replace('.js', '');
22 | map[key] = file;
23 | })
24 | return map;
25 | }
26 |
27 | const appEntry = { app: resolve('./src/main.js') }
28 | const pagesEntry = getEntry(resolve('./src'), 'pages/**/main.js')
29 | const entry = Object.assign({}, appEntry, pagesEntry)
30 |
31 | let baseWebpackConfig = {
32 | // 如果要自定义生成的 dist 目录里面的文件路径,
33 | // 可以将 entry 写成 {'toPath': 'fromPath'} 的形式,
34 | // toPath 为相对于 dist 的路径, 例:index/demo,则生成的文件地址为 dist/index/demo.js
35 | entry,
36 | target: require('mpvue-webpack-target'),
37 | output: {
38 | path: config.build.assetsRoot,
39 | jsonpFunction: 'webpackJsonpMpvue',
40 | filename: '[name].js',
41 | publicPath: process.env.NODE_ENV === 'production'
42 | ? config.build.assetsPublicPath
43 | : config.dev.assetsPublicPath
44 | },
45 | resolve: {
46 | extensions: ['.js', '.vue', '.json'],
47 | alias: {
48 | 'vue': 'mpvue',
49 | '@': resolve('src')
50 | },
51 | symlinks: false,
52 | aliasFields: ['mpvue', 'weapp', 'browser'],
53 | mainFields: ['browser', 'module', 'main']
54 | },
55 | module: {
56 | rules: [
57 | // {
58 | // test: /\.(js|vue)$/,
59 | // loader: 'eslint-loader',
60 | // enforce: 'pre',
61 | // include: [resolve('src'), resolve('test')],
62 | // options: {
63 | // formatter: require('eslint-friendly-formatter')
64 | // }
65 | // },
66 | {
67 | test: /\.vue$/,
68 | loader: 'mpvue-loader',
69 | options: vueLoaderConfig
70 | },
71 | {
72 | test: /\.js$/,
73 | include: [resolve('src'), resolve('test')],
74 | use: [
75 | 'babel-loader',
76 | {
77 | loader: 'mpvue-loader',
78 | options: Object.assign({checkMPEntry: true}, vueLoaderConfig)
79 | },
80 | ]
81 | },
82 | {
83 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
84 | loader: 'url-loader',
85 | options: {
86 | limit: 10000,
87 | name: utils.assetsPath('img/[name].[ext]')
88 | }
89 | },
90 | {
91 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
92 | loader: 'url-loader',
93 | options: {
94 | limit: 10000,
95 | name: utils.assetsPath('media/[name].[ext]')
96 | }
97 | },
98 | {
99 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
100 | loader: 'url-loader',
101 | options: {
102 | limit: 10000,
103 | name: utils.assetsPath('fonts/[name].[ext]')
104 | }
105 | }
106 | ]
107 | },
108 | plugins: [
109 | // api 统一桥协议方案
110 | new webpack.DefinePlugin({
111 | 'mpvue': 'global.mpvue',
112 | 'mpvuePlatform': 'global.mpvuePlatform'
113 | }),
114 | new MpvuePlugin(),
115 | new CopyWebpackPlugin([{
116 | from: '**/*.json',
117 | to: ''
118 | }], {
119 | context: 'src/'
120 | }),
121 | new CopyWebpackPlugin([
122 | {
123 | from: path.resolve(__dirname, '../static'),
124 | to: path.resolve(config.build.assetsRoot, './static'),
125 | ignore: ['.*']
126 | }
127 | ])
128 | ]
129 | }
130 |
131 | // 针对百度小程序,由于不支持通过 miniprogramRoot 进行自定义构建完的文件的根路径
132 | // 所以需要将项目根路径下面的 project.swan.json 拷贝到构建目录
133 | // 然后百度开发者工具将 dist/swan 作为项目根目录打
134 | const projectConfigMap = {
135 | tt: '../project.config.json',
136 | swan: '../project.swan.json'
137 | }
138 |
139 | const PLATFORM = process.env.PLATFORM
140 | if (/^(swan)|(tt)$/.test(PLATFORM)) {
141 | baseWebpackConfig = merge(baseWebpackConfig, {
142 | plugins: [
143 | new CopyWebpackPlugin([{
144 | from: path.resolve(__dirname, projectConfigMap[PLATFORM]),
145 | to: path.resolve(config.build.assetsRoot)
146 | }])
147 | ]
148 | })
149 | }
150 |
151 | module.exports = baseWebpackConfig
152 |
--------------------------------------------------------------------------------
/OneSideProgram/static/libs/qqmap-wx-jssdk.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 微信小程序JavaScriptSDK
3 | *
4 | * @version 1.2
5 | * @date 2019-03-06
6 | * @author v_ylyue@tencent.com
7 | */
8 |
9 | var ERROR_CONF = {
10 | KEY_ERR: 311,
11 | KEY_ERR_MSG: 'key格式错误',
12 | PARAM_ERR: 310,
13 | PARAM_ERR_MSG: '请求参数信息有误',
14 | SYSTEM_ERR: 600,
15 | SYSTEM_ERR_MSG: '系统错误',
16 | WX_ERR_CODE: 1000,
17 | WX_OK_CODE: 200
18 | };
19 | var BASE_URL = 'https://apis.map.qq.com/ws/';
20 | var URL_SEARCH = BASE_URL + 'place/v1/search';
21 | var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion';
22 | var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/';
23 | var URL_CITY_LIST = BASE_URL + 'district/v1/list';
24 | var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren';
25 | var URL_DISTANCE = BASE_URL + 'distance/v1/';
26 | var URL_DIRECTION = BASE_URL + 'direction/v1/';
27 | var MODE = {
28 | driving: 'driving',
29 | transit: 'transit'
30 | };
31 | var EARTH_RADIUS = 6378136.49;
32 | var Utils = {
33 | /**
34 | * md5加密方法
35 | * 版权所有©2011 Sebastian Tschan,https://blueimp.net
36 | */
37 | safeAdd(x, y) {
38 | var lsw = (x & 0xffff) + (y & 0xffff);
39 | var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
40 | return (msw << 16) | (lsw & 0xffff);
41 | },
42 | bitRotateLeft(num, cnt) {
43 | return (num << cnt) | (num >>> (32 - cnt));
44 | },
45 | md5cmn(q, a, b, x, s, t) {
46 | return this.safeAdd(this.bitRotateLeft(this.safeAdd(this.safeAdd(a, q), this.safeAdd(x, t)), s), b);
47 | },
48 | md5ff(a, b, c, d, x, s, t) {
49 | return this.md5cmn((b & c) | (~b & d), a, b, x, s, t);
50 | },
51 | md5gg(a, b, c, d, x, s, t) {
52 | return this.md5cmn((b & d) | (c & ~d), a, b, x, s, t);
53 | },
54 | md5hh(a, b, c, d, x, s, t) {
55 | return this.md5cmn(b ^ c ^ d, a, b, x, s, t);
56 | },
57 | md5ii(a, b, c, d, x, s, t) {
58 | return this.md5cmn(c ^ (b | ~d), a, b, x, s, t);
59 | },
60 | binlMD5(x, len) {
61 | /* append padding */
62 | x[len >> 5] |= 0x80 << (len % 32);
63 | x[((len + 64) >>> 9 << 4) + 14] = len;
64 |
65 | var i;
66 | var olda;
67 | var oldb;
68 | var oldc;
69 | var oldd;
70 | var a = 1732584193;
71 | var b = -271733879;
72 | var c = -1732584194;
73 | var d = 271733878;
74 |
75 | for (i = 0; i < x.length; i += 16) {
76 | olda = a;
77 | oldb = b;
78 | oldc = c;
79 | oldd = d;
80 |
81 | a = this.md5ff(a, b, c, d, x[i], 7, -680876936);
82 | d = this.md5ff(d, a, b, c, x[i + 1], 12, -389564586);
83 | c = this.md5ff(c, d, a, b, x[i + 2], 17, 606105819);
84 | b = this.md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
85 | a = this.md5ff(a, b, c, d, x[i + 4], 7, -176418897);
86 | d = this.md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
87 | c = this.md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
88 | b = this.md5ff(b, c, d, a, x[i + 7], 22, -45705983);
89 | a = this.md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
90 | d = this.md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
91 | c = this.md5ff(c, d, a, b, x[i + 10], 17, -42063);
92 | b = this.md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
93 | a = this.md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
94 | d = this.md5ff(d, a, b, c, x[i + 13], 12, -40341101);
95 | c = this.md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
96 | b = this.md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
97 |
98 | a = this.md5gg(a, b, c, d, x[i + 1], 5, -165796510);
99 | d = this.md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
100 | c = this.md5gg(c, d, a, b, x[i + 11], 14, 643717713);
101 | b = this.md5gg(b, c, d, a, x[i], 20, -373897302);
102 | a = this.md5gg(a, b, c, d, x[i + 5], 5, -701558691);
103 | d = this.md5gg(d, a, b, c, x[i + 10], 9, 38016083);
104 | c = this.md5gg(c, d, a, b, x[i + 15], 14, -660478335);
105 | b = this.md5gg(b, c, d, a, x[i + 4], 20, -405537848);
106 | a = this.md5gg(a, b, c, d, x[i + 9], 5, 568446438);
107 | d = this.md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
108 | c = this.md5gg(c, d, a, b, x[i + 3], 14, -187363961);
109 | b = this.md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
110 | a = this.md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
111 | d = this.md5gg(d, a, b, c, x[i + 2], 9, -51403784);
112 | c = this.md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
113 | b = this.md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
114 |
115 | a = this.md5hh(a, b, c, d, x[i + 5], 4, -378558);
116 | d = this.md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
117 | c = this.md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
118 | b = this.md5hh(b, c, d, a, x[i + 14], 23, -35309556);
119 | a = this.md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
120 | d = this.md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
121 | c = this.md5hh(c, d, a, b, x[i + 7], 16, -155497632);
122 | b = this.md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
123 | a = this.md5hh(a, b, c, d, x[i + 13], 4, 681279174);
124 | d = this.md5hh(d, a, b, c, x[i], 11, -358537222);
125 | c = this.md5hh(c, d, a, b, x[i + 3], 16, -722521979);
126 | b = this.md5hh(b, c, d, a, x[i + 6], 23, 76029189);
127 | a = this.md5hh(a, b, c, d, x[i + 9], 4, -640364487);
128 | d = this.md5hh(d, a, b, c, x[i + 12], 11, -421815835);
129 | c = this.md5hh(c, d, a, b, x[i + 15], 16, 530742520);
130 | b = this.md5hh(b, c, d, a, x[i + 2], 23, -995338651);
131 |
132 | a = this.md5ii(a, b, c, d, x[i], 6, -198630844);
133 | d = this.md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
134 | c = this.md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
135 | b = this.md5ii(b, c, d, a, x[i + 5], 21, -57434055);
136 | a = this.md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
137 | d = this.md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
138 | c = this.md5ii(c, d, a, b, x[i + 10], 15, -1051523);
139 | b = this.md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
140 | a = this.md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
141 | d = this.md5ii(d, a, b, c, x[i + 15], 10, -30611744);
142 | c = this.md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
143 | b = this.md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
144 | a = this.md5ii(a, b, c, d, x[i + 4], 6, -145523070);
145 | d = this.md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
146 | c = this.md5ii(c, d, a, b, x[i + 2], 15, 718787259);
147 | b = this.md5ii(b, c, d, a, x[i + 9], 21, -343485551);
148 |
149 | a = this.safeAdd(a, olda);
150 | b = this.safeAdd(b, oldb);
151 | c = this.safeAdd(c, oldc);
152 | d = this.safeAdd(d, oldd);
153 | }
154 | return [a, b, c, d];
155 | },
156 | binl2rstr(input) {
157 | var i;
158 | var output = '';
159 | var length32 = input.length * 32;
160 | for (i = 0; i < length32; i += 8) {
161 | output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xff);
162 | }
163 | return output;
164 | },
165 | rstr2binl(input) {
166 | var i;
167 | var output = [];
168 | output[(input.length >> 2) - 1] = undefined;
169 | for (i = 0; i < output.length; i += 1) {
170 | output[i] = 0;
171 | }
172 | var length8 = input.length * 8;
173 | for (i = 0; i < length8; i += 8) {
174 | output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << (i % 32);
175 | }
176 | return output;
177 | },
178 | rstrMD5(s) {
179 | return this.binl2rstr(this.binlMD5(this.rstr2binl(s), s.length * 8));
180 | },
181 | rstrHMACMD5(key, data) {
182 | var i;
183 | var bkey = this.rstr2binl(key);
184 | var ipad = [];
185 | var opad = [];
186 | var hash;
187 | ipad[15] = opad[15] = undefined;
188 | if (bkey.length > 16) {
189 | bkey = this.binlMD5(bkey, key.length * 8);
190 | }
191 | for (i = 0; i < 16; i += 1) {
192 | ipad[i] = bkey[i] ^ 0x36363636;
193 | opad[i] = bkey[i] ^ 0x5c5c5c5c;
194 | }
195 | hash = this.binlMD5(ipad.concat(this.rstr2binl(data)), 512 + data.length * 8);
196 | return this.binl2rstr(this.binlMD5(opad.concat(hash), 512 + 128));
197 | },
198 | rstr2hex(input) {
199 | var hexTab = '0123456789abcdef';
200 | var output = '';
201 | var x;
202 | var i;
203 | for (i = 0; i < input.length; i += 1) {
204 | x = input.charCodeAt(i);
205 | output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f);
206 | }
207 | return output;
208 | },
209 | str2rstrUTF8(input) {
210 | return unescape(encodeURIComponent(input));
211 | },
212 | rawMD5(s) {
213 | return this.rstrMD5(this.str2rstrUTF8(s));
214 | },
215 | hexMD5(s) {
216 | return this.rstr2hex(this.rawMD5(s));
217 | },
218 | rawHMACMD5(k, d) {
219 | return this.rstrHMACMD5(this.str2rstrUTF8(k), str2rstrUTF8(d));
220 | },
221 | hexHMACMD5(k, d) {
222 | return this.rstr2hex(this.rawHMACMD5(k, d));
223 | },
224 |
225 | md5(string, key, raw) {
226 | if (!key) {
227 | if (!raw) {
228 | return this.hexMD5(string);
229 | }
230 | return this.rawMD5(string);
231 | }
232 | if (!raw) {
233 | return this.hexHMACMD5(key, string);
234 | }
235 | return this.rawHMACMD5(key, string);
236 | },
237 | /**
238 | * 得到md5加密后的sig参数
239 | * @param {Object} requestParam 接口参数
240 | * @param {String} sk签名字符串
241 | * @param {String} featrue 方法名
242 | * @return 返回加密后的sig参数
243 | */
244 | getSig(requestParam, sk, feature, mode) {
245 | var sig = null;
246 | var requestArr = [];
247 | Object.keys(requestParam).sort().forEach(function(key){
248 | requestArr.push(key + '=' + requestParam[key]);
249 | });
250 | if (feature == 'search') {
251 | sig = '/ws/place/v1/search?' + requestArr.join('&') + sk;
252 | }
253 | if (feature == 'suggest') {
254 | sig = '/ws/place/v1/suggestion?' + requestArr.join('&') + sk;
255 | }
256 | if (feature == 'reverseGeocoder') {
257 | sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk;
258 | }
259 | if (feature == 'geocoder') {
260 | sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk;
261 | }
262 | if (feature == 'getCityList') {
263 | sig = '/ws/district/v1/list?' + requestArr.join('&') + sk;
264 | }
265 | if (feature == 'getDistrictByCityId') {
266 | sig = '/ws/district/v1/getchildren?' + requestArr.join('&') + sk;
267 | }
268 | if (feature == 'calculateDistance') {
269 | sig = '/ws/distance/v1/?' + requestArr.join('&') + sk;
270 | }
271 | if (feature == 'direction') {
272 | sig = '/ws/direction/v1/' + mode + '?' + requestArr.join('&') + sk;
273 | }
274 | sig = this.md5(sig);
275 | return sig;
276 | },
277 | /**
278 | * 得到终点query字符串
279 | * @param {Array|String} 检索数据
280 | */
281 | location2query(data) {
282 | if (typeof data == 'string') {
283 | return data;
284 | }
285 | var query = '';
286 | for (var i = 0; i < data.length; i++) {
287 | var d = data[i];
288 | if (!!query) {
289 | query += ';';
290 | }
291 | if (d.location) {
292 | query = query + d.location.lat + ',' + d.location.lng;
293 | }
294 | if (d.latitude && d.longitude) {
295 | query = query + d.latitude + ',' + d.longitude;
296 | }
297 | }
298 | return query;
299 | },
300 |
301 | /**
302 | * 计算角度
303 | */
304 | rad(d) {
305 | return d * Math.PI / 180.0;
306 | },
307 | /**
308 | * 处理终点location数组
309 | * @return 返回终点数组
310 | */
311 | getEndLocation(location){
312 | var to = location.split(';');
313 | var endLocation = [];
314 | for (var i = 0; i < to.length; i++) {
315 | endLocation.push({
316 | lat: parseFloat(to[i].split(',')[0]),
317 | lng: parseFloat(to[i].split(',')[1])
318 | })
319 | }
320 | return endLocation;
321 | },
322 |
323 | /**
324 | * 计算两点间直线距离
325 | * @param a 表示纬度差
326 | * @param b 表示经度差
327 | * @return 返回的是距离,单位m
328 | */
329 | getDistance(latFrom, lngFrom, latTo, lngTo) {
330 | var radLatFrom = this.rad(latFrom);
331 | var radLatTo = this.rad(latTo);
332 | var a = radLatFrom - radLatTo;
333 | var b = this.rad(lngFrom) - this.rad(lngTo);
334 | var distance = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2)));
335 | distance = distance * EARTH_RADIUS;
336 | distance = Math.round(distance * 10000) / 10000;
337 | return parseFloat(distance.toFixed(0));
338 | },
339 | /**
340 | * 使用微信接口进行定位
341 | */
342 | getWXLocation(success, fail, complete) {
343 | wx.getLocation({
344 | type: 'gcj02',
345 | success: success,
346 | fail: fail,
347 | complete: complete
348 | });
349 | },
350 |
351 | /**
352 | * 获取location参数
353 | */
354 | getLocationParam(location) {
355 | if (typeof location == 'string') {
356 | var locationArr = location.split(',');
357 | if (locationArr.length === 2) {
358 | location = {
359 | latitude: location.split(',')[0],
360 | longitude: location.split(',')[1]
361 | };
362 | } else {
363 | location = {};
364 | }
365 | }
366 | return location;
367 | },
368 |
369 | /**
370 | * 回调函数默认处理
371 | */
372 | polyfillParam(param) {
373 | param.success = param.success || function () { };
374 | param.fail = param.fail || function () { };
375 | param.complete = param.complete || function () { };
376 | },
377 |
378 | /**
379 | * 验证param对应的key值是否为空
380 | *
381 | * @param {Object} param 接口参数
382 | * @param {String} key 对应参数的key
383 | */
384 | checkParamKeyEmpty(param, key) {
385 | if (!param[key]) {
386 | var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + key +'参数格式有误');
387 | param.fail(errconf);
388 | param.complete(errconf);
389 | return true;
390 | }
391 | return false;
392 | },
393 |
394 | /**
395 | * 验证参数中是否存在检索词keyword
396 | *
397 | * @param {Object} param 接口参数
398 | */
399 | checkKeyword(param){
400 | return !this.checkParamKeyEmpty(param, 'keyword');
401 | },
402 |
403 | /**
404 | * 验证location值
405 | *
406 | * @param {Object} param 接口参数
407 | */
408 | checkLocation(param) {
409 | var location = this.getLocationParam(param.location);
410 | if (!location || !location.latitude || !location.longitude) {
411 | var errconf = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误');
412 | param.fail(errconf);
413 | param.complete(errconf);
414 | return false;
415 | }
416 | return true;
417 | },
418 |
419 | /**
420 | * 构造错误数据结构
421 | * @param {Number} errCode 错误码
422 | * @param {Number} errMsg 错误描述
423 | */
424 | buildErrorConfig(errCode, errMsg) {
425 | return {
426 | status: errCode,
427 | message: errMsg
428 | };
429 | },
430 |
431 | /**
432 | *
433 | * 数据处理函数
434 | * 根据传入参数不同处理不同数据
435 | * @param {String} feature 功能名称
436 | * search 地点搜索
437 | * suggest关键词提示
438 | * reverseGeocoder逆地址解析
439 | * geocoder地址解析
440 | * getCityList获取城市列表:父集
441 | * getDistrictByCityId获取区县列表:子集
442 | * calculateDistance距离计算
443 | * @param {Object} param 接口参数
444 | * @param {Object} data 数据
445 | */
446 | handleData(param,data,feature){
447 | if (feature == 'search') {
448 | var searchResult = data.data;
449 | var searchSimplify = [];
450 | for (var i = 0; i < searchResult.length; i++) {
451 | searchSimplify.push({
452 | id: searchResult[i].id || null,
453 | title: searchResult[i].title || null,
454 | latitude: searchResult[i].location && searchResult[i].location.lat || null,
455 | longitude: searchResult[i].location && searchResult[i].location.lng || null,
456 | address: searchResult[i].address || null,
457 | category: searchResult[i].category || null,
458 | tel: searchResult[i].tel || null,
459 | adcode: searchResult[i].ad_info && searchResult[i].ad_info.adcode || null,
460 | city: searchResult[i].ad_info && searchResult[i].ad_info.city || null,
461 | district: searchResult[i].ad_info && searchResult[i].ad_info.district || null,
462 | province: searchResult[i].ad_info && searchResult[i].ad_info.province || null
463 | })
464 | }
465 | param.success(data, {
466 | searchResult: searchResult,
467 | searchSimplify: searchSimplify
468 | })
469 | } else if (feature == 'suggest') {
470 | var suggestResult = data.data;
471 | var suggestSimplify = [];
472 | for (var i = 0; i < suggestResult.length; i++) {
473 | suggestSimplify.push({
474 | adcode: suggestResult[i].adcode || null,
475 | address: suggestResult[i].address || null,
476 | category: suggestResult[i].category || null,
477 | city: suggestResult[i].city || null,
478 | district: suggestResult[i].district || null,
479 | id: suggestResult[i].id || null,
480 | latitude: suggestResult[i].location && suggestResult[i].location.lat || null,
481 | longitude: suggestResult[i].location && suggestResult[i].location.lng || null,
482 | province: suggestResult[i].province || null,
483 | title: suggestResult[i].title || null,
484 | type: suggestResult[i].type || null
485 | })
486 | }
487 | param.success(data, {
488 | suggestResult: suggestResult,
489 | suggestSimplify: suggestSimplify
490 | })
491 | } else if (feature == 'reverseGeocoder') {
492 | var reverseGeocoderResult = data.result;
493 | var reverseGeocoderSimplify = {
494 | address: reverseGeocoderResult.address || null,
495 | latitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lat || null,
496 | longitude: reverseGeocoderResult.location && reverseGeocoderResult.location.lng || null,
497 | adcode: reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode || null,
498 | city: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.city || null,
499 | district: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.district || null,
500 | nation: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.nation || null,
501 | province: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.province || null,
502 | street: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street || null,
503 | street_number: reverseGeocoderResult.address_component && reverseGeocoderResult.address_component.street_number || null,
504 | recommend: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.recommend || null,
505 | rough: reverseGeocoderResult.formatted_addresses && reverseGeocoderResult.formatted_addresses.rough || null
506 | };
507 | if (reverseGeocoderResult.pois) {//判断是否返回周边poi
508 | var pois = reverseGeocoderResult.pois;
509 | var poisSimplify = [];
510 | for (var i = 0;i < pois.length;i++) {
511 | poisSimplify.push({
512 | id: pois[i].id || null,
513 | title: pois[i].title || null,
514 | latitude: pois[i].location && pois[i].location.lat || null,
515 | longitude: pois[i].location && pois[i].location.lng || null,
516 | address: pois[i].address || null,
517 | category: pois[i].category || null,
518 | adcode: pois[i].ad_info && pois[i].ad_info.adcode || null,
519 | city: pois[i].ad_info && pois[i].ad_info.city || null,
520 | district: pois[i].ad_info && pois[i].ad_info.district || null,
521 | province: pois[i].ad_info && pois[i].ad_info.province || null
522 | })
523 | }
524 | param.success(data,{
525 | reverseGeocoderResult: reverseGeocoderResult,
526 | reverseGeocoderSimplify: reverseGeocoderSimplify,
527 | pois: pois,
528 | poisSimplify: poisSimplify
529 | })
530 | } else {
531 | param.success(data, {
532 | reverseGeocoderResult: reverseGeocoderResult,
533 | reverseGeocoderSimplify: reverseGeocoderSimplify
534 | })
535 | }
536 | } else if (feature == 'geocoder') {
537 | var geocoderResult = data.result;
538 | var geocoderSimplify = {
539 | title: geocoderResult.title || null,
540 | latitude: geocoderResult.location && geocoderResult.location.lat || null,
541 | longitude: geocoderResult.location && geocoderResult.location.lng || null,
542 | adcode: geocoderResult.ad_info && geocoderResult.ad_info.adcode || null,
543 | province: geocoderResult.address_components && geocoderResult.address_components.province || null,
544 | city: geocoderResult.address_components && geocoderResult.address_components.city || null,
545 | district: geocoderResult.address_components && geocoderResult.address_components.district || null,
546 | street: geocoderResult.address_components && geocoderResult.address_components.street || null,
547 | street_number: geocoderResult.address_components && geocoderResult.address_components.street_number || null,
548 | level: geocoderResult.level || null
549 | };
550 | param.success(data,{
551 | geocoderResult: geocoderResult,
552 | geocoderSimplify: geocoderSimplify
553 | });
554 | } else if (feature == 'getCityList') {
555 | var provinceResult = data.result[0];
556 | var cityResult = data.result[1];
557 | var districtResult = data.result[2];
558 | param.success(data,{
559 | provinceResult: provinceResult,
560 | cityResult: cityResult,
561 | districtResult: districtResult
562 | });
563 | } else if (feature == 'getDistrictByCityId') {
564 | var districtByCity = data.result[0];
565 | param.success(data, districtByCity);
566 | } else if (feature == 'calculateDistance') {
567 | var calculateDistanceResult = data.result.elements;
568 | var distance = [];
569 | for (var i = 0; i < calculateDistanceResult.length; i++){
570 | distance.push(calculateDistanceResult[i].distance);
571 | }
572 | param.success(data, {
573 | calculateDistanceResult: calculateDistanceResult,
574 | distance: distance
575 | });
576 | } else if (feature == 'direction') {
577 | var direction = data.result.routes;
578 | param.success(data,direction);
579 | } else {
580 | param.success(data);
581 | }
582 | },
583 |
584 | /**
585 | * 构造微信请求参数,公共属性处理
586 | *
587 | * @param {Object} param 接口参数
588 | * @param {Object} param 配置项
589 | * @param {String} feature 方法名
590 | */
591 | buildWxRequestConfig(param, options, feature) {
592 | var that = this;
593 | options.header = { "content-type": "application/json" };
594 | options.method = 'GET';
595 | options.success = function (res) {
596 | var data = res.data;
597 | if (data.status === 0) {
598 | that.handleData(param, data, feature);
599 | } else {
600 | param.fail(data);
601 | }
602 | };
603 | options.fail = function (res) {
604 | res.statusCode = ERROR_CONF.WX_ERR_CODE;
605 | param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
606 | };
607 | options.complete = function (res) {
608 | var statusCode = +res.statusCode;
609 | switch(statusCode) {
610 | case ERROR_CONF.WX_ERR_CODE: {
611 | param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
612 | break;
613 | }
614 | case ERROR_CONF.WX_OK_CODE: {
615 | var data = res.data;
616 | if (data.status === 0) {
617 | param.complete(data);
618 | } else {
619 | param.complete(that.buildErrorConfig(data.status, data.message));
620 | }
621 | break;
622 | }
623 | default:{
624 | param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG));
625 | }
626 |
627 | }
628 | };
629 | return options;
630 | },
631 |
632 | /**
633 | * 处理用户参数是否传入坐标进行不同的处理
634 | */
635 | locationProcess(param, locationsuccess, locationfail, locationcomplete) {
636 | var that = this;
637 | locationfail = locationfail || function (res) {
638 | res.statusCode = ERROR_CONF.WX_ERR_CODE;
639 | param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
640 | };
641 | locationcomplete = locationcomplete || function (res) {
642 | if (res.statusCode == ERROR_CONF.WX_ERR_CODE) {
643 | param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg));
644 | }
645 | };
646 | if (!param.location) {
647 | that.getWXLocation(locationsuccess, locationfail, locationcomplete);
648 | } else if (that.checkLocation(param)) {
649 | var location = Utils.getLocationParam(param.location);
650 | locationsuccess(location);
651 | }
652 | }
653 | };
654 |
655 |
656 | class QQMapWX {
657 |
658 | /**
659 | * 构造函数
660 | *
661 | * @param {Object} options 接口参数,key 为必选参数
662 | */
663 | constructor(options) {
664 | if (!options.key) {
665 | throw Error('key值不能为空');
666 | }
667 | this.key = options.key;
668 | };
669 |
670 | /**
671 | * POI周边检索
672 | *
673 | * @param {Object} options 接口参数对象
674 | *
675 | * 参数对象结构可以参考
676 | * @see http://lbs.qq.com/webservice_v1/guide-search.html
677 | */
678 | search(options) {
679 | var that = this;
680 | options = options || {};
681 |
682 | Utils.polyfillParam(options);
683 |
684 | if (!Utils.checkKeyword(options)) {
685 | return;
686 | }
687 |
688 | var requestParam = {
689 | keyword: options.keyword,
690 | orderby: options.orderby || '_distance',
691 | page_size: options.page_size || 10,
692 | page_index: options.page_index || 1,
693 | output: 'json',
694 | key: that.key
695 | };
696 |
697 | if (options.address_format) {
698 | requestParam.address_format = options.address_format;
699 | }
700 |
701 | if (options.filter) {
702 | requestParam.filter = options.filter;
703 | }
704 |
705 | var distance = options.distance || "1000";
706 | var auto_extend = options.auto_extend || 1;
707 | var region = null;
708 | var rectangle = null;
709 |
710 | //判断城市限定参数
711 | if (options.region) {
712 | region = options.region;
713 | }
714 |
715 | //矩形限定坐标(暂时只支持字符串格式)
716 | if (options.rectangle) {
717 | rectangle = options.rectangle;
718 | }
719 |
720 | var locationsuccess = function (result) {
721 | if (region && !rectangle) {
722 | //城市限定参数拼接
723 | requestParam.boundary = "region(" + region + "," + auto_extend + "," + result.latitude + "," + result.longitude + ")";
724 | if (options.sig) {
725 | requestParam.sig = Utils.getSig(requestParam, options.sig, 'search');
726 | }
727 | } else if (rectangle && !region) {
728 | //矩形搜索
729 | requestParam.boundary = "rectangle(" + rectangle + ")";
730 | if (options.sig) {
731 | requestParam.sig = Utils.getSig(requestParam, options.sig, 'search');
732 | }
733 | } else {
734 | requestParam.boundary = "nearby(" + result.latitude + "," + result.longitude + "," + distance + "," + auto_extend + ")";
735 | if (options.sig) {
736 | requestParam.sig = Utils.getSig(requestParam, options.sig, 'search');
737 | }
738 | }
739 | wx.request(Utils.buildWxRequestConfig(options, {
740 | url: URL_SEARCH,
741 | data: requestParam
742 | }, 'search'));
743 | };
744 | Utils.locationProcess(options, locationsuccess);
745 | };
746 |
747 | /**
748 | * sug模糊检索
749 | *
750 | * @param {Object} options 接口参数对象
751 | *
752 | * 参数对象结构可以参考
753 | * http://lbs.qq.com/webservice_v1/guide-suggestion.html
754 | */
755 | getSuggestion(options) {
756 | var that = this;
757 | options = options || {};
758 | Utils.polyfillParam(options);
759 |
760 | if (!Utils.checkKeyword(options)) {
761 | return;
762 | }
763 |
764 | var requestParam = {
765 | keyword: options.keyword,
766 | region: options.region || '全国',
767 | region_fix: options.region_fix || 0,
768 | policy: options.policy || 0,
769 | page_size: options.page_size || 10,//控制显示条数
770 | page_index: options.page_index || 1,//控制页数
771 | get_subpois : options.get_subpois || 0,//返回子地点
772 | output: 'json',
773 | key: that.key
774 | };
775 | //长地址
776 | if (options.address_format) {
777 | requestParam.address_format = options.address_format;
778 | }
779 | //过滤
780 | if (options.filter) {
781 | requestParam.filter = options.filter;
782 | }
783 | //排序
784 | if (options.location) {
785 | var locationsuccess = function (result) {
786 | requestParam.location = result.latitude + ',' + result.longitude;
787 | if (options.sig) {
788 | requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest');
789 | }
790 | wx.request(Utils.buildWxRequestConfig(options, {
791 | url: URL_SUGGESTION,
792 | data: requestParam
793 | }, "suggest"));
794 | };
795 | Utils.locationProcess(options, locationsuccess);
796 | } else {
797 | if (options.sig) {
798 | requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest');
799 | }
800 | wx.request(Utils.buildWxRequestConfig(options, {
801 | url: URL_SUGGESTION,
802 | data: requestParam
803 | }, "suggest"));
804 | }
805 | };
806 |
807 | /**
808 | * 逆地址解析
809 | *
810 | * @param {Object} options 接口参数对象
811 | *
812 | * 请求参数结构可以参考
813 | * http://lbs.qq.com/webservice_v1/guide-gcoder.html
814 | */
815 | reverseGeocoder(options) {
816 | var that = this;
817 | options = options || {};
818 | Utils.polyfillParam(options);
819 | var requestParam = {
820 | coord_type: options.coord_type || 5,
821 | get_poi: options.get_poi || 0,
822 | output: 'json',
823 | key: that.key
824 | };
825 | if (options.poi_options) {
826 | requestParam.poi_options = options.poi_options
827 | }
828 |
829 | var locationsuccess = function (result) {
830 | requestParam.location = result.latitude + ',' + result.longitude;
831 | if (options.sig) {
832 | requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder');
833 | }
834 | wx.request(Utils.buildWxRequestConfig(options, {
835 | url: URL_GET_GEOCODER,
836 | data: requestParam
837 | }, 'reverseGeocoder'));
838 | };
839 | Utils.locationProcess(options, locationsuccess);
840 | };
841 |
842 | /**
843 | * 地址解析
844 | *
845 | * @param {Object} options 接口参数对象
846 | *
847 | * 请求参数结构可以参考
848 | * http://lbs.qq.com/webservice_v1/guide-geocoder.html
849 | */
850 | geocoder(options) {
851 | var that = this;
852 | options = options || {};
853 | Utils.polyfillParam(options);
854 |
855 | if (Utils.checkParamKeyEmpty(options, 'address')) {
856 | return;
857 | }
858 |
859 | var requestParam = {
860 | address: options.address,
861 | output: 'json',
862 | key: that.key
863 | };
864 |
865 | //城市限定
866 | if (options.region) {
867 | requestParam.region = options.region;
868 | }
869 |
870 | if (options.sig) {
871 | requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder');
872 | }
873 |
874 | wx.request(Utils.buildWxRequestConfig(options, {
875 | url: URL_GET_GEOCODER,
876 | data: requestParam
877 | },'geocoder'));
878 | };
879 |
880 |
881 | /**
882 | * 获取城市列表
883 | *
884 | * @param {Object} options 接口参数对象
885 | *
886 | * 请求参数结构可以参考
887 | * http://lbs.qq.com/webservice_v1/guide-region.html
888 | */
889 | getCityList(options) {
890 | var that = this;
891 | options = options || {};
892 | Utils.polyfillParam(options);
893 | var requestParam = {
894 | output: 'json',
895 | key: that.key
896 | };
897 |
898 | if (options.sig) {
899 | requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList');
900 | }
901 |
902 | wx.request(Utils.buildWxRequestConfig(options, {
903 | url: URL_CITY_LIST,
904 | data: requestParam
905 | },'getCityList'));
906 | };
907 |
908 | /**
909 | * 获取对应城市ID的区县列表
910 | *
911 | * @param {Object} options 接口参数对象
912 | *
913 | * 请求参数结构可以参考
914 | * http://lbs.qq.com/webservice_v1/guide-region.html
915 | */
916 | getDistrictByCityId(options) {
917 | var that = this;
918 | options = options || {};
919 | Utils.polyfillParam(options);
920 |
921 | if (Utils.checkParamKeyEmpty(options, 'id')) {
922 | return;
923 | }
924 |
925 | var requestParam = {
926 | id: options.id || '',
927 | output: 'json',
928 | key: that.key
929 | };
930 |
931 | if (options.sig) {
932 | requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId');
933 | }
934 |
935 | wx.request(Utils.buildWxRequestConfig(options, {
936 | url: URL_AREA_LIST,
937 | data: requestParam
938 | },'getDistrictByCityId'));
939 | };
940 |
941 | /**
942 | * 用于单起点到多终点的路线距离(非直线距离)计算:
943 | * 支持两种距离计算方式:步行和驾车。
944 | * 起点到终点最大限制直线距离10公里。
945 | *
946 | * 新增直线距离计算。
947 | *
948 | * @param {Object} options 接口参数对象
949 | *
950 | * 请求参数结构可以参考
951 | * http://lbs.qq.com/webservice_v1/guide-distance.html
952 | */
953 | calculateDistance(options) {
954 | var that = this;
955 | options = options || {};
956 | Utils.polyfillParam(options);
957 |
958 | if (Utils.checkParamKeyEmpty(options, 'to')) {
959 | return;
960 | }
961 |
962 | var requestParam = {
963 | mode: options.mode || 'walking',
964 | to: Utils.location2query(options.to),
965 | output: 'json',
966 | key: that.key
967 | };
968 |
969 | if (options.from) {
970 | options.location = options.from;
971 | }
972 |
973 | //计算直线距离
974 | if(requestParam.mode == 'straight'){
975 | var locationsuccess = function (result) {
976 | var locationTo = Utils.getEndLocation(requestParam.to);//处理终点坐标
977 | var data = {
978 | message:"query ok",
979 | result:{
980 | elements:[]
981 | },
982 | status:0
983 | };
984 | for (var i = 0; i < locationTo.length; i++) {
985 | data.result.elements.push({//将坐标存入
986 | distance: Utils.getDistance(result.latitude, result.longitude, locationTo[i].lat, locationTo[i].lng),
987 | duration:0,
988 | from:{
989 | lat: result.latitude,
990 | lng:result.longitude
991 | },
992 | to:{
993 | lat: locationTo[i].lat,
994 | lng: locationTo[i].lng
995 | }
996 | });
997 | }
998 | var calculateResult = data.result.elements;
999 | var distanceResult = [];
1000 | for (var i = 0; i < calculateResult.length; i++) {
1001 | distanceResult.push(calculateResult[i].distance);
1002 | }
1003 | return options.success(data,{
1004 | calculateResult: calculateResult,
1005 | distanceResult: distanceResult
1006 | });
1007 | };
1008 |
1009 | Utils.locationProcess(options, locationsuccess);
1010 | } else {
1011 | var locationsuccess = function (result) {
1012 | requestParam.from = result.latitude + ',' + result.longitude;
1013 | if (options.sig) {
1014 | requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance');
1015 | }
1016 | wx.request(Utils.buildWxRequestConfig(options, {
1017 | url: URL_DISTANCE,
1018 | data: requestParam
1019 | },'calculateDistance'));
1020 | };
1021 |
1022 | Utils.locationProcess(options, locationsuccess);
1023 | }
1024 | };
1025 |
1026 | /**
1027 | * 路线规划:
1028 | *
1029 | * @param {Object} options 接口参数对象
1030 | *
1031 | * 请求参数结构可以参考
1032 | * https://lbs.qq.com/webservice_v1/guide-road.html
1033 | */
1034 | direction(options) {
1035 | var that = this;
1036 | options = options || {};
1037 | Utils.polyfillParam(options);
1038 |
1039 | if (Utils.checkParamKeyEmpty(options, 'to')) {
1040 | return;
1041 | }
1042 |
1043 | var requestParam = {
1044 | output: 'json',
1045 | key: that.key
1046 | };
1047 |
1048 | //to格式处理
1049 | if (typeof options.to == 'string') {
1050 | requestParam.to = options.to;
1051 | } else {
1052 | requestParam.to = options.to.latitude + ',' + options.to.longitude;
1053 | }
1054 | //初始化局部请求域名
1055 | var SET_URL_DIRECTION = null;
1056 | //设置默认mode属性
1057 | options.mode = options.mode || MODE.driving;
1058 |
1059 | //设置请求域名
1060 | SET_URL_DIRECTION = URL_DIRECTION + options.mode;
1061 |
1062 | if (options.from) {
1063 | options.location = options.from;
1064 | }
1065 |
1066 | if (options.mode == MODE.driving) {
1067 | if (options.from_poi) {
1068 | requestParam.from_poi = options.from_poi;
1069 | }
1070 | if (options.heading) {
1071 | requestParam.heading = options.heading;
1072 | }
1073 | if (options.speed) {
1074 | requestParam.speed = options.speed;
1075 | }
1076 | if (options.accuracy) {
1077 | requestParam.accuracy = options.accuracy;
1078 | }
1079 | if (options.road_type) {
1080 | requestParam.road_type = options.road_type;
1081 | }
1082 | if (options.to_poi) {
1083 | requestParam.to_poi = options.to_poi;
1084 | }
1085 | if (options.from_track) {
1086 | requestParam.from_track = options.from_track;
1087 | }
1088 | if (options.waypoints) {
1089 | requestParam.waypoints = options.waypoints;
1090 | }
1091 | if (options.policy) {
1092 | requestParam.policy = options.policy;
1093 | }
1094 | if (options.plate_number) {
1095 | requestParam.plate_number = options.plate_number;
1096 | }
1097 | }
1098 |
1099 | if (options.mode == MODE.transit) {
1100 | if (options.departure_time) {
1101 | requestParam.departure_time = options.departure_time;
1102 | }
1103 | if (options.policy) {
1104 | requestParam.policy = options.policy;
1105 | }
1106 | }
1107 |
1108 | var locationsuccess = function (result) {
1109 | requestParam.from = result.latitude + ',' + result.longitude;
1110 | if (options.sig) {
1111 | requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction',options.mode);
1112 | }
1113 | wx.request(Utils.buildWxRequestConfig(options, {
1114 | url: SET_URL_DIRECTION,
1115 | data: requestParam
1116 | }, 'direction'));
1117 | };
1118 |
1119 | Utils.locationProcess(options, locationsuccess);
1120 | }
1121 | };
1122 |
1123 | export default QQMapWX;
1124 | // module.exports = QQMapWX;
1125 |
--------------------------------------------------------------------------------