DaMowang 2 жил өмнө
parent
commit
af12fc2c0e

+ 14 - 2
src/pagesB/hotel/hotel.vue

@@ -13,7 +13,7 @@
             </div>
             <div class="h_address flex_r flex_jb flex_as">
                 <div class="address">{{ detail.address }}</div>
-                <div class="iconfont ico">&#xe6b3;</div>
+                <div class="iconfont ico" @click="openm">&#xe6b3;</div>
             </div>
             <div class="RatePlan">
                 <div class="Room" v-for="(i,s) in RatePlan" :key="s">
@@ -123,7 +123,19 @@ export default {
             let qd = Object.assign({ checkInDate, checkOutDate, hotelID: this.hotelID }, a, b);
             setCache("roomInfo", qd)
             this.goto("/pagesB/hotel/hotelDetail");
-        }
+        },
+        openm() {
+            let latitude = this.detail.googleLat;
+            let longitude = this.detail.googleLon;
+            let name = this.detail.hotelName;
+            let address = this.detail.address;
+            uni.openLocation({
+                latitude, longitude, scale: 18, name, address,
+                success: function() {
+                    console.log('success');
+                }
+            });
+        },
     },
     onLoad(da) {
         this.hotelID = da.id;

+ 3 - 17
src/pagesB/hotel/orderDetail.vue

@@ -107,33 +107,19 @@ export default {
                     this.detail = res.data.detail.data
                     this.order = res.data.order
                     let de = JSON.parse(res.data.order.product_detail)
-                    let { hotelID,checkInDate,checkOutDate,ratePlanID } = de
-                    this.gethotel({ hotelID,checkInDate,checkOutDate },ratePlanID)
+                    let { hotelID,checkInDate,checkOutDate } = de
+                    this.gethotel({ hotelID,checkInDate,checkOutDate })
                 }
             })
         },
-        gethotel(da,ratePlanID){
+        gethotel(da){
             post("/local/hotel/detail", da).then((res) => {
                 if (res.code == 0) {
                     this.hotel = res.data.data;
                 }
             });
-            post("/local/hotel/room", da).then((res) => {
-                if (res.code == 0) {
-                    let da = res.data.data.rooms;
-                    for (const a of da) {
-                        for (const b of a.ratePlans) {
-                            if(b.ratePlanId == ratePlanID){
-                                this.ratePlan = Object.assign({},a,b)
-                                console.log(this.ratePlan);
-                            }
-                        }
-                    }
-                }
-            });
         },
         openm() {
-            console.log(12);
             let latitude = this.hotel.googleLat;
             let longitude = this.hotel.googleLon;
             let name = this.hotel.hotelName;