Bläddra i källkod

✨ feat(cart-sku): 添加购物车商品信息

陈雪 2 veckor sedan
förälder
incheckning
8d8d2df75a

+ 13 - 0
src/components/cart/cart-item.vue

@@ -0,0 +1,13 @@
+<template>
+  <view class="cart-item">
+    <view class="icon"></view>
+  </view>
+</template>
+
+<script lang="ts" setup>
+  //
+</script>
+
+<style lang="scss" scoped>
+  //
+</style>

+ 11 - 0
src/components/sku/single-sku.vue

@@ -0,0 +1,11 @@
+<template>
+  <view class="">单个商品</view>
+</template>
+
+<script lang="ts" setup>
+  //
+</script>
+
+<style lang="scss" scoped>
+  //
+</style>

+ 0 - 0
src/components/sku/sku.vue → src/components/sku/sku-select.vue


+ 12 - 2
src/pages/cart/cart.vue

@@ -10,6 +10,7 @@
 <script setup lang="ts">
   import { t } from '@/locale'
   const { safeAreaInsets } = uni.getSystemInfoSync()
+  const selectAll = ref(true)
 </script>
 <template>
   <view
@@ -33,8 +34,12 @@
     <view class="cart-list"></view>
     <view class="cart-bottom-area pb-tab">
       <view class="cart-control">
-        <view class="icon"></view>
-        <view class="text">{{ t('cart.selectAll') }}</view>
+        <view
+          class="icon"
+          @click="selectAll = !selectAll"
+          :class="{ 'select-icon': selectAll }"
+        ></view>
+        <view @click="selectAll = !selectAll" class="text">{{ t('cart.selectAll') }}</view>
         <view class="price">
           {{ t('cart.totalPrice') }}
           <view class="price-text flex">
@@ -80,6 +85,11 @@
         margin-right: 16rpx;
         border: 4rpx solid $shop-bg-line;
         border-radius: 50%;
+
+        &.select-icon {
+          background: url('@/static/images/cart/select.svg') no-repeat center;
+          border-color: $shop-bg-line;
+        }
       }
 
       .text {

+ 5 - 0
src/static/images/cart/select.svg

@@ -0,0 +1,5 @@
+<svg width="21" height="21" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g id="&#229;&#141;&#149;&#233;&#128;&#137;">
+<path id="union" d="M10.5 21C16.299 21 21 16.299 21 10.5C21 4.70101 16.299 0 10.5 0C4.70101 0 0 4.70101 0 10.5C0 16.299 4.70101 21 10.5 21ZM5.25 10.8097L6.30975 9.75L9 12.4395L14.6887 6.75L15.75 7.81125L9 14.5605L5.25 10.8097Z" fill="#FF4C1B"/>
+</g>
+</svg>

BIN
src/static/images/cart/sku-img.png