Sfoglia il codice sorgente

客户列表页优化

shish 20 ore fa
parent
commit
a54a76cf15

+ 33 - 10
hdApp/src/admin/home/member.vue

@@ -295,6 +295,9 @@ export default {
     shortDateTime (value) {
       return value ? value.substr(5, 11) : "";
     },
+    /**
+     * 余额展示文案:负值显示绝对值;正值显示余额;0 显示 0
+     */
     amountText (item) {
       const balance = Number(item.balance) || 0;
       if (balance < 0) {
@@ -303,19 +306,25 @@ export default {
       if (balance > 0) {
         return `${this.formatNumber(balance)}`;
       }
-      return "";
+      return "0";
     },
     decorateMemberList () {
       this.list.data.forEach(item => {
         this.$set(item, "amountClass", this.getAmountClass(item));
       });
     },
+    /**
+     * 余额样式:欠款红 / 有余额蓝 / 零余额灰
+     */
     getAmountClass (item) {
-      const type = this.tabs[this.tabIndex] ? this.tabs[this.tabIndex].type : 0;
-      if (type == 1 || Number(item.balance) >= 0) {
+      const balance = Number(item.balance) || 0;
+      if (balance < 0) {
+        return "negative";
+      }
+      if (balance > 0) {
         return "positive";
       }
-      return "negative";
+      return "zero";
     },
     formatNumber (value) {
       return value ? parseFloat(value) : 0;
@@ -337,13 +346,10 @@ export default {
       };
       return map[Number(item.overTimeUnExpend)] || "";
     },
+    /**
+     * 未下单提示图标:与「没有下过 / 1月未下」等统一用时钟,不用单独生日图标
+     */
     statusIcon (item) {
-      if (item.passStatus != 1) {
-        return "client-clock";
-      }
-      if (Number(item.overTimeUnExpend) == 180 || Number(item.overTimeUnExpend) == 365) {
-        return "client-birthday";
-      }
       return "client-clock";
     }
   }
@@ -739,6 +745,23 @@ export default {
   color: #ff1f1f;
 }
 
+.meta-item.zero {
+  color: #9aa3ad;
+}
+
+/* image 无法继承 color,用 filter 把黑色 SVG 染成对应色 */
+.meta-item.positive .meta-icon-balance {
+  filter: brightness(0) saturate(100%) invert(36%) sepia(98%) saturate(2476%) hue-rotate(201deg) brightness(101%) contrast(101%);
+}
+
+.meta-item.negative .meta-icon-balance {
+  filter: brightness(0) saturate(100%) invert(18%) sepia(97%) saturate(6400%) hue-rotate(358deg) brightness(98%) contrast(118%);
+}
+
+.meta-item.zero .meta-icon-balance {
+  filter: brightness(0) saturate(100%) invert(70%) sepia(6%) saturate(300%) hue-rotate(169deg) brightness(92%) contrast(88%);
+}
+
 .status-pill {
   padding: 4upx 14upx;
   border-radius: 18upx;

+ 6 - 1
hdApp/src/admin/home/order.vue

@@ -88,7 +88,7 @@
             <view class="header-tags">
               <text class="tag debt-tag" v-if="item.debt == 1">挂账</text>
               <text class="tag refund-tag" v-if="item.refund == 1">有售后</text>
-              <view class="status-label">
+              <view class="status-label" :class="{ 'status-label--cancel': item.status == 5 }">
                 <image v-if="item._statusIcon" class="card-icon-sm" :src="iconSrc(item._statusIcon)" mode="aspectFit" />
                 <text>{{ item._statusText }}</text>
               </view>
@@ -1441,6 +1441,11 @@ export default {
   font-weight: 800;
 }
 
+/* 已取消:灰色,与其它进行中状态区分 */
+.status-label--cancel {
+  color: #9aa3ad;
+}
+
 .status-label text {
   margin-left: 6upx;
 }

+ 0 - 1
hdApp/src/static/icons/client-birthday.svg

@@ -1 +0,0 @@
-<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1779193902738" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6235" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M992 960h-64V480a96 96 0 0 0-96-96h-64v-128a32 32 0 0 0-64 0v128H544V224a32 32 0 0 0-64 0v160H320v-128a32 32 0 0 0-64 0v128h-64a96 96 0 0 0-96 96v480H32a32 32 0 0 0 0 64h960a32 32 0 0 0 0-64zM192 448h640a32 32 0 0 1 32 32v117.92a134.56 134.56 0 0 0-58.72 56.32c-16 24-23.84 33.76-37.28 33.76s-21.44-9.76-37.44-33.76S688.96 592 640 592s-73.12 36-90.56 62.24S525.44 688 512 688s-21.28-9.76-37.28-33.76S432.96 592 384 592s-73.12 36-90.56 62.24S269.44 688 256 688s-21.44-9.76-37.44-33.76A133.28 133.28 0 0 0 160 597.92V480a32 32 0 0 1 32-32z m-32 233.92c1.76 2.4 3.52 4.96 5.28 7.84C182.88 716 206.88 752 256 752s73.12-36 90.56-62.24S370.4 656 384 656s21.44 9.76 37.44 33.76S462.72 752 512 752s73.12-36 90.72-62.24S626.4 656 640 656s21.44 9.76 37.44 33.76S718.72 752 768 752s73.12-36 90.56-62.24c1.92-2.88 3.68-5.6 5.44-8V960H160z" p-id="6236"></path><path d="M288 128m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z" p-id="6237"></path><path d="M512 96m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z" p-id="6238"></path><path d="M736 128m-32 0a32 32 0 1 0 64 0 32 32 0 1 0-64 0Z" p-id="6239"></path></svg>