|
@@ -12,10 +12,50 @@ Page({
|
|
statusList: []
|
|
statusList: []
|
|
},
|
|
},
|
|
// 上传比分
|
|
// 上传比分
|
|
- async toUpload(e) {
|
|
|
|
|
|
+ async toUpload(e) {
|
|
let item = e.currentTarget.dataset.item
|
|
let item = e.currentTarget.dataset.item
|
|
wx.navigateTo({ url: '/pagesMy/score/index?id=' + item._id })
|
|
wx.navigateTo({ url: '/pagesMy/score/index?id=' + item._id })
|
|
},
|
|
},
|
|
|
|
+ // 分页-触底
|
|
|
|
+ toLower() {
|
|
|
|
+ const that = this;
|
|
|
|
+ let list = that.data.list;
|
|
|
|
+ let limit = that.data.limit;
|
|
|
|
+ if (that.data.total > list.length) {
|
|
|
|
+ wx.showLoading({ title: '加载中', mask: true })
|
|
|
|
+ let page = that.data.page + 1;
|
|
|
|
+ that.setData({ page })
|
|
|
|
+ let skip = page * limit
|
|
|
|
+ that.setData({ skip })
|
|
|
|
+ that.search()
|
|
|
|
+ wx.hideLoading()
|
|
|
|
+ } else {
|
|
|
|
+ wx.showToast({ title: `到底了没数据了`, icon: 'none' });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 分页-滚动
|
|
|
|
+ toScroll() {
|
|
|
|
+ // console.log('滚动');
|
|
|
|
+ },
|
|
|
|
+ // 字典
|
|
|
|
+ getDict(value, model) {
|
|
|
|
+ const that = this;
|
|
|
|
+ if (model == 'status') {
|
|
|
|
+ if (value) {
|
|
|
|
+ let data = that.data.statusList.find(i => i.value == value)
|
|
|
|
+ if (data) return data.label
|
|
|
|
+ else return '暂无'
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 清空列表
|
|
|
|
+ clearPage() {
|
|
|
|
+ const that = this;
|
|
|
|
+ that.setData({ list: [] })
|
|
|
|
+ that.setData({ skip: 0 })
|
|
|
|
+ that.setData({ limit: 5 })
|
|
|
|
+ that.setData({ total: 0 })
|
|
|
|
+ },
|
|
/**
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
*/
|
|
@@ -47,12 +87,21 @@ Page({
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ // 查询其他信息
|
|
|
|
+ async searchOther() {
|
|
|
|
+ const that = this;
|
|
|
|
+ let res;
|
|
|
|
+ res = await app.$api('dictData', 'GET', { type: 'course_status', is_use: '0' })
|
|
|
|
+ if (res.errcode == '0') that.setData({ statusList: res.data })
|
|
|
|
+ // 查分数
|
|
|
|
+ res = await app.$api('course/ranking', 'GET', { match_id: that.data.id })
|
|
|
|
+ },
|
|
// 查询通知
|
|
// 查询通知
|
|
async search() {
|
|
async search() {
|
|
const that = this;
|
|
const that = this;
|
|
let info = { skip: that.data.skip, limit: that.data.limit };
|
|
let info = { skip: that.data.skip, limit: that.data.limit };
|
|
info.match_id = that.data.id
|
|
info.match_id = that.data.id
|
|
- let res = await app.$api('course', 'GET', { ...info})
|
|
|
|
|
|
+ let res = await app.$api('course', 'GET', { ...info })
|
|
if (res.errcode == '0') {
|
|
if (res.errcode == '0') {
|
|
let list = [...that.data.list, ...res.data]
|
|
let list = [...that.data.list, ...res.data]
|
|
for (const val of list) {
|
|
for (const val of list) {
|
|
@@ -62,53 +111,6 @@ Page({
|
|
that.setData({ total: res.total })
|
|
that.setData({ total: res.total })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 分页-触底
|
|
|
|
- toLower() {
|
|
|
|
- const that = this;
|
|
|
|
- let list = that.data.list;
|
|
|
|
- let limit = that.data.limit;
|
|
|
|
- if (that.data.total > list.length) {
|
|
|
|
- wx.showLoading({ title: '加载中', mask: true })
|
|
|
|
- let page = that.data.page + 1;
|
|
|
|
- that.setData({ page })
|
|
|
|
- let skip = page * limit
|
|
|
|
- that.setData({ skip })
|
|
|
|
- that.search()
|
|
|
|
- wx.hideLoading()
|
|
|
|
- } else {
|
|
|
|
- wx.showToast({ title: `到底了没数据了`, icon: 'none' });
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 分页-滚动
|
|
|
|
- toScroll() {
|
|
|
|
- // console.log('滚动');
|
|
|
|
- },
|
|
|
|
- // 字典
|
|
|
|
- getDict(value, model) {
|
|
|
|
- const that = this;
|
|
|
|
- if (model == 'status') {
|
|
|
|
- if (value) {
|
|
|
|
- let data = that.data.statusList.find(i => i.value == value)
|
|
|
|
- if (data) return data.label
|
|
|
|
- else return '暂无'
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- // 查询其他信息
|
|
|
|
- async searchOther() {
|
|
|
|
- const that = this;
|
|
|
|
- let res;
|
|
|
|
- res = await app.$api('dictData', 'GET', { type: 'course_status', is_use: '0' })
|
|
|
|
- if (res.errcode == '0') that.setData({ statusList: res.data })
|
|
|
|
- },
|
|
|
|
- // 清空列表
|
|
|
|
- clearPage() {
|
|
|
|
- const that = this;
|
|
|
|
- that.setData({ list: [] })
|
|
|
|
- that.setData({ skip: 0 })
|
|
|
|
- that.setData({ limit: 5 })
|
|
|
|
- that.setData({ total: 0 })
|
|
|
|
- },
|
|
|
|
/**
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
*/
|