2***@qq.com
2***@qq.com
  • 发布:2023-06-29 17:05
  • 更新:2024-05-08 23:11
  • 阅读:678

uniapp开发/打包app应用内渲染列表时列表中出现undefined

分类:uni-app

列表页: 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

2023-06-29 17:05 负责人:DCloud_App_Array 分享
已邀请:
piaoyi_UI

piaoyi_UI - 【插件开发】【专治疑难杂症】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=193663(微信搜索飘逸科技UI小程序直接体验)】【骗子请绕道】问题咨询请加QQ群:120594820,代表作灵感实用工具小程序

检查项目代码呗,这也不算bug啊

  • 2***@qq.com (作者)

    还请大佬指点一下,有的数据能出来有的怎么会显示undefiend

    2023-06-29 17:33

  • piaoyi_UI

    回复 2***@qq.com: 看看你的storeConversationList数据呗

    2023-06-29 17:39

  • 2***@qq.com (作者)

    回复 piaoyi_UI: 我一次拉取15条,数据都是完整的

    2023-06-29 17:51

  • 2***@qq.com (作者)

    回复 piaoyi_UI: 我觉得是不是uniapp逻辑层和渲染层通信的时候出现的问题

    2023-06-29 17:51

  • piaoyi_UI

    回复 2***@qq.com: 这种问题不会,my-avatar啥子组件

    2023-06-29 17:53

  • 2***@qq.com (作者)

    回复 piaoyi_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

w***@163.com

w***@163.com

楼主的问题解决了吗?
我跟你一样的问题,也是一个列表,其他的都好的,偶尔有一个展示undefined,
数据没问题,刷新一下就好了,
偶尔出现,几率极低

  • minBox

    我也有这种情况,层主定位到问题了吗

    2023-11-02 11:35

  • 3***@qq.com

    回复 minBox: 有定位到问题么

    2023-12-14 10:59

3***@qq.com

3***@qq.com

一样的问题,偶现的(ios,并且退到后台一段时间再进入,页面内存被回收重新加载时候导致),像是渲染问题。

  • 2***@qq.com

    大哥 有定位到问题么

    2023-12-26 14:46

  • 3***@qq.com

    回复 2***@qq.com: 感觉是uniapp的bug。。有点无解。。

    2024-01-08 12:04

3***@qq.com

3***@qq.com

一样的问题,偶现的(ios,并且退到后台一段时间再进入,页面内存被回收重新加载时候导致),像是渲染问题。

2***@qq.com

2***@qq.com

我这也出现了 你们都解决了么

2***@qq.com

2***@qq.com

求回复

小小会

小小会

求回复,像是bug,渲染错误。数据没有问题

a***@126.com

a***@126.com

遇到相同问题,有大佬解决了吗?

喜欢技术的前端

喜欢技术的前端 - QQ---445849201

可以给个复现的demo,方便排查

要回复问题请先登录注册