张延森 6 gadus atpakaļ
vecāks
revīzija
f89c125434
6 mainītis faili ar 15975 papildinājumiem un 15985 dzēšanām
  1. 15831
    15831
      package-lock.json
  2. 96
    96
      package.json
  3. 25
    25
      src/main.js
  4. 2
    0
      src/pages/page2.vue
  5. 4
    16
      src/store/user/index.js
  6. 17
    17
      src/util/polyfill.js

+ 15831
- 15831
package-lock.json
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


+ 96
- 96
package.json Parādīt failu

@@ -1,96 +1,96 @@
1
-{
2
-  "name": "myvue",
3
-  "version": "1.0.0",
4
-  "description": "A Vue.js project",
5
-  "author": "xuchengxiang <xcx18267901393@dingtalk.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
-    "unit": "jest --config test/unit/jest.conf.js --coverage",
11
-    "e2e": "node test/e2e/runner.js",
12
-    "test": "npm run unit && npm run e2e",
13
-    "lint": "eslint --ext .js,.vue src test/unit test/e2e/specs",
14
-    "build": "node build/build.js"
15
-  },
16
-  "dependencies": {
17
-    "axios": "^0.18.0",
18
-    "mescroll.js": "^1.3.8",
19
-    "solarlunar": "^2.0.7",
20
-    "vant": "^1.4.5",
21
-    "video.js": "^7.4.1",
22
-    "vue": "^2.5.2",
23
-    "vue-awesome-swiper": "^3.1.3",
24
-    "vue-router": "^3.0.1",
25
-    "vuex": "^3.0.1"
26
-  },
27
-  "devDependencies": {
28
-    "autoprefixer": "^7.1.2",
29
-    "babel-core": "^6.22.1",
30
-    "babel-eslint": "^8.2.1",
31
-    "babel-helper-vue-jsx-merge-props": "^2.0.3",
32
-    "babel-jest": "^21.0.2",
33
-    "babel-loader": "^7.1.1",
34
-    "babel-plugin-dynamic-import-node": "^1.2.0",
35
-    "babel-plugin-syntax-jsx": "^6.18.0",
36
-    "babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
37
-    "babel-plugin-transform-runtime": "^6.22.0",
38
-    "babel-plugin-transform-vue-jsx": "^3.5.0",
39
-    "babel-preset-env": "^1.3.2",
40
-    "babel-preset-stage-2": "^6.22.0",
41
-    "babel-register": "^6.22.0",
42
-    "chalk": "^2.0.1",
43
-    "chromedriver": "^2.46.0",
44
-    "copy-webpack-plugin": "^4.0.1",
45
-    "cross-spawn": "^5.0.1",
46
-    "css-loader": "^0.28.0",
47
-    "eslint": "^4.15.0",
48
-    "eslint-config-standard": "^10.2.1",
49
-    "eslint-friendly-formatter": "^3.0.0",
50
-    "eslint-loader": "^1.7.1",
51
-    "eslint-plugin-import": "^2.7.0",
52
-    "eslint-plugin-node": "^5.2.0",
53
-    "eslint-plugin-promise": "^3.4.0",
54
-    "eslint-plugin-standard": "^3.0.1",
55
-    "eslint-plugin-vue": "^4.0.0",
56
-    "extract-text-webpack-plugin": "^3.0.0",
57
-    "file-loader": "^1.1.4",
58
-    "friendly-errors-webpack-plugin": "^1.6.1",
59
-    "html-webpack-plugin": "^2.30.1",
60
-    "jest": "^22.0.4",
61
-    "jest-serializer-vue": "^0.3.0",
62
-    "nightwatch": "^0.9.12",
63
-    "node-notifier": "^5.1.2",
64
-    "node-sass": "^4.10.0",
65
-    "optimize-css-assets-webpack-plugin": "^3.2.0",
66
-    "ora": "^1.2.0",
67
-    "portfinder": "^1.0.13",
68
-    "postcss-import": "^11.0.0",
69
-    "postcss-loader": "^2.0.8",
70
-    "postcss-url": "^7.2.1",
71
-    "rimraf": "^2.6.0",
72
-    "sass-loader": "^7.1.0",
73
-    "selenium-server": "^3.0.1",
74
-    "semver": "^5.3.0",
75
-    "shelljs": "^0.7.6",
76
-    "uglifyjs-webpack-plugin": "^1.1.1",
77
-    "url-loader": "^0.5.8",
78
-    "vue-jest": "^1.0.2",
79
-    "vue-loader": "^13.3.0",
80
-    "vue-style-loader": "^3.1.2",
81
-    "vue-template-compiler": "^2.5.2",
82
-    "webpack": "^3.6.0",
83
-    "webpack-bundle-analyzer": "^2.9.0",
84
-    "webpack-dev-server": "^2.9.1",
85
-    "webpack-merge": "^4.1.0"
86
-  },
87
-  "engines": {
88
-    "node": ">= 6.0.0",
89
-    "npm": ">= 3.0.0"
90
-  },
91
-  "browserslist": [
92
-    "> 1%",
93
-    "last 2 versions",
94
-    "not ie <= 8"
95
-  ]
96
-}
1
+{
2
+  "name": "myvue",
3
+  "version": "1.0.0",
4
+  "description": "A Vue.js project",
5
+  "author": "xuchengxiang <xcx18267901393@dingtalk.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
+    "unit": "jest --config test/unit/jest.conf.js --coverage",
11
+    "e2e": "node test/e2e/runner.js",
12
+    "test": "npm run unit && npm run e2e",
13
+    "lint": "eslint --ext .js,.vue src test/unit test/e2e/specs",
14
+    "build": "node build/build.js"
15
+  },
16
+  "dependencies": {
17
+    "axios": "^0.18.0",
18
+    "mescroll.js": "^1.3.8",
19
+    "solarlunar": "^2.0.7",
20
+    "vant": "^1.4.5",
21
+    "video.js": "^7.4.1",
22
+    "vue": "^2.5.2",
23
+    "vue-awesome-swiper": "^3.1.3",
24
+    "vue-router": "^3.0.1",
25
+    "vuex": "^3.0.1"
26
+  },
27
+  "devDependencies": {
28
+    "autoprefixer": "^7.1.2",
29
+    "babel-core": "^6.22.1",
30
+    "babel-eslint": "^8.2.1",
31
+    "babel-helper-vue-jsx-merge-props": "^2.0.3",
32
+    "babel-jest": "^21.0.2",
33
+    "babel-loader": "^7.1.1",
34
+    "babel-plugin-dynamic-import-node": "^1.2.0",
35
+    "babel-plugin-syntax-jsx": "^6.18.0",
36
+    "babel-plugin-transform-es2015-modules-commonjs": "^6.26.0",
37
+    "babel-plugin-transform-runtime": "^6.22.0",
38
+    "babel-plugin-transform-vue-jsx": "^3.5.0",
39
+    "babel-preset-env": "^1.3.2",
40
+    "babel-preset-stage-2": "^6.22.0",
41
+    "babel-register": "^6.22.0",
42
+    "chalk": "^2.0.1",
43
+    "chromedriver": "^2.46.0",
44
+    "copy-webpack-plugin": "^4.0.1",
45
+    "cross-spawn": "^5.0.1",
46
+    "css-loader": "^0.28.0",
47
+    "eslint": "^4.15.0",
48
+    "eslint-config-standard": "^10.2.1",
49
+    "eslint-friendly-formatter": "^3.0.0",
50
+    "eslint-loader": "^1.7.1",
51
+    "eslint-plugin-import": "^2.7.0",
52
+    "eslint-plugin-node": "^5.2.0",
53
+    "eslint-plugin-promise": "^3.4.0",
54
+    "eslint-plugin-standard": "^3.0.1",
55
+    "eslint-plugin-vue": "^4.0.0",
56
+    "extract-text-webpack-plugin": "^3.0.0",
57
+    "file-loader": "^1.1.4",
58
+    "friendly-errors-webpack-plugin": "^1.6.1",
59
+    "html-webpack-plugin": "^2.30.1",
60
+    "jest": "^22.0.4",
61
+    "jest-serializer-vue": "^0.3.0",
62
+    "nightwatch": "^0.9.12",
63
+    "node-notifier": "^5.1.2",
64
+    "node-sass": "^4.10.0",
65
+    "optimize-css-assets-webpack-plugin": "^3.2.0",
66
+    "ora": "^1.2.0",
67
+    "portfinder": "^1.0.13",
68
+    "postcss-import": "^11.0.0",
69
+    "postcss-loader": "^2.0.8",
70
+    "postcss-url": "^7.2.1",
71
+    "rimraf": "^2.6.0",
72
+    "sass-loader": "^7.1.0",
73
+    "selenium-server": "^3.0.1",
74
+    "semver": "^5.3.0",
75
+    "shelljs": "^0.7.6",
76
+    "uglifyjs-webpack-plugin": "^1.1.1",
77
+    "url-loader": "^0.5.8",
78
+    "vue-jest": "^1.0.2",
79
+    "vue-loader": "^13.3.0",
80
+    "vue-style-loader": "^3.1.2",
81
+    "vue-template-compiler": "^2.5.2",
82
+    "webpack": "^3.6.0",
83
+    "webpack-bundle-analyzer": "^2.9.0",
84
+    "webpack-dev-server": "^2.9.1",
85
+    "webpack-merge": "^4.1.0"
86
+  },
87
+  "engines": {
88
+    "node": ">= 6.0.0",
89
+    "npm": ">= 3.0.0"
90
+  },
91
+  "browserslist": [
92
+    "> 1%",
93
+    "last 2 versions",
94
+    "not ie <= 8"
95
+  ]
96
+}

