liujq 3 tahun lalu
induk
melakukan
48252f4733
3 mengubah file dengan 7 tambahan dan 8 penghapusan
  1. 2 2
      src/pagesQa/msg/chat.jsx
  2. 3 4
      src/pagesRoom/dtl.jsx
  3. 2 2
      src/utils/http.js

+ 2 - 2
src/pagesQa/msg/chat.jsx

@@ -31,7 +31,7 @@ class Index extends Component {
   }
 
 
-  componentWillMount () {
+  componentDidMount () {
     const that = this
     let uObj = Taro.getStorageSync('APP_userInfo')
     const { to_user_id } = this.$router.params
@@ -126,7 +126,7 @@ class Index extends Component {
     }).then(task => {
       task.onOpen(function () {
         // console.log('onOpen')
-        const { to_user_id } = this.$router.params
+        const { to_user_id } = that.$router.params
         let token = Taro.getStorageSync('APP_token')
         task.send({ data: '{"seq":"' + that.sendId() + '","cmd":"login","data":{"userId":"' + to_user_id + '","appId":101,"serviceToken":"' + token + '"}}' })
         setInterval(() => {

+ 3 - 4
src/pagesRoom/dtl.jsx

@@ -278,10 +278,9 @@ class Index extends Component {
   }
 
 
-  netLink () {
-    const { curObj } = this.state
+  netLink (saleObj) {
     Taro.navigateTo({
-      url: `/pagesQa/msg/chat?to_user_id=${curObj.user_id}`
+      url: `/pagesQa/msg/chat?to_user_id=${saleObj.user_id}`
     })
   }
   callHandle (saleObj) {
@@ -304,7 +303,7 @@ class Index extends Component {
           <View className="p2">{tagStr}</View>
         </View>
         <View className="ss-r">
-          <View className="b" onClick={this.netLink.bind(this)}>在线问</View>
+          <View className="b" onClick={this.netLink.bind(this, saleObj)}>在线问</View>
           <View className="b t2" onClick={this.callHandle.bind(this, saleObj)}>打电话</View>
         </View>
       </View>

+ 2 - 2
src/utils/http.js

@@ -23,8 +23,8 @@ const Http = (options = { data: {} }) => {
       }
     }
     try {
-      // let baseUrl = 'http://api.dev.com'
-      let baseUrl = 'https://api.honglouplus.com'
+      let baseUrl = 'http://api.dev.com'
+      // let baseUrl = 'https://api.honglouplus.com'
       // let baseUrl = 'https://api.honglounews.com'
       const resX = Taro.request({
         url: baseUrl + options.url,