guhongwei 2 years ago
parent
commit
95f1ca5c53

+ 1 - 1
pagesMatch/match/achieve.js

@@ -34,7 +34,7 @@ Page({
      */
     onLoad: async function (options) {
         const that = this;
-        that.setData({ options: { match_id: options && options.match_id || '630ec4700a92b0a015ccfd14', group_id: options && options.group_id || '631060da75c1cd7fa923b8df', project_id: options && options.project_id || '631060f775c1cd7fa923b8ef' } });
+        that.setData({ options: { match_id: options && options.match_id || '', group_id: options && options.group_id || '', project_id: options && options.project_id || '' } });
         // 监听用户是否登录
         await that.watchLogin();
     },

+ 7 - 15
pagesMatch/matchAdmin/profit/list.js

@@ -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]

+ 1 - 1
pagesMatch/matchAdmin/profit/list.wxml

@@ -61,7 +61,7 @@
                     </view>
                 </view>
                 <view class="btn">
-                    <button type="primary" size="mini" formType="submit">提交保存</button>
+                    <button type="primary" size="mini" formType="submit">提交查询</button>
                 </view>
             </form>
         </view>