|
| xqd
@@ -8,7 +8,7 @@
|
|
|
</view>
|
|
|
<!-- 这是聊天列表 当值为true时显示-->
|
|
|
<view class="cu-list menu-avatar margin-top-xs" v-if="qiehuan == true">
|
|
|
- <view class="cu-item u-border-bottom" v-for="(item,index) in list" :key="index" @click="goliaotian">
|
|
|
+ <view class="cu-item u-border-bottom" v-for="(item,index) in list" :key="index" @click="goliaotian(index)">
|
|
|
<view class="cu-avatar radius lg" :style="'background-image:url('+item.avatar+');'">
|
|
|
<view class="cu-tag badge">10</view>
|
|
|
</view>
|
|
| xqd
@@ -49,27 +49,49 @@
|
|
|
} from "../../common/goeasyimutil.js"
|
|
|
import GoEasyAudioPlayer from "../../components/GoEasyAudioPlayer/GoEasyAudioPlayer.vue";
|
|
|
const recorderManager = uni.getRecorderManager()
|
|
|
+ import IMService from "../../common/goeasyimutil.js"
|
|
|
export default {
|
|
|
components: {
|
|
|
GoEasyAudioPlayer
|
|
|
},
|
|
|
+ onShow() {
|
|
|
+ var i = 0;
|
|
|
+ while(i<3){
|
|
|
+ console.log('我是i',i);
|
|
|
+ if(typeof getApp().globalData.imService =='undefined'){
|
|
|
+ let res = uni.getStorageSync('user');
|
|
|
+ getApp().globalData.imService = new IMService();
|
|
|
+ let loginResult = getApp().globalData.imService.login({
|
|
|
+ uuid: res.data.flag,
|
|
|
+ name: res.data.name,
|
|
|
+ avatar: res.data.avatar
|
|
|
+ });
|
|
|
+ if (loginResult) {
|
|
|
+ //连接IM
|
|
|
+ getApp().globalData.imService.connectIM();
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ i++;
|
|
|
+ }
|
|
|
+ this.getcnversationList()
|
|
|
+ },
|
|
|
onLoad() {
|
|
|
this.imService = getApp().globalData.imService;
|
|
|
- console.log(this.imService.sendPrivateTextMessage())
|
|
|
+ // console.log(this.imService.sendPrivateTextMessage())
|
|
|
// console.log(this.imService.getFrindList())
|
|
|
|
|
|
},
|
|
|
mounted() {
|
|
|
},
|
|
|
- onShow() {
|
|
|
- this.getcnversationList()
|
|
|
- },
|
|
|
+
|
|
|
data() {
|
|
|
return {
|
|
|
//控制聊天列表和通话记录
|
|
|
//false为通话记录,true为聊天列表
|
|
|
qiehuan: true,
|
|
|
-
|
|
|
+ index:0,
|
|
|
keyword: "",
|
|
|
list:[],
|
|
|
listPhone:[],
|
|
| xqd
@@ -85,9 +107,25 @@
|
|
|
this.qiehuan = true
|
|
|
}
|
|
|
},
|
|
|
- goliaotian() {
|
|
|
+ goliaotian(e) {
|
|
|
+ let data = this.list[e];
|
|
|
+ var index=data.flag.lastIndexOf("\_");
|
|
|
+ var user_id=data.flag.substring(index+1,data.flag.length);
|
|
|
+
|
|
|
+ let obj = {
|
|
|
+ 'user_id':user_id,
|
|
|
+ 'user_name':data.nickname,
|
|
|
+ 'user_avatar':data.avatar,
|
|
|
+ }
|
|
|
+ var urls = "";
|
|
|
+ if(data.order_status==3){
|
|
|
+ urls = "../conversation/conversationWindow?patient=" + JSON.stringify(obj) + "&type=1"
|
|
|
+ }else{
|
|
|
+ urls = "../conversation/conversationWindow?patient=" + JSON.stringify(obj) + "&type=2"
|
|
|
+ }
|
|
|
+ // ?patient=" + JSON.stringify(this.info) + "&type=1
|
|
|
uni.navigateTo({
|
|
|
- url: "conversationWindow"
|
|
|
+ url: urls
|
|
|
})
|
|
|
},
|
|
|
call() {
|
|
| xqd
@@ -100,9 +138,6 @@
|
|
|
if(res.status==0){
|
|
|
if(res.data.length!=0){
|
|
|
this.list = res.data;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|