purui 2 weeks ago
parent
commit
887855a113

+ 1 - 0
packages/app/src/core/libs/message-types.ts

@@ -88,6 +88,7 @@ export const messageTypes = [
   { subType: 35, desc: '点赞评论', path: '/pages-sub/home/moment/index' },
   { subType: 36, desc: '分享', path: '/pages-sub/home/moment/index' },
   { subType: 37, desc: '积分抽奖' },
+  { subType: 38, desc: '引荐加成奖励', path: '/pages-sub/mine/refferrer/details?type=reward' },
 ]
 export const getMessageType = (subType: number) =>
   messageTypes.find((item) => item.subType === subType)

+ 10 - 2
packages/app/src/pages-sub/mine/refferrer/details.vue

@@ -7,11 +7,14 @@ import { pageReferrerDetail, getDistributePage } from '../../../core/libs/reques
 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(() => ({ auditStatus: tabsRecommend.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)
@@ -49,6 +52,11 @@ const handleClick = () => {
   uni.navigateTo({ url: '/pages-sub/mine/orders/detail/index' })
 }
 
+const toSecond = (record) =>{
+	referrerId.value = record.referrerId
+	PageHelperEvoRef.value?.reload()
+}
+
 const handleChange = async (value) => {
   if(type.value === "recommend"){
 	  let tab1 = tabsRecommend.value[value.index]
@@ -97,7 +105,7 @@ onLoad((options:object)=>{
 							<image :src="it.avatar" mode="widthFix"></image>
 						</view>
 						<view class="flex-grow text-[32rpx]">{{ it.name }}</view>
-						<view class="text-[#586A8F] text-[28rpx]" v-if="it.auditStatus === 0">推荐人数:{{ it.referrerCount }}</view>
+						<view class="text-[#586A8F] text-[28rpx]" v-if="it.auditStatus === 0 && !referrerId" @click="toSecond(it)">推荐人数:{{ it.referrerCount }}</view>
 						<view class="absolute bottom-0 left-[20%] text-[24rpx] text-[#EF4343]" v-if="it.auditStatus == 2">原因:{{ it.remark }}</view>
 					</view>
 				</view>

+ 8 - 1
packages/app/src/pages-sub/mine/refferrer/index.vue

@@ -12,6 +12,13 @@ const { data: pointsSum, run: setPointsSum} = useRequest(() => distributePointsS
 const handleClick = (path) => {
   uni.navigateTo({ url: path })
 }
+const tips = () =>{
+	uni.showToast({
+		title:"推荐的设计师,有未完成的订单,订单完成后即可获得",
+		icon:"none",
+		duration:3000
+	})
+}
 onMounted(async () => {
   await setCount();
   await setPointsSum();
@@ -71,7 +78,7 @@ onMounted(async () => {
 		  </view>
 		  <view class="bg-[#F2F2F2] flex px-[32rpx] py-[10rpx] text-[24rpx] text-black/40 rounded-full items-center">
 			  <text class="mr-[10rpx]">待入账:{{ pointsSum.waitPoints }}积分</text>
-			  <icon type="info_circle" size="16" color="#999"></icon>
+			  <icon @click="tips" type="info_circle" size="16" color="#999"></icon>
 		  </view>	  
 	  </view>
 	  <div class="flex">

+ 2 - 2
packages/app/src/pages-sub/mine/refferrer/rule.vue

@@ -18,10 +18,10 @@ onLoad(()=>{
 </script>
 <template>
 	<div class="px-[24rpx] py-[34rpx]">
-		<view class="flex mb-[30rpx]">
+		<!-- <view class="flex mb-[30rpx]">
 			<icon type="info_circle" size="22" color="#000000"></icon>
 			<text class="ml-[10rpx]">如何获得引荐加成奖励</text>
-		</view>
+		</view> -->
 		<view class="mb-[40rpx]" v-if="distribute && distribute.details">
 			<rich-text :nodes="distribute.details"></rich-text>
 		</view>

+ 1 - 0
packages/app/src/pages/messages/components/message-card.vue

@@ -55,6 +55,7 @@ const init = async () => {
 }
 const handleJump = () => {
   fuckYou({ id: props.options.id })
+  console.log(props.options.linkUrl)
   if ((props.options.linkUrl ?? '') !== '') {
     return router.push(props.options.linkUrl)
   }

+ 11 - 0
packages/merchant/src/core/libs/requests.ts

@@ -250,3 +250,14 @@ export const getByDictType = (
       status: number
     }[]
   >('/app-api/system/dict-data/type', { type })
+export const getDistribute = () =>
+  httpGet<string>('/app-api/member/distribute/getDistribute')  
+export const referrerCount = () =>
+  httpGet<string>('/app-api/member/distribute/referrerCount')
+export const distributePointsSum = () =>
+  httpGet<string>('/app-api/member/distribute/distributePointsSum')
+export const pageReferrerDetail = (query) =>
+  httpGet('/app-api/member/distribute/pageReferrerDetail', query)  
+export const getDistributePage = (query) =>
+  httpGet('/app-api/member/distribute/getAppDistributeParticularPage', query)     
+  

+ 129 - 0
packages/merchant/src/pages/mine/refferrer/details.vue

@@ -0,0 +1,129 @@
+<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'
+
+// 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(() => ({ 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 handleChange = async (value) => {
+  if(type.value === "recommend"){
+	  let tab1 = tabsRecommend.value[value.index]
+	  console.log(tab1)
+  }else{
+	  let tab1 = tabsReward.value[value.index]
+	  console.log(tab1)
+  }
+}
+
+onLoad((options:object)=>{
+	if(options?.type === "recommend"){
+		uni.setNavigationBarTitle({
+			title:"我的推荐"
+		})		
+	}else{
+		uni.setNavigationBarTitle({
+			title:"奖励明细"
+		})
+	}
+	type.value = options?.type
+})
+
+</script>
+<template>
+	<view class="flex flex-col">
+		<PageHelperEvo ref="pageHelperRef" class="flex-grow flex" :request="type === 'recommend'?pageReferrerDetail:getDistributePage" :query="type === 'recommend'?queryRecommend:queryReward">
+			<template #top>
+			  <wd-tabs v-model="tab" @change="handleChange">
+			    <block v-if="type === 'recommend'">
+					<block v-for="({ label }, i) in tabsRecommend" :key="i">
+					  <wd-tab :title="`${label}`" class="relative"></wd-tab>
+					</block>
+				</block>
+				<block v-else-if="type === 'reward'">
+					<block v-for="({ label }, i) in tabsReward" :key="i">
+					  <wd-tab :title="`${label}`" class="relative"></wd-tab>
+					</block>
+				</block>
+			  </wd-tabs>
+			</template>
+			<template #default="{ source }">
+				<view class="bg-white rounded-[20rpx] mx-[24rpx] mt-[30rpx] px-[20rpx] py-[30rpx]" v-if="type === 'recommend'">
+					<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="text-[#586A8F] text-[28rpx]" v-if="it.auditStatus === 0">推荐人数:{{ it.referrerCount }}</view>
+						<view class="absolute bottom-0 left-[20%] text-[24rpx] text-[#EF4343]" v-if="it.auditStatus == 2">原因:{{ it.remark }}</view>
+					</view>
+				</view>
+				<view class="bg-white rounded-[20rpx] mx-[24rpx] mt-[30rpx] px-[20rpx] py-[30rpx]" v-else>
+					<view class="flex flex-col mb-[30rpx]" v-for="(it, i) in source.list" :key="i" style="border-bottom: 2rpx solid #FAFAFA;">
+						<view class="flex items-center">
+							<view class="rounded-full w-[88rpx] h-[88rpx] overflow-hidden mr-[20rpx]">
+								<image :src="it.userAvatar" mode="widthFix"></image>
+							</view>
+							<view class="flex-grow">
+								<view class="flex items-center">
+									<view class="text-[32rpx] mr-[12rpx]">{{ it.userName }}</view>
+									<view class="text-[20rpx] bg-[#F6F6F6] rounded-full text-black/40 px-[14rpx] py-[6rpx]" v-if=" it.distributeType==1 ">一级奖励</view>
+									<view class="text-[20rpx] bg-[#F6F6F6] rounded-full text-black/40 px-[14rpx] py-[6rpx]" v-else>二级奖励</view>
+								</view>
+								<view class="text-black/30">{{ it.completeTime }}</view>
+							</view>
+							<view class="text-[#EF4343] text-[32rpx]">+{{ it.onePoints }}(*{{ it.oneRatio }})</view>
+						</view>
+						<view class="flex py-[40rpx] justify-between text-black/60 text-[24rpx]">
+							<text>{{ it.pointsName }}</text>
+							<text>消耗积分:{{ it.points }}</text>
+						</view>
+					</view>
+				</view>
+			</template>
+		</PageHelperEvo>
+	</view>
+</template>

+ 93 - 0
packages/merchant/src/pages/mine/refferrer/index.vue

@@ -0,0 +1,93 @@
+<route lang="json">
+{ "style": { "navigationBarTitleText": "引荐奖励", "navigationBarBackgroundColor": "#fff" } }
+</route>
+<script setup lang="ts">
+import Card from '@/components/card.vue'
+import { phone, right } from '../../../core/libs/svgs'
+import { referrerCount, distributePointsSum } from '../../../core/libs/requests'
+import { handleCall } from '../../../core/utils/common'
+
+const { data: count, run: setCount } = useRequest(() => referrerCount())
+const { data: pointsSum, run: setPointsSum} = useRequest(() => distributePointsSum())
+const handleClick = (path) => {
+  uni.navigateTo({ url: path })
+}
+onMounted(async () => {
+  await setCount();
+  await setPointsSum();
+})
+</script>
+<template>
+  <div class="px-[24rpx] py-[34rpx]">
+	<view class="bg-white rounded-[32rpx] px-[24rpx] pt-[34rpx] pb-[60rpx] mb-[30rpx]">
+	  <view class="flex items-center justify-between mb-[60rpx] border-b-1 pb-[20rpx]">
+		  <view class="text-[36rpx] font-bold">我的推荐</view>
+		  <view class="text-[28rpx] text-black/40" @click="handleClick('/pages-sub/mine/refferrer/details?type=recommend')">
+			  <text>查看明细</text>
+			  <wd-img :src="right" width="12" height="12"></wd-img>
+		  </view>
+	  </view>
+	  <view class="flex items-start justify-between mb-[40rpx]">
+		  <view class="">
+			  <view class="text-[56rpx] font-bold mb-[12rpx]">{{ count.onePassCount }}</view>
+			  <view class="text-[28rpx] text-black/40 ">认证设计师 (人)</view>
+		  </view>
+		  <view class="bg-[#F2F2F2] flex px-[32rpx] py-[10rpx] text-[24rpx] text-black/40 rounded-full items-center">
+			  <text class="mr-[10rpx]">二级推荐:{{ count.twoPassCount }}人</text>
+			  <icon type="info_circle" size="16" color="#999"></icon>
+		  </view>
+	  </view>
+	  <view class="flex justify-between">
+		  <view class="rounded-[8rpx] shadow-[0_4rpx_10rpx_4rpx_rgba(0,0,0,0.1)] relative min-w-[260rpx] h-[60rpx] line-height-[60rpx] overflow-hidden">
+			  <view class="w-[10rpx] h-full absolute bg-[#0CBE7D] left-0 top-0"></view>
+			  <view class="w-full text-center text-[24rpx] text-black/60">
+				  <text>审核中</text>
+				  <text class="text-[32rpx] text-black">{{ count.oneWaitCount }}</text>
+				  <text>人</text>
+			  </view>
+		  </view>
+		  <view class="rounded-[8rpx] shadow-[0_4rpx_10rpx_4rpx_rgba(0,0,0,0.1)] relative min-w-[260rpx] h-[60rpx] line-height-[60rpx] overflow-hidden">
+			  <view class="w-[10rpx] h-full absolute bg-[#FFCF82] left-0 top-0"></view>
+			  <view class="w-full text-center text-[24rpx] text-black/60 ">
+				  <text>未通过</text>
+				  <text class="text-[32rpx] text-black px-[6rpx]">{{ count.oneRejectCount }}</text>
+				  <text>人</text>
+			  </view>
+		  </view>
+	  </view>
+	</view>
+	<view class="bg-white rounded-[32rpx] px-[24rpx] pt-[34rpx] pb-[60rpx] mb-[30rpx]">
+	  <view class="flex items-center justify-between mb-[60rpx] border-b-1 pb-[20rpx]">
+		  <view class="text-[36rpx] font-bold">引荐加成奖励</view>
+		  <view class="text-[28rpx] text-black/40" @click="handleClick('/pages-sub/mine/refferrer/details?type=reward')">
+			  <text>查看明细</text>
+			  <wd-img :src="right" width="12" height="12"></wd-img>
+		  </view>
+	  </view>
+	  <view class="flex items-start justify-between mb-[40rpx]">
+		  <view class="">
+			  <view class="text-[56rpx] font-bold mb-[12rpx]">{{ pointsSum.passPoints }}</view>
+			  <view class="text-[28rpx] text-black/40 ">已获得总积分</view>
+		  </view>
+		  <view class="bg-[#F2F2F2] flex px-[32rpx] py-[10rpx] text-[24rpx] text-black/40 rounded-full items-center">
+			  <text class="mr-[10rpx]">待入账:{{ pointsSum.waitPoints }}积分</text>
+			  <icon type="info_circle" size="16" color="#999"></icon>
+		  </view>	  
+	  </view>
+	  <div class="flex">
+		<div class="w-[50%]">
+			<div class="text-[32rpx] font-bold">{{ pointsSum.onePassPoints }}</div>
+			<div class="text-[24rpx] text-black/60">一级引荐奖励积分</div>
+		</div>
+		<div class="w-[50%]">
+			<div class="text-[32rpx] font-bold">{{ pointsSum.twoPassPoints }}</div>
+			<div class="text-[24rpx] text-black/60">二级引荐奖励积分</div>
+		</div>
+	  </div>
+	</view>
+	<view class="flex bg-white rounded-[32rpx] px-[24rpx] py-[34rpx]" @click="handleClick('/pages-sub/mine/refferrer/rule')">
+		<view class="text-[32rpx] flex-grow">引荐奖励规则</view>
+		<icon type="info_circle" size="22" color="#999"></icon>
+	</view>
+  </div>
+</template>

+ 43 - 0
packages/merchant/src/pages/mine/refferrer/rule.vue

@@ -0,0 +1,43 @@
+<route lang="json5">
+{ "style": { "navigationBarTitleText": "规则说明", "navigationBarBackgroundColor": "#fff" } }
+</route>
+<script setup lang="ts">
+import { phone, right } from '../../../core/libs/svgs'
+import { getDistribute } from '../../../core/libs/requests'
+import { handleCall } from '../../../core/utils/common'
+import { onLoad } from '@dcloudio/uni-app'
+
+const { data: distribute, run: setDistribute } = useRequest(() => getDistribute())
+const handleClick = () => {
+  uni.navigateTo({ url: '/pages-sub/mine/orders/detail/index' })
+}
+onLoad(()=>{
+	setDistribute()
+})
+
+</script>
+<template>
+	<div class="px-[24rpx] py-[34rpx]">
+		<view class="flex mb-[30rpx]">
+			<icon type="info_circle" size="22" color="#000000"></icon>
+			<text class="ml-[10rpx]">如何获得引荐加成奖励</text>
+		</view>
+		<view class="mb-[40rpx]" v-if="distribute && distribute.details">
+			<rich-text :nodes="distribute.details"></rich-text>
+		</view>
+		<view class="rounded-[30rpx] overflow-hidden" style="border: 2rpx solid #B18A57;" v-if="distribute && distribute.distributeList.length > 0">
+			<view class="flex w-full text-center py-[20rpx] bg-[#FFFCF6]">
+				<view class="w-[33%] text-[28rpx] text-[#BC8647]">会员等级</view>
+				<view class="w-[33%] text-[28rpx] text-[#BC8647]">一级奖励</view>
+				<view class="w-[33%] text-[28rpx] text-[#BC8647]">二级奖励</view>
+			</view>
+			<block v-for="(it,i) in distribute.distributeList" :key="i">
+				<view class="flex w-full text-center py-[20rpx] bg-[#FFFCF6]">
+					<view class="w-[33%] text-[28rpx] text-[#BC8647]">{{ it.levelName }}</view>
+					<view class="w-[33%] text-[28rpx] text-[#BC8647]">{{ it.oneRatio }}%</view>
+					<view class="w-[33%] text-[28rpx] text-[#BC8647]">{{ it.twoRatio }}%</view>
+				</view>
+			</block>
+		</view>
+	</div>
+</template>