123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <template>
- <!-- 价格区域 -->
- <view class="cm-product-price">
- <view class="price">
- <text class="small">¥</text><text class="big">{{ bigPrice }}</text
- ><text class="small">{{ smallPrice }}</text>
- </view>
- <view class="tags">
- <view class="tag type1" v-if="productInfo.heUserId !== 0">促销</view>
- <template v-if="productInfo.activeStatus === 1">
- <view class="tag type2" v-if="productInfo.ladderList" @click="drawerVisible = true">活动价</view>
- </template>
- </view>
- <cm-drawer :visible="drawerVisible" position="bottom" @close="drawerClose">
- <scroll-view scroll-y="true" class="scroll-box">
- <cm-activity-info :productInfo="productInfo"></cm-activity-info>
- <view class="btn" @click="drawerVisible = false">了解</view>
- </scroll-view>
- </cm-drawer>
- </view>
- </template>
- <script>
- import CmDrawer from '@/components/cm-module/cm-drawer/cm-drawer.vue'
- import CmActivityInfo from '@/components/cm-module/cm-activity-info/cm-activity-info.vue'
- export default {
- components: {
- CmDrawer,
- CmActivityInfo
- },
- data() {
- return {
- drawerVisible: false
- }
- },
- props: {
- productInfo: {
- type: Object,
- default: () => {}
- }
- },
- computed: {
- price() {
- return Number(this.productInfo.price).toFixed(2)
- },
- bigPrice() {
- return this.price.split('.')[0]
- },
- smallPrice() {
- return '.' + this.price.split('.')[1]
- }
- },
- methods: {
- drawerClose() {
- this.drawerVisible = false
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .cm-product-price {
- position: relative;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- padding: 12rpx 0;
- .price {
- color: #ff457b;
- .small {
- font-size: 36rpx;
- }
- .big {
- font-size: 48rpx;
- }
- }
- .tags {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- margin-left: 24rpx;
- .tag {
- display: flex;
- justify-content: center;
- align-items: center;
- height: 30rpx;
- margin-right: 8rpx;
- font-size: 22rpx;
- &.type1 {
- width: 56rpx;
- background: #ff457b;
- border-radius: 4rpx;
- color: #ffffff;
- }
- &.type2 {
- width: 80rpx;
- background: url(https://static.caimei365.com/app/mini-hehe/icon/icon-active.png) top center no-repeat;
- background-size: 80rpx 30rpx;
- color: #f83c6c;
- }
- }
- }
- }
- .scroll-box {
- height: 500rpx;
- box-sizing: border-box;
- padding: 70rpx 0 24rpx;
- .btn {
- width: 100%;
- height: 88rpx;
- margin-top: 24rpx;
- background: #ff457b;
- line-height: 88rpx;
- text-align: center;
- color: #ffffff;
- font-size: 28rpx;
- border-radius: 44rpx;
- }
- }
- </style>
|