Pārlūkot izejas kodu

Merge branch 'master' of http://git.ycjcjy.com/ershoufang/mp-agent into master

zlisen 4 gadus atpakaļ
vecāks
revīzija
1bfc46dcee

+ 4
- 4
src/components/XLoading/index.vue Parādīt failu

@@ -12,9 +12,9 @@
12 12
 </template>
13 13
 
14 14
 <script>
15
-import { computed } from "vue"
16
-import { Loading } from "vant"
17
-import { useModel } from "@zjxpcyc/vue-tiny-store"
15
+import { computed } from 'vue'
16
+import { Loading } from 'vant'
17
+import { useModel } from '@zjxpcyc/vue-tiny-store'
18 18
 // import store from '../../store'
19 19
 
20 20
 export default {
@@ -27,7 +27,7 @@ export default {
27 27
     xId: String,
28 28
   },
29 29
   setup(props) {
30
-    const { loading } = useModel("loading")
30
+    const { loading } = useModel('loading')
31 31
 
32 32
     const show = computed(() => loading[props.xId])
33 33
 

+ 54
- 43
src/components/detailCompents/swiper/index.vue Parādīt failu

@@ -1,40 +1,27 @@
1 1
 <template>
2 2
   <div class="swiper">
3 3
     <van-swipe :autoplay="3000" @change="onChange" ref="swipe">
4
-      <van-swipe-item v-for="(image, index) in images" :key="index">
5
-        <van-image height="300" :src="image.image" @click="onPerView(index)" />
4
+      <van-swipe-item v-for="(item, index) in imageList" :key="index">
5
+        <van-image height="300" :src="item.image" @click="onPerView(index)" />
6 6
       </van-swipe-item>
7
+      <template #indicator>
8
+        <div class="swiper-indicator" ref="indicator">
9
+          <span
10
+            v-for="(item, index) in imageList"
11
+            :key="index"
12
+            :class="{ active: current === index }"
13
+          >
14
+            {{ item.text }}
15
+          </span>
16
+        </div>
17
+      </template>
7 18
     </van-swipe>
8
-    <div class="swiper-tabs">
9
-      <van-tabs
10
-        v-model:active="current"
11
-        background="rgba(0, 0, 0, 0.69)"
12
-        line-width="0"
13
-        color="#fff"
14
-        title-active-color="#d75e3a"
15
-        @click="onClickTab"
16
-      >
17
-        <van-tab
18
-          v-for="(image, index) in images"
19
-          :key="index"
20
-          :title="image?.text"
21
-        >
22
-        </van-tab>
23
-      </van-tabs>
24
-    </div>
25 19
   </div>
26 20
 </template>
27 21
 
28 22
 <script>
29
-import { ref } from 'vue'
30
-import {
31
-  Swipe,
32
-  SwipeItem,
33
-  Image as VanImage,
34
-  ImagePreview,
35
-  Tabs,
36
-  Tab,
37
-} from 'vant'
23
+import { computed, ref } from 'vue'
24
+import { Swipe, SwipeItem, Image as VanImage, ImagePreview } from 'vant'
38 25
 
39 26
 export default {
40 27
   name: 'swiper',
@@ -42,27 +29,34 @@ export default {
42 29
     [Swipe.name]: Swipe,
43 30
     [SwipeItem.name]: SwipeItem,
44 31
     [VanImage.name]: VanImage,
45
-    [Tabs.name]: Tabs,
46
-    [Tab.name]: Tab,
47 32
   },
48 33
   props: {
49 34
     images: {
50 35
       type: Array,
51
-      default: () => [
52
-        {
53
-          image: '',
54
-          text: '暂无',
55
-        },
56
-      ],
36
+      default: () => [],
57 37
     },
58 38
   },
59 39
 
60 40
   setup(props) {
61 41
     const current = ref(0)
62 42
     const swipe = ref()
43
+    const indicator = ref()
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
+    })
63 56
 
64 57
     const onChange = (index) => {
65 58
       current.value = index
59
+      // indicator.value.scrollTo({ left: 1000 })
66 60
     }
67 61
     const onPerView = (index) => {
68 62
       ImagePreview({
@@ -79,10 +73,12 @@ export default {
79 73
     }
80 74
 
81 75
     // refs.checkbox.toggle();
82
-    onPerView
76
+
83 77
     return {
84 78
       swipe,
85 79
       current,
80
+      indicator,
81
+      imageList,
86 82
       onChange,
87 83
       onPerView,
88 84
       onClickTab,
@@ -106,11 +102,26 @@ export default {
106 102
     width: 100%;
107 103
   }
108 104
 }
109
-.swiper .van-swipe-item {
110
-  /* color: #fff;
111
-  font-size: 20px;
112
-  line-height: 150px;
113
-  text-align: center;
114
-  background-color: #39a9ed; */
105
+
106
+.swiper-indicator {
107
+  position: absolute;
108
+  bottom: 0;
109
+  left: 0;
110
+  background: rgba(0, 0, 0, 0.69);
111
+  color: #aaa;
112
+  display: flex;
113
+  flex-wrap: nowrap;
114
+  font-size: 0.85em;
115
+  min-width: 100vw;
116
+
117
+  span {
118
+    display: inline-block;
119
+    padding: 0.8em;
120
+    flex: none;
121
+
122
+    &.active {
123
+      color: #d75e3a;
124
+    }
125
+  }
115 126
 }
116 127
 </style>

+ 0
- 1
src/view/secondhand/detail/components/Follow.vue Parādīt failu

@@ -17,7 +17,6 @@
17 17
       block
18 18
       size="small"
19 19
       type="warning"
20
-      v-if="roomInfo.status === '0'"
21 20
       v-shiro="'room:info:addFollow'"
22 21
       @click="goToAddFollow"
23 22
     >

+ 4
- 8
src/view/secondhand/detail/components/Profile.vue Parādīt failu

@@ -138,20 +138,16 @@ export default {
138 138
 
139 139
               // 有跟进权限
140 140
               if (hasFollowPermission.value) {
141
-                confirm({
141
+                confirm(`您存在未跟进的房源,房源编号: ${followRoom.id}`, {
142 142
                   title: '去跟进',
143
-                  message: `您存在未跟进的房源,房源编号: ${followRoom.id}`,
144 143
                 }).then(() => {
145 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 149
               } else {
151
-                alert({
152
-                  title: '去跟进',
153
-                  message: `您存在未跟进的房源,房源编号: ${followRoom.id}`,
154
-                })
150
+                alert(`您存在未跟进的房源,房源编号: ${followRoom.id}`)
155 151
               }
156 152
             } else {
157 153
               showDanger('查看敏感信息失败')

+ 12
- 12
src/view/secondhand/detail/index.vue Parādīt failu

@@ -16,8 +16,8 @@
16 16
 
17 17
       <van-cell-group title="房源信息">
18 18
         <RoomProfile
19
-          :room-info="roomInfo"
20
-          :building="building"
19
+          :room-info="detail.roomInfo"
20
+          :building="detail.building"
21 21
           :other-data="roomOtherData"
22 22
         />
23 23
       </van-cell-group>
@@ -95,7 +95,7 @@
95 95
 </template>
96 96
 
97 97
 <script>
98
-import { ref, onMounted, computed, watch } from 'vue'
98
+import { ref, onMounted, computed } from 'vue'
99 99
 import { useRouter } from 'vue-router'
100 100
 import { Swiper } from '@/components/detailCompents'
101 101
 import {
@@ -169,15 +169,15 @@ export default {
169 169
 
170 170
     const { detail, getDetail } = useModel('room')
171 171
 
172
-    const roomInfo = ref({})
173
-    const building = ref({})
174
-    watch(detail, (nw) => {
175
-      roomInfo.value = nw.roomInfo
176
-      building.value = nw.building
177
-      // console.log('--------->', nw.building)
178
-    })
179
-    // const roomInfo = computed(() => detail.roomInfo || {})
180
-    // const building = computed(() => detail.building || {})
172
+    // const roomInfo = ref({})
173
+    // const building = ref({})
174
+    // watch(detail, (nw) => {
175
+    //   roomInfo.value = nw.roomInfo
176
+    //   building.value = nw.building
177
+    //   // console.log('--------->', nw.building)
178
+    // })
179
+    const roomInfo = computed(() => detail.roomInfo || {})
180
+    const building = computed(() => detail.building || {})
181 181
 
182 182
     const isNormalStatus = computed(() => {
183 183
       return detail.roomInfo?.status === '0'

+ 13
- 19
src/view/secondhand/edithouse/index.vue Parādīt failu

@@ -11,15 +11,15 @@
11 11
 </template>
12 12
 
13 13
 <script>
14
-import { watch } from "vue"
15
-import { useModel } from "@zjxpcyc/vue-tiny-store"
16
-import { useRoute, useRouter } from "vue-router"
17
-import { alert, showDanger } from "@/utils"
18
-import RoomBasic from "./components/Basic"
19
-import RoomForm from "./components/Form"
14
+import { onMounted } from 'vue'
15
+import { useModel } from '@zjxpcyc/vue-tiny-store'
16
+import { useRoute, useRouter } from 'vue-router'
17
+import { alert, showDanger } from '@/utils'
18
+import RoomBasic from './components/Basic'
19
+import RoomForm from './components/Form'
20 20
 
21 21
 export default {
22
-  name: "secondhanddetail",
22
+  name: 'secondhanddetail',
23 23
   components: {
24 24
     RoomBasic,
25 25
     RoomForm,
@@ -28,22 +28,12 @@ export default {
28 28
   setup() {
29 29
     const route = useRoute()
30 30
     const router = useRouter()
31
-    const { detail, getDetail, houseEdit } = useModel("room")
32
-
33
-    watch(
34
-      () => route.query.roomId,
35
-      (nw, od) => {
36
-        if (nw != od && nw) {
37
-          getDetail(nw)
38
-        }
39
-      },
40
-      { immediate: true }
41
-    )
31
+    const { detail, getDetail, houseEdit } = useModel('room')
42 32
 
43 33
     const handleSumbit = (values) => {
44 34
       houseEdit(values)
45 35
         .then(() => {
46
-          alert("编辑成功").then(() => {
36
+          alert('编辑成功').then(() => {
47 37
             router.go(-1)
48 38
           })
49 39
         })
@@ -52,6 +42,10 @@ export default {
52 42
         })
53 43
     }
54 44
 
45
+    onMounted(() => {
46
+      getDetail(route.query.roomId)
47
+    })
48
+
55 49
     return {
56 50
       handleSumbit,
57 51
       detail,