//頁面銷毀前——上傳被提交的數據
onUnload:function(){
var _this=this;
let updateStatus = wx.getStorageSync('UpdateStatus');//判斷是否有未上傳的數據
if(updateStatus){
wx.showModal({
title: '提示',
content: '是否上傳本地數據?',
success: function(res) {
if (res.confirm) {
var promiseInfo = util.UpdateFn(0);
promiseInfo.then(function(data){
_this.getAPIData();
_this.setData({
updataCount: 0
});
}).catch(function(){
});
} else if (res.cancel) {
console.log('用戶點擊取消')
}
}
})
};
}