2023-11-17 09:51:35 +08:00

54 lines
891 B
JavaScript

// components/nav.js
const app = getApp()
Component({
/**
* 组件的属性列表
*/
properties: {
navName: {
type: String,
value: "",
observer(newval) {
this.setData({
name: newval,
});
},
},
},
/**
* 组件的初始数据
*/
data: {
name:''
},
/**
* 组件的方法列表
*/
methods: {
goBack(){
console.log("origion:"+app.globalData.origion)
if(app.globalData.origion==1){
wx.reLaunch({
url: '/pages/index/index',
})
}else if(app.globalData.origion==2){
wx.reLaunch({
url: '/pages/index/index',
})
}else{
wx.navigateBack({
delta: 1,
fail:function(){
wx.reLaunch({
url: '/pages/index/index',
})
}
})
}
},
}
})