- backend: NestJS service with exercise/plan data - miniprogram: WeChat mini program client - exclude node_modules, dist, runtime data-store, local env
28 lines
555 B
JavaScript
28 lines
555 B
JavaScript
const app = getApp();
|
|
|
|
Component({
|
|
properties: {
|
|
title: { type: String, value: '' },
|
|
showBack: { type: Boolean, value: false }
|
|
},
|
|
data: {
|
|
statusBarHeight: 20
|
|
},
|
|
lifetimes: {
|
|
attached() {
|
|
const h = (app.globalData && app.globalData.statusBarHeight) || 20;
|
|
this.setData({ statusBarHeight: h });
|
|
}
|
|
},
|
|
methods: {
|
|
onBack() {
|
|
const pages = getCurrentPages();
|
|
if (pages.length > 1) {
|
|
wx.navigateBack();
|
|
} else {
|
|
wx.reLaunch({ url: '/pages/index/index' });
|
|
}
|
|
}
|
|
}
|
|
});
|