├── static ├── .gitkeep ├── trangle.png └── seigaiha.png ├── desktop.ini ├── src ├── assets │ ├── logo.jpg │ ├── logo.png │ └── narrowlogo.jpg ├── router │ └── index.js ├── components │ ├── ErrorHandler.vue │ ├── RoadPage │ │ ├── DetailCard │ │ │ ├── RideDetail.vue │ │ │ ├── WalkDetail.vue │ │ │ ├── DriveDetail.vue │ │ │ ├── BusDetail.vue │ │ │ ├── Collapse.vue │ │ │ └── CardCollapse.vue │ │ ├── DayTransmit.vue │ │ ├── Drawer.vue │ │ ├── SearchBar.vue │ │ ├── DetailPath.vue │ │ └── MapContainer.vue │ ├── User.vue │ ├── CheckList.vue │ ├── RoadPage.vue │ ├── NavBar.vue │ └── InitModel.vue ├── App.vue ├── plungins │ └── LeanCloud.js └── main.js ├── config ├── prod.env.js ├── dev.env.js └── index.js ├── dist ├── static │ ├── trangle.png │ ├── seigaiha.png │ ├── fonts │ │ └── element-icons.6f0a763.ttf │ └── js │ │ ├── manifest.012c6502c66441b451fc.js │ │ ├── manifest.012c6502c66441b451fc.js.map │ │ └── app.00ac63e55ffb13d062d8.js └── index.html ├── .editorconfig ├── .gitignore ├── .babelrc ├── .postcssrc.js ├── index.html ├── README.md └── package.json /static/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /desktop.ini: -------------------------------------------------------------------------------- 1 | [ViewState] 2 | Mode= 3 | Vid= 4 | FolderType=Generic 5 | -------------------------------------------------------------------------------- /static/trangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dixeran/RoadMap/HEAD/static/trangle.png -------------------------------------------------------------------------------- /src/assets/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dixeran/RoadMap/HEAD/src/assets/logo.jpg -------------------------------------------------------------------------------- /src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dixeran/RoadMap/HEAD/src/assets/logo.png -------------------------------------------------------------------------------- /static/seigaiha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dixeran/RoadMap/HEAD/static/seigaiha.png -------------------------------------------------------------------------------- /config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /dist/static/trangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dixeran/RoadMap/HEAD/dist/static/trangle.png -------------------------------------------------------------------------------- /dist/static/seigaiha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dixeran/RoadMap/HEAD/dist/static/seigaiha.png -------------------------------------------------------------------------------- /src/assets/narrowlogo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dixeran/RoadMap/HEAD/src/assets/narrowlogo.jpg -------------------------------------------------------------------------------- /dist/static/fonts/element-icons.6f0a763.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Dixeran/RoadMap/HEAD/dist/static/fonts/element-icons.6f0a763.ttf -------------------------------------------------------------------------------- /config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const merge = require('webpack-merge') 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | NODE_ENV: '"development"' 7 | }) 8 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | npm-debug.log* 4 | yarn-debug.log* 5 | yarn-error.log* 6 | 7 | # Editor directories and files 8 | .idea 9 | .vscode 10 | *.suo 11 | *.ntvs* 12 | *.njsproj 13 | *.sln 14 | -------------------------------------------------------------------------------- /.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-vue-jsx", "transform-runtime"] 12 | } 13 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | "postcss-import": {}, 6 | "postcss-url": {}, 7 | // to edit target browsers: use "browserslist" field in package.json 8 | "autoprefixer": {} 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | roadmap 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Router from 'vue-router' 3 | import Checklist from '../components/CheckList' 4 | import Roadpage from '../components/Roadpage' 5 | 6 | Vue.use(Router) 7 | 8 | export default new Router({ 9 | routes: [ 10 | { 11 | path: '/', 12 | name: 'Roadpage', 13 | component: Roadpage, 14 | meta: { 15 | keepAlive: true 16 | } 17 | }, 18 | { 19 | path: '/abstract', 20 | name: 'Abstract', 21 | component: Checklist 22 | } 23 | ], 24 | linkExactActiveClass:'active' 25 | }) 26 | -------------------------------------------------------------------------------- /src/components/ErrorHandler.vue: -------------------------------------------------------------------------------- 1 | 6 | 12 | 13 | 28 | -------------------------------------------------------------------------------- /src/components/RoadPage/DetailCard/RideDetail.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 20 | 21 | 33 | 34 | -------------------------------------------------------------------------------- /src/components/RoadPage/DetailCard/WalkDetail.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 20 | 21 | 33 | 34 | -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | roadmap
-------------------------------------------------------------------------------- /src/components/RoadPage/DetailCard/DriveDetail.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 22 | 23 | 35 | -------------------------------------------------------------------------------- /src/components/RoadPage/DetailCard/BusDetail.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 22 | 23 | 35 | -------------------------------------------------------------------------------- /dist/static/js/manifest.012c6502c66441b451fc.js: -------------------------------------------------------------------------------- 1 | !function(r){var n=window.webpackJsonp;window.webpackJsonp=function(o,u,c){for(var f,p,a,i=0,l=[];i Yet another travel tool 4 | 5 | ## RoadMap 工作流 6 | 1. 去无论什么网站,找出想去的地方 7 | 2. 添加到 RoadMap 中 8 | 3. 使用灰色的脑细胞,观察如何将这些景点安排在不同的日期、在一日内如何排定一个顺序 9 | 4. 分享给你的同伴,或者分享到手机上存一个书签 10 | 5. 走! 11 | 12 | ## RoadMap 的闪光点 13 | ### 在地图上,你甚至只能看到你想要的 14 | ![这是你想要的?](https://i.loli.net/2018/06/03/5b136c82a163d.png) 15 | 精心设计的配色,高亮**景点、商城、酒店、交通线路** 16 | ![这个才是吧!](https://i.loli.net/2018/06/03/5b136c7f39338.png) 17 | 18 | ### 各种出行方式,以及附带的温馨提示 19 | ![动物园的关门时间..](https://i.loli.net/2018/06/03/5b136c7ceba8e.png) 20 | 8102年了,旅行计划也该有详细路线了 21 | 22 | ### 最后,友好的告诉你,菜上齐了 23 | ![路线摘要](https://i.loli.net/2018/06/03/5b136c75c7bc5.png) 24 | 25 | ## 关于云存储 26 | 使用 LeanCloud 储存云端同步信息 27 | 28 | ## Build Setup 29 | 30 | ``` bash 31 | # install dependencies 32 | npm install 33 | 34 | # serve with hot reload at localhost:8080 35 | npm run dev 36 | 37 | # build for production with minification 38 | npm run build 39 | 40 | # build for production and view the bundle analyzer report 41 | npm run build --report 42 | ``` 43 | 44 | For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). 45 | -------------------------------------------------------------------------------- /src/components/User.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 61 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 44 | 45 | 76 | -------------------------------------------------------------------------------- /src/components/RoadPage/DayTransmit.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 33 | 34 | 74 | -------------------------------------------------------------------------------- /src/components/RoadPage/Drawer.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 47 | 48 | 79 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "roadmap", 3 | "version": "1.0.0", 4 | "description": "travel tool", 5 | "author": "dixeran@outlook.com", 6 | "private": true, 7 | "scripts": { 8 | "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", 9 | "start": "npm run dev", 10 | "build": "node build/build.js" 11 | }, 12 | "dependencies": { 13 | "@tweenjs/tween.js": "^17.2.0", 14 | "blueimp-md5": "^2.10.0", 15 | "element-ui": "^2.3.7", 16 | "leancloud-storage": "^3.6.8", 17 | "qrcode": "^1.2.0", 18 | "sortablejs": "^1.7.0", 19 | "vue": "^2.5.2", 20 | "vue-router": "^3.0.1", 21 | "vuex": "^3.0.1" 22 | }, 23 | "devDependencies": { 24 | "autoprefixer": "^7.1.2", 25 | "babel-core": "^6.22.1", 26 | "babel-helper-vue-jsx-merge-props": "^2.0.3", 27 | "babel-loader": "^7.1.1", 28 | "babel-plugin-syntax-jsx": "^6.18.0", 29 | "babel-plugin-transform-runtime": "^6.22.0", 30 | "babel-plugin-transform-vue-jsx": "^3.5.0", 31 | "babel-preset-env": "^1.3.2", 32 | "babel-preset-stage-2": "^6.22.0", 33 | "chalk": "^2.0.1", 34 | "copy-webpack-plugin": "^4.0.1", 35 | "css-loader": "^0.28.0", 36 | "extract-text-webpack-plugin": "^3.0.0", 37 | "file-loader": "^1.1.4", 38 | "friendly-errors-webpack-plugin": "^1.6.1", 39 | "html-webpack-plugin": "^2.30.1", 40 | "node-notifier": "^5.1.2", 41 | "optimize-css-assets-webpack-plugin": "^3.2.0", 42 | "ora": "^1.2.0", 43 | "portfinder": "^1.0.13", 44 | "postcss-import": "^11.0.0", 45 | "postcss-loader": "^2.0.8", 46 | "postcss-url": "^7.2.1", 47 | "rimraf": "^2.6.0", 48 | "semver": "^5.3.0", 49 | "shelljs": "^0.7.6", 50 | "uglifyjs-webpack-plugin": "^1.1.1", 51 | "url-loader": "^0.5.8", 52 | "vue-loader": "^13.3.0", 53 | "vue-style-loader": "^3.0.1", 54 | "vue-template-compiler": "^2.5.2", 55 | "webpack": "^3.6.0", 56 | "webpack-bundle-analyzer": "^2.9.0", 57 | "webpack-dev-server": "^2.9.1", 58 | "webpack-merge": "^4.1.0" 59 | }, 60 | "engines": { 61 | "node": ">= 6.0.0", 62 | "npm": ">= 3.0.0" 63 | }, 64 | "browserslist": [ 65 | "> 1%", 66 | "last 2 versions", 67 | "not ie <= 8" 68 | ] 69 | } 70 | -------------------------------------------------------------------------------- /config/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | // Template version: 1.3.1 3 | // see http://vuejs-templates.github.io/webpack for documentation. 4 | 5 | const path = require('path') 6 | 7 | module.exports = { 8 | dev: { 9 | 10 | // Paths 11 | assetsSubDirectory: 'static', 12 | assetsPublicPath: '/', 13 | proxyTable: {}, 14 | 15 | // Various Dev Server settings 16 | host: 'localhost', // can be overwritten by process.env.HOST 17 | port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined 18 | autoOpenBrowser: false, 19 | errorOverlay: true, 20 | notifyOnErrors: true, 21 | poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- 22 | 23 | 24 | /** 25 | * Source Maps 26 | */ 27 | 28 | // https://webpack.js.org/configuration/devtool/#development 29 | devtool: 'cheap-module-eval-source-map', 30 | 31 | // If you have problems debugging vue-files in devtools, 32 | // set this to false - it *may* help 33 | // https://vue-loader.vuejs.org/en/options.html#cachebusting 34 | cacheBusting: true, 35 | 36 | cssSourceMap: true 37 | }, 38 | 39 | build: { 40 | // Template for index.html 41 | index: path.resolve(__dirname, '../dist/index.html'), 42 | 43 | // Paths 44 | assetsRoot: path.resolve(__dirname, '../dist'), 45 | assetsSubDirectory: 'static', 46 | assetsPublicPath: '/RoadMap/', 47 | 48 | /** 49 | * Source Maps 50 | */ 51 | 52 | productionSourceMap: true, 53 | // https://webpack.js.org/configuration/devtool/#production 54 | devtool: '#source-map', 55 | 56 | // Gzip off by default as many popular static hosts such as 57 | // Surge or Netlify already gzip all static assets for you. 58 | // Before setting to `true`, make sure to: 59 | // npm install --save-dev compression-webpack-plugin 60 | productionGzip: false, 61 | productionGzipExtensions: ['js', 'css'], 62 | 63 | // Run the build command with an extra argument to 64 | // View the bundle analyzer report after build finishes: 65 | // `npm run build --report` 66 | // Set to `true` or `false` to always turn it on or off 67 | bundleAnalyzerReport: process.env.npm_config_report 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/components/RoadPage/SearchBar.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 69 | 70 | 131 | -------------------------------------------------------------------------------- /src/components/RoadPage/DetailCard/Collapse.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 95 | 96 | 114 | -------------------------------------------------------------------------------- /src/components/CheckList.vue: -------------------------------------------------------------------------------- 1 | 36 | 37 | 79 | 80 | 81 | 123 | -------------------------------------------------------------------------------- /src/components/RoadPage/DetailCard/CardCollapse.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | 82 | 83 | 114 | -------------------------------------------------------------------------------- /src/components/RoadPage.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 100 | 101 | 154 | -------------------------------------------------------------------------------- /dist/static/js/manifest.012c6502c66441b451fc.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///webpack/bootstrap d72b6fcfe54e40235f12"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,YAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.012c6502c66441b451fc.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/RoadMap/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap d72b6fcfe54e40235f12"],"sourceRoot":""} -------------------------------------------------------------------------------- /src/components/NavBar.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | 119 | 120 | 190 | -------------------------------------------------------------------------------- /src/plungins/LeanCloud.js: -------------------------------------------------------------------------------- 1 | import AV from 'leancloud-storage'; 2 | import md5 from 'blueimp-md5'; 3 | const LCStorge = { 4 | install: function (Vue, options) { 5 | Vue.mixin({ 6 | data: function () { 7 | return { 8 | lcs: { 9 | Init: function () { 10 | AV.init({ 11 | appId: 'Bc3luL7In6UFyXHh5Vybnavi-gzGzoHsz', 12 | appKey: 'ff359xQsjpOvWjxit9PsffnR' 13 | }); 14 | }, 15 | Login: function (name, passwd) { 16 | return new Promise(function (resolve, reject) { 17 | AV.User.logIn(name, passwd).then(function (loggedInUser) { 18 | console.log('login success:' + loggedInUser); 19 | resolve(); 20 | }, function (error) { 21 | console.warn('login error:' + error); 22 | reject(); 23 | }); 24 | }); 25 | }, 26 | Logout: function () { 27 | AV.User.logOut(); 28 | }, 29 | Signin: function (name, passwd) { 30 | return new Promise(function (resolve, reject) { 31 | // 新建 AVUser 对象实例 32 | let user = new AV.User(); 33 | // 设置用户名 34 | user.setUsername(name); 35 | // 设置密码 36 | user.setPassword(passwd); 37 | // 设置邮箱 38 | user.setEmail(name);//默认用户名为邮箱 39 | user.signUp().then(function (loggedInUser) { 40 | console.log('signin success:' + loggedInUser); 41 | resolve(); 42 | }, function (error) { 43 | console.warn('signin error:' + error); 44 | reject(); 45 | }); 46 | }) 47 | }, 48 | isLogin: function () { 49 | let currentUser = AV.User.current(); 50 | if (currentUser) { 51 | return true; 52 | } 53 | return false; 54 | }, 55 | saveToCloud: function (data) { 56 | return new Promise(function (resolve, reject) { 57 | if (AV.User.current()) { 58 | let user = AV.User.current(); 59 | let query = new AV.Query('roadmap'); 60 | query.equalTo('belong', user); 61 | query.first().then(function (result) { 62 | if (result) {//原本存有数据,更新 63 | console.log('has:' + result); 64 | let myMap = AV.Object.createWithoutData('roadmap', result.id); 65 | myMap.set('data', data); 66 | myMap.save().then(function (obj) { 67 | resolve(obj); 68 | }, function (err) { 69 | console.warn('save err:' + err); 70 | reject(err); 71 | }); 72 | } else {//原本无数据,插入 73 | let RoadMap = AV.Object.extend('roadmap'); 74 | let myMap = new RoadMap(); 75 | let hash = md5(user.getEmail()); 76 | myMap.set('belong', user); 77 | myMap.set('data', data); 78 | myMap.set('hash', hash); 79 | myMap.save().then(function (obj) { 80 | resolve(obj); 81 | }, function (err) { 82 | console.warn('save err:' + err); 83 | reject(err); 84 | }); 85 | } 86 | }, function (error) { 87 | console.log(error); 88 | }); 89 | } 90 | else { 91 | reject(); 92 | } 93 | }); 94 | }, 95 | getDataByEmail: function (email) { 96 | if (!email) {//未从url获取到邮箱 97 | let user = AV.User.current(); 98 | email = md5(user.getEmail()); 99 | } 100 | console.log(email); 101 | return new Promise((resolve, reject) => { 102 | let query = new AV.Query('roadmap'); 103 | query.equalTo('hash', email); 104 | query.first().then(result => { 105 | if (result) { 106 | resolve(result.get('data')); 107 | } 108 | else { 109 | reject('云端不存在的Email'); 110 | } 111 | }, err => { 112 | console.warn('getByEmail error' + err); 113 | reject(err); 114 | }) 115 | }); 116 | }, 117 | getEmail: function () { 118 | let user = AV.User.current(); 119 | if (user) { 120 | return md5(user.getEmail()); 121 | } 122 | return null; 123 | } 124 | } 125 | } 126 | }, 127 | methods: { 128 | test: function () { 129 | console.log('mixin'); 130 | } 131 | } 132 | }); 133 | } 134 | } 135 | 136 | export default LCStorge; 137 | -------------------------------------------------------------------------------- /src/components/InitModel.vue: -------------------------------------------------------------------------------- 1 | 29 | 30 | 156 | 157 | 196 | -------------------------------------------------------------------------------- /src/components/RoadPage/DetailPath.vue: -------------------------------------------------------------------------------- 1 | 71 | 72 | 151 | 152 | 300 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from "vue"; 4 | import Vuex from "vuex"; 5 | import App from "./App"; 6 | import router from "./router"; 7 | 8 | import ElementUI from 'element-ui';//use element-ui 9 | import 'element-ui/lib/theme-chalk/index.css'; 10 | 11 | import LCStorge from './plungins/LeanCloud'//to use Leancloud 12 | 13 | Vue.use(Vuex); 14 | Vue.use(ElementUI); 15 | if (location.search.indexOf('mobile') < 0) { 16 | Vue.mixin({ 17 | data: function () { 18 | return { 19 | isMobile: false 20 | } 21 | } 22 | }); 23 | } else { 24 | let hash = location.search.match(/email=(\w+)/)[1]; 25 | Vue.mixin({ 26 | data: function () { 27 | return { 28 | isMobile: true, 29 | email: hash 30 | } 31 | } 32 | }) 33 | } 34 | Vue.use(LCStorge); 35 | Vue.config.productionTip = false; 36 | /*{ 37 | id: '',//唯一ID 38 | detail: {},//PlaceSearch对象 39 | marker: '',//点标记对象 40 | transfer: { 41 | type: '',//换乘类型 42 | index: number, //换乘方案索引 43 | plan: {},//换乘方案对象 44 | routes:[{}],//换乘绘制路线 45 | kit:{}//换乘搜索对象 46 | } 47 | }*/ 48 | const store = new Vuex.Store({ 49 | state: { 50 | city: "", 51 | totalDays: 1, 52 | nowDay: 0, 53 | POIs: [[]], 54 | /*地点搜索*/ 55 | AMap_PlaceSearch: { 56 | config: { 57 | city: "全国", 58 | extensions: 'all' 59 | }, 60 | search: {} 61 | }, 62 | /*驾车规划*/ 63 | AMap_Driving: { 64 | policy: AMap.DrivingPolicy.LEAST_TIME, 65 | hideMarkers: true, 66 | autoFitView: false, 67 | showTraffic: false 68 | }, 69 | /*公交规划*/ 70 | AMap_Bus: { 71 | city: '', 72 | hideMarkers: true, 73 | autoFitView: false 74 | }, 75 | AMap_Ride: { 76 | hideMarkers: true, 77 | autoFitView: false 78 | }, 79 | AMap_Walk: { 80 | hideMarkers: true, 81 | autoFitView: false 82 | }, 83 | storge: { 84 | toCloud: false, 85 | localData: '' 86 | } 87 | }, 88 | mutations: { 89 | /**@description 设置PlaceSearch插件 90 | * @param {AMap.PlaceSearch} target 插件对象 91 | */ 92 | setPlaceSearch(state, target) { 93 | console.log(target); 94 | state.AMap_PlaceSearch.config = target.config; 95 | state.AMap_PlaceSearch.search = target.search; 96 | }, 97 | /** 98 | * @description 使天数+1 99 | */ 100 | addNewDay(state) { 101 | state.totalDays++; 102 | state.POIs.push([]); 103 | }, 104 | /** 105 | * @description 切换当前天数 106 | * @param {number} d 切换到d天(数组编号) 107 | */ 108 | switchDay(state, d) { 109 | if (d < state.totalDays && d >= 0) { 110 | let nowP = state.POIs[state.nowDay]; 111 | for (var i = 0; i < nowP.length; i++) { 112 | nowP[i].marker.hide(); //hide marker 113 | if (nowP[i].transfer) { 114 | for (let z = 0; z < nowP[i].transfer.routes.length; z++) { 115 | nowP[i].transfer.routes[z].hide(); //hide path 116 | } 117 | } 118 | } 119 | let newP = state.POIs[d]; 120 | for (var j = 0; j < newP.length; j++) { 121 | newP[j].marker.show(); //show marker 122 | if (newP[j].transfer) { 123 | for (let z = 0; z < newP[j].transfer.routes.length; z++) { 124 | newP[j].transfer.routes[z].show(); //hide path 125 | } 126 | } 127 | } 128 | state.nowDay = d; 129 | } 130 | }, 131 | /** 132 | * @description 删除特定的天数 133 | * @param {number} d 删除第d天(数组编号) 134 | */ 135 | deleteDay(state, d) { 136 | if (d < state.totalDays && d >= 0) { 137 | for (let t = 0; t < state.POIs[d].length; t++) { 138 | state.POIs[d][t].marker.hide(); //hide markers 139 | if (state.POIs[d][t].transfer) 140 | state.POIs[d][t].transfer.routes.hide(); //hide path 141 | } 142 | state.POIs.splice(d, 1); 143 | state.totalDays--; 144 | if (state.nowDay == d) { 145 | if (state.nowDay > 0) state.nowDay--; 146 | for (let i = 0; i < state.POIs[state.nowDay].length; i++) { 147 | state.POIs[state.nowDay][i].marker.show(); 148 | if (state.POIs[state.nowDay][i].transfer) { 149 | state.POIs[state.nowDay][i].transfer.routes.show(); 150 | } 151 | } 152 | } 153 | } 154 | }, 155 | /** 156 | * @description 添加POI到数据集 157 | * @param {object} payload 158 | * @param {object} payload.data 数据 159 | * @param {number} payload.dayTo 可选,添加到的天 160 | */ 161 | addPOIFromMap(state, payload) { 162 | if (!payload.dayTo) { 163 | state.POIs[state.nowDay].push(payload.data); 164 | } 165 | else state.POIs[payload.dayTo].push(payload.data);//move to 166 | }, 167 | /** 168 | * @description 更新POI出行方案,替换整个transfer对象 169 | * @param {object} payload 170 | * @param {number} payload.index POI当日索引 171 | * @param {object} payload.newTransfer POI新transfer 172 | */ 173 | updateTransferPlan: function (state, payload) { 174 | if (state.POIs[state.nowDay][payload.index].transfer) { 175 | let route = state.POIs[state.nowDay][payload.index].transfer.routes; 176 | for (let i = 0; i < route.length; i++) { 177 | route[i].hide(); 178 | } 179 | } 180 | state.POIs[state.nowDay][payload.index].transfer = payload.newTransfer; 181 | }, 182 | /** 183 | * @description 更新POI出行方案索引 184 | * @param {object} payload 185 | * @param {number} payload.index POI当日索引 186 | * @param {object} payload.newRoutes POI新transfer.routes 187 | * @param {number} payload.transferIndex POI出行方案索引 188 | */ 189 | updateTransferIndex: function (state, payload) { 190 | if (state.POIs[state.nowDay][payload.index].transfer) { 191 | let route = state.POIs[state.nowDay][payload.index].transfer.routes; 192 | for (let i = 0; i < route.length; i++) { 193 | route[i].hide(); 194 | } 195 | } 196 | let item = state.POIs[state.nowDay][payload.index]; 197 | state.POIs[state.nowDay][payload.index].transfer.routes = payload.newRoutes; 198 | state.POIs[state.nowDay][payload.index].transfer.index = payload.transferIndex; 199 | }, 200 | /** 201 | * @description 从nowday删除index 202 | * @param {number} index 待删除POI索引 203 | */ 204 | wipe: function (state, index) { 205 | state.POIs[state.nowDay].splice(index, 1); 206 | }, 207 | /** 208 | * @description 当天内移动节点顺序 209 | * @param {object} payload 210 | * @param {number} payload.oldIndex 节点旧索引 211 | * @param {number} payload.newIndex 节点新索引 212 | */ 213 | sortItem: function (state, payload) { 214 | let nowDay = state.POIs[state.nowDay]; 215 | nowDay.splice(payload.newIndex, 0, nowDay.splice(payload.oldIndex, 1)[0]); 216 | }, 217 | /** 218 | * @description 设置存储至本地或云 219 | * @param {bool} isCloud 是否上云 220 | */ 221 | setStorgeType: function (state, isCloud) { 222 | state.storge.toCloud = isCloud; 223 | } 224 | }, 225 | actions: { 226 | addPOIFromMap(context, payload) { 227 | return new Promise(function (resolve, reject) { 228 | if (!payload.data.detail) {//no detail 229 | context.state.AMap_PlaceSearch.search.getDetails(payload.data.id, function ( 230 | status, 231 | result 232 | ) { 233 | if (status == "complete") { 234 | payload.data.detail = result.poiList.pois[0]; 235 | context.commit("addPOIFromMap", payload); 236 | } else { 237 | console.log(result); 238 | context.commit("addPOIFromMap", payload); 239 | } 240 | resolve(); 241 | }); 242 | } 243 | else {//already exist data 244 | context.commit("addPOIFromMap", payload); 245 | resolve(); 246 | } 247 | }); 248 | } 249 | }, 250 | getters: { 251 | /** 252 | * @description 生成导出到持久化的数据 253 | */ 254 | exportData: state => { 255 | let data = {}; 256 | data.city = state.city; 257 | data.totalDays = state.totalDays; 258 | let ar = []; 259 | for (let i = 0; i < state.totalDays; i++) { 260 | ar.push([]); 261 | for (let j = 0; j < state.POIs[i].length; j++) { 262 | let poi = state.POIs[i][j]; 263 | ar[i].push({ 264 | id: poi.detail.id, 265 | transfer: poi.transfer ? { 266 | type: poi.transfer.type, 267 | index: poi.transfer.index 268 | } : null 269 | }); 270 | } 271 | } 272 | data.POIs = ar; 273 | return data; 274 | } 275 | } 276 | }); 277 | 278 | /* eslint-disable no-new */ 279 | new Vue({ 280 | el: "#app", 281 | router, 282 | store, 283 | components: { App }, 284 | template: "" 285 | }); 286 | -------------------------------------------------------------------------------- /src/components/RoadPage/MapContainer.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 604 | 605 | 660 | -------------------------------------------------------------------------------- /dist/static/js/app.00ac63e55ffb13d062d8.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([1],{"1Ivt":function(t,e){},"2wgI":function(t,e){},Bd54:function(t,e){},Gre8:function(t,e){},JMyr:function(t,e){},K11V:function(t,e){},NHnr:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n("rVsN"),i=n.n(a),s=n("MVMM"),r=n("9rMa"),o=n("3cXf"),l=n.n(o),c=n("CkgV"),d=n.n(c),u={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"User"}},[n("el-alert",{directives:[{name:"show",rawName:"v-show",value:""!=t.error,expression:"error != ''"}],attrs:{title:"登录/注册错误",type:"error",description:t.error,"show-icon":""}}),t._v(" "),n("el-form",{ref:"form",attrs:{model:t.form}},[n("el-form-item",{attrs:{label:"邮箱"}},[n("el-input",{model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),t._v(" "),n("el-form-item",{attrs:{label:"密码"}},[n("el-input",{attrs:{type:"password"},model:{value:t.form.passwd,callback:function(e){t.$set(t.form,"passwd",e)},expression:"form.passwd"}})],1),t._v(" "),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:t.login}},[t._v("登录")]),t._v(" "),n("el-button",{on:{click:t.signin}},[t._v("注册")])],1)],1)],1)},staticRenderFns:[]},f=n("Z0/y")({name:"User",data:function(){return{form:{name:"",passwd:""},error:""}},methods:{login:function(){var t=this;this.lcs.Login(this.form.name,this.form.passwd).then(function(){t.$emit("login")}).catch(function(){t.error="登录出错!"})},signin:function(){var t=this;this.lcs.Signin(this.form.name,this.form.passwd).then(function(){t.$emit("login")}).catch(function(){t.error="注册失败耶"})}}},u,!1,null,null,null).exports,p={name:"Navbar",components:{User:f},data:function(){return{dialogVisible:!1,loading:!1,mycode:!1}},methods:{storgeStateChange:function(t){t?this.lcs.isLogin()?this.login_success():(this.dialogVisible=!0,this.$store.state.storge.toCloud=!1):this.$store.state.storge.toCloud=!1},login_success:function(){this.$store.state.storge.toCloud=!0},save:function(){var t=this;this.loading=!0,window.localStorage?(localStorage.setItem("roadmap",l()(this.$store.getters.exportData)),console.log(localStorage.getItem("roadmap")),this.$store.state.storge.toCloud?this.lcs.saveToCloud(l()(this.$store.getters.exportData)).then(function(e){console.log(e),t.loading=!1}).catch(function(e){console.log(e),t.loading=!1}):this.loading=!1):(this.$message({message:"保存需要使用localstorge",type:"error"}),this.loading=!1)},showCode:function(){var t=this;setTimeout(function(){var e=document.getElementById("qrcode");d.a.toCanvas(e,"https://dixeran.github.io/RoadMap/?type=mobile&email="+t.lcs.getEmail()+"/",function(t){t&&console.error(t),console.log("success!")})},100)}}},v={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"Navbar"}},[t._m(0),t._v(" "),t.isMobile?t._e():n("ul",{attrs:{id:"navlist"}},[n("router-link",{attrs:{to:"/"}},[t._v("路径规划")]),t._v(" "),n("router-link",{attrs:{to:"/abstract"}},[t._v("行程概览")])],1),t._v(" "),t.isMobile?t._e():n("input",{directives:[{name:"model",rawName:"v-model",value:t.$store.state.city,expression:"$store.state.city"}],class:""==t.$store.state.city?"unName":"",attrs:{id:"cityName",type:"text",placeholder:"输入城市名"},domProps:{value:t.$store.state.city},on:{input:function(e){e.target.composing||t.$set(t.$store.state,"city",e.target.value)}}}),t._v(" "),t.isMobile?t._e():n("el-popover",{attrs:{placement:"top-start",trigger:"hover"}},[n("el-switch",{attrs:{"active-text":"保存至云端",value:t.$store.state.storge.toCloud},on:{change:t.storgeStateChange}}),t._v(" "),t.$store.state.storge.toCloud?n("el-button",{on:{click:function(e){t.mycode=!0}}},[t._v("生成分享二维码")]):t._e(),t._v(" "),n("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{slot:"reference",icon:"el-icon-upload",circle:""},on:{click:t.save},slot:"reference"})],1),t._v(" "),n("el-dialog",{attrs:{title:"登录/注册",visible:t.dialogVisible},on:{"update:visible":function(e){t.dialogVisible=e}}},[n("User",{on:{login:function(e){t.dialogVisible=!1,t.login_success()}}})],1),t._v(" "),n("el-dialog",{attrs:{title:"分享二维码",visible:t.mycode},on:{"update:visible":function(e){t.mycode=e},open:t.showCode}},[n("canvas",{attrs:{id:"qrcode"}})])],1)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{attrs:{id:"logo"}},[e("span",[this._v("RoadMap")])])}]};var m={render:function(){var t=this.$createElement;return(this._self._c||t)("div",{attrs:{id:"Errorhandler"}},[this._v("\n "+this._s(this.errorData)+"\n")])},staticRenderFns:[]};var h={name:"Initmodel",components:{User:f},data:function(){return{init:!1,val:[],option:[],props:{label:"name",value:"name",children:"districtList"},dialogVisible:!1}},created:function(){this.lcs.Init()},mounted:function(){var t=this;AMap.service("AMap.DistrictSearch",function(){new AMap.DistrictSearch({level:"country",subdistrict:2}).search("中国",function(e,n){t.formatArray(n.districtList[0].districtList),t.option=n.districtList[0].districtList})}),this.isMobile&&this.importCloud(this.email)},methods:{formatArray:function(t){var e=this;t.forEach(function(t){t.districtList&&0!=t.districtList.length&&"district"!=t.districtList[0].level?e.formatArray(t.districtList):t.districtList=null,t.label=t.value=t.name,t.children=t.districtList})},importLocal:function(){var t=JSON.parse(localStorage.getItem("roadmap"));t?(this.$store.state.storge.localData=t,this.$store.state.city=t.city,this.$store.state.AMap_Bus.city=t.city,this.$store.state.AMap_PlaceSearch.config.city=t.city,this.init=!0,this.$emit("init")):this.$emit("error","数据不存在")},importCloud:function(t){var e=this;this.lcs.getDataByEmail(t).then(function(t){var n=JSON.parse(t);e.$store.state.storge.localData=n,e.$store.state.city=n.city,e.$store.state.AMap_Bus.city=n.city,e.$store.state.storge.toCloud=!0,e.$store.state.AMap_PlaceSearch.config.city=n.city,e.init=!0,e.$emit("init")}).catch(function(t){e.$emit("error",t)})},importUser:function(){this.lcs.isLogin()?this.importCloud():this.dialogVisible=!0}},watch:{val:function(){var t=this.val[this.val.length-1];this.$store.state.city=t,this.$store.state.AMap_Bus.city=t;var e=this.$store.state.AMap_PlaceSearch.config;e.city=t;var n=new AMap.PlaceSearch(e);this.$store.commit("setPlaceSearch",{config:e,search:n}),this.init=!0,this.$emit("init")}}},_={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.init?t._e():n("div",{attrs:{id:"Initmodel"}},[n("div",{attrs:{id:"container"}},[n("div",{attrs:{id:"select"}},[n("h1",[t._v("去哪?(・ω´・ )")]),t._v(" "),n("div",{attrs:{id:"select-or"}},[n("el-cascader",{attrs:{options:t.option,size:"medium"},model:{value:t.val,callback:function(e){t.val=e},expression:"val"}})],1)]),t._v(" "),n("div",{attrs:{id:"import"}},[n("h1",[t._v("导入!")]),t._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:t.importLocal}},[t._v("本地导入")]),t._v(" "),n("el-button",{attrs:{plain:""},on:{click:t.importUser}},[t._v("云端导入")])],1)]),t._v(" "),n("el-dialog",{attrs:{title:"登录/注册",modal:!1,visible:t.dialogVisible},on:{"update:visible":function(e){t.dialogVisible=e}}},[n("User",{on:{login:function(e){t.dialogVisible=!1,t.importUser()}}})],1)],1)},staticRenderFns:[]};var g={name:"App",components:{Navbar:n("Z0/y")(p,v,!1,function(t){n("K11V")},"data-v-06ae0bf8",null).exports,Errorhandler:n("Z0/y")({name:"Errorhandler",props:["errorData"]},m,!1,function(t){n("zpZT")},"data-v-0ea0fdf0",null).exports,Initmodel:n("Z0/y")(h,_,!1,function(t){n("VMY/")},"data-v-7d9285fd",null).exports},methods:{errorConfirmed:function(t){this.error=""},HandleError:function(t){this.$notify.error({title:"错误",message:t})}},data:function(){return{error:"",init:!1}}},y={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("Initmodel",{on:{init:function(e){t.init=!0},error:t.HandleError}}),t._v(" "),n("Navbar"),t._v(" "),n("transition",{attrs:{name:"slide"}},[""!=t.error?n("Errorhandler",{attrs:{errorData:t.error},nativeOn:{click:function(e){return t.errorConfirmed(e)}}}):t._e()],1),t._v(" "),t.init?n("keep-alive",{attrs:{include:"Roadpage"},on:{error:t.HandleError}},[n("router-view")],1):t._e()],1)},staticRenderFns:[]};var w=n("Z0/y")(g,y,!1,function(t){n("m95v")},null,null).exports,$=n("zO6J"),I={name:"Checklist",mounted:function(){var t=this,e=new XMLHttpRequest;e.open("get","https://v1.hitokoto.cn/?c=d"),e.onreadystatechange=function(){if(4===e.readyState){var n=JSON.parse(e.responseText);"。"==n.hitokoto[n.hitokoto.length-1]&&(n.hitokoto=n.hitokoto.substring(0,n.hitokoto.length-1)),t.hitokoto=n}},e.send()},data:function(){return{hitokoto:{}}},methods:{getDailyCost:function(t){t=this.$store.state.POIs[t];for(var e=0,n=0;n0?t.suggests=n.poiList.pois:console.log(n)})}}},methods:{searchChecked:function(t){var e={id:t.id,name:t.name,lnglat:t.location,type:t.type};this.$emit("searchChecked",e),this.keyWord=""}}},X={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"Searchbar"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.keyWord,expression:"keyWord"}],attrs:{type:"search",name:"searchPOI",id:"searchTile",placeholder:"搜索景点.."},domProps:{value:t.keyWord},on:{input:function(e){e.target.composing||(t.keyWord=e.target.value)}}}),t._v(" "),n("transition",{attrs:{name:"list"}},[""!=t.keyWord?n("div",{attrs:{id:"searchResult"}},[n("ul",[t._l(t.suggests,function(e){return[n("div",{key:e.id,staticClass:"suggest",on:{click:function(n){t.searchChecked(e)}}},[n("span",{attrs:{type:"name"}},[t._v(t._s(e.name))]),t._v(" "),n("span",{attrs:{type:"location"}},[t._v(t._s(e.address))])])]})],2)]):t._e()])],1)},staticRenderFns:[]};var G=n("Z0/y")(z,X,!1,function(t){n("kK4M")},"data-v-5c597b58",null).exports,K=(n("i8gr"),{name:"Mapcontainer",components:{Searchbar:G},data:function(){return{count:0,map:{}}},created:function(){var t=this;this.$parent.$on("updateTransferPlan",function(e,n){var a=t.$store.state.POIs[t.$store.state.nowDay][e-1].detail.location,i=t.$store.state.POIs[t.$store.state.nowDay][e].detail.location;t.createTransferObj(a,i,n).then(function(n){t.$store.commit({type:"updateTransferPlan",newTransfer:n,index:e})})}),this.$parent.$on("updateTransferIndex",function(e,n){t.updateTransferIndex(e,n)}),this.$parent.$on("setCenter",function(e){var n=t.$store.state.POIs[t.$store.state.nowDay][e].marker.getPosition();t.map.panTo(n)}),this.$parent.$on("moveTo",function(e,n){var a=t.$store.state.POIs[t.$store.state.nowDay][e];a.marker.hide();for(var i=0;a.transfer&&i '+t.name+'
';e.innerHTML+=n;var a=this;e.querySelector("#infoAction").onclick=function(e){a.addPOIToData(t)},new AMap.InfoWindow({isCustom:!0,content:e,offset:new AMap.Pixel(0,-10),closeWhenClickMap:!0,autoMove:!0}).open(this.map,t.lnglat)},drawResultOnMap:function(t,e,n){var a=[];if("driving"===n){for(var i=[],s=0;s0?this.createTransferObj(r[r.length-1].detail.location,t.lnglat,"driving").then(function(t){console.log(t),o.transfer=t,i.$store.dispatch({type:"addPOIFromMap",data:o}),i.$emit("setLoading",!1)}).catch(function(t){console.log(t)}):i.$store.dispatch({type:"addPOIFromMap",data:o})},updateTransferIndex:function(t,e){var n=this.$store.state.POIs[this.$store.state.nowDay][t].transfer,a=this.drawResultOnMap(n.plan,e,n.type);this.$store.commit({type:"updateTransferIndex",newRoutes:a,index:t,transferIndex:e})}}}),Y={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{attrs:{id:"Mapcontainer"}},[e("div",{attrs:{id:"map"}}),this._v(" "),this.isMobile?this._e():e("Searchbar",{on:{searchChecked:this.createInfoWindow}})],1)},staticRenderFns:[]};var Q={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"Daytransmit"}},[n("div",{staticClass:"header"},[t._v("拖动至此处分发到其他日期")]),t._v(" "),n("ul",t._l(t.$store.state.totalDays,function(e){return e-1!=t.$store.state.nowDay?n("div",{key:e,staticClass:"item",attrs:{dayIndex:e-1},on:{dragover:function(t){t.preventDefault()},drop:function(e){e.preventDefault(),t.moveTo(e)}}},[1==e||e-2==t.$store.state.nowDay&&e-1==1?t._e():n("div",{staticClass:"item-line"}),t._v(" "),n("i",{staticClass:"item-icon iconfont icon-right"}),t._v("\n 第"+t._s(e)+"天\n ")]):t._e()}))])},staticRenderFns:[]};var tt={name:"Drawer",props:["width","enable"],data:function(){return{leftMargin:0}},watch:{enable:function(t){if(t){new E.a.Tween(this).to({leftMargin:-this.width},150).start(),function t(){requestAnimationFrame(t),E.a.update()}()}else{new E.a.Tween(this).to({leftMargin:0},150).start(),function t(){requestAnimationFrame(t),E.a.update()}()}}}},et={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{style:{width:t.width+"px",marginLeft:t.leftMargin+"px"},attrs:{id:"Drawer"}},[n("div",{attrs:{id:"content"}},[t._t("default")],2),t._v(" "),n("transition",{attrs:{name:"fade"}},[t.enable?n("div",{attrs:{id:"mask"},on:{click:function(e){t.$emit("close")}}}):t._e()])],1)},staticRenderFns:[]};var nt={name:"Roadpage",components:{Detailpath:V,Mapcontainer:n("Z0/y")(K,Y,!1,function(t){n("nIIM")},null,null).exports,Daytransmit:n("Z0/y")({name:"Daytransmit",data:function(){return{}},methods:{moveTo:function(t){var e=t.dataTransfer.getData("ItemIndex");this.$emit("moveTo",e,t.target.getAttribute("dayIndex"))}}},Q,!1,function(t){n("UFyb")},"data-v-002b6210",null).exports,Drawer:n("Z0/y")(tt,et,!1,function(t){n("rt9+")},"data-v-36649872",null).exports},data:function(){return{onDrag:!1,loading:!1,drawerOpen:!1}},methods:{updateTransferPlan:function(t,e){this.$emit("updateTransferPlan",t,e)},updateTransferIndex:function(t,e){this.$emit("updateTransferIndex",t,e)},setCenter:function(t){this.$emit("setCenter",t)},moveTo:function(t,e){this.$emit("moveTo",t,e)},sort:function(t,e){this.$emit("sort",t,e)},setLoading:function(t){this.loading=t}}},at={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"Roadpage"}},[n("Mapcontainer",{directives:[{name:"loading",rawName:"v-loading.fullscreen.lock",value:t.loading,expression:"loading",modifiers:{fullscreen:!0,lock:!0}}],on:{setLoading:t.setLoading}}),t._v(" "),t.onDrag?n("Daytransmit",{on:{moveTo:t.moveTo}}):t._e(),t._v(" "),t.isMobile?t._e():n("Detailpath",{on:{updateTransferPlan:t.updateTransferPlan,updateTransferIndex:t.updateTransferIndex,setCenter:t.setCenter,moveTo:t.moveTo,drag:function(e){t.onDrag=!t.onDrag},sort:t.sort}}),t._v(" "),t.isMobile?n("Drawer",{attrs:{width:300,enable:t.drawerOpen},on:{close:function(e){t.drawerOpen=!1}}},[n("Detailpath",{on:{updateTransferPlan:t.updateTransferPlan,updateTransferIndex:t.updateTransferIndex,setCenter:t.setCenter,moveTo:t.moveTo,drag:function(e){t.onDrag=!t.onDrag},sort:t.sort}})],1):t._e(),t._v(" "),t.isMobile?n("div",{attrs:{id:"footer"},on:{click:function(e){t.drawerOpen=!0}}},[n("i",{staticClass:"iconfont icon-menu"})]):t._e()],1)},staticRenderFns:[]};var it=n("Z0/y")(nt,at,!1,function(t){n("JMyr")},"data-v-440e50be",null).exports;s.default.use($.a);var st=new $.a({routes:[{path:"/",name:"Roadpage",component:it,meta:{keepAlive:!0}},{path:"/abstract",name:"Abstract",component:P}],linkExactActiveClass:"active"}),rt=n("UM93"),ot=n.n(rt),lt=(n("bTWF"),n("JnRc")),ct=n.n(lt),dt=n("AJcs"),ut=n.n(dt),ft={install:function(t,e){t.mixin({data:function(){return{lcs:{Init:function(){ct.a.init({appId:"Bc3luL7In6UFyXHh5Vybnavi-gzGzoHsz",appKey:"ff359xQsjpOvWjxit9PsffnR"})},Login:function(t,e){return new i.a(function(n,a){ct.a.User.logIn(t,e).then(function(t){console.log("login success:"+t),n()},function(t){console.warn("login error:"+t),a()})})},Logout:function(){ct.a.User.logOut()},Signin:function(t,e){return new i.a(function(n,a){var i=new ct.a.User;i.setUsername(t),i.setPassword(e),i.setEmail(t),i.signUp().then(function(t){console.log("signin success:"+t),n()},function(t){console.warn("signin error:"+t),a()})})},isLogin:function(){return!!ct.a.User.current()},saveToCloud:function(t){return new i.a(function(e,n){if(ct.a.User.current()){var a=ct.a.User.current(),i=new ct.a.Query("roadmap");i.equalTo("belong",a),i.first().then(function(i){if(i){console.log("has:"+i);var s=ct.a.Object.createWithoutData("roadmap",i.id);s.set("data",t),s.save().then(function(t){e(t)},function(t){console.warn("save err:"+t),n(t)})}else{var r=new(ct.a.Object.extend("roadmap")),o=ut()(a.getEmail());r.set("belong",a),r.set("data",t),r.set("hash",o),r.save().then(function(t){e(t)},function(t){console.warn("save err:"+t),n(t)})}},function(t){console.log(t)})}else n()})},getDataByEmail:function(t){if(!t){var e=ct.a.User.current();t=ut()(e.getEmail())}return console.log(t),new i.a(function(e,n){var a=new ct.a.Query("roadmap");a.equalTo("hash",t),a.first().then(function(t){t?e(t.get("data")):n("云端不存在的Email")},function(t){console.warn("getByEmail error"+t),n(t)})})},getEmail:function(){var t=ct.a.User.current();return t?ut()(t.getEmail()):null}}}},methods:{test:function(){console.log("mixin")}}})}};if(s.default.use(r.a),s.default.use(ot.a),location.search.indexOf("mobile")<0)s.default.mixin({data:function(){return{isMobile:!1}}});else{var pt=location.search.match(/email=(\w+)/)[1];s.default.mixin({data:function(){return{isMobile:!0,email:pt}}})}s.default.use(ft),s.default.config.productionTip=!1;var vt=new r.a.Store({state:{city:"",totalDays:1,nowDay:0,POIs:[[]],AMap_PlaceSearch:{config:{city:"全国",extensions:"all"},search:{}},AMap_Driving:{policy:AMap.DrivingPolicy.LEAST_TIME,hideMarkers:!0,autoFitView:!1,showTraffic:!1},AMap_Bus:{city:"",hideMarkers:!0,autoFitView:!1},AMap_Ride:{hideMarkers:!0,autoFitView:!1},AMap_Walk:{hideMarkers:!0,autoFitView:!1},storge:{toCloud:!1,localData:""}},mutations:{setPlaceSearch:function(t,e){console.log(e),t.AMap_PlaceSearch.config=e.config,t.AMap_PlaceSearch.search=e.search},addNewDay:function(t){t.totalDays++,t.POIs.push([])},switchDay:function(t,e){if(e=0){for(var n=t.POIs[t.nowDay],a=0;a=0){for(var n=0;n0&&t.nowDay--;for(var a=0;a"})},UFyb:function(t,e){},"VMY/":function(t,e){},XYzH:function(t,e){},bTWF:function(t,e){},eM5G:function(t,e){},gmXR:function(t,e){},kK4M:function(t,e){},m95v:function(t,e){},nIIM:function(t,e){},"rt9+":function(t,e){},x8bm:function(t,e){},zpZT:function(t,e){}},["NHnr"]); 2 | //# sourceMappingURL=app.00ac63e55ffb13d062d8.js.map --------------------------------------------------------------------------------