Browse Source

退款申请

guhongwei 2 năm trước cách đây
mục cha
commit
a0e08cdefd

+ 1 - 0
pagesMatch/matchAdmin/group/list.js

@@ -19,6 +19,7 @@ Page({
         let data = that.data.matchList[e.detail.value];
         if (data) {
             that.setData({ 'match.id': data._id, 'match.name': data.name });
+            that.setData({ skip: 0, page: 0, list: [] })
             that.search();
         }
     },

+ 1 - 0
pagesMatch/matchAdmin/profit/list.js

@@ -19,6 +19,7 @@ Page({
         let data = that.data.matchList[e.detail.value];
         if (data) {
             that.setData({ 'match.id': data._id, 'match.name': data.name });
+            that.setData({ skip: 0, page: 0, list: [] })
             that.search(data);
         }
     },

+ 1 - 0
pagesMatch/matchAdmin/project/list.js

@@ -23,6 +23,7 @@ Page({
         let data = that.data.matchList[e.detail.value];
         if (data) {
             that.setData({ 'match.id': data._id, 'match.name': data.name });
+            that.setData({ skip: 0, page: 0, list: [] })
             that.search();
         }
     },

+ 26 - 28
pagesMatch/matchAdmin/refund/list.js

@@ -1,13 +1,11 @@
 const app = getApp();
 import { pay_status } from "../../../utils/dict";
-
 Page({
     data: {
         frameStyle: { useTop: true, name: '退款申请', leftArrow: true, useBar: false },
         // 赛事列表
         matchList: [],
-        zhMatch: '',
-        _id: '',
+        match: {},
         list: [],
         total: 0,
         page: 0,
@@ -16,15 +14,17 @@ Page({
     },
     // 返回
     back: function () { wx.navigateBack({ delta: 1 }) },
-    matchChange: async function (e) {
+    // 选择赛事
+    matchChange: function (e) {
         const that = this;
         let data = that.data.matchList[e.detail.value];
         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: [] })
-            await that.watchLogin();
+            that.search(data);
         }
     },
+    // 审核退款
     toExam: function (e) {
         const that = this;
         let { item } = e.currentTarget.dataset;
@@ -33,7 +33,7 @@ Page({
             content: '是否通过该名用户的退款',
             async success(res) {
                 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') {
                         wx.showToast({ title: `维护信息完成`, icon: 'success', duration: 2000 });
                         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 () {
         const that = this;
@@ -56,7 +72,7 @@ Page({
             that.setData({ page: page })
             let skip = page * limit;
             that.setData({ skip: skip })
-            that.watchLogin();
+            that.search();
             wx.hideLoading()
         } else { wx.showToast({ title: '没有更多数据了', icon: 'none', duration: 2000 }) }
     },
@@ -84,32 +100,14 @@ Page({
             success: async res => {
                 let arr;
                 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 => {
                 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 '暂无';
-    },
+
     /**
      * 页面上拉触底事件的处理函数
      */

+ 8 - 5
pagesMatch/matchAdmin/refund/list.less

@@ -6,12 +6,13 @@
 
     .one {
         display: flex;
-        flex-direction: row;
+        flex-direction: column;
+        width: 96vw;
         padding: 2vw;
         border-bottom: 1px solid var(--f1Color);
 
         .one_1 {
-            flex-grow: 1;
+            margin: 0 0 2vw 0;
 
             input {
                 padding: 1vw 0 2vw 2vw;
@@ -21,11 +22,13 @@
         }
 
         .one_2 {
-            width: 25vw;
+            display: flex;
+            flex-direction: row;
+            justify-content: space-around;
 
             button {
-                width: 25vw;
-                padding: 1vw;
+                width: 100%;
+                padding: 2vw;
                 font-size: var(--font14Size);
             }
         }

+ 5 - 3
pagesMatch/matchAdmin/refund/list.wxml

@@ -5,9 +5,11 @@
                 <input type="text" placeholder="请输入关键词" />
             </view>
             <view class="one_2">
-                <picker mode="selector" bindchange="matchChange" name="_id" value="{{_id}}" range="{{matchList}}" range-key="name">
-                    <button type="primary" size="mini" class="textOver">{{zhMatch||'选择赛事'}}</button>
-                </picker>
+                <view class="one_2_1">
+                    <picker mode="selector" bindchange="matchChange" name="id" value="{{match.id}}" range="{{matchList}}" range-key="name">
+                        <button type="primary" class="textOver">{{match.name||'选择赛事'}}</button>
+                    </picker>
+                </view>
             </view>
         </view>
         <view class="two">

+ 8 - 5
pagesMatch/matchAdmin/refund/list.wxss

@@ -5,12 +5,13 @@
 }
 .main .one {
   display: flex;
-  flex-direction: row;
+  flex-direction: column;
+  width: 96vw;
   padding: 2vw;
   border-bottom: 1px solid var(--f1Color);
 }
 .main .one .one_1 {
-  flex-grow: 1;
+  margin: 0 0 2vw 0;
 }
 .main .one .one_1 input {
   padding: 1vw 0 2vw 2vw;
@@ -18,11 +19,13 @@
   border-radius: 5px;
 }
 .main .one .one_2 {
-  width: 25vw;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-around;
 }
 .main .one .one_2 button {
-  width: 25vw;
-  padding: 1vw;
+  width: 100%;
+  padding: 2vw;
   font-size: var(--font14Size);
 }
 .main .two {