li.shaoyi 2 lat temu
rodzic
commit
1f8b9d0332
44 zmienionych plików z 592 dodań i 1057 usunięć
  1. 1 64
      src/business/bank/index.ts
  2. 1 33
      src/business/contract/index.ts
  3. 0 33
      src/business/credit/index.ts
  4. 1 130
      src/business/goods/index.ts
  5. 0 79
      src/business/news/index.ts
  6. 2 285
      src/business/order/index.ts
  7. 6 0
      src/hooks/navigation/index.ts
  8. 36 35
      src/hooks/request/index.ts
  9. 24 14
      src/packages/mobile/components/base/pull-refresh/index.vue
  10. 16 12
      src/packages/mobile/views/bank/hisstatement/index.vue
  11. 16 12
      src/packages/mobile/views/bank/statement/index.vue
  12. 21 14
      src/packages/mobile/views/contract/list/index.vue
  13. 15 12
      src/packages/mobile/views/credit/statement/index.vue
  14. 9 8
      src/packages/mobile/views/home/components/main/index.vue
  15. 24 19
      src/packages/mobile/views/mine/generalize/components/promotion/index.vue
  16. 17 16
      src/packages/mobile/views/mine/generalize/components/tradedata/index.vue
  17. 16 13
      src/packages/mobile/views/mine/generalize/detail/index.vue
  18. 19 16
      src/packages/mobile/views/mine/order/his/purchasetrade/index.vue
  19. 16 13
      src/packages/mobile/views/mine/order/his/transfer/index.vue
  20. 24 17
      src/packages/mobile/views/mine/order/his/wrorder/index.vue
  21. 25 16
      src/packages/mobile/views/mine/order/his/wrtrade/index.vue
  22. 19 16
      src/packages/mobile/views/mine/order/list/components/purchasetrade/index.vue
  23. 19 16
      src/packages/mobile/views/mine/order/list/components/transferbuy/index.vue
  24. 19 16
      src/packages/mobile/views/mine/order/list/components/transfersell/index.vue
  25. 19 16
      src/packages/mobile/views/mine/order/list/components/wrorder/index.vue
  26. 19 16
      src/packages/mobile/views/mine/order/list/components/wrtrade/index.vue
  27. 20 18
      src/packages/mobile/views/mine/wareorder/list/components/holdlb/index.vue
  28. 18 16
      src/packages/mobile/views/mine/wareorder/list/components/wroutinapply/index.vue
  29. 10 8
      src/packages/mobile/views/news/details/index.vue
  30. 37 16
      src/packages/mobile/views/news/list/index.vue
  31. 22 19
      src/packages/mobile/views/product/list/index.vue
  32. 24 17
      src/packages/mobile/views/purchase/list/index.vue
  33. 7 6
      src/packages/mobile/views/supply-demand/detail/index.vue
  34. 25 17
      src/packages/mobile/views/supply-demand/list/index.vue
  35. 1 1
      src/packages/mobile/views/user/avatar/index.vue
  36. 5 0
      src/services/api/bank/index.ts
  37. 4 0
      src/services/api/credit/index.ts
  38. 5 0
      src/services/api/goods/index.ts
  39. 11 0
      src/services/api/order/index.ts
  40. 6 5
      src/stores/modules/menu.ts
  41. 2 2
      src/types/model/bank.d.ts
  42. 1 1
      src/types/model/credit.d.ts
  43. 2 2
      src/types/model/goods.d.ts
  44. 8 8
      src/types/model/order.d.ts

+ 1 - 64
src/business/bank/index.ts

@@ -1,76 +1,13 @@
 import { reactive, shallowRef, computed } from 'vue'
 import { useDataTable } from '@/hooks/datatable'
 import { loginStore, userStore } from '@/stores'
-import { queryHisAmountLog, queryAmountLog, t2bBankWithdraw, queryBankAccountSign, t2bBankDeposit, queryAccountInOutApply, queryCusBankSignBank, t2bBankSign, t2bBankCancelSign, accountFundInfoReq } from '@/services/api/bank'
+import { t2bBankWithdraw, queryBankAccountSign, t2bBankDeposit, queryAccountInOutApply, queryCusBankSignBank, t2bBankSign, t2bBankCancelSign, accountFundInfoReq } from '@/services/api/bank'
 import { SignStatus } from '@/constants/bank'
 import { decryptAES } from '@/utils/websocket/crypto'
 import moment from "moment"
 
 const { userId, firstAccountId } = loginStore.$mapGetters()
 
-// 历史资金流水列表
-export function useAmountStatementList() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.AmountLogRsp>()
-    const loading = shallowRef(false)
-
-    const getAmountStatementList = async () => {
-        loading.value = true
-        await queryAmountLog({
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-            pageflag: 1,
-            accountID: firstAccountId.value.toString(),
-        }).then((res) => {
-            total.value = res.total
-            dataList.value = res.data
-        }).finally(() => {
-            loading.value = false
-        })
-        return dataList.value
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getAmountStatementList,
-    }
-}
-
-// 历史出入金流水列表
-export function useHisAmountStatementList() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.HisAmountLogRsp>()
-    const loading = shallowRef(false)
-
-    const getHisAmountStatementList = async () => {
-        loading.value = true
-        await queryHisAmountLog({
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-            pageflag: 1,
-            accountID: firstAccountId.value.toString(),
-        }).then((res) => {
-            total.value = res.total
-            dataList.value = res.data
-        }).finally(() => {
-            loading.value = false
-        })
-        return dataList.value
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getHisAmountStatementList,
-    }
-}
 
 // 获取出入金流水列表
 export function useAccouuntInOutApplyListList() {

+ 1 - 33
src/business/contract/index.ts

@@ -1,38 +1,6 @@
 import { shallowRef, reactive } from 'vue'
-import { useDataTable } from '@/hooks/datatable'
 import { EchartsDataset } from '@/hooks/echarts/line/interface'
-import { queryTHJPurchaseTransfer, queryTHJPurchaseTransferDetail } from '@/services/api/contract'
-
-// 合同转让列表
-export function useContractList() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.THJPurchaseTransferRsp>()
-    const loading = shallowRef(false)
-
-    const getWrstandardList = async (params: Partial<Model.THJPurchaseTransferReq> = {}) => {
-        loading.value = true
-        await queryTHJPurchaseTransfer({
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-            wrstandardname: params.wrstandardname,
-        }).then((res) => {
-            total.value = res.total
-            dataList.value = res.data
-        }).finally(() => {
-            loading.value = false
-        })
-        return dataList.value
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getWrstandardList,
-    }
-}
+import { queryTHJPurchaseTransferDetail } from '@/services/api/contract'
 
 // 合同转让详情
 export function useContractDetails(wrstandardid: number) {

+ 0 - 33
src/business/credit/index.ts

@@ -1,5 +1,4 @@
 import { shallowRef } from 'vue'
-import { useDataTable } from '@/hooks/datatable'
 import { v4 } from 'uuid'
 import { ClientType } from '@/constants/client'
 import { ScoreConfigType } from '@/constants/credit'
@@ -9,38 +8,6 @@ import { queryUserScoreLog, queryTHJScoreConfig, thjRedPacketLottery } from '@/s
 
 const { userId } = loginStore.$mapGetters()
 
-// 积分流水列表
-export function useCreditStatementList(stype?: ScoreConfigType) {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.UserScoreLogRsp>()
-    const loading = shallowRef(false)
-
-    const getCreditStatementList = async () => {
-        loading.value = true
-        await queryUserScoreLog({
-            stype,
-            userid: userId.value,
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-        }).then((res) => {
-            total.value = res.total
-            dataList.value = res.data
-        }).finally(() => {
-            loading.value = false
-        })
-        return dataList.value
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getCreditStatementList,
-    }
-}
-
 // 积分抽奖
 export function useCreditLottery() {
     const loading = shallowRef(false)

+ 1 - 130
src/business/goods/index.ts

@@ -3,44 +3,13 @@ import { useDataTable } from '@/hooks/datatable'
 import { EchartsDataset } from '@/hooks/echarts/line/interface'
 import { BuyOrSell } from '@/constants/order'
 import { queryTHJinvesotrdeposit } from '@/services/api/common'
-import { queryTHJWrstandard, queryOrderQuote, queryOrderQuoteDetail, queryWrMarketTradeConfig, queryTHJWrstandardDetail, addUserFavoriteGoods, removeUserFavoriteGoods, queryTHJProduct, queryMarketRun, queryTHJTradeData } from '@/services/api/goods'
+import { queryOrderQuoteDetail, queryWrMarketTradeConfig, queryTHJWrstandardDetail, addUserFavoriteGoods, removeUserFavoriteGoods, queryMarketRun } from '@/services/api/goods'
 import { loginStore } from '@/stores'
 
 const { userId } = loginStore.$mapGetters()
 
 export type OptionalType<T, K extends keyof T> = Omit<T, K> & { [key in K]: Partial<T[K]> } // 指定某个属性为可选
 
-// 采购列表
-export function useWrstandardList() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.THJWrstandardRsp>()
-    const loading = shallowRef(false)
-
-    const getWrstandardList = async (params: Partial<Model.THJWrstandardReq> = {}) => {
-        loading.value = true
-        await queryTHJWrstandard({
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-            wrstandardname: params.wrstandardname
-        }).then((res) => {
-            total.value = res.total
-            dataList.value = res.data
-        }).finally(() => {
-            loading.value = false
-        })
-        return dataList.value
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getWrstandardList,
-    }
-}
-
 // 采购详细
 export function useWrstandardDetails(wrstandardid: number) {
     const loading = shallowRef(false)
@@ -116,72 +85,6 @@ export function useUserFavoriteGoods(goodsid: number) {
     }
 }
 
-// 获取我的推广-交易数据
-export function useQueryTHJTradeDataList() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.THJTradeDataRsp>()
-    const loading = shallowRef(false)
-
-    const getQueryTHJTradeDataList = async (marketid: number) => {
-        loading.value = true
-        await queryTHJTradeData({
-            userid: userId.value,
-            marketid: marketid,
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-        }).then((res) => {
-            total.value = res.total
-            dataList.value = res.data
-        }).finally(() => {
-            loading.value = false
-        })
-        return dataList.value
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getQueryTHJTradeDataList,
-    }
-}
-
-// 获取产品介绍列表
-export function useQueryTHJProductLists() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.THJProductRsp>()
-    const loading = shallowRef(false)
-    const active = shallowRef(0)
-
-    const getQueryTHJProductLists = async () => {
-        loading.value = true
-        await queryTHJProduct({
-            userid: userId.value,
-            favoriteflag: false,
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-        }).then((res) => {
-            total.value = res.total
-            dataList.value = res.data
-        }).finally(() => {
-            loading.value = false
-        })
-        return dataList.value
-    }
-
-    return {
-        loading,
-        dataList,
-        active,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getQueryTHJProductLists,
-    }
-}
-
 // 查询市场运行信息
 export function useQueryMarketRunLists() {
     const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.MarketRunRsp>()
@@ -240,38 +143,6 @@ export function useQueryWrMarketTradeConfig() {
     }
 }
 
