|
@@ -1,13 +1,11 @@
|
|
const app = getApp();
|
|
const app = getApp();
|
|
import { pay_status } from "../../../utils/dict";
|
|
import { pay_status } from "../../../utils/dict";
|
|
-
|
|
|
|
Page({
|
|
Page({
|
|
data: {
|
|
data: {
|
|
frameStyle: { useTop: true, name: '退款申请', leftArrow: true, useBar: false },
|
|
frameStyle: { useTop: true, name: '退款申请', leftArrow: true, useBar: false },
|
|
// 赛事列表
|
|
// 赛事列表
|
|
matchList: [],
|
|
matchList: [],
|
|
- zhMatch: '',
|
|
|
|
- _id: '',
|
|
|
|
|
|
+ match: {},
|
|
list: [],
|
|
list: [],
|
|
total: 0,
|
|
total: 0,
|
|
page: 0,
|
|
page: 0,
|
|
@@ -16,15 +14,17 @@ Page({
|
|
},
|
|
},
|
|
// 返回
|
|
// 返回
|
|
back: function () { wx.navigateBack({ delta: 1 }) },
|
|
back: function () { wx.navigateBack({ delta: 1 }) },
|
|
- matchChange: async function (e) {
|
|
|
|
|
|
+ // 选择赛事
|
|
|
|
+ matchChange: function (e) {
|
|
const that = this;
|
|
const that = this;
|
|
let data = that.data.matchList[e.detail.value];
|
|
let data = that.data.matchList[e.detail.value];
|
|
if (data) {
|
|
if (data) {
|
|
- that.setData({ _id: data._id, zhMatch: data.name });
|
|
|
|
|
|
+ that.setData({ 'match.id': data._id, 'match.name': data.name });
|
|
that.setData({ skip: 0, page: 0, list: [] })
|
|
that.setData({ skip: 0, page: 0, list: [] })
|
|
- await that.watchLogin();
|
|
|
|
|
|
+ that.search(data);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 审核退款
|
|
toExam: function (e) {
|
|
toExam: function (e) {
|
|
const that = this;
|
|
const that = this;
|
|
let { item } = e.currentTarget.dataset;
|
|
let { item } = e.currentTarget.dataset;
|
|
@@ -33,7 +33,7 @@ Page({
|
|
content: '是否通过该名用户的退款',
|
|
content: '是否通过该名用户的退款',
|
|
async success(res) {
|
|
async success(res) {
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
- const arr = await app.$post(`/matchSign/${item._id}`, { pay_status: -3}, 'race');
|
|
|
|
|
|
+ const arr = await app.$post(`/matchSign/${item._id}`, { pay_status: -3 }, 'race');
|
|
if (arr.errcode == '0') {
|
|
if (arr.errcode == '0') {
|
|
wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 });
|
|
wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 });
|
|
that.setData({ skip: 0, page: 0, list: [] })
|
|
that.setData({ skip: 0, page: 0, list: [] })
|
|
@@ -45,6 +45,22 @@ Page({
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ search: async function (e) {
|
|
|
|
+ let info = { skip: that.data.skip, limit: that.data.limit, match_id: e._id, pay_status: '-2' };
|
|
|
|
+ const arr = await app.$get(`/matchSign`, { ...info }, 'race');
|
|
|
|
+ if (arr.errcode == '0') {
|
|
|
|
+ let list = [...that.data.list, ...arr.data]
|
|
|
|
+ for (const val of list) { val.zhpay_status = that.searchStatus(val.pay_status) }
|
|
|
|
+ that.setData({ list })
|
|
|
|
+ that.setData({ total: arr.total })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 查询状态
|
|
|
|
+ searchStatus: function (e) {
|
|
|
|
+ let data = pay_status.find(i => i.value == e);
|
|
|
|
+ if (data) return data.label;
|
|
|
|
+ else return '暂无';
|
|
|
|
+ },
|
|
// 分页
|
|
// 分页
|
|
toPage: function () {
|
|
toPage: function () {
|
|
const that = this;
|
|
const that = this;
|
|
@@ -56,7 +72,7 @@ Page({
|
|
that.setData({ page: page })
|
|
that.setData({ page: page })
|
|
let skip = page * limit;
|
|
let skip = page * limit;
|
|
that.setData({ skip: skip })
|
|
that.setData({ skip: skip })
|
|
- that.watchLogin();
|
|
|
|
|
|
+ that.search();
|
|
wx.hideLoading()
|
|
wx.hideLoading()
|
|
} else { wx.showToast({ title: '没有更多数据了', icon: 'none', duration: 2000 }) }
|
|
} else { wx.showToast({ title: '没有更多数据了', icon: 'none', duration: 2000 }) }
|
|
},
|
|
},
|
|
@@ -84,32 +100,14 @@ Page({
|
|
success: async res => {
|
|
success: async res => {
|
|
let arr;
|
|
let arr;
|
|
arr = await app.$get(`/match`, { belong_id: res.data._id }, 'race');
|
|
arr = await app.$get(`/match`, { belong_id: res.data._id }, 'race');
|
|
- if (arr.errcode == '0') {
|
|
|
|
- that.setData({ matchList: arr.data });
|
|
|
|
- }
|
|
|
|
- if (that.data._id) {
|
|
|
|
- let info = { skip: that.data.skip, limit: that.data.limit, match_id: that.data._id, pay_status: '-2' };
|
|
|
|
- const arr = await app.$get(`/matchSign`, { ...info }, 'race');
|
|
|
|
- if (arr.errcode == '0') {
|
|
|
|
- let list = [...that.data.list, ...arr.data]
|
|
|
|
- for (const val of list) { val.zhpay_status = that.searchStatus(val.pay_status) }
|
|
|
|
- that.setData({ list })
|
|
|
|
- that.setData({ total: arr.total })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ if (arr.errcode == '0') { that.setData({ matchList: arr.data }); }
|
|
},
|
|
},
|
|
fail: async res => {
|
|
fail: async res => {
|
|
wx.redirectTo({ url: '/pages/index/index' })
|
|
wx.redirectTo({ url: '/pages/index/index' })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 查询状态
|
|
|
|
- searchStatus: function (e) {
|
|
|
|
- let data = pay_status.find(i => i.value == e);
|
|
|
|
- if (data) return data.label;
|
|
|
|
- else return '暂无';
|
|
|
|
- },
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
*/
|