需求按钮状态优化
This commit is contained in:
@@ -39,7 +39,16 @@ Page({
|
||||
return new Promise((resolve) => {
|
||||
fetchDemandDetail({ id: id }).then(
|
||||
(res) => {
|
||||
console.log(res);
|
||||
if (!res || res.code !== 1 || !res.data) {
|
||||
wx.showToast({ title: (res && res.msg) || '加载失败', icon: 'none' });
|
||||
if (!this.data.demandInfo) {
|
||||
setTimeout(() => {
|
||||
wx.navigateBack({ delta: 1 });
|
||||
}, 1500);
|
||||
}
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
const demandInfo = res.data;
|
||||
this.setData({
|
||||
demandInfo,
|
||||
@@ -47,7 +56,7 @@ Page({
|
||||
}, () => resolve()); // setData 回调:页面已重新渲染
|
||||
},
|
||||
() => {
|
||||
//接口异常处理
|
||||
wx.showToast({ title: '网络异常,请重试', icon: 'none' });
|
||||
resolve();
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user