浏览代码

refactor(app): 优化首页活动展示和用户认证功能

- 修改确认订单页面的优惠券积分显示
- 优化用户认证页面的加载逻辑
- 调整首页活动列表的展示样式
- 移除未使用的优惠券状态枚举
- 修复设计师列表的头像显示
EvilDragon 1 月之前
父节点
当前提交
9351eeaf98

+ 6 - 6
packages/app/src/core/libs/models.ts

@@ -767,15 +767,15 @@ export interface ConfirmOrder {
   type: any
 }
 export enum CouponStatus {
-//   HAVE_USE(1, "已使用"),
-//   NOT_USE(2, "未使用"),
-//   EXPIRED(3, "已过期"),
-//   BECAME_INVALID(4, "已失效"),
-// ;
+  //   HAVE_USE(1, "已使用"),
+  //   NOT_USE(2, "未使用"),
+  //   EXPIRED(3, "已过期"),
+  //   BECAME_INVALID(4, "已失效"),
+  // ;
   HAVE_USE = 1,
   NOT_USE = 2,
   EXPIRED = 3,
-  BECAME_INVALID = 4
+  BECAME_INVALID = 4,
 }
 export interface Coupon {
   id: number

+ 1 - 1
packages/app/src/core/libs/requests.ts

@@ -1,4 +1,4 @@
-import { http, httpDelete, httpGet, httpPost, httpPut } from '../../utils/http'
+import { http, httpDelete, httpGet, httpPost, httpPut } from '@/utils/http'
 import { Schedule } from '../models/schedule'
 import {
   Category,

+ 17 - 14
packages/app/src/pages/home/components/offline-activity-item.vue

@@ -21,23 +21,24 @@ const router = useRouter()
 <template>
   <div @click="router.push(`/pages/home/classmates-detail/index?id=${options.id}`)">
     <card :custom-class="[customClass, 'p-0!']">
-      <view class="relative">
+      <view class="relative aspect-[1.72/1]">
         <wd-img
           width="100%"
+          height="100%"
           custom-class="vertical-bottom"
           class="w-[347px] h-[202px] rounded-tl-2xl rounded-tr-2xl"
-          mode="widthFix"
+          mode="aspectFill"
           :src="options.bannerUrl"
         />
-        <template v-if="dayjs().isAfter(dayjs(options?.hostDate).add(1, 'd'))">
-          <div
-            class="absolute top-4 right-4 px-2.5 bg-black/30 rounded-[20px] backdrop-blur-[15px]"
-          >
-            <div class="text-white text-xs font-normal font-['PingFang_SC'] leading-relaxed">
-              已结束
-            </div>
-          </div>
-        </template>
+        <!--        <template v-if="dayjs().isAfter(dayjs(options?.hostDate).add(1, 'd'))">-->
+        <!--          <div-->
+        <!--            class="absolute top-4 right-4 px-2.5 bg-black/30 rounded-[20px] backdrop-blur-[15px]"-->
+        <!--          >-->
+        <!--            <div class="text-white text-xs font-normal font-['PingFang_SC'] leading-relaxed">-->
+        <!--              已结束-->
+        <!--            </div>-->
+        <!--          </div>-->
+        <!--        </template>-->
         <div
           class="absolute top-4 left-4 px-2.5 rounded-md border border-solid border-white justify-center items-center gap-2.5 inline-flex"
         >
@@ -47,7 +48,9 @@ const router = useRouter()
         </div>
       </view>
       <div class="p-5 bg-white rounded-bl-[20px] rounded-br-[20px] shadow">
-        <div class="w-[244px] text-black text-base font-normal font-['PingFang_SC'] leading-normal">
+        <div
+          class="text-black text-base font-normal font-['PingFang_SC'] leading-normal text-ellipsis line-clamp-1 overflow-hidden"
+        >
           {{ options.title }}
         </div>
         <view class="mt-1.5 flex items-center mb-4">
@@ -58,7 +61,7 @@ const router = useRouter()
             <!-- <div class="">{{ dayjs(options.studyStartDate).format('MM-DD') }}</div>
             <wd-img custom-class="mx-1" width="5" height="5" :src="polygon16" />
             <div>{{ dayjs(options.studyEndDate).format('MM-DD') }}</div> -->
-            {{ dayjs(options?.hostDate).format('MM.DD HH:mm') }}
+            {{ dayjs(options?.hostDate).format('YYYY-MM-DD') }}
           </div>
         </view>
         <view class="flex gap-4">
@@ -74,7 +77,7 @@ const router = useRouter()
             class="inline-block px-2.5 rounded-md border border-solid border-black/30 backdrop-blur-[6px] flex justify-center items-center"
           >
             <div class="text-black/60 text-xs font-normal font-['PingFang_SC'] leading-normal">
-              {{ options.supportBrand }}
+              赞助品牌:{{ options.supportBrand }}
             </div>
           </div>
         </view>

+ 1 - 1
packages/app/src/pages/home/mall/confirm-order/index.vue

@@ -177,7 +177,7 @@ onLoad(async (query: { data: string }) => {
                   <div
                     class="text-[#ef4343] text-sm font-normal font-['PingFang_SC'] leading-[10.18px]"
                   >
-                    -{{ offerPoints }}
+                    -{{ confirmOrder.totalsCouponPoints }}
                   </div>
                 </template>
                 <wd-img :src="right" width="12" height="12"></wd-img>

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

@@ -183,7 +183,21 @@ const handleSubmit = async () => {
     }
   }
 }
-onMounted(async () => {
+onLoad(async (query?: Record<string | 'scene', string>) => {
+  if (query?.scene) {
+    console.log(query.scene)
+    try {
+      const [referrer, channelSource] = decodeURIComponent(query.scene).split('&')
+      console.log(referrer, channelSource)
+      formData.value = {
+        ...formData.value,
+        referrer,
+        channelSource,
+      }
+    } catch (e) {
+      await uni.showToast({ title: e.message, icon: 'none' })
+    }
+  }
   await setUserAuthInfo()
   if (userAuthInfo.value) {
     formData.value = {
@@ -214,14 +228,14 @@ onMounted(async () => {
       schema.value[key].props.disabled = true
     })
     uploadDisabled.value = true
-    alert({
+    await alert({
       msg: '您的认证申请已提交,请耐心等待审核,审核通过后您将获得通知',
       title: '提示',
       confirmButtonText: '我知道了',
     })
   }
   if (userInfo.value.userAuthStatus === 2) {
-    alert({
+    await alert({
       title: '审核不通过',
       msg: userAuthInfo.value?.remark || '由于系统原因,您提交的认证暂时无法通过,请修改后重新提交',
     })

+ 10 - 10
packages/app/src/pages/mine/index.vue

@@ -26,9 +26,9 @@ import { NetImages } from '../../core/libs/net-images'
 import { qrCodeString2Object, requestToast, toQrCodeString } from '../../core/utils/common'
 import { QrCodeBusinessType } from '../../core/libs/enums'
 import { usePermissions } from '../../composables/permissions'
-import {AnalysisEventType, useAnalysis} from "@/composables/analysis";
+import { AnalysisEventType, useAnalysis } from '@/composables/analysis'
 
-const {option, report} = useAnalysis(false)
+const { option, report } = useAnalysis(false)
 const router = useRouter()
 const userStore = useUserStore()
 const { isLogined, userInfo } = storeToRefs(userStore)
@@ -186,25 +186,25 @@ const handleClickScan = async () => {
       option.value = {
         remark: `最近到店品牌: ${options.name}`,
       }
-      report(AnalysisEventType.ViewPage)
+      await report(AnalysisEventType.ViewPage)
       // await storeAndPunchIn({ id: 24 })
-      router.push(`/pages/mine/scan/result/index?result=${result}`)
+      await router.push(`/pages/mine/scan/result/index?result=${result}`)
     } catch (e) {
       if (e.code === 1000) {
-        router.push(
+        await router.push(
           `/pages/mine/scan/result/index?result=${toQrCodeString(type, { name: options.name, desc: e.msg })}`,
         )
       } else {
-        uni.showToast({ title: e.msg, icon: 'none' })
+        await uni.showToast({ title: e.msg, icon: 'none' })
       }
     }
     return
   }
   if (type === QrCodeBusinessType.PagePath) {
-    router.push(options.path)
+    await router.push(options.path)
     return
   }
-  router.push(`/pages/mine/scan/result/index?result=${result}`)
+  await router.push(`/pages/mine/scan/result/index?result=${result}`)
 }
 const navBarProps = ref({ customClass: 'bg-transparent!' })
 onMounted(async () => {
@@ -378,7 +378,7 @@ onPageScroll(({ scrollTop }: { scrollTop: number }) => {
       </div>
     </div>
     <template v-else>
-      <div class="relative top--36">
+      <div @click="router.push('/pages/mine/levels/index')" class="relative top--36">
         <div
           class="mx-3.5 absolute left-0 right-0 top--4 aspect-[1.93/1] rounded-2.5 p-3.5 box-border bg-[length:100%]"
           :class="['text-[#8FB8DB]']"
@@ -391,7 +391,7 @@ onPageScroll(({ scrollTop }: { scrollTop: number }) => {
             <div class="flex-1"></div>
             <div
               class="bg-gradient-to-r from-[#333333] to-[#20201e] rounded-tl-[20px] rounded-bl-[20px] mr--3.5 px-2 mt-3"
-              @click="router.push('/pages/mine/levels/index')"
+              @click.stop="router.push('/pages/mine/levels/index')"
             >
               <div class="text-xs font-normal font-['PingFang_SC'] leading-relaxed color-[#f3f3f3]">
                 更多等级权益

+ 1 - 2
packages/merchant/src/core/libs/actions.ts

@@ -1,5 +1,4 @@
-import { title } from 'radash'
-import { cancelCircleReviewUpvote, cancelCircleUpvote, createCircleUpvote } from './requests'
+import { cancelCircleUpvote, createCircleUpvote } from './requests'
 
 const toast = (title: string) => uni.showToast({ title, icon: 'none' })
 export const handleUpvoteClick = async (

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

@@ -25,6 +25,7 @@ import { useUserStore } from '../../../store'
 import link from '@designer-hub/assets/src/libs/assets/link'
 import { beforeNow } from '@/utils/date-util'
 import { getDesignerList } from '@/core/libs/requests'
+import { NetImages } from '@/core/libs/enums'
 
 const userStore = useUserStore()
 const { userInfo } = storeToRefs(userStore)
@@ -193,7 +194,12 @@ onLoad(async (params: { title?: string; filter?: string; tags?: string }) => {
                     <div
                       class="w-[55px] h-[55px] bg-neutral-100 rounded-full mr-2 flex items-center justify-center relative"
                     >
-                      <wd-img width="100%" height="100%" round :src="it.avatar"></wd-img>
+                      <wd-img
+                        width="100%"
+                        height="100%"
+                        round
+                        :src="it.avatar || NetImages.DefaultAvatar"
+                      ></wd-img>
                       <div v-if="it.retryStatus" class="absolute right-0 bottom--1">
                         <wd-img width="14" height="14" :src="link"></wd-img>
                       </div>