collect 8.7

This commit is contained in:
2020-08-07 11:59:08 +08:00
parent 71e984b2ed
commit a088c895d2
10 changed files with 76 additions and 30 deletions

View File

@@ -3,7 +3,7 @@
<u-empty mode="list" v-if="!list.length" color="#000" img-width="200" font-size="30" margin-top="300"></u-empty>
<u-swipe-action
v-for="(item, index) in list" :key="index"
:index='item.fav_id'
:index='index'
:show="item.show"
:options="options"
@click="removeFavorite"
@@ -18,7 +18,7 @@
<view class="item-price">{{ item.favlog_price }}</view>
<view class="item-date">
<image src="@/pageE/static/mine/26.png"></image>
<view>{{ item.fav_time }}</view>
<view>{{ item.fav_time | date }}</view>
</view>
</view>
</view>
@@ -31,7 +31,6 @@ export default {
data() {
return {
list: [],
show: false,
options: [
{
text: '删除',
@@ -50,16 +49,22 @@ export default {
this.$u.api.getFavoritesList().then(res => {
if(res.errCode == 0) {
this.list = res.data;
this.list.forEach(item => {
Object.assign(item, { show: false });
})
}
})
},
removeFavorite(id) {
removeFavorite(index) {
const id = this.list[index].fav_id;
this.$u.api.removeFavorite({
id: id
fid: id,
type: 'goods'
}).then(res => {
this.$u.toast(res.message);
if(res.errCode == 0) {
this.getGoodsFavoritesList();
} else {
this.$u.toast(res.message);
}
})
},

View File

@@ -10,7 +10,7 @@
<view class="price"><span>{{ couponInfo.voucher_price }}</span></view>
<view class="condition">{{ couponInfo.voucher_limit }}使用</view>
</view>
<view class="info-store u-line-1">仅限{{ couponInfo.type == 1 ? '平台' : couponInfo.store_name }}{{ couponInfo.gc_id | showClass(goodsClass) }}商品使用</view>
<view class="info-store u-line-1">仅限{{ couponInfo.type == 1 ? '指定商品' : couponInfo.store_name }}{{ couponInfo.gc_id | showClass(goodsClass) }}商品使用</view>
<view class="info-integral">兑换积分{{ couponInfo.voucher_points }}积分</view>
<view class="info-date">有效期{{ couponInfo.voucher_startdate }}-{{ couponInfo.voucher_enddate }}</view>
</view>

View File

@@ -13,7 +13,7 @@
</swiper-item>
</swiper>
<!-- 加载更多 -->
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" @loadmore="loadMore" v-if="goodsList.length>=pageSize"></u-loadmore>
<u-loadmore :status="loadStatus" bgColor="#FFF" margin-top="20" margin-bottom="20" @loadmore="loadMore"></u-loadmore>
</view>
</template>
<script>
@@ -22,7 +22,7 @@ export default {
name:"list",
data() {
return {
pageSize: 12,
// pageSize: 12,
current: -1,
swiperCurrent: 0,
goodsList: [],