列表页: storeConversationList从vuex中获取
<u-list class="conversation_list" @scrolltolower="scrolltolower" v-if="storeConversationList.length">
<u-list-item v-for="item in storeConversationList" :key="item.conversationID"
@click="itemClick(item)">
<conversation-item @closeAllSwipe="closeAllSwipe" :source="item" :key="item.conversationID" />
</u-list-item>
</u-list>
conversationItem组件:
<u-swipe-action-item :index="source.conversationID ? source.conversationID : ''" @click="clickConversationMenu($event,source)"
:name="source.conversationID ? source.conversationID : ''" :options="getSwipeActions || []">
<view @tap.prevent="clickConversationItem" class="conversation_item"
:class="{conversation_item_active:source.isPinned ? source.isPinned : false }">
<view class="left_info">
<my-avatar shape="circle" :isGroup="isGroup" :isNotify="isNotify" :src="source.faceURL ? source.faceURL : ''"
:desc="source.showName ? source.showName : ''" size='48' />
<view class="details">
<text class="nic">{{source.showName ? source.showName : ''}}</text>
<view class="lastest_msg_wrap">
<text class="lastest_msg_content">{{latestMessage}}</text>
<!-- <u-parse class="lastest_msg_content"
:content="latestMessage" /> -->
</view>
</view>
</view>
<view class="right_desc">
<text class="send_time">{{latestMessageTime}}</text>
<image v-if="notAccept" src="@/static/images/conversation_not_accept.png">
<u-badge v-else max="99" :value="source.unreadCount ? source.unreadCount : ''"></u-badge>
</view>
</view>
</u-swipe-action-item>
渲染数据的时候出现了undefined
2***@qq.com (作者)
还请大佬指点一下,有的数据能出来有的怎么会显示undefiend
2023-06-29 17:33
Diligent_UI
回复 2***@qq.com: 看看你的storeConversationList数据呗
2023-06-29 17:39
2***@qq.com (作者)
回复 Diligent_UI: 我一次拉取15条,数据都是完整的
2023-06-29 17:51
2***@qq.com (作者)
回复 Diligent_UI: 我觉得是不是uniapp逻辑层和渲染层通信的时候出现的问题
2023-06-29 17:51
Diligent_UI
回复 2***@qq.com: 这种问题不会,my-avatar啥子组件
2023-06-29 17:53
2***@qq.com (作者)
回复 Diligent_UI: 会话左侧图像
2023-06-29 18:00
2***@qq.com (作者)
回复 2***@qq.com: "conversationID": "super_group_6461300",
"conversationType": 3,
"userID": "",
"groupID": "6461300",
"showName": "哈哈哈",
"faceURL": "",
"recvMsgOpt": 0,
"unreadCount": 4,
"groupAtType": 0,
"latestMsg": "{\"clientMsgID\":\"d08cb1ad02bde81cb9567ce7d77fe0bf\",\"serverMsgID\":\"e36aab4c29920bc564f4ed941cad3430\",\"createTime\":1687961821092,\"sendTime\":1687961821092,\"sessionType\":3,\"sendID\":\"153\",\"msgFrom\":0,\"contentType\":1502,\"platformID\":0,\"groupID\":\"6461300\",\"content\":\"{\\"detail\\":\\"CoEBCgc2NDYxMzAwEgMxNTMYAiDIgfGkBioK6KW/55OcIOWghzJPaHR0cHM6Ly9vc3MueHVueXVldGVjaC5jb20vcHJlcmVsZWFzZS83YTUzYmM0Mi1lODZmLTQzYWItODU5Ny1mOTg5ODFiMTk4NjIud2VicDgBQAJKAzE1M2IDMTUzGkgKBzY0NjEzMDAaEuasoui/juWQhOS9jeWKoOWFpTIDMTUzOMiB8aQGQAVKBnpsbXFmNFoDMTUzYAJoAYAB3YHxpAaKAQMxNTM=\\",\\"defaultTips\\":\\"西瓜 堇 modified the group profile\\",\\"jsonDetail\\":\\"{\\\\"opUser\\\\":{\\\\"groupID\\\\":\\\\"6461300\\\\",\\\\"userID\\\\":\\\\"153\\\\",\\\\"roleLevel\\\\":2,\\\\"joinTime\\\\":1687961800,\\\\"nickname\\\\":\\\\"西瓜 堇\\\\",\\\\"faceURL\\\\":\\\\"https://oss.xunyuetech.com/prerelease/7a53bc42-e86f-43ab-8597-f98981b19862.webp\\\\",\\\\"appMangerLevel\\\\":1,\\\\"joinSource\\\\":2,\\\\"operatorUserID\\\\":\\\\"153\\\\",\\\\"inviterUserID\\\\":\\\\"153\\\\"},\\\\"group\\\\":{\\\\"groupID\\\\":\\\\"6461300\\\\",\\\\"notification\\\\":\\\\"欢迎各位加入\\\\",\\\\"ownerUserID\\\\":\\\\"153\\\\",\\\\"createTime\\\\":1687961800,\\\\"memberCount\\\\":5,\\\\"ex\\\\":\\\\"zlmqf4\\\\",\\\\"creatorUserID\\\\":\\\\"153\\\\",\\\\"groupType\\\\":2,\\\\"needVerification\\\\":1,\\\\"notificationUpdateTime\\\\":1687961821,\\\\"notificationUserID\\\\":\\\\"153\\\\"}}\\"}\",\"seq\":4,\"isRead\":false,\"status\":2,\"offlinePush\":{\"title\":\"groupInfoSet title\",\"desc\":\"groupInfoSet desc\",\"ex\":\"groupInfoSet ext\",\"iOSPushSound\":\"xxx\",\"iOSBadgeCount\":true},\"pictureElem\":{\"sourcePicture\":{\"size\":0,\"width\":0,\"height\":0},\"bigPicture\":{\"size\":0,\"width\":0,\"height\":0},\"snapshotPicture\":{\"size\":0,\"width\":0,\"height\":0}},\"soundElem\":{\"dataSize\":0,\"duration\":0},\"videoElem\":{\"videoSize\":0,\"duration\":0,\"snapshotSize\":0,\"snapshotWidth\":0,\"snapshotHeight\":0},\"fileElem\":{\"fileSize\":0},\"mergeElem\":{},\"atElem\":{\"isAtSelf\":false},\"faceElem\":{\"index\":0},\"locationElem\":{\"longitude\":0,\"latitude\":0},\"customElem\":{},\"quoteElem\":{},\"notificationElem\":{\"detail\":\"{\\"opUser\\":{\\"groupID\\":\\"6461300\\",\\"userID\\":\\"153\\",\\"roleLevel\\":2,\\"joinTime\\":1687961800,\\"nickname\\":\\"西瓜 堇\\",\\"faceURL\\":\\"https://oss.xunyuetech.com/prerelease/7a53bc42-e86f-43ab-8597-f98981b19862.webp\\",\\"appMangerLevel\\":1,\\"joinSource\\":2,\\"operatorUserID\\":\\"153\\",\\"inviterUserID\\":\\"153\\"},\\"group\\":{\\"groupID\\":\\"6461300\\",\\"notification\\":\\"欢迎各位加入\\",\\"ownerUserID\\":\\"153\\",\\"createTime\\":1687961800,\\"memberCount\\":5,\\"ex\\":\\"zlmqf4\\",\\"creatorUserID\\":\\"153\\",\\"groupType\\":2,\\"needVerification\\":1,\\"notificationUpdateTime\\":1687961821,\\"notificationUserID\\":\\"153\\"}}\",\"defaultTips\":\"西瓜 堇 modified the group profile\"},\"messageEntityElem\":{},\"attachedInfoElem\":{\"groupHasReadInfo\":{\"hasReadCount\":0,\"groupMemberCount\":0},\"isPrivateChat\":false,\"burnDuration\":0,\"hasReadTime\":0,\"notSenderNotificationPush\":false,\"isEncryption\":false,\"inEncryptStatus\":false}}",
"latestMsgSendTime": 1687961821092,
"draftText": "",
"draftTextTime": 0,
"isPinned": false,
"isPrivateChat": false,
"burnDuration": 30,
"isNotInGroup": false,
"updateUnreadCountTime": 0,
"attachedInfo": "",
"ex": ""
2023-06-29 18:01