Bladeren bron

feat:更新第一版修改

jinx 4 jaren geleden
bovenliggende
commit
cf7f6dfdf9

+ 3 - 0
apps/RealtorEasier/components/chat-input/chat-input.js

@@ -167,6 +167,7 @@ Component({
         },
         _send$voice$move$event(e) {
             if ('send$voice$btn' === e.currentTarget.id) {
+                console.log(this.data)
                 const {windowHeight, voiceObj, tabBarHeight, cancelLineYPosition} = this.data,
                     y = windowHeight + tabBarHeight - e.touches[0].clientY;
                 if (y > cancelLineYPosition) {
@@ -264,6 +265,7 @@ Component({
                 textMessage: '',
                 'inputType': 'none'
             }, () => {
+
                 if (!!this.data.inputValueEventTemp) {
                     this.triggerEvent(EVENT.SEND_MESSAGE, {value: this.data.inputValueEventTemp});
                     this.data.inputValueEventTemp = '';
@@ -279,6 +281,7 @@ Component({
         },
         _chatInput$extra$item$click$event(e) {
             const {currentTarget: {dataset}} = e;
+            
             this.triggerEvent(EVENT.EXTRA_ITEM_CLICK, {...dataset}, {});
         },
 

+ 2 - 1
apps/RealtorEasier/components/contact-user/cantact-user.wxml

@@ -6,7 +6,8 @@
     <view class="username">{{agent_user.name ? agent_user.name : ''}}</view>
     <view class="user-type">{{agent_user.store ? agent_user.store : ''}}</view>
   </view>
-  <button class="msg-btn btn" data-action="senMsg" open-type="getUserInfo" bindgetuserinfo="bindgetuserinfo" wx:if="{{ !loginStatus }}">在线问</button>
+  <button class="msg-btn btn" data-action="senMsg" open-type="getUserInfo" bindtap="bindgetuserinfo" wx:if="{{ !loginStatus }}">在线问</button>
+  <!-- <button class="msg-btn btn" data-action="senMsg" open-type="getUserInfo" bindtap="bindgetuserinfo" wx:if="{{ !loginStatus }}">在线问</button> -->
   <button class="msg-btn btn" bindtap="senMsg" wx:else>在线问</button>
   <button class="phone-btn btn" bindtap="makePhone">打电话</button>
 </view>

+ 1 - 1
apps/RealtorEasier/components/detail-components/detail-scroll/detail-scroll.wxml

@@ -9,7 +9,7 @@
             <image class="follow-icon" src="/image/4Dage/detail/icon-follow.svg" />
             关注
           </button>
-          <button class="follow-status" data-action="changeFocusStatus" open-type="getUserInfo" bindgetuserinfo="bindgetuserinfo" wx:elif="{{ !loginStatus && app_type === 'user' }}">
+          <button class="follow-status" data-action="changeFocusStatus" open-type="getUserInfo" bindtap="bindgetuserinfo" wx:elif="{{ !loginStatus && app_type === 'user' }}">
             <image class="follow-icon" src="/image/4Dage/detail/icon-follow.svg" />
             关注
           </button>

+ 1 - 1
apps/RealtorEasier/components/login-pannel/login-pannel.wxml

@@ -5,6 +5,6 @@
     <cover-image class="login-logo" src="/image/4Dage/login-logo.png" mode="heightFix"></cover-image>
     <cover-view class="logo-bottom-tips">四维时代网络科技有限公司申请获取以下权限</cover-view>
     <cover-view class="tips">·获得您的公开信息(昵称、头像等)</cover-view>
-    <button class="login-btn" open-type="getUserInfo" bindgetuserinfo="bindgetuserinfo">微信授权登录</button>
+    <button class="login-btn" open-type="getUserInfo" bindtap="bindgetuserinfo">微信授权登录</button>
   </cover-view>
 </cover-view>

+ 4 - 4
apps/RealtorEasier/config/config.js

@@ -1,6 +1,6 @@
-// export const IM_HOST = 'wss://vrhouse2.4dkankan.com'
+export const IM_HOST = 'wss://vrhouse2.4dkankan.com'
 
-// export const API_BASE_URL = 'https://vrhouse2.4dkankan.com'
+export const API_BASE_URL = 'https://vrhouse2.4dkankan.com'
 
 
 // export const IM_HOST = 'ws://192.168.0.83:8085'
@@ -8,6 +8,6 @@
 // export const API_BASE_URL = 'http://192.168.0.83:8085'
 
 
-export const IM_HOST = 'wss://vrhouse.4dkankan.com'
+// export const IM_HOST = 'wss://vrhouse.4dkankan.com'
 
-export const API_BASE_URL = 'https://vrhouse.4dkankan.com'
+// export const API_BASE_URL = 'https://vrhouse.4dkankan.com'

+ 1 - 1
apps/RealtorEasier/dist/button/index.wxml

@@ -31,7 +31,7 @@
         send-message-img="{{ sendMessageImg }}" 
         show-message-card="{{ showMessageCard }}" 
         bindcontact="openTypeEvent" 
-        bindgetuserinfo="openTypeEvent"
+        bindtap="openTypeEvent"
         bindgetphonenumber="openTypeEvent" 
         bindopensetting="openTypeEvent">
 </button>

+ 1 - 1
apps/RealtorEasier/pages/agent-detail/agent-detail.wxml

@@ -45,7 +45,7 @@
 </scroll-view>
 
 <view class="footer">
-  <button class=" btn" data-action="toChat" open-type="getUserInfo" bindgetuserinfo="bindgetuserinfo" wx:if="{{ !loginStatus }}">在线咨询</button>
+  <button class=" btn" data-action="toChat" open-type="getUserInfo" bindtap="bindgetuserinfo" wx:if="{{ !loginStatus }}">在线咨询</button>
   <view class="btn" bindtap="toChat" wx:else>在线咨询</view>
   <view class="btn mobile-btn" bindtap="makePhone">电话咨询</view>
 </view>

+ 1 - 1
apps/RealtorEasier/pages/contact/contact.wxml

@@ -5,7 +5,7 @@
         <view class="logo-w" bindtap="saveLocalPhoto">
             <image src="{{ qr_url }}" />
         </view>
-        <view class="contact-text">关注<text>看房4DKanKan</text>公众号</view>
+        <view class="contact-text">关注<text>Realtor Easier</text>公众号</view>
         <view class="save-tip">【点击保存二维码图片】</view>
     </view>
     <view class="contact-step">

+ 1 - 1
apps/RealtorEasier/pages/index/index.json

@@ -1,7 +1,7 @@
 {
   "navigationBarBackgroundColor": "#fff",
   "navigationBarTextStyle": "black",
-  "navigationBarTitleText": "看房4DKanKan",
+  "navigationBarTitleText": "Realtor Easier",
   "usingComponents": {
     "house-item": "./../../components/house-item/house-item",
     "tab-bar": "/components/tab-bar/tab-bar"

+ 2 - 2
apps/RealtorEasier/pages/login/login.wxml

@@ -5,12 +5,12 @@
   </view>
   <view class='login_text'>
     <image src='{{login_logo}}'></image>
-    <view>看房4DKanKan</view>
+    <view>Realtor Easier</view>
     <view>看房大平台,在线云带看,足不出户看实况让您的房产交易更便捷</view>
   </view>
   <view class="quanxian">
     <view>四维时代网络科技有限公司申请获得以下权限</view>
     <view>· 获得您的公开信息(昵称、头像等)</view>
   </view>
-  <button  wx:if="{{canIUse}}" class='btn_login'  open-type="getUserInfo" bindgetuserinfo="login">授权登录</button>
+  <button  wx:if="{{canIUse}}" class='btn_login'  open-type="getUserInfo" bindtap="login">授权登录</button>
 </view>

+ 19 - 1
apps/RealtorEasier/pages/my/my.js

@@ -1,4 +1,4 @@
-import { loginByUserInfo } from '../../utils/login'
+import { loginByUserInfo,loginByUserInfo1 } from '../../utils/login'
 const app = getApp();
 Page({
     options: {
@@ -87,4 +87,22 @@ Page({
             })
         })
     },
+    bindgetuserinfo1 (e) {
+        // wx.getUserProfile({
+            // desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
+            // success: (res) => {
+                loginByUserInfo1().then(res => {
+                    this.setData({
+                        isLogined: app.globalData.token ? true : false,
+                        userinfo: app.globalData.userinfo
+                    })
+                })
+                // this.setData({
+                //     isLogined: app.globalData.token ? true : false,
+                //     userinfo: app.globalData.userinfo
+                // })
+            // }
+        //   })
+      
+    },
 })

+ 2 - 1
apps/RealtorEasier/pages/my/my.wxml

@@ -8,7 +8,8 @@
         点击注册 / 登录
         
     </view>
-    <button wx:if="{{ !isLogined }}" open-type="getUserInfo" bindgetuserinfo="bindgetuserinfo">获取手机号</button>
+    <button wx:if="{{ !isLogined }}" open-type="getUserInfo" bindtap="bindgetuserinfo">获取手机号</button>
+    <!-- <button wx:if="{{ !isLogined }}" open-type="getUserInfo" bindtap="bindgetuserinfo1">获取手机号</button> -->
     <image src="/image/4Dage/my/my-header-bg.png" class="header-bg"></image>
 </view>
 

+ 1 - 0
apps/RealtorEasier/pages/web/web.js

@@ -52,6 +52,7 @@ Page({
       vr_link: vr_link,
       
     })
+    console.log(this.data.url)
     this.scene = getQueryString(vr_link, 'm')
     this.getHouseDetail(this.scene)
     this.socket = SocketHandle.initSocket(this, opts)

+ 1 - 1
apps/RealtorEasier/pages/web/web.json

@@ -2,6 +2,6 @@
   "usingComponents": {
     "trtc-room": "/components/trtc-room/trtc-room"
   },
-  "navigationBarTitleText": "看房4DKanKan",
+  "navigationBarTitleText": "Realtor Easier",
   "pageOrientation": "auto"
 }

+ 78 - 6
apps/RealtorEasier/utils/login.js

@@ -67,6 +67,43 @@ function tips (res) {
   }
 }
 
+
+//获取用户信息接口
+ function getUserProfile() {
+  return new Promise((resovle, reject) => {
+    wx.getUserProfile({
+      desc: "用于完善用户资料", 
+      //异步请求:回调函数中调用下一个函数
+      success (res)  {
+        resovle(res)
+      },
+      fail(err) {
+        wx.showModal({
+          title: "登录失败",
+          content: "网络异常,请重试",
+        })
+        reject(err)
+      },
+    });
+    
+  })
+  // await wx.getUserProfile({
+  //   desc: "用于完善用户资料", 
+  //   //异步请求:回调函数中调用下一个函数
+  //   success (res)  {
+  //     return res
+  //   },
+  //   fail(err) {
+  //     // wx.showModal({
+  //     //   title: "登录失败",
+  //     //   content: "网络异常,请重试",
+  //     // })
+  //     console.log(err)
+  //     return res
+  //   },
+  // });
+}
+
 export default function Login(phone_data, code, isAgency) {
   const { encryptedData, iv } = phone_data.detail
   if (!encryptedData || !iv) {
@@ -94,24 +131,58 @@ export default function Login(phone_data, code, isAgency) {
   })
 }
 
+// 修復微信用戶信息 详情请看以下同名方法
+// export async function loginByUserInfo () {
+//   wx.showLoading('登录中')
+  
+//   return new Promise(async (resolve, reject) => {
+//     let code = await wxLogin()
+//     wx.getUserInfo({
+//       withCredentials: true,
+//       success (res) {
+//         res.wx_code = code
+//         UserApi.loginByUserInfo(res).then(loginRes => {
+//           const data = loginRes.data
+//           data.user = data.user || data.agency
+//           data.user.user_id = data.user.user_id || data.user.agency_user_id
+//           saveToken(data.token)
+//           saveUserInfo(data.user)
+//           getApp().globalData.token = data.token
+//           getApp().globalData.userinfo = data.user
+//           EventEmitter.emit('login')
+//           wx.hideLoading()
+//           resolve(res)
+//         })
+//       },
+//       fail (err) {
+//         wx.hideLoading()
+//         reject(err)
+//       }
+//     })
+//   })
+  
+// }
+
 
 export async function loginByUserInfo () {
-  wx.showLoading('登录中')
+  // wx.showLoading('登录中')
+  let UserProfile  = await getUserProfile()
   return new Promise(async (resolve, reject) => {
     let code = await wxLogin()
     wx.getUserInfo({
       withCredentials: true,
       success (res) {
-        console.log(res)
         res.wx_code = code
         UserApi.loginByUserInfo(res).then(loginRes => {
           const data = loginRes.data
           data.user = data.user || data.agency
-          data.user.user_id = data.user.user_id || data.user.agency_user_id
+          UserProfile.userInfo.user_id = data.user.user_id || data.user.agency_user_id
           saveToken(data.token)
-          saveUserInfo(data.user)
           getApp().globalData.token = data.token
-          getApp().globalData.userinfo = data.user
+          UserProfile.userInfo.name = UserProfile.userInfo.name || UserProfile.userInfo.nickName
+          UserProfile.userInfo.avatar = UserProfile.userInfo.avatar || UserProfile.userInfo.avatarUrl
+          getApp().globalData.userinfo =UserProfile.userInfo
+          saveUserInfo(UserProfile.userInfo)
           EventEmitter.emit('login')
           wx.hideLoading()
           resolve(res)
@@ -123,5 +194,6 @@ export async function loginByUserInfo () {
       }
     })
   })
-  
 }
+
+

+ 1 - 1
readme.md

@@ -1,4 +1,4 @@
-# vr看房小程序
+# RealtorEasier vr看房小程序
 
 ## 开发 
 因为涵盖了经纪人端和用户端得代码。然后里面也有很多相同的模块和代码,所以这里用webpack去进行代码的修改和同步