获取好友信息的时候,排除自己,但是还要把自己的信息加载到内存中

This commit is contained in:
2022-02-28 10:26:48 +08:00
parent 3e1275fc74
commit e8e496cf37
4 changed files with 10 additions and 6 deletions

View File

@@ -40,7 +40,7 @@ usqlite.connect({
fail: () => {
contactModel.create((err, res) => {
console.error('SQLITE 创建表格', err, res)
uni.setStorageSync('FIRST_RUN', 'X')
uni.setStorageSync('FIRST_RUN', true)
})
}
})

View File

@@ -2,7 +2,7 @@
"name" : "ZH-HEALTH",
"appid" : "__UNI__C29473D",
"description" : "ZH-HEALTH您手上的健康管理专家",
"versionName" : "1.0.20",
"versionName" : "1.0.21",
"versionCode" : 100,
"transformPx" : false,
/* 5+App */

View File

@@ -8,7 +8,7 @@
<view class="header">
<view class="name">
{{ contact(item.targetId).name }}
<text v-if="item.conversationType === 3" class='group'>[]</text>
<!-- <text v-if="item.conversationType === 3" class='group'>[]</text> -->
</view>
<view class="time">{{ item.sentTime|timeCustomCN }}</view>
</view>

View File

@@ -6,7 +6,7 @@ import {
export default {
state: {
contacts: {},
myInfo: {}
myInfo: {}
},
getters: {
contacts(state) {
@@ -41,6 +41,7 @@ export default {
updateContactInfo(state, contactInfo) {
Vue.set(state.contacts, contactInfo.targetId, contactInfo)
},
// 设置我的资料
setSenderInfo(state, contactInfo) {
state.myInfo = {
userId: contactInfo.targetId,
@@ -69,8 +70,11 @@ export default {
})
},
setSenderInfo({
commit
}, contactInfo) {
commit,
dispatch
}, contactInfo) {
contactInfo.type = 0 // type 更改为0标记是我自己
dispatch('updateContact', contactInfo)
commit('setSenderInfo', contactInfo)
},
// 载入好友信息