Browse Source

add export

KaysonCui 5 years ago
parent
commit
ce68f06fa5

+ 93 - 0
front/project/www/routes/page/export/index.less

@@ -5,6 +5,7 @@
 
   .content {
     width: 1200px !important;
+    padding-bottom: 20px;
   }
 
   .head-layout {
@@ -22,5 +23,97 @@
       line-height: 80px;
       border-radius: 4px;
     }
+
+    .detail-item {
+      padding-top: 20px;
+      padding-bottom: 40px;
+    }
+
+    .detail-item-block {
+      margin-bottom: 40px;
+    }
+
+    .title-item {
+      border-left: 6px solid #7775CAFF;
+      padding-left: 10px;
+      font-size: 18px;
+      line-height: 16px;
+      font-weight: 600;
+      color: #303036FF;
+      margin-bottom: 20px;
+    }
+
+    .select-item {
+      width: 520px;
+
+      .select-icon {
+        left: 0;
+        top: 5px;
+        border-radius: 50%;
+        width: 15px;
+        height: 15px;
+        border: 1px solid #D5D5D5FF;
+      }
+    }
+
+    .ask-tag {
+      display: inline-block;
+      background: #4D4D4DFF;
+      padding: 2px 10px;
+      font-size: 10px;
+      color: #fff;
+      border-radius: 2px;
+      margin-bottom: 5px;
+    }
+
+    .note-item {
+      background: rgba(245, 245, 245, 1);
+      border-radius: 6px;
+      padding: 15px;
+
+      .t {
+        border-left: 5px solid rgba(179, 179, 179, 1);
+        padding-left: 15px;
+        line-height: 10px;
+      }
+    }
+
+    .hard-body {
+      border-top: 1px solid #ECEDEEFF;
+    }
+
+    .hard-row {
+      border-bottom: 1px solid #ECEDEEFF;
+      line-height: 60px;
+      height: 60px;
+      display: flex;
+
+      .label {
+        padding-left: 20px;
+        width: 90px;
+      }
+
+      .input {
+        padding-left: 20px;
+        flex: 1;
+
+        .hard-input {
+          display: inline-block;
+          border: none;
+          background: none;
+        }
+      }
+    }
+
+    .hard-row:nth-of-type(even) {
+      background: #FBFBFB;
+    }
+
+    .hard-select {
+      background: #FBFBFBFF;
+      border-bottom: 1px solid #ECEDEEFF;
+      border-top: 1px solid #ECEDEEFF;
+      padding: 15px 20px;
+    }
   }
 }

File diff suppressed because it is too large
+ 77 - 11
front/project/www/routes/page/export/page.js


+ 27 - 16
front/project/www/stores/user.js

@@ -5,15 +5,23 @@ import { getMap } from '@src/services/Tools';
 
 import { ServiceParamMap, OrderInfoMap, ServiceKey } from '../../Constant';
 
-const ServiceParamRelation = getMap(Object.keys(ServiceParamMap).map(key => {
-  return {
-    map: getMap(ServiceParamMap[key].map((row, index) => {
-      row.index = index;
-      return row;
-    }), 'value', 'index'),
-    key,
-  };
-}), 'key', 'map');
+const ServiceParamRelation = getMap(
+  Object.keys(ServiceParamMap).map(key => {
+    return {
+      map: getMap(
+        ServiceParamMap[key].map((row, index) => {
+          row.index = index;
+          return row;
+        }),
+        'value',
+        'index',
+      ),
+      key,
+    };
+  }),
+  'key',
+  'map',
+);
 function formatTitle(record) {
   if (record.productType === 'course_package') {
     return (record.coursePackage || {}).title;
@@ -27,7 +35,7 @@ function formatTitle(record) {
     return (record.data || {}).title;
   }
   if (record.productType === 'service') {
-    return record.info.label || ((record.serviceInfo || {}).title);
+    return record.info.label || (record.serviceInfo || {}).title;
   }
   return '';
 }
@@ -52,7 +60,8 @@ function formatCheckout(checkouts) {
     checkout.key = checkout.id;
     checkout.info = OrderInfoMap[checkout.productType];
     if (checkout.productType === 'service') {
-      const index = (ServiceParamRelation[checkout.service] && ServiceParamRelation[checkout.service][checkout.param]) || 0;
+      const index =
+        (ServiceParamRelation[checkout.service] && ServiceParamRelation[checkout.service][checkout.param]) || 0;
       checkout.info = Object.assign({}, checkout.info[checkout.service], checkout.serviceInfo.package[index]);
     }
     checkout.title = formatTitle(checkout);
@@ -76,11 +85,13 @@ export default class UserStore extends BaseStore {
   }
 
   initAfter() {
-    this.refreshToken().then(() => {
-      if (this.adminLogin) {
-        window.location.href = window.location.href.replace(`token=${this.adminLogin}`, '').replace('&&', '&');
-      }
-    });
+    if (this.getToken()) {
+      this.refreshToken().then(() => {
+        if (this.adminLogin) {
+          window.location.href = window.location.href.replace(`token=${this.adminLogin}`, '').replace('&&', '&');
+        }
+      });
+    }
   }
 
   needPay(order) {

+ 0 - 1
front/src/stores/base.js

@@ -27,7 +27,6 @@ export default class BaseStore {
 
   setState(state) {
     if (!this.store) throw new Error('store init error');
-    console.log('setState', state);
     this.store.dispatch({
       key: this.key,
       type: STORE_UPDATE,