| | |
| | | <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> |
| | |
| | | }, |
| | | onLoad() { |
| | | this.getList() |
| | | uni.$on('shuaxin', () => { |
| | | this.getList() |
| | | }) |
| | | }, |
| | | methods: { |
| | | jumpDetails(id, status) { |
| | |
| | | }) |
| | | }, |
| | | // 单选 |
| | | select(item) { |
| | | item.active = !item.active |
| | | select(index) { |
| | | this.list[index].active = !this.list[index].active |
| | | }, |
| | | // 更新商品数量 |
| | | changeNum(index) { |
| | |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | | this.list.splice(e.name, 1) |
| | | that.$refs.item.forEach(item => item.closeHandler(true)) |
| | | } |
| | | }) |
| | | }, |