feat: harden phase one workflows
This commit is contained in:
@@ -3,6 +3,7 @@ const { listSecondGoods } = require('../../api/secondGoodsApi')
|
||||
Page({
|
||||
data: {
|
||||
loading: false,
|
||||
keyword: '',
|
||||
goods: []
|
||||
},
|
||||
|
||||
@@ -16,12 +17,20 @@ Page({
|
||||
|
||||
load() {
|
||||
this.setData({ loading: true })
|
||||
listSecondGoods()
|
||||
listSecondGoods(null, this.data.keyword)
|
||||
.then((goods) => this.setData({ goods: goods || [] }))
|
||||
.catch((error) => wx.showToast({ title: error.message, icon: 'none' }))
|
||||
.finally(() => this.setData({ loading: false }))
|
||||
},
|
||||
|
||||
onKeywordInput(event) {
|
||||
this.setData({ keyword: event.detail.value })
|
||||
},
|
||||
|
||||
search() {
|
||||
this.load()
|
||||
},
|
||||
|
||||
goCreate() {
|
||||
wx.navigateTo({ url: '/pages/second-hand/create' })
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user