feat:抵扣券换成数字积分

This commit is contained in:
2026-06-25 19:44:48 +08:00
parent 3523cc3a21
commit 363f4a0c52
7 changed files with 76 additions and 48 deletions
+13 -14
View File
@@ -1,35 +1,34 @@
<template> <template>
<view :style="{ height: safeHeight + 'px',width:width + 'px',backgroundColor:bgColor}" <view :style="{ height: safeHeight + 'px', width: width + 'px', backgroundColor: bgColor }" class="top-view">
class="top-view">
</view> </view>
</template> </template>
<script> <script>
import {screen} from './global.js' import { screen } from './global.js'
export default { export default {
data() { data() {
return { return {
safeHeight:screen.top, safeHeight: screen.top,
width:screen.width width: screen.width
} }
}, },
props: { props: {
bgColor:{ bgColor: {
type:String, type: String,
default:'#fff' default: '#fff'
} }
}, },
onShow(){ onShow() {
// safeHeight:screen.top, // safeHeight:screen.top,
// width:screen.width, // width:screen.width,
}, },
mounted(){ mounted() {
this.width = screen.width; this.width = screen.width;
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.top-view{ .top-view {
display: flex; display: flex;
} }
</style> </style>
+1 -1
View File
@@ -8,7 +8,7 @@
<!-- 有优惠券 --> <!-- 有优惠券 -->
<view class="flex-r-lr price-line coupon-line" v-if="obj.buyDeductionValue"> <view class="flex-r-lr price-line coupon-line" v-if="obj.buyDeductionValue">
<view class="text-28 text-zi text-bold"> <view class="text-28 text-zi text-bold">
<view class="text-36 text-bold">{{ obj.buyDeductionValue }}抵扣券</view> <view class="text-28 text-bold">{{ obj.buyDeductionValue }}数字积分</view>
<view class="text-24">+{{ obj.price }}元</view> <view class="text-24">+{{ obj.price }}元</view>
</view> </view>
<text class="text-20 sold">兑换</text> <text class="text-20 sold">兑换</text>
+1 -1
View File
@@ -88,7 +88,7 @@
<view class="content_item_yd_msg">(快递动态跟进请复制单号至[快递100官网] 查询)</view> <view class="content_item_yd_msg">(快递动态跟进请复制单号至[快递100官网] 查询)</view>
<view>共{{ item.buyNum }}件,合计¥{{ item.sumAmount }}</view> <view>共{{ item.buyNum }}件,合计¥{{ item.sumAmount }}</view>
</view> --> </view> -->
<view class="collect_msg" v-if="item.buyDeductionValue">共{{ item.buyNum }}件,合计抵扣券{{item.buyDeductionValue}} +¥{{item.sumAmount}}</view> <view class="collect_msg" v-if="item.buyDeductionValue">共{{ item.buyNum }}件,合计数字积分{{item.buyDeductionValue}} +¥{{item.sumAmount}}</view>
<view class="collect_msg" v-if="!item.buyDeductionValue">运费:¥{{ item.postage }},商品总价:¥{{item.sumAmount}}</view> <view class="collect_msg" v-if="!item.buyDeductionValue">运费:¥{{ item.postage }},商品总价:¥{{item.sumAmount}}</view>
<view class="collect_msg" v-if="!item.buyDeductionValue">共{{ item.buyNum }}件,合计¥{{ item.sumAmount + item.postage }}</view> <view class="collect_msg" v-if="!item.buyDeductionValue">共{{ item.buyNum }}件,合计¥{{ item.sumAmount + item.postage }}</view>
<view class="collect_operate"> <view class="collect_operate">
@@ -106,7 +106,7 @@
<view class="data_item"> <view class="data_item">
<view class="item_title">商品总价</view> <view class="item_title">商品总价</view>
<view class="item_value" v-if="!orderInfo.buyDeductionValue">¥{{ orderInfo.sumAmount }}</view> <view class="item_value" v-if="!orderInfo.buyDeductionValue">¥{{ orderInfo.sumAmount }}</view>
<view class="item_value" v-else>抵扣券{{ orderInfo.buyDeductionValue }} +¥{{ orderInfo.sumAmount }}</view> <view class="item_value" v-else>数字积分{{ orderInfo.buyDeductionValue }} +¥{{ orderInfo.sumAmount }}</view>
</view> </view>
<view class="data_item"> <view class="data_item">
<view class="item_title">快递运费</view> <view class="item_title">快递运费</view>
@@ -114,8 +114,8 @@
</view> </view>
<view class="data_item" v-if="orderInfo.buyDeductionValue"> <view class="data_item" v-if="orderInfo.buyDeductionValue">
<view class="item_title">抵扣券</view> <view class="item_title">数字积分</view>
<view class="item_value" style="color: #7934F6">{{ orderInfo.buyDeductionValue }}抵扣券</view> <view class="item_value" style="color: #7934F6">{{ orderInfo.buyDeductionValue }}数字积分</view>
</view> </view>
<view class="data_item"> <view class="data_item">
@@ -133,12 +133,12 @@
<!-- 优惠券信息 --> <!-- 优惠券信息 -->
<view class="order_way_warp_two" v-if="isCoupon"> <view class="order_way_warp_two" v-if="isCoupon">
<view class="price-view"> <view class="price-view">
<text class="text-32 text-zu">抵扣券余额</text> <text class="text-32 text-zu">数字积分余额</text>
<text class="text-32 text-zu text-bold">{{ couponData.balance || 0 }}</text> <text class="text-32 text-zu text-bold">{{ couponData.balance || 0 }}</text>
</view> </view>
<view class="price-view"> <view class="price-view">
<text class="text-32 text-zu">实付抵扣券 </text> <text class="text-32 text-zu">实付数字积分 </text>
<text class="text-32 text-zu text-bold">{{ buyCouponvalue }}</text> <text class="text-32 text-zu text-bold">{{ buyCouponvalue }}</text>
</view> </view>
</view> </view>
@@ -169,7 +169,7 @@
<view class="price-view"> <view class="price-view">
<text class="text-32 text-zu">商品总价</text> <text class="text-32 text-zu">商品总价</text>
<text class="text-32 text-zu text-bold" v-if="isCoupon"> <text class="text-32 text-zu text-bold" v-if="isCoupon">
{{ `${buyCouponvalue}抵扣券+${orderInfo.amount - (orderInfo.postage || 0) + {{ `${buyCouponvalue}数字积分+${orderInfo.amount - (orderInfo.postage || 0) +
(orderInfo.enterpriseAmount (orderInfo.enterpriseAmount
|| 0)}元` }} || 0)}元` }}
</text> </text>
@@ -183,8 +183,8 @@
</view> </view>
<view class="price-view" v-if="isCoupon"> <view class="price-view" v-if="isCoupon">
<text class="text-32 text-zu">抵扣券</text> <text class="text-32 text-zu">数字积分</text>
<text class="text-32 text-zu text-bold">{{ buyCouponvalue }}抵扣券</text> <text class="text-32 text-zu text-bold">{{ buyCouponvalue }}数字积分</text>
</view> </view>
<view class="price-view" v-if="user?.isEnterpriseUser"> <view class="price-view" v-if="user?.isEnterpriseUser">
<text class="text-32 text-zu">企业用户优惠</text> <text class="text-32 text-zu">企业用户优惠</text>
@@ -366,8 +366,8 @@ export default {
isCoupon: false, // 是否优惠卷 isCoupon: false, // 是否优惠卷
couponData: {}, // 优惠卷数据 couponData: {}, // 优惠卷数据
allOrderInfo: {}, // 所有订单信息 allOrderInfo: {}, // 所有订单信息
buyCouponvalue: 0, // 实付抵扣券积分 buyCouponvalue: 0, // 实付数字积分积分
buyCouponAmount: 0, // 实付抵扣券对应的钱 buyCouponAmount: 0, // 实付数字积分对应的钱
}; };
}, },
async onLoad(option) { async onLoad(option) {
@@ -415,12 +415,12 @@ export default {
methods: { methods: {
getValue, getValue,
assembleAddress, assembleAddress,
// 实付抵扣券 // 实付数字积分
onBuyCouponvalue(currentQuantity) { onBuyCouponvalue(currentQuantity) {
this.buyCouponvalue = Number((this.allOrderInfo.buyDeductionValue * (currentQuantity || 1)).toFixed(2)) || 0; this.buyCouponvalue = Number((this.allOrderInfo.buyDeductionValue * (currentQuantity || 1)).toFixed(2)) || 0;
}, },
// 实付抵扣券对应的钱 // 实付数字积分对应的钱
onBuyCouponAmount() { onBuyCouponAmount() {
this.buyCouponAmount = Number((this.sed.goodsNum * this.allOrderInfo.buyDeduction).toFixed(2)) || 0; this.buyCouponAmount = Number((this.sed.goodsNum * this.allOrderInfo.buyDeduction).toFixed(2)) || 0;
}, },
@@ -31,11 +31,11 @@
"> ">
<view class="content_data_price buy_deduction" v-if="orderInfo.buyDeductionValue"> <view class="content_data_price buy_deduction" v-if="orderInfo.buyDeductionValue">
<view class="buy_deduction_value"> <view class="buy_deduction_value">
<text class="text-38 text-bold mr-10">{{ orderInfo.buyDeductionValue }}抵扣券</text> <text class="text-38 text-bold mr-10">{{ orderInfo.buyDeductionValue }}数字积分</text>
<text class="text-24">+{{ orderInfo.minPrice }}元</text> <text class="text-24">+{{ orderInfo.minPrice }}元</text>
</view> </view>
<view class="buy_deduction_label"> <view class="buy_deduction_label">
兑后抵扣券不退 兑后数字积分不退
</view> </view>
</view> </view>
<view class="content_data_price" v-else> <view class="content_data_price" v-else>
@@ -190,7 +190,7 @@
<view class="price_warp"> <view class="price_warp">
<!-- 优惠券价格 --> <!-- 优惠券价格 -->
<view class="price_content_warp" v-if="isCoupon"> <view class="price_content_warp" v-if="isCoupon">
<text class="text-38 text-bold mr-10">{{ orderInfo.buyDeductionValue }}抵扣券</text> <text class="text-38 text-bold mr-10">{{ orderInfo.buyDeductionValue }}数字积分</text>
<text class="text-24" v-if=" <text class="text-24" v-if="
selectSpecificationTempl && selectSpecificationTempl &&
Object.keys(selectSpecificationTempl).length !== 0">+{{ selectSpecificationTempl.price }}元</text> Object.keys(selectSpecificationTempl).length !== 0">+{{ selectSpecificationTempl.price }}元</text>
+35 -6
View File
@@ -1,14 +1,17 @@
<template> <template>
<view class="content"> <view class="content">
<TopSafe></TopSafe> <TopSafe></TopSafe>
<Header :isBack="false"> <Header :isBack="false" height="88rpx">
<!-- #ifndef MP-WEIXIN -->
<template v-slot:left> <template v-slot:left>
<view class="header-left-content">
<u-icon size="36rpx" name="arrow-left" color="#000" @click="goback"></u-icon> <u-icon size="36rpx" name="arrow-left" color="#000" @click="goback"></u-icon>
抵扣券专区: {{ balanceData.curAmount || 0 }} <up-image src="https://static.tbmall.xin/static/mine-purse/vcoin.png" width="22" height="22"
bgColor="#f1f6ff00" class="purse_amount"></up-image>
<text class="header-text">数字积分兑换专区: {{ balanceData.curAmount || 0 }}</text>
</view>
</template> </template>
<!-- #endif -->
</Header> </Header>
<view class="swiper-view"> <view class="swiper-view">
<view :class="['swiper-item', { 'active': currentItem === item.key }]" v-for="(item, index) in swiperList" <view :class="['swiper-item', { 'active': currentItem === item.key }]" v-for="(item, index) in swiperList"
:key="index" @click="onClickItem(item)"> :key="index" @click="onClickItem(item)">
@@ -184,6 +187,24 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.header-left-content {
display: flex;
flex-direction: row;
align-items: center;
}
.header-text {
font-size: 28rpx;
color: #333;
}
.purse_amount{
width: 36rpx;
height: 36rpx;
margin: 0 12rpx;
display: flex;
align-items: center;
justify-content: center;
}
.bottom-btn { .bottom-btn {
width: 100%; width: 100%;
margin-bottom: 92rpx; margin-bottom: 92rpx;
@@ -198,7 +219,7 @@ export default {
.swiper-view { .swiper-view {
width: 100%; width: 100%;
height: 80rpx; height: 70rpx;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
background: #FFFFFF; background: #FFFFFF;
@@ -210,12 +231,19 @@ export default {
.swiper-item { .swiper-item {
padding: 0 16rpx; padding: 0 16rpx;
height: 100%; height: 100%;
min-height: 40px;
color: #666; color: #666;
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-shrink: 0; flex-shrink: 0;
box-sizing: border-box; box-sizing: border-box;
font-size: 28rpx;
.swiper-item-content {
font-size: 28rpx;
line-height: 40rpx;
}
&.active { &.active {
color: #7A35F6; color: #7A35F6;
@@ -226,7 +254,8 @@ export default {
.name-box { .name-box {
width: 100%; width: 100%;
flex: 1; // flex: 1;
height: calc(100% - 88rpx - 70rpx - var(--status-bar-height));
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;