Pārlūkot izejas kodu

Added error components

Sendya 7 gadi atpakaļ
vecāks
revīzija
51edd22215

+ 1 - 1
src/components/layout/PageHeader.vue

@@ -11,7 +11,7 @@
     </a-breadcrumb>
 
     <div class="detail">
-      <div class="main">
+      <div class="main" v-if="!$route.meta.hiddenPageHeader">
         <div class="row">
           <img v-if="logo" :src="logo" class="logo"/>
           <h1 v-if="title" class="title">{{ title }}</h1>

+ 5 - 4
src/router/index.js

@@ -14,6 +14,7 @@ Vue.use(Router)
  * meta : {
     title: 'title'               the name show in submenu and breadcrumb (recommend set)
     icon: 'svg-name'             the icon show in the sidebar,
+    hiddenPageHeader: true       if `hiddenPageHeader: true` will not show page-header(details)
   }
  **/
 export const constantRouterMap = [
@@ -181,8 +182,8 @@ export const asyncRouterMap = [
       {
         path: '/result/success',
         name: 'ResultSuccess',
-        component: () => import('../views/result/Success'),
-        meta: { title: '成功' }
+        component: () => import(/* webpackChunkName: "result" */ '../views/result/Success'),
+        meta: { title: '成功', hiddenPageHeader: true }
       },
       {
         path: '/result/fail',
@@ -190,8 +191,8 @@ export const asyncRouterMap = [
         // route level code-splitting
         // this generates a separate chunk (about.[hash].js) for this route
         // which is lazy-loaded when the route is visited.
-        component: () => import(/* webpackChunkName: "fail" */ '../views/result/Success'),
-        meta: { title: '失败' }
+        component: () => import(/* webpackChunkName: "result" */ '../views/result/Error'),
+        meta: { title: '失败', hiddenPageHeader: true }
       }
     ]
   },

+ 45 - 0
src/views/result/Error.vue

@@ -0,0 +1,45 @@
+<template>
+  <a-card :bordered="false">
+    <result style="margin-bottom: 16px; margin-top: 48px" :is-success="false" :title="title" :description="description">
+      <template slot="action">
+        <a-button type="primary" >返回修改</a-button>
+      </template>
+      <div>
+        <div style="font-size: 16px; color: rgba(0, 0, 0, 0.85); font-weight: 500; margin-bottom: 16px">
+          您提交的内容有如下错误:
+        </div>
+        <div style="margin-bottom: 16px">
+          <a-icon type="close-circle-o" style="color: #f5222d; margin-right: 8px"/>
+          您的账户已被冻结
+          <a style="margin-left: 16px">立即解冻 <a-icon type="right" /></a>
+        </div>
+        <div>
+          <a-icon type="close-circle-o" style="color: #f5222d; margin-right: 8px"/>
+          您的账户还不具备申请资格
+          <a style="margin-left: 16px">立即升级 <a-icon type="right" /></a>
+        </div>
+      </div>
+    </result>
+  </a-card>
+</template>
+
+<script>
+  import Result from './Result'
+
+  export default {
+    name: "Error",
+    components: {
+      Result
+    },
+    data () {
+      return {
+        title: '提交失败',
+        description: '请核对并修改以下信息后,再重新提交。'
+      }
+    }
+  }
+</script>
+
+<style scoped>
+
+</style>