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

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: () => { fail: () => {
contactModel.create((err, res) => { contactModel.create((err, res) => {
console.error('SQLITE 创建表格', 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", "name" : "ZH-HEALTH",
"appid" : "__UNI__C29473D", "appid" : "__UNI__C29473D",
"description" : "ZH-HEALTH您手上的健康管理专家", "description" : "ZH-HEALTH您手上的健康管理专家",
"versionName" : "1.0.20", "versionName" : "1.0.21",
"versionCode" : 100, "versionCode" : 100,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */

View File

@@ -8,7 +8,7 @@
<view class="header"> <view class="header">
<view class="name"> <view class="name">
{{ contact(item.targetId).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>
<view class="time">{{ item.sentTime|timeCustomCN }}</view> <view class="time">{{ item.sentTime|timeCustomCN }}</view>
</view> </view>

View File

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