panhui 7 лет назад
Родитель
Сommit
9ee50a0adb

+ 24 - 3
src/main/House/src/main.js

@@ -28,11 +28,24 @@ css.innerHTML = `html{font-size: ${fontSize}px}`
 document.head.appendChild(css)
 var iNoBounce = require('./inobounce.min.js')
 var isiOS = !!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
-// const baseUrl = process.env.NODE_ENV === 'production' ? '../' : 'http://www.xiangjuwu.com';
-const baseUrl = 'http://www.xiangjuwu.com'
+const baseUrl = process.env.NODE_ENV === 'production' ? '../' : 'http://localhost:8080';
+// const baseUrl = 'http://www.xiangjuwu.com'
 store.commit('updateBaseUrl', baseUrl)
 axios.defaults.withCredentials = true;
 axios.defaults.baseURL = baseUrl;
+
+let houseId = getQueryString('houseId')
+if (houseId) {
+    store.commit('updateRedirect', {
+        name: 'houseDetail',
+        query: {
+            id: houseId
+        }
+    })
+}
+
+
+
 Vue.prototype.$http = {
     get(params) {
         return new Promise((resolve, reject) => {
@@ -208,4 +221,12 @@ new Vue({
             iNoBounce.disable()
         }
     }
-})
+})
+
+
+function getQueryString(name) {
+    let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i')
+    let r = window.location.search.substr(1).match(reg)
+    if (r != null) return unescape(r[2])
+    return null
+}

+ 20 - 1
src/main/House/src/pages/Home.vue

@@ -186,6 +186,25 @@ export default {
 
 
 
+        wx.ready(() => {
+            wx.onMenuShareTimeline({
+                title: `享居屋租房———首页`,
+                link: 'http://www.xiangjuwu.com/wx/auth?redirectUri=home',
+                imgUrl: 'http://www.xiangjuwu.com/images/logo.png'
+            })
+            wx.onMenuShareAppMessage({
+                title: '享居屋租房———首页',
+                desc: `让租房变的简单`,
+                link: 'http://www.xiangjuwu.com/wx/auth?redirectUri=home',
+                imgUrl: 'http://www.xiangjuwu.com/images/logo.png'
+            })
+        })
+
+
+        if (this.redirect) {
+            this.$router.push(this.redirect)
+        }
+
 
 
     },
@@ -198,7 +217,7 @@ export default {
         }
     },
     computed: {
-        ...mapState(["locationInfo"]),
+        ...mapState(["locationInfo", "redirect"]),
     },
     methods: {
         goLocation() {

+ 24 - 5
src/main/House/src/pages/HouseDetail.vue

@@ -57,7 +57,7 @@
             </div>
             <div class="box">
                 <div class="boxTitle">房源配置</div>
-                <hr/>
+                <hr />
                 <div class="setList">
                     <div class="set-item" v-for="item in info.houseParts">
                         <img :src="item.image" alt="">
@@ -67,11 +67,11 @@
             </div>
             <div class="box">
                 <div class="boxTitle">房源介绍</div>
-                <hr/>
+                <hr />
                 <div class="message">
                     {{info.houseIntroduce}}
                 </div>
-                <hr/>
+                <hr />
                 <div class="userInfo" v-if="info.keeper">
                     <div class="icon" :style="{backgroundImage:'url('+info.keeper.icon+')'}"></div>
                     <div class="right">
@@ -79,10 +79,13 @@
                         <div class="position">{{info.keeper.position}}</div>
                     </div>
                 </div>
+                <div class="message" style="color:#000" v-if="info.phone">
+                    业务员电话:{{info.phone}}
+                </div>
             </div>
-            <div class="box">
+            <div class="box" v-if="info.housingDistrictInfo">
                 <div class="boxTitle">位置及周边</div>
-                <hr/>
+                <hr />
                 <div class="mapcontent" v-if="info.housingDistrictInfo">
                     <div id="Map" class="map" @click="goLocation">
                         <img src="@/assets/xq_icon_dingwei.png" alt="">
@@ -161,6 +164,8 @@ export default {
         }
 
 
+
+
     },
     mounted() {
         window.init = () => {
@@ -174,6 +179,20 @@ export default {
                     }
                 })
                 this.initMap();
+
+                wx.ready(() => {
+                    wx.onMenuShareTimeline({
+                        title: `享居屋租房———`+this.rentType[parseInt(this.info.rentingType)]+this.info.title+this.info.room室+this.info.hall+厅,
+                        link: 'http://www.xiangjuwu.com/wx/auth?redirectUri=houseDetail?id=' + this.$route.query.id,
+                        imgUrl: this.info.houseImages[0].imageUrl
+                    })
+                    wx.onMenuShareAppMessage({
+                        title: `享居屋租房———`+this.rentType[parseInt(this.info.rentingType)]+this.info.title+this.info.room室+this.info.hall+厅,
+                        desc: `让租房变的简单`,
+                        link: 'http://www.xiangjuwu.com/wx/auth?redirectUri=houseDetail?id=' + this.$route.query.id,
+                        imgUrl: this.info.houseImages[0].imageUrl
+                    })
+                })
             })
 
         };

+ 6 - 6
src/main/House/src/router/index.js

@@ -211,13 +211,13 @@ router.beforeEach((to, from, next) => {
                         return;
                     }
                 }
-                // next('/login');
-                if (isWeiXin) {
-                    window.open('http://xjw.izouma.com/wx/auth?redirectUri=' + to.name);
+                next('/login');
+                // if (isWeiXin) {
+                //     window.open('http://xjw.izouma.com/wx/auth?redirectUri=' + to.name);
 
-                } else {
-                    next('/login')
-                }
+                // } else {
+                //     next('/login')
+                // }
             }).catch(() => {
                 // next('/login');
             })

+ 5 - 1
src/main/House/src/store/index.js

@@ -13,9 +13,13 @@ export default new Vuex.Store({
         customerPhone: '400886886',
         baseUrl: '',
         fetchingData: false,
-        orderStatus: ['待客服确认', '带看房', '已完成', '已取消']
+        orderStatus: ['待客服确认', '带看房', '已完成', '已取消'],
+        redirect: null
     },
     mutations: {
+        updateRedirect(state, redirect) {
+            state.redirect = redirect
+        },
         updateLoading(state, status) {
             state.isLoading = status
         },