purui 1 week ago
parent
commit
35ac95e719

+ 8 - 0
packages/app/pages.config.ts

@@ -564,6 +564,14 @@ export default defineUniPages({
 			navigationBarBackgroundColor:'#fff'
 		  },
 		},
+		{
+		  path: 'mine/refferrer/twoDetails',
+		  type: 'page',
+		  style: {
+		    navigationBarTitleText: '明细',
+			navigationBarBackgroundColor:'#fff'
+		  },
+		},
       ],
     },
   ],

+ 7 - 5
packages/app/src/pages-sub/mine/refferrer/details.vue

@@ -8,6 +8,7 @@ import { handleCall } from '../../../core/utils/common'
 import { onLoad } from '@dcloudio/uni-app'
 import PageHelperEvo from '@/components/page-helper-evo.vue'
 import { ComponentExposed } from 'vue-component-type-helpers'
+import { domainToUnicode } from 'url'
 
 const PageHelperEvoRef = ref<ComponentExposed<typeof PageHelperEvo>>()
 const referrerId = ref<number | string>('')
@@ -53,11 +54,12 @@ const handleClick = () => {
 }
 
 const toSecond = (record) =>{
-	referrerId.value = record.userId
-	PageHelperEvoRef.value?.reload()
-	uni.setNavigationBarTitle({
-		title:record.name + "的推荐"
-	})
+	let str = encodeURIComponent(JSON.stringify(record))
+	// PageHelperEvoRef.value?.reload()
+	// uni.setNavigationBarTitle({
+	// 	title:record.name + "的推荐"
+	// })
+	uni.navigateTo({ url: '/pages-sub/mine/refferrer/twoDetails?str=' + str })
 }
 
 const handleChange = async (value) => {

+ 100 - 0
packages/app/src/pages-sub/mine/refferrer/twoDetails.vue

@@ -0,0 +1,100 @@
+<route lang="json">
+{ "style": { "navigationBarTitleText": "", "navigationBarBackgroundColor": "#fff" } }
+</route>
+<script setup lang="ts">
+import { phone, right } from '../../../core/libs/svgs'
+import { pageReferrerDetail, getDistributePage } from '../../../core/libs/requests'
+import { handleCall } from '../../../core/utils/common'
+import { onLoad } from '@dcloudio/uni-app'
+import PageHelperEvo from '@/components/page-helper-evo.vue'
+import { ComponentExposed } from 'vue-component-type-helpers'
+
+const PageHelperEvoRef = ref<ComponentExposed<typeof PageHelperEvo>>()
+const referrerId = ref<number | string>('')
+// const { data: referrer, run: setReferrer } = useRequest(() => pageReferrerDetail())
+// const { data: distribute, run: setDistribute } = useRequest(() => getDistributePage())
+const queryReward = computed(() => ({ status: tabsReward.value[tab.value]?.value }))
+const queryRecommend = computed(() => (referrerId.value?{ auditStatus: tabsRecommend.value[tab.value]?.value, referrerId:referrerId.value }:{auditStatus: tabsRecommend.value[tab.value]?.value}))
+
+const type = ref("recommend")
+const tab = ref(0)
+const tabsReward = ref([
+  {
+    label: '已完成',
+    value: "1",
+  },
+  {
+    label: '待入账',
+    value: "2"
+  },
+  {
+    label: '已取消',
+    value: "3",
+  },
+])
+
+const tabsRecommend  = ref([
+  {
+    label: '已认证',
+    value: "0",
+  },
+  {
+    label: '审核中',
+    value: "1"
+  },
+  {
+    label: '未通过',
+    value: "2",
+  },
+])
+
+const handleClick = () => {
+  uni.navigateTo({ url: '/pages-sub/mine/orders/detail/index' })
+}
+
+const toSecond = (record) =>{
+	referrerId.value = record.userId
+	PageHelperEvoRef.value?.reload()
+	uni.setNavigationBarTitle({
+		title:record.name + "的推荐"
+	})
+}
+
+const handleChange = async (value) => {
+  console.log(value)
+}
+
+onLoad((options:object)=>{
+	console.log(decodeURIComponent(options.str))
+	let ob = JSON.parse(decodeURIComponent(options.str))
+	referrerId.value = ob.userId
+	uni.setNavigationBarTitle({
+		title:ob.name + "的推荐"
+	})	
+})
+
+</script>
+<template>
+	<view class="flex flex-col">
+		<PageHelperEvo ref="pageHelperRef" class="flex-grow flex" :request="pageReferrerDetail" :query="type === queryRecommend">
+			<template #top>
+			  <wd-tabs v-model="tab" @change="handleChange">
+			    <block v-for="({ label }, i) in tabsRecommend" :key="i">
+			      <wd-tab :title="`${label}`" class="relative"></wd-tab>
+			    </block>
+			  </wd-tabs>
+			</template>
+			<template #default="{ source }">
+				<view class="bg-white rounded-[20rpx] mx-[24rpx] mt-[30rpx] px-[20rpx] py-[30rpx]">
+					<view class="flex items-center py-[30rpx] relative" v-for="(it, i) in source.list" :key="i" style="border-bottom: 2rpx solid #FAFAFA;">
+						<view class="rounded-full w-[88rpx] h-[88rpx] overflow-hidden mr-[20rpx]">
+							<image :src="it.avatar" mode="widthFix"></image>
+						</view>
+						<view class="flex-grow text-[32rpx]">{{ it.name }}</view>
+						<view class="absolute bottom-0 left-[20%] text-[24rpx] text-[#EF4343]" v-if="it.auditStatus == 2">原因:{{ it.remark }}</view>
+					</view>
+				</view>
+			</template>
+		</PageHelperEvo>
+	</view>
+</template>

+ 8 - 0
packages/app/src/pages.json

@@ -587,6 +587,14 @@
             "navigationBarTitleText": "明细",
             "navigationBarBackgroundColor": "#fff"
           }
