54 lines
1.2 KiB
Vue
54 lines
1.2 KiB
Vue
<template>
|
|
<div>
|
|
<joyful-selection-cart-skeleton v-if="loading" />
|
|
<main v-else class="cart-page">
|
|
<van-nav-bar title="购物车" right-text="编辑" @click-right="$router.push('/joyful-selection/cart/edit')" />
|
|
<joyful-cart-panel fixed-submit page-mode @checkout="goCheckout" />
|
|
</main>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import JoyfulCartPanel from './components/JoyfulCartPanel.vue'
|
|
import JoyfulSelectionCartSkeleton from '@/skeleton-view/joyful-selection/cart/index.vue'
|
|
|
|
export default {
|
|
name: 'JoyfulSelectionCart',
|
|
components: {
|
|
JoyfulCartPanel,
|
|
JoyfulSelectionCartSkeleton
|
|
},
|
|
data: () => ({
|
|
loading: true
|
|
}),
|
|
mounted() {
|
|
this.$nextTick(() => {
|
|
this.loading = false
|
|
})
|
|
},
|
|
methods: {
|
|
goCheckout(items) {
|
|
sessionStorage.setItem('joyful-selection-checkout-items', JSON.stringify(items))
|
|
this.$router.push({ path: '/joyful-selection/checkout', query: { source: 'cart' } })
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
.cart-page {
|
|
min-height: 100vh;
|
|
padding-top: 46px;
|
|
background: #fff;
|
|
}
|
|
|
|
.cart-page ::v-deep .van-nav-bar {
|
|
position: fixed;
|
|
z-index: 20;
|
|
top: 0;
|
|
right: 0;
|
|
left: 0;
|
|
box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
|
|
}
|
|
</style>
|