-// 供求列表
-export function useOrderQuoteList() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.OrderQuoteRsp>()
-    const loading = shallowRef(false)
-
-    const getOrderQuoteList = async (params: Partial<Model.OrderQuoteReq> = {}) => {
-        loading.value = true
-        await queryOrderQuote({
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-            wrpricetype: 1,
-            ...params,
-        }).then((res) => {
-            total.value = res.total
-            dataList.value = res.data
-        }).finally(() => {
-            loading.value = false
-        })
-        return dataList.value
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getOrderQuoteList,
-    }
-}
-
 // 供求详情
 export function useOrderQuoteDetail(wrfactortypeid?: string) {
     const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.OrderQuoteDetailRsp>()

+ 0 - 79
src/business/news/index.ts

@@ -1,79 +0,0 @@
-import { shallowRef } from 'vue'
-import { useDataTable } from '@/hooks/datatable'
-import { querySiteColumnDetail, querySiteColumnConfig } from '@/services/api/news'
-
-// 新闻资讯列表
-export function useSiteColumnDetail() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.SiteColumnDetailRsp>()
-    const loading = shallowRef(false)
-    const siteColumns = shallowRef<Model.SiteColumnConfigRsp[]>([])
-    const currentColumnId = shallowRef(0)
-
-    /// 查询栏目配置
-    const getSiteColumnConfig = querySiteColumnConfig().then((res) => {
-        siteColumns.value = res.data
-        /// 默认第一个
-        if (res.data.length) {
-            currentColumnId.value = res.data[0].id
-        }
-    })
-
-    const getSiteColumnDetail = async () => {
-        loading.value = true
-        await getSiteColumnConfig
-        await querySiteColumnDetail({
-            columnid: currentColumnId.value,
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-        }).then((res) => {
-            total.value = res.total
-            dataList.value = res.data
-        }).finally(() => {
-            loading.value = false
-        })
-        return dataList.value
-    }
-
-    return {
-        loading,
-        dataList,
-        siteColumns,
-        currentColumnId,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getSiteColumnDetail,
-    }
-}
-
-// 查询资讯栏目配置
-export function useSiteColumnConfig() {
-
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.SiteColumnConfigRsp>()
-    const loading = shallowRef(false)
-
-    const getSiteColumnConfig = (columntype?: number) => {
-        loading.value = true
-        return querySiteColumnConfig({
-            columntype: columntype,
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-        }).then((res) => {
-            total.value = res.total
-            dataList.value = res.data
-        }).finally(() => {
-            loading.value = false
-        })
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getSiteColumnConfig,
-    }
-}

+ 2 - 285
src/business/order/index.ts

@@ -1,288 +1,5 @@
-import { reactive, shallowRef } from 'vue'
-import { useDataTable } from '@/hooks/datatable'
-import {
-    queryWrOrderDetail,
-    queryWrTradeDetail,
-    queryTHJPurchaseTradeDetail,
-    queryHoldLB, queryWrOutInApply,
-    queryTHJPromotionIncome,
-    queryTHJPromotionIncomeDetail,
-    queryTHJPurchaseTransferOrder,
-    queryTHJPurchaseTransferOrderDetail
-} from '@/services/api/order'
-import { loginStore } from '@/stores'
-
-const { userId, firstAccountId } = loginStore.$mapGetters()
-
-// 查询仓单持有记录
-export function useQueryHoldLB() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.HoldLBRsp>()
-    const loading = shallowRef(false)
-
-    const getHoldLB = async (warehouseid?: number, deliverygoodsid?: number, wrstandardid?: number, wrfactortypeid?: string, dgitemname?: string) => {
-        loading.value = true
-        await queryHoldLB({
-            accountid: firstAccountId.value,
-            warehouseid,
-            deliverygoodsid,
-            wrstandardid,
-            wrfactortypeid,
-            dgitemname,
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-        }).then((res) => {
-            total.value = res.total
-            dataList.value = res.data
-        }).finally(() => {
-            loading.value = false
-        })
-        return dataList.value
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getHoldLB,
-    }
-}
-
-// 查询提货申请
-export function useQueryWrOutInApply() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.WrOutInApplyRsp>()
-    const loading = shallowRef(false)
-
-    const getWrOutInApply = async (begindate?: string, enddate?: string) => {
-        loading.value = true
-        await queryWrOutInApply({
-            userid: userId.value,
-            begindate: begindate,
-            enddate: enddate,
-            page: 1,
-            pagesize: pageSize.value,
-        }).then((res) => {
-            total.value = res.total
-            dataList.value = res.data
-        }).finally(() => {
-            loading.value = false
-        })
-        return dataList.value
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getWrOutInApply,
-    }
-}
-
-// 查询仓单委托单
-export function useQueryWrOrderDetail() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.WrOrderDetailRsp>()
-    const loading = shallowRef(false)
-
-    const formData = reactive<Partial<Model.WrOrderDetailReq>>({
-        userid: userId.value,
-        haswr: 1,
-        page: pageIndex.value,
-        pagesize: pageSize.value,
-    })
-
-    const getWrOrderDetail = async () => {
-        loading.value = true
-        await queryWrOrderDetail(formData).then((res) => {
-            total.value = res.total
-            dataList.value = res.data
-        }).finally(() => {
-            loading.value = false
-        })
-        return dataList.value
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getWrOrderDetail,
-        formData
-    }
-}
-
-// 查询仓单成交明细
-export function useQueryWrTradeDetail() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.WrTradeDetailRsp>()
-    const loading = shallowRef(false)
-
-    const formData = reactive<Partial<Model.WrTradeDetailReq>>({
-        userid: userId.value,
-        haswr: 1,
-        page: pageIndex.value,
-        pagesize: pageSize.value,
-    })
-
-    const getWrTradeDetail = async () => {
-        loading.value = true
-        await queryWrTradeDetail(formData).then((res) => {
-            total.value = res.total
-            dataList.value = res.data
-        }).finally(() => {
-            loading.value = false
-        })
-        return dataList.value
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getWrTradeDetail,
-        formData
-    }
-}
-
-// 查询我的订单-采购订单
-export function useTHJPurchaseTradeDetail() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.THJPurchaseTradeDetailRsp>()
-    const loading = shallowRef(false)
-
-    const getTHJPurchaseTradeDetail = async (type?: number) => {
-        loading.value = true
-        await queryTHJPurchaseTradeDetail({
-            userid: userId.value,
-            type: type,
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-        }).then((res) => {
-            total.value = res.total
-            dataList.value = res.data
-        }).finally(() => {
-            loading.value = false
-        })
-        return dataList.value
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getTHJPurchaseTradeDetail,
-    }
-}
-
-// 查询我的推广-推广收益
-export function useQueryTHJPromotionIncome() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.THJPromotionIncomeRsp>()
-    const loading = shallowRef(false)
-
-    const getTHJPromotionIncome = async (status?: number) => {
-        loading.value = true
-        await queryTHJPromotionIncome({
-            userid: userId.value,
-            profitstatus: status,
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-        }).then((res) => {
-            total.value = res.total
-            dataList.value = res.data.map((e) => ({
-                ...e,
-                profitstatus: status ?? e.profitstatus
-            }))
-        }).finally(() => {
-            loading.value = false
-        })
-        return dataList.value
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getTHJPromotionIncome,
-    }
-}
-
-// 查询我的推广-推广收益-明细
-export function useQueryTHJPromotionIncomeDetail(month: string) {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.THJPromotionIncomeDetailRsp>()
-    const loading = shallowRef(false)
-
-    const getTHJPromotionIncomeDetail = async () => {
-        loading.value = true
-        await queryTHJPromotionIncomeDetail({
-            userid: userId.value,
-            mouth: month,
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-        }).then((res) => {
-            total.value = res.total
-            dataList.value = res.data
-        }).finally(() => {
-            loading.value = false
-        })
-        return dataList.value
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getTHJPromotionIncomeDetail,
-    }
-}
-
-// 查询我的订单-转让/受让订单
-export function useQueryTHJPurchaseTransferOrder() {
-    const { dataList, total, pageIndex, pageSize, pageCount } = useDataTable<Model.THJPurchaseTransferOrderRsp>()
-    const loading = shallowRef(false)
-
-    const getTHJPurchaseTransferOrder = async (ordertype: number) => {
-        loading.value = true
-        await queryTHJPurchaseTransferOrder({
-            userid: userId.value,
-            page: pageIndex.value,
-            pagesize: pageSize.value,
-            ordertype: ordertype
-        }).then((res) => {
-            total.value = res.total
-            dataList.value = res.data
-        }).finally(() => {
-            loading.value = false
-        })
-        return dataList.value
-    }
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        pageCount,
-        getTHJPurchaseTransferOrder,
-    }
-}
+import { shallowRef } from 'vue'
+import { queryTHJPurchaseTransferOrderDetail } from '@/services/api/order'
 
 // 查询我的订单-转让/受让订单详情
 export function useQueryTTHJPurchaseTransferOrderDetail(transferid: string) {

+ 6 - 0
src/hooks/navigation/index.ts

@@ -28,6 +28,11 @@ export function useNavigation() {
         }
     }
 
