2021-07-15 15:10:27 +08:00
|
|
|
<template>
|
|
|
|
<div class="page">
|
2021-08-27 17:54:52 +08:00
|
|
|
<u-navbar :custom-back="back" back-icon-color="#fff" :background="background" :border-bottom="false" >
|
2021-08-27 14:11:06 +08:00
|
|
|
</u-navbar>
|
2021-07-15 15:10:27 +08:00
|
|
|
<div class="wrapper">
|
|
|
|
<!-- 砍价列表 -->
|
|
|
|
<div class="box">
|
2021-08-27 14:11:06 +08:00
|
|
|
<!-- 已砍的商品 -->
|
2022-09-15 15:40:50 +08:00
|
|
|
<goodsTemplate type="kanJia" v-if="bargainList.length!=0" :res="bargainList" />
|
2021-07-15 15:10:27 +08:00
|
|
|
<div class="bargain empty" v-else>
|
|
|
|
<u-empty text="暂无活动" mode="list"></u-empty>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { getBargainList } from "@/api/promotions";
|
2022-09-15 15:40:50 +08:00
|
|
|
import goodsTemplate from '@/components/m-goods-list/promotion'
|
2021-07-15 15:10:27 +08:00
|
|
|
export default {
|
2022-09-15 15:40:50 +08:00
|
|
|
components:{goodsTemplate},
|
2021-07-15 15:10:27 +08:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
background: {
|
2021-07-20 18:05:50 +08:00
|
|
|
backgroundColor: "transparent",
|
2021-07-15 15:10:27 +08:00
|
|
|
},
|
|
|
|
params: {
|
|
|
|
promotionStatus: "START", //开始/上架
|
|
|
|
pageNumber: 1,
|
|
|
|
pageSize: 20,
|
|
|
|
},
|
|
|
|
bargainList: [], //砍价活动列表
|
|
|
|
};
|
|
|
|
},
|
|
|
|
onShow() {
|
2021-07-20 18:05:50 +08:00
|
|
|
this.params.pageNumber = 1;
|
|
|
|
this.bargainList = [];
|
|
|
|
this.init();
|
|
|
|
},
|
|
|
|
onReachBottom() {
|
|
|
|
this.params.pageNumber++;
|
2021-07-15 15:10:27 +08:00
|
|
|
this.init();
|
|
|
|
},
|
|
|
|
methods: {
|
2021-08-27 14:11:06 +08:00
|
|
|
// 返回上一级
|
|
|
|
back() {
|
|
|
|
uni.switchTab({
|
2021-08-27 17:54:52 +08:00
|
|
|
url: "/pages/tabbar/home/index",
|
2021-08-27 14:11:06 +08:00
|
|
|
});
|
|
|
|
},
|
2021-07-15 15:10:27 +08:00
|
|
|
/**
|
|
|
|
* 初始化砍价列表
|
|
|
|
*/
|
|
|
|
async init() {
|
|
|
|
let res = await getBargainList(this.params); //砍价列表
|
|
|
|
if (res.data.success) {
|
2021-07-20 18:05:50 +08:00
|
|
|
this.bargainList.push(...res.data.result.records);
|
2021-07-15 15:10:27 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
// 跳转到砍价详情
|
|
|
|
navigateToBargainDetail(val) {
|
2022-09-15 15:40:50 +08:00
|
|
|
uni.navigateTo({
|
2021-07-15 15:10:27 +08:00
|
|
|
url: `/pages/promotion/bargain/detail?id=${val.id}`,
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style lang="scss">
|
2021-07-20 18:05:50 +08:00
|
|
|
page {
|
|
|
|
background-color: $light-color !important;
|
2021-07-15 15:10:27 +08:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.wrapper {
|
2022-09-14 10:43:40 +08:00
|
|
|
background: url("https://lili-system.oss-cn-beijing.aliyuncs.com/kanjia.png");
|
2021-07-15 15:10:27 +08:00
|
|
|
background-repeat: no-repeat;
|
|
|
|
background-size: 100% 100%;
|
2022-09-15 15:40:50 +08:00
|
|
|
height: 506rpx;
|
2021-07-15 15:10:27 +08:00
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.box {
|
|
|
|
background: #fff;
|
|
|
|
border-radius: 20rpx;
|
|
|
|
position: relative;
|
2022-09-15 15:40:50 +08:00
|
|
|
top: 560rpx;
|
2021-07-15 15:10:27 +08:00
|
|
|
width: 94%;
|
|
|
|
margin: 0 auto;
|
|
|
|
> .bargain {
|
|
|
|
padding: 32rpx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.bargain-item {
|
|
|
|
align-items: center;
|
|
|
|
border-bottom: 1rpx solid #f6f6f6;
|
|
|
|
padding: 32rpx 0;
|
|
|
|
}
|
|
|
|
.goods-config {
|
|
|
|
flex: 8;
|
|
|
|
margin-left: 20rpx;
|
|
|
|
> .goods-title {
|
|
|
|
height: 80rpx;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.max-price {
|
|
|
|
color: $main-color;
|
|
|
|
font-size: 24rpx;
|
|
|
|
> span {
|
|
|
|
font-size: 32rpx;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.goods-buy {
|
|
|
|
margin: 10rpx 0;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
|
|
|
.bargaining {
|
|
|
|
font-size: 24rpx;
|
|
|
|
color: #fff;
|
|
|
|
background: $light-color;
|
|
|
|
padding: 10rpx 24rpx;
|
|
|
|
border-radius: 100px;
|
|
|
|
}
|
|
|
|
.empty {
|
|
|
|
height: 400rpx;
|
|
|
|
}
|
|
|
|
</style>
|