sunChengjie 1 year ago
parent
commit
a474ad002d
12 changed files with 1024 additions and 740 deletions
  1. 256 17
      .eslintrc.js
  2. 7 1
      config/index.js
  3. 26 18
      src/main.js
  4. 148 143
      src/pages/setting.vue
  5. 58 30
      src/pages/sytk.vue
  6. 285 285
      src/router/index.js
  7. 6 6
      src/script/areas.js
  8. 164 166
      src/script/common.js
  9. 49 49
      src/store/store.js
  10. 6 6
      test/e2e/custom-assertions/elementCount.js
  11. 18 18
      test/e2e/runner.js
  12. 1 1
      test/e2e/specs/test.js

+ 256 - 17
.eslintrc.js

@@ -1,30 +1,269 @@
-// https://eslint.org/docs/user-guide/configuring
-
 module.exports = {
   root: true,
+  env: {
+    node: true
+  },
+  extends: ['plugin:vue/essential', 'eslint:recommended'],
   parserOptions: {
     parser: 'babel-eslint'
   },
-  env: {
-    browser: true,
-  },
-  extends: [
-    // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
-    // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
-    'plugin:vue/essential', 
-    // https://github.com/standard/standard/blob/master/docs/RULES-en.md
-    'standard'
-  ],
-  // required to lint *.vue files
-  plugins: [
-    'vue'
-  ],
-  // add your custom rules here
   rules: {
+<<<<<<< HEAD
     // allow async-await
     'generator-star-spacing': 'off',
     // allow debugger during development
     'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
     "no-tabs": ["error", { allowIndentationTabs: true }]
+=======
+    'vue/max-attributes-per-line': [
+      2,
+      {
+        singleline: 10,
+        multiline: {
+          max: 1,
+          allowFirstLine: false
+        }
+      }
+    ],
+    'vue/singleline-html-element-content-newline': 'off',
+    'vue/multiline-html-element-content-newline': 'off',
+    'vue/name-property-casing': ['error', 'PascalCase'],
+    'vue/no-v-html': 'off',
+    'accessor-pairs': 2,
+    'arrow-spacing': [
+      2,
+      {
+        before: true,
+        after: true
+      }
+    ],
+    'block-spacing': [2, 'always'],
+    'brace-style': [
+      2,
+      '1tbs',
+      {
+        allowSingleLine: true
+      }
+    ],
+    camelcase: [
+      0,
+      {
+        properties: 'always'
+      }
+    ],
+    'comma-dangle': [2, 'never'],
+    'comma-spacing': [
+      2,
+      {
+        before: false,
+        after: true
+      }
+    ],
+    'comma-style': [2, 'last'],
+    'constructor-super': 2,
+    curly: [2, 'multi-line'],
+    'dot-location': [2, 'property'],
+    'eol-last': 2,
+    eqeqeq: ['error', 'always', { null: 'ignore' }],
+    'generator-star-spacing': [
+      2,
+      {
+        before: true,
+        after: true
+      }
+    ],
+    'handle-callback-err': [2, '^(err|error)$'],
+    indent: [
+      2,
+      2,
+      {
+        SwitchCase: 1
+      }
+    ],
+    'jsx-quotes': [2, 'prefer-single'],
+    'key-spacing': [
+      2,
+      {
+        beforeColon: false,
+        afterColon: true
+      }
+    ],
+    'keyword-spacing': [
+      2,
+      {
+        before: true,
+        after: true
+      }
+    ],
+    'new-cap': [
+      2,
+      {
+        newIsCap: true,
+        capIsNew: false
+      }
+    ],
+    'new-parens': 2,
+    'no-array-constructor': 2,
+    'no-caller': 2,
+    'no-console': 'off',
+    'no-class-assign': 2,
+    'no-cond-assign': 2,
+    'no-const-assign': 2,
+    'no-control-regex': 0,
+    'no-delete-var': 2,
+    'no-dupe-args': 2,
+    'no-dupe-class-members': 2,
+    'no-dupe-keys': 2,
+    'no-duplicate-case': 2,
+    'no-empty-character-class': 2,
+    'no-empty-pattern': 2,
+    'no-eval': 2,
+    'no-ex-assign': 2,
+    'no-extend-native': 2,
+    'no-extra-bind': 2,
+    'no-extra-boolean-cast': 2,
+    'no-extra-parens': [2, 'functions'],
+    'no-fallthrough': 2,
+    'no-floating-decimal': 2,
+    'no-func-assign': 2,
+    'no-implied-eval': 2,
+    'no-inner-declarations': [2, 'functions'],
+    'no-invalid-regexp': 2,
+    'no-irregular-whitespace': 2,
+    'no-iterator': 2,
+    'no-label-var': 2,
+    'no-labels': [
+      2,
+      {
+        allowLoop: false,
+        allowSwitch: false
+      }
+    ],
+    'no-lone-blocks': 2,
+    'no-mixed-spaces-and-tabs': "off",
+    'no-multi-spaces': 2,
+    'no-multi-str': 2,
+    'no-multiple-empty-lines': [
+      2,
+      {
+        max: 1
+      }
+    ],
+    'no-native-reassign': 2,
+    'no-negated-in-lhs': 2,
+    'no-new-object': 2,
+    'no-new-require': 2,
+    'no-new-symbol': 2,
+    'no-new-wrappers': 2,
+    'no-obj-calls': 2,
+    'no-octal': 2,
+    'no-octal-escape': 2,
+    'no-path-concat': 2,
+    'no-proto': 2,
+    'no-redeclare': 2,
+    'no-regex-spaces': 2,
+    'no-return-assign': [2, 'except-parens'],
+    'no-self-assign': 2,
+    'no-self-compare': 2,
+    'no-sequences': 2,
+    'no-shadow-restricted-names': 2,
+    'no-spaced-func': 2,
+    'no-sparse-arrays': 2,
+    'no-this-before-super': 2,
+    'no-throw-literal': 2,
+    'no-trailing-spaces': 2,
+    'no-undef': 2,
+    'no-undef-init': 2,
+    'no-unexpected-multiline': 2,
+    'no-unmodified-loop-condition': 2,
+    'no-unneeded-ternary': [
+      2,
+      {
+        defaultAssignment: false
+      }
+    ],
+    'no-unreachable': 2,
+    'no-unsafe-finally': 2,
+    'no-unused-vars': [
+      2,
+      {
+        vars: 'all',
+        args: 'none'
+      }
+    ],
+    'no-useless-call': 2,
+    'no-useless-computed-key': 2,
+    'no-useless-constructor': 2,
+    'no-useless-escape': 0,
+    'no-whitespace-before-property': 2,
+    'no-with': 2,
+    'one-var': [
+      2,
+      {
+        initialized: 'never'
+      }
+    ],
+    'operator-linebreak': [
+      2,
+      'after',
+      {
+        overrides: {
+          '?': 'before',
+          ':': 'before'
+        }
+      }
+    ],
+    'padded-blocks': [2, 'never'],
+    quotes: [
+      2,
+      'single',
+      {
+        avoidEscape: true,
+        allowTemplateLiterals: true
+      }
+    ],
+    semi: [2, 'never'],
+    'semi-spacing': [
+      2,
+      {
+        before: false,
+        after: true
+      }
+    ],
+    'space-before-blocks': [2, 'always'],
+    'space-before-function-paren': [2, 'never'],
+    'space-in-parens': [2, 'never'],
+    'space-infix-ops': 2,
+    'space-unary-ops': [
+      2,
+      {
+        words: true,
+        nonwords: false
+      }
+    ],
+    'spaced-comment': [
+      2,
+      'always',
+      {
+        markers: ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
+      }
+    ],
+    'template-curly-spacing': [2, 'never'],
+    'use-isnan': 2,
+    'valid-typeof': 2,
+    'wrap-iife': [2, 'any'],
+    'yield-star-spacing': [2, 'both'],
+    yoda: [2, 'never'],
+    'prefer-const': 2,
+    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
+    'object-curly-spacing': [
+      2,
+      'always',
+      {
+        objectsInObjects: false
+      }
+    ],
+    'array-bracket-spacing': [2, 'never']
+>>>>>>> aa04db25e25a9b4b6579117270aa794e75ca8481
   }
 }

