Sfoglia il codice sorgente

Update 调整小程序页面,没有权限隐藏部分内容

YueYunyun 1 anno fa
parent
commit
05c749e620

+ 2 - 4
UI/XYH.APP/src/pages-sub/activity/edit.vue

@@ -1,5 +1,5 @@
 <template>
-  <view v-if="isAudit" class="page-container">
+  <view v-if="appStore.amProfileStore.isAudit()" class="page-container">
     <view v-if="activityId" class="mb-15">
       <view class="text-center text-danger" v-if="form.isClose == 1">活动已关闭</view>
       <view class="text-center text-danger" v-else-if="form.auditStatus == 2">活动未通过审核,修改后重新发布</view>
@@ -235,9 +235,7 @@ import appStore from "@/stores"
 
 const imageUploadRef = ref()
 const qrCodeRef = ref()
-const isAudit = computed(() => {
-  return appStore.authStore.isAuthenticated && appStore.amProfileStore.getProfileInfo().auditStatus == 1
-})
+
 const form = ref<any>({
   activityId: "",
   title: "",

+ 2 - 4
UI/XYH.APP/src/pages-sub/help/edit.vue

@@ -1,5 +1,5 @@
 <template>
-  <view v-if="isAudit" class="page-container">
+  <view v-if="appStore.amProfileStore.isAudit()" class="page-container">
     <view v-if="helpId">
       <view class="text-center text-danger mb-5" v-if="form.isClose == 1">互助已关闭</view>
       <view class="text-center text-danger mb-5" v-else-if="form.auditStatus == 2">互助未通过审核,修改后重新发布</view>
@@ -140,9 +140,7 @@ const form = ref<any>({
   area: "",
   images: "",
 })
-const isAudit = computed(() => {
-  return appStore.authStore.isAuthenticated && appStore.amProfileStore.getProfileInfo().auditStatus == 1
-})
+
 const area = ref<any[]>([])
 const params = route.getRouteParams("helpEdit")
 const helpId = ref(params?.id)

+ 2 - 0
UI/XYH.APP/src/pages/activity/index.vue

@@ -1,6 +1,7 @@
 <template>
   <view class="">
     <SearchBar
+      v-if="appStore.amProfileStore.isAudit()"
       v-model:search-input-value="searchInputValue"
       v-model:search-type="searchType"
       v-model:search-dropdown-value="searchDropdownValue"
@@ -33,6 +34,7 @@ import apis from "@/api"
 import route from "@/route"
 import ListCard from "@/components/listCard.vue"
 import SearchBar from "@/components/searchBar.vue"
+import  appStore from "@/stores"
 
 dayjs.locale("zh-cn") // 使用本地化语言
 

+ 4 - 1
UI/XYH.APP/src/pages/alumnus/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <view>
+  <view v-if="appStore.amProfileStore.isAudit()">
     <SearchBar
       v-model:search-input-value="searchInputValue"
       v-model:search-type="searchType"
@@ -83,6 +83,9 @@
       </template>
     </vb-list>
   </view>
+  <view v-else>
+    <view class="d-fc text-gray-5 mt-50">功能正在开发中...</view>
+  </view>
 </template>
 
 <script lang="ts" setup>

+ 5 - 1
UI/XYH.APP/src/pages/help/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <view>
+  <view v-if="appStore.amProfileStore.isAudit()">
     <SearchBar
       v-model:search-input-value="searchInputValue"
       v-model:search-type="searchType"
@@ -24,6 +24,9 @@
       </template>
     </vb-list>
   </view>
+  <view v-else>
+    <view class="d-fc text-gray-5 mt-50">功能正在开发中...</view>
+  </view>
 </template>
 
 <script lang="ts" setup>
@@ -34,6 +37,7 @@ import "dayjs/locale/zh-cn" // 导入本地化语言
 
 import ListCard from "@/components/listCard.vue"
 import SearchBar from "@/components/searchBar.vue"
+import appStore from "@/stores"
 
 dayjs.locale("zh-cn") // 使用本地化语言
 

+ 2 - 2
UI/XYH.APP/src/pages/mine/index.vue

@@ -137,7 +137,7 @@ onShow(init)
       </view>
     </view>
     <view v-if="ready" class="">
-      <vb-cell-group inset>
+      <vb-cell-group inset v-if="appStore.amProfileStore.isAudit()">
         <vb-cell icon="user-s" icon-class="text-vb" is-link @click="route.navigate('profileEdit')">
           <template #title>
             <text class="me-10">完善个人资料</text>
@@ -172,7 +172,7 @@ onShow(init)
           </template>
         </vb-cell>
       </vb-cell-group>
-      <vb-cell-group inset>
+      <vb-cell-group inset  v-if="appStore.amProfileStore.isAudit()">
         <vb-cell
           icon="like-s"
           icon-class="text-vb"

+ 4 - 0
UI/XYH.APP/src/stores/_profile.ts

@@ -28,6 +28,9 @@ export const useAmProfileStore = defineStore("amProfile", () => {
     return amInfo.value
   }
 
+  function isAudit()  {
+    return  appStore.authStore.isAuthenticated && amInfo.value.auditStatus == 1
+  }
   function getProfileProgress() {
     let count = 0,
       total = 0
@@ -68,6 +71,7 @@ export const useAmProfileStore = defineStore("amProfile", () => {
     getProfileProgress,
     loadProfile,
     getProfileInfo,
+    isAudit,
     updateProfile,
     updatePrivacy,
     clean,