+ 25
- 25
src/main.js Parādīt failu

@@ -1,25 +1,25 @@
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 App from './App'
5
-import router from './router'
6
-import store from './store'
7
-import Vant from 'vant'
8
-import 'vant/lib/index.css'
9
-// import 'video.js/dist/video-js.css'
10
-import toolClass from './util/util'
11
-import './util/polyfill'
12
-
13
-Vue.use(Vant)
14
-
15
-Vue.config.productionTip = false
16
-Vue.prototype.toolClass = toolClass
17
-
18
-/* eslint-disable no-new */
19
-new Vue({
20
-  el: '#app',
21
-  router,
22
-  store,
23
-  components: { App },
24
-  template: '<App/>'
25
-})
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 App from './App'
5
+import router from './router'
6
+import store from './store'
7
+import { Toast } from 'vant'
8
+import 'vant/lib/index.css'
9
+// import 'video.js/dist/video-js.css'
10
+import toolClass from './util/util'
11
+import './util/polyfill'
12
+
13
+Vue.use(Toast)
14
+
15
+Vue.config.productionTip = false
16
+Vue.prototype.toolClass = toolClass
17
+
18
+/* eslint-disable no-new */
19
+new Vue({
20
+  el: '#app',
21
+  router,
22
+  store,
23
+  components: { App },
24
+  template: '<App/>'
25
+})

