|
@@ -7,18 +7,18 @@ Page({
|
|
|
*/
|
|
|
data: {
|
|
|
frameStyle: { useTop: true, name: '比赛管理', leftArrow: true, useBar: false },
|
|
|
- //查询条件
|
|
|
- searchName: '',
|
|
|
- list: [{
|
|
|
- name: '测试',
|
|
|
- explain: '比赛说明',
|
|
|
- num: 1
|
|
|
- }]
|
|
|
+ searchInfo: {},
|
|
|
+ list: []
|
|
|
},
|
|
|
// 跳转菜单
|
|
|
back(e) {
|
|
|
wx.navigateBack({ delta: 1 })
|
|
|
},
|
|
|
+ search: function (e) {
|
|
|
+ const that = this;
|
|
|
+ that.setData({ 'searchInfo.name': e.detail.value });
|
|
|
+ that.watchLogin()
|
|
|
+ },
|
|
|
//添加
|
|
|
toAdd: function () {
|
|
|
wx.navigateTo({ url: `/pages/match/projectadd` })
|
|
@@ -49,12 +49,6 @@ Page({
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 查询信息
|
|
|
- onSearch: function (e) {
|
|
|
- const that = this;
|
|
|
- that.setData({ searchName: e.detail });
|
|
|
- that.watchLogin();
|
|
|
- },
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
@@ -67,11 +61,12 @@ Page({
|
|
|
// 监听用户是否登录
|
|
|
watchLogin: async function () {
|
|
|
const that = this;
|
|
|
+ let searchInfo = that.data.searchInfo;
|
|
|
wx.getStorage({
|
|
|
key: 'user',
|
|
|
success: async res => {
|
|
|
let info = {};
|
|
|
- if (that.data.searchName) info.name = that.data.searchName;
|
|
|
+ if (searchInfo && searchInfo.name) info.name = searchInfo.name;
|
|
|
const arr = await app.$get(`/newCourt/api/matchProject/`, { ...info });
|
|
|
if (arr.errcode == '0') {
|
|
|
that.setData({ list: arr.data });
|