YY 2 年之前
父節點
當前提交
26f3a4938f

+ 49 - 4
pagesMatch/matchAdmin/profit/list.js

@@ -1,4 +1,7 @@
 const app = getApp();
 const app = getApp();
+import { bill_type } from '../../../utils/dict';
+import WxValidate from '../../../utils/wxValidate';
+
 Page({
 Page({
     data: {
     data: {
         frameStyle: { useTop: true, name: '收益信息', leftArrow: true, useBar: false },
         frameStyle: { useTop: true, name: '收益信息', leftArrow: true, useBar: false },
@@ -10,23 +13,57 @@ Page({
         page: 0,
         page: 0,
         skip: 0,
         skip: 0,
         limit: 5,
         limit: 5,
+        dialog: { title: '查询条件', show: false, type: '1' },
+        form: {},
+        typeList: bill_type,
+    },
+    initValidate() {
+        const rules = { match_id: { required: true } }
+        // 验证字段的提示信息,若不传则调用默认的信息
+        const messages = { match_id: { required: '赛事名称' } };
+        this.WxValidate = new WxValidate(rules, messages)
     },
     },
     // 返回
     // 返回
     back: function () { wx.navigateBack({ delta: 1 }) },
     back: function () { wx.navigateBack({ delta: 1 }) },
+
+    toSearch: function (e) {
+        const that = this;
+        that.setData({ dialog: { title: '查询条件', show: true, type: '1' } })
+    },
     // 选择赛事
     // 选择赛事
     matchChange: 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({ 'match.id': data._id, 'match.name': data.name });
+            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 });
+        }
+    },
+    //自动生成
+    onSubmit: async function (e) {
+        const that = this;
+        const params = e.detail.value;
+        if (!this.WxValidate.checkForm(params)) {
+            const error = this.WxValidate.errorList[0];
+            wx.showToast({ title: `${error.msg}`, icon: 'error', duration: 2000 })
+            return false
+        } else {
             that.setData({ skip: 0, page: 0, list: [] })
             that.setData({ skip: 0, page: 0, list: [] })
-            that.search(data);
+            that.search(); that.toClose();
         }
         }
     },
     },
