twoDetails.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <route lang="json">
  2. { "style": { "navigationBarTitleText": "", "navigationBarBackgroundColor": "#fff" } }
  3. </route>
  4. <script setup lang="ts">
  5. import { phone, right } from '../../../core/libs/svgs'
  6. import { pageReferrerDetail, getDistributePage, referrerCount } from '../../../core/libs/requests'
  7. import { handleCall } from '../../../core/utils/common'
  8. import { onLoad } from '@dcloudio/uni-app'
  9. import PageHelperEvo from '@/components/page-helper-evo.vue'
  10. import { ComponentExposed } from 'vue-component-type-helpers'
  11. const PageHelperEvoRef = ref<ComponentExposed<typeof PageHelperEvo>>()
  12. const referrerId = ref<number | string>('')
  13. const { data: count, run: setCount } = useRequest(() => referrerCount({ referrerId:referrerId.value }))
  14. const queryReward = computed(() => ({ status: tabsReward.value[tab.value]?.value }))
  15. const queryRecommend = computed(() => (referrerId.value?{ auditStatus: tabsRecommend.value[tab.value]?.value, referrerId:referrerId.value }:{auditStatus: tabsRecommend.value[tab.value]?.value}))
  16. const type = ref("recommend")
  17. const tab = ref(0)
  18. const tabsReward = ref([
  19. {
  20. label: '已完成',
  21. value: "1",
  22. },
  23. {
  24. label: '待入账',
  25. value: "2"
  26. },
  27. {
  28. label: '已取消',
  29. value: "3",
  30. },
  31. ])
  32. const tabsRecommend = ref([
  33. {
  34. label: '已认证',
  35. value: "0",
  36. },
  37. {
  38. label: '审核中',
  39. value: "1"
  40. },
  41. {
  42. label: '未通过',
  43. value: "2",
  44. },
  45. ])
  46. const handleClick = () => {
  47. uni.navigateTo({ url: '/pages-sub/mine/orders/detail/index' })
  48. }
  49. const toSecond = (record) =>{
  50. referrerId.value = record.userId
  51. PageHelperEvoRef.value?.reload()
  52. uni.setNavigationBarTitle({
  53. title:record.name + "的推荐"
  54. })
  55. }
  56. const handleChange = async (value) => {
  57. console.log(value)
  58. }
  59. onLoad(async (options)=>{
  60. console.log(decodeURIComponent(options.str))
  61. let ob = JSON.parse(decodeURIComponent(options.str))
  62. referrerId.value = ob.userId
  63. let res = await setCount();
  64. tabsRecommend.value[0].label = tabsRecommend.value[0].label + "(" +res.onePassCount+ ")"
  65. tabsRecommend.value[1].label = tabsRecommend.value[1].label + "(" +res.oneWaitCount+ ")"
  66. tabsRecommend.value[2].label = tabsRecommend.value[2].label + "(" +res.oneRejectCount+ ")"
  67. uni.setNavigationBarTitle({
  68. title:ob.name + "的推荐"
  69. })
  70. })
  71. </script>
  72. <template>
  73. <view class="flex flex-col">
  74. <PageHelperEvo ref="pageHelperRef" class="flex-grow flex" :request="pageReferrerDetail" :query="type === queryRecommend">
  75. <template #top>
  76. <wd-tabs v-model="tab" @change="handleChange">
  77. <block v-for="({ label }, i) in tabsRecommend" :key="i">
  78. <wd-tab :title="`${label}`" class="relative"></wd-tab>
  79. </block>
  80. </wd-tabs>
  81. </template>
  82. <template #default="{ source }">
  83. <view class="bg-white rounded-[20rpx] mx-[24rpx] mt-[30rpx] px-[20rpx] py-[30rpx]">
  84. <view class="py-[30rpx]" v-for="(it, i) in source.list" :key="i">
  85. <view class="flex items-center pb-[20rpx]" style="border-bottom: 2rpx solid #FAFAFA;">
  86. <view class="rounded-full w-[88rpx] h-[88rpx] overflow-hidden mr-[20rpx]">
  87. <image :src="it.avatar" mode="widthFix"></image>
  88. </view>
  89. <view class="flex-grow text-[32rpx]">{{ it.name }}</view>
  90. </view>
  91. <view class="text-[24rpx] text-[#EF4343] pl-[108rpx] pt-[20rpx] pr-[20rpx]" v-if="it.auditStatus == 2">原因:{{ it.reason }}</view>
  92. </view>
  93. </view>
  94. </template>
  95. </PageHelperEvo>
  96. </view>
  97. </template>