wx.showToast 在开发工具正常显示,安卓手机调试时不生效
_nullBack(res) {
console.log(res,'11122')
let str = '提示信息!'
if(res.errmsg){
str = res.errmsg
}
wx.showToast({
title: str,
icon: 'none',
duration: 2000
})
this.data.SocketTask.close({
code: 1000,
success() {
console.log('正常手动关闭')
},
})
setTimeout(() => {
wx.navigateBack({
delta: 1,
})
}, 2500)
},
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
<wxs src="../../utils/splice.wxs" module="mytool"></wxs>
<view class="user" wx:for="{{info}}" wx:key="info">
<view><image src="{{item.avatar}}" class="img"></image></view>
<view >{{item.nickname}}</view>
</view>
<view class="box" wx:for="{{box}}" wx:key="box">
<view class="box1">
<view class="title" bind:tap="goto" data-id="{{item.id}}">{{item.title}}</view>
<view>{{mytool.mysub(item.content,0,20)}}</view>
<view wx:if="{{item.is_like==1}}">
<view class="iconfont icon-dianzan favor" bind:tap="favor" data-id="{{item.id}}" data-index="{{index}}" style="color: red;"></view>
</view>
<view wx:else="{{item.is_like==0}}">
<view class="iconfont icon-dianzan favor" bind:tap="favor" data-id="{{item.id}}" data-index="{{index}}" style="color: black;"></view>
</view>
</view>
<view><image src="{{item.img}}"></image></view>
</view>
console.log(e);
wx.navigateTo({
url: '/pages/detail/detail?id='+e.target.dataset.id,
})
},