x1ongzhu 6 лет назад
Родитель
Сommit
5059598793
7 измененных файлов с 1244 добавлено и 667 удалено
  1. 41 41
      build/webpack.base.conf.js
  2. 585 7
      package-lock.json
  3. 4 2
      package.json
  4. 5 4
      src/components/preview/index.js
  5. 105 107
      src/components/preview/main.vue
  6. 28 31
      src/main.js
  7. 476 475
      src/pages/Home.vue

+ 41 - 41
build/webpack.base.conf.js

@@ -3,7 +3,7 @@ const path = require('path')
 const utils = require('./utils')
 const config = require('../config')
 const vueLoaderConfig = require('./vue-loader.conf')
-
+require('babel-polyfill')
 function resolve(dir) {
     return path.join(__dirname, '..', dir)
 }
@@ -13,7 +13,7 @@ function resolve(dir) {
 module.exports = {
     context: path.resolve(__dirname, '../'),
     entry: {
-        app: './src/main.js'
+        app: ['babel-polyfill', './src/main.js']
     },
     output: {
         path: config.build.assetsRoot,
@@ -30,46 +30,46 @@ module.exports = {
     },
     module: {
         rules: [{
-                test: /\.vue$/,
-                loader: 'vue-loader',
-                options: vueLoaderConfig
-            },
-            {
-                test: /\.js$/,
-                loader: 'babel-loader',
-                include: [
-                    resolve('src'),
-                    resolve('test'),
-                    resolve('node_modules/webpack-dev-server/client'),
-                    resolve('node_modules/swiper'),
-                    resolve('node_modules/dom7'),
-                    resolve('node_modules/ssr-window')
-                ]
-            },
-            {
-                test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
-                loader: 'url-loader',
-                options: {
-                    limit: 10000,
-                    name: utils.assetsPath('img/[name].[hash:7].[ext]')
-                }
-            },
-            {
-                test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
-                loader: 'url-loader',
-                options: {
-                    limit: 10000,
-                    name: utils.assetsPath('media/[name].[hash:7].[ext]')
-                }
-            },
-            {
-                test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
-                loader: 'url-loader',
-                options: {
-                    limit: 10000,
-                    name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
-                }
+            test: /\.vue$/,
+            loader: 'vue-loader',
+            options: vueLoaderConfig
+        },
+        {
+            test: /\.js$/,
+            loader: 'babel-loader',
+            include: [
+                resolve('src'),
+                resolve('test'),
+                resolve('node_modules/webpack-dev-server/client'),
+                resolve('node_modules/swiper'),
+                resolve('node_modules/dom7'),
+                resolve('node_modules/ssr-window')
+            ]
+        },
+        {
+            test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
+            loader: 'url-loader',
+            options: {
+                limit: 10000,
+                name: utils.assetsPath('img/[name].[hash:7].[ext]')
+            }
+        },
+        {
+            test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
+            loader: 'url-loader',
+            options: {
+                limit: 10000,
+                name: utils.assetsPath('media/[name].[hash:7].[ext]')
             }
+        },
+        {
+            test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
+            loader: 'url-loader',
+            options: {
+                limit: 10000,
+                name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
+            }
+        }
         ]
     },
     node: {

+ 585 - 7
package-lock.json

@@ -1007,6 +1007,23 @@
         "esutils": "^2.0.2"
       }
     },
+    "babel-polyfill": {
+      "version": "6.26.0",
+      "resolved": "http://registry.npm.taobao.org/babel-polyfill/download/babel-polyfill-6.26.0.tgz",
+      "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=",
+      "requires": {
+        "babel-runtime": "^6.26.0",
+        "core-js": "^2.5.0",
+        "regenerator-runtime": "^0.10.5"
+      },
+      "dependencies": {
+        "regenerator-runtime": {
+          "version": "0.10.5",
+          "resolved": "http://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.10.5.tgz",
+          "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg="
+        }
+      }
+    },
     "babel-preset-env": {
       "version": "1.7.0",
       "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz",
@@ -1101,7 +1118,6 @@
       "version": "6.26.0",
       "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
       "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
-      "dev": true,
       "requires": {
         "core-js": "^2.4.0",
         "regenerator-runtime": "^0.11.0"
@@ -1639,6 +1655,7 @@
         "anymatch": "^2.0.0",
         "async-each": "^1.0.1",
         "braces": "^2.3.2",
+        "fsevents": "^1.2.7",
         "glob-parent": "^3.1.0",
         "inherits": "^2.0.3",
         "is-binary-path": "^1.0.0",
@@ -2019,8 +2036,7 @@
     "core-js": {
       "version": "2.6.5",
       "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz",
-      "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==",
-      "dev": true
+      "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A=="
     },
     "core-util-is": {
       "version": "1.0.2",
@@ -3537,6 +3553,554 @@
       "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
       "dev": true
     },
+    "fsevents": {
+      "version": "1.2.8",
+      "resolved": "http://registry.npm.taobao.org/fsevents/download/fsevents-1.2.8.tgz",
+      "integrity": "sha1-V+pTIPdizUaW5ejocSDszIsRys8=",
+      "dev": true,
+      "optional": true,
+      "requires": {
+        "nan": "^2.12.1",
+        "node-pre-gyp": "^0.12.0"
+      },
+      "dependencies": {
+        "abbrev": {
+          "version": "1.1.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "ansi-regex": {
+          "version": "2.1.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "aproba": {
+          "version": "1.2.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "are-we-there-yet": {
+          "version": "1.1.5",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "delegates": "^1.0.0",
+            "readable-stream": "^2.0.6"
+          }
+        },
+        "balanced-match": {
+          "version": "1.0.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "brace-expansion": {
+          "version": "1.1.11",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "balanced-match": "^1.0.0",
+            "concat-map": "0.0.1"
+          }
+        },
+        "chownr": {
+          "version": "1.1.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "code-point-at": {
+          "version": "1.1.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "concat-map": {
+          "version": "0.0.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "console-control-strings": {
+          "version": "1.1.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "core-util-is": {
+          "version": "1.0.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "debug": {
+          "version": "4.1.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "ms": "^2.1.1"
+          }
+        },
+        "deep-extend": {
+          "version": "0.6.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "delegates": {
+          "version": "1.0.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "detect-libc": {
+          "version": "1.0.3",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "fs-minipass": {
+          "version": "1.2.5",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "minipass": "^2.2.1"
+          }
+        },
+        "fs.realpath": {
+          "version": "1.0.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "gauge": {
+          "version": "2.7.4",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "aproba": "^1.0.3",
+            "console-control-strings": "^1.0.0",
+            "has-unicode": "^2.0.0",
+            "object-assign": "^4.1.0",
+            "signal-exit": "^3.0.0",
+            "string-width": "^1.0.1",
+            "strip-ansi": "^3.0.1",
+            "wide-align": "^1.1.0"
+          }
+        },
+        "glob": {
+          "version": "7.1.3",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "fs.realpath": "^1.0.0",
+            "inflight": "^1.0.4",
+            "inherits": "2",
+            "minimatch": "^3.0.4",
+            "once": "^1.3.0",
+            "path-is-absolute": "^1.0.0"
+          }
+        },
+        "has-unicode": {
+          "version": "2.0.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "iconv-lite": {
+          "version": "0.4.24",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "safer-buffer": ">= 2.1.2 < 3"
+          }
+        },
+        "ignore-walk": {
+          "version": "3.0.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "minimatch": "^3.0.4"
+          }
+        },
+        "inflight": {
+          "version": "1.0.6",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "once": "^1.3.0",
+            "wrappy": "1"
+          }
+        },
+        "inherits": {
+          "version": "2.0.3",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "ini": {
+          "version": "1.3.5",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "is-fullwidth-code-point": {
+          "version": "1.0.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "number-is-nan": "^1.0.0"
+          }
+        },
+        "isarray": {
+          "version": "1.0.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "minimatch": {
+          "version": "3.0.4",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "brace-expansion": "^1.1.7"
+          }
+        },
+        "minimist": {
+          "version": "0.0.8",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "minipass": {
+          "version": "2.3.5",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "safe-buffer": "^5.1.2",
+            "yallist": "^3.0.0"
+          }
+        },
+        "minizlib": {
+          "version": "1.2.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "minipass": "^2.2.1"
+          }
+        },
+        "mkdirp": {
+          "version": "0.5.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "minimist": "0.0.8"
+          }
+        },
+        "ms": {
+          "version": "2.1.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "needle": {
+          "version": "2.3.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "debug": "^4.1.0",
+            "iconv-lite": "^0.4.4",
+            "sax": "^1.2.4"
+          }
+        },
+        "node-pre-gyp": {
+          "version": "0.12.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "detect-libc": "^1.0.2",
+            "mkdirp": "^0.5.1",
+            "needle": "^2.2.1",
+            "nopt": "^4.0.1",
+            "npm-packlist": "^1.1.6",
+            "npmlog": "^4.0.2",
+            "rc": "^1.2.7",
+            "rimraf": "^2.6.1",
+            "semver": "^5.3.0",
+            "tar": "^4"
+          }
+        },
+        "nopt": {
+          "version": "4.0.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "abbrev": "1",
+            "osenv": "^0.1.4"
+          }
+        },
+        "npm-bundled": {
+          "version": "1.0.6",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "npm-packlist": {
+          "version": "1.4.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "ignore-walk": "^3.0.1",
+            "npm-bundled": "^1.0.1"
+          }
+        },
+        "npmlog": {
+          "version": "4.1.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "are-we-there-yet": "~1.1.2",
+            "console-control-strings": "~1.1.0",
+            "gauge": "~2.7.3",
+            "set-blocking": "~2.0.0"
+          }
+        },
+        "number-is-nan": {
+          "version": "1.0.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "object-assign": {
+          "version": "4.1.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "once": {
+          "version": "1.4.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "wrappy": "1"
+          }
+        },
+        "os-homedir": {
+          "version": "1.0.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "os-tmpdir": {
+          "version": "1.0.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "osenv": {
+          "version": "0.1.5",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "os-homedir": "^1.0.0",
+            "os-tmpdir": "^1.0.0"
+          }
+        },
+        "path-is-absolute": {
+          "version": "1.0.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "process-nextick-args": {
+          "version": "2.0.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "rc": {
+          "version": "1.2.8",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "deep-extend": "^0.6.0",
+            "ini": "~1.3.0",
+            "minimist": "^1.2.0",
+            "strip-json-comments": "~2.0.1"
+          },
+          "dependencies": {
+            "minimist": {
+              "version": "1.2.0",
+              "bundled": true,
+              "dev": true,
+              "optional": true
+            }
+          }
+        },
+        "readable-stream": {
+          "version": "2.3.6",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "core-util-is": "~1.0.0",
+            "inherits": "~2.0.3",
+            "isarray": "~1.0.0",
+            "process-nextick-args": "~2.0.0",
+            "safe-buffer": "~5.1.1",
+            "string_decoder": "~1.1.1",
+            "util-deprecate": "~1.0.1"
+          }
+        },
+        "rimraf": {
+          "version": "2.6.3",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "glob": "^7.1.3"
+          }
+        },
+        "safe-buffer": {
+          "version": "5.1.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "safer-buffer": {
+          "version": "2.1.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "sax": {
+          "version": "1.2.4",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "semver": {
+          "version": "5.7.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "set-blocking": {
+          "version": "2.0.0",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "signal-exit": {
+          "version": "3.0.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "string-width": {
+          "version": "1.0.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "code-point-at": "^1.0.0",
+            "is-fullwidth-code-point": "^1.0.0",
+            "strip-ansi": "^3.0.0"
+          }
+        },
+        "string_decoder": {
+          "version": "1.1.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "safe-buffer": "~5.1.0"
+          }
+        },
+        "strip-ansi": {
+          "version": "3.0.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "ansi-regex": "^2.0.0"
+          }
+        },
+        "strip-json-comments": {
+          "version": "2.0.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "tar": {
+          "version": "4.4.8",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "chownr": "^1.1.1",
+            "fs-minipass": "^1.2.5",
+            "minipass": "^2.3.4",
+            "minizlib": "^1.1.1",
+            "mkdirp": "^0.5.0",
+            "safe-buffer": "^5.1.2",
+            "yallist": "^3.0.2"
+          }
+        },
+        "util-deprecate": {
+          "version": "1.0.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "wide-align": {
+          "version": "1.1.3",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "string-width": "^1.0.2 || 2"
+          }
+        },
+        "wrappy": {
+          "version": "1.0.2",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        },
+        "yallist": {
+          "version": "3.0.3",
+          "bundled": true,
+          "dev": true,
+          "optional": true
+        }
+      }
+    },
     "function-bind": {
       "version": "1.1.1",
       "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
@@ -5085,6 +5649,13 @@
       "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=",
       "dev": true
     },
