调用wx.showActionSheet在模拟器上显示是正常的,但是在真机上iphoneX上可以正常显示,但是iphone6s,小米5上都无法正常显示,控制台也没有显示报错信息,这是什么原因造成的
自定义组件中的代码:
//点击评论的某一条
clickCommentItem (e) {
var that = this
var header = common.getHeader()
// 是否可以删除
var canDelete = e.currentTarget.dataset.candelete
//评论id
var commentId = e.currentTarget.dataset.commentid
// id
var momentId = e.currentTarget.dataset.momentid
// 可以删除
if (canDelete) {
wx.showActionSheet({
itemList: [‘删除’],
success: function (res) {
// 选择删除装友圈评论
var eventDetail = {
name: ‘commentStatus’,
value: {
id: commentId,
momentId: momentId
}
}
var eventOption = {
bubbles: false,
composed: false,
capturePhase: false
}
that.triggerEvent(‘delComment’, eventDetail, eventOption)
},
fail: function (res) {
}
})
} else {
}
},
page中的JS代码
delComment: function (e) {
var that = this
var header = common.getHeader()
var momentList = this.data.list
var commentId = e.detail.value.id
var momentId = e.detail.value.momentId
wx.request({
url: API + ‘/comment/update’,
method: ‘POST’,
data: {
token: header.TOKEN,
commentId: commentId,
deleteFlag: true
},
success: res => {
if (res.data.returnCode === ‘00000’) {
var currentComment = res.data.data
for (var i in momentList) {
if(momentList[i].momentId === momentId) {
momentList[i].commentList = currentComment
that.setData({
list: momentList
})
}
}
}
console.log(res)
}
})
}
wml中的代码:
<renovation-renovation-item list="{{list}}" bindclickDelStatus=“deleteStatus” bindclickAddComment=“addComment” binddelComment=“delComment” bindlikeStatus=“likeStatus”></renovation-renovation-item>