vue商城项目商品分类页面

可直接复制使用

<template>
  <view class="container">
    <view class="list">
      <!-- 左侧滑动 -->
      <scroll-view scroll-y="true" class="list_left">
        <view v-for="(leftItem, leftIndex) in 50" class="left_item" :key="leftIndex">
          <view class="left_name">一级分类</view>
        </view>
      </scroll-view>
      <!-- 右侧滑动 -->
      <scroll-view scroll-y="true" class="list_right">
        <view class="right_list" v-for="(rightItem, rightIndex) in 4" :key="rightIndex">
          <view class="list_title">分类名称</view>
          <view class="right_content">
            <view class="right_item" v-for="(subItem, subIndex) in 4" :key="subIndex">
              <image class="right_img" src="https://cdn.uviewui.com/uview/album/1.jpg" mode=""></image>
              <view class="right_name">二级分类</view>
            </view>
          </view>
        </view>
      </scroll-view>
    </view>
  </view>
</template>
  
<script setup>
import { ref } from 'vue'
import { onShow } from '@dcloudio/uni-app'

const data = ref('')
const dataList = ref([])

onShow(() => {})
</script>

<style lang="scss" scoped >
.container {
  width: 100%;
  height: 100%;
}

.list {
  display: flex;
}

.list_left {
  width: 200rpx;
  height: 100vh; /* 根据需要调整高度 */
}

.left_item {
  border-bottom: 2rpx solid #ffffff;
  font-size: 28rpx;
  font-weight: bold;
  background-color: #f7f7f7;
}

.left_name {
  padding: 30rpx 6rpx;
  text-align: center;
}

.list_right {
  flex: 1;
  height: 100vh; /* 根据需要调整高度 */
}

.list_title {
  font-weight: bold;
  padding: 30rpx 0;
}

.right_content {
  display: flex;
  flex-wrap: wrap;
}

.right_item {
  width: 150rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10rpx;
}

.right_name {
  padding: 16rpx 0;
}

.right_img {
  width: 150rpx;
  height: 150rpx;
}
</style>

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
基于Vue的购物商城项目可以分为以下几个模块: 1. 首页:展示商品列表、轮播图等信息,可以通过搜索框搜索商品。 2. 分类:展示商品分类列表,可以通过点击分类查看对应的商品列表。 3. 购物车:展示用户已选中的商品列表,可以对商品进行增删改操作。 4. 个人中心:展示用户个人信息,包括订单信息、收货地址等。 以下是一个简单的基于Vue的购物商城项目的实现步骤: 1. 使用Vue CLI 4生成项目,安装Vue Router和Vuex等必要的依赖。 2. 配置路由,分别对应首页、分类、购物车和个人中心等页面。 3. 制作TabBar组件,包括TabBarItem组件和MainTabBar组件,实现底部导航栏的功能。 4. 制作商品列表组件和轮播图组件,展示首页信息。 5. 制作分类列表组件和商品列表组件,展示分类信息。 6. 制作购物车列表组件和商品详情组件,实现购物车功能。 7. 制作个人中心组件,展示用户个人信息。 8. 使用Vuex管理购物车状态,实现购物车数据的增删改查。 9. 使用axios发送请求,获取商品列表、分类列表、用户信息等数据。 10. 使用localStorage存储用户信息和购物车数据,实现数据的持久化。 以下是一个简单的基于Vue的购物商城项目的代码示例: ```vue <template> <div> <main-tab-bar :tabs="tabs" /> <router-view /> </div> </template> <script> import MainTabBar from '@/components/MainTabBar' export default { name: 'App', components: { MainTabBar }, data () { return { tabs: [ { name: '首页', icon: 'home', path: '/' }, { name: '分类', icon: 'category', path: '/category' }, { name: '购物车', icon: 'cart', path: '/cart' }, { name: '个人中心', icon: 'user', path: '/user' } ] } } } </script> ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值