|
@@ -5,9 +5,6 @@ import WxValidate from '../../../utils/wxValidate';
|
|
|
Page({
|
|
|
data: {
|
|
|
frameStyle: { useTop: true, name: '收益信息', leftArrow: true, useBar: false },
|
|
|
- // 赛事列表
|
|
|
- matchList: [],
|
|
|
- match: {},
|
|
|
list: [],
|
|
|
total: 0,
|
|
|
page: 0,
|
|
@@ -16,16 +13,17 @@ Page({
|
|
|
dialog: { title: '查询条件', show: false, type: '1' },
|
|
|
form: {},
|
|
|
typeList: bill_type,
|
|
|
+ matchList: [],
|
|
|
},
|
|
|
initValidate() {
|
|
|
- const rules = { match_id: { required: true } }
|
|
|
+ const rules = { match_id: { required: false } }
|
|
|
// 验证字段的提示信息,若不传则调用默认的信息
|
|
|
const messages = { match_id: { required: '赛事名称' } };
|
|
|
this.WxValidate = new WxValidate(rules, messages)
|
|
|
},
|
|
|
// 返回
|
|
|
back: function () { wx.navigateBack({ delta: 1 }) },
|
|
|
-
|
|
|
+ // 查询条件
|
|
|
toSearch: function (e) {
|
|
|
const that = this;
|
|
|
that.setData({ dialog: { title: '查询条件', show: true, type: '1' } })
|
|
@@ -34,19 +32,15 @@ Page({
|
|
|
matchChange: function (e) {
|
|
|
const that = this;
|
|
|
let data = that.data.matchList[e.detail.value];
|
|
|
- if (data) {
|
|
|
- that.setData({ 'form.match_id': data._id, 'form.match_name': data.name });
|
|
|
- }
|
|
|
+ if (data) { that.setData({ 'form.match_id': data._id, 'form.match_name': data.name }); }
|
|
|
},
|
|
|
// 账单来源
|
|
|
typeChange: function (e) {
|
|
|
const that = this;
|
|
|
let data = that.data.typeList[e.detail.value];
|
|
|
- if (data) {
|
|
|
- that.setData({ 'form.type': data.value, 'form.type_name': data.label });
|
|
|
- }
|
|
|
+ if (data) { that.setData({ 'form.type': data.value, 'form.type_name': data.label }); }
|
|
|
},
|
|
|
- //自动生成
|
|
|
+ //提交查询
|
|
|
onSubmit: async function (e) {
|
|
|
const that = this;
|
|
|
const params = e.detail.value;
|
|
@@ -59,11 +53,9 @@ Page({
|
|
|
that.search(); that.toClose();
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
search: async function (e) {
|
|
|
const that = this;
|
|
|
- let form = that.data.form;
|
|
|
- let info = { skip: that.data.skip, limit: that.data.limit, ...form };
|
|
|
+ let info = { skip: that.data.skip, limit: that.data.limit, ...that.data.form };
|
|
|
const arr = await app.$get(`/bill`, { ...info }, 'race');
|
|
|
if (arr.errcode == '0') {
|
|
|
let list = [...that.data.list, ...arr.data]
|