Prechádzať zdrojové kódy

feat: 优化购物车和订单处理逻辑;添加权限控制以增强用户交互体验

EvilDragon 1 mesiac pred
rodič
commit
ef799acbc8

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

@@ -143,7 +143,7 @@ onLoad(async (query: { id: string }) => {
             block
             color="white"
             location="right"
-            @click="(show = true), (type = 'add2Cart')"
+            @click="((show = true), (type = 'add2Cart'))"
           >
             <span class="text-black/80">加入购物车</span>
           </ButtonEvo>

+ 3 - 1
packages/app/src/pages/home/mall/shopping-cart/index.vue

@@ -27,7 +27,9 @@ import { storeToRefs } from 'pinia'
 import { requestToast } from '../../../../core/utils/common'
 import type { ComponentExposed } from 'vue-component-type-helpers'
 import ButtonEvo from '@/components/button-evo.vue'
+import { usePermissions } from '../../../../composables/permissions'
 
+const { clickByPermission } = usePermissions()
 const pageHelperRef = ref<ComponentExposed<typeof PageHelper>>()
 const userStore = useUserStore()
 const router = useRouter()
@@ -210,7 +212,7 @@ const handlePlaceOrder = async () => {
           </div>
           <div class="text-black text-base font-normal font-['PingFang_SC'] leading-5">积分</div>
         </div>
-        <div class="" @click="handlePlaceOrder">
+        <div class="" @click="clickByPermission('mallExchange', () => handlePlaceOrder)">
           <ButtonEvo>
             <div
               class="w-[65px] h-[22px] text-white text-base font-normal font-['PingFang_SC'] leading-tight"