123 lines
2.4 KiB
JavaScript
123 lines
2.4 KiB
JavaScript
// pages/transfer/transfer.js
|
|
let app = getApp()
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
show: false
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad(options) {
|
|
wx.showLoading({
|
|
title: '加载中...',
|
|
})
|
|
|
|
setTimeout(() => {
|
|
wx.hideLoading()
|
|
}, 500);
|
|
let miniProgram = app.globalData['miniProgram']
|
|
if (miniProgram == 'gx') {
|
|
wx.navigateToMiniProgram({
|
|
appId: "wx9c68fbf7886ea9c4",
|
|
path: "/pages/edit/edit",
|
|
success: function () {
|
|
wx.hideLoading()
|
|
},
|
|
fail: (err) => {
|
|
wx.hideLoading()
|
|
this.setData({
|
|
show: true
|
|
})
|
|
}
|
|
})
|
|
} else {
|
|
wx.redirectTo({
|
|
url: '/pages/edit/edit',
|
|
})
|
|
}
|
|
},
|
|
|
|
skip() {
|
|
let miniProgram = app.globalData['miniProgram']
|
|
if (miniProgram == 'gx') {
|
|
wx.navigateToMiniProgram({
|
|
appId: "wx9c68fbf7886ea9c4",
|
|
path: "/pages/edit/edit",
|
|
fail: function () {
|
|
wx.redirectTo({
|
|
url: '/pages/index/index',
|
|
})
|
|
}
|
|
})
|
|
} else {
|
|
wx.redirectTo({
|
|
url: '/pages/edit/edit',
|
|
})
|
|
}
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
showIndex: 0,
|
|
onShow() {
|
|
this.showIndex++
|
|
if (this.showIndex >= 2) {
|
|
wx.navigateBack({
|
|
delta: 1,
|
|
fail: function () {
|
|
wx.redirectTo({
|
|
url: '/pages/index/index',
|
|
})
|
|
}
|
|
})
|
|
}
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom() {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage() {
|
|
|
|
}
|
|
}) |