+    // 获取参数字符串
+    const getParamString = (name: string) => {
+        return route.params[name] ?? ''
+    }
+
     // 获取查询字符串
     const getQueryString = (name: string) => {
         const qs = route.query[name]
@@ -107,6 +112,7 @@ export function useNavigation() {
         hasHistory,
         setGlobalUrlParams,
         getGlobalUrlParams,
+        getParamString,
         getQueryString,
         getQueryStringToNumber,
         backHomePage,

+ 36 - 35
src/hooks/request/index.ts

@@ -9,72 +9,69 @@ interface RequestOptions<TParams, TResponse> {
     } & TParams;
     localPagination?: boolean;
     delay?: number;
+    manual?: boolean; // 是否手动触发
+    onBefore?: () => unknown;
     onSuccess?: (res: TResponse) => void;
     onError?: (err: string) => void;
     onFinally?: () => void;
 }
 
+// 判断对象是否通用响应对象
+const isCommonResult = (obj: unknown): obj is CommonResult => {
+    if (obj instanceof Object) {
+        return 'code' in obj && 'data' in obj
+    }
+    return false
+}
+
 export function useRequest<TParams extends object, TResponse>(request: (params: TParams) => Promise<TResponse>, options?: RequestOptions<TParams, TResponse>) {
-    const { params, localPagination, onSuccess, onError, onFinally } = options ?? {}
+    const { params, localPagination, manual, onBefore, onSuccess, onError, onFinally } = options ?? {}
 
     type Result = TResponse extends CommonResult ? TResponse['data'] : TResponse // 获取返回值的类型
     type ResultType = Result extends (infer U)[] ? U : Result // 如果 U 是数组,取 U 的类型
 
     const { dataList, filters, total, pageIndex, pageSize, pageCount } = useDataTable<ResultType>({
         localPagination,
-        pageSize: params?.page,
-        pageIndex: params?.pagesize,
+        pageIndex: params?.page,
+        pageSize: params?.pagesize,
     })
     const data = ref<ResultType>()
     const loading = ref(false)
 
-    // 判断对象是否通用响应对象
-    const isCommonResult = (obj: unknown): obj is CommonResult => {
-        if (obj instanceof Object) {
-            return 'code' in obj && 'data' in obj
-        }
-        return false
-    }
-
     // 异步函数
     const runAsync = async (payload: Partial<TParams> = {}) => {
-        try {
-            loading.value = true
-            if (params && params.page && params.pagesize) {
-                params.page = pageIndex.value
-                params.pagesize = pageIndex.value
+        if (params && params.pagesize) {
+            params.page = pageIndex.value
+            params.pagesize = pageSize.value
+        }
+        onBefore && await onBefore()
+        const res = await request({ ...params, ...payload } as TParams)
+        if (isCommonResult(res)) {
+            total.value = res.total
+            if (Array.isArray(res.data)) {
+                dataList.value = res.data
+            } else {
+                data.value = res.data as ResultType
             }
-
-            const res = await request({ ...params, ...payload } as TParams)
-
-            if (isCommonResult(res)) {
-                total.value = res.total
-                if (Array.isArray(res.data)) {
-                    dataList.value = res.data
-                } else {
-                    data.value = res.data as ResultType
-                }
+        } else {
+            if (Array.isArray(res)) {
+                dataList.value = res
             } else {
-                if (Array.isArray(res)) {
-                    dataList.value = res
-                } else {
-                    data.value = res as ResultType
-                }
+                data.value = res as ResultType
             }
-
-            return res
-        } finally {
-            loading.value = false
         }
+        return res
     }
 
     // 同步函数
     const run = (payload: Partial<TParams> = {}) => {
+        loading.value = true
         runAsync(payload).then((res) => {
             onSuccess && onSuccess(res)
         }).catch((err) => {
             onError && onError(err)
         }).finally(() => {
+            loading.value = false
             onFinally && onFinally()
         })
     }
@@ -83,6 +80,10 @@ export function useRequest<TParams extends object, TResponse>(request: (params:
         console.warn('取消请求')
     }
 
+    if (!manual) {
+        run() // 自动执行
+    }
+
     onUnmounted(() => {
         cancel()
     })

+ 24 - 14
src/packages/mobile/components/base/pull-refresh/index.vue

@@ -1,7 +1,7 @@
 <template>
     <PullRefresh class="app-pull-refresh" v-model="refreshing" @refresh="onRefresh">
         <slot name="header"></slot>
-        <List ref="listRef" v-model:loading="loading" v-model:error="showError" :finished="finished" @load="onLoad">
+        <List ref="listRef" v-model:loading="showLoading" v-model:error="showError" :finished="finished" @load="onLoad">
             <slot></slot>
             <template #finished>
                 <span>{{ finishedText }}</span>
@@ -15,10 +15,14 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, computed, nextTick } from 'vue'
+import { shallowRef, computed, nextTick, watch } from 'vue'
 import { List, PullRefresh, ListInstance } from 'vant'
 
 const props = defineProps({
+    loading: {
+        type: Boolean,
+        default: false,
+    },
     pageIndex: {
         type: Number,
         default: 1,
@@ -41,11 +45,15 @@ const props = defineProps({
     }
 })
 
-const emit = defineEmits(['update:pageIndex', 'update:error', 'refresh'])
+const emit = defineEmits(['update:loading', 'update:pageIndex', 'update:error', 'refresh'])
 const listRef = shallowRef<ListInstance>()
 const refreshing = shallowRef(false) // 是否处于下拉加载状态
 const finished = shallowRef(false) // 是否已加载完成所有数据
-const loading = shallowRef(false)
+
+const showLoading = computed({
+    get: () => props.loading,
+    set: (val) => emit('update:loading', val)
+})
 
 const showError = computed({
     get: () => props.error,
@@ -64,15 +72,7 @@ const onLoad = () => {
     }
     nextTick(() => {
         if (currentPage.value <= props.pageCount) {
-            emit('refresh', () => {
-                if (refreshing.value) {
-                    refreshing.value = false
-                }
-                if (!showError.value) {
-                    currentPage.value++
-                }
-                loading.value = false
-            })
+            emit('refresh')
         } else {
             refreshing.value = false
             finished.value = true
@@ -83,10 +83,20 @@ const onLoad = () => {
 // 下拉刷新
 const onRefresh = () => {
     finished.value = false
-    loading.value = true
     onLoad()
 }
 
+watch(showLoading, (status) => {
+    if (!status) {
+        if (refreshing.value) {
+            refreshing.value = false
+        }
+        if (!showError.value) {
+            currentPage.value++
+        }
+    }
+})
+
 // 暴露组件属性给父组件调用
 defineExpose({
     refresh: () => {

+ 16 - 12
src/packages/mobile/views/bank/hisstatement/index.vue

@@ -3,8 +3,8 @@
         <template #header>
             <app-navbar title="历史资金流水" />
         </template>
-        <app-pull-refresh v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount"
-            @refresh="onRefresh">
+        <app-pull-refresh v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
+            :page-count="pageCount" @refresh="run">
             <app-list class="bank-hisstatement__table" :columns="columns" :data-list="dataList">
                 <template #createtime="{ value }">
                     <span>{{ formatDate(value, 'YYYY-MM-DD') }}</span>
@@ -21,12 +21,12 @@
 <script lang="ts" setup>
 import { shallowRef } from 'vue'
 import { formatDate } from '@/filters'
+import { useRequest } from '@/hooks/request'
 import { getAccountBusinessCodeName } from '@/constants/bank'
-import { useHisAmountStatementList } from '@/business/bank'
+import { queryHisAmountLog } from '@/services/api/bank'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import AppList from '@mobile/components/base/list/index.vue'
 
-const { pageIndex, pageCount, getHisAmountStatementList } = useHisAmountStatementList()
 const dataList = shallowRef<Model.HisAmountLogRsp[]>([])
 const error = shallowRef(false)
 
@@ -36,18 +36,22 @@ const columns: Model.TableColumn[] = [
     { prop: 'amount', label: '金额' },
 ]
 
-const onRefresh = (finish: () => void) => {
-    getHisAmountStatementList().then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryHisAmountLog, {
+    manual: true,
+    params: {
+        pagesize: 20,
+        pageflag: 1,
+    },
+    onSuccess: (res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
-        dataList.value.push(...res)
-    }).catch(() => {
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
         error.value = true
-    }).finally(() => {
-        finish()
-    })
-}
+    }
+})
 </script>
 
 <style lang="less">

+ 16 - 12
src/packages/mobile/views/bank/statement/index.vue

@@ -9,8 +9,8 @@
                 </template>
             </app-navbar>
         </template>
-        <app-pull-refresh v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount"
-            @refresh="onRefresh">
+        <app-pull-refresh v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
+            :page-count="pageCount" @refresh="run">
             <app-list class="bank-statement__table" :columns="columns" :data-list="dataList">
                 <template #createtime="{ value }">
                     <span>{{ formatDate(value, 'YYYY-MM-DD') }}</span>
@@ -27,14 +27,14 @@
 <script lang="ts" setup>
 import { shallowRef } from 'vue'
 import { formatDate } from '@/filters'
+import { useRequest } from '@/hooks/request'
 import { useNavigation } from '@/hooks/navigation'
 import { getAccountBusinessCodeName } from '@/constants/bank'
-import { useAmountStatementList } from '@/business/bank'
+import { queryAmountLog } from '@/services/api/bank'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import AppList from '@mobile/components/base/list/index.vue'
 
 const { routerTo } = useNavigation()
-const { pageIndex, pageCount, getAmountStatementList } = useAmountStatementList()
 const dataList = shallowRef<Model.AmountLogRsp[]>([])
 const error = shallowRef(false)
 
@@ -44,18 +44,22 @@ const columns: Model.TableColumn[] = [
     { prop: 'amount', label: '金额' },
 ]
 
-const onRefresh = (finish: () => void) => {
-    getAmountStatementList().then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryAmountLog, {
+    manual: true,
+    params: {
+        pagesize: 20,
+        pageflag: 1,
+    },
+    onSuccess: (res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
-        dataList.value.push(...res)
-    }).catch(() => {
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
         error.value = true
-    }).finally(() => {
-        finish()
-    })
-}
+    }
+})
 </script>
 
 <style lang="less">

+ 21 - 14
src/packages/mobile/views/contract/list/index.vue

@@ -7,7 +7,7 @@
                 </template>
             </app-navbar>
         </template>
-        <app-pull-refresh ref="pullRefreshRef" class="contract__container" v-model:error="error"
+        <app-pull-refresh ref="pullRefreshRef" class="contract__container" v-model:loading="loading" v-model:error="error"
             v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
             <ul class="list">
                 <li class="list-item g-block--bg" v-for="(item, index) in dataList" :key="index">
@@ -29,32 +29,39 @@
 import { shallowRef, onActivated } from 'vue'
 import { Search, Button } from 'vant'
 import { getImageUrl } from '@/filters'
-import { useContractList } from '@/business/contract'
+import { useRequest } from '@/hooks/request'
+import { queryTHJPurchaseTransfer } from '@/services/api/contract'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
-const { pageIndex, pageCount, getWrstandardList } = useContractList()
 const dataList = shallowRef<Model.THJPurchaseTransferRsp[]>([])
 const error = shallowRef(false)
 const pullRefreshRef = shallowRef()
 const keyword = shallowRef('')
 
+const { loading, pageIndex, pageCount, run } = useRequest(queryTHJPurchaseTransfer, {
+    manual: true,
+    params: {
+        pagesize: 20,
+    },
+    onSuccess: (res) => {
+        if (pageIndex.value === 1) {
+            dataList.value = []
+        }
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
+        error.value = true
+    }
+})
+
 // 获取产品首图
 const getFirstImage = (url: string) => {
     const images = url.split(',').map((path) => getImageUrl(path))
     return images[0] ?? ''
 }
 
-const onRefresh = (finish: () => void) => {
-    getWrstandardList({ wrstandardname: keyword.value }).then((res) => {
-        if (pageIndex.value === 1) {
-            dataList.value = []
-        }
-        dataList.value.push(...res)
-    }).catch(() => {
-        error.value = true
-    }).finally(() => {
-        finish()
-    })
+const onRefresh = () => {
+    run({ wrstandardname: keyword.value })
 }
 
 onActivated(() => {

+ 15 - 12
src/packages/mobile/views/credit/statement/index.vue

@@ -4,8 +4,8 @@
             <app-navbar title="积分流水">
             </app-navbar>
         </template>
-        <app-pull-refresh v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount"
-            @refresh="onRefresh">
+        <app-pull-refresh v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
+            :page-count="pageCount" @refresh="run">
             <app-list class="credit-statement__table" :columns="columns" :data-list="dataList">
                 <template #createtime="{ value }">
                     <span>{{ formatDate(value, 'YYYY-MM-DD') }}</span>
@@ -22,12 +22,12 @@
 <script lang="ts" setup>
 import { shallowRef } from 'vue'
 import { formatDate } from '@/filters'
+import { useRequest } from '@/hooks/request'
+import { queryUserScoreLog } from '@/services/api/credit'
 import { getScoreConfigTypeName } from '@/constants/credit'
-import { useCreditStatementList } from '@/business/credit'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import AppList from '@mobile/components/base/list/index.vue'
 
-const { pageIndex, pageCount, getCreditStatementList } = useCreditStatementList()
 const dataList = shallowRef<Model.UserScoreLogRsp[]>([])
 const error = shallowRef(false)
 
@@ -37,18 +37,21 @@ const columns: Model.TableColumn[] = [
     { prop: 'score', label: '积分' },
 ]
 
-const onRefresh = (finish: () => void) => {
-    getCreditStatementList().then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryUserScoreLog, {
+    manual: true,
+    params: {
+        pagesize: 20,
+    },
+    onSuccess: (res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
-        dataList.value.push(...res)
-    }).catch(() => {
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
         error.value = true
-    }).finally(() => {
-        finish()
-    })
-}
+    }
+})
 </script>
 
 <style lang="less">

+ 9 - 8
src/packages/mobile/views/home/components/main/index.vue

@@ -163,9 +163,9 @@ const onSpotChange = (index: number) => {
 
 // 下拉刷新
 const onRefresh = () => {
-  // 市场信息
-  queryMarketRun().then((res) => {
-    marketRun.value = res.data[0]
+  // 现货行情
+  queryThjSpotQuoteConfig().then((res) => {
+    spotQuoteList.value = res.data
   })
   // 市场资讯
   querySiteColumnDetail({
@@ -178,6 +178,11 @@ const onRefresh = () => {
   })
 }
 
+// 市场信息
+queryMarketRun().then((res) => {
+  marketRun.value = res.data[0]
+})
+
 queryImageConfigs({
   imageType: 1,
 }).then((res) => {
@@ -190,11 +195,7 @@ queryImageConfigs({
   bodyBanners.value = res.data
 })
 
-queryThjSpotQuoteConfig().then((res) => {
-  spotQuoteList.value = res.data
-})
-
-onRefresh();
+onRefresh()
 </script>
 
 <style lang="less">

+ 24 - 19
src/packages/mobile/views/mine/generalize/components/promotion/index.vue

@@ -1,6 +1,6 @@
 <template>
-    <app-pull-refresh ref="pullRefreshRef" v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount"
-        @refresh="onRefresh" disabled style="height:auto">
+    <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
+        :page-count="pageCount" @refresh="run" disabled style="height:auto">
         <app-list :columns="columns" :data-list="dataList" v-if="dataList.length" @click="onClick">
             <!-- 日期 -->
             <template #profitmonth="{ value }">
@@ -18,7 +18,8 @@
 <script lang="ts" setup>
 import { shallowRef, watch, computed } from 'vue'
 import { formatDate } from '@/filters'
-import { useQueryTHJPromotionIncome } from '@/business/order'
+import { useRequest } from '@/hooks/request'
+import { queryTHJPromotionIncome } from '@/services/api/order'
 import { useTHJProfitDrawApplyReq } from '@/business/trade'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import AppList from '@mobile/components/base/list/index.vue'
@@ -34,13 +35,10 @@ const props = defineProps({
 })
 
 const { router } = useNavigation()
-const { pageIndex, pageCount, getTHJPromotionIncome } = useQueryTHJPromotionIncome()
 const { onSubmit } = useTHJProfitDrawApplyReq()
 const dataList = shallowRef<Model.THJPromotionIncomeRsp[]>([])
-const error = shallowRef(false)
-
-/// 下拉刷新
 const pullRefreshRef = shallowRef()
+const error = shallowRef(false)
 
 const columns = computed<Model.TableColumn[]>(() => {
     const result = [
@@ -55,22 +53,29 @@ const columns = computed<Model.TableColumn[]>(() => {
     return result
 })
 
-const onClick = (item: Model.THJPromotionIncomeRsp) => {
-    router.push({ name: 'promotion-detail', query: { month: formatDate(item.profitmonth, 'YYYYMM') } })
-}
-
-const onRefresh = (finish: () => void) => {
-    /// 查询数据
-    getTHJPromotionIncome(props.status).then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryTHJPromotionIncome, {
+    manual: true,
+    params: {
+        pagesize: 20,
+        profitstatus: props.status,
+    },
+    onSuccess: (res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
-        dataList.value.push(...res)
-    }).catch(() => {
+        const data = res.data.map((e) => ({
+            ...e,
+            profitstatus: props.status ?? e.profitstatus
+        }))
+        dataList.value.push(...data)
+    },
+    onError: () => {
         error.value = true
-    }).finally(() => {
-        finish()
-    })
+    }
+})
+
+const onClick = (item: Model.THJPromotionIncomeRsp) => {
+    router.push({ name: 'promotion-detail', query: { month: formatDate(item.profitmonth, 'YYYYMM') } })
 }
 
 const submit = (item: Model.THJPromotionIncomeRsp) => {

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

@@ -1,6 +1,6 @@
 <template>
-    <app-pull-refresh ref="pullRefreshRef" v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount"
-        @refresh="onRefresh" disabled style="height:auto">
+    <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
+        :page-count="pageCount" @refresh="run" disabled style="height:auto">
         <app-list :columns="columns" :data-list="dataList" v-if="dataList.length">
             <!-- 日期 -->
             <template #reckondate="{ value }">
@@ -26,7 +26,8 @@
 <script lang="ts" setup>
 import { shallowRef, watch } from 'vue'
 import { formatDate } from '@/filters'
-import { useQueryTHJTradeDataList } from '@/business/goods'
+import { useRequest } from '@/hooks/request'
+import { queryTHJTradeData } from '@/services/api/goods'
 import { getTHJMarketName } from '@/constants/market'
 import { Empty } from 'vant'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
@@ -39,7 +40,7 @@ const props = defineProps({
     }
 })
 
-const { pageIndex, pageCount, getQueryTHJTradeDataList } = useQueryTHJTradeDataList()
+const pullRefreshRef = shallowRef()
 const dataList = shallowRef<Model.THJTradeDataRsp[]>([])
 const error = shallowRef(false)
 
@@ -52,22 +53,22 @@ const columns: Model.TableColumn[] = [
     { prop: 'tradelot', label: '笔数' },
 ]
 
-/// 下拉刷新
-const pullRefreshRef = shallowRef()
-
-const onRefresh = (finish: () => void) => {
-    /// 查询数据
-    getQueryTHJTradeDataList(props.marketid).then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryTHJTradeData, {
+    manual: true,
+    params: {
+        pagesize: 20,
+        marketid: props.marketid,
+    },
+    onSuccess: (res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
-        dataList.value.push(...res)
-    }).catch(() => {
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
         error.value = true
-    }).finally(() => {
-        finish()
-    })
-}
+    }
+})
 
 watch(() => props.marketid, () => {
     pullRefreshRef.value?.refresh()

+ 16 - 13
src/packages/mobile/views/mine/generalize/detail/index.vue

@@ -3,8 +3,8 @@
         <template #header>
             <app-navbar title="推广收益明细" />
         </template>
-        <app-pull-refresh class="promotion-detail__container" v-model:error="error" v-model:pageIndex="pageIndex"
-            :page-count="pageCount" @refresh="onRefresh">
+        <app-pull-refresh class="promotion-detail__container" v-model:loading="loading" v-model:error="error"
+            v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="run">
             <app-list :columns="columns" :data-list="dataList" v-if="dataList.length">
                 <!-- 时间 -->
                 <template #tradetime="{ value }">
@@ -20,14 +20,14 @@
 <script lang="ts" setup>
 import { shallowRef } from 'vue'
 import { formatDate } from '@/filters'
+import { useRequest } from '@/hooks/request'
+import { queryTHJPromotionIncomeDetail } from '@/services/api/order'
 import { useNavigation } from '@/hooks/navigation'
-import { useQueryTHJPromotionIncomeDetail } 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'
 
 const { getQueryString } = useNavigation()
-const { pageIndex, pageCount, getTHJPromotionIncomeDetail } = useQueryTHJPromotionIncomeDetail(getQueryString('month'))
 const dataList = shallowRef<Model.THJPromotionIncomeDetailRsp[]>([])
 const error = shallowRef(false)
 
@@ -40,17 +40,20 @@ const columns: Model.TableColumn[] = [
     { prop: 'profitamount', label: '金额' },
 ]
 
-const onRefresh = (finish: () => void) => {
-    /// 查询数据
-    getTHJPromotionIncomeDetail().then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryTHJPromotionIncomeDetail, {
+    manual: true,
+    params: {
+        pagesize: 20,
+        mouth: getQueryString('month'),
+    },
+    onSuccess: (res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
-        dataList.value.push(...res)
-    }).catch(() => {
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
         error.value = true
-    }).finally(() => {
-        finish()
-    })
-}
+    }
+})
 </script>

+ 19 - 16
src/packages/mobile/views/mine/order/his/purchasetrade/index.vue

@@ -3,8 +3,8 @@
         <template #header>
             <app-navbar title="采购订单-已完成" />
         </template>
-        <app-pull-refresh class="order-list__wrapper" v-model:error="error" v-model:pageIndex="pageIndex"
-            :page-count="pageCount" @refresh="onRefresh">
+        <app-pull-refresh class="order-list__wrapper" v-model:loading="loading" v-model:error="error"
+            v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="run">
             <ul class="section">
                 <li class="section-item" v-for="(item, index) in dataList" :key="index">
                     <div class="section-item__titlebar">
@@ -51,31 +51,34 @@
 import { shallowRef } from 'vue'
 import { Button } from 'vant'
 import { useNavigation } from '@/hooks/navigation'
+import { useRequest } from '@/hooks/request'
 import { handleNumberValue, parsePercent } from '@/filters'
+import { queryTHJPurchaseTradeDetail } from '@/services/api/order'
 import { getGoodsUnitName } from '@/constants/unit'
-import { useTHJPurchaseTradeDetail } from '@/business/order'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
 const { router } = useNavigation()
-const { pageIndex, pageCount, getTHJPurchaseTradeDetail } = useTHJPurchaseTradeDetail()
 const dataList = shallowRef<Model.THJPurchaseTradeDetailRsp[]>([])
 const error = shallowRef(false)
 
-const onClick = (item: Model.THJPurchaseTradeDetailRsp) => {
-    router.push({ name: 'purchase-trade-detail', params: { item: JSON.stringify(item) } })
-}
-
-const onRefresh = (finish: () => void) => {
-    /// 查询已完成
-    getTHJPurchaseTradeDetail(1).then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryTHJPurchaseTradeDetail, {
+    manual: true,
+    params: {
+        pagesize: 20,
+        type: 1,
+    },
+    onSuccess: (res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
-        dataList.value.push(...res)
-    }).catch(() => {
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
         error.value = true
-    }).finally(() => {
-        finish()
-    })
+    }
+})
+
+const onClick = (item: Model.THJPurchaseTradeDetailRsp) => {
+    router.push({ name: 'purchase-trade-detail', params: { item: JSON.stringify(item) } })
 }
 </script>

+ 16 - 13
src/packages/mobile/views/mine/order/his/transfer/index.vue

@@ -3,8 +3,8 @@
         <template #header>
             <app-navbar title="转让委托-已成交" />
         </template>
-        <app-pull-refresh class="order-list__wrapper" v-model:error="error" v-model:pageIndex="pageIndex"
-            :page-count="pageCount" @refresh="onRefresh">
+        <app-pull-refresh class="order-list__wrapper" v-model:loading="loading" v-model:error="error"
+            v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="run">
             <ul class="section">
                 <li class="section-item" v-for="(item, index) in dataList" :key="index">
                     <div class="section-item__titlebar">
@@ -51,11 +51,11 @@ import { Button } from 'vant'
 import { useNavigation } from '@/hooks/navigation'
 import { getGoodsUnitName } from '@/constants/unit'
 import { handleNumberValue } from '@/filters'
-import { useQueryTHJPurchaseTransferOrder } from '@/business/order'
+import { useRequest } from '@/hooks/request'
+import { queryTHJPurchaseTransferOrder } from '@/services/api/order'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
 const { router } = useNavigation()
-const { pageIndex, pageCount, getTHJPurchaseTransferOrder } = useQueryTHJPurchaseTransferOrder()
 const dataList = shallowRef<Model.THJPurchaseTransferOrderRsp[]>([])
 const error = shallowRef(false)
 
@@ -63,17 +63,20 @@ const onClick = (item: Model.THJPurchaseTransferOrderRsp) => {
     router.push({ name: 'transfer-detail', query: { id: item.transferid } })
 }
 
-const onRefresh = (finish: () => void) => {
-    /// 查询未完成
-    getTHJPurchaseTransferOrder(3).then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryTHJPurchaseTransferOrder, {
+    manual: true,
+    params: {
+        pagesize: 20,
+        ordertype: 3,
+    },
+    onSuccess: (res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
-        dataList.value.push(...res)
-    }).catch(() => {
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
         error.value = true
-    }).finally(() => {
-        finish()
-    })
-}
+    }
+})
 </script>

+ 24 - 17
src/packages/mobile/views/mine/order/his/wrorder/index.vue

@@ -4,8 +4,8 @@
             <app-navbar title="供求委托-历史" />
         </template>
         <Cell title="委托日期" :value="date" @click="show = true" is-link></Cell>
-        <app-pull-refresh ref="pullRefreshRef" class="order-list__wrapper" v-model:pageIndex="pageIndex"
-            v-model:error="error" :page-count="pageCount" @refresh="onRefresh">
+        <app-pull-refresh ref="pullRefreshRef" class="order-list__wrapper" v-model:loading="loading"
+            v-model:pageIndex="pageIndex" v-model:error="error" :page-count="pageCount" @refresh="onRefresh">
             <ul class="section">
                 <li class="section-item" v-for="(item, index) in dataList" :key="index">
                     <div class="section-item__titlebar">
@@ -44,17 +44,17 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, ref } from 'vue'
+import { shallowRef, ref, reactive } from 'vue'
 import { Button, Calendar, Cell } from 'vant'
 import { formatDate, handleNoneValue } from '@/filters'
+import { useRequest } from '@/hooks/request'
+import { queryWrOrderDetail } from '@/services/api/order'
 import { getWRTradeOrderStatusName } from '@/constants/order'
-import { useQueryWrOrderDetail } from '@/business/order'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import { useNavigation } from '@/hooks/navigation'
 import moment from 'moment'
 
 const { router } = useNavigation()
-const { pageIndex, pageCount, getWrOrderDetail, formData } = useQueryWrOrderDetail()
 const dataList = shallowRef<Model.WrOrderDetailRsp[]>([])
 const error = shallowRef(false)
 /// 是否显示日历
@@ -64,22 +64,30 @@ const date = ref('')
 /// 下拉刷新
 const pullRefreshRef = shallowRef()
 
-const onClick = (item: Model.WrOrderDetailRsp) => {
-    router.push({ name: 'wrorder-detail', params: { item: JSON.stringify(item) } })
-}
+const formData = reactive<Model.WrOrderDetailReq>({
+    pagesize: 20,
+    haswr: 1,
+})
 
-const onRefresh = (finish: () => void) => {
-    /// 查询未完成
-    getWrOrderDetail().then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryWrOrderDetail, {
+    manual: true,
+    onSuccess: (res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
-        dataList.value.push(...res)
-    }).catch(() => {
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
         error.value = true
-    }).finally(() => {
-        finish()
-    })
+    }
+})
+
+const onRefresh = () => {
+    run(formData)
+}
+
+const onClick = (item: Model.WrOrderDetailRsp) => {
+    router.push({ name: 'wrorder-detail', params: { item: JSON.stringify(item) } })
 }
 
 const onClose = () => {
@@ -95,5 +103,4 @@ const onConfirm = (values: Date[]) => {
     /// 查询
     pullRefreshRef.value?.refresh()
 }
-
 </script>

+ 25 - 16
src/packages/mobile/views/mine/order/his/wrtrade/index.vue

@@ -4,8 +4,8 @@
             <app-navbar title="供求成交-历史" />
         </template>
         <Cell title="成交日期" :value="date" @click="show = true" is-link></Cell>
-        <app-pull-refresh ref="pullRefreshRef" class="order-list__wrapper" v-model:pageIndex="pageIndex"
-            :page-count="pageCount" v-model:error="error" @refresh="onRefresh">
+        <app-pull-refresh ref="pullRefreshRef" class="order-list__wrapper" v-model:loading="loading"
+            v-model:pageIndex="pageIndex" :page-count="pageCount" v-model:error="error" @refresh="onRefresh">
             <ul class="section">
                 <li class="section-item" v-for="(item, index) in dataList" :key="index">
                     <div class="section-item__titlebar">
@@ -45,17 +45,17 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, ref } from 'vue'
+import { shallowRef, ref, reactive } from 'vue'
 import { Button, Calendar, Cell } from 'vant'
 import { formatDate, handleNoneValue } from '@/filters'
 import { getBuyOrSellName } from '@/constants/order'
-import { useQueryWrTradeDetail } from '@/business/order'
+import { useRequest } from '@/hooks/request'
+import { queryWrTradeDetail } from '@/services/api/order'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import { useNavigation } from '@/hooks/navigation'
 import moment from 'moment'
 
 const { router } = useNavigation()
-const { pageIndex, pageCount, getWrTradeDetail, formData } = useQueryWrTradeDetail()
 const dataList = shallowRef<Model.WrTradeDetailRsp[]>([])
 const error = shallowRef(false)
 /// 是否显示日历
@@ -65,22 +65,31 @@ const date = ref('')
 /// 下拉刷新
 const pullRefreshRef = shallowRef()
 
-const onClick = (item: Model.WrTradeDetailRsp) => {
-    router.push({ name: 'wrtrade-detail', params: { item: JSON.stringify(item) } })
-}
+const formData = reactive<Model.WrTradeDetailReq>({
+    pagesize: 20,
+    haswr: 1,
+})
 
-const onRefresh = (finish: () => void) => {
-    /// 查询未完成
-    getWrTradeDetail().then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryWrTradeDetail, {
+    manual: true,
+    onSuccess: (res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
-        dataList.value.push(...res)
-    }).catch(() => {
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
         error.value = true
-    }).finally(() => {
-        finish()
-    })
+    }
+})
+
+const onClick = (item: Model.WrTradeDetailRsp) => {
+    router.push({ name: 'wrtrade-detail', params: { item: JSON.stringify(item) } })
+}
+
+const onRefresh = () => {
+    /// 查询未完成
+    run(formData)
 }
 
 const onClose = () => {

+ 19 - 16
src/packages/mobile/views/mine/order/list/components/purchasetrade/index.vue

@@ -1,8 +1,8 @@
 <!-- 我的订单-采购订单 -->
 <template>
     <app-view class="order-list-purchase">
-        <app-pull-refresh ref="pullRefreshRef" class="order-list__wrapper" v-model:error="error"
-            v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
+        <app-pull-refresh ref="pullRefreshRef" class="order-list__wrapper" v-model:loading="loading" v-model:error="error"
+            v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="run">
             <ul class="section">
                 <li class="section-item" v-for="(item, index) in dataList" :key="index">
                     <div class="section-item__titlebar">
@@ -51,31 +51,34 @@ import { Button } from 'vant'
 import { useNavigation } from '@/hooks/navigation'
 import { handleNumberValue, parsePercent } from '@/filters'
 import { getGoodsUnitName } from '@/constants/unit'
-import { useTHJPurchaseTradeDetail } from '@/business/order'
+import { useRequest } from '@/hooks/request'
+import { queryTHJPurchaseTradeDetail } from '@/services/api/order'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
 const { router } = useNavigation()
-const { pageIndex, pageCount, getTHJPurchaseTradeDetail } = useTHJPurchaseTradeDetail()
 const dataList = shallowRef<Model.THJPurchaseTradeDetailRsp[]>([])
 const error = shallowRef(false)
 const pullRefreshRef = shallowRef()
 
-const onClick = (item: Model.THJPurchaseTradeDetailRsp) => {
-    router.push({ name: 'purchase-trade-detail', params: { item: JSON.stringify(item) } })
-}
-
-const onRefresh = (finish: () => void) => {
-    /// 查询未完成
-    getTHJPurchaseTradeDetail(0).then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryTHJPurchaseTradeDetail, {
+    manual: true,
+    params: {
+        pagesize: 20,
+        type: 0,
+    },
+    onSuccess: (res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
-        dataList.value.push(...res)
-    }).catch(() => {
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
         error.value = true
-    }).finally(() => {
-        finish()
-    })
+    }
+})
+
+const onClick = (item: Model.THJPurchaseTradeDetailRsp) => {
+    router.push({ name: 'purchase-trade-detail', params: { item: JSON.stringify(item) } })
 }
 
 onActivated(() => {

+ 19 - 16
src/packages/mobile/views/mine/order/list/components/transferbuy/index.vue

@@ -1,8 +1,8 @@
 <!-- 我的订单-转让成交 -->
 <template>
     <app-view class="order-list-purchase">
-        <app-pull-refresh ref="pullRefreshRef" class="order-list__wrapper" v-model:error="error"
-            v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
+        <app-pull-refresh ref="pullRefreshRef" class="order-list__wrapper" v-model:loading="loading" v-model:error="error"
+            v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="run">
             <ul class="section">
                 <li class="section-item" v-for="(item, index) in dataList" :key="index">
                     <div class="section-item__titlebar">
@@ -54,31 +54,34 @@ import { Button } from 'vant'
 import { useNavigation } from '@/hooks/navigation'
 import { getGoodsUnitName } from '@/constants/unit'
 import { handleNumberValue } from '@/filters'
-import { useQueryTHJPurchaseTransferOrder } from '@/business/order'
+import { useRequest } from '@/hooks/request'
+import { queryTHJPurchaseTransferOrder } from '@/services/api/order'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
 const { router } = useNavigation()
-const { pageIndex, pageCount, getTHJPurchaseTransferOrder } = useQueryTHJPurchaseTransferOrder()
 const pullRefreshRef = shallowRef()
 const dataList = shallowRef<Model.THJPurchaseTransferOrderRsp[]>([])
 const error = shallowRef(false)
 
-const onClick = (item: Model.THJPurchaseTransferOrderRsp) => {
-    router.push({ name: 'transfer-detail', query: { id: item.transferid } })
-}
-
-const onRefresh = (finish: () => void) => {
-    /// 查询未完成
-    getTHJPurchaseTransferOrder(2).then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryTHJPurchaseTransferOrder, {
+    manual: true,
+    params: {
+        pagesize: 20,
+        ordertype: 2,
+    },
+    onSuccess: (res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
-        dataList.value.push(...res)
-    }).catch(() => {
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
         error.value = true
-    }).finally(() => {
-        finish()
-    })
+    }
+})
+
+const onClick = (item: Model.THJPurchaseTransferOrderRsp) => {
+    router.push({ name: 'transfer-detail', query: { id: item.transferid } })
 }
 
 onActivated(() => {

+ 19 - 16
src/packages/mobile/views/mine/order/list/components/transfersell/index.vue

@@ -1,8 +1,8 @@
 <!-- 我的订单-转让委托 -->
 <template>
     <app-view class="order-list-purchase">
-        <app-pull-refresh ref="pullRefreshRef" class="order-list__wrapper" v-model:error="error"
-            v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
+        <app-pull-refresh ref="pullRefreshRef" class="order-list__wrapper" v-model:loading="loading" v-model:error="error"
+            v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="run">
             <ul class="section">
                 <li class="section-item" v-for="(item, index) in dataList" :key="index">
                     <div class="section-item__titlebar">
@@ -49,31 +49,34 @@ import { Button } from 'vant'
 import { useNavigation } from '@/hooks/navigation'
 import { getGoodsUnitName } from '@/constants/unit'
 import { handleNumberValue } from '@/filters'
-import { useQueryTHJPurchaseTransferOrder } from '@/business/order'
+import { useRequest } from '@/hooks/request'
+import { queryTHJPurchaseTransferOrder } from '@/services/api/order'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
 const { router } = useNavigation()
-const { pageIndex, pageCount, getTHJPurchaseTransferOrder } = useQueryTHJPurchaseTransferOrder()
 const pullRefreshRef = shallowRef()
 const dataList = shallowRef<Model.THJPurchaseTransferOrderRsp[]>([])
 const error = shallowRef(false)
 
-const onClick = (item: Model.THJPurchaseTransferOrderRsp) => {
-    router.push({ name: 'transfer-detail', query: { id: item.transferid } })
-}
-
-const onRefresh = (finish: () => void) => {
-    /// 查询未完成
-    getTHJPurchaseTransferOrder(1).then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryTHJPurchaseTransferOrder, {
+    manual: true,
+    params: {
+        pagesize: 20,
+        ordertype: 1,
+    },
+    onSuccess: (res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
-        dataList.value.push(...res)
-    }).catch(() => {
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
         error.value = true
-    }).finally(() => {
-        finish()
-    })
+    }
+})
+
+const onClick = (item: Model.THJPurchaseTransferOrderRsp) => {
+    router.push({ name: 'transfer-detail', query: { id: item.transferid } })
 }
 
 onActivated(() => {

+ 19 - 16
src/packages/mobile/views/mine/order/list/components/wrorder/index.vue

@@ -1,8 +1,8 @@
 <!-- 我的订单-供求委托 -->
 <template>
     <app-view class="wrorderdetail">
-        <app-pull-refresh ref="pullRefreshRef" class="order-list__wrapper" v-model:pageIndex="pageIndex"
-            v-model:error="error" :page-count="pageCount" @refresh="onRefresh">
+        <app-pull-refresh ref="pullRefreshRef" class="order-list__wrapper" v-model:loading="loading"
+            v-model:pageIndex="pageIndex" v-model:error="error" :page-count="pageCount" @refresh="run">
             <ul class="section">
                 <li class="section-item" v-for="(item, index) in dataList" :key="index">
                     <div class="section-item__titlebar">
@@ -47,32 +47,35 @@ import { shallowRef, onActivated } from 'vue'
 import { Button } from 'vant'
 import { handleNoneValue } from '@/filters'
 import { getWRTradeOrderStatusName } from '@/constants/order'
-import { useQueryWrOrderDetail } from '@/business/order'
+import { useRequest } from '@/hooks/request'
+import { queryWrOrderDetail } from '@/services/api/order'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import { useNavigation } from '@/hooks/navigation'
 
 const { router } = useNavigation()
-const { pageIndex, pageCount, getWrOrderDetail } = useQueryWrOrderDetail()
 const pullRefreshRef = shallowRef()
 const dataList = shallowRef<Model.WrOrderDetailRsp[]>([])
 const error = shallowRef(false)
 
-const onClick = (item: Model.WrOrderDetailRsp) => {
-    router.push({ name: 'wrorder-detail', params: { item: JSON.stringify(item) } })
-}
-
-const onRefresh = (finish: () => void) => {
-    /// 查询未完成
-    getWrOrderDetail().then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryWrOrderDetail, {
+    manual: true,
+    params: {
+        pagesize: 20,
+        haswr: 1,
+    },
+    onSuccess: (res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
-        dataList.value.push(...res)
-    }).catch(() => {
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
         error.value = true
-    }).finally(() => {
-        finish()
-    })
+    }
+})
+
+const onClick = (item: Model.WrOrderDetailRsp) => {
+    router.push({ name: 'wrorder-detail', params: { item: JSON.stringify(item) } })
 }
 
 onActivated(() => {

+ 19 - 16
src/packages/mobile/views/mine/order/list/components/wrtrade/index.vue

@@ -1,8 +1,8 @@
 <!-- 我的订单-供求成交 -->
 <template>
     <app-view class="wrtradedetail">
-        <app-pull-refresh ref="pullRefreshRef" class="order-list__wrapper" v-model:pageIndex="pageIndex"
-            :page-count="pageCount" v-model:error="error" @refresh="onRefresh">
+        <app-pull-refresh ref="pullRefreshRef" class="order-list__wrapper" v-model:loading="loading"
+            v-model:pageIndex="pageIndex" :page-count="pageCount" v-model:error="error" @refresh="run">
             <ul class="section">
                 <li class="section-item" v-for="(item, index) in dataList" :key="index">
                     <div class="section-item__titlebar">
@@ -44,32 +44,35 @@ import { shallowRef, onActivated } from 'vue'
 import { Button } from 'vant'
 import { formatDate, handleNoneValue } from '@/filters'
 import { getBuyOrSellName } from '@/constants/order'
-import { useQueryWrTradeDetail } from '@/business/order'
+import { useRequest } from '@/hooks/request'
+import { queryWrTradeDetail } from '@/services/api/order'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import { useNavigation } from '@/hooks/navigation'
 
 const { router } = useNavigation()
-const { pageIndex, pageCount, getWrTradeDetail } = useQueryWrTradeDetail()
 const pullRefreshRef = shallowRef()
 const dataList = shallowRef<Model.WrTradeDetailRsp[]>([])
 const error = shallowRef(false)
 
-const onClick = (item: Model.WrTradeDetailRsp) => {
-    router.push({ name: 'wrtrade-detail', params: { item: JSON.stringify(item) } })
-}
-
-const onRefresh = (finish: () => void) => {
-    /// 查询未完成
-    getWrTradeDetail().then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryWrTradeDetail, {
+    manual: true,
+    params: {
+        pagesize: 20,
+        haswr: 1,
+    },
+    onSuccess: (res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
-        dataList.value.push(...res)
-    }).catch(() => {
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
         error.value = true
-    }).finally(() => {
-        finish()
-    })
+    }
+})
+
+const onClick = (item: Model.WrTradeDetailRsp) => {
+    router.push({ name: 'wrtrade-detail', params: { item: JSON.stringify(item) } })
 }
 
 onActivated(() => {

+ 20 - 18
src/packages/mobile/views/mine/wareorder/list/components/holdlb/index.vue

@@ -1,7 +1,7 @@
 <template>
     <app-view class="wareorder-list-purchase">
-        <app-pull-refresh ref="pullRefreshRef" class="wareorder-list__wrapper" v-model:error="error"
-            v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
+        <app-pull-refresh ref="pullRefreshRef" class="wareorder-list__wrapper" v-model:loading="loading"
+            v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="run">
             <ul class="section">
                 <li class="section-item" v-for="(item, index) in dataList" :key="index">
                     <div class="section-item__titlebar">
@@ -40,7 +40,8 @@
 <script lang="ts" setup>
 import { shallowRef, defineAsyncComponent } from 'vue'
 import { Button } from 'vant'
-import { useQueryHoldLB } from '@/business/order'
+import { useRequest } from '@/hooks/request'
+import { queryHoldLB } from '@/services/api/order'
 import { useComponent } from '@/hooks/component'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
@@ -53,12 +54,27 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
     pullRefreshRef.value?.refresh()
 })
 
-const { pageIndex, pageCount, getHoldLB } = useQueryHoldLB()
 const pullRefreshRef = shallowRef()
 const dataList = shallowRef<Model.HoldLBRsp[]>([])
 const selectedRow = shallowRef()
 const error = shallowRef(false)
 
+const { loading, pageIndex, pageCount, run } = useRequest(queryHoldLB, {
+    manual: true,
+    params: {
+        pagesize: 20,
+    },
+    onSuccess: (res) => {
+        if (pageIndex.value === 1) {
+            dataList.value = []
+        }
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
+        error.value = true
+    }
+})
+
 const pickup = (item: Model.HoldLBRsp) => {
     selectedRow.value = item
     openComponent('pickup')
@@ -68,18 +84,4 @@ const listing = (item: Model.HoldLBRsp) => {
     selectedRow.value = item
     openComponent('listing')
 }
-
-const onRefresh = (finish: () => void) => {
-    /// 查询未完成
-    getHoldLB().then((res) => {
-        if (pageIndex.value === 1) {
-            dataList.value = []
-        }
-        dataList.value.push(...res)
-    }).catch(() => {
-        error.value = true
-    }).finally(() => {
-        finish()
-    })
-}
 </script>

+ 18 - 16
src/packages/mobile/views/mine/wareorder/list/components/wroutinapply/index.vue

@@ -1,7 +1,7 @@
 <template>
     <app-view class="wareorder-list-purchase">
-        <app-pull-refresh class="wareorder-list__wrapper" v-model:error="error" v-model:pageIndex="pageIndex"
-            :page-count="pageCount" @refresh="onRefresh">
+        <app-pull-refresh class="wareorder-list__wrapper" v-model:loading="loading" v-model:error="error"
+            v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="run">
             <ul class="section">
                 <li class="section-item" v-for="(item, index) in dataList" :key="index">
                     <div class="section-item__titlebar">
@@ -41,30 +41,32 @@
 import { shallowRef } from 'vue'
 import { Button } from 'vant'
 import { useNavigation } from '@/hooks/navigation'
-import { useQueryWrOutInApply } from '@/business/order'
+import { useRequest } from '@/hooks/request'
+import { queryWrOutInApply } from '@/services/api/order'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import { getApplyStatusName } from "@/constants/order"
 
 const { router } = useNavigation()
-const { pageIndex, pageCount, getWrOutInApply } = useQueryWrOutInApply()
 const dataList = shallowRef<Model.WrOutInApplyRsp[]>([])
 const error = shallowRef(false)
 
-const onClick = (item: Model.WrOutInApplyRsp) => {
-    router.push({ name: 'wroutinapply-detail', params: { item: JSON.stringify(item) } })
-}
-
-const onRefresh = (finish: () => void) => {
-    /// 查询未完成
-    getWrOutInApply().then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryWrOutInApply, {
+    manual: true,
+    params: {
+        pagesize: 20,
+    },
+    onSuccess: (res) => {
         if (pageIndex.value === 1) {
             dataList.value = []
         }
-        dataList.value.push(...res)
-    }).catch(() => {
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
         error.value = true
-    }).finally(() => {
-        finish()
-    })
+    }
+})
+
+const onClick = (item: Model.WrOutInApplyRsp) => {
+    router.push({ name: 'wroutinapply-detail', params: { item: JSON.stringify(item) } })
 }
 </script>

+ 10 - 8
src/packages/mobile/views/news/details/index.vue

@@ -13,7 +13,7 @@
         </section>
         <Divider>热门资讯</Divider>
         <CellGroup class="new-details__list">
-            <template v-for="(item, index) in newsList" :key="index">
+            <template v-for="(item, index) in dataList" :key="index">
                 <Cell class="article-item" title-class="article-item__title" value-class="article-item__time"
                     :title="item.title" :value="formatDate(item.creaedate, 'MM/DD')"
                     :to="{ name: 'news-details', query: { t: new Date().getTime() }, params: { item: JSON.stringify(item), columnid } }"
@@ -28,24 +28,26 @@ import { shallowRef } from 'vue'
 import { CellGroup, Cell, Divider } from 'vant'
 import { formatDate } from '@/filters'
 import { useNavigation } from '@/hooks/navigation'
+import { useRequest } from '@/hooks/request'
 import { formatHtmlString } from '@/filters'
 import { querySiteColumnDetail } from '@/services/api/news'
 
 const { route } = useNavigation()
 const { item, columnid } = route.params
 const details = shallowRef<Model.SiteColumnDetailRsp>()
-const newsList = shallowRef<Model.SiteColumnDetailRsp[]>([])
 
 if (item) {
     details.value = JSON.parse(item.toString())
 }
 
-querySiteColumnDetail({
-    columnid: columnid ? Number(columnid) : undefined,
-    page: 1,
-    pagesize: 10,
-}).then((res) => {
-    newsList.value = res.data.filter((e) => e.id !== details.value?.id)
+const { dataList } = useRequest(querySiteColumnDetail, {
+    params: {
+        pagesize: 10,
+        columnid: columnid ? Number(columnid) : undefined,
+    },
+    onFinally: () => {
+        dataList.value = dataList.value.filter((e) => e.id !== details.value?.id)
+    }
 })
 </script>
 

+ 37 - 16
src/packages/mobile/views/news/list/index.vue

@@ -8,12 +8,12 @@
         <Tab :name="item.id" :title="item.columnname" />
       </template>
     </Tabs>
-    <app-pull-refresh ref="pullRefreshRef" class="news-list__container" v-model:error="error"
+    <app-pull-refresh ref="pullRefreshRef" class="news-list__container" v-model:loading="loading" v-model:error="error"
       v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
       <Empty v-if="!dataList.length" />
       <template v-for="(item, index) in dataList" :key="index">
-        <Cell class="article-item" title-class="article-item__title" value-class="article-item__time"
-          :title="item.title" :value="formatDate(item.creaedate, 'MM/DD')"
+        <Cell class="article-item" title-class="article-item__title" value-class="article-item__time" :title="item.title"
+          :value="formatDate(item.creaedate, 'MM/DD')"
           :to="{ name: 'news-details', params: { item: JSON.stringify(item), columnid: currentColumnId } }" />
       </template>
     </app-pull-refresh>
@@ -24,30 +24,51 @@
 import { shallowRef } from 'vue'
 import { Cell, Tab, Tabs, Empty } from 'vant'
 import { formatDate } from '@/filters'
-import { useSiteColumnDetail } from '@/business/news'
+import { useRequest } from '@/hooks/request'
+import { querySiteColumnDetail, querySiteColumnConfig } from '@/services/api/news'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
-const { siteColumns, currentColumnId, pageIndex, pageCount, getSiteColumnDetail } = useSiteColumnDetail()
 const pullRefreshRef = shallowRef()
 const dataList = shallowRef<Model.SiteColumnDetailRsp[]>([])
+const siteColumns = shallowRef<Model.SiteColumnConfigRsp[]>([])
+const currentColumnId = shallowRef(0)
 const error = shallowRef(false)
 
-// Tab触发
-const onClickTab = () => {
-  pullRefreshRef.value?.refresh()
-}
+/// 查询栏目配置
+const getSiteColumnConfig = querySiteColumnConfig().then((res) => {
+  siteColumns.value = res.data
+  /// 默认第一个
+  if (res.data.length) {
+    currentColumnId.value = res.data[0].id
+  }
+})
 
-const onRefresh = (finish: () => void) => {
-  getSiteColumnDetail().then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(querySiteColumnDetail, {
+  manual: true,
+  params: {
+    pagesize: 20,
+  },
+  onBefore: () => {
+    return getSiteColumnConfig
+  },
+  onSuccess: (res) => {
     if (pageIndex.value === 1) {
       dataList.value = []
     }
-    dataList.value.push(...res)
-  }).catch(() => {
+    dataList.value.push(...res.data)
+  },
+  onError: () => {
     error.value = true
-  }).finally(() => {
-    finish()
-  })
+  }
+})
+
+const onRefresh = () => {
+  run({ columnid: currentColumnId.value })
+}
+
+// Tab触发
+const onClickTab = () => {
+  pullRefreshRef.value?.refresh()
 }
 </script>
   

+ 22 - 19
src/packages/mobile/views/product/list/index.vue

@@ -3,8 +3,8 @@
     <template #header>
       <app-navbar title="产品介绍" />
     </template>
-    <app-pull-refresh class="product__container" v-model:error="error" v-model:pageIndex="pageIndex"
-      :page-count="pageCount" @refresh="onRefresh">
+    <app-pull-refresh class="product__container" v-model:loading="loading" v-model:error="error"
+      v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="run">
       <ul class="list">
         <li class="list-item g-block--bg" v-for="(item, index) in dataList" :key="index">
           <div class="block">
@@ -13,7 +13,7 @@
           </div>
           <div class="block">
             <Button type="primary" size="small" round
-              @click="$router.push({ name: 'product-detail', query: { favorite: active, wrstandardid: item.wrstandardid } })">查看详情</Button>
+              @click="$router.push({ name: 'product-detail', query: { favorite: 0, wrstandardid: item.wrstandardid } })">查看详情</Button>
           </div>
         </li>
       </ul>
@@ -25,31 +25,34 @@
 import { shallowRef } from 'vue'
 import { Button } from 'vant'
 import { getImageUrl } from '@/filters'
-import { useQueryTHJProductLists } from '@/business/goods'
+import { useRequest } from '@/hooks/request'
+import { queryTHJProduct } from '@/services/api/goods'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
-const { pageIndex, pageCount, getQueryTHJProductLists, active } = useQueryTHJProductLists()
 const dataList = shallowRef<Model.THJProductRsp[]>([])
 const error = shallowRef(false)
 
-// 获取产品首图
-const getFirstImage = (url: string) => {
-  const images = url.split(',').map((path) => getImageUrl(path))
-  return images[0] ?? ''
-}
-
-const onRefresh = (finish: () => void) => {
-  /// 获取产品列表
-  getQueryTHJProductLists().then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryTHJProduct, {
+  manual: true,
+  params: {
+    pagesize: 20,
+    favoriteflag: false,
+  },
+  onSuccess: (res) => {
     if (pageIndex.value === 1) {
       dataList.value = []
     }
-    dataList.value.push(...res)
-  }).catch(() => {
+    dataList.value.push(...res.data)
+  },
+  onError: () => {
     error.value = true
-  }).finally(() => {
-    finish()
-  })
+  }
+})
+
+// 获取产品首图
+const getFirstImage = (url: string) => {
+  const images = url.split(',').map((path) => getImageUrl(path))
+  return images[0] ?? ''
 }
 </script>
 

