Handy_Cao hace 3 años
padre
commit
d4891bf2f8

+ 16 - 3
src/packages/mobile/views/mine/generalize/components/promotion/index.vue

@@ -1,5 +1,8 @@
 <template>
-    <app-pull-refresh v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
+    <app-pull-refresh ref="pullRefreshRef" v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
+        <DropdownMenu>
+            <DropdownItem v-model="type" :options="options" @change="onChange"></DropdownItem>
+        </DropdownMenu>
         <app-list :columns="columns" :data-list="dataList" v-if="dataList.length" @click="onClick">
             <!-- 日期 -->
             <template #profitmonth="{ value }">
@@ -16,7 +19,7 @@ import { formatDate } from '@/filters'
 import { useQueryTHJPromotionIncome } from '@/business/order'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import AppList from '@mobile/components/base/list/index.vue'
-import { Empty } from 'vant'
+import { Empty, DropdownItem, DropdownMenu } from 'vant'
 import { useNavigation } from '@/hooks/navigation'
 
 const { router } = useNavigation()
@@ -24,6 +27,11 @@ const { pageIndex, pageCount, getTHJPromotionIncome } = useQueryTHJPromotionInco
 const dataList = shallowRef<Model.THJPromotionIncomeRsp[]>([])
 const error = shallowRef(false)
 
+const options = [ { text: '全部', value: 0 }, { text: '已支付', value: 1 }, { text: '未支付', value: 2 }]
+const type = shallowRef(0)
+/// 下拉刷新
+const pullRefreshRef = shallowRef()
+
 const columns: Model.TableColumn[] = [
     { prop: 'profitmonth', label: '时间' },
     { prop: 'sumamount', label: '金额' },
@@ -35,7 +43,7 @@ const onClick = (item: Model.THJPromotionIncomeRsp) => {
 
 const onRefresh = (finish: () => void) => {
     /// 查询数据
-    getTHJPromotionIncome(0).then((res) => {
+    getTHJPromotionIncome(type.value).then((res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
@@ -46,6 +54,11 @@ const onRefresh = (finish: () => void) => {
         finish()
     })
 }
+
+const onChange = () => {
+    /// 查询
+    pullRefreshRef.value?.refresh()
+}
 </script>
 
 <style lang="less">

+ 16 - 3
src/packages/mobile/views/mine/generalize/components/tradedata/index.vue

@@ -1,5 +1,8 @@
 <template>
-    <app-pull-refresh v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
+    <app-pull-refresh ref="pullRefreshRef" v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
+        <DropdownMenu>
+            <DropdownItem v-model="type" :options="options" @change="onChange"></DropdownItem>
+        </DropdownMenu>
         <app-list :columns="columns" :data-list="dataList" v-if="dataList.length">
             <!-- 日期 -->
             <template #reckondate="{ value }">
@@ -23,7 +26,7 @@ import { shallowRef } from 'vue'
 import { formatDate } from '@/filters'
 import { useQueryTHJTradeDataList } from '@/business/goods'
 import { Market } from '@/constants/market'
-import { Empty } from 'vant'
+import { Empty, DropdownItem, DropdownMenu } from 'vant'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import AppList from '@mobile/components/base/list/index.vue'
 
@@ -40,9 +43,14 @@ const columns: Model.TableColumn[] = [
     { prop: 'selltradelot', label: '笔数' },
 ]
 
+const options = [ { text: '采购', value: 0 }, { text: '供求', value: 1 }]
+const type = shallowRef(0)
+/// 下拉刷新
+const pullRefreshRef = shallowRef()
+
 const onRefresh = (finish: () => void) => {
     /// 查询数据
-    getQueryTHJTradeDataList(Market.THJ).then((res) => {
+    getQueryTHJTradeDataList(type.value === 0 ? Market.THJ : Market.THJ_Listing).then((res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
@@ -53,6 +61,11 @@ const onRefresh = (finish: () => void) => {
         finish()
     })
 }
+
+const onChange = () => {
+    /// 查询
+    pullRefreshRef.value?.refresh()
+}
 </script>
 
 <style lang="less">