uniapp 购物车 单店铺

这篇博客分享了如何使用uniApp开发单店铺购物车的功能。提供了模板代码、CSS样式和JavaScript脚本,强调了图片路径需要根据选中状态自定义,并给出了商品数据结构示例,帮助开发者进行视图参数的调整。
摘要由CSDN通过智能技术生成

代码复制直接用
图片路径要自己添加 图片路径是根据选中状态拼接显示 select_show是选中的图片 改成自己的选中图片
template 代码

<template>
	<view class="body">
		<scroll-view scroll-y="true" style="height: 100%;">
			<view class="text-bianji" @click="eidtClick" v-if="carList.length">{
  {!edit ? '编辑' : '删除'}}</view>
			<view class="car-list" v-for="(item,index) in carList" :key='index'>
				<view class="left" @click="SelectChecked(index)">
					<image class="check" :src="('../../static/img/func/'+(item.checked ? 'select_show' : 'select')+'.png')" mode="" ></image>
					<view class="cont">
						<image :src="item.goods.img" mode="aspectFill"></image>
						<view class="continfo">
							<view class="title">{
  {item.goods.title}}</view>
							<view class="">
                <text class="price">¥{
  {item.goods.price}}</text>
                <text class="c999 fs0d85">+{
  {item.goods.integral}}积分</text>
              </view>
						</view>
					</view>
				</view>
				<!-- 加减 -->
				<view class="right" v-if="!edit">
					<image src="../../static/img/users/clear.png" mode="" @click="CarNum('-',index)"></image>
					<view class="">{
  {item.num}}</view>
					<image src="../../static/img/users/add.png" mode="" @click="CarNum('+',index)"></image>
				</view>
			</view>
			
			<view class="text-none" v-if="!carList.length">购物车是空的</view>
			
			<!--  -->
			<view class="car-bottom">
				<view class="df aife">
					<image class="check" :src="('../../static/img/func/'+(checked ? 'select_show' : 'select')+'.png')" mode="" @click="autoChecked()"></image>
					全选
					<text class="price" v-if="!edit">¥{
  {(autoPrice || 0).toFixed(2)}}</text>
          <text class="c999 fs0d85">+{
  {(Autointegral || 0).toFixed(2)}}积分</text>
				</view>
				<view class=
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值