Browse Source

购物车模块猜你喜欢与安全区域

template
liruiqiang 2 months ago
parent
commit
964ba87e7e
  1. 3
      src/pages/cart/cart2.vue
  2. 19
      src/pages/cart/components/CartMain.vue

3
src/pages/cart/cart2.vue

@ -3,7 +3,8 @@ import CartMain from './components/CartMain.vue'
</script> </script>
<template> <template>
<CartMain />
<!-- 适配底部安全区 -->
<CartMain safe-area-inset-bottom />
</template> </template>
<style lang="scss"> <style lang="scss">

19
src/pages/cart/components/CartMain.vue

@ -1,5 +1,5 @@
<template> <template>
<scroll-view scroll-y class="scroll-view">
<scroll-view scroll-y class="scroll-view" @scrolltolower="onScrolltolower">
<!-- 已登录: 显示购物车 --> <!-- 已登录: 显示购物车 -->
<template v-if="memberStore.profile"> <template v-if="memberStore.profile">
<!-- 购物车列表 --> <!-- 购物车列表 -->
@ -62,7 +62,10 @@
</navigator> </navigator>
</view> </view>
<!-- 吸底工具栏 --> <!-- 吸底工具栏 -->
<view class="toolbar">
<view
class="toolbar"
:style="{ paddingBottom: safeAreaInsetBottom ? safeAreaInsets?.bottom + 'px' : 0 }"
>
<text @tap="onChangeSelectedAll" class="all" :class="{ checked: isSelectedAll }">全选</text> <text @tap="onChangeSelectedAll" class="all" :class="{ checked: isSelectedAll }">全选</text>
<text class="text">合计:</text> <text class="text">合计:</text>
<text class="amount">{{ selectedCartListMoney }}</text> <text class="amount">{{ selectedCartListMoney }}</text>
@ -103,6 +106,7 @@ import { useMemberStore } from '@/stores'
import type { CartItem } from '@/types/cart' import type { CartItem } from '@/types/cart'
import { onShow } from '@dcloudio/uni-app' import { onShow } from '@dcloudio/uni-app'
import { computed, ref } from 'vue' import { computed, ref } from 'vue'
import { useGuessList } from '@/composables'
// Store // Store
const memberStore = useMemberStore() const memberStore = useMemberStore()
@ -196,6 +200,17 @@ const gotoPayment = () => {
// //
uni.navigateTo({ url: '/pagesOrder/create/create' }) uni.navigateTo({ url: '/pagesOrder/create/create' })
} }
//
const { guessRef, onScrolltolower } = useGuessList()
//
defineProps<{
safeAreaInsetBottom?: boolean
}>()
//
const { safeAreaInsets } = uni.getSystemInfoSync()
</script> </script>
<style lang="scss"> <style lang="scss">

Loading…
Cancel
Save