Переглянути джерело

feat: 添加活动游学兑换权限,优化相关组件的权限逻辑

EvilDragon 1 місяць тому
батько
коміт
6ccef852fd

+ 5 - 1
packages/app/src/composables/permissions.ts

@@ -81,7 +81,7 @@ export const usePermissions = () => {
    * 按钮操作权限
    */
   const clickByPermission = (
-    name: 'wechatAgentExchange' | 'caseExchange' | 'mallExchange' | 'thumbsUp',
+    name: 'wechatAgentExchange' | 'caseExchange' | 'mallExchange' | 'thumbsUp' | 'exchange',
     callback: () => void,
   ) => {
     const features = [
@@ -91,6 +91,10 @@ export const usePermissions = () => {
        * 点赞需登录
        */
       { name: 'thumbsUp', meta: { canNotLogin: false, canNotDesigner: true } },
+      /**
+       * 活动游学兑换
+       */
+      { name: 'exchange', meta: { canNotLogin: false, canNotDesigner: false } },
     ]
     const feature = features.find((item) => item.name === name)
     if (feature) {

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

@@ -42,12 +42,14 @@ import ImageEvo from '@/components/image-evo.vue'
 import TooltipEvo from '@/components/tooltip-evo.vue'
 import ActivityAsOf from '../../components/activity-as-of.vue'
 import images from '@designer-hub/assets/src/libs/assets/images'
+import { usePermissions } from '../../../../composables/permissions'
 const themeVars = ref<ConfigProviderThemeVars>({
   tableBorderColor: 'white',
   tabsNavLineBgColor: 'white',
   tabsNavColor: 'white',
 })
 const router = useRouter()
+const { clickByPermission } = usePermissions()
 const id = ref()
 const type = ref<'activity' | 'studyTour'>()
 const activityTypes = ref({ activity: '活动', studyTour: '游学' })
@@ -431,7 +433,7 @@ onShareTimeline(() => ({ title: data.value.name, imageUrl: data.value.thumbnailU
             :content="`还差${difference}积分`"
             :model-value="status === 'runing' && difference > 0"
           >
-            <div @click="show = true">
+            <div @click="clickByPermission('exchange', () => (show = true))">
               <ButtonEvo>{{ data?.ifSingnUp ? '已报名' : '立即报名' }}</ButtonEvo>
             </div>
           </TooltipEvo>

+ 9 - 2
packages/app/src/pages/home/components/comment-item.vue

@@ -99,8 +99,15 @@ defineExpose({
         <Avatar :src="options.userAvatar" :size="isChild ? 22 : 28"></Avatar>
       </div>
       <view class="col-start-2 row-start-1">
-        <div class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-[10.18px]">
-          {{ options.userName }}
+        <div class="flex items-center gap-1">
+          <div class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-[10.18px]">
+            {{ options.userName }}
+          </div>
+          <div
+            class="px-1 rounded-[30px] border border-solid border-[#0cbe7c] justify-center items-center gap-2.5 inline-flex"
+          >
+            <div class="text-[#0cbe7c] text-[9px] font-normal font-['PingFang_SC']">作者</div>
+          </div>
         </div>
         <div class="my-3 text-black/90 text-sm font-normal font-['PingFang_SC'] leading-[10.18px]">
           <span v-if="isChild">回复</span>

+ 1 - 1
packages/app/src/pages/home/moment/index.vue

@@ -177,7 +177,7 @@ onShareAppMessage(async ({ from, target }) => {
           class="flex items-center gap-2"
           @click="
             ['1', '2'].includes(data.circleType) &&
-              router.push(`/pages/mine/homepage/index?id=${data.stylistId}`)
+            router.push(`/pages/mine/homepage/index?id=${data.stylistId}`)
           "
         >
           <wd-img width="24" height="24" round :src="data.headUrl"></wd-img>

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

@@ -207,6 +207,9 @@ onMounted(async () => {
   schema.value.spatialExpertiseType.props.columns = res
   formInited.value = true
   if (userInfo.value.userAuthStatus === 1) {
+    Object.entries(schema.value).forEach(([key]) => {
+      schema.value[key].props.disabled = true
+    })
     alert({
       msg: '您的认证申请已提交,请耐心等待审核,审核通过后您将获得通知',
       title: '提示',