Your Name 4 years ago
parent
commit
71d8c6aeac

+ 4
- 13
src/components/detailCompents/swiper/index.vue View File

4
       <van-swipe-item v-for="(image, index) in images" :key="index" >
4
       <van-swipe-item v-for="(image, index) in images" :key="index" >
5
         <van-image
5
         <van-image
6
           height="300"
6
           height="300"
7
-          fit="contain"
8
           :src="image.image"
7
           :src="image.image"
9
           @click="onPerView(index)"
8
           @click="onPerView(index)"
10
         />
9
         />
24
           v-for="(image, index) in images"
23
           v-for="(image, index) in images"
25
           :key="index"
24
           :key="index"
26
           :title="image.text"
25
           :title="image.text"
27
-          
28
         >
26
         >
29
-          <!-- {{ image.text }} -->
30
         </van-tab>
27
         </van-tab>
31
       </van-tabs>
28
       </van-tabs>
32
     </div>
29
     </div>
53
     [Tabs.name]: Tabs,
50
     [Tabs.name]: Tabs,
54
     [Tab.name]: Tab,
51
     [Tab.name]: Tab,
55
   },
52
   },
56
-
57
-  //   images = [
58
-  //       'https://img.yzcdn.cn/vant/apple-1.jpg',
59
-  //       'https://img.yzcdn.cn/vant/apple-2.jpg',
60
-  //     ];
61
-
62
   props: {
53
   props: {
63
     images: {
54
     images: {
64
       type: Array,
55
       type: Array,
68
 
59
 
69
   setup(props,) {
60
   setup(props,) {
70
     const current = ref(0);
61
     const current = ref(0);
71
-const swipe = ref();
62
+    const swipe = ref();
72
     
63
     
73
     const onChange = (index) => {
64
     const onChange = (index) => {
74
       current.value = index;
65
       current.value = index;
82
     };
73
     };
83
     const onClickTab = (index) => {
74
     const onClickTab = (index) => {
84
       current.value=index
75
       current.value=index
85
-    swipe.value.swipeTo(index)
86
-swipe.value.resize()
76
+      swipe.value.swipeTo(index)
77
+      swipe.value.resize()
87
     
78
     
88
       console.log(index,  "ongchawng");
79
       console.log(index,  "ongchawng");
89
     };
80
     };
91
     // refs.checkbox.toggle();
82
     // refs.checkbox.toggle();
92
     onPerView;
83
     onPerView;
93
     return {
84
     return {
94
-        swipe,
85
+      swipe,
95
       current,
86
       current,
96
       onChange,
87
       onChange,
97
       onPerView,
88
       onPerView,

+ 9
- 1
src/view/secondhand/detail/index.vue View File

170
       getDetail,
170
       getDetail,
171
     } = useModel("room")
171
     } = useModel("room")
172
 
172
 
173
+    const { dicts, getDict } = useModel('dicts')
174
+
175
+    const getRescType = val => {
176
+      const rescTypes = dicts['roomResc_type'] || []
177
+      return (rescTypes.filter(x => x.value === val)[0] || {}).text
178
+    }
179
+
173
     const imageList = computed(() => {
180
     const imageList = computed(() => {
174
-      return (detail.RoomResc || []).filter(x => x.imgType !== '0').map(x => ({image: x.url, text: ''}))
181
+      return (detail.RoomResc || []).filter(x => x.imgType !== '0').map(x => ({image: x.url, text: getRescType(x.imgType)}))
175
     })
182
     })
176
 
183
 
177
     onMounted(() => {
184
     onMounted(() => {
178
       getDetail(roomId);
185
       getDetail(roomId);
186
+      getDict('roomResc_type')
179
     });
187
     });
180
 
188
 
181
     const shareOptions = [
189
     const shareOptions = [

+ 2
- 2
vue.config.js View File

11
     disableHostCheck: true,
11
     disableHostCheck: true,
12
     proxy: {
12
     proxy: {
13
       '/mp': {
13
       '/mp': {
14
-        target: 'http://10.161.7.66:8080/',
15
-        // target: 'http://localhost:8080/',
14
+        // target: 'http://10.161.7.66:8080/',
15
+        target: 'http://localhost:8080/',
16
         ws: true,
16
         ws: true,
17
         changeOrigin: true,
17
         changeOrigin: true,
18
         // pathRewrite: {'^/mp': ''}
18
         // pathRewrite: {'^/mp': ''}