panhui 4 年之前
父节点
当前提交
4ad01d1cfb

+ 6 - 3
src/main/nine-space/src/components/product/HashCode.vue

@@ -8,7 +8,7 @@
                 <span class="text1">Hash地址:</span>
                 <span class="flex1"></span>
                 <img @click="copy(info.txHash)" src="@assets/svgs/copy_icon.svg" alt="" />
-                <span class="van-ellipsis" style="direction: rtl; text-align: left">{{ info.txHash }}</span>
+                <span class="van-ellipsis">{{ getShort(info.txHash) }}</span>
             </div>
             <div class="text-info">
                 <span class="text1">区块高度: </span>
@@ -19,7 +19,7 @@
                 <span class="text1">令牌ID: </span>
                 <span class="flex1"></span>
                 <img @click="copy(info.tokenId)" src="@assets/svgs/copy_icon.svg" alt="" />
-                <span class="van-ellipsis" style="direction: rtl; text-align: left">{{ info.tokenId }}</span>
+                <span class="van-ellipsis">{{ getShort(info.tokenId) }}</span>
             </div>
         </div>
         <div v-else class="textName">铸造者未设置</div>
@@ -27,6 +27,7 @@
 </template>
 
 <script>
+import product from '../../mixins/product';
 export default {
     props: {
         info: {
@@ -36,6 +37,7 @@ export default {
             }
         }
     },
+    mixins: [product],
     methods: {
         copy(text) {
             this.$copyText(text).then(
@@ -110,7 +112,8 @@ export default {
             min-width: 80px;
         }
         .van-ellipsis {
-            width: 200px;
+            // width: 200px;
+            text-align: right;
         }
 
         img {

+ 6 - 0
src/main/nine-space/src/mixins/product.js

@@ -92,6 +92,12 @@ export default {
             setTimeout(() => {
                 this.getTime(startTime);
             }, 1000);
+        },
+        getShort(str = '') {
+            if (str) {
+                str = '...' + str.substr(-8, 8);
+            }
+            return str;
         }
     }
 };

+ 2 - 2
src/main/nine-space/src/views/order/Detail.vue

@@ -37,11 +37,11 @@
         </div>
         <div class="info-item">
             <div class="text1">实际支付</div>
-            <div class="text1 prim" style="font-weight: bold;">¥{{ info.couponId ? 0 : info.totalPrice }}</div>
+            <div class="text1 prim" style="font-weight: bold">¥{{ info.couponId ? 0 : info.totalPrice }}</div>
         </div>
         <div class="info-item" v-if="info.txHash">
             <div class="text1">链上hash</div>
-            <div class="van-ellipsis" style="width: 120px;">{{ info.txHash }}</div>
+            <div class="van-ellipsis" style="width: 120px">{{ getShort(info.txHash) }}</div>
         </div>
 
         <div class="info-item" v-if="info.gasUsed">