+
     search: async function (e) {
     search: async function (e) {
         const that = this;
         const that = this;
-        let match = that.data.match;
-        let info = { skip: that.data.skip, limit: that.data.limit, match_id: match.id };
+        let form = that.data.form;
+        let info = { skip: that.data.skip, limit: that.data.limit, ...form };
         const arr = await app.$get(`/bill`, { ...info }, 'race');
         const arr = await app.$get(`/bill`, { ...info }, 'race');
         if (arr.errcode == '0') {
         if (arr.errcode == '0') {
             let list = [...that.data.list, ...arr.data]
             let list = [...that.data.list, ...arr.data]
@@ -34,6 +71,12 @@ Page({
             that.setData({ total: arr.total })
             that.setData({ total: arr.total })
         }
         }
     },
     },
+    // 关闭弹框
+    toClose: function () {
+        const that = this;
+        that.setData({ form: {} })
+        that.setData({ dialog: { title: '查询条件', show: false, type: '1' } })
+    },
     // 分页
     // 分页
     toPage: function () {
     toPage: function () {
         const that = this;
         const that = this;
@@ -62,6 +105,8 @@ Page({
      */
      */
     onShow: async function () {
     onShow: async function () {
         const that = this;
         const that = this;
+        //验证规则函数
+        that.initValidate();
         // 监听用户是否登录
         // 监听用户是否登录
         await that.watchLogin();
         await that.watchLogin();
     },
     },

+ 2 - 1
pagesMatch/matchAdmin/profit/list.json

@@ -1,6 +1,7 @@
 {
 {
     "component": true,
     "component": true,
     "usingComponents": {
     "usingComponents": {
-      "mobile-main": "/commpents/mobile-frame/index"
+      "mobile-main": "/commpents/mobile-frame/index",
+      "dialog": "/commpents/dialog/index"
     }
     }
   }
   }

+ 43 - 0
pagesMatch/matchAdmin/profit/list.less

@@ -25,10 +25,12 @@
             display: flex;
             display: flex;
             flex-direction: row;
             flex-direction: row;
             justify-content: space-around;
             justify-content: space-around;
+
             .one_2_1 {
             .one_2_1 {
                 width: 30vw;
                 width: 30vw;
                 margin: 0 1vw;
                 margin: 0 1vw;
             }
             }
+
             button {
             button {
                 width: 100%;
                 width: 100%;
                 padding: 2vw;
                 padding: 2vw;
@@ -92,4 +94,45 @@
         display: flex;
         display: flex;
         flex-direction: column;
         flex-direction: column;
     }
     }
+}
+
+.dialog_1 {
+    .content {
+        display: flex;
+        flex-direction: row;
+        border-bottom: 1px dashed var(--f1Color);
+        padding: 2vw 0;
+        margin: 0 2vw 2vw 2vw;
+
+        .value {
+            flex-grow: 1;
+            color: var(--blackColor);
+            width: 20vw;
+
+            .checkbox {
+                display: flex;
+                flex-direction: row;
+                flex-wrap: wrap;
+
+                .member {
+                    width: 23vw;
+                    margin: 0 1vw 0 0;
+                }
+
+                .memberTeam {
+                    width: 40vw;
+                    margin: 0 1vw 0 0;
+                }
+            }
+        }
+    }
+
+    .btn {
+        text-align: center;
+        margin: 3vw 0;
+
+        button {
+            margin: 0 2vw;
+        }
+    }
 }
 }

+ 31 - 6
pagesMatch/matchAdmin/profit/list.wxml

@@ -6,9 +6,7 @@
             </view>
             </view>
             <view class="one_2">
             <view class="one_2">
                 <view class="one_2_1 textOver">
                 <view class="one_2_1 textOver">
-                    <picker mode="selector" bindchange="matchChange" name="id" value="{{match.id}}" range="{{matchList}}" range-key="name">
-                        <button type="primary" class="textOver">{{match.name||'选择赛事'}}</button>
-                    </picker>
+                    <button type="primary" bindtap="toSearch">查询条件</button>
                 </view>
                 </view>
             </view>
             </view>
         </view>
         </view>
@@ -35,8 +33,8 @@
                                 <text>{{item.time}}</text>
                                 <text>{{item.time}}</text>
                             </view>
                             </view>
                             <view class="other_1">
                             <view class="other_1">
-                                <text>支付状态:</text>
-                                <text>{{item.type=='1'?'付款成功':item.type=='-1'?'退款成功':'暂无'}}</text>
+                                <text>账单来源:</text>
+                                <text>{{item.type=='1'?'报名缴费':item.type=='-1'?'退款':'暂无'}}</text>
                             </view>
                             </view>
                         </view>
                         </view>
                     </view>
                     </view>
@@ -44,4 +42,31 @@
             </scroll-view>
             </scroll-view>
         </view>
         </view>
     </view>
     </view>
-</mobile-main>
+</mobile-main>
+<dialog dialog="{{dialog}}" bind:toClose="toClose">
+    <view slot="info" class="dialog">
+        <view class="dialog_1" wx:if="{{dialog.type=='1'}}">
+            <form catchsubmit="onSubmit">
+                <view class="content">
+                    <view class="label">赛事名称:</view>
+                    <view class="value">
+                        <picker bindchange="matchChange" name="match_id" value="{{form.match_id}}" range-key='name' range="{{matchList}}">
+                            <view class="picker">{{form.match_name||'请选择赛事'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">账单来源:</view>
+                    <view class="value">
+                        <picker mode="selector" bindchange="typeChange" name="type" value="{{form.type}}" range="{{typeList}}" range-key="label">
+                            <view class="picker">{{form.type_name||'请选择账单来源'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="btn">
+                    <button type="primary" size="mini" formType="submit">提交保存</button>
+                </view>
+            </form>
+        </view>
+    </view>
+</dialog>

+ 32 - 0
pagesMatch/matchAdmin/profit/list.wxss

@@ -78,3 +78,35 @@
   display: flex;
   display: flex;
   flex-direction: column;
   flex-direction: column;
 }
 }
+.dialog_1 .content {
+  display: flex;
+  flex-direction: row;
+  border-bottom: 1px dashed var(--f1Color);
+  padding: 2vw 0;
+  margin: 0 2vw 2vw 2vw;
+}
+.dialog_1 .content .value {
+  flex-grow: 1;
+  color: var(--blackColor);
+  width: 20vw;
+}
+.dialog_1 .content .value .checkbox {
+  display: flex;
+  flex-direction: row;
+  flex-wrap: wrap;
+}
+.dialog_1 .content .value .checkbox .member {
+  width: 23vw;
+  margin: 0 1vw 0 0;
+}
+.dialog_1 .content .value .checkbox .memberTeam {
+  width: 40vw;
+  margin: 0 1vw 0 0;
+}
+.dialog_1 .btn {
+  text-align: center;
+  margin: 3vw 0;
+}
+.dialog_1 .btn button {
+  margin: 0 2vw;
+}

+ 5 - 0
utils/dict.js

@@ -229,4 +229,9 @@ export const pay_status = [
 export const is_use = [
 export const is_use = [
     { label: '启用', value: '0' },
     { label: '启用', value: '0' },
     { label: '禁用', value: '1' },
     { label: '禁用', value: '1' },
+]
+// 收益信息-账单来源
+export const bill_type = [
+    { label: '报名缴费', value: '1' },
+    { label: '退款', value: '-1' },
 ]
 ]