Bläddra i källkod

添加周期筛选

xiaohaizhao 1 år sedan
förälder
incheckning
82e257be63
2 ändrade filer med 28 tillägg och 3 borttagningar
  1. 18 1
      packageA/orderForm/rows.js
  2. 10 2
      packageA/orderForm/rows.wxml

+ 18 - 1
packageA/orderForm/rows.js

@@ -15,6 +15,23 @@ Page({
   onLoad(options) {
     this.getList()
   },
+  tabsChange({
+    detail
+  }) {
+    let where = this.data.content.where;
+    if (detail.index == 0) {
+      delete(where.isuncheckout);
+      where.datetype = ""
+    } else if (detail.index == 1) {
+      where.isuncheckout = 1;
+      where.datetype = ""
+    } else {
+      where.isuncheckout = 1;
+      where.datetype = detail.name;
+    }
+    this.data.content.where = where;
+    this.getList(true)
+  },
   /* 获取产品 */
   getList(init = false) {
     if (init.detail != undefined) init = init.detail;
@@ -56,6 +73,6 @@ Page({
   },
   /* 设置页面高度 */
   setListHeight() {
-    this.selectComponent("#ListBox").setHeight(".head", this);
+    this.selectComponent("#ListBox").setHeight(".top", this);
   }
 })

+ 10 - 2
packageA/orderForm/rows.wxml

@@ -1,10 +1,18 @@
 <van-search use-action-slot placeholder='请输入搜索关键词' shape='round' bind:search="onSearch" bind:clear="onSearch" />
-<view class="head">
+<!-- <view class="head">
     <picker mode="date" value="{{content.where.begindate}}" data-name="begindate" bindchange='changeDate'>{{content.where.begindate||'开始日期'}}</picker>
     <text>-</text>
     <picker mode="date" value="{{content.where.enddate}}" data-name="enddate" bindchange='changeDate'>{{content.where.enddate||'结束日期'}}</picker>
     <text wx:if="{{content.where.begindate||content.where.enddate}}" style="color:var( --assist);" bindtap="initialize">重置</text>
-</view>
+</view> -->
+<van-tabs active="{{ active }}" color='var(--assist)' title-active-color='var(--assist)' bind:change="tabsChange">
+    <van-tab title="全部" name='' />
+    <van-tab title="全部未发" name='' />
+    <van-tab title="一周未发" name='周' />
+    <van-tab title="一月未发" name='月' />
+    <van-tab title="一年未发" name='年' />
+</van-tabs>
+<view class="top" style="height: 5px;" />
 <Yl_ListBox id='ListBox' bind:getlist='getList'>
     <Yl_Empty wx:if="{{list.length==0}}" />
     <view class="item" wx:for="{{list}}" wx:key="sa_orderitemsid">