zs 1 year ago
parent
commit
14fef8ee25
3 changed files with 9 additions and 5 deletions
  1. 0 2
      src/views/chat/parts/chat.vue
  2. 5 2
      src/views/demand/detail.vue
  3. 4 1
      src/views/demand/index.vue

+ 0 - 2
src/views/chat/parts/chat.vue

@@ -55,8 +55,6 @@
 </template>
 
 <script setup>
-// 图片引入
-import kf from '@/assets/kf.png'
 const id = inject('id')
 const list = inject('list')
 const info = inject('info')

+ 5 - 2
src/views/demand/detail.vue

@@ -57,7 +57,7 @@
                 </el-col>
                 <el-col :span="24" class="other">
                   <span>联系人</span>
-                  {{ userInfo.name || '暂无联系人' }}
+                  {{ formatName(userInfo.name) || '暂无联系人' }}
                 </el-col>
               </el-col>
               <el-col :span="4" class="right" v-if="info.status == '1'">
@@ -97,7 +97,7 @@
                       <span>需求地区:</span>{{ getArea(item.area) }}
                     </el-col>
                     <el-col :span="24" class="two_1">
-                      <span>单位:</span>{{ item.userName || '暂无单位' }}
+                      <span>单位:</span> {{ formatName(item.userName) || '暂无单位' }}
                     </el-col>
                     <el-col :span="24" class="bottom">
                       <a-button size="small" type="primary" @click="toView(item)">
@@ -267,6 +267,9 @@ const toCollection = async (status) => {
 const toView = (item) => {
   router.push({ path: '/demand/detail', query: { id: item.id || item._id } })
 }
+const formatName = (str) => {
+  if (str) return str.substr(0, 1) + new Array(str.length).join('*')
+}
 const currentPage = ref(1)
 // 分页
 const changePage = (page = currentPage.value) => {

+ 4 - 1
src/views/demand/index.vue

@@ -186,7 +186,7 @@
                 </el-col>
                 <el-col :span="8" class="other_1">
                   <span>单位:</span>
-                  {{ item.userName || '暂无单位' }}
+                  {{ formatName(item.userName) || '暂无单位' }}
                 </el-col>
               </el-row>
               <el-col :span="24" class="brief textOver">
@@ -365,6 +365,9 @@ const toDel = (item, type) => {
     }
   }
 }
+const formatName = (str) => {
+  if (str) return str.substr(0, 1) + new Array(str.length).join('*')
+}
 const currentPage = ref(1)
 // 分页
 const changePage = (page = currentPage.value) => {