|
@@ -12,25 +12,28 @@
|
|
<uni-collapse>
|
|
<uni-collapse>
|
|
<uni-collapse-item title="群组" :thumb="config.group_url[0].url">
|
|
<uni-collapse-item title="群组" :thumb="config.group_url[0].url">
|
|
<view class="content">
|
|
<view class="content">
|
|
- <view class="list" v-for="(item, index) in groupList" :key="index" @tap="toInfo(item)">
|
|
|
|
- <uni-list-chat :title="item.name" :avatar="item.doctor.icon[0].url||config.logo_url[0].url"
|
|
|
|
- :time="item.doctor.name"></uni-list-chat>
|
|
|
|
|
|
+ <view class="two_1">
|
|
|
|
+ <input type="text" v-model="searchInfo.name" @input="toInput" placeholder="搜索">
|
|
</view>
|
|
</view>
|
|
- <view class="is_bottom" v-if="is_bottom">
|
|
|
|
- <text>{{config.bottom_title||'到底了!'}}</text>
|
|
|
|
|
|
+ <view class="list" v-for="(item, index) in groupList" :key="index">
|
|
|
|
+ <uni-list-chat :title="item.name" :avatar="item.doctor.icon[0].url||config.logo_url[0].url"
|
|
|
|
+ :time="item.doctor.name" link="navigateTo" @click="toInfo(item,'group')">
|
|
|
|
+ </uni-list-chat>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</uni-collapse-item>
|
|
</uni-collapse-item>
|
|
<uni-collapse-item title="好友" :thumb="config.friend_url[0].url">
|
|
<uni-collapse-item title="好友" :thumb="config.friend_url[0].url">
|
|
<view class="content">
|
|
<view class="content">
|
|
- <view class="list" v-for="(item, index) in friendList" :key="index" @tap="toInfo(item)">
|
|
|
|
|
|
+ <view class="two_1">
|
|
|
|
+ <input type="text" v-model="searchInfo.name" @input="toInput" placeholder="搜索">
|
|
|
|
+ </view>
|
|
|
|
+ <view class="list" v-for="(item, index) in friendList" :key="index"
|
|
|
|
+ @tap="toInfo(item,'friend')">
|
|
<uni-list-chat title="uni-app"
|
|
<uni-list-chat title="uni-app"
|
|
avatar="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png"
|
|
avatar="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/unicloudlogo.png"
|
|
- note="您收到一条新的消息" time="2020-02-02 20:20" badge-positon="left"
|
|
|
|
- badge-text="99"></uni-list-chat>
|
|
|
|
- </view>
|
|
|
|
- <view class="is_bottom" v-if="is_bottom">
|
|
|
|
- <text>{{config.bottom_title||'到底了!'}}</text>
|
|
|
|
|
|
+ note="您收到一条新的消息" time="2020-02-02 20:20" badge-positon="left" badge-text="99"
|
|
|
|
+ link="navigateTo" @click="toInfo(item,'friend')">
|
|
|
|
+ </uni-list-chat>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</uni-collapse-item>
|
|
</uni-collapse-item>
|
|
@@ -45,6 +48,7 @@
|
|
return {
|
|
return {
|
|
user: {},
|
|
user: {},
|
|
config: {},
|
|
config: {},
|
|
|
|
+ searchInfo: {},
|
|
// 广告
|
|
// 广告
|
|
advertList: [],
|
|
advertList: [],
|
|
// 群组
|
|
// 群组
|
|
@@ -109,9 +113,13 @@
|
|
title: res.errmsg,
|
|
title: res.errmsg,
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ let info = {
|
|
|
|
+ // doctor: that.user._id,
|
|
|
|
+ }
|
|
// 群组
|
|
// 群组
|
|
res = await that.$api(`/group`, 'GET', {
|
|
res = await that.$api(`/group`, 'GET', {
|
|
- // doctor: that.user._id
|
|
|
|
|
|
+ ...info,
|
|
|
|
+ ...that.searchInfo
|
|
})
|
|
})
|
|
if (res.errcode == '0') {
|
|
if (res.errcode == '0') {
|
|
that.$set(that, `groupList`, res.data)
|
|
that.$set(that, `groupList`, res.data)
|
|
@@ -121,7 +129,25 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
// 好友
|
|
// 好友
|
|
-
|
|
|
|
|
|
+ },
|
|
|
|
+ // 输入框
|
|
|
|
+ toInput(e) {
|
|
|
|
+ const that = this;
|
|
|
|
+ if (that.searchInfo.name) that.$set(that.searchInfo, `name`, e.detail.value)
|
|
|
|
+ else that.$set(that, `searchInfo`, {})
|
|
|
|
+ that.search();
|
|
|
|
+ },
|
|
|
|
+ // 详情
|
|
|
|
+ toInfo(item, type) {
|
|
|
|
+ if (type == 'group') {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: `/pagesHome/group/index?id=${item.id||item._id}&title=${item.name}`
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: `/pagesHome/friend/index?id=${item.id||item._id}&title=${item.name}`
|
|
|
|
+ })
|
|
|
|
+ }
|
|
},
|
|
},
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -143,5 +169,25 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .two {
|
|
|
|
+ .content {
|
|
|
|
+ .two_1 {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ padding: 2vw;
|
|
|
|
+ background-color: var(--f3CColor);
|
|
|
|
+
|
|
|
|
+ input {
|
|
|
|
+ width: 100%;
|
|
|
|
+ padding: 2vw;
|
|
|
|
+ background-color: var(--mainColor);
|
|
|
|
+ font-size: var(--font14Size);
|
|
|
|
+ border-radius: 5px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|