This commit is contained in:
2023-11-28 20:45:05 +08:00
parent a8ddb2ff68
commit 12c9920e1e
518 changed files with 2 additions and 87911 deletions

View File

@@ -1,157 +0,0 @@
<template>
<view class="xw-book">
<watermark></watermark>
<uni-indexed-list-wx :options="list" @click="bindClick"></uni-indexed-list-wx>
<!-- <top-right-tool-wx ref="trtw"></top-right-tool-wx> -->
</view>
</template>
<script>
import customHttp from "@/common/customHttp.js"
export default {
data() {
return {
list: []
}
},
onLoad() {},
onShow() {
this.getflist()
this.$store.dispatch('tabBarpull')
},
methods: {
bindClick(e){
//注释之前的旧代码,直接跳转到里聊天页
/*
uni.navigateTo({
url:'../personInfo/detail?param='+e.item.data.userId
})
*/
uni.navigateTo({
url: '../chatWindow/index?userId=' + e.item.data.userId + '&windowType=' + "SINGLE"
});
},
getflist(){
//TODO 从接口获取
var list=[
{
name:"测试18200702230",
avatar:"https://shudong2022.oss-cn-hangzhou.aliyuncs.com/common/user/logo.png",
userId:"18200702230",
userType:"item.userType",
chatNo:"item.chatNo"
},
{
name:"测试18200000000",
avatar:"https://shudong2022.oss-cn-hangzhou.aliyuncs.com/common/user/logo.png",
userId:"18200000000",
userType:"item.userType",
chatNo:"item.chatNo"
},{
name:"测试18200000001",
avatar:"https://shudong2022.oss-cn-hangzhou.aliyuncs.com/common/user/logo.png",
userId:"18200000001",
userType:"item.userType",
chatNo:"item.chatNo"
},{
name:"测试lld3",
avatar:"https://shudong2022.oss-cn-hangzhou.aliyuncs.com/common/user/logo.png",
userId:"lld3",
userType:"item.userType",
chatNo:"item.chatNo"
}
]
this.list=this.$fc.sortList({list:list,key:'name'})
console.log(customHttp)
console.log("================开始请求通讯录列表")
// 局部修改配置,局部配置优先级高于全局配置
customHttp.customHttp.get('/api/im/app/addressList', {
params: {}, /* 会加在url上 */
header: {}, /* 会与全局header合并如有同名属性局部覆盖全局 */
dataType: 'json',
// 注如果局部custom与全局custom有同名属性则后面的属性会覆盖前面的属性相当于Object.assign(全局,局部)
custom: {target: "znzq"} , // 可以加一些自定义参数在拦截器等地方使用。比如这里我加了一个auth可在拦截器里拿到如果true就传token
}).then(res => {
//userInfo
const userId = uni.getStorageSync("userId")
console.log("=========获取到数据")
console.log(res)
if(res.statusCode==200){
if(res.data.code==200){
var list=[]
res.data.result.records.map((item)=>{
console.log(item)
//在通讯录中过滤掉自己
if(userId!=item.userId){
list.push({
name:item.realname,
avatar:item.portrait,
userId:item.userId,
userType:1,
chatNo:item.userId
})
}
})
this.list=this.$fc.sortList({list:list,key:'name'})
}
}
}).catch(err => {
})
/*
this.$http.request({
url: '/friend/friendList',
method: 'POST',
data:JSON.stringify({}),
success: (res) => {
if (res.data.code == 200) {
var data=res.data.data
var list=[]
for (var i = 0; i < data.length; i++) {
var item=data[i]
list.push({
name:item.nickName,
avatar:item.portrait,
userId:item.userId,
userType:item.userType,
chatNo:item.chatNo
})
}
this.list=this.$fc.sortList({list:list,key:'name'})
}
}
});
*/
},
},
onNavigationBarButtonTap(e) {
switch (e.index) {
case 0: //更多
this.$refs['trtw'].showTab();
break;
case 1: //搜索
uni.navigateTo({
url: '../search/index'
});
break;
default:
break;
}
},
}
</script>
<style scoped>
</style>