微信小程序电商平台购物车交互功能

本文介绍了微信小程序中电商平台的购物车交互功能,涵盖了商品选择、数量修改和删除操作,详细解析了cart.wxml、cart.wxss及cart.js三个关键页面的实现细节。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

微信小程序电商平台购物车交互功能。包括选择,改变数量,删除
cart.wxml页面

<block wx:for="{
   {
   items}}" wx:for-index="bindex">
  <view class='b_head'>
    <image class='b_select' src="{
   {
   item.isSelect ? '/images/common/selected.png' : '/images/common/no_select.png'}}" data-bindex="{
   {
   bindex}}" bindtap='b_select'></image>
    <view class='ruzhu' hidden="{
   {
   item.supplier_id>0 ? false :true}}">
      <text class='b_flag'>入驻商家</text>
      <text class="bname">{
   {
   item.supplier_name}}</text>
    </view>
    <view class='ziying' hidden="{
   {
   item.supplier_id == 0 ? false :true}}">-平台自营商品-</view>
  </view>
<block wx:for="{
   {
   item.goods_list}}">
 <view class="touch-item {
   {
   item.isTouchMove ? 'touch-move-active' : ''}}" data-bindex="{
   {
   bindex}}" data-index="{
   {
   index}}" bindtouchstart="touchstart" bindtouchmove="touchmove">
  <view class="content">
  <image class='select' src="{
   {
   item.isSelect ? '/images/common/selected.png' : '/images/common/no_select.png'}}" bindtap='single_select' data-bindex="{
   {
   bindex}}" data-index="{
   {
   index}}"></image> 
  <image class='thumb' src="{
   {
   item.goods_thumb}}"></image>
  <view class='name'>{
   {
   item.goods_name}}</view>
  <view class="attr">{
   {
   item.goods_attr}}</view>
  <view class='price'>{
   {
   item.goods_price}}</view>
  <view class="buy_num">
    <view class="stepper">
      <!-- 减号 -->
      <text class="{
   {
   minusStatus}}" data-bindex="{
   {
   bindex}}" data-index="{
   {
   index}}"  data-rec_id="{
   {
   item.rec_id}}"  bindtap="bindMinus">-</text>
      <!-- 数值 -->
      <input type="number" bindchange="bindManual" data-bindex="{
   {
   bindex}}" data-index="{
   {
   index}}"  data-rec_id="{
   {
   item.rec_id}}" value="{
   {
   item.goods_number}}" />
      <!-- 加号 -->
      <text class="normal" data-bindex="{
   {
   bindex}}"  data-index="{
   {
   index}}" data-rec_id="{
   {
   item.rec_id}}" bindtap="bindPlus">+</text>
    </view>
  </view>
  </view>
  <view class="del" catchtap="del" data-index="
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值