张延森 4 years ago
parent
commit
b6c6f04ae7

+ 18
- 27
src/components/detailCompents/swiper/index.vue View File

1
 <template>
1
 <template>
2
   <div class="swiper">
2
   <div class="swiper">
3
     <van-swipe :autoplay="3000" @change="onChange" ref="swipe">
3
     <van-swipe :autoplay="3000" @change="onChange" ref="swipe">
4
-      <van-swipe-item v-for="(item, index) in images" :key="index">
4
+      <van-swipe-item v-for="(item, index) in imageList" :key="index">
5
         <van-image height="300" :src="item.image" @click="onPerView(index)" />
5
         <van-image height="300" :src="item.image" @click="onPerView(index)" />
6
       </van-swipe-item>
6
       </van-swipe-item>
7
       <template #indicator>
7
       <template #indicator>
8
         <div class="swiper-indicator" ref="indicator">
8
         <div class="swiper-indicator" ref="indicator">
9
           <span
9
           <span
10
-            v-for="(item, index) in images"
10
+            v-for="(item, index) in imageList"
11
             :key="index"
11
             :key="index"
12
             :class="{ active: current === index }"
12
             :class="{ active: current === index }"
13
           >
13
           >
16
         </div>
16
         </div>
17
       </template>
17
       </template>
18
     </van-swipe>
18
     </van-swipe>
19
-    <!-- <div class="swiper-tabs">
20
-      <van-tabs
21
-        v-model:active="current"
22
-        background="rgba(0, 0, 0, 0.69)"
23
-        line-width="0"
24
-        color="#fff"
25
-        title-active-color="#d75e3a"
26
-        @click="onClickTab"
27
-      >
28
-        <template v-for="(item, index) in images" :key="index">
29
-          <van-tab :title="item.text" />
30
-        </template>
31
-      </van-tabs>
32
-    </div> -->
33
   </div>
19
   </div>
34
 </template>
20
 </template>
35
 
21
 
36
 <script>
22
 <script>
37
-import { ref } from 'vue'
38
-import {
39
-  Swipe,
40
-  SwipeItem,
41
-  Image as VanImage,
42
-  ImagePreview,
43
-  Tabs,
44
-  Tab,
45
-} from 'vant'
23
+import { computed, ref } from 'vue'
24
+import { Swipe, SwipeItem, Image as VanImage, ImagePreview } from 'vant'
46
 
25
 
47
 export default {
26
 export default {
48
   name: 'swiper',
27
   name: 'swiper',
50
     [Swipe.name]: Swipe,
29
     [Swipe.name]: Swipe,
51
     [SwipeItem.name]: SwipeItem,
30
     [SwipeItem.name]: SwipeItem,
52
     [VanImage.name]: VanImage,
31
     [VanImage.name]: VanImage,
53
-    [Tabs.name]: Tabs,
54
-    [Tab.name]: Tab,
55
   },
32
   },
56
   props: {
33
   props: {
57
     images: {
34
     images: {
65
     const swipe = ref()
42
     const swipe = ref()
66
     const indicator = ref()
43
     const indicator = ref()
67
 
44
 
45
+    const imageList = computed(() => {
46
+      const list = (props.image || []).filter(Boolean)
47
+      return list.length
48
+        ? list
49
+        : [
50
+            {
51
+              image: 'https://img01.yzcdn.cn/vant/custom-empty-image.png',
52
+              text: '暂无图片',
53
+            },
54
+          ]
55
+    })
56
+
68
     const onChange = (index) => {
57
     const onChange = (index) => {
69
       current.value = index
58
       current.value = index
70
       // indicator.value.scrollTo({ left: 1000 })
59
       // indicator.value.scrollTo({ left: 1000 })
89
       swipe,
78
       swipe,
90
       current,
79
       current,
91
       indicator,
80
       indicator,
81
+      imageList,
92
       onChange,
82
       onChange,
93
       onPerView,
83
       onPerView,
94
       onClickTab,
84
       onClickTab,
122
   display: flex;
112
   display: flex;
123
   flex-wrap: nowrap;
113
   flex-wrap: nowrap;
124
   font-size: 0.85em;
114
   font-size: 0.85em;
115
+  min-width: 100vw;
125
 
116
 
126
   span {
117
   span {
127
     display: inline-block;
118
     display: inline-block;

+ 4
- 8
src/view/secondhand/detail/components/Profile.vue View File

138
 
138
 
139
               // 有跟进权限
139
               // 有跟进权限
140
               if (hasFollowPermission.value) {
140
               if (hasFollowPermission.value) {
141
-                confirm({
141
+                confirm(`您存在未跟进的房源,房源编号: ${followRoom.id}`, {
142
                   title: '去跟进',
142
                   title: '去跟进',
143
-                  message: `您存在未跟进的房源,房源编号: ${followRoom.id}`,
144
                 }).then(() => {
143
                 }).then(() => {
145
                   router.push({
144
                   router.push({
146
-                    name: 'secondhand.detail',
147
-                    query: { roomId: followRoom.id },
145
+                    name: 'followup',
146
+                    query: { roomId: followRoom.id, type: 'room' },
148
                   })
147
                   })
149
                 })
148
                 })
150
               } else {
149
               } else {
151
-                alert({
152
-                  title: '去跟进',
153
-                  message: `您存在未跟进的房源,房源编号: ${followRoom.id}`,
154
-                })
150
+                alert(`您存在未跟进的房源,房源编号: ${followRoom.id}`)
155
               }
151
               }
156
             } else {
152
             } else {
157
               showDanger('查看敏感信息失败')
153
               showDanger('查看敏感信息失败')