+    "nan": {
+      "version": "2.13.2",
+      "resolved": "http://registry.npm.taobao.org/nan/download/nan-2.13.2.tgz",
+      "integrity": "sha1-9R3Hrma6fV1V4ebU2AkugCya7+c=",
+      "dev": true,
+      "optional": true
+    },
     "nanomatch": {
       "version": "1.2.13",
       "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz",
@@ -5272,8 +5843,7 @@
     "object-assign": {
       "version": "4.1.1",
       "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
-      "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
-      "dev": true
+      "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
     },
     "object-copy": {
       "version": "0.1.0",
@@ -8078,8 +8648,7 @@
     "regenerator-runtime": {
       "version": "0.11.1",
       "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
-      "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
-      "dev": true
+      "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg=="
     },
     "regenerator-transform": {
       "version": "0.10.1",
@@ -9596,6 +10165,15 @@
         "uppercamelcase": "^1.1.0"
       }
     },
+    "vue-awesome-swiper": {
+      "version": "3.1.3",
+      "resolved": "http://registry.npm.taobao.org/vue-awesome-swiper/download/vue-awesome-swiper-3.1.3.tgz",
+      "integrity": "sha1-BVALUB/7P+yb9+uZhbz0roNg7Z4=",
+      "requires": {
+        "object-assign": "^4.1.1",
+        "swiper": "^4.0.7"
+      }
+    },
     "vue-axios": {
       "version": "2.1.4",
       "resolved": "https://registry.npmjs.org/vue-axios/-/vue-axios-2.1.4.tgz",

+ 4 - 2
package.json

@@ -11,13 +11,15 @@
     },
     "dependencies": {
         "axios": "^0.18.0",
-        "swiper": "^4.5.0",
+        "babel-polyfill": "^6.26.0",
+        "gsap": "^2.0.0",
         "less": "^3.0.4",
         "less-loader": "^4.1.0",
-        "gsap": "^2.0.0",
+        "swiper": "^4.5.0",
         "vconsole": "^3.3.0",
         "vue": "^2.5.2",
         "vue-amap": "^0.5.9",
+        "vue-awesome-swiper": "^3.1.3",
         "vue-axios": "^2.1.1",
         "vue-router": "^3.0.1",
         "vuex": "^3.0.1"

+ 5 - 4
src/components/preview/index.js

@@ -2,11 +2,12 @@ import Vue from 'vue'
 import Main from './main.vue'
 let PreviewConstructor = Vue.extend(Main)
 let instance = null
-var Preview = function(data) {
+var Preview = function (data) {
     // data.useList = data.List
-
+    console.log('Constructor')
+    console.log(data)
     if (instance && instance.visible) {
-        Object.keys(data).forEach(function(key) {
+        Object.keys(data).forEach(function (key) {
             instance[key] = data[key]
         })
         instance.restartTimer()
@@ -20,7 +21,7 @@ var Preview = function(data) {
     return instance.vm
 };
 
-Preview.close = function() {
+Preview.close = function () {
     instance && instance.close()
 }
 export default Preview

+ 105 - 107
src/components/preview/main.vue

@@ -1,142 +1,140 @@
 <template>
-  <transition name="fade" v-on:after-leave="afterLeave" v-on:enter="enter">
-    <div class="modal-container" v-show="visible">
-      <div class="swiper-container previewSwiper">
-        <div class="swiper-wrapper">
-          <div class="swiper-slide" v-for="(item,index) in useList" @click="close" :key="index">
-            <img v-if="!isLoading" :src="item.img" :style="{width:item.width+'px',height:item.height+'px'}" @click.stop alt>
-            <div class="title">
-              {{item.title}}
-              <small>{{item.money}}</small>
+    <transition name="fade" v-on:after-leave="afterLeave" v-on:enter="enter">
+        <div class="modal-container" v-show="visible">
+            <div class="swiper-container previewSwiper">
+                <div class="swiper-wrapper">
+                    <div class="swiper-slide" v-for="(item,index) in useList" @click="close" :key="item.title">
+                        <img v-if="!isLoading" :src="item.img" :style="{width:item.width+'px',height:item.height+'px'}" @click.stop alt>
+                        <div class="title">
+                            {{item.title}}
+                            <small>{{item.money}}</small>
+                        </div>
+                    </div>
+                </div>
             </div>
-          </div>
+            <div class="num">{{nowIndex+1}}/{{useList.length}}</div>
         </div>
-      </div>
-      <div class="num">{{nowIndex+1}}/{{useList.length}}</div>
-    </div>
-  </transition>
+    </transition>
 </template>
 <script>
 import Swiper from 'swiper'
 export default {
-  name: 'preview',
-  created() { },
-  mounted() {
-    this.$modal.loading({ msg: '加载中', duration: -1, type: 'no' })
-    this.visible = true
-    this.isLoading = true
-    if (this.mySwiper) {
-      this.mySwiper.destroy()
-    }
-
-  },
-  data() {
-    return {
-      useList: [],
-      nowIndex: 0,
-      visible: false,
-      isLoading: false,
-      mySwiper: null,
-    }
-  },
-  computed: {
-
-  },
-  methods: {
-    enter() {
-      this.useList = this.List;
-      this.$nextTick(function () {
-        setTimeout(() => {
-          var ref = this;
-
-          this.mySwiper = new Swiper('.previewSwiper', {
-            height: window.innerHeight,
-            initialSlide: ref.nowIndex,
-            on: {
-              init: function () {
-                ref.isLoading = false
-                ref.$modal.close()
-              },
-              slideChange: function () {
-                //    console.log(ref.mySwiper.realIndex)
-                if (ref.mySwiper) {
-                  ref.nowIndex = ref.mySwiper.activeIndex;
-                }
-              },
-            },
-          })
-        }, 100)
-      })
+    name: 'preview',
+    created() {
     },
-    close() {
+    mounted() {
+        this.$modal.loading({ msg: '加载中', duration: -1, type: 'no' })
+        this.visible = true
+        this.isLoading = true
+        if (this.mySwiper) {
+            this.mySwiper.destroy()
+        }
 
-      this.visible = false
-      
     },
-    destroyView() {
-      console.log('aaaaa')
-      // this.$el.removeEventuseListener('transitionend', this.destroyView)
-      this.$destroy(true)
-      this.$el.parentNode.removeChild(this.$el)
+    data() {
+        return {
+            useList: [],
+            nowIndex: 0,
+            visible: false,
+            isLoading: false,
+            mySwiper: null,
+        }
     },
-    afterLeave(el) {
-      this.destroyView()
+    computed: {
+
     },
-  },
+    methods: {
+        enter() {
+            this.useList = this.List;
+            this.$nextTick(function () {
+                setTimeout(() => {
+                    var ref = this;
+
+                    this.mySwiper = new Swiper('.previewSwiper', {
+                        height: window.innerHeight,
+                        initialSlide: ref.nowIndex,
+                        on: {
+                            init: function () {
+                                ref.isLoading = false
+                                ref.$modal.close()
+                            },
+                            slideChange: function () {
+                                //    console.log(ref.mySwiper.realIndex)
+                                if (ref.mySwiper) {
+                                    ref.nowIndex = ref.mySwiper.activeIndex;
+                                }
+                            },
+                        },
+                    })
+                }, 100)
+            })
+        },
+        close() {
+            this.visible = false
+        },
+        destroyView() {
+            // this.$el.removeEventuseListener('transitionend', this.destroyView)
+            this.$destroy(true)
+            this.$el.parentNode.removeChild(this.$el)
+        },
+        afterLeave(el) {
+            this.destroyView()
+        },
+    }
 }
 
 </script>
 <style lang="less" scoped>
 .modal-container {
-  position: fixed;
-  width: 100%;
-  height: 100%;
-  left: 0;
-  top: 0;
-  z-index: 500;
-  background-color: rgba(0, 0, 0, 0.8);
+    position: fixed;
+    width: 100%;
+    height: 100%;
+    left: 0;
+    top: 0;
+    z-index: 500;
+    background-color: rgba(0, 0, 0, 0.8);
 }
 .swiper-slide {
-  width: 100vw;
-  height: 100vh;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  flex-direction: column;
-  img {
-    border-radius: 6px;
-  }
+    width: 100vw;
+    height: 100vh;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    flex-direction: column;
+    img {
+        border-radius: 6px;
+    }
 
-  .title {
-    color: #fff;
-    margin-top: 20px;
-    font-size: 14px;
-    font-weight: bold;
+    .title {
+        color: #fff;
+        margin-top: 20px;
+        font-size: 14px;
+        font-weight: bold;
 
-    small {
-      font-size: 10px;
-      margin-left: 6px;
-      font-weight: normal;
+        small {
+            font-size: 10px;
+            margin-left: 6px;
+            font-weight: normal;
+        }
     }
-  }
 }
 
 .num {
-  position: absolute;
-  top: 10px;
-  left: 50%;
-  transform: translateX(-50%);
-  color: #fff;
-  font-size: 16px;
+    position: absolute;
+    top: 10px;
+    left: 50%;
+    transform: translateX(-50%);
+    color: #fff;
+    font-size: 16px;
 }
 
 .fade-enter,
 .fade-leave-active {
-  opacity: 0;
+    opacity: 0;
 }
 
 .fade-enter-active,
 .fade-leave-active {
-  transition: all 0.5s;
+    transition: all 0.5s;
 }
 </style>

+ 28 - 31
src/main.js

@@ -6,7 +6,7 @@ import axios from 'axios'
 import VueAMap from 'vue-amap'
 import preview from './components/preview'
 import Modal from './components/Modal'
-
+import 'swiper/dist/css/swiper.css'
 import './main.css'
 import './swiper.css'
 
@@ -136,39 +136,36 @@ Vue.prototype.$http = {
 
 
 
-Vue.prototype.preview = function(index, list) {
-    console.log(list)
+Vue.prototype.preview = function (index, list) {
     var imgList = []
-    list.forEach(item => {
-        if (item.img) {
-            getImg(item.img, window.innerWidth - 30, window.innerHeight - 30).then(data => {
-                var jsonp = {
-                    img: item.img,
-                    width: data.width,
-                    height: data.height,
-                };
-                if (item.title) {
-                    jsonp.title = item.title
-
-                    if (item.money) {
-                        jsonp.money = item.money
-                    }
+
+    var sequence = Promise.resolve();
+
+    list.forEach(function (item) {
+        sequence = sequence.then(function () {
+            return getImg(item.img, window.innerWidth - 30, window.innerHeight - 30);
+        }).then(function (data) {
+            var jsonp = {
+                img: item.img,
+                width: data.width,
+                height: data.height,
+            };
+            if (item.title) {
+                jsonp.title = item.title
+
+                if (item.money) {
+                    jsonp.money = item.money
                 }
+            }
+            imgList.push(jsonp);
+            return Promise.resolve();
+        });
+    })
+    sequence.then(() => {
+        this.$preview({ nowIndex: index, List: imgList })
+    })
+
 
-                imgList.push(jsonp)
-            })
-
-        } else {
-            getImg(item, window.innerWidth - 30, window.innerHeight - 30).then(data => {
-                imgList.push({
-                    img: item,
-                    width: data.width,
-                    height: data.height
-                })
-            })
-        }
-    });
-    this.$preview({ nowIndex: index, List: imgList })
 
 
     function getImg(img, maxWidth, maxHeight) {

+ 476 - 475
src/pages/Home.vue

@@ -1,551 +1,552 @@
 <template>
-  <div :class="{isInEnglish:!isChinese}">
-    <div class="bg topImg">
-      <div class="topImgText bg" :style="{fontSize:isChinese?'18px':'11px',backgroundImage:'url('+require('../assets/icon_banner_00.png')+')'}">{{wordsJson.topImg}}</div>
-      <div class="bg img" :style="{backgroundImage:'url('+require('../assets/home_banner.jpg')+')'}"></div>
-    </div>
-    <div class="menu">
-      <div class="menu-item" :class="{active:item.isChoose,isEnglish:!isChinese}" v-for="item in menuList" @click="takeMenu(item)">{{item.name}}</div>
-    </div>
+    <div :class="{isInEnglish:!isChinese}">
+        <div class="bg topImg">
+            <div class="topImgText bg" :style="{fontSize:isChinese?'18px':'11px',backgroundImage:'url('+require('../assets/icon_banner_00.png')+')'}">{{wordsJson.topImg}}</div>
+            <div class="bg img" :style="{backgroundImage:'url('+require('../assets/home_banner.jpg')+')'}"></div>
+        </div>
+        <div class="menu">
+            <div class="menu-item" :class="{active:item.isChoose,isEnglish:!isChinese}" v-for="item in menuList" @click="takeMenu(item)" :key="item.name">{{item.name}}</div>
+        </div>
 
-    <div class="introduction">
-      <div class="title">{{wordsJson.homeTitle0}}</div>
-      <div class="subtitle">{{wordsJson.homeSubTitle0}}</div>
-      <div class="subtitle">{{wordsJson.homeSubTitle1}}</div>
-      <img src="../assets/home_icon_02.png" class="img" alt>
-      <p v-html="wordsJson.homeContent0"></p>
-      <img src="../assets/home_icon_01.png" alt class="leftTop">
-      <img src="../assets/home_icon_03.png" class="right" alt>
-    </div>
+        <div class="introduction">
+            <div class="title">{{wordsJson.homeTitle0}}</div>
+            <div class="subtitle">{{wordsJson.homeSubTitle0}}</div>
+            <div class="subtitle">{{wordsJson.homeSubTitle1}}</div>
+            <img src="../assets/home_icon_02.png" class="img" alt>
+            <p v-html="wordsJson.homeContent0"></p>
+            <img src="../assets/home_icon_01.png" alt class="leftTop">
+            <img src="../assets/home_icon_03.png" class="right" alt>
+        </div>
 
-    <div class="titleContent bg" style="margin-top:23px" :style="{backgroundImage:'url('+require('../assets/home_img_biaoti.png')+')'}">{{wordsJson.homeTitle1}}</div>
+        <div class="titleContent bg" style="margin-top:23px" :style="{backgroundImage:'url('+require('../assets/home_img_biaoti.png')+')'}">{{wordsJson.homeTitle1}}</div>
 
-    <div class="swiper-container" id="swiper1">
-      <div class="swiper-wrapper">
-        <div class="houseItem swiper-slide" v-for="(item,index) in housList">
-          <img :src="item.img" alt @click="preview(index,housList)">
-          <div>{{item.title}}</div>
+        <div class="swiper-container" id="swiper1">
+            <div class="swiper-wrapper">
+                <div class="houseItem swiper-slide" v-for="(item,index) in housList" :key="index">
+                    <img :src="item.img" alt @click="preview(index,housList)">
+                    <div>{{item.title}}</div>
+                </div>
+            </div>
         </div>
-      </div>
-    </div>
 
-    <div class="titleContent bg" :style="{backgroundImage:'url('+require('../assets/home_img_biaoti.png')+')'}">{{wordsJson.homeTitle2}}</div>
-    <div class="restaurantList">
-      <div class="resraurantItem" v-for="item in restaurantList" @click="goDinner(item.title)">
-        <img :src="item.img" alt>
-        <div class="text">
-          <div class="title">{{item.title}}</div>
-          <div class="time">{{wordsJson.homeSubTitle2}}{{item.time}}</div>
+        <div class="titleContent bg" :style="{backgroundImage:'url('+require('../assets/home_img_biaoti.png')+')'}">{{wordsJson.homeTitle2}}</div>
+        <div class="restaurantList">
+            <div class="resraurantItem" v-for="item in restaurantList" @click="goDinner(item.title)" :key="item.title">
+                <img :src="item.img" alt>
+                <div class="text">
+                    <div class="title">{{item.title}}</div>
+                    <div class="time">{{wordsJson.homeSubTitle2}}{{item.time}}</div>
+                </div>
+            </div>
         </div>
-      </div>
-    </div>
 
-    <div class="titleContent bg" :style="{backgroundImage:'url('+require('../assets/home_img_biaoti.png')+')'}">{{wordsJson.homeTitle3}}</div>
-    <div class="swiper-container" id="swiper2">
-      <div class="swiper-wrapper">
-        <div class="foodItem swiper-slide" v-for="(item,index) in foodList">
-          <img :src="item" alt @click="goDaily">
+        <div class="titleContent bg" :style="{backgroundImage:'url('+require('../assets/home_img_biaoti.png')+')'}">{{wordsJson.homeTitle3}}</div>
+        <div class="swiper-container" id="swiper2">
+            <div class="swiper-wrapper">
+                <div class="foodItem swiper-slide" v-for="(item,index) in foodList">
+                    <img :src="item" alt @click="goDaily">
+                </div>
+            </div>
+        </div>
+        <div class="titleContent bg" :style="{backgroundImage:'url('+require('../assets/home_img_biaoti.png')+')'}">{{wordsJson.homeTitle4}}</div>
+        <div class="map" id="map"></div>
+
+        <div class="address">
+            <div class="address-item">
+                <img src="../assets/icon_dizhi.png" alt>
+                <div class="name">{{wordsJson.homeContent1}}</div>
+            </div>
+            <div class="address-item">
+                <img src="../assets/icon_jingdian.png" alt>
+                <div class="name" v-html="wordsJson.homeContent2"></div>
+            </div>
         </div>
-      </div>
-    </div>
-    <div class="titleContent bg" :style="{backgroundImage:'url('+require('../assets/home_img_biaoti.png')+')'}">{{wordsJson.homeTitle4}}</div>
-    <div class="map" id="map"></div>
-
-    <div class="address">
-      <div class="address-item">
-        <img src="../assets/icon_dizhi.png" alt>
-        <div class="name">{{wordsJson.homeContent1}}</div>
-      </div>
-      <div class="address-item">
-        <img src="../assets/icon_jingdian.png" alt>
-        <div class="name" v-html="wordsJson.homeContent2"></div>
-      </div>
-    </div>
 
-    <div class="bottom-img">
-      <img class="imgRight" src="../assets/home_icon_04.png" alt>
-      <img src="../assets/home_icon_05.png" alt class="imgLeft">
+        <div class="bottom-img">
+            <img class="imgRight" src="../assets/home_icon_04.png" alt>
+            <img src="../assets/home_icon_05.png" alt class="imgLeft">
+        </div>
+        <div class="bottom">{{wordsJson.homeBottom}}</div>
     </div>
-    <div class="bottom">{{wordsJson.homeBottom}}</div>
-  </div>
 </template>
 <script>
 import { mapState } from 'vuex'
 import Swiper from 'swiper'
 export default {
-  name: 'home',
-  data() {
-    return {
-      img: 'http://img4.imgtn.bdimg.com/it/u=3408617866,1879551538&fm=26&gp=0.jpg',
-      foodList: [
-        require('../assets/daily/meiri_img_02.jpg'),
-        require('../assets/daily/meiri_img_03.jpg'),
-        require('../assets/daily/meiri_img_04.jpg'),
-        require('../assets/daily/meiri_img_05.jpg'),
-        require('../assets/daily/meiri_img_06.jpg')
-      ],
-      mySwiper1: null,
-      mySwiper2: null
-    }
-  },
-  computed: {
-    ...mapState(['wordsJson', 'isChinese']),
-    menuList() {
-      var list = [];
-      for (var i = 0; i < 12; i++) {
-        var jsonp = {
-          name: this.wordsJson['menu' + i],
-          isChoose: false
-        };
-        if (i == 0) {
-          jsonp.urlName = 'home'
-        }
-        else if (i == 1) {
-          jsonp.urlName = 'history'
-        }
-        else if (i == 2) {
-          jsonp.urlName = 'meeting'
-        }
-        else if (i == 3) {
-          jsonp.urlName = 'daily'
-        }
-        else if (i == 4) {
-          jsonp.changeLanguage = 'ch';
-        }
-        else if (i == 5) {
-          jsonp.urlName = 'dinner'
-        }
-        else if (i == 6) {
-          jsonp.urlName = 'waterTreatment'
-        }
-        else if (i == 7) {
-          jsonp.urlName = 'foodMenu'
-        }
-        else if (i == 8) {
-          jsonp.changeLanguage = 'en';
-        }
-        else if (i == 9) {
-          jsonp.urlName = 'banquetReservation'
-        }
-        else if (i == 10) {
-          jsonp.urlName = 'location'
-        }
-        else if (i == 11) {
-          jsonp.urlName = 'safeTips'
-        }
-
-        if (this.$route.name == jsonp.urlName) {
-          jsonp.isChoose = true
-        }
-        list.push(jsonp);
-      }
-      return list
-    },
-    housList() {
-      return [{
-        title: this.wordsJson.homeList1[0],
-        img: require("../assets/room/room1.jpg")
-      }, {
-        title: this.wordsJson.homeList1[1],
-        img: require("../assets/room/room2.jpg")
-      }, {
-        title: this.wordsJson.homeList1[2],
-        img: require("../assets/room/room3.jpg")
-      }, {
-        title: this.wordsJson.homeList1[3],
-        img: require("../assets/room/room4.jpg")
-      }, {
-        title: this.wordsJson.homeList1[4],
-        img: require("../assets/room/room5.jpg")
-      }, {
-        title: this.wordsJson.homeList1[5],
-        img: require("../assets/room/room6.jpg")
-      }, {
-        title: this.wordsJson.homeList1[6],
-        img: require("../assets/room/room7.jpg")
-      }]
-    },
-    restaurantList() {
-      return [{
-        title: "风味餐馆",
-        title: this.wordsJson.homeList2[0],
-        img: require('../assets/yanhui_img_0001.jpg'),
-        time: '10:00~24:00'
-      }, {
-        title: "娄湖苑万国春中菜馆",
-        title: this.wordsJson.homeList2[1],
-        img: require('../assets/yanhui_img_0002.jpg'),
-        time: '10:00~24:00'
-      }]
-    }
-  },
-  mounted() {
-    this.$nextTick(() => {
-      setTimeout(() => {
-        if (document.getElementById('swiper1')) {
-          this.mySwiper1 = new Swiper('#swiper1', {
-            slidesPerView: 'auto',
-          })
-          this.mySwiper2 = new Swiper('#swiper2', {
-            slidesPerView: 'auto',
-          })
-          this.init()
+    name: 'home',
+    data() {
+        return {
+            img: 'http://img4.imgtn.bdimg.com/it/u=3408617866,1879551538&fm=26&gp=0.jpg',
+            foodList: [
+                require('../assets/daily/meiri_img_02.jpg'),
+                require('../assets/daily/meiri_img_03.jpg'),
+                require('../assets/daily/meiri_img_04.jpg'),
+                require('../assets/daily/meiri_img_05.jpg'),
+                require('../assets/daily/meiri_img_06.jpg')
+            ],
+            mySwiper1: null,
+            mySwiper2: null
         }
-      }, 1)
-    })
-
-  },
-  methods: {
-    goDaily(){
-      this.$route.push({
-        name:'daily'
-      })
     },
-    takeMenu(jsonp) {
-      if (jsonp.changeLanguage) {
-        if (jsonp.changeLanguage == 'ch') {
-          this.$store.commit('updateIsChinese', true);
-        }
-        else {
-          this.$store.commit('updateIsChinese', false);
+    computed: {
+        ...mapState(['wordsJson', 'isChinese']),
+        menuList() {
+            var list = [];
+            for (var i = 0; i < 12; i++) {
+                var jsonp = {
+                    name: this.wordsJson['menu' + i],
+                    isChoose: false
+                };
+                if (i == 0) {
+                    jsonp.urlName = 'home'
+                }
+                else if (i == 1) {
+                    jsonp.urlName = 'history'
+                }
+                else if (i == 2) {
+                    jsonp.urlName = 'meeting'
+                }
+                else if (i == 3) {
+                    jsonp.urlName = 'daily'
+                }
+                else if (i == 4) {
+                    jsonp.changeLanguage = 'ch';
+                }
+                else if (i == 5) {
+                    jsonp.urlName = 'dinner'
+                }
+                else if (i == 6) {
+                    jsonp.urlName = 'waterTreatment'
+                }
+                else if (i == 7) {
+                    jsonp.urlName = 'foodMenu'
+                }
+                else if (i == 8) {
+                    jsonp.changeLanguage = 'en';
+                }
+                else if (i == 9) {
+                    jsonp.urlName = 'banquetReservation'
+                }
+                else if (i == 10) {
+                    jsonp.urlName = 'location'
+                }
+                else if (i == 11) {
+                    jsonp.urlName = 'safeTips'
+                }
+
+                if (this.$route.name == jsonp.urlName) {
+                    jsonp.isChoose = true
+                }
+                list.push(jsonp);
+            }
+            return list
+        },
+        housList() {
+            return [{
+                title: this.wordsJson.homeList1[0],
+                img: require("../assets/room/room1.jpg")
+            }, {
+                title: this.wordsJson.homeList1[1],
+                img: require("../assets/room/room2.jpg")
+            }, {
+                title: this.wordsJson.homeList1[2],
+                img: require("../assets/room/room3.jpg")
+            }, {
+                title: this.wordsJson.homeList1[3],
+                img: require("../assets/room/room4.jpg")
+            }, {
+                title: this.wordsJson.homeList1[4],
+                img: require("../assets/room/room5.jpg")
+            }, {
+                title: this.wordsJson.homeList1[5],
+                img: require("../assets/room/room6.jpg")
+            }, {
+                title: this.wordsJson.homeList1[6],
+                img: require("../assets/room/room7.jpg")
+            }]
+        },
+        restaurantList() {
+            return [{
+                title: "风味餐馆",
+                title: this.wordsJson.homeList2[0],
+                img: require('../assets/yanhui_img_0001.jpg'),
+                time: '10:00~24:00'
+            }, {
+                title: "娄湖苑万国春中菜馆",
+                title: this.wordsJson.homeList2[1],
+                img: require('../assets/yanhui_img_0002.jpg'),
+                time: '10:00~24:00'
+            }]
         }
-      }
-      else {
-        this.$router.push({ name: jsonp.urlName, params: { isNext: 1 } })
-      }
     },
-    init() {
-      var center = new qq.maps.LatLng(32.019220, 118.797040);
-      var map = new qq.maps.Map(document.getElementById('map'), {
-        center: center,
-        zoom: 16,
-        scaleControl: false,
-        zoomControl: false,
-        mapTypeControl: false,
-        disableDoubleClickZoom: false
-      });
-      var marker = new qq.maps.Marker({
-        position: center,
-        map: map,
-      });
-      var anchor = new qq.maps.Point(0, 0),
-        size = new qq.maps.Size(12, 16),
-        origin = new qq.maps.Point(0, 0),
-        scaleSize = new qq.maps.Size(12, 16),
-        markerIcon = new qq.maps.MarkerImage(
-          require('../assets/icon_dian.png'),
-          size,
-          origin,
-          anchor,
-          scaleSize
-        );
-      marker.setIcon(markerIcon);
-
-      var label = new qq.maps.Label({
-        offset: new qq.maps.Size(-37, -44),
-        position: center,
-        map: map,
-        content: '到这去',
-        style: {
-          width: '66px',
-          height: '28px',
-          paddingRight: '8px',
-          background: 'rgba(105,69,44,1)',
-          borderRadius: '2px',
-          fontSize: '14px',
-          fontFamily: 'FZKTJW',
-          color: 'rgba(255,255,255,1)',
-          lineHeight: '28px',
-          textAlign: 'right',
-          backgroundImage: 'url(' + require('../assets/icon_daohang.png') + ')',
-          backgroundPosition: '6px 8px',
-          backgroundSize: '13px 13px',
-          backgroundRepeat: 'no-repeat'
-        }
-      });
+    mounted() {
+        this.$nextTick(() => {
+            setTimeout(() => {
+                if (document.getElementById('swiper1')) {
+                    this.mySwiper1 = new Swiper('#swiper1', {
+                        slidesPerView: 'auto',
+                    })
+                    this.mySwiper2 = new Swiper('#swiper2', {
+                        slidesPerView: 'auto',
+                    })
+                    this.init()
+                }
+            }, 1)
+        })
 
-      qq.maps.event.addListener(label, 'click', function () {
-        window.location.href = 'https://apis.map.qq.com/tools/routeplan/eword=水街&epointx=118.797040&epointy=32.019220?referer=水街&key=GLFBZ-ZR2W6-76XSA-MF7CQ-GDJ6Z-6FB5K'
-      });
     },
-    goDinner(title) {
-      this.$router.push({
-        name: 'dinner',
-        query: {
-          title: title
+    methods: {
+        goDaily() {
+            this.$route.push({
+                name: 'daily'
+            })
+        },
+        takeMenu(jsonp) {
+            if (jsonp.changeLanguage) {
+                if (jsonp.changeLanguage == 'ch') {
+                    this.$store.commit('updateIsChinese', true);
+                }
+                else {
+                    this.$store.commit('updateIsChinese', false);
+                }
+            }
+            else {
+                this.$router.push({ name: jsonp.urlName, params: { isNext: 1 } })
+            }
         },
-        params: {
-          isNext: 1
+        init() {
+            var center = new qq.maps.LatLng(32.019220, 118.797040);
+            var map = new qq.maps.Map(document.getElementById('map'), {
+                center: center,
+                zoom: 16,
+                scaleControl: false,
+                zoomControl: false,
+                mapTypeControl: false,
+                disableDoubleClickZoom: false
+            });
+            var marker = new qq.maps.Marker({
+                position: center,
+                map: map,
+            });
+            var anchor = new qq.maps.Point(0, 0),
+                size = new qq.maps.Size(12, 16),
+                origin = new qq.maps.Point(0, 0),
+                scaleSize = new qq.maps.Size(12, 16),
+                markerIcon = new qq.maps.MarkerImage(
+                    require('../assets/icon_dian.png'),
+                    size,
+                    origin,
+                    anchor,
+                    scaleSize
+                );
+            marker.setIcon(markerIcon);
+
+            var label = new qq.maps.Label({
+                offset: new qq.maps.Size(-37, -44),
+                position: center,
+                map: map,
+                content: '到这去',
+                style: {
+                    width: '66px',
+                    height: '28px',
+                    paddingRight: '8px',
+                    background: 'rgba(105,69,44,1)',
+                    borderRadius: '2px',
+                    fontSize: '14px',
+                    fontFamily: 'FZKTJW',
+                    color: 'rgba(255,255,255,1)',
+                    lineHeight: '28px',
+                    textAlign: 'right',
+                    backgroundImage: 'url(' + require('../assets/icon_daohang.png') + ')',
+                    backgroundPosition: '6px 8px',
+                    backgroundSize: '13px 13px',
+                    backgroundRepeat: 'no-repeat'
+                }
+            });
+
+            qq.maps.event.addListener(label, 'click', function () {
+                window.location.href = 'https://apis.map.qq.com/tools/routeplan/eword=水街&epointx=118.797040&epointy=32.019220?referer=水街&key=GLFBZ-ZR2W6-76XSA-MF7CQ-GDJ6Z-6FB5K'
+            });
+        },
+        goDinner(title) {
+            this.$router.push({
+                name: 'dinner',
+                query: {
+                    title: title
+                },
+                params: {
+                    isNext: 1
+                }
+            })
+        }
+    },
+    destroyed() {
+        if (this.mySwiper1) {
+            this.mySwiper1.destroy()
+        }
+        if (this.mySwiper2) {
+            this.mySwiper2.destroy()
         }
-      })
-    }
-  },
-  destroyed() {
-    if (this.mySwiper1) {
-      this.mySwiper1.destroy()
-    }
-    if (this.mySwiper2) {
-      this.mySwiper2.destroy()
     }
-  }
 }
 
 </script>
 <style lang="less" scoped>
 .topImg {
-  height: 176px;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  position: relative;
-  z-index: 1;
-
-  .img {
-    width: 100%;
-    height: 200px;
-    position: absolute;
-    top: 0;
-    left: 0;
+    height: 176px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    position: relative;
     z-index: 1;
-  }
 
-  .topImgText {
-    width: 156px;
-    height: 53px;
-    font-size: 11px;
-    font-family: SourceHanSerifCN;
-    font-weight: bold;
-    color: rgba(255, 236, 188, 1);
-    text-align: center;
-    line-height: 53px;
-    position: relative;
-    z-index: 2;
-  }
+    .img {
+        width: 100%;
+        height: 200px;
+        position: absolute;
+        top: 0;
+        left: 0;
+        z-index: 1;
+    }
+
+    .topImgText {
+        width: 156px;
+        height: 53px;
+        font-size: 11px;
+        font-family: SourceHanSerifCN;
+        font-weight: bold;
+        color: rgba(255, 236, 188, 1);
+        text-align: center;
+        line-height: 53px;
+        position: relative;
+        z-index: 2;
+    }
 }
 
 .menu {
-  padding: 14px 15px 20px;
-  background-color: #fff;
-  border-radius: 12px 12px 0 0;
-  position: relative;
-  z-index: 2;
-  display: flex;
-  flex-wrap: wrap;
-  justify-content: space-between;
-
-  .menu-item {
-    width: 83px;
-    height: 30px;
-    background: rgba(242, 244, 245, 1);
-    border-radius: 2px;
-    font-size: 14px;
-    font-family: FZKTJW;
-    color: rgba(105, 69, 44, 1);
-    line-height: 30px;
-    text-align: center;
-    margin-top: 6px;
+    padding: 14px 15px 20px;
+    background-color: #fff;
+    border-radius: 12px 12px 0 0;
+    position: relative;
+    z-index: 2;
+    display: flex;
+    flex-wrap: wrap;
+    justify-content: space-between;
 
-    &.active,
-    &:active {
-      background: rgba(105, 69, 44, 1);
-      color: #fff;
-    }
+    .menu-item {
+        width: 83px;
+        height: 30px;
+        background: rgba(242, 244, 245, 1);
+        border-radius: 2px;
+        font-size: 14px;
+        font-family: FZKTJW;
+        color: rgba(105, 69, 44, 1);
+        line-height: 30px;
+        text-align: center;
+        margin-top: 6px;
+
+        &.active,
+        &:active {
+            background: rgba(105, 69, 44, 1);
+            color: #fff;
+        }
 
-    &.isEnglish {
-      height: 40px;
-      line-height: 14px;
-      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
-        Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
-      display: flex;
-      align-items: center;
-      justify-content: center;
-      font-size: 12px;
+        &.isEnglish {
+            height: 40px;
+            line-height: 14px;
+            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
+                Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue",
+                sans-serif;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            font-size: 12px;
+        }
     }
-  }
 }
 
 .introduction {
-  position: relative;
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  .title {
-    font-size: 15px;
-    font-family: SourceHanSerifCN;
-    font-weight: bold;
-    color: rgba(0, 0, 0, 1);
-    line-height: 21px;
-    margin: 38px 0 10px;
-    max-width: 246px;
-    text-align: center;
-  }
+    position: relative;
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+    .title {
+        font-size: 15px;
+        font-family: SourceHanSerifCN;
+        font-weight: bold;
+        color: rgba(0, 0, 0, 1);
+        line-height: 21px;
+        margin: 38px 0 10px;
+        max-width: 246px;
+        text-align: center;
+    }
 
-  .subtitle {
-    font-size: 14px;
-    font-family: FZKTJW;
-    color: rgba(0, 0, 0, 1);
-    line-height: 20px;
-    margin-top: 10px;
-    max-width: 345px;
-    text-align: center;
-  }
-
-  .img {
-    width: 59px;
-    margin: 29px 150px 3px 0;
-  }
-
-  p {
-    font-size: 15px;
-    font-family: FZKTJW;
-    font-weight: normal;
-    color: rgba(0, 0, 0, 1);
-    line-height: 26px;
-    text-align: center;
-  }
-
-  .leftTop {
-    position: absolute;
-    width: 41px;
-    height: 35px;
-    top: 12px;
-    left: 18px;
-  }
-
-  .right {
-    width: 153px;
-    align-self: flex-end;
-  }
+    .subtitle {
+        font-size: 14px;
+        font-family: FZKTJW;
+        color: rgba(0, 0, 0, 1);
+        line-height: 20px;
+        margin-top: 10px;
+        max-width: 345px;
+        text-align: center;
+    }
+
+    .img {
+        width: 59px;
+        margin: 29px 150px 3px 0;
+    }
+
+    p {
+        font-size: 15px;
+        font-family: FZKTJW;
+        font-weight: normal;
+        color: rgba(0, 0, 0, 1);
+        line-height: 26px;
+        text-align: center;
+    }
+
+    .leftTop {
+        position: absolute;
+        width: 41px;
+        height: 35px;
+        top: 12px;
+        left: 18px;
+    }
+
+    .right {
+        width: 153px;
+        align-self: flex-end;
+    }
 }
 
 .houseItem {
-  width: 120px;
-  padding-left: 10px;
-  img {
     width: 120px;
-    height: 90px;
-    border-radius: 4px;
-    display: block;
-  }
-  div {
-    font-size: 14px;
-    font-family: FZKTJW;
-    color: rgba(0, 0, 0, 1);
-    line-height: 20px;
-    margin-top: 8px;
-  }
-
-  &:last-child {
-    padding-right: 10px;
-  }
+    padding-left: 10px;
+    img {
+        width: 120px;
+        height: 90px;
+        border-radius: 4px;
+        display: block;
+    }
+    div {
+        font-size: 14px;
+        font-family: FZKTJW;
+        color: rgba(0, 0, 0, 1);
+        line-height: 20px;
+        margin-top: 8px;
+    }
+
+    &:last-child {
+        padding-right: 10px;
+    }
 }
 
 .resraurantItem {
-  margin: 0 15px 15px;
-  border-radius: 6px;
-  overflow: hidden;
-  background: rgba(255, 255, 255, 1);
-  box-shadow: 0px 8px 12px 0px rgba(0, 0, 0, 0.06);
-  img {
-    height: 140px;
-    width: 100%;
-    display: block;
-  }
-  .text {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    padding: 0 10px 0 15px;
-    height: 42px;
-    .title {
-      font-size: 13px;
-      font-family: SourceHanSerifCN;
-      color: rgba(105, 69, 44, 1);
+    margin: 0 15px 15px;
+    border-radius: 6px;
+    overflow: hidden;
+    background: rgba(255, 255, 255, 1);
+    box-shadow: 0px 8px 12px 0px rgba(0, 0, 0, 0.06);
+    img {
+        height: 140px;
+        width: 100%;
+        display: block;
     }
+    .text {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        padding: 0 10px 0 15px;
+        height: 42px;
+        .title {
+            font-size: 13px;
+            font-family: SourceHanSerifCN;
+            color: rgba(105, 69, 44, 1);
+        }
 
-    .time {
-      font-size: 13px;
-      font-family: FZKTJW;
-      color: rgba(0, 0, 0, 0.9);
+        .time {
+            font-size: 13px;
+            font-family: FZKTJW;
+            color: rgba(0, 0, 0, 0.9);
+        }
     }
-  }
 }
 
 .foodItem {
-  padding-left: 12px;
-  width: 130px;
-  img {
+    padding-left: 12px;
     width: 130px;
-    height: 173px;
-    border-radius: 4px;
-    display: block;
-  }
-  &:last-child {
-    padding-right: 15px;
-  }
+    img {
+        width: 130px;
+        height: 173px;
+        border-radius: 4px;
+        display: block;
+    }
+    &:last-child {
+        padding-right: 15px;
+    }
 }
 
 .isInEnglish {
-  .titleContent {
-    font-size: 10px;
-  }
+    .titleContent {
+        font-size: 10px;
+    }
 
-  .houseItem {
-    div {
-      line-height: 16px;
+    .houseItem {
+        div {
+            line-height: 16px;
+        }
     }
-  }
 }
 
 .map {
-  margin: 0 15px;
-  height: 140px;
-  border-radius: 4px;
+    margin: 0 15px;
+    height: 140px;
+    border-radius: 4px;
 }
 
 .address {
-  margin: 14px 15px;
-  .address-item {
-    display: flex;
-    margin-bottom: 10px;
-    img {
-      width: 22px;
-      height: 22px;
-    }
-    .name {
-      font-size: 14px;
-      font-family: FZKTJW;
-      color: rgba(0, 0, 0, 1);
-      line-height: 22px;
-      margin-left: 14px;
+    margin: 14px 15px;
+    .address-item {
+        display: flex;
+        margin-bottom: 10px;
+        img {
+            width: 22px;
+            height: 22px;
+        }
+        .name {
+            font-size: 14px;
+            font-family: FZKTJW;
+            color: rgba(0, 0, 0, 1);
+            line-height: 22px;
+            margin-left: 14px;
+        }
     }
-  }
 }
 
 .bottom-img {
-  display: flex;
-  justify-content: flex-end;
-  position: relative;
-  .imgRight {
-    width: 162px;
-    height: 106px;
-  }
-  .imgLeft {
-    width: 33px;
-    height: 31px;
-    position: absolute;
-    left: 93px;
-    bottom: 0;
-  }
+    display: flex;
+    justify-content: flex-end;
+    position: relative;
+    .imgRight {
+        width: 162px;
+        height: 106px;
+    }
+    .imgLeft {
+        width: 33px;
+        height: 31px;
+        position: absolute;
+        left: 93px;
+        bottom: 0;
+    }
 }
 
 .bottom {
-  font-size: 14px;
-  font-family: SourceHanSerifCN;
-  font-weight: 800;
-  color: rgba(255, 231, 122, 1);
-  line-height: 36px;
-  text-align: center;
-  background: rgba(105, 69, 44, 1);
+    font-size: 14px;
+    font-family: SourceHanSerifCN;
+    font-weight: 800;
+    color: rgba(255, 231, 122, 1);
+    line-height: 36px;
+    text-align: center;
+    background: rgba(105, 69, 44, 1);
 }
 </style>