123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- <template>
- <view class="goods-price">
- <view class="row">
- <view class="price"> <text class="amount">9999.00</text> <text class="delete">12888.00</text> </view>
- <view class="price-tags">
- <!-- <view class="tag-pt">拼团价</view>
- <view class="tag-hd">活动价</view> -->
- <view class="tag-xs">限时特价</view>
- </view>
- </view>
- <view class="row">
- <!-- 券后价 -->
- <view class="tag-qh">券后价¥6000.00</view>
- </view>
- <!-- 限时特价结束时间 -->
- <view class="countdown-box">
- <view class="tip">距离结束</view>
- <view class="time">
- <!-- 时 -->
- <text class="hh">72</text>:
- <!-- 分 -->
- <text class="mm">48</text>:
- <!-- 秒 -->
- <text class="ss">33</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: 'goods-price',
- props: {
- priceType: {
- type: String,
- default: 'normal',
- validator: value => {
- /* normal: 普通价 | group: 拼团价 | activity: 活动价 | time-limit: 限时特价 | */
- return ['normal', 'group', 'activity', 'time-limit'].indexOf(value) > -1
- }
- },
- productData: {
- type: Object,
- default: () => {}
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .goods-price {
- position: relative;
- padding: 24rpx;
- background-color: #fff;
- .row {
- @extend .cm-flex-center;
- justify-content: flex-start;
- &:nth-child(2) {
- margin-top: 4rpx;
- }
- }
- .price {
- .amount {
- font-size: 48rpx;
- font-weight: bold;
- color: #ff457b;
- &::before {
- content: '¥';
- font-size: 24rpx;
- vertical-align: 2rpx;
- }
- }
- .delete {
- margin-left: 16rpx;
- font-size: 26rpx;
- font-weight: 400;
- color: #999999;
- text-decoration: line-through;
- &::before {
- content: '¥';
- }
- }
- }
- .price-tags {
- margin-left: 24rpx;
- @extend .cm-flex-center;
- justify-content: flex-start;
- margin-top: 10rpx;
- .tag-pt {
- @extend .cm-flex-center;
- height: 32rpx;
- padding: 0 8rpx;
- background: linear-gradient(90deg, #6431f2 0%, #b03bb8 49%, #ff457b 100%);
- border-radius: 4rpx;
- font-size: 22rpx;
- color: #fff;
- }
- .tag-hd,
- .tag-xs {
- @extend .cm-flex-center;
- display: block;
- height: 30rpx;
- padding: 0 8rpx;
- background: #fff3f7;
- border: 1rpx solid #ff457b;
- border-radius: 4rpx;
- font-size: 22rpx;
- color: #ff457b;
- }
- }
- .tag-qh {
- @extend .cm-flex-center;
- height: 40rpx;
- background: #ff457b;
- border-radius: 25rpx;
- padding: 0 15rpx;
- font-size: 24rpx;
- font-weight: bold;
- color: #ffffff;
- }
- }
- .countdown-box {
- position: absolute;
- top: 50%;
- right: 24rpx;
- transform: translateY(-50%);
- @extend .cm-flex-center;
- flex-direction: column;
- width: 160rpx;
- .tip {
- font-size: 24rpx;
- color: #ff457b;
- }
- .time {
- margin-top: 20rpx;
- width: 160rpx;
- @extend .cm-flex-between;
- font-size: 24rpx;
- font-weight: bold;
- color: #333333;
- text {
- @extend .cm-flex-center;
- width: 40rpx;
- height: 40rpx;
- background: #333;
- border-radius: 4rpx;
- color: #ffffff;
- }
- }
- }
- </style>
|