if (res.statusCode === 200) { wx.showToast({ title: '保存成功', }) console.log('保存成功') console.log('重新獲取數據') console.log(res.data.bx_id) this.searchBx(res.data.bx_id) }
原來代碼
this.searchBx(res.data.bx_id)沒有執行
修改后:
if (res.statusCode === 200) { var that = this wx.showToast({ title: '保存成功', success() { console.log('保存成功') console.log('重新獲取數據') console.log(res.data.bx_id) that.searchBx(res.data.bx_id) } }) }
順利執行
介紹:
wx.showToast({ title:"成功", icon: 'loading...',//圖標,支持"success"、"loading" image: '/images/tan.png',//自定義圖標的本地路徑,image 的優先級高於 icon duration: 2000,//提示的延遲時間,單位毫秒,默認:1500 mask: false,//是否顯示透明蒙層,防止觸摸穿透,默認:false success:function(){}, fail:function(){}, complete:function(){} }) },