Przeglądaj źródła

Merge branch 'main' of https://github.com/omnia96/designer-hub

Jake 2 miesięcy temu
rodzic
commit
fda9c983ed

+ 75 - 5
packages/app/src/pages/common/components/honor-dialog/honor-dialog.vue

@@ -1,11 +1,16 @@
 <script setup lang="ts">
 import { close } from '../../../../core/libs/svgs'
-import { HonorDialogOptions, HonorDialogSymbol } from '.'
+import { HonorDialogOptions, HonorDialogSymbol, HonorDialogType } from '.'
 import earnBadgeTitle from '@designer-hub/assets/src/libs/assets/earnBadgeTitle'
 import radiation from '@designer-hub/assets/src/libs/assets/radiation'
 import { NetImages } from '@/core/libs/net-images'
 import { ConfigProviderThemeVars } from 'wot-design-uni'
 import { useRouter } from '@/core/utils/router'
+import earnCertificate from '@designer-hub/assets/src/libs/assets/earnCertificate'
+import envelopeFront from '@designer-hub/assets/src/libs/assets/envelopeFront'
+import envelopeBack from '@designer-hub/assets/src/libs/assets/envelopeBack'
+import ribbonTl from '@designer-hub/assets/src/libs/assets/ribbonTl'
+import ribbonBr from '@designer-hub/assets/src/libs/assets/ribbonBr'
 
 const dialogOption = inject(HonorDialogSymbol, ref<HonorDialogOptions>({}))
 const { push } = useRouter()
@@ -20,6 +25,8 @@ const path = ref('')
 const src = ref(
   'https://image.zhuchaohui.com/zhucaohui/e104215c64d39e4a0f8676c48b8e7221c891eade1c8d7f02b2a7f0be862e3f76.png',
 )
