2 Commits 2c80a674a3 ... 41d0d6f5a2

Author SHA1 Message Date
  peter 41d0d6f5a2 change: userinfo cookie为空时, 重新获取userinfo. 2 days ago
  Ken 47afa5cf5a feat:ESG-carbon Dialog根据productType显示下载 3 days ago
2 changed files with 29 additions and 2 deletions
  1. 22 1
      components/FootprintReportDialog.vue
  2. 7 1
      plugins/router.js

+ 22 - 1
components/FootprintReportDialog.vue

@@ -56,7 +56,11 @@
           </div>
         </div>
       </div>
-      <div style="text-align:right;margin-top:20px;">
+      <div class="report-footer" v-if="comProductType == '粗算'">
+        <p>Contact us for detailed reports.</p>
+        <p>esgteam@promocollection.com.au</p>
+      </div>
+      <div style="text-align:right;margin-top:20px;" v-else>
         <el-button type="primary" class="report-btn"
           @click="download(comEquallist?.url)">Download</el-button>
       </div>
@@ -85,6 +89,9 @@ export default {
     comEquallist() {
       return this.carbon[this.form.model]?.accountlist?.find(item => item.code === this.form.transport) || { equallist: [], emissionTotal: 0 };
     },
+    comProductType() {
+      return this.carbon[this.form.model]?.productType || '';
+    },
     comEmissionTotal() {
       return this.multiply(this.comEquallist.emissionTotal, this.form.quantity).toFixed(2) || 0;
     }
@@ -221,6 +228,20 @@ $shadow-green: 0 2px 8px rgba($green, 0.08);
   }
 }
 
+.report-footer{
+  p{
+    font-size: 16px;
+    font-weight: 600;
+    &:nth-child(1){
+      margin: 10px 0;
+      color: #303133;
+    }
+    &:nth-child(2){
+      color: $blue-dark;
+    }
+  }
+}
+
 .report-btn {
   background: $blue-dark !important;
   border: none !important;

+ 7 - 1
plugins/router.js

@@ -11,14 +11,20 @@ export default ({ app, store, redirect, $cookies }) => {
     }
 
     let token = ''
+    let userInfo = ''
     // console.log($cookies.get('can-use-cookie'), 'can use cookie')
     // console.log($cookies.get('token'), 'token')
     if ($cookies.get('can-use-cookie')) {
       token = $cookies.get('token')
+      userInfo = $cookies.get('user-info')
     }
     if (token) {
       // console.log('set status')
-      store.commit('setUserInfo', $cookies.get('user-info'))
+      if (userInfo) {
+        store.commit('setUserInfo', userInfo)
+      } else {
+        store.dispatch('getUserInfo')
+      }
     } else {
       // console.log('remove status')
       store.commit('clearUserInfo')