55 lines
930 B
JavaScript
55 lines
930 B
JavaScript
// components/nav.js
|
|
const app = getApp()
|
|
Component({
|
|
/**
|
|
* 组件的属性列表
|
|
*/
|
|
properties: {
|
|
navName: {
|
|
type: String,
|
|
value: "",
|
|
observer(newval) {
|
|
this.setData({
|
|
name: newval,
|
|
});
|
|
},
|
|
},
|
|
},
|
|
|
|
/**
|
|
* 组件的初始数据
|
|
*/
|
|
data: {
|
|
name:'',
|
|
img_host:app.hostConfig().imghost
|
|
},
|
|
|
|
/**
|
|
* 组件的方法列表
|
|
*/
|
|
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',
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
},
|
|
}
|
|
})
|