2021-08-27 14:11:06 +08:00
|
|
|
<template>
|
|
|
|
<div class="box">
|
|
|
|
<div v-if="bargainLog.length != 0">
|
|
|
|
<div v-for="(item,index) in bargainLog" class="flex" :key="index">
|
|
|
|
<div>
|
2021-08-27 17:54:52 +08:00
|
|
|
<u-image border-radius="20" width='230' height="230" :src="item.thumbnail"></u-image>
|
2021-08-27 14:11:06 +08:00
|
|
|
</div>
|
|
|
|
<div class="goods">
|
|
|
|
<div class="wes-2">
|
|
|
|
{{item.goodsName}}
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
还剩<span class="surplusPrice">{{item.surplusPrice | unitPrice}}元</span>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div @click="navigateToBargainDetail(item)" v-if="item.status == 'START'" class="buy">
|
|
|
|
继续免费领
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="tips-box">
|
|
|
|
<div class="tips" :class="[item.status]">
|
|
|
|
{{statusWay[item.status]}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-else>
|
2021-09-08 09:52:04 +08:00
|
|
|
<u-empty style="margin-top:20%;" text="暂无砍价活动"></u-empty>
|
2021-08-27 14:11:06 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { getMineBargainLog } from "@/api/promotions";
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
params: {
|
|
|
|
pageNumber: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
},
|
|
|
|
bargainLog: [],
|
|
|
|
statusWay: {
|
|
|
|
START: "砍价开始",
|
|
|
|
FAIL: "砍价失败",
|
|
|
|
SUCCESS: "砍价成功",
|
|
|
|
END: "活动结束",
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
onReachBottom() {
|
|
|
|
this.params.pageNumber++;
|
|
|
|
this.init();
|
|
|
|
},
|
|
|
|
onShow() {
|
|
|
|
this.params.pageNumber = 1;
|
|
|
|
this.bargainLog = [];
|
|
|
|
this.init();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
// 初始化砍价记录
|
|
|
|
async init() {
|
|
|
|
let res = await getMineBargainLog(this.params);
|
|
|
|
if (res.data.success) {
|
|
|
|
this.bargainLog.push(...res.data.result.records);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// 跳转到砍价详情
|
|
|
|
navigateToBargainDetail(val) {
|
2022-09-15 15:40:50 +08:00
|
|
|
uni.navigateTo({
|
2021-08-27 14:11:06 +08:00
|
|
|
url: `/pages/promotion/bargain/detail?id=${val.kanjiaActivityGoodsId}`,
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
page {
|
|
|
|
background: #fff;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.box {
|
2021-09-01 17:30:54 +08:00
|
|
|
padding: 0 32rpx;
|
2021-08-27 14:11:06 +08:00
|
|
|
background: #fff;
|
|
|
|
}
|
|
|
|
.buy {
|
|
|
|
background: $light-color;
|
|
|
|
color: #fff;
|
|
|
|
display: inline;
|
|
|
|
padding: 10rpx 0;
|
|
|
|
border-radius: 100rpx;
|
|
|
|
width: 200rpx;
|
|
|
|
text-align: center;
|
|
|
|
font-size: 24rpx;
|
|
|
|
margin-top: 20rpx;
|
|
|
|
}
|
|
|
|
.tips-box {
|
|
|
|
flex: 1;
|
|
|
|
justify-content: center;
|
|
|
|
display: flex;
|
2021-09-01 17:30:54 +08:00
|
|
|
|
2021-08-27 14:11:06 +08:00
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
.tips {
|
|
|
|
color: #999;
|
|
|
|
|
|
|
|
margin-top: 20rpx;
|
|
|
|
}
|
|
|
|
.surplusPrice {
|
|
|
|
font-size: 40rpx;
|
|
|
|
margin-left: 10rpx;
|
|
|
|
font-weight: bold;
|
|
|
|
color: $light-color;
|
|
|
|
}
|
|
|
|
.goods {
|
2021-08-27 17:54:52 +08:00
|
|
|
margin: 0 20rpx;
|
2021-08-27 14:11:06 +08:00
|
|
|
display: flex;
|
|
|
|
flex: 2;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
2021-09-01 17:30:54 +08:00
|
|
|
.flex {
|
|
|
|
border-bottom: 1rpx solid #f7f7f7;
|
|
|
|
|
|
|
|
padding: 20rpx 0;
|
|
|
|
margin: 10rpx 0;
|
|
|
|
}
|
2021-08-27 14:11:06 +08:00
|
|
|
.SUCCESS {
|
|
|
|
color: $light-color;
|
|
|
|
}
|
|
|
|
.START {
|
|
|
|
color: $aider-light-color;
|
|
|
|
}
|
|
|
|
.END {
|
|
|
|
color: #999;
|
|
|
|
}
|
|
|
|
.FAIL {
|
|
|
|
color: $main-color;
|
|
|
|
}
|
|
|
|
</style>
|