Преглед изворни кода

Merge branch 'yuan' of panhui/lasuo_nft_front into dev

yuanyuan пре 3 година
родитељ
комит
00cef0c01f
1 измењених фајлова са 43 додато и 16 уклоњено
  1. 43 16
      src/views/product/Detail.vue

+ 43 - 16
src/views/product/Detail.vue

@@ -315,7 +315,15 @@
                                 class="list_of_details_one_title_img list_of_details_one_title_img_left"
                             />
                             <div>
-                                <div class="list_of_details_one_title_con">{{ infoName }}</div>
+                                <div
+                                    :class="
+                                        infoNameLength
+                                            ? 'list_of_details_one_title_cons'
+                                            : 'list_of_details_one_title_con'
+                                    "
+                                >
+                                    {{ info.name }}
+                                </div>
                                 <div class="limited_label">
                                     <div class="limited_label_title" v-if="info.collectionCategory">
                                         {{ info.collectionCategory }}
@@ -759,7 +767,8 @@ export default {
             showOnly: false,
             noLikes: require('@assets/icon-dianzan.png'),
             likes: require('@assets/icon-dianzan@2x.png'),
-            startTime: null
+            startTime: null,
+            infoNameLength: false
         };
     },
     setup() {
@@ -784,17 +793,17 @@ export default {
                 return this.changeImgs(item.pic);
             });
         },
-        infoName() {
-            if (this.info.name) {
-                if (this.info.name.length > 10) {
-                    return this.info.name.slice(0, 10) + '...';
-                } else {
-                    return this.info.name;
-                }
-            } else {
-                return '';
-            }
-        },
+        // infoName() {
+        //     if (this.info.name) {
+        //         if (this.info.name.length > 16) {
+        //             return (this.infoNameLength = true);
+        //         } else {
+        //             return (this.infoNameLength = false);
+        //         }
+        //     } else {
+        //         return '';
+        //     }
+        // },
         appointmentStartOne() {
             if (this.info.startTime) {
                 return this.info.startTime.slice(5, 10);
@@ -862,7 +871,6 @@ export default {
             this.limit = res;
         });
         this.getProduct();
-
         // if (this.isLogin) {
         //     this.$http
         //         .post(
@@ -1036,6 +1044,12 @@ export default {
                     }
                     // console.log(res);
                     this.info = res;
+                    if (this.info.name.length > 14) {
+                        console.log("1343131e",this.info.name.length)
+                        this.infoNameLength = true;
+                    } else {
+                        this.infoNameLength = false;
+                    }
                     // this.appointmentStartTime = new Date(this.info.startTime).getTime();
                     // this.endTime = new Date(this.info.endTime).getTime();
                     // this.publishTime = new Date(this.info.publishTime).getTime();
@@ -1328,11 +1342,11 @@ export default {
                 }
                 .list_of_details_one_title_img_left {
                     position: absolute;
-                    left: -60px;
+                    left: -45px;
                 }
                 .list_of_details_one_title_img_right {
                     position: absolute;
-                    right: -60px;
+                    right: -45px;
                 }
                 .list_of_details_one_title_con {
                     // width: calc(100vw - 30px);
@@ -1348,6 +1362,19 @@ export default {
                     line-height: 28px;
                     margin-bottom: 9px;
                 }
+                .list_of_details_one_title_cons {
+                    font-size: 16px;
+                     white-space: nowrap;
+                    overflow: hidden;
+                    text-overflow: ellipsis;
+                    text-align: center;
+                    // height: 28px;
+                    font-family: PingFangSC-Semibold, PingFang SC;
+                    font-weight: 600;
+                    color: #ffffff;
+                    line-height: 28px;
+                    margin-bottom: 9px;
+                }
                 .limited_label {
                     display: flex;
                     justify-content: center;