//Component Object Component({ properties: { shops: { type: Array, value: [] }, }, data: { }, methods: { getLocation: function(res){ this.triggerEvent('getLocation', { }); }, gotoShopInfo:function (e){ let id = e.currentTarget.dataset.id; let pages = getCurrentPages(); // 当前页, let prevPage = pages[pages.length - 2]; // 上一页 prevPage.setData({ chooseStoreId: id, }) wx.navigateBack({ //返回 delta: 1 }) // wx.switchTab({ // url: '../../pages/index/index?storeId='+id, // }) } }, created: function(){ }, attached: function(){ }, ready: function(){ }, moved: function(){ }, detached: function(){ }, });