12345678910111213141516171819202122232425262728293031323334353637 |
- // components/publishBtn/publishBtn.js
- Component({
- properties: {
- data: {
- type: Object,
- value: {},
- },
- },
- data: {
- isRelease: false,
- },
- lifetimes: {
- // 生命周期函数,可以为函数,或一个在methods段中定义的方法名
- attached: function () {
- this.setData({
- isRelease: getApp().globalData.isRelease,
- });
- },
- },
- /**
- * 组件的方法列表
- */
- methods: {
- tapPulishAction() {
- const { data } = this.properties;
- const userinfo = wx.getStorageSync("USERINFO");
- if (userinfo && userinfo.token) {
- wx.navigateTo({
- url: `/pages/pulishPost/pulishPost?data=${JSON.stringify(data)}`,
- });
- } else {
- wx.navigateTo({ url: `/pages/login/login` });
- }
- },
- },
- });
|