砍价活动修改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({ return http.request({
url: `promotion/kanjiaGoods/help/${kanJiaActivityId}`, url: `/promotion/kanjiaGoods/kanjiaActivity/mine/`,
method: Method.POST, method: Method.GET,
params
}); });
} }

View File

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

View File

@ -1,6 +1,7 @@
<template> <template>
<div class="page"> <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="wrapper">
<!-- 砍价列表 --> <!-- 砍价列表 -->
@ -43,7 +44,8 @@
立即购买 立即购买
</div> </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>
</div> </div>
<!-- 帮砍列表 --> <!-- 帮砍列表 -->
@ -207,6 +209,18 @@ export default {
}, },
}, },
methods: { methods: {
//
back() {
//
if (getCurrentPages().length > 1) {
uni.navigateBack();
} else {
uni.redirectTo({
url: `/pages/promotion/bargain/list`,
});
}
},
// //
startOpenGroup() { startOpenGroup() {
uni.redirectTo({ uni.redirectTo({
@ -232,6 +246,7 @@ export default {
}); });
this.$refs.popupGoods.buy({ this.$refs.popupGoods.buy({
skuId: this.bargainDetail.id, skuId: this.bargainDetail.id,
id: this.routerVal.id,
num: 1, num: 1,
cartType: "KANJIA", cartType: "KANJIA",
}); });

View File

@ -1,9 +1,11 @@
<template> <template>
<div class="page"> <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="wrapper">
<!-- 砍价列表 --> <!-- 砍价列表 -->
<div class="box"> <div class="box">
<!-- 已砍的商品 -->
<div class="bargain" v-if="bargainList.length!=0"> <div class="bargain" v-if="bargainList.length!=0">
<div class="flex bargain-item" v-for="(item,index) in bargainList" :key="index"> <div class="flex bargain-item" v-for="(item,index) in bargainList" :key="index">
<div class="goods-img"> <div class="goods-img">
@ -54,6 +56,12 @@ export default {
this.init(); this.init();
}, },
methods: { methods: {
//
back() {
uni.switchTab({
url:"/pages/tabbar/home/index"
});
},
/** /**
* 初始化砍价列表 * 初始化砍价列表
*/ */
@ -100,7 +108,6 @@ page {
} }
.bargain-item { .bargain-item {
align-items: center; align-items: center;
border-bottom: 1rpx solid #f6f6f6; border-bottom: 1rpx solid #f6f6f6;
padding: 32rpx 0; 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"> <view class="index-head">
<scroll-view scroll-x class="list-scroll-content" :scroll-left="currentLeft" scroll-with-animation> <scroll-view scroll-x class="list-scroll-content" :scroll-left="currentLeft" scroll-with-animation>
<view class="index-head-navs"> <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 }} {{ ele.name }}
</view> </view>
</view> </view>
@ -23,7 +24,7 @@
</u-image> </u-image>
<view class="index-item-title">{{ item.goodsSku.goodsName }}</view> <view class="index-item-title">{{ item.goodsSku.goodsName }}</view>
<view class="index-item-price"> <view class="index-item-price">
{{ item.points | unitPrice }}积分 {{ item.points }}积分
<span class="tipsMkt">¥{{ item.goodsSku.price | unitPrice }}</span> <span class="tipsMkt">¥{{ item.goodsSku.price | unitPrice }}</span>
</view> </view>
</view> </view>
@ -264,7 +265,6 @@ page {
} }
.index-head-nav { .index-head-nav {
width: 100rpx;
padding-bottom: 8rpx; padding-bottom: 8rpx;
margin: 20rpx; margin: 20rpx;
text-align: center; text-align: center;

View File

@ -54,6 +54,10 @@
<image src="/static/mine/distribution.png" mode=""></image> <image src="/static/mine/distribution.png" mode=""></image>
<view>我的分销</view> <view>我的分销</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> </view>
</div> </div>
</view> </view>

BIN
static/mine/kanjia.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB