陈冉 6 years ago
parent
commit
407a10702e

+ 5
- 0
package-lock.json View File

14189
         "extsprintf": "^1.2.0"
14189
         "extsprintf": "^1.2.0"
14190
       }
14190
       }
14191
     },
14191
     },
14192
+    "viewer": {
14193
+      "version": "0.10.11",
14194
+      "resolved": "https://registry.npmjs.org/viewer/-/viewer-0.10.11.tgz",
14195
+      "integrity": "sha1-3yR20nxfxZFKGVOQG7P1RdlRyxs="
14196
+    },
14192
     "viewerjs": {
14197
     "viewerjs": {
14193
       "version": "1.3.0",
14198
       "version": "1.3.0",
14194
       "resolved": "https://registry.npmjs.org/viewerjs/-/viewerjs-1.3.0.tgz",
14199
       "resolved": "https://registry.npmjs.org/viewerjs/-/viewerjs-1.3.0.tgz",

+ 1
- 0
package.json View File

12
     "lodash.get": "^4.4.2",
12
     "lodash.get": "^4.4.2",
13
     "moment": "^2.22.2",
13
     "moment": "^2.22.2",
14
     "vant": "^1.3.10",
14
     "vant": "^1.3.10",
15
+    "viewer": "^0.10.11",
15
     "vue": "^2.5.17",
16
     "vue": "^2.5.17",
16
     "vue-amap": "^0.5.8",
17
     "vue-amap": "^0.5.8",
17
     "vue-awesome-swiper": "^3.1.3",
18
     "vue-awesome-swiper": "^3.1.3",

+ 1
- 0
src/App.vue View File

57
 </script>
57
 </script>
58
 
58
 
59
 <style>
59
 <style>
60
+.viewer-backdrop{background-color:rgba(0,0,0,0.8)!important}
60
 #app {
61
 #app {
61
   font-family: "Avenir", Helvetica, Arial, sans-serif;
62
   font-family: "Avenir", Helvetica, Arial, sans-serif;
62
   -webkit-font-smoothing: antialiased;
63
   -webkit-font-smoothing: antialiased;

+ 7
- 6
src/components/bigimages.vue View File

1
 <template>
1
 <template>
2
-  <div class="images" @click="close">
3
-    <!-- <img class="modal_content" :src="fileurl" preview /> -->
4
-    <swiper :options="swiperOption" ref="imgOverview" style="height: 100%;" >
5
-      <swiper-slide class="swiper-zoom-container">
6
-        <!-- <div class="swiper-zoom-container"> -->
2
+  <div class="images">
3
+     <!-- <slot :images="images" :options="options">
4
+       <img :src="fileurl" alt="" >
5
+    </slot> -->
6
+    <swiper :options="swiperOption" ref="imgOverview" style="height: 100%;" @click="close">
7
+      <swiper-slide class="swiper-zoom-container"> 
7
           <img :src="fileurl" alt="" >
8
           <img :src="fileurl" alt="" >
8
-        <!-- </div> -->
9
       </swiper-slide>
9
       </swiper-slide>
10
     </swiper>
10
     </swiper>
11
   </div>
11
   </div>
26
 },
26
 },
27
   methods: {
27
   methods: {
28
     close() {
28
     close() {
29
+      // alert(1)
29
       this.$emit("close");
30
       this.$emit("close");
30
     },
31
     },
31
   }
32
   }

+ 10
- 0
src/main.js View File

11
 import 'vue-photo-preview/dist/skin.css'
11
 import 'vue-photo-preview/dist/skin.css'
12
 import AMap from "vue-amap";
12
 import AMap from "vue-amap";
13
 import myTouch from "./touch/myTouch";
13
 import myTouch from "./touch/myTouch";
