This commit is contained in:
Gdpao
2020-08-07 19:59:51 +08:00
22 changed files with 332 additions and 145 deletions

View File

@@ -3,13 +3,13 @@
<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"
@open="open"
>
<view class="item u-border-bottom">
<view class="item u-border-bottom" @click="viewGoodsDetails(item)">
<image :src="item.goods_image"></image>
<!-- 此层wrap在此为必写的否则可能会出现标题定位错误 -->
<view class="title-wrap">
@@ -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: '删除',
@@ -46,20 +45,38 @@ export default {
this.getGoodsFavoritesList();
},
methods: {
viewGoodsDetails(item) {
const list = this.list.filter(item => {
return item.show;
})
if(list.length) return false;
this.$u.route({
url: 'pageB/sdetails/index',
params: {
id: item.fav_id,
}
})
},
getGoodsFavoritesList() {
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);
}
})
},
@@ -70,6 +87,7 @@ export default {
this.list.map((val, idx) => {
if(index != idx) this.list[idx].show = false;
})
this.$forceUpdate();
}
},
};

View File

@@ -10,7 +10,7 @@
<view class="price"><span>{{ couponInfo.vouchertemplate_price }}</span></view>
<view class="condition">{{ couponInfo.vouchertemplate_limit }}使用</view>
</view>
<view class="info-store u-line-1">仅限{{ couponInfo.vouchertemplate_storename }}商品使用</view>
<view class="info-store u-line-1">仅限{{ couponInfo.type == 2 ? couponInfo.vouchertemplate_storename : '指定商品' }}使用</view>
<view class="info-integral">兑换积分{{ couponInfo.vouchertemplate_points }}积分</view>
<view class="info-date">有效期{{ couponInfo.vouchertemplate_startdate }}-{{ couponInfo.vouchertemplate_enddate }}</view>
</view>

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: [],

View File

@@ -60,8 +60,9 @@ export default {
this.$u.route({
url: 'pageB/sdetails/index',
params: {
id: this.recommendData.pintuan_id,
type: 2,
// id: this.recommendData.pintuan_id,
id: this.recommendData.groupbuy_id,
// type: 2,
}
})
}

View File

@@ -45,8 +45,9 @@ export default {
this.$u.route({
url: 'pageB/sdetails/index',
params: {
id: this.item.groupbuy_id,
type: 3,
// id: this.item.groupbuy_id,
id: this.item.goods_id,
// type: 3,
}
})
},