+ 7 - 1
config/index.js

@@ -9,7 +9,13 @@ module.exports = {
     // Paths
     assetsSubDirectory: 'static',
     assetsPublicPath: '/',
-    proxyTable: {},
+    proxyTable: {
+      '/':{
+        target:'http://192.168.31.201:8080/tianzong',
+        changeOrigin:true,
+        logLevel:'debug'
+      }
+    },
 
     // Various Dev Server settings
     host: 'localhost', // can be overwritten by process.env.HOST

+ 26 - 18
src/main.js

@@ -2,7 +2,7 @@
 // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
 
 import Vue from 'vue'
-import {VueJsonp} from 'vue-jsonp'
+import { VueJsonp } from 'vue-jsonp'
 Vue.use(VueJsonp)
 import App from './App'
 import router from './router'
@@ -16,6 +16,7 @@ import Vant from 'vant'
 import clipboard from 'clipboard'
 import 'vant/lib/index.css'
 import wx from 'weixin-js-sdk'
+<<<<<<< HEAD
 import request from "@/utils/request" 
 Vue.prototype.$axios = request
 Vue.prototype.$wx= wx
@@ -23,6 +24,14 @@ Vue.component('tabbar',tabbar)
 Vue.component('banner',banner)
 Vue.component('back',back)
 Vue.component('backindex',backIndex)
+=======
+Vue.prototype.$wx = wx
+
+Vue.component('tabbar', tabbar)
+Vue.component('banner', banner)
+Vue.component('back', back)
+Vue.component('backindex', backIndex)
+>>>>>>> aa04db25e25a9b4b6579117270aa794e75ca8481
 Vue.config.productionTip = false
 Vue.use(Vant)
 Vue.use(resource)
@@ -30,12 +39,11 @@ import common from './script/common.js'
 Vue.use(common)
 Vue.prototype.clipboard = clipboard
 
-
 // 时间戳过滤器
 Vue.filter('dateFormat', (dataStr) => {
   var time = new Date(dataStr)
 
-  function timeAdd0 (str) {
+  function timeAdd0(str) {
     if (str < 10) {
       str = '0' + str
     }
@@ -50,7 +58,7 @@ Vue.filter('dateFormat', (dataStr) => {
   return y + '-' + timeAdd0(m) + '-' + timeAdd0(d) + ' ' + timeAdd0(h) + ':' + timeAdd0(mm) + ':' + timeAdd0(s)
 })
 
-//Vue.prototype.common=common
+// Vue.prototype.common=common
 // Vue.http.options.emulateJSON = true;
 // Vue.http.options.headers = {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'};
 
@@ -60,24 +68,24 @@ Vue.filter('dateFormat', (dataStr) => {
 // })
 /* eslint-disable no-new */
 router.beforeEach((to, from, next) => {
-	if (to.matched.some(record => record.meta.needLogin)) { // 判断该路由是否需要登录权限
-		//登录判断
-		
-		if (localStorage.getItem('userId')) { // 判断当前用户的登录信息loginInfo是否存在
-			next();
-		} else {
-			next({
-				path: '/Login'
-			})
-		}
-	} else {
-		next();
-	}
+  if (to.matched.some(record => record.meta.needLogin)) { // 判断该路由是否需要登录权限
+    // 登录判断
+
+    if (localStorage.getItem('userId')) { // 判断当前用户的登录信息loginInfo是否存在
+      next()
+    } else {
+      next({
+        path: '/Login'
+      })
+    }
+  } else {
+    next()
+  }
 })
 new Vue({
   el: '#app',
   router,
-  store:store,
+  store: store,
   components: { App },
   template: '<App/>'
 })

+ 148 - 143
src/pages/setting.vue

@@ -1,161 +1,166 @@
 <template>
-	<div class="body">
-		<!-- 选择类型 -->
-		<back :title="titlename"></back>
-		<div class="list">
-			<router-link to="/Forgetpassword">
-				<span>修改密码</span>
-			</router-link>
-			<router-link to="">
-				<span>关于</span>
-			</router-link>
-			<router-link to="/Sytk">
-				<span>使用条款</span>
-			</router-link>
-
-		</div>
-		<div class="btn">
-			<van-button color="#00c4b8" @click="loginout">退出登录</van-button>
-		</div>
-		
-	</div>
-
+  <div class="body">
+    <!-- 选择类型 -->
+    <back :title="titlename"></back>
+    <div class="list">
+      <router-link to="/Forgetpassword">
+        <span>修改密码</span>
+      </router-link>
+      <router-link to="">
+        <span>关于</span>
+      </router-link>
+      <router-link to="/Sytk">
+        <span>使用条款</span>
+      </router-link>
+    </div>
+    <div class="btn">
+      <van-button color="#00c4b8" @click="loginout">退出登录</van-button>
+    </div>
+  </div>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				titlename: "设置",
-				userId: "",
-				user: []
-			};
-		},
-		created: function() {
-			this.isLogin();
-			this.userId = localStorage.getItem("userId");
-			//this.openid = '123'
-		},
-		methods: {
-			//跳转
-			getUser() {
-				this.$http.post(this.$store.state.host + "/interface/getUser", {
-						userId: this.userId
-					}, {
-						emulateJSON: true
-					})
-					.then(res => {
-						//发送成功
-						if (res.body.code == 0) {
-							this.user = res.body.userPd;
-							console.log(this.user);
-						}
+export default {
+  data() {
+    return {
+      titlename: "设置",
+      userId: "",
+      user: [],
+    };
+  },
+  created: function () {
+    this.isLogin();
+    this.userId = localStorage.getItem("userId");
+    //this.openid = '123'
+  },
+  methods: {
+    //跳转
+    getUser() {
+      this.$http
+        .post(
+          this.$store.state.host + "/interface/getUser",
+          {
+            userId: this.userId,
+          },
+          {
+            emulateJSON: true,
+          }
+        )
+        .then(
+          (res) => {
+            //发送成功
+            if (res.body.code == 0) {
+              this.user = res.body.userPd;
+              console.log(this.user);
+            }
 
-						//if()
-					}, res => {
-						//发送失败
-					})
-			},
-			//退出登录
-			loginout(){
-				localStorage.removeItem("userId");
-				localStorage.removeItem("openid");
-				window.location.href ='http://47.101.145.23/wuliu/';
-			}
-		}
-	};
+            //if()
+          },
+          (res) => {
+            //发送失败
+          }
+        );
+    },
+    // 退出登录
+    loginout() {
+      localStorage.removeItem("userId");
+      localStorage.removeItem("openid");
+      window.location.href = "http://47.101.145.23/wuliu/";
+    },
+  },
+};
 </script>
 
 <style lang="less" scoped>
-	body {
-		background: #fbfbfb;
-	}
+body {
+  background: #fbfbfb;
+}
 
-	.body {
-		.head {
-			padding: .43rem .38rem;
-			font-size: .24rem;
-			color: #999;
-			display: flex;
-			background: white;
-			flex-wrap: wrap;
-			position: relative;
+.body {
+  .head {
+    padding: 0.43rem 0.38rem;
+    font-size: 0.24rem;
+    color: #999;
+    display: flex;
+    background: white;
+    flex-wrap: wrap;
+    position: relative;
 
-			img {
-				width: 1.48rem;
-				height: 1.48rem;
-				border-radius: 50%;
-				margin-right: .4rem;
-			}
+    img {
+      width: 1.48rem;
+      height: 1.48rem;
+      border-radius: 50%;
+      margin-right: 0.4rem;
+    }
 
-			div {
-				p:nth-of-type(1) {
-					font-size: .36rem;
-					font-weight: bold;
-					color: #333;
-					margin-bottom: .2rem;
-					padding-top: .3rem;
-				}
-			}
+    div {
+      p:nth-of-type(1) {
+        font-size: 0.36rem;
+        font-weight: bold;
+        color: #333;
+        margin-bottom: 0.2rem;
+        padding-top: 0.3rem;
+      }
+    }
 
-			div:after {
-				content: "";
-				display: block;
-				width: .2rem;
-				height: .2rem;
-				border-left: .01rem solid #333;
-				border-top: .01rem solid #333;
-				transform: rotate(135deg);
-				position: absolute;
-				right: .38rem;
-				top: 1rem;
-			}
-		}
+    div:after {
+      content: "";
+      display: block;
+      width: 0.2rem;
+      height: 0.2rem;
+      border-left: 0.01rem solid #333;
+      border-top: 0.01rem solid #333;
+      transform: rotate(135deg);
+      position: absolute;
+      right: 0.38rem;
+      top: 1rem;
+    }
+  }
 
-		.list {
-			background: white;
-			margin-top: .36rem;
-			border-radius: .05rem;
+  .list {
+    background: white;
+    margin-top: 0.36rem;
+    border-radius: 0.05rem;
 
-			a {
-				font-size: .3rem;
-				display: block;
-				color: #333;
-				padding: .3rem .4rem;
-				border-bottom: 1px solid #f4f3f3;
-				position: relative;
+    a {
+      font-size: 0.3rem;
+      display: block;
+      color: #333;
+      padding: 0.3rem 0.4rem;
+      border-bottom: 1px solid #f4f3f3;
+      position: relative;
 
-				img {
-					width: .4rem;
-					height: .4rem;
-				}
+      img {
+        width: 0.4rem;
+        height: 0.4rem;
+      }
 
-				span {
-					position: relative;
-					top: -.075rem;
-					margin-left: 0rem;
-				}
-			}
+      span {
+        position: relative;
+        top: -0.075rem;
+        margin-left: 0rem;
+      }
+    }
 
-			a:after {
-				content: "";
-				display: block;
-				width: .2rem;
-				height: .2rem;
-				border-left: .01rem solid #b8b8b8;
-				border-top: .01rem solid #b8b8b8;
-				transform: rotate(135deg);
-				position: absolute;
-				right: .4rem;
-				top: .4rem;
-			}
-		}
-		.btn{
-			padding: 0px .37rem;
-			button{
-				width: 100%;
-				color: white;
-			}
-		}
-	}
+    a:after {
+      content: "";
+      display: block;
+      width: 0.2rem;
+      height: 0.2rem;
+      border-left: 0.01rem solid #b8b8b8;
+      border-top: 0.01rem solid #b8b8b8;
+      transform: rotate(135deg);
+      position: absolute;
+      right: 0.4rem;
+      top: 0.4rem;
+    }
+  }
+  .btn {
+    padding: 0px 0.37rem;
+    button {
+      width: 100%;
+      color: white;
+    }
+  }
+}
 </style>

File diff suppressed because it is too large
+ 58 - 30
src/pages/sytk.vue


+ 285 - 285
src/router/index.js

@@ -40,293 +40,293 @@ import Key from '@/pages/key'
 import Login from '@/pages/login'
 const originalPush = Router.prototype.push
 Router.prototype.push = function push(location) {
-	return originalPush.call(this, location).catch(err => err)
+  return originalPush.call(this, location).catch(err => err)
 }
 Vue.use(Router)
 
 export default new Router({
-	routes: [{
-			path: '/',
-			name: 'Index',
-			component: Index,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //意见建议列表
-			path: '/SuggestList',
-			name: 'SuggestList',
-			component: SuggestList,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //意见建议详情
-			path: '/SuggestInfo',
-			name: 'SuggestInfo',
-			component: SuggestInfo,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //查件
-			path: '/Search',
-			name: 'Search',
-			component: Search,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{
-			path: '/My',
-			name: 'My',
-			component: My,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //个人信息
-			path: '/Personinfomation',
-			name: 'Personinfomation',
-			component: Personinfomation,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{
-			path: '/Express',
-			name: 'Express',
-			component: Express,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //内部件
-			path: '/Inexpress',
-			name: 'Inexpress',
-			component: Inexpress,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //同城急送
-			path: '/Cityexpress',
-			name: 'Cityexpress',
-			component: Cityexpress,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //地址簿
-			path: '/Addressbook',
-			name: 'Addressbook',
-			component: Addressbook,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //地址簿
-			path: '/MultipleAddressbook',
-			name: 'MultipleAddressbook',
-			component: MultipleAddressbook,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //地址簿
-			path: '/CityAddressbook',
-			name: 'CityAddressbook',
-			component: CityAddressbook,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //地址簿
-			path: '/Inaddressbook',
-			name: 'Inaddressbook',
-			component: Inaddressbook,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //我的地址簿
-			path: '/Myaddressbook',
-			name: 'Myaddressbook',
-			component: Myaddressbook,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //新建地址
-			path: '/Newaddress',
-			name: 'Newaddress',
-			component: Newaddress,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //新建地址(内部)
-			path: '/InNewaddress',
-			name: 'InNewaddress',
-			component: InNewaddress,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //编辑地址
-			path: '/Editaddress',
-			name: 'Editaddress',
-			component: Editaddress,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //批量寄
-			path: '/Multipleexpress',
-			name: 'Multipleexpress',
-			component: Multipleexpress,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //禁寄品须知
-			path: '/Xz',
-			name: 'Xz',
-			component: Xz,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //快递代收
-			path: '/Daishou',
-			name: 'Daishou',
-			component: Daishou,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //查快递
-			path: '/Info',
-			name: 'Info',
-			component: Info,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //寄快递查询
-			path: '/MailInfo',
-			name: 'MailInfo',
-			component: MailInfo,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //运费时效
-			path: '/Time',
-			name: 'Time',
-			component: Time,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //我的快件
-			path: '/Myexpress',
-			name: 'Myexpress',
-			component: Myexpress,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		// 新增
-		{ //设置
-			path: '/Setting',
-			name: 'Setting',
-			component: Setting,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //使用条款
-			path: '/Sytk',
-			name: 'Sytk',
-			component: Sytk,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //意见建议
-			path: '/Suggest',
-			name: 'Suggest',
-			component: Suggest,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //忘记密码
-			path: '/Forgetpassword',
-			name: 'Forgetpassword',
-			component: Forgetpassword
-		},
-		{ //添加国际收件人
-			path: '/foreignaddress',
-			name: 'foreignaddress',
-			component: Foreignaddress,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //国际寄件
-			path: '/Foreignexpress',
-			name: 'Foreignexpress',
-			component: Foreignexpress,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //申报信息
-			path: '/Sbxx',
-			name: 'Sbxx',
-			component: Sbxx,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //添加港澳收件人
-			path: '/Hkaddress',
-			name: 'Hkaddress',
-			component: Hkaddress,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //添加港澳
-			path: '/Hkexpress',
-			name: 'Hkexpress',
-			component: Hkexpress,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //添加港澳
-			path: '/Key',
-			name: 'Key',
-			component: Key,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //运单追踪
-			path: '/Logisticslist',
-			name: 'Logisticslist',
-			component: Logisticslist,
-			meta: {
-				needLogin: true //需要加校检判断的路由
-			}
-		},
-		{ //登录
-			path: '/Login',
-			name: 'Login',
-			component: Login
-		},
-	]
+  routes: [{
+    path: '/',
+    name: 'Index',
+    component: Index,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 意见建议列表
+    path: '/SuggestList',
+    name: 'SuggestList',
+    component: SuggestList,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 意见建议详情
+    path: '/SuggestInfo',
+    name: 'SuggestInfo',
+    component: SuggestInfo,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 查件
+    path: '/Search',
+    name: 'Search',
+    component: Search,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  {
+    path: '/My',
+    name: 'My',
+    component: My,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 个人信息
+    path: '/Personinfomation',
+    name: 'Personinfomation',
+    component: Personinfomation,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  {
+    path: '/Express',
+    name: 'Express',
+    component: Express,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 内部件
+    path: '/Inexpress',
+    name: 'Inexpress',
+    component: Inexpress,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 同城急送
+    path: '/Cityexpress',
+    name: 'Cityexpress',
+    component: Cityexpress,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 地址簿
+    path: '/Addressbook',
+    name: 'Addressbook',
+    component: Addressbook,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 地址簿
+    path: '/MultipleAddressbook',
+    name: 'MultipleAddressbook',
+    component: MultipleAddressbook,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 地址簿
+    path: '/CityAddressbook',
+    name: 'CityAddressbook',
+    component: CityAddressbook,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 地址簿
+    path: '/Inaddressbook',
+    name: 'Inaddressbook',
+    component: Inaddressbook,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 我的地址簿
+    path: '/Myaddressbook',
+    name: 'Myaddressbook',
+    component: Myaddressbook,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 新建地址
+    path: '/Newaddress',
+    name: 'Newaddress',
+    component: Newaddress,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 新建地址(内部)
+    path: '/InNewaddress',
+    name: 'InNewaddress',
+    component: InNewaddress,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 编辑地址
+    path: '/Editaddress',
+    name: 'Editaddress',
+    component: Editaddress,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 批量寄
+    path: '/Multipleexpress',
+    name: 'Multipleexpress',
+    component: Multipleexpress,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 禁寄品须知
+    path: '/Xz',
+    name: 'Xz',
+    component: Xz,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 快递代收
+    path: '/Daishou',
+    name: 'Daishou',
+    component: Daishou,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 查快递
+    path: '/Info',
+    name: 'Info',
+    component: Info,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 寄快递查询
+    path: '/MailInfo',
+    name: 'MailInfo',
+    component: MailInfo,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 运费时效
+    path: '/Time',
+    name: 'Time',
+    component: Time,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 我的快件
+    path: '/Myexpress',
+    name: 'Myexpress',
+    component: Myexpress,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  // 新增
+  { // 设置
+    path: '/Setting',
+    name: 'Setting',
+    component: Setting,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 使用条款
+    path: '/Sytk',
+    name: 'Sytk',
+    component: Sytk,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 意见建议
+    path: '/Suggest',
+    name: 'Suggest',
+    component: Suggest,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 忘记密码
+    path: '/Forgetpassword',
+    name: 'Forgetpassword',
+    component: Forgetpassword
+  },
+  { // 添加国际收件人
+    path: '/foreignaddress',
+    name: 'foreignaddress',
+    component: Foreignaddress,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 国际寄件
+    path: '/Foreignexpress',
+    name: 'Foreignexpress',
+    component: Foreignexpress,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 申报信息
+    path: '/Sbxx',
+    name: 'Sbxx',
+    component: Sbxx,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 添加港澳收件人
+    path: '/Hkaddress',
+    name: 'Hkaddress',
+    component: Hkaddress,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 添加港澳
+    path: '/Hkexpress',
+    name: 'Hkexpress',
+    component: Hkexpress,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 添加港澳
+    path: '/Key',
+    name: 'Key',
+    component: Key,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 运单追踪
+    path: '/Logisticslist',
+    name: 'Logisticslist',
+    component: Logisticslist,
+    meta: {
+      needLogin: true // 需要加校检判断的路由
+    }
+  },
+  { // 登录
+    path: '/Login',
+    name: 'Login',
+    component: Login
+  }
+  ]
 })

+ 6 - 6
src/script/areas.js

@@ -1,4 +1,4 @@
-export default{
+export default {
   province_list: {
     110000: '北京市',
     120000: '天津市',
@@ -33,7 +33,7 @@ export default{
     650000: '新疆维吾尔自治区',
     710000: '台湾省',
     810000: '香港特别行政区',
-    820000: '澳门特别行政区',
+    820000: '澳门特别行政区'
   },
   city_list: {
     110100: '北京市',
@@ -404,7 +404,7 @@ export default{
     810200: '九龙',
     810300: '新界',
     820100: '澳门半岛',
-    820200: '离岛',
+    820200: '离岛'
   },
   county_list: {
     110101: '东城区',
@@ -3884,6 +3884,6 @@ export default{
     820106: '风顺堂区',
     820202: '嘉模堂区',
     820203: '路氹填海区',
-    820204: '圣方济各堂区',
-  },
-};
+    820204: '圣方济各堂区'
+  }
+}

+ 164 - 166
src/script/common.js

@@ -1,183 +1,181 @@
 export default {
-  install(Vue){
+  install(Vue) {
     Vue.prototype.getOpenid = function(page) {
-        //var host='http://www.kzmos.com/tianzong';
-        var host='http://47.101.145.23/tianzong';
-        if (localStorage.getItem("openid") != 'undefined' && localStorage.getItem("openid") != null)
-          return;
-        var code = this.getUrlParam("code");
-        if (code == 'undefined' || code == null || code == "") {
-          //alert("参数异常,请返回首页重试");
-          this.urlredirect(page);
-          return;
-        }
-        this.$http.post(host + "/weixin/getWxUserInfo", {
-            code: code,
-			userId:localStorage.getItem("userId")
-          }, {
-            emulateJSON: true
-          })
-          .then(res => {
-            //发送成功
-			console.log(res);
-
-            if (res.body.code == '0') {
-              localStorage.setItem("openid", res.body.openId);
-              localStorage.setItem("headimgurl", res.body.headimgurl);
-              //this.$store.commit("getId",res.body.data)
-            } else {
-              //console.log(res);
-              this.urlredirect(page);
-            }
+      // var host='http://www.kzmos.com/tianzong';
+      // http://47.101.145.23/tianzong
+      var host = ''
+      if (localStorage.getItem('openid') !== 'undefined' && localStorage.getItem('openid') != null) { return }
+      var code = this.getUrlParam('code')
+      if (code === 'undefined' || code == null || code === '') {
+        // alert("参数异常,请返回首页重试");
+        this.urlredirect(page)
+        return
+      }
+      this.$http.post(host + '/weixin/getWxUserInfo', {
+        code: code,
+        userId: localStorage.getItem('userId')
+      }, {
+        emulateJSON: true
+      })
+        .then(res => {
+          // 发送成功
+          console.log(res)
 
-            //if()
-          }, res => {
-            //发送失败
-          })
+          if (res.body.code === '0') {
+            localStorage.setItem('openid', res.body.openId)
+            localStorage.setItem('headimgurl', res.body.headimgurl)
+            // this.$store.commit("getId",res.body.data)
+          } else {
+            // console.log(res);
+            this.urlredirect(page)
+          }
 
-      }
+          // if()
+        }, res => {
+          // 发送失败
+        })
+    }
 
-      Vue.prototype.urlredirect=function(page) {
-        var host='http://47.101.145.23/wuliu';
-        window.location.href =
-          "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx3d3b98cc26425f40&redirect_uri=" + host + page + "&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect";
-      }
-      Vue.prototype.getUrlParam=function(name) {
-        var vars = [],
-          hash;
-        var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
-        for (var i = 0; i < hashes.length; i++) {
-          hash = hashes[i].split('=');
-          vars.push(hash[0]);
-          vars[hash[0]] = hash[1];
-        }
-        return decodeURIComponent(vars[name]);
+    Vue.prototype.urlredirect = function(page) {
+      var host = 'http://47.101.145.23/wuliu'
+      window.location.href =
+          'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx3d3b98cc26425f40&redirect_uri=' + host + page + '&response_type=code&scope=snsapi_userinfo&state=STATE&connect_redirect=1#wechat_redirect'
+    }
+    Vue.prototype.getUrlParam = function(name) {
+      var vars = []
+      var hash
+      var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&')
+      for (var i = 0; i < hashes.length; i++) {
+        hash = hashes[i].split('=')
+        vars.push(hash[0])
+        vars[hash[0]] = hash[1]
       }
-			Vue.prototype.getUser=function(){
-				this.$http.post(this.$store.state.host+"/personal/getPersonalInfoByUserId.do",{userId:this.userId},{emulateJSON:true})
-					.then(res=>{
-							//发送成功
-							if(res.body.msg=='success'){
-								this.user=res.body.personalInfo;
-							}
-				},res=>{
-							 //发送失败
-				})
-			}
-			//代收人列表
-			Vue.prototype.findCollectAgentList=function(){
-				this.$http.post(this.$store.state.host+"/sendMail/findCollectAgentList.do",{},{emulateJSON:true})
-					.then(res=>{
-						//发送成功
-						if(res.body.msg=='success'){
-							this.dsList = res.body.list
-								for(var i=0;i<this.dsList.length;i++){
-									this.dsList[i].text = this.dsList[i].name+' '+this.dsList[i].phone + ' '+this.dsList[i].department
-								}
-						}
-				},res=>{
-						 //发送失败
-				})
-			}
-			//获取对应人的地址
-			Vue.prototype.getPersonalAddressById=function(id){
-				this.$http.post(this.$store.state.host+"/personal/getPersonalAddress.do",{userId:id},{emulateJSON:true})
-					.then(res=>{
-						//发送成功
-						if(res.body.msg=='success'){
-							this.address = res.body.address
-						}
-				},res=>{
-						 //发送失败
-				})
-			}
-			//代收人列表
-			Vue.prototype.getLogisticsList=function(){
-				this.$http.post(this.$store.state.host+"/sendMail/getLogisticsList.do",{},{emulateJSON:true})
-					.then(res=>{
-						//发送成功
-						if(res.body.msg=='success'){
-							this.columns = res.body.list
+      return decodeURIComponent(vars[name])
+    }
+    Vue.prototype.getUser = function() {
+      this.$http.post(this.$store.state.host + '/personal/getPersonalInfoByUserId.do', { userId: this.userId }, { emulateJSON: true })
+        .then(res => {
+          // 发送成功
+          if (res.body.msg === 'success') {
+            this.user = res.body.personalInfo
+          }
+        }, res => {
+							 // 发送失败
+        })
+    }
+    // 代收人列表
+    Vue.prototype.findCollectAgentList = function() {
+      this.$http.post(this.$store.state.host + '/sendMail/findCollectAgentList.do', {}, { emulateJSON: true })
+        .then(res => {
+          // 发送成功
+          if (res.body.msg === 'success') {
+            this.dsList = res.body.list
+            for (var i = 0; i < this.dsList.length; i++) {
+              this.dsList[i].text = this.dsList[i].name + ' ' + this.dsList[i].phone + ' ' + this.dsList[i].department
+            }
+          }
+        }, res => {
+						 // 发送失败
+        })
+    }
+    // 获取对应人的地址
+    Vue.prototype.getPersonalAddressById = function(id) {
+      this.$http.post(this.$store.state.host + '/personal/getPersonalAddress.do', { userId: id }, { emulateJSON: true })
+        .then(res => {
+          // 发送成功
+          if (res.body.msg === 'success') {
+            this.address = res.body.address
+          }
+        }, res => {
+						 // 发送失败
+        })
+    }
+    // 代收人列表
+    Vue.prototype.getLogisticsList = function() {
+      this.$http.post(this.$store.state.host + '/sendMail/getLogisticsList.do', {}, { emulateJSON: true })
+        .then(res => {
+          // 发送成功
+          if (res.body.msg === 'success') {
+            this.columns = res.body.list
 
-								for(var i=0;i<this.columns.length;i++){
-									if(this.columns[i].companyFlag == '' ||this.columns[i].companyFlag == undefined){
-										this.columns[i].text = this.columns[i].expressCompany
-									}else{
-										this.columns[i].text = this.columns[i].expressCompany+'('+this.columns[i].companyFlag+')'
-									}
-								}
-								//默认顺丰快递
-								this.expressInfoShow=this.columns[0].text
-								this.expressInfo=this.columns[0].id
-								this.expressPhone=this.columns[0].phone
-						}
-				},res=>{
-						 //发送失败
-				})
-			}
+            for (var i = 0; i < this.columns.length; i++) {
+              if (this.columns[i].companyFlag === '' || this.columns[i].companyFlag === undefined) {
+                this.columns[i].text = this.columns[i].expressCompany
+              } else {
+                this.columns[i].text = this.columns[i].expressCompany + '(' + this.columns[i].companyFlag + ')'
+              }
+            }
+            // 默认顺丰快递
+            this.expressInfoShow = this.columns[0].text
+            this.expressInfo = this.columns[0].id
+            this.expressPhone = this.columns[0].phone
+          }
+        }, res => {
+						 // 发送失败
+        })
+    }
 
-      //成本中心列表
-      Vue.prototype.getCostCenterList=function(){
-      	this.$http.post(this.$store.state.host+"/sendMail/getCostCenterList.do",{mailRoomId:this.mailRoomId},{emulateJSON:true})
-      		.then(res=>{
-      			//发送成功
-      			if(res.body.msg=='success'){
+    // 成本中心列表
+    Vue.prototype.getCostCenterList = function() {
+      	this.$http.post(this.$store.state.host + '/sendMail/getCostCenterList.do', { mailRoomId: this.mailRoomId }, { emulateJSON: true })
+      		.then(res => {
+      			// 发送成功
+      			if (res.body.msg === 'success') {
       				this.costCenterList = res.body.list
-              for(var i=0;i<this.costCenterList.length;i++){
-                this.costCenterList[i].text = this.costCenterList[i].costCenterName
-              }
-              this.costCenterInfoShow=this.costCenterList[0].text
-              this.costCenterName=this.costCenterList[0].costCenterName
-              this.costCenterId=this.costCenterList[0].id
+            for (var i = 0; i < this.costCenterList.length; i++) {
+              this.costCenterList[i].text = this.costCenterList[i].costCenterName
+            }
+            this.costCenterInfoShow = this.costCenterList[0].text
+            this.costCenterName = this.costCenterList[0].costCenterName
+            this.costCenterId = this.costCenterList[0].id
       			}
-      	},res=>{
-      			 //发送失败
+      	}, res => {
+      			 // 发送失败
       	})
-      }
+    }
 
-			//代收人列表
-			Vue.prototype.getDefaultAddress=function(){
-				this.$http.post(this.$store.state.host+"/solic/getDefaultAddress.do",{
-					userId:localStorage.getItem("userId"),
-					mailRoomId:localStorage.getItem("roomId")
-				},{emulateJSON:true})
-					.then(res=>{
-						//发送成功
-						if(res.body.msg=='success'){
-							this.jjname=res.body.personalInfo.name+' '+res.body.personalInfo.phone
-							this.jjadd=res.body.mailRoomInfo.province+" "+res.body.mailRoomInfo.city+" "+res.body.mailRoomInfo.area+' '+res.body.mailRoomInfo.address
-							this.jjInfo.jjname = this.jjname
-							this.jjInfo.jjadd = this.jjadd
-							this.jjInfo.senderMobile = res.body.personalInfo.telephone
-							this.jjInfo.sender = res.body.personalInfo.name
-							this.jjInfo.senderPhone = res.body.personalInfo.phone
-							this.jjInfo.sendAddr = res.body.mailRoomInfo.province+" "+res.body.mailRoomInfo.city+" "+res.body.mailRoomInfo.area
-							this.jjInfo.sendAddress = res.body.mailRoomInfo.address
-							this.$store.commit("getJjInfo",this.jjInfo)
-						}
-				},res=>{
-						 //发送失败
-				})
-			}
+    // 代收人列表
+    Vue.prototype.getDefaultAddress = function() {
+      this.$http.post(this.$store.state.host + '/solic/getDefaultAddress.do', {
+        userId: localStorage.getItem('userId'),
+        mailRoomId: localStorage.getItem('roomId')
+      }, { emulateJSON: true })
+        .then(res => {
+          // 发送成功
+          if (res.body.msg === 'success') {
+            this.jjname = res.body.personalInfo.name + ' ' + res.body.personalInfo.phone
+            this.jjadd = res.body.mailRoomInfo.province + ' ' + res.body.mailRoomInfo.city + ' ' + res.body.mailRoomInfo.area + ' ' + res.body.mailRoomInfo.address
+            this.jjInfo.jjname = this.jjname
+            this.jjInfo.jjadd = this.jjadd
+            this.jjInfo.senderMobile = res.body.personalInfo.telephone
+            this.jjInfo.sender = res.body.personalInfo.name
+            this.jjInfo.senderPhone = res.body.personalInfo.phone
+            this.jjInfo.sendAddr = res.body.mailRoomInfo.province + ' ' + res.body.mailRoomInfo.city + ' ' + res.body.mailRoomInfo.area
+            this.jjInfo.sendAddress = res.body.mailRoomInfo.address
+            this.$store.commit('getJjInfo', this.jjInfo)
+          }
+        }, res => {
+						 // 发送失败
+        })
+    }
 
-			//登录判断
-			Vue.prototype.isLogin=function(){
-			// 	this.$http.post(this.$store.state.host+"/appSysUser/isLogin.do",{
-			// 	},{emulateJSON:true})
-			// 		.then(res=>{
-			// 			//console.log(res.body)
-			// 			//发送成功
-			// 			if(res.body.msg=='success'){
+    // 登录判断
+    Vue.prototype.isLogin = function() {
+      // 	this.$http.post(this.$store.state.host+"/appSysUser/isLogin.do",{
+      // 	},{emulateJSON:true})
+      // 		.then(res=>{
+      // 			//console.log(res.body)
+      // 			//发送成功
+      // 			if(res.body.msg=='success'){
 
-			// 			}else{
-            //   //本地(服务器下面这个要放开)
-			// 				localStorage.clear();
-			// 			}
-			// 	},res=>{
-			// 			 //发送失败
-			// 	})
-			}
+      // 			}else{
+      //   //本地(服务器下面这个要放开)
+      // 				localStorage.clear();
+      // 			}
+      // 	},res=>{
+      // 			 //发送失败
+      // 	})
+    }
   }
 
-
 }

+ 49 - 49
src/store/store.js

@@ -4,55 +4,55 @@ import Vuex from 'vuex'
 Vue.use(Vuex)
 
 const store = new Vuex.Store({
-	state: {
-		openId: localStorage.getItem("openid"),
-		//服务器用
-		//host: "http://www.kzmos.com/tianzong",
-   host: "http://47.101.145.23/tianzong",
-		//本地用
-		//host:"http://localhost:8080/tianzong",
-		regEmail: "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$",
-		regPhone: "^(1[3-9])\\d{9}$",
-		jjInfo: {},
-		sjInfo: {},
-		sjInfo3: {},
-		sjList: [],
-		foreignSjInfo: {},
-		foreignJjInfo: {},
-		hkSjInfo: {},
-		hkJjInfo: {}
-	},
-	mutations: {
-		getId(state, openid) {
-			state.openId = openid
-		},
-		getJjInfo(state, jjInfo) {
-			state.jjInfo = jjInfo
-		},
-		getSjInfo(state, sjInfo) {
-			state.sjInfo = sjInfo
-		},
-		getSjInfo3(state, sjInfo3) {
-			state.sjInfo3 = sjInfo3
-		},
-		getSjList(state, sjList) {
-			state.sjList = sjList
-		},
-		getForeignSjInfo(state, foreignSjInfo) {
-			state.foreignSjInfo = foreignSjInfo
-		},
-		getForeignJjInfo(state, foreignJjInfo) {
-			state.foreignJjInfo = foreignJjInfo
-		},
-		getHkSjInfo(state, hkSjInfo) {
-			state.hkSjInfo = hkSjInfo
-		},
-		getHkJjInfo(state, hkJjInfo) {
-			state.hkJjInfo = hkJjInfo
-		}
-	},
-	actions: {
+  state: {
+    openId: localStorage.getItem('openid'),
+    // 服务器用
+    // host: "http://www.kzmos.com/tianzong",
+    host: '/tianzong',
+    // 本地用
+    // host:"http://localhost:8080/tianzong",
+    regEmail: '^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$',
+    regPhone: '^(1[3-9])\\d{9}$',
+    jjInfo: {},
+    sjInfo: {},
+    sjInfo3: {},
+    sjList: [],
+    foreignSjInfo: {},
+    foreignJjInfo: {},
+    hkSjInfo: {},
+    hkJjInfo: {}
+  },
+  mutations: {
+    getId(state, openid) {
+      state.openId = openid
+    },
+    getJjInfo(state, jjInfo) {
+      state.jjInfo = jjInfo
+    },
+    getSjInfo(state, sjInfo) {
+      state.sjInfo = sjInfo
+    },
+    getSjInfo3(state, sjInfo3) {
+      state.sjInfo3 = sjInfo3
+    },
+    getSjList(state, sjList) {
+      state.sjList = sjList
+    },
+    getForeignSjInfo(state, foreignSjInfo) {
+      state.foreignSjInfo = foreignSjInfo
+    },
+    getForeignJjInfo(state, foreignJjInfo) {
+      state.foreignJjInfo = foreignJjInfo
+    },
+    getHkSjInfo(state, hkSjInfo) {
+      state.hkSjInfo = hkSjInfo
+    },
+    getHkJjInfo(state, hkJjInfo) {
+      state.hkJjInfo = hkJjInfo
+    }
+  },
+  actions: {
 
-	}
+  }
 })
 export default store

+ 6 - 6
test/e2e/custom-assertions/elementCount.js

@@ -7,20 +7,20 @@
 // For more information on custom assertions see:
 // http://nightwatchjs.org/guide#writing-custom-assertions
 
-exports.assertion = function (selector, count) {
+exports.assertion = function(selector, count) {
   this.message = 'Testing if element <' + selector + '> has count: ' + count
   this.expected = count
-  this.pass = function (val) {
+  this.pass = function(val) {
     return val === this.expected
   }
-  this.value = function (res) {
+  this.value = function(res) {
     return res.value
   }
-  this.command = function (cb) {
+  this.command = function(cb) {
     var self = this
-    return this.api.execute(function (selector) {
+    return this.api.execute(function(selector) {
       return document.querySelectorAll(selector).length
-    }, [selector], function (res) {
+    }, [selector], function(res) {
       cb.call(self, res)
     })
   }

+ 18 - 18
test/e2e/runner.js

@@ -17,7 +17,7 @@ devConfigPromise.then(devConfig => {
   const host = devServerOptions.host
   return server.listen(port, host)
 })
-.then(() => {
+  .then(() => {
   // 2. run the nightwatch test suite against it
   // to run in additional browsers:
   //    1. add an entry in test/e2e/nightwatch.conf.js under "test_settings"
@@ -25,24 +25,24 @@ devConfigPromise.then(devConfig => {
   // or override the environment flag, for example: `npm run e2e -- --env chrome,firefox`
   // For more information on Nightwatch's config file, see
   // http://nightwatchjs.org/guide#settings-file
-  let opts = process.argv.slice(2)
-  if (opts.indexOf('--config') === -1) {
-    opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js'])
-  }
-  if (opts.indexOf('--env') === -1) {
-    opts = opts.concat(['--env', 'chrome'])
-  }
+    let opts = process.argv.slice(2)
+    if (opts.indexOf('--config') === -1) {
+      opts = opts.concat(['--config', 'test/e2e/nightwatch.conf.js'])
+    }
+    if (opts.indexOf('--env') === -1) {
+      opts = opts.concat(['--env', 'chrome'])
+    }
 
-  const spawn = require('cross-spawn')
-  const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' })
+    const spawn = require('cross-spawn')
+    const runner = spawn('./node_modules/.bin/nightwatch', opts, { stdio: 'inherit' })
 
-  runner.on('exit', function (code) {
-    server.close()
-    process.exit(code)
-  })
+    runner.on('exit', function(code) {
+      server.close()
+      process.exit(code)
+    })
 
-  runner.on('error', function (err) {
-    server.close()
-    throw err
+    runner.on('error', function(err) {
+      server.close()
+      throw err
+    })
   })
-})

+ 1 - 1
test/e2e/specs/test.js

@@ -2,7 +2,7 @@
 // http://nightwatchjs.org/guide#usage
 
 module.exports = {
-  'default e2e tests': function (browser) {
+  'default e2e tests': function(browser) {
     // automatically uses dev Server port from /config.index.js
     // default: http://localhost:8080
     // see nightwatch.conf.js