砍价活动修改bug

master
lemon橪 2021-08-27 14:11:06 +08:00
parent 52e6c57f70
commit cb982c2883
8 changed files with 180 additions and 11 deletions

View File

@ -163,12 +163,17 @@ export function getBargainLog(params) {
});
}
/**
* 分页获取砍价活动-帮砍记录
* 分页获取已参与的砍价活动
*/
export function helpBargain(kanJiaActivityId) {
export function getMineBargainLog(params) {
return http.request({
url: `promotion/kanjiaGoods/help/${kanJiaActivityId}`,
method: Method.POST,
url: `/promotion/kanjiaGoods/kanjiaActivity/mine/`,
method: Method.GET,
params
});
}

View File

@ -503,6 +503,11 @@
"navigationBarTextStyle": "white"
}
},{
"path": "bargain/log",
"style": {
"navigationBarTitleText": "砍价记录"
}
},{
"path": "point/detail",
"style": {

View File

@ -1,6 +1,7 @@
<template>
<div class="page">
<u-navbar back-icon-color="#fff" :background="background" :border-bottom="false" title=""></u-navbar>
<u-navbar :custom-back="back" back-icon-color="#fff" :background="background" :border-bottom="false" title="">
</u-navbar>
<div class="wrapper">
<!-- 砍价列表 -->
@ -43,7 +44,8 @@
立即购买
</div>
<!-- 我要开团 -->
<div class="start" v-if="activityData.memberId != $options.filters.isLogin().id" @click="startOpenGroup"></div>
<div class="start" v-if="activityData.memberId != $options.filters.isLogin().id" @click="startOpenGroup">
</div>
</div>
</div>
<!-- 帮砍列表 -->
@ -207,6 +209,18 @@ export default {
},
},
methods: {
//
back() {
//
if (getCurrentPages().length > 1) {
uni.navigateBack();
} else {
uni.redirectTo({
url: `/pages/promotion/bargain/list`,
});
}
},
//
startOpenGroup() {
uni.redirectTo({
@ -232,6 +246,7 @@ export default {
});
this.$refs.popupGoods.buy({
skuId: this.bargainDetail.id,
id: this.routerVal.id,
num: 1,
cartType: "KANJIA",
});

View File

@ -1,9 +1,11 @@
<template>
<div class="page">
<u-navbar back-icon-color="#fff" :background="background" :border-bottom="false" title=""></u-navbar>
<u-navbar :custom-back="back" back-icon-color="#fff" :background="background" :border-bottom="false" title="">
</u-navbar>
<div class="wrapper">
<!-- 砍价列表 -->
<div class="box">
<!-- 已砍的商品 -->
<div class="bargain" v-if="bargainList.length!=0">
<div class="flex bargain-item" v-for="(item,index) in bargainList" :key="index">
<div class="goods-img">
@ -54,6 +56,12 @@ export default {
this.init();
},
methods: {
//
back() {
uni.switchTab({
url:"/pages/tabbar/home/index"
});
},
/**
* 初始化砍价列表
*/
@ -100,7 +108,6 @@ page {
}
.bargain-item {
align-items: center;
border-bottom: 1rpx solid #f6f6f6;
padding: 32rpx 0;
}

View File

@ -0,0 +1,133 @@
<template>
<div class="box">
<div v-if="bargainLog.length != 0">
<div v-for="(item,index) in bargainLog" class="flex" :key="index">
<div>
<u-image width='250' height="250" :src="item.thumbnail"></u-image>
</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>
<u-empty text="暂无砍价活动"></u-empty>
</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) {
uni.navigateTo({
url: `/pages/promotion/bargain/detail?id=${val.kanjiaActivityGoodsId}`,
});
},
},
};
</script>
<style scoped>
page {
background: #fff;
}
</style>
<style scoped lang="scss">
.box {
padding: 32rpx;
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;
align-items: center;
}
.tips {
color: #999;
margin-top: 20rpx;
}
.surplusPrice {
font-size: 40rpx;
margin-left: 10rpx;
font-weight: bold;
color: $light-color;
}
.goods {
display: flex;
flex: 2;
flex-direction: column;
justify-content: center;
}
.SUCCESS {
color: $light-color;
}
.START {
color: $aider-light-color;
}
.END {
color: #999;
}
.FAIL {
color: $main-color;
}
</style>

View File

@ -4,7 +4,8 @@
<view class="index-head">
<scroll-view scroll-x class="list-scroll-content" :scroll-left="currentLeft" scroll-with-animation>
<view class="index-head-navs">
<view class="index-head-nav" v-for="(ele, index) in categoryIndexData" :key="index" :class="{ 'index-head-nav-active': tabIndex == index }" @click="setCat(index)">
<view class="index-head-nav" v-for="(ele, index) in categoryIndexData" :key="index"
:class="{ 'index-head-nav-active': tabIndex == index }" @click="setCat(index)">
{{ ele.name }}
</view>
</view>
@ -23,7 +24,7 @@
</u-image>
<view class="index-item-title">{{ item.goodsSku.goodsName }}</view>
<view class="index-item-price">
{{ item.points | unitPrice }}积分
{{ item.points }}积分
<span class="tipsMkt">¥{{ item.goodsSku.price | unitPrice }}</span>
</view>
</view>
@ -264,7 +265,6 @@ page {
}
.index-head-nav {
width: 100rpx;
padding-bottom: 8rpx;
margin: 20rpx;
text-align: center;

View File

@ -54,6 +54,10 @@
<image src="/static/mine/distribution.png" mode=""></image>
<view>我的分销</view>
</view>
<view class="interact-item" @click="navigateTo('/pages/promotion/bargain/log')">
<image src="/static/mine/kanjia.png" mode=""></image>
<view>砍价记录</view>
</view>
</view>
</div>
</view>

BIN
static/mine/kanjia.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB