MrShi
6 小时以前 bc5d79cdd957fcee510d7a1cee07f6775af65596
mini-program/pages/shopping-cart/shopping-cart.vue
@@ -1,9 +1,9 @@
<template>
   <view class="cart">
      <u-swipe-action>
         <u-swipe-action-item :options="options" v-for="(item, index) in list" :name="index" :key="index" @click="deleRow">
         <u-swipe-action-item :options="options" v-for="(item, index) in list" :name="index" :key="item.id" @click="deleRow" ref="item">
            <view class="cart-item" @click="jumpDetails(item.goodsId, item.status)">
               <view class="cart-item-check" @click.stop="select(item)">
               <view class="cart-item-check" @click.stop="select(index)">
                  <image src="/static/icon/ic_agree@2x.png" mode="widthFix" v-if="!item.active"></image>
                  <image src="/static/icon/cart_ic_sel@2x.png" mode="widthFix" v-else></image>
               </view>
@@ -87,6 +87,9 @@
      },
      onLoad() {
         this.getList()
         uni.$on('shuaxin', () => {
            this.getList()
         })
      },
      methods: {
         jumpDetails(id, status) {
@@ -130,8 +133,8 @@
            })
         },
         // 单选
         select(item) {
            item.active = !item.active
         select(index) {
            this.list[index].active = !this.list[index].active
         },
         // 更新商品数量
         changeNum(index) {
@@ -146,6 +149,7 @@
               .then(res => {
                  if (res.code === 200) {
                     this.list.splice(e.name, 1)
                     that.$refs.item.forEach(item => item.closeHandler(true))
                  }
               })
         },