收藏
回答

wx.selectGroupMembers如何拿到选择的成员的昵称?

通过开发工具模式进入 选择对应的成员后使用 通过wx.selectGroupMembers({

      success: (res) => {

        console.log('选择的群成员:', res)

        // 更新成员列表

        this.setData({

          members: res.members

        })

      },

      fail: (error) => {

        console.log('选择群成员失败:', error)

        wx.showToast({

          title: '选择失败',

          icon: 'error',

          duration: 2000

        })

      }

    })

拿到成员的id集合 使用<open-data-list type="groupMembers" members="{{members}}">

          <view class="userinfo" slot:index>

            <open-data-item class="avatar" type="userAvatar" index="{{index}}" />

            <open-data-item class="nickname" type="userNickName" index="{{index}}" />

          </view>

        </open-data-list> 进行渲染 如何拿到成员的昵称和头像呢?

回答关注问题邀请回答
收藏

1 个回答

  • 拾忆
    拾忆
    发表于小程序端
    1天前

    开放数据组件只能显示不能拿到用户信息。

    1天前
    有用
    回复
登录 后发表内容