async saveCarInfo() { const { plate = '', wecarId = '' } = this.data; const checkMsg = this.checkPlate(plate); if (checkMsg !== '') { wx.showToast({ title: checkMsg, icon: 'none', duration: 20000 }); return; } wx.showLoading(); try { let carInfo = { wecarId: '' }; if (wecarId) { carInfo = await this.updateCar({ plate }, wecarId); wx.showToast({ title: '保存成功!', icon: 'none', duration: 20000 }); this.getCars(); this.setData({ showEditDrawer: false, }); } else { carInfo = await this.createNewCar({ plate }); const { wecarId: addWecarId = '' } = carInfo; this.setData({ wecarId: addWecarId }); wx.showToast({ title: '保存成功!', icon: 'none', duration: 20000 }); this.getCars(); this.setData({ showEditDrawer: false, }); return; } // 更新当前车 // tms.getCarManager().setCarInfo(carInfo); // this.getAppendQuery(); // this.navigateToPage(); wx.hideLoading(); } catch (e) { if (e.errCode !== 0) { wx.showToast({ title: e.errMsg, icon: 'none', duration: 20000 }); } wx.hideLoading(); // const showModalObj = C.handleSaveCarInfoError(e); // showOcrModal(showModalObj); } }, 整体代码是这样的
wx.showToast 提示框在模拟器正常 ,预览手机端不显示或者闪一下,为什么?wx.showToast({ title: '保存成功!', icon: 'none', duration: 20000 });
03-29