+ 24 - 17
src/packages/mobile/views/purchase/list/index.vue

@@ -7,7 +7,7 @@
         </template>
       </app-navbar>
     </template>
-    <app-pull-refresh ref="pullRefreshRef" class="purchase__container" v-model:error="error"
+    <app-pull-refresh ref="pullRefreshRef" class="purchase__container" v-model:loading="loading" v-model:error="error"
       v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
       <ul class="list">
         <li class="list-item g-block--bg" v-for="(item, index) in dataList" :key="index">
@@ -29,32 +29,39 @@
 import { shallowRef, onActivated } from 'vue'
 import { Search, Button } from 'vant'
 import { getImageUrl } from '@/filters'
-import { useWrstandardList } from '@/business/goods'
+import { useRequest } from '@/hooks/request'
+import { queryTHJWrstandard } from '@/services/api/goods'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
-const { pageIndex, pageCount, getWrstandardList } = useWrstandardList()
-const dataList = shallowRef<Model.THJWrstandardRsp[]>([])
 const error = shallowRef(false)
 const pullRefreshRef = shallowRef()
 const keyword = shallowRef('')
+const dataList = shallowRef<Model.THJWrstandardRsp[]>([])
 
-// 获取产品首图
-const getFirstImage = (url: string) => {
-  const images = url.split(',').map((path) => getImageUrl(path))
-  return images[0] ?? ''
-}
-
-const onRefresh = (finish: () => void) => {
-  getWrstandardList({ wrstandardname: keyword.value }).then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryTHJWrstandard, {
+  manual: true,
+  params: {
+    pagesize: 20,
+  },
+  onSuccess: (res) => {
     if (pageIndex.value === 1) {
       dataList.value = []
     }
-    dataList.value.push(...res)
-  }).catch(() => {
+    dataList.value.push(...res.data)
+  },
+  onError: () => {
     error.value = true
-  }).finally(() => {
-    finish()
-  })
+  }
+})
+
+const onRefresh = () => {
+  run({ wrstandardname: keyword.value })
+}
+
+// 获取商品首图
+const getFirstImage = (url: string) => {
+  const images = url.split(',').map((path) => getImageUrl(path))
+  return images[0] ?? ''
 }
 
 onActivated(() => {

+ 7 - 6
src/packages/mobile/views/supply-demand/detail/index.vue

@@ -94,7 +94,8 @@ import { getImageUrl } from '@/filters'
 import { useComponent } from '@/hooks/component'
 import { useNavigation } from '@/hooks/navigation'
 import { BuyOrSell } from '@/constants/order'
-import { useOrderQuoteList, useOrderQuoteDetail } from '@/business/goods'
+import { queryOrderQuote } from '@/services/api/goods'
+import { useOrderQuoteDetail } from '@/business/goods'
 import eventBus from '@/services/bus'
 import AppList from '@mobile/components/base/list/index.vue'
 
@@ -109,7 +110,8 @@ const quoteDetail = shallowRef<Model.OrderQuoteDetailRsp>() // 买卖详情
 const buyorsell = shallowRef(BuyOrSell.Buy) // 买卖方向
 
 const wrfactortypeid = getQueryString('wrfactortypeid')
-const { dataList, getOrderQuoteList } = useOrderQuoteList()
+const quoteItem = shallowRef<Model.OrderQuoteRsp>() // 供求详情
+
 const { dataList: buyList, getOrderQuoteList: getOrderBuyList } = useOrderQuoteDetail(wrfactortypeid)
 const { dataList: sellList, getOrderQuoteList: getOrderSellList } = useOrderQuoteDetail(wrfactortypeid)
 
@@ -120,9 +122,6 @@ const columns: Model.TableColumn[] = [
     { prop: 'operate', label: '操作' },
 ]
 
-// 供求详情
-const quoteItem = computed(() => dataList.value[0])
-
 // 商品banner
 const topBanners = computed(() => {
     const bannerpicurl = quoteItem.value?.bannerpicurl ?? ''
@@ -150,7 +149,9 @@ const delistingListing = (row: Model.OrderQuoteDetailRsp, value: BuyOrSell) => {
 
 // 刷新数据
 const refresh = () => {
-    getOrderQuoteList({ wrfactortypeid })
+    queryOrderQuote({ wrpricetype: 1, wrfactortypeid }).then((res) => {
+        quoteItem.value = res.data[0]
+    })
     getOrderBuyList(BuyOrSell.Buy)
     getOrderSellList(BuyOrSell.Sell)
 }

+ 25 - 17
src/packages/mobile/views/supply-demand/list/index.vue

@@ -7,8 +7,8 @@
         </template>
       </app-navbar>
     </template>
-    <app-pull-refresh ref="pullRefreshRef" class="supply-demand__container" v-model:error="error"
-      v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
+    <app-pull-refresh ref="pullRefreshRef" class="supply-demand__container" v-model:loading="loading"
+      v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="onRefresh">
       <ul class="list">
         <li class="list-item g-block--bg" v-for="(item, index) in dataList" :key="index">
           <div class="block">
@@ -32,32 +32,40 @@
 import { shallowRef, onActivated } from 'vue'
 import { Search, Button } from 'vant'
 import { getImageUrl } from '@/filters'
-import { useOrderQuoteList } from '@/business/goods'
+import { useRequest } from '@/hooks/request'
+import { queryOrderQuote } from '@/services/api/goods'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 
-const { pageIndex, pageCount, getOrderQuoteList } = useOrderQuoteList()
 const dataList = shallowRef<Model.OrderQuoteRsp[]>([])
 const error = shallowRef(false)
 const pullRefreshRef = shallowRef()
 const keyword = shallowRef('')
 
-// 获取商品首图
-const getFirstImage = (url: string) => {
-  const images = url.split(',').map((path) => getImageUrl(path))
-  return images[0] ?? ''
-}
-
-const onRefresh = (finish: () => void) => {
-  getOrderQuoteList({ dgitemname: keyword.value }).then((res) => {
+const { loading, pageIndex, pageCount, run } = useRequest(queryOrderQuote, {
+  manual: true,
+  params: {
+    pagesize: 20,
+    wrpricetype: 1,
+  },
+  onSuccess: (res) => {
     if (pageIndex.value === 1) {
       dataList.value = []
     }
-    dataList.value.push(...res)
-  }).catch(() => {
+    dataList.value.push(...res.data)
+  },
+  onError: () => {
     error.value = true
-  }).finally(() => {
-    finish()
-  })
+  }
+})
+
+const onRefresh = () => {
+  run({ dgitemname: keyword.value })
+}
+
+// 获取商品首图
+const getFirstImage = (url: string) => {
+  const images = url.split(',').map((path) => getImageUrl(path))
+  return images[0] ?? ''
 }
 
 onActivated(() => {

+ 1 - 1
src/packages/mobile/views/user/avatar/index.vue

@@ -54,7 +54,7 @@ const onUploadSuccess = (filePath: string) => {
 
 const onSubmit = () => {
     fullloading((hideLoading) => {
-        updateUserHeadUrl(formData).then((res) => {
+        updateUserHeadUrl(formData).then(() => {
             hideLoading()
             userStore.actions.getUserData()
             router.back()

+ 5 - 0
src/services/api/bank/index.ts

@@ -1,6 +1,9 @@
 import { httpRequest } from '@/services/http'
 import { tradeServerRequest } from '@/services/socket/trade'
 import { TradeParams } from '@/services/socket/trade/interface'
+import { loginStore } from '@/stores'
+
+const { firstAccountId } = loginStore.$mapGetters()
 
 /**
  * 账户资金信息请求
@@ -69,6 +72,7 @@ export function queryAccountInOutApply(params: Model.AccountInOutApplyReq) {
  * 资金流水查询(历史)
  */
 export function queryHisAmountLog(params: Model.HisAmountLogReq) {
+    params.accountID = firstAccountId.value.toString()
     return httpRequest<Model.HisAmountLogRsp[]>('/TaAccount/QueryHisAmountLog', 'get', params);
 }
 
@@ -76,6 +80,7 @@ export function queryHisAmountLog(params: Model.HisAmountLogReq) {
  * 资金流水查询(当前)
  */
 export function queryAmountLog(params: Model.AmountLogReq) {
+    params.accountID = firstAccountId.value.toString()
     return httpRequest<Model.AmountLogRsp[]>('/TaAccount/QueryAmountLog', 'get', params);
 }
 

+ 4 - 0
src/services/api/credit/index.ts

@@ -2,11 +2,15 @@ import { Market } from '@/constants/market'
 import { httpRequest } from '@/services/http'
 import { tradeServerRequest } from '@/services/socket/trade'
 import { TradeParams } from '@/services/socket/trade/interface'
+import { loginStore } from '@/stores'
+
+const { userId } = loginStore.$mapGetters()
 
 /**
  * 查询我的积分流水
  */
 export function queryUserScoreLog(params: Model.UserScoreLogReq) {
+    params.userid = userId.value
     return httpRequest<Model.UserScoreLogRsp[]>('/Ferroalloy/QueryUserScoreLog', 'get', params);
 }
 

+ 5 - 0
src/services/api/goods/index.ts

@@ -1,4 +1,7 @@
 import { httpRequest } from '@/services/http'
+import { loginStore } from '@/stores'
+
+const { userId } = loginStore.$mapGetters()
 
 /**
  * 查询企业风管期货商品信息
@@ -67,6 +70,7 @@ export function addUserFavoriteGoods(params: Model.UserFavoriteGoodsReq) {
  * 获取我的推广-交易数据
  */
 export function queryTHJTradeData(params: Model.THJTradeDataReq) {
+    params.userid = userId.value
     return httpRequest<Model.THJTradeDataRsp[]>('/Ferroalloy/QueryTHJTradeData', 'get', params);
 }
 
@@ -74,6 +78,7 @@ export function queryTHJTradeData(params: Model.THJTradeDataReq) {
  * 获取产品介绍列表
  */
 export function queryTHJProduct(params: Model.THJProductReq) {
+    params.userid = userId.value
     return httpRequest<Model.THJProductRsp[]>('/Ferroalloy/QueryTHJProduct', 'get', params);
 }
 

+ 11 - 0
src/services/api/order/index.ts

@@ -1,9 +1,13 @@
 import { httpRequest } from '@/services/http'
+import { loginStore } from '@/stores'
+
+const { userId, firstAccountId } = loginStore.$mapGetters()
 
 /**
  * 查询仓单成交明细
  */
 export function queryWrTradeDetail(params: Partial<Model.WrTradeDetailReq>) {
+    params.userid = userId.value
     return httpRequest<Model.WrTradeDetailRsp[]>('/WrTrade2/QueryWrTradeDetail', 'get', params);
 }
 
@@ -11,6 +15,7 @@ export function queryWrTradeDetail(params: Partial<Model.WrTradeDetailReq>) {
  * 查询仓单委托单
  */
 export function queryWrOrderDetail(params: Partial<Model.WrOrderDetailReq>) {
+    params.userid = userId.value
     return httpRequest<Model.WrOrderDetailRsp[]>('/WrTrade2/QueryWrOrderDetail', 'get', params);
 }
 
@@ -18,6 +23,7 @@ export function queryWrOrderDetail(params: Partial<Model.WrOrderDetailReq>) {
  * 查询我的订单-采购订单
  */
 export function queryTHJPurchaseTradeDetail(params: Model.THJPurchaseTradeDetailReq) {
+    params.userid = userId.value
     return httpRequest<Model.THJPurchaseTradeDetailRsp[]>('/Ferroalloy/QueryTHJPurchaseTradeDetail', 'get', params);
 }
 
@@ -25,6 +31,7 @@ export function queryTHJPurchaseTradeDetail(params: Model.THJPurchaseTradeDetail
  * 查询仓单持有记录
  */
 export function queryHoldLB(params: Model.HoldLBReq) {
+    params.accountid = firstAccountId.value
     return httpRequest<Model.HoldLBRsp[]>('/WrTrade2/QueryHoldLB', 'get', params);
 }
 
@@ -32,6 +39,7 @@ export function queryHoldLB(params: Model.HoldLBReq) {
  * 查询提货申请
  */
 export function queryWrOutInApply(params: Model.WrOutInApplyReq) {
+    params.userid = userId.value
     return httpRequest<Model.WrOutInApplyRsp[]>('/WrTrade2/QueryWrOutInApply', 'get', params);
 }
 
@@ -39,6 +47,7 @@ export function queryWrOutInApply(params: Model.WrOutInApplyReq) {
  * 查询我的推广-推广收益
  */
 export function queryTHJPromotionIncome(params: Model.THJPromotionIncomeReq) {
+    params.userid = userId.value
     return httpRequest<Model.THJPromotionIncomeRsp[]>('/Ferroalloy/QueryTHJPromotionIncome', 'get', params);
 }
 
@@ -46,6 +55,7 @@ export function queryTHJPromotionIncome(params: Model.THJPromotionIncomeReq) {
  * 查询我的推广-推广收益-明细
  */
 export function queryTHJPromotionIncomeDetail(params: Model.THJPromotionIncomeDetailReq) {
+    params.userid = userId.value
     return httpRequest<Model.THJPromotionIncomeDetailRsp[]>('/Ferroalloy/QueryTHJPromotionIncomeDetail', 'get', params);
 }
 
@@ -53,6 +63,7 @@ export function queryTHJPromotionIncomeDetail(params: Model.THJPromotionIncomeDe
  * 查询我的订单-转让/受让订单
  */
 export function queryTHJPurchaseTransferOrder(params: Model.THJPurchaseTransferOrderReq) {
+    params.userid = userId.value
     return httpRequest<Model.THJPurchaseTransferOrderRsp[]>('/Ferroalloy/QueryTHJPurchaseTransferOrder', 'get', params);
 }
 

+ 6 - 5
src/stores/modules/menu.ts

@@ -11,13 +11,14 @@ export const menuStore = createStore({
     },
     actions: {
         /** 获取用户菜单列表 */
-        getUserMenuList() {
-            this.state.loading = true
-            return queryAccountMenu().then((res) => {
+        async getUserMenuList() {
+            try {
+                this.state.loading = true
+                const res = await queryAccountMenu()
                 this.state.userRoutes = res.data
-            }).finally(() => {
+            } finally {
                 this.state.loading = false
-            })
+            }
         },
         /** 重置数据 */
         reset() {

+ 2 - 2
src/types/model/bank.d.ts

@@ -154,7 +154,7 @@ declare namespace Model {
 
     /** 资金流水查询(历史) 请求 */
     interface HisAmountLogReq {
-        accountID: string; // 资金账户 - 格式:1,2,3
+        accountID?: string; // 资金账户 - 格式:1,2,3
         page?: number; // 页码
         pagesize?: number; // 每页条数
         pageflag?: number; // 分页标志 0-page从0开始 1-page从1开始
@@ -224,7 +224,7 @@ declare namespace Model {
         pagesize?: number
         pageflag?: number; // 分页标志 0-page从0开始 1-page从1开始
         // 资金账户 - 格式:1,2,3
-        accountID: string
+        accountID?: string
         // 资金操作类型 - 格式:1,2,3
         OperateType?: string
     }

+ 1 - 1
src/types/model/credit.d.ts

@@ -1,7 +1,7 @@
 declare namespace Model {
     /** 查询我的积分流水 请求 */
     interface UserScoreLogReq {
-        userid: number; // 用户ID
+        userid?: number; // 用户ID
         stype?: number; // [格式:1,2,3] 配置类型 - 1:注册红包 2:签到积分 3:推广积分 4:下级用户下单积分 5:自己采购下单积分 6:自己供求下单积分 7:抽奖配置
         page?: number; // 页码
         pagesize?: number; // 每页条数

+ 2 - 2
src/types/model/goods.d.ts

@@ -147,7 +147,7 @@ declare namespace Model {
     /** 获取我的推广-交易数据 请求 */
     interface THJTradeDataReq {
         /// 用户ID
-        userid: number
+        userid?: number
         /// 市场ID 采购-64201 供求-65201
         marketid: number
         /// 页码
@@ -181,7 +181,7 @@ declare namespace Model {
     /** 获取产品介绍列表 请求 */
     interface THJProductReq {
         /// 用户ID
-        userid: number
+        userid?: number
         /// 关注标志 true-已关注 false-未关注
         favoriteflag?: boolean
         /// 页码

+ 8 - 8
src/types/model/order.d.ts

@@ -6,7 +6,7 @@ declare namespace Model {
         /// 每页条数
         pagesize?: number
         /// 用户id
-        userid: number
+        userid?: number
         /// 仓单贸易市场id
         marketid?: number
         /// 0:仓单预售 1:仓单贸易
@@ -144,7 +144,7 @@ declare namespace Model {
         /// 每页条数
         pagesize?: number
         /// 用户id
-        userid: number
+        userid?: number
         /// 仓单贸易市场id
         marketid?: number
         /// 0:仓单预售 1:仓单贸易
@@ -233,7 +233,7 @@ declare namespace Model {
         /// 每页条数
         pagesize?: number
         /// 用户id
-        userid: number
+        userid?: number
         /// 类型 - 0:未完成 1:已完成
         type?: number
     }
@@ -350,7 +350,7 @@ declare namespace Model {
         /// 每页条数
         pagesize?: number
         /// 资金账号
-        accountid: number
+        accountid?: number
         /// 仓库id
         warehouseid?: number
         /// 品种id
@@ -434,7 +434,7 @@ declare namespace Model {
         /// 每页条数
         pagesize?: number
         /// 用户id
-        userid: number
+        userid?: number
         /// 开始交易日(yyyymmdd)
         begindate?: string
         /// 结束交易日(yyyymmdd)
@@ -514,7 +514,7 @@ declare namespace Model {
         /// 每页条数
         pagesize?: number
         /// 用户id
-        userid: number
+        userid?: number
         /// 状态 - 0:全部 1:已支付 2:未支付
         profitstatus?: number
     }
@@ -542,7 +542,7 @@ declare namespace Model {
         /// 每页条数
         pagesize?: number
         /// 用户id
-        userid: number
+        userid?: number
         /// 月份,格式:yyyymm
         mouth: string
     }
@@ -574,7 +574,7 @@ declare namespace Model {
         /// 每页条数
         pagesize?: number
         /// 用户id
-        userid: number
+        userid?: number
         /// 类型 - 1:转让 2:受让
         ordertype: number
     }