+ 2
- 0
src/pages/page2.vue Parādīt failu

@@ -253,6 +253,7 @@ export default {
253 253
     getPersonList () {
254 254
       this.getPerson().then(res => {
255 255
         window.console.log('---------success---------')
256
+        this.$toast(`${(new Date().valueOf())}---------success---------`)
256 257
 
257 258
         if (res && res.isShow) {
258 259
           const sex = res.sex === '1' ? '先生' : '女士'
@@ -276,6 +277,7 @@ export default {
276 277
         }, 500)
277 278
       }).catch(r => {
278 279
         window.console.log('---------error---------')
280
+        this.$toast(`${(new Date().valueOf())}---------error---------`)
279 281
 
280 282
         if (this.personDelay) {
281 283
           window.clearTimeout(this.personDelay)

+ 4
- 16
src/store/user/index.js Parādīt failu

@@ -81,25 +81,13 @@ export default {
81 81
       })
82 82
     },
83 83
     getPersonB ({ commit }) {
84
-      return new Promise((resolve, reject) => {
85
-        Ajax(api.person.url, {
86
-          method: api.person.method
87
-        }).then(res => {
88
-          resolve(res)
89
-        }).catch((res) => {
90
-          reject(res)
91
-        })
84
+      return Ajax(api.person.url, {
85
+        method: api.person.method
92 86
       })
93 87
     },
94 88
     getPerson ({ commit }) {
95
-      return new Promise((resolve, reject) => {
96
-        Ajax(api.person2.url, {
97
-          method: api.person2.method
98
-        }).then(res => {
99
-          resolve(res)
100
-        }).catch((res) => {
101
-          reject(res)
102
-        })
89
+      return Ajax(api.person2.url, {
90
+        method: api.person2.method
103 91
       })
104 92
     }
105 93
   }

+ 17
- 17
src/util/polyfill.js Parādīt failu

@@ -1,17 +1,17 @@
1
-/* eslint-disable */
2
-
3
-if (!String.prototype.padStart) {
4
-  String.prototype.padStart = function padStart(targetLength, padString) {
5
-      targetLength = targetLength >> 0; //truncate if number, or convert non-number to 0;
6
-      padString = String(typeof padString !== 'undefined' ? padString : ' ');
7
-      if (this.length >= targetLength) {
8
-          return String(this);
9
-      } else {
10
-          targetLength = targetLength - this.length;
11
-          if (targetLength > padString.length) {
12
-              padString += padString.repeat(targetLength / padString.length); //append to original to ensure we are longer than needed
13
-          }
14
-          return padString.slice(0, targetLength) + String(this);
15
-      }
16
-  };
17
-}
1
+/* eslint-disable */
2
+
3
+if (!String.prototype.padStart) {
4
+  String.prototype.padStart = function padStart(targetLength, padString) {
5
+      targetLength = targetLength >> 0; //truncate if number, or convert non-number to 0;
6
+      padString = String(typeof padString !== 'undefined' ? padString : ' ');
7
+      if (this.length >= targetLength) {
8
+          return String(this);
9
+      } else {
10
+          targetLength = targetLength - this.length;
11
+          if (targetLength > padString.length) {
12
+              padString += padString.repeat(targetLength / padString.length); //append to original to ensure we are longer than needed
13
+          }
14
+          return padString.slice(0, targetLength) + String(this);
15
+      }
16
+  };
17
+}