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