14
+import 'viewerjs/dist/viewer.css'
15
+import Viewer from 'v-viewer'
14
 AMap.initAMapApiLoader({
16
 AMap.initAMapApiLoader({
15
   key: "73df496773bd9a021d44d32d6e272fb5", //自己申请
17
   key: "73df496773bd9a021d44d32d6e272fb5", //自己申请
16
   plugin: [
18
   plugin: [
29
 
31
 
30
 
32
 
31
 
33
 
34
+Viewer.setDefaults({
35
+  zIndexInline: 2017,
36
+  toolbar:false,
37
+  navbar:false,
38
+  title:false,
39
+  // movable:false,
32
 
40
 
41
+})
33
 
42
 
34
 
43
 
35
 Vue.filter('moment', function (value, formatString) {
44
 Vue.filter('moment', function (value, formatString) {
43
 Vue.use(VueAwesomeSwiper)
52
 Vue.use(VueAwesomeSwiper)
44
 Vue.use(preview)
53
 Vue.use(preview)
45
 Vue.use(myTouch)
54
 Vue.use(myTouch)
55
+Vue.use(Viewer)
46
 
56
 
47
 Vue.config.productionTip = false
57
 Vue.config.productionTip = false
48
 
58
 

+ 32
- 41
src/pages/building/buildingimage.vue View File

6
         <swiper :options="swiperOption" ref="mySwiper" class="slidewrapper">
6
         <swiper :options="swiperOption" ref="mySwiper" class="slidewrapper">
7
           <swiper-slide class="slideimg" v-for="(list1, index1) in detail.imageLst1" :key="index1" >
7
           <swiper-slide class="slideimg" v-for="(list1, index1) in detail.imageLst1" :key="index1" >
8
             <div  class="selsectimg">
8
             <div  class="selsectimg">
9
-              <img class="lazyimage" :src="list1.fileurl" @click="viewpicture1(list1)"/>
9
+              <img class="lazyimage" :src="list1.fileurl" v-viewer/>
10
               <div class="houseindex">
10
               <div class="houseindex">
11
                 <span class="imagetype">{{list1.name}}</span>
11
                 <span class="imagetype">{{list1.name}}</span>
12
                 <div class="imageindex" >
12
                 <div class="imageindex" >
32
           </swiper-slide>
32
           </swiper-slide>
33
           <swiper-slide class="slideimg" v-for="(list2, index2) in detail.imageLst2" :key="index2" >
33
           <swiper-slide class="slideimg" v-for="(list2, index2) in detail.imageLst2" :key="index2" >
34
             <div class="selsectimg">
34
             <div class="selsectimg">
35
-              <img class="lazyimage" :src="list2.fileurl"  @click="viewpicture2(list2)"/>
35
+              <img class="lazyimage" :src="list2.fileurl"  v-viewer/>
36
               <div class="houseindex">
36
               <div class="houseindex">
37
                 <span class="imagetype">{{list2.name}}</span>
37
                 <span class="imagetype">{{list2.name}}</span>
38
                 <div class="imageindex">
38
                 <div class="imageindex">
58
           </swiper-slide>
58
           </swiper-slide>
59
           <swiper-slide class="slideimg" v-for="(list3, index3) in detail.imageLst3" :key="index3" >
59
           <swiper-slide class="slideimg" v-for="(list3, index3) in detail.imageLst3" :key="index3" >
60
             <div class="selsectimg">
60
             <div class="selsectimg">
61
-              <img class="lazyimage" :src="list3.fileurl" @click="viewpicture3(list3)"/>
61
+              <img class="lazyimage" :src="list3.fileurl" v-viewer/>
62
               <div class="houseindex">
62
               <div class="houseindex">
63
                 <span class="imagetype">{{list3.name}}</span>
63
                 <span class="imagetype">{{list3.name}}</span>
64
                 <div class="imageindex">
64
                 <div class="imageindex">
84
           </swiper-slide>
84
           </swiper-slide>
85
           <swiper-slide class="slideimg" v-for="(list4, index4) in detail.imageLst4" :key="index4" >
85
           <swiper-slide class="slideimg" v-for="(list4, index4) in detail.imageLst4" :key="index4" >
86
             <div class="selsectimg">
86
             <div class="selsectimg">
87
-              <img class="lazyimage" :src="list4.fileurl" @click="viewpicture4(list4)"/>
87
+              <img class="lazyimage" :src="list4.fileurl" v-viewer/>
88
               <div class="houseindex">
88
               <div class="houseindex">
89
                 <span class="imagetype">{{list4.name}}</span>
89
                 <span class="imagetype">{{list4.name}}</span>
90
                 <div class="imageindex">
90
                 <div class="imageindex">
110
           </swiper-slide>
110
           </swiper-slide>
111
           <swiper-slide class="slideimg" v-for="(list5, index5) in detail.imageLst5" :key="index5">
111
           <swiper-slide class="slideimg" v-for="(list5, index5) in detail.imageLst5" :key="index5">
112
             <div class="selsectimg">
112
             <div class="selsectimg">
113
-              <img class="lazyimage" :src="list5.fileurl" @click="viewpicture5(list5)"/>
113
+              <img class="lazyimage" :src="list5.fileurl" v-viewer/>
114
               <div class="houseindex">
114
               <div class="houseindex">
115
                 <span class="imagetype">{{list5.name}}</span>
115
                 <span class="imagetype">{{list5.name}}</span>
116
                 <div class="imageindex">
116
                 <div class="imageindex">
142
         <span class="boxcharacters" :class='{active:list.active}'>{{list.imagetypename}}</span>
142
         <span class="boxcharacters" :class='{active:list.active}'>{{list.imagetypename}}</span>
143
       </div>
143
       </div>
144
     </div>
144
     </div>
145
-  <!-- <div class="bigimages"> -->
146
-   <big-images v-if="imgLook.state" :fileurl='imgLook.fileurl' @close='imgLook.state=false'></big-images>
147
-  <!-- </div> -->
145
+   <!-- <big-images v-if="imgLook.state" :fileurl='imgLook.fileurl' @close='imgLook.state=false'></big-images> -->
148
   </div>
146
   </div>
149
 </template>
147
 </template>
150
 
148
 
151
 <script>
149
 <script>
152
 import { mapState, mapActions } from "vuex";
150
 import { mapState, mapActions } from "vuex";
153
 import bottomDrawing from "../../img/bottomdrawing.jpg";
151
 import bottomDrawing from "../../img/bottomdrawing.jpg";
154
-import BigImages from '../../components/bigimages.vue'
152
+// import BigImages from '../../components/bigimages.vue'
155
 
153
 
156
 export default {
154
 export default {
157
   name: "BuildingImage",
155
   name: "BuildingImage",
169
         preloadImages:false,
167
         preloadImages:false,
170
         speed: 500,
168
         speed: 500,
171
       },
169
       },
172
-      // selected:true,
173
       isactive: false,
170
       isactive: false,
174
-      imgLook:{
175
-        state:false,
176
-        fileurl:''
177
-      }
171
+      // imgLook:{
172
+      //   state:false,
173
+      //   fileurl:''
174
+      // }
178
     };
175
     };
179
   },
176
   },
180
   components: {
177
   components: {
181
     "vue-headful": () => import("vue-headful"),
178
     "vue-headful": () => import("vue-headful"),
182
-    'BigImages':BigImages,
179
+    // 'BigImages':BigImages,
183
   },
180
   },
184
   computed: {
181
   computed: {
185
     ...mapState({
182
     ...mapState({
186
       detail: s => s.buildingimage.detail
183
       detail: s => s.buildingimage.detail
187
     })
184
     })
188
-    // swiper() {
189
-    //     return this.$refs.mySwiper.swiper;
190
-    //   }
191
   },
185
   },
192
   created() {
186
   created() {
193
     this.getBuildingimage({ buildingid: this.$route.query.id }).then(() => {
187
     this.getBuildingimage({ buildingid: this.$route.query.id }).then(() => {
194
-      // this.$previewRefresh()
195
       this.showPage = true;
188
       this.showPage = true;
196
       this.lists = this.detail.imageTypeLst;
189
       this.lists = this.detail.imageTypeLst;
197
       this.lists.forEach((curr, index) => {
190
       this.lists.forEach((curr, index) => {
205
       on: {
198
       on: {
206
         slideChangeTransitionEnd: () => {
199
         slideChangeTransitionEnd: () => {
207
           let swiper = this.$refs.mySwiper.swiper;
200
           let swiper = this.$refs.mySwiper.swiper;
208
-          //  let selected=swiper.activeIndex;
209
-          // window.console.log(selected)
210
           if (swiper.activeIndex < parseInt(this.detail.imageLstCount1)) {
201
           if (swiper.activeIndex < parseInt(this.detail.imageLstCount1)) {
211
             let list = [];
202
             let list = [];
212
             this.lists.forEach((curr, index) => {
203
             this.lists.forEach((curr, index) => {
291
     this.swiperOption = { ...config };
282
     this.swiperOption = { ...config };
292
   },
283
   },
293
   methods: {
284
   methods: {
294
-    viewpicture1(list1){
295
-      this.imgLook.state = true
296
-      this.imgLook.fileurl = list1.fileurl
297
-    },
298
-    viewpicture2(list2){
299
-      this.imgLook.state = true
300
-      this.imgLook.fileurl = list2.fileurl
301
-    },
302
-      viewpicture3(list3){
303
-      this.imgLook.state = true
304
-      this.imgLook.fileurl = list3.fileurl
305
-    },
306
-      viewpicture4(list4){
307
-      this.imgLook.state = true
308
-      this.imgLook.fileurl = list4.fileurl
309
-    },
310
-      viewpicture5(list5){
311
-      this.imgLook.state = true
312
-      this.imgLook.fileurl = list5.fileurl
313
-    },
285
+    // viewpicture1(list1){
286
+    //   this.imgLook.state = true
287
+    //   this.imgLook.fileurl = list1.fileurl
288
+    // },
289
+    // viewpicture2(list2){
290
+    //   this.imgLook.state = true
291
+    //   this.imgLook.fileurl = list2.fileurl
292
+    // },
293
+    //   viewpicture3(list3){
294
+    //   this.imgLook.state = true
295
+    //   this.imgLook.fileurl = list3.fileurl
296
+    // },
297
+    //   viewpicture4(list4){
298
+    //   this.imgLook.state = true
299
+    //   this.imgLook.fileurl = list4.fileurl
300
+    // },
301
+    //   viewpicture5(list5){
302
+    //   this.imgLook.state = true
303
+    //   this.imgLook.fileurl = list5.fileurl
304
+    // },
314
     ...mapActions(["getBuildingimage"]),
305
     ...mapActions(["getBuildingimage"]),
315
     toggle(ind, detail) {
306
     toggle(ind, detail) {
316
       let list = [];
307
       let list = [];

+ 23
- 21
src/pages/building/buildingtype.vue View File

4
         <div class="typeheader">
4
         <div class="typeheader">
5
             <swiper class="slidewrapper" >
5
             <swiper class="slidewrapper" >
6
                 <swiper-slide class="slideimg" v-for="(list, index) in detail.buildingModelLst" :key="index">
6
                 <swiper-slide class="slideimg" v-for="(list, index) in detail.buildingModelLst" :key="index">
7
-                    <!-- <img class="typeimg" :src="noHouse" v-if="!detail.buildingModelLst.modelurl"/> -->
8
-                    <img class="typeimg" :src="list.modelurl" @click="viewpicture(list)"/>
7
+                  <!-- <slot :images="images" :options="options">
8
+                   <img class="typeimg" :src="list.modelurl" v-if="detail.buildingModelLst[index].modelurl" @click="viewpicture(list)"/>
9
+                    <img class="typeimg" :src="noHouse" v-else/>
10
+                  </slot> -->
11
+                    <img class="typeimg" :src="list.modelurl" v-if="detail.buildingModelLst[index].modelurl" v-viewer/>
12
+                    <img class="typeimg" :src="noHouse" v-else/>
9
                     <div class="typeindex">
13
                     <div class="typeindex">
10
                         <span class="typename">{{list.name}}</span>
14
                         <span class="typename">{{list.name}}</span>
11
                         <div class="imageindex" >
15
                         <div class="imageindex" >
46
                 </swiper-slide>
50
                 </swiper-slide>
47
             </swiper>
51
             </swiper>
48
         </div>
52
         </div>
49
-    <big-images v-if="imgLook.state" :fileurl='imgLook.fileurl' @close='imgLook.state=false'></big-images>
53
+    <!-- <big-images v-if="imgLook.state" :fileurl='imgLook.fileurl' @close='imgLook.state=false'></big-images> -->
50
     </div>
54
     </div>
51
 </template>
55
 </template>
52
 
56
 
53
 <script>
57
 <script>
54
-// import noHouse from "../../img/nohouse.jpg";
58
+import noHouse from "../../img/nohouse.jpg";
55
 import noHouseType from "../../img/nohousetype.png";
59
 import noHouseType from "../../img/nohousetype.png";
56
 import { mapState, mapActions } from "vuex";
60
 import { mapState, mapActions } from "vuex";
57
-// import TypeImages from '../../components/typeimage.vue'
58
-import BigImages from '../../components/bigimages.vue'
61
+// import BigImages from '../../components/bigimages.vue'
59
 
62
 
60
 export default {
63
 export default {
61
   name: "BuildingType",
64
   name: "BuildingType",
63
     return {
66
     return {
64
       activeName2: "id",
67
       activeName2: "id",
65
       showPage:false,
68
       showPage:false,
66
-      // noHouse,
69
+      noHouse,
67
       noHouseType,
70
       noHouseType,
68
-      // imgTypeLook:{
71
+      //  imgLook:{
69
       //   state:false,
72
       //   state:false,
70
-      //   modelurl:''
73
+      //   fileurl:''
71
       // }
74
       // }
72
-       imgLook:{
73
-        state:false,
74
-        fileurl:''
75
-      }
76
     };
75
     };
77
   },
76
   },
78
   components: {
77
   components: {
79
     "vue-headful": () => import("vue-headful"),
78
     "vue-headful": () => import("vue-headful"),
80
     // 'TypeImages':TypeImages
79
     // 'TypeImages':TypeImages
81
-    'BigImages':BigImages,
80
+    // 'BigImages':BigImages,
82
   },
81
   },
83
   computed: {
82
   computed: {
84
     ...mapState({
83
     ...mapState({
91
     });
90
     });
92
   },
91
   },
93
   methods: {
92
   methods: {
94
-    viewpicture(list){
95
-      this.imgLook.state = true
96
-      this.imgLook.fileurl = list.modelurl
97
-    },
93
+    // viewpicture(list){
94
+    //   this.imgLook.state = true
95
+    //   this.imgLook.fileurl = list.modelurl
96
+    // },
98
     ...mapActions(["getBuildingtype"]),
97
     ...mapActions(["getBuildingtype"]),
99
     gotobuilding(){
98
     gotobuilding(){
100
       this.$router.go(-1)
99
       this.$router.go(-1)
128
 
127
 
129
       .slideimg {
128
       .slideimg {
130
         width: 100%;
129
         width: 100%;
130
+        display: flex;
131
+        flex-direction: column;
132
+        align-items: center;
131
         /* height: 225px; */
133
         /* height: 225px; */
132
 
134
 
133
         .noslideimg{
135
         .noslideimg{
134
           height:100%;
136
           height:100%;
135
           width:100%;
137
           width:100%;
136
-           display: flex;
138
+          display: flex;
137
           flex-direction: column;
139
           flex-direction: column;
138
           align-items: center;
140
           align-items: center;
139
 
141
 
157
         }
159
         }
158
         
160
         
159
         .typeimg {
161
         .typeimg {
160
-          width: 100%;
161
-          height: 225px;
162
+          max-width: 100%;
163
+          max-height: 225px;
162
         }
164
         }
163
 
165
 
164
         .typeindex {
166
         .typeindex {

+ 5
- 3
src/pages/building/perimetertype.vue View File

96
       new AMap.Marker({
96
       new AMap.Marker({
97
         position: [routerParams.lng, routerParams.lat],
97
         position: [routerParams.lng, routerParams.lat],
98
         title: "routerParams.buildingname",
98
         title: "routerParams.buildingname",
99
-        map: map
99
+        map: map,
100
+        icon:"https://webapi.amap.com/theme/v1.3/markers/n/mark_r.png",
100
       });
101
       });
101
       this.searchAround(routerParams.tag);
102
       this.searchAround(routerParams.tag);
102
       if (routerParams.tag == "学校") {
103
       if (routerParams.tag == "学校") {
142
       new AMap.Marker({
143
       new AMap.Marker({
143
         position: [routerParams.lng, routerParams.lat],
144
         position: [routerParams.lng, routerParams.lat],
144
         title: "routerParams.buildingname",
145
         title: "routerParams.buildingname",
145
-        map: map
146
+        map: map,
147
+        icon:"https://webapi.amap.com/theme/v1.3/markers/n/mark_r.png",
146
       });
148
       });
147
       this.searchAround(val);
149
       this.searchAround(val);
148
       if (val == "学校") {
150
       if (val == "学校") {
175
     border-radius:50%;
177
     border-radius:50%;
176
     background: rgba(255,255,255,1);
178
     background: rgba(255,255,255,1);
177
     position:absolute;
179
     position:absolute;
178
-    top: 63%;
180
+    top: 55%;
179
     right: 4%;
181
     right: 4%;
180
     z-index: 4;
182
     z-index: 4;
181
     border: 1px solid rgba(59,153,252,1);
183
     border: 1px solid rgba(59,153,252,1);

+ 1
- 1
src/pages/reservation/lookhouse.vue View File

309
         width: 90%;
309
         width: 90%;
310
         height: 125px;
310
         height: 125px;
311
         position: relative;
311
         position: relative;
312
-        margin: 8px 0 0 15px;
312
+        margin: 10px 0 0 15px;
313
 
313
 
314
         .content_txt {
314
         .content_txt {
315
           width: 100%;
315
           width: 100%;