index.js 566 字节
Newer Older
1
import $state from '@/uni_modules/uni-im/sdk/state/index.js';
DCloud_JSON's avatar
DCloud_JSON 已提交
2
export default {
3 4 5 6
  toChat(param) {
    if ($state.isWidescreen) {
      uni.$emit('uni-im-toChat', param)
    } else {
7 8 9 10 11 12 13 14
      console.log('uni-im-toChat', param)
      let url = '/uni_modules/uni-im/pages/chat/chat?'
      for (let key in param) {
        let value = param[key]
        if (typeof value === 'object') {
          value = decodeURIComponent(JSON.stringify(value))
        }
        url += key + '=' + param[key] + '&'
15 16 17 18
      }
      uni.navigateTo({url,animationDuration: 300})
    }
  },
DCloud_JSON's avatar
DCloud_JSON 已提交
19
}