zs 2 years ago
parent
commit
5c2b156532
4 changed files with 119 additions and 8 deletions
  1. 26 3
      pages/order/index.js
  2. 36 2
      pages/order/index.less
  3. 28 1
      pages/order/index.wxml
  4. 29 2
      pages/order/index.wxss

+ 26 - 3
pages/order/index.js

@@ -1,5 +1,5 @@
 const app = getApp()
-import { examine_status } from '../../utils/dict';
+import { paystatusList } from '../../utils/dict';
 import WxValidate from '../../utils/wxValidate';
 Page({
 
@@ -12,13 +12,31 @@ Page({
         list: [],
         dialog: { title: '详细信息', show: false, type: '1' },
         info: {},
+        statusList: paystatusList
     },
     // 跳转菜单
     back(e) {
         wx.navigateBack({ delta: 1 })
     },
     // 查询
-    search: function (e) { console.log('查询'); },
+    onSearch: function () {
+        const that = this;
+        that.setData({ dialog: { title: '查询条件', show: true, type: '2' } })
+    },
+    // 选择支付状态
+    statusChange: function (e) {
+        const that = this;
+        let data = that.data.statusList[e.detail.value];
+        if (data) that.setData({ 'searchInfo.status': data.value })
+    },
+    // 提交查询
+    searchSubmit: function (e) {
+        const that = this;
+        const params = e.detail.value;
+        that.setData({ searchInfo: params })
+        that.watchLogin();
+        that.toClose()
+    },
     // 查看
     toView: async function (e) {
         const that = this;
@@ -68,10 +86,15 @@ Page({
     // 监听用户是否登录
     watchLogin: async function () {
         const that = this;
+        const searchInfo = that.data.searchInfo;
         wx.getStorage({
             key: 'user',
             success: async res => {
-                const arr = await app.$get(`/newCourt/api/payOrder`, { skip: 0, limit: 1000 });
+                let info = {};
+                if (searchInfo.money) info.money = searchInfo.money;
+                if (searchInfo.type) info.type = searchInfo.type;
+                if (searchInfo.status) info.status = searchInfo.status;
+                const arr = await app.$get(`/newCourt/api/payOrder`, { skip: 0, limit: 1000, ...info });
                 if (arr.errcode == '0') {
                     let list = arr.data;
                     for (const val of list) {

+ 36 - 2
pages/order/index.less

@@ -15,9 +15,10 @@
         width: 92vw;
         padding: 2vw;
         background-color: #f1f1f1;
+        text-align: center;
 
-        input {
-            font-size: 16px;
+        button {
+            width: 50%;
         }
     }
 
@@ -102,4 +103,37 @@
             color: #000000;
         }
     }
+}
+
+.dialog_two {
+    .content {
+        background-color: #ffffff;
+        border-bottom: 1px solid #cccccc;
+        display: flex;
+        flex-direction: row;
+        justify-content: space-between;
+        padding: 2vw;
+        width: 70vw;
+
+        .label {
+            width: 20vw;
+            text-align: left;
+            font-size: 16px;
+        }
+
+        .value {
+            width: 55vw;
+            text-align: right;
+            font-size: 16px;
+
+            textarea {
+                width: 55vw;
+            }
+        }
+    }
+
+    .btn {
+        margin: 2vw 0 0 0;
+        text-align: center;
+    }
 }

+ 28 - 1
pages/order/index.wxml

@@ -1,7 +1,7 @@
 <mobile-main frameStyle="{{frameStyle}}" bind:back="back">
     <view slot="info" class="container main">
         <view class="zero one">
-            <input type="text" value="{{searchInfo.name}}" bindconfirm="search" placeholder="请输入关键词" />
+            <button type="primary" size="mini" bindtap="onSearch">查询</button>
         </view>
         <view class="zero two">
             <scroll-view scroll-y="true" class="scroll-view">
@@ -65,5 +65,32 @@
                 <text>{{info.desc||'暂无'}}</text>
             </view>
         </view>
+        <view class="dialog_two" wx:elif="{{dialog.type=='2'}}">
+            <form catchsubmit="searchSubmit">
+                <view class="content">
+                    <view class="label">支付金额</view>
+                    <view class="value">
+                        <input type="text" name="money" value="{{searchInfo.money}}" placeholder="请输入支付金额" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">支付类型</view>
+                    <view class="value">
+                        <input type="text" name="type" value="{{searchInfo.type}}" placeholder="请输入支付类型" />
+                    </view>
+                </view>
+                <view class="content">
+                    <view class="label">支付状态</view>
+                    <view class="value">
+                        <picker mode="selector" bindchange="statusChange" value="{{searchInfo.status}}" name="status" range-key='label' range="{{statusList}}">
+                            <view class="input">{{searchInfo.status=='0'?'未支付':searchInfo.status=='1'?'已支付':searchInfo.status=='-1'?'支付失败':searchInfo.status=='-2'?'申请退款':searchInfo.status=='-3'?'已退款':'请选择支付状态'}}</view>
+                        </picker>
+                    </view>
+                </view>
+                <view class="btn">
+                    <button type="primary" size="mini" form-type="submit">提交保存</button>
+                </view>
+            </form>
+        </view>
     </view>
 </e-dialog>

+ 29 - 2
pages/order/index.wxss

@@ -12,9 +12,10 @@
   width: 92vw;
   padding: 2vw;
   background-color: #f1f1f1;
+  text-align: center;
 }
-.main .one input {
-  font-size: 16px;
+.main .one button {
+  width: 50%;
 }
 .main .two {
   flex-grow: 1;
@@ -83,3 +84,29 @@
 .dialog_one .one_1 text:nth-child(1) {
   color: #000000;
 }
+.dialog_two .content {
+  background-color: #ffffff;
+  border-bottom: 1px solid #cccccc;
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  padding: 2vw;
+  width: 70vw;
+}
+.dialog_two .content .label {
+  width: 20vw;
+  text-align: left;
+  font-size: 16px;
+}
+.dialog_two .content .value {
+  width: 55vw;
+  text-align: right;
+  font-size: 16px;
+}
+.dialog_two .content .value textarea {
+  width: 55vw;
+}
+.dialog_two .btn {
+  margin: 2vw 0 0 0;
+  text-align: center;
+}