cover-view中使用wx:for ios中闪烁消失
发布于 4 年前 作者 min91 6900 次浏览 来自 问答

  

sendMessage:function(e){


    let inputValue = that.data.test,

        colorArr = that.data.colorArr,

        colorLen = colorArr.length

        let message = tim.createTextMessage({

          to:that.data.groupID,

          conversationType: TIM.TYPES.CONV_GROUP,

          payload: {

            text: inputValue,

          }

        });

        let promise = tim.sendMessage(message);

        promise.then(function(imResponse) {

          // 发送成功

          if(imResponse.code==0){

            let list={

              name:imResponse.data.message.nick,

              text:imResponse.data.message.payload.text,

              code:code,

              vip:that.data.user_type

            }

            that.data.messageList.push(list);

            let random = colorArr[Math.floor(Math.random() * colorLen)];

            that.data.randomColorArr.push(random);

            that.setData({ 

              messageList:that.data.messageList,

            });

          }

        }).catch(function(imError) {

          // 发送失败

          console.warn('sendMessage error:', imError);

        });    

 



  },

1 回复

你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

回到顶部