+const isBadge = computed(() => dialogOption.value?.type === HonorDialogType.Badge)
+const isCertificate = computed(() => dialogOption.value?.type === HonorDialogType.Certificate)
 const reset = (option) => {
   if (option) {
     modelValue.value = option.show
@@ -37,6 +44,7 @@ const jumpTo = () => {
   if (dialogOption.value?.type && dialogOption.value?.type === 'badge') {
     push('/pages/mine/honors/index?active=badge')
   }
+  modelValue.value = false
 }
 const handleLoad = () => {
   console.log(1111)
@@ -60,14 +68,18 @@ watch(
       custom-class="bg-transparent! bg-[#f6f6f6]!"
     >
       <div class="flex flex-col items-center relative">
-        <wd-img width="60vw" mode="widthFix" :src="earnBadgeTitle"></wd-img>
-        <div class="w-[100vw] h-[68vw] pt-2 flex">
+        <wd-img
+          width="60vw"
+          mode="widthFix"
+          :src="isBadge ? earnBadgeTitle : earnCertificate"
+        ></wd-img>
+        <div v-if="isBadge" class="w-[100vw] h-[68vw] pt-2 flex">
           <div class="w-100vw h-100vw absolute left-0 right-0 top--8">
             <wd-img
+              v-if="isBadge"
               custom-class="absolute! top-50% left-50% translate-[-50%,-50%] vertical-bottom"
               width="68%"
               height="68%"
-              @load="handleLoad"
               :src="radiation"
             ></wd-img>
             <wd-img
@@ -77,20 +89,77 @@ watch(
               :src="NetImages.Stars"
             ></wd-img>
             <wd-img
+              v-if="isBadge"
               custom-class="absolute! ma-a top-50% left-50% translate-[-50%,-50%]  vertical-bottom blur-60"
               width="40vw"
               mode="widthFix"
               :src="src"
             ></wd-img>
             <wd-img
+              v-if="isBadge"
               custom-class="absolute! ma-a top-50% left-50% translate-[-50%,-50%]  vertical-bottom"
               width="40vw"
               mode="widthFix"
+              @load="handleLoad"
               :src="src"
             ></wd-img>
           </div>
         </div>
-        <div class="text-center">
+        <div v-if="isCertificate" class="relative mb-16">
+          <wd-img
+            v-if="isCertificate"
+            custom-class="absolute! bottom-0 left-7.5vw vertical-bottom"
+            width="85%"
+            mode="widthFix"
+            :src="envelopeBack"
+          ></wd-img>
+          <wd-img
+            custom-class="absolute! left-12 top--4 vertical-bottom"
+            width="58vw"
+            mode="widthFix"
+            :src="NetImages.Stars"
+          ></wd-img>
+          <div class="w-[100vw] center">
+            <wd-img
+              v-if="isCertificate"
+              custom-class="mt-9.5 mb-22 vertical-bottom"
+              width="80vw"
+              mode="widthFix"
+              @load="handleLoad"
+              :src="src"
+            ></wd-img>
+          </div>
+          <wd-img custom-class="absolute! top-0 left-0" width="114" height="114" :src="ribbonTl" />
+          <wd-img
+            v-if="isCertificate"
+            custom-class="absolute! bottom-0 left-7.5vw vertical-bottom"
+            width="85vw"
+            mode="widthFix"
+            :src="envelopeFront"
+          ></wd-img>
+          <wd-img
+            custom-class="absolute! bottom-0 right-0"
+            width="76"
+            height="56"
+            :src="ribbonBr"
+          />
+          <div class="absolute bottom-0 left-50% translate-[-50%,-50%]">
+            <div
+              class="w-[115.50px] h-[41.16px] bg-gradient-to-r from-[#f2b36f] to-[#ce995c] rounded-[28.68px] flex center"
+              @click="jumpTo"
+            >
+              <div
+                class="w-[110.71px] h-[37.17px] bg-gradient-to-r from-[#f1bf84] to-[#e6c99f] rounded-[28.19px] shadow shadow-inner flex center"
+              >
+                <div class="text-center text-[#242323] text-base font-normal font-['PingFang SC']">
+                  去查看
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+
+        <div v-if="isBadge" class="text-center">
           <div class="text-white text-2xl font-normal font-['PingFang_SC'] uppercase">
             {{ title }}
           </div>
@@ -99,6 +168,7 @@ watch(
           </div>
         </div>
         <div
+          v-if="isBadge"
           class="my-10 w-[155px] px-5 py-2.5 rounded-full border border-solid border-[#c8beab] justify-center items-center gap-1 inline-flex"
         >
           <div

+ 5 - 1
packages/app/src/pages/common/components/honor-dialog/index.ts

@@ -4,11 +4,15 @@ export interface DialogShowOptions {
   path: string
   image: string
 }
+export enum HonorDialogType {
+  Badge = 'badge',
+  Certificate = 'certificate',
+}
 export interface HonorDialogOptions {
   title?: string
   content?: string
   image?: string
-  type?: 'badge' | 'certificate'
+  type?: HonorDialogType
   onLoad?: () => void
 }
 // export const HonorDialogSymbol: InjectionKey<{

+ 3 - 3
packages/app/src/pages/home/activity/detail/index.vue

@@ -471,9 +471,9 @@ onShareTimeline(() => ({ title: data.value.name, imageUrl: data.value.thumbnailU
                 {{ data.needPointsCount || 0 }}
               </div>
               <div class="text-black/40 text-sm font-normal font-['PingFang_SC']">积分</div>
-              <div class="ml-1 text-black/40 text-xs font-normal font-['PingFang_SC']">
-                剩余:{{ remainedCount || 0 }}
-              </div>
+              <!--              <div class="ml-1 text-black/40 text-xs font-normal font-['PingFang_SC']">-->
+              <!--                剩余:{{ remainedCount || 0 }}-->
+              <!--              </div>-->
               <div class="flex-1"></div>
             </div>
           </div>

+ 27 - 9
packages/app/src/pages/home/index.vue

@@ -19,6 +19,7 @@ import Menus from './components/menus.vue'
 import {
   getActivities,
   getBadges,
+  getCertificates,
   getCircles,
   getMyStudyTours,
   getSetIndexConfigs,
@@ -42,7 +43,7 @@ import PageHelperEvo from '@/components/page-helper-evo.vue'
 import { useMessage } from 'wot-design-uni'
 import ShareActionSheet from '@/pages/common/components/share-action-sheet.vue'
 import { useShare } from '@/composables/share'
-import { useHonorDialog } from '@/pages/common/components/honor-dialog'
+import { HonorDialogType, useHonorDialog } from '@/pages/common/components/honor-dialog'
 
 defineOptions({
   name: 'Home',
@@ -129,19 +130,36 @@ onLoad(async () => {
     data: it,
   }))
   const { data: badgeData } = await getBadges({})
+  const { data: certificates } = await getCertificates()
+  console.log(certificates)
   const badges = Object.values(badgeData)
     .flat()
     .filter((it) => !it.popUp && it.quantity)
-  console.log(badges)
-  // const option = {};
-  if (badges.length) {
+  const honors = [
+    ...badges.map((it) => ({
+      type: HonorDialogType.Badge,
+      title: it.badgeName,
+      content: it.badgeDescription,
+      image: it.badgeYesObtainedImage,
+    })),
+    ...certificates.map((it) => ({
+      type: HonorDialogType.Certificate,
+      title: it.certificateName,
+      content: it.certificateDescription,
+      image: it.certificateImage,
+    })),
+  ]
+  // console.log(honors)
+  // console.log(badges)
+  if (honors.length) {
+    const honor = honors[0]
     await show({
-      title: badges[0].badgeName,
-      content: badges[0].badgeDescription,
-      image: badges[0].badgeYesObtainedImage,
-      type: 'badge',
+      title: honor.title ?? ' ',
+      content: honor.content ?? ' ',
+      image: honor.image,
+      type: honor.type,
       onLoad: async () => {
-        // await updateHonorPopUp({ bizId: String(badges[0].id), bizType: '1' })
+        await updateHonorPopUp({ bizId: String(badges[0].id), bizType: '1' })
       },
     })
   }

+ 4 - 1
packages/app/src/pages/mine/points/index.vue

@@ -58,7 +58,10 @@ const { userInfo } = storeToRefs(userStore)
         </wd-datetime-picker>
       </div>
       <Card custom-class="relative">
-        <PageHelper :request="getPoints" :query="{ stylistId: userInfo.userId, year: dayjs(year).toDate().getFullYear() }">
+        <PageHelper
+          :request="getPoints"
+          :query="{ stylistId: userInfo.userId, year: dayjs(year).toDate().getFullYear() }"
+        >
           <template #default="{ source }">
             <div class="flex flex-col gap-4">
               <template v-for="(it, i) in source.list" :key="i">

Plik diff jest za duży
+ 1 - 0
packages/assets/src/assets/earnCertificate.svg


+ 3 - 0
packages/assets/src/assets/envelope-back.svg

@@ -0,0 +1,3 @@
+<svg width="320" height="249" viewBox="0 0 320 249" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M0.736328 45.4466C0.736328 38.6623 5.49062 32.8064 12.1302 31.4126L157.382 0.921172C159.324 0.513326 161.331 0.513324 163.274 0.921171L308.525 31.4126C315.165 32.8064 319.919 38.6623 319.919 45.4466V233.875C319.919 241.795 313.499 248.215 305.579 248.215H15.0762C7.15652 248.215 0.736328 241.795 0.736328 233.875V45.4466Z" fill="#201F1E"/>
+</svg>

+ 25 - 0
packages/assets/src/assets/envelope-front.svg

@@ -0,0 +1,25 @@
+<svg width="320" height="142" viewBox="0 0 320 142" fill="none" xmlns="http://www.w3.org/2000/svg">
+    <path d="M0.736328 0.507812L155.725 53.0295C158.71 54.041 161.945 54.041 164.93 53.0295L319.919 0.507812V124.003C319.919 131.923 313.499 138.343 305.579 138.343H15.0762C7.15652 138.343 0.736328 131.923 0.736328 124.003V0.507812Z" fill="url(#paint0_linear_3438_1011)"/>
+    <path d="M0.736328 3.37891L155.725 55.9006C158.71 56.912 161.945 56.9121 164.93 55.9006L319.919 3.37891V126.874C319.919 134.794 313.499 141.214 305.579 141.214H15.0762C7.15652 141.214 0.736328 134.794 0.736328 126.874V3.37891Z" fill="url(#paint1_linear_3438_1011)"/>
+    <path d="M136.201 37.0155C150.196 25.7588 170.139 25.7588 184.135 37.0155L305.108 134.318C307.217 136.015 306.018 139.421 303.31 139.421H17.0254C14.3181 139.421 13.1183 136.015 15.2279 134.318L136.201 37.0155Z" fill="url(#paint2_linear_3438_1011)"/>
+    <path d="M136.201 38.9296C150.196 27.6728 170.139 27.6728 184.135 38.9296L305.108 136.232C307.217 137.929 306.018 141.335 303.31 141.335H17.0254C14.3181 141.335 13.1183 137.929 15.2279 136.232L136.201 38.9296Z" fill="url(#paint3_linear_3438_1011)"/>
+    <defs>
+        <linearGradient id="paint0_linear_3438_1011" x1="0.73633" y1="9.36182" x2="319.919" y2="9.36183" gradientUnits="userSpaceOnUse">
+            <stop stop-color="#ECBD73"/>
+            <stop offset="0.504263" stop-color="#E0D3AD"/>
+            <stop offset="1" stop-color="#ECBD73"/>
+        </linearGradient>
+        <linearGradient id="paint1_linear_3438_1011" x1="160.328" y1="-68.4104" x2="160.328" y2="141.214" gradientUnits="userSpaceOnUse">
+            <stop stop-color="#3C3B39"/>
+            <stop offset="1" stop-color="#1E1C1E"/>
+        </linearGradient>
+        <linearGradient id="paint2_linear_3438_1011" x1="160.328" y1="27.0709" x2="160.328" y2="139.301" gradientUnits="userSpaceOnUse">
+            <stop stop-color="#F2C173"/>
+            <stop offset="0.995868" stop-color="#202020" stop-opacity="0.6"/>
+        </linearGradient>
+        <linearGradient id="paint3_linear_3438_1011" x1="160.407" y1="30.1814" x2="160.169" y2="141.335" gradientUnits="userSpaceOnUse">
+            <stop stop-color="#333333"/>
+            <stop offset="1" stop-color="#201F1E"/>
+        </linearGradient>
+    </defs>
+</svg>

BIN
packages/assets/src/assets/ribbon-br.png


BIN
packages/assets/src/assets/ribbon-tl.png


+ 2 - 0
packages/assets/src/libs/assets/earnCertificate.ts

@@ -0,0 +1,2 @@
+import earnCertificate from '../../assets/earnCertificate.svg' 
+ export default earnCertificate

+ 2 - 0
packages/assets/src/libs/assets/envelopeBack.ts

@@ -0,0 +1,2 @@
+import envelopeBack from '../../assets/envelope-back.svg' 
+ export default envelopeBack

+ 2 - 0
packages/assets/src/libs/assets/envelopeFront.ts

@@ -0,0 +1,2 @@
+import envelopeFront from '../../assets/envelope-front.svg' 
+ export default envelopeFront

+ 2 - 0
packages/assets/src/libs/assets/ribbonBr.ts

@@ -0,0 +1,2 @@
+import ribbonBr from '../../assets/ribbon-br.png' 
+ export default ribbonBr

+ 2 - 0
packages/assets/src/libs/assets/ribbonTl.ts

@@ -0,0 +1,2 @@
+import ribbonTl from '../../assets/ribbon-tl.png' 
+ export default ribbonTl

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików