diff --git a/pages/settlement/index.js b/pages/settlement/index.js index fc11394..d7da390 100644 --- a/pages/settlement/index.js +++ b/pages/settlement/index.js @@ -76,7 +76,7 @@ Page({ // 检查是否是从首页登录返回的 const pendingReturnPath = wx.getStorageSync('pendingReturnPath'); if (pendingReturnPath === 'settlement') { - console.log('检测到从首页登录返回,清除标记'); + console.log('检测到从首页登录返回,清除标记并自动提交申请'); // 清除返回路径标记 wx.removeStorageSync('pendingReturnPath'); @@ -85,11 +85,11 @@ Page({ // 检查是否有保存的表单数据 const savedProgress = wx.getStorageSync('settlementProgress'); if (savedProgress && savedProgress.formData) { - console.log('发现保存的表单数据,不自动提交申请'); + console.log('发现保存的表单数据,自动提交申请'); // 恢复表单数据 this.setData(savedProgress.formData); - // 自动提交申请已关闭 - // this.submitApplication(); + // 自动提交申请 + this.submitApplication(); } }, 500); } diff --git a/utils/api.js b/utils/api.js index 6f2f42e..b75649c 100644 --- a/utils/api.js +++ b/utils/api.js @@ -1617,6 +1617,19 @@ module.exports = { }); }, + // 重新提交备案申请 + resubmitSettlementApplication: function (applicationId) { + const openid = wx.getStorageSync('openid'); + console.log('API.resubmitSettlementApplication - applicationId:', applicationId, 'openid:', openid); + if (!openid) { + return Promise.reject(new Error('用户未登录')); + } + + return request(`/api/settlement/resubmit/${applicationId}`, 'POST', { + openid: openid + }); + }, + // 将商品状态设置为隐藏(软删除) deleteProduct: function (productId) { const openid = wx.getStorageSync('openid');