Ver código fonte

feat: 优化认证和荣誉页面的逻辑,调整路由参数,修复导航链接

EvilDragon 1 mês atrás
pai
commit
0ed1118ee5

+ 2 - 2
packages/app/src/pages/mine/authentication/index.vue

@@ -197,8 +197,8 @@ onMounted(async () => {
     }
     setReferrerExisting(userAuthInfo.value.channelSource.toString())
     attachment.value = userAuthInfo.value.attachment
-    schema.value.channelSource.props.disabled = true
-    schema.value.referrer.props.disabled = true
+    // schema.value.channelSource.props.disabled = true
+    // schema.value.referrer.props.disabled = true
   }
   const { data } = await getByDictType('member_channel_source')
   const { data: res } = await getByDictType(DictType.memberSpatialExpertiseType)

+ 12 - 7
packages/app/src/pages/mine/honors/detail/index.vue

@@ -12,7 +12,7 @@ import Card from '@/components/card.vue'
 import SectionHeading from '@/components/section-heading.vue'
 import { getBadges, getCertificates } from '../../../../core/libs/requests'
 import { Badge } from '../../../../core/libs/models'
-import { NetImages } from '@/core/libs/net-images'
+import { NetImages } from '../../../../core/libs/net-images'
 
 const active = ref('badge')
 const tabs = ref([
@@ -35,10 +35,14 @@ const { data: badges, run: setBadges } = useRequest(() => getBadges({}), {
 const { data: certificates, run: setCertificates } = useRequest(() => getCertificates({}), {
   initialData: [],
 })
-const data = ref<Badge | undefined>()
-onLoad(async (query: { data: string }) => {
-  data.value = JSON.parse(query.data) as Badge
-  console.log(data.value)
+const data = ref<{ name: string }>()
+onLoad(async (query: { type: 'badge' | 'certificate'; data: string }) => {
+  console.log(JSON.parse(query.data))
+
+  if (query.type === 'badge') {
+    const badge = JSON.parse(query.data) as Badge
+    data.value = { name: badge.badgeName }
+  }
 })
 </script>
 <template>
@@ -65,10 +69,11 @@ onLoad(async (query: { data: string }) => {
     <wd-img width="42%" mode="widthFix" :src="data.badgeYesObtainedImage"></wd-img>
     <div class="flex flex-col items-center gap-1">
       <div class="text-white text-[26px] font-normal font-['PingFang_SC'] uppercase">
-        东方研习营
+        <!-- 东方研习营 -->
+        {{ data.name }}
       </div>
       <div class="text-center text-white text-sm font-normal font-['PingFang_SC'] uppercase">
-        参加东方艺术设计研学营
+        <!-- 参加东方艺术设计研学营 -->
       </div>
       <div class="mt-6 flex items-center gap-4">
         <div class="w-4 h-0.25 bg-white"></div>

+ 18 - 6
packages/app/src/pages/mine/honors/index.vue

@@ -171,7 +171,11 @@ onMounted(async () => {
             <template v-for="(item, i) in it" :key="i">
               <div
                 class="w-full px-4 box-border"
-                @click="router.push(`/pages/mine/honors/detail/index?data=${JSON.stringify(item)}`)"
+                @click="
+                  router.push(
+                    `/pages/mine/honors/detail/index?type=badge&data=${JSON.stringify(item)}`,
+                  )
+                "
               >
                 <wd-img
                   width="100%"
@@ -193,11 +197,19 @@ onMounted(async () => {
     </template>
     <template v-if="active === 'certificate'">
       <div>
-        <template v-for="(it, i) in certificates" :key="i">
-          <div class="grid grid-cols-2">
-            <wd-img width="100%" :src="it.certificateImage" mode="widthFix"></wd-img>
-          </div>
-        </template>
+        <div class="grid grid-cols-2 gap-2.5">
+          <template v-for="(it, i) in certificates" :key="i">
+            <div
+              @click="
+                router.push(
+                  `/pages/mine/honors/detail/index?type=certificate&data=${JSON.stringify(it)}`,
+                )
+              "
+            >
+              <wd-img width="100%" :src="it.certificateImage" mode="widthFix"></wd-img>
+            </div>
+          </template>
+        </div>
       </div>
     </template>
   </div>

+ 1 - 1
packages/merchant/src/pages/agent/designer/archives/index.vue

@@ -112,7 +112,7 @@ onLoad(async (query: { id: string }) => {
 </script>
 <template>
   <div class="flex-grow bg-white">
-    <wd-tabs v-model="tab">
+    <wd-tabs v-model="tab" :swipeable="true" :slidable-num="4">
       <template v-for="(it, index) in tabs" :key="index">
         <wd-tab :title="it.label" :name="it.value"></wd-tab>
       </template>

+ 1 - 1
packages/merchant/src/pages/agent/designer/detail.vue

@@ -38,7 +38,7 @@ const toOrderDetails = () => {
   uni.navigateTo({ url: '/pages/mine/merchant/orders/detail/index' })
 }
 const toArchives = () => {
-  uni.navigateTo({ url: '/pages/designer/archives/index?id=' + id.value })
+  uni.navigateTo({ url: '/pages/agent/designer/archives/index?id=' + id.value })
 }
 onLoad(async (query: { id: string }) => {
   id.value = query.id

+ 1 - 1
packages/merchant/src/pages/agent/designer/index.vue

@@ -60,7 +60,7 @@ const searchChange = (e: any) => {
   console.log(e)
 }
 const toDetail = async (designer: any) => {
-  await uni.navigateTo({ url: '/pages/designer/detail' + '?id=' + designer.id })
+  await uni.navigateTo({ url: '/pages/agent/designer/detail' + '?id=' + designer.id })
 }
 const callPhone = (phoneNumber) => {
   uni.makePhoneCall({