From b74ce363c7d882aac335da92e363a1889228b492 Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Mon, 10 Feb 2025 16:37:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E8=BD=AC=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- subPackages/transferPage/transferPage.js | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/subPackages/transferPage/transferPage.js b/subPackages/transferPage/transferPage.js index e1322c0..5a5ee19 100644 --- a/subPackages/transferPage/transferPage.js +++ b/subPackages/transferPage/transferPage.js @@ -5,13 +5,16 @@ Page({ * 页面的初始数据 */ data: { - + back: false }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { + this.setData({ + back: false + }) if (options.action = 'otherMiniProgram') { this.goOtherMiniProgrogram(options) } else { @@ -27,7 +30,12 @@ Page({ appId: data.appId, path: data.path, shortLink: data.shortLink, - complete: () =>{ + success: () =>{ + this.setData({ + back: true + }) + }, + fail: ()=>{ wx.navigateBack() } }) @@ -44,7 +52,15 @@ Page({ * 生命周期函数--监听页面显示 */ onShow() { - + if (this.data.back) { + wx.showModal({ + title: '即将返回君到苏州小程序', + showCancel: false, + complete: (res) => { + wx.navigateBack() + } + }) + } }, /** @@ -58,7 +74,6 @@ Page({ * 生命周期函数--监听页面卸载 */ onUnload() { - }, /**