|
|
@ -4,7 +4,7 @@ |
|
|
<view style="height: 1rpx;"></view> |
|
|
<view style="height: 1rpx;"></view> |
|
|
<view> |
|
|
<view> |
|
|
<view v-for="(s_item, s_index) in list" :key="s_index" class="online-card"> |
|
|
<view v-for="(s_item, s_index) in list" :key="s_index" class="online-card"> |
|
|
<view class="lf-m-b-20" @click="$url('/pages/shop/shopdetail')"> |
|
|
|
|
|
|
|
|
<view class="lf-m-b-20" @click="$url('/pages/shop/shopdetail?id='+ s_item.id)"> |
|
|
<text class="lf-iconfont icon-Group- lf-font-28"></text> |
|
|
<text class="lf-iconfont icon-Group- lf-font-28"></text> |
|
|
<text class="lf-color-black lf-font-28 lf-font-bold lf-m-l-10">{{ s_item.name }}</text> |
|
|
<text class="lf-color-black lf-font-28 lf-font-bold lf-m-l-10">{{ s_item.name }}</text> |
|
|
<text class="lf-iconfont icon-xiangyou lf-font-24 lf-m-l-10"></text> |
|
|
<text class="lf-iconfont icon-xiangyou lf-font-24 lf-m-l-10"></text> |
|
|
@ -18,7 +18,7 @@ |
|
|
</view> |
|
|
</view> |
|
|
<!-- 单个商品信息,增加滑动删除 --> |
|
|
<!-- 单个商品信息,增加滑动删除 --> |
|
|
<view v-for="(g_item, g_index) in s_item.goods" :key="g_index"> |
|
|
<view v-for="(g_item, g_index) in s_item.goods" :key="g_index"> |
|
|
<lf-swipe-action :options="options" :index="g_index" :show="show" @button="onButton($event, s_index)"> |
|
|
|
|
|
|
|
|
<lf-swipe-action :options="options" :index="g_index" :show="show" @button="onButton($event, s_index, g_index)"> |
|
|
<view class="lf-row-between"> |
|
|
<view class="lf-row-between"> |
|
|
<u-checkbox-group> |
|
|
<u-checkbox-group> |
|
|
<u-checkbox shape="circle" active-color="#15716E" @change="goodsCheckChange($event, s_index, g_index)" v-model="g_item.checked"></u-checkbox> |
|
|
<u-checkbox shape="circle" active-color="#15716E" @change="goodsCheckChange($event, s_index, g_index)" v-model="g_item.checked"></u-checkbox> |
|
|
@ -28,7 +28,7 @@ |
|
|
<view class="lf-m-l-15 content-info"> |
|
|
<view class="lf-m-l-15 content-info"> |
|
|
<view class="lf-color-333 lf-font-26 lf-line-2" style="max-width: 480rpx;">{{g_item.name}}</view> |
|
|
<view class="lf-color-333 lf-font-26 lf-line-2" style="max-width: 480rpx;">{{g_item.name}}</view> |
|
|
<view class="lf-font-24 lf-color-777 lf-m-t-14 lf-row-between"> |
|
|
<view class="lf-font-24 lf-color-777 lf-m-t-14 lf-row-between"> |
|
|
<view>{{g_item.qty}}件;{{g_item.color}};{{g_item.size}}</view> |
|
|
|
|
|
|
|
|
<view>{{g_item.qty ? g_item.qty+'件;' : ''}}{{g_item.color ? g_item.color+';' : ''}}{{g_item.size ? g_item.size : ''}}</view> |
|
|
<view class="lf-font-32 lf-color-price">¥{{ g_item.price }}</view> |
|
|
<view class="lf-font-32 lf-color-price">¥{{ g_item.price }}</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -128,7 +128,8 @@ |
|
|
list.push({ |
|
|
list.push({ |
|
|
name: data[i].name, |
|
|
name: data[i].name, |
|
|
full_minus: '', |
|
|
full_minus: '', |
|
|
goods: goods |
|
|
|
|
|
|
|
|
goods: goods, |
|
|
|
|
|
id: data[i].id |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
this.list = list; |
|
|
this.list = list; |
|
|
@ -183,14 +184,33 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// 滑动组件,按钮被点击 |
|
|
// 滑动组件,按钮被点击 |
|
|
onButton(event, parentIndex){ |
|
|
|
|
|
console.log("event", event, parentIndex); |
|
|
|
|
|
|
|
|
onButton(event, parentIndex, childIndex){ |
|
|
if(event.buttonIndex == 0){ |
|
|
if(event.buttonIndex == 0){ |
|
|
|
|
|
let __raw_id = this.list[parentIndex].goods[childIndex].__raw_id; |
|
|
uni.showModal({ |
|
|
uni.showModal({ |
|
|
title: '温馨提示', |
|
|
title: '温馨提示', |
|
|
content: '确定移除该商品吗?', |
|
|
content: '确定移除该商品吗?', |
|
|
success: result => { |
|
|
success: result => { |
|
|
|
|
|
|
|
|
|
|
|
if(result.confirm){ |
|
|
|
|
|
this.$http.ajax({ |
|
|
|
|
|
api: 'api/shopping/cart/'+ __raw_id, |
|
|
|
|
|
method: 'DELETE', |
|
|
|
|
|
header: { |
|
|
|
|
|
Authorization: this.token |
|
|
|
|
|
} |
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
|
this.$msg('删除成功', {icon: 'success'}).then(() => { |
|
|
|
|
|
this.list[parentIndex].goods.splice(childIndex, 1); |
|
|
|
|
|
if(this.list[parentIndex].goods.length <= 0){ |
|
|
|
|
|
this.list.splice(parentIndex, 1); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}else{ |
|
|
|
|
|
this.$msg('删除失败', {icon: 'error'}); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|