jiayubo 3 months ago
parent
commit
7eb631af45
1 changed files with 13 additions and 4 deletions
  1. 13 4
      pages_home/pages/client/details.vue

+ 13 - 4
pages_home/pages/client/details.vue

@@ -10,7 +10,7 @@
         <up-waterfall v-model="flowList" v-if="pages.total >0">
           <template #left>
             <view class="demo-warter" v-for="(item, index) in leftList" :key="index" @click="goToDetail(item)">
-              <up-lazy-load threshold="-450" border-radius="10" :image="item.volunteerPicture"
+              <up-lazy-load threshold="-450" border-radius="10" :image="getVolunteerPicture(item)"
                 :index="index"></up-lazy-load>
               <view class="demo-title-container">
                 <view class="demo-title">
@@ -22,7 +22,7 @@
               </view>
               <view class="demo-PriceDome">
                 <view class="demo-price">
-                  <image :src="item.volunteerPicture" class="name-image"></image>
+                  <image :src="getVolunteerPicture(item)" class="name-image"></image>
                   <text class="name-text">{{ item.name }}</text>
                 </view>
                 <view class="demo-price">
@@ -34,7 +34,7 @@
           </template>
           <template #right>
             <view class="demo-warter" v-for="(item, index) in rightList" :key="index" @click="goToDetail(item)">
-              <up-lazy-load threshold="-450" border-radius="10" :image="item.volunteerPicture"
+              <up-lazy-load threshold="-450" border-radius="10" :image="getVolunteerPicture(item)"
                 :index="index"></up-lazy-load>
               <view class="demo-title-container">
                 <view class="demo-title">
@@ -46,7 +46,7 @@
               </view>
               <view class="demo-PriceDome">
                 <view class="demo-price">
-                  <image :src="item.volunteerPicture" class="name-image"></image>
+                  <image :src="getVolunteerPicture(item)" class="name-image"></image>
                   <text class="name-text">{{ item.name }}</text>
                 </view>
                 <view class="demo-price">
@@ -102,6 +102,15 @@
 
 	const userType = uni.getStorageSync('userType') //读取本地存储
 
+// 获取志愿者图片
+const getVolunteerPicture = (item) => {
+  // volunteerPicture是用逗号拼接的多张图片,取第一张
+  const pictures = item.volunteerPicture.split(',');
+  return pictures[0];
+};
+
+
+
 	function handlTabs(record) {
 		clearList();
 		serviceCategory.value = record.parentId;