Browse Source

中转页

master
jiazhipeng 1 year ago
parent
commit
b74ce363c7
  1. 23
      subPackages/transferPage/transferPage.js

23
subPackages/transferPage/transferPage.js

@ -5,13 +5,16 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
back: false
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.setData({
back: false
})
if (options.action = 'otherMiniProgram') { if (options.action = 'otherMiniProgram') {
this.goOtherMiniProgrogram(options) this.goOtherMiniProgrogram(options)
} else { } else {
@ -27,7 +30,12 @@ Page({
appId: data.appId, appId: data.appId,
path: data.path, path: data.path,
shortLink: data.shortLink, shortLink: data.shortLink,
complete: () =>{ success: () =>{
this.setData({
back: true
})
},
fail: ()=>{
wx.navigateBack() wx.navigateBack()
} }
}) })
@ -44,7 +52,15 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
if (this.data.back) {
wx.showModal({
title: '即将返回君到苏州小程序',
showCancel: false,
complete: (res) => {
wx.navigateBack()
}
})
}
}, },
/** /**
@ -58,7 +74,6 @@ Page({
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {
}, },
/** /**

Loading…
Cancel
Save