|
@@ -20,26 +20,20 @@ Page({
|
|
|
//查询
|
|
|
onSearch: function (e) {
|
|
|
const that = this;
|
|
|
- that.setData({ list: [] })
|
|
|
- that.setData({ skip: 0 })
|
|
|
- that.setData({ page: 0 })
|
|
|
+ that.setData({ skip: 0, page: 0, list: [] })
|
|
|
that.setData({ 'searchInfo.title': e.detail.value });
|
|
|
that.watchLogin()
|
|
|
},
|
|
|
// 添加
|
|
|
toAdd() {
|
|
|
const that = this;
|
|
|
- that.setData({ skip: 0 })
|
|
|
- that.setData({ page: 0 })
|
|
|
- that.setData({ list: [] })
|
|
|
+ that.setData({ skip: 0, page: 0, list: [] })
|
|
|
wx.navigateTo({ url: '/pages/topic/add' })
|
|
|
},
|
|
|
// 修改
|
|
|
toEdit: function (e) {
|
|
|
const that = this;
|
|
|
- that.setData({ list: [] })
|
|
|
- that.setData({ skip: 0 })
|
|
|
- that.setData({ page: 0 })
|
|
|
+ that.setData({ skip: 0, page: 0, list: [] })
|
|
|
let { id } = e.currentTarget.dataset;
|
|
|
wx.navigateTo({ url: `/pages/topic/add?id=${id}` })
|
|
|
},
|
|
@@ -55,9 +49,7 @@ Page({
|
|
|
const arr = await app.$delete(`/newCourt/api/topic/${id}`);
|
|
|
if (arr.errcode == '0') {
|
|
|
wx.showToast({ title: `删除信息成功`, icon: 'success', duration: 2000 })
|
|
|
- that.setData({ list: [] })
|
|
|
- that.setData({ skip: 0 })
|
|
|
- that.setData({ page: 0 })
|
|
|
+ that.setData({ skip: 0, page: 0, list: [] })
|
|
|
that.watchLogin()
|
|
|
} else {
|
|
|
wx.showToast({ title: `${arr.errmsg}`, icon: 'error', duration: 2000 })
|