+        },
+        {
+          "path": "mine/refferrer/twoDetails",
+          "type": "page",
+          "style": {
+            "navigationBarTitleText": "明细",
+            "navigationBarBackgroundColor": "#fff"
+          }
         }
       ]
     }

+ 2 - 1
packages/app/src/types/uni-pages.d.ts

@@ -76,7 +76,8 @@ interface NavigateToOptions {
        "/pages-sub/mine/setting/mobile/modify/index" |
        "/pages-sub/mine/refferrer/index" |
        "/pages-sub/mine/refferrer/rule" |
-       "/pages-sub/mine/refferrer/details";
+       "/pages-sub/mine/refferrer/details" |
+       "/pages-sub/mine/refferrer/twoDetails";
 }
 interface RedirectToOptions extends NavigateToOptions {}
 

+ 4 - 2
packages/merchant/src/pages/mine/refferrer/details.vue

@@ -54,8 +54,10 @@ const handleClick = () => {
 }
 
 const toSecond = (record) =>{
-	referrerId.value = record.userId
-	PageHelperEvoRef.value?.reload()
+	// referrerId.value = record.userId
+	// PageHelperEvoRef.value?.reload()
+	let str = encodeURIComponent(JSON.stringify(record))
+	uni.navigateTo({ url: '/pages/mine/refferrer/twoDetails?str=' + str })
 }
 
 const handleChange = async (value) => {

+ 100 - 0
packages/merchant/src/pages/mine/refferrer/twoDetails.vue

@@ -0,0 +1,100 @@
+<route lang="json">
+{ "style": { "navigationBarTitleText": "", "navigationBarBackgroundColor": "#fff" } }
+</route>
+<script setup lang="ts">
+import { phone, right } from '../../../core/libs/svgs'
+import { pageReferrerDetail, getDistributePage } from '../../../core/libs/requests'
+import { handleCall } from '../../../core/utils/common'
+import { onLoad } from '@dcloudio/uni-app'
+import PageHelperEvo from '@/components/page-helper-evo.vue'
+import { ComponentExposed } from 'vue-component-type-helpers'
+
+const PageHelperEvoRef = ref<ComponentExposed<typeof PageHelperEvo>>()
+const referrerId = ref<number | string>('')
+// const { data: referrer, run: setReferrer } = useRequest(() => pageReferrerDetail())
+// const { data: distribute, run: setDistribute } = useRequest(() => getDistributePage())
+const queryReward = computed(() => ({ status: tabsReward.value[tab.value]?.value }))
+const queryRecommend = computed(() => (referrerId.value?{ auditStatus: tabsRecommend.value[tab.value]?.value, referrerId:referrerId.value }:{auditStatus: tabsRecommend.value[tab.value]?.value}))
+
+const type = ref("recommend")
+const tab = ref(0)
+const tabsReward = ref([
+  {
+    label: '已完成',
+    value: "1",
+  },
+  {
+    label: '待入账',
+    value: "2"
+  },
+  {
+    label: '已取消',
+    value: "3",
+  },
+])
+
+const tabsRecommend  = ref([
+  {
+    label: '已认证',
+    value: "0",
+  },
+  {
+    label: '审核中',
+    value: "1"
+  },
+  {
+    label: '未通过',
+    value: "2",
+  },
+])
+
+const handleClick = () => {
+  uni.navigateTo({ url: '/pages-sub/mine/orders/detail/index' })
+}
+
+const toSecond = (record) =>{
+	referrerId.value = record.userId
+	PageHelperEvoRef.value?.reload()
+	uni.setNavigationBarTitle({
+		title:record.name + "的推荐"
+	})
+}
+
+const handleChange = async (value) => {
+ console.log(value)
+}
+
+onLoad((options:object)=>{
+	console.log(decodeURIComponent(options.str))
+	let ob = JSON.parse(decodeURIComponent(options.str))
+	referrerId.value = ob.userId
+	uni.setNavigationBarTitle({
+		title:ob.name + "的推荐"
+	})	
+})
+
+</script>
+<template>
+	<view class="flex flex-col">
+		<PageHelperEvo ref="pageHelperRef" class="flex-grow flex" :request="pageReferrerDetail" :query="type === queryRecommend">
+			<template #top>
+			  <wd-tabs v-model="tab" @change="handleChange">
+			    <block v-for="({ label }, i) in tabsRecommend" :key="i">
+			      <wd-tab :title="`${label}`" class="relative"></wd-tab>
+			    </block>
+			  </wd-tabs>
+			</template>
+			<template #default="{ source }">
+				<view class="bg-white rounded-[20rpx] mx-[24rpx] mt-[30rpx] px-[20rpx] py-[30rpx]">
+					<view class="flex items-center py-[30rpx] relative" v-for="(it, i) in source.list" :key="i" style="border-bottom: 2rpx solid #FAFAFA;">
+						<view class="rounded-full w-[88rpx] h-[88rpx] overflow-hidden mr-[20rpx]">
+							<image :src="it.avatar" mode="widthFix"></image>
+						</view>
+						<view class="flex-grow text-[32rpx]">{{ it.name }}</view>
+						<view class="absolute bottom-0 left-[20%] text-[24rpx] text-[#EF4343]" v-if="it.auditStatus == 2">原因:{{ it.remark }}</view>
+					</view>
+				</view>
+			</template>
+		</PageHelperEvo>
+	</view>
+</template>