feat: add resident miniapp MVP
This commit is contained in:
@@ -1 +1,28 @@
|
||||
Page({})
|
||||
const { listGroupBuys } = require('../../api/groupBuyApi')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
loading: false,
|
||||
groupBuys: []
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.load()
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.load()
|
||||
},
|
||||
|
||||
load() {
|
||||
this.setData({ loading: true })
|
||||
listGroupBuys()
|
||||
.then((groupBuys) => this.setData({ groupBuys: groupBuys || [] }))
|
||||
.catch((error) => wx.showToast({ title: error.message, icon: 'none' }))
|
||||
.finally(() => this.setData({ loading: false }))
|
||||
},
|
||||
|
||||
goDetail(event) {
|
||||
wx.navigateTo({ url: '/pages/group-buy/detail?id=' + event.currentTarget.dataset.id })
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user