首页 > 其他分享 >uniapp+vue3 优惠券样式

uniapp+vue3 优惠券样式

时间:2023-12-05 09:11:18浏览次数:32  
标签:uniapp 优惠券 color height item vue3 font margin size

效果如图:

template部分:

  <view class="item">
    <view class="box">
      <view class="content">
        <view class="head">优惠券</view>
        <view class="content-box1">
          <view class="coupons-name">开业大酬宾</view>
          <view class="effective-date"> 有效期至:2023年12月5日 </view>
        </view>
        <view class="content-box2">
          <view class="discount">
            ¥
            <text style="font-size: 40rpx; font-weight: bold">10</text>
          </view>
          <view class="memo">满100元可用</view>
        </view>

        <view class="dot-left"></view>
        <view class="dot-right"></view>
      </view>
      <view class="footer">
        <view class="footer-label"> 使用说明 <text class="icon-help"></text> </view>
        <view class="m-button">
          <view class="button-button">去使用</view>
        </view>
      </view>
    </view>
  </view>

scss样式:

<style lang="scss">
page {
  height: 100%;
  overflow: hidden;
  background-color: #f7f7f8;
}

.item {
  width: 349px;
  overflow: hidden;
  padding-left: 2rpx;
  position: relative;
  margin: 0 auto;
  margin-top: 30rpx;
}
.box {
  background: #fff;
  border-radius: 20rpx;
  background: rgb(255, 255, 255);
}
.item .dot-left,
.item .dot-right {
  display: block;
  width: 24rpx;
  height: 24rpx;
  border-radius: 50%;
  background: #f5f5f5;
  position: absolute;
  z-index: 999;
}
.item .dot-left {
  bottom: -12rpx;
  left: -12rpx;
}
.item .dot-right {
  bottom: -12rpx;
  right: -12rpx;
}
.item .content {
  width: 100%;
  height: 160rpx;
  border-bottom: 1rpx dotted #f5f5f5;
  position: relative;
  z-index: 2;

  .head {
    width: 120rpx;
    height: 40rpx;
    padding: 5rpx;
    text-align: center;
    border-top-left-radius: 20rpx;
    border-bottom-right-radius: 20rpx;
    background-color: #55bb8a;
    color: white;
    font-size: 25rpx;
  }

  .content-box1 {
    margin-left: 40rpx;
    margin-top: 8rpx;
    margin-bottom: 20rpx;
    .coupons-name {
      color: #444444;
      white-space: nowrap;
      font-size: 30rpx;
      margin-bottom: 10rpx;
      width: 350rpx;
      white-space: nowrap; /* 禁止文本换行 */
      overflow: hidden; /* 隐藏超出容器的文本 */
      text-overflow: ellipsis; /* 超出显示省略号 */
    }
    .effective-date {
      font-size: 24rpx;
      color: #444444;
    }
  }

  .content-box2 {
    position: absolute;
    top: 40rpx;
    right: 50rpx;
    text-align: center;

    .discount {
      display: block;
      font-size: 24rpx;
      color: #55bb8a;
    }

    .memo {
      display: block;
      font-size: 24rpx;
      margin-top: 5rpx;
      color: #55bb8a;
    }
  }
}

.item .footer {
  color: #444444;
  font-size: 26rpx;
  height: 80rpx;
  padding-left: 40rpx;
}
.m-button {
  position: absolute;
  bottom: 20rpx;
  right: 40rpx;
  text-align: center;
  .button-button {
    background-color: #55bb8a;
    border-radius: 10rpx;
    color: white;
    width: 130rpx;
    height: 45rpx;
    padding: 5rpx;
    font-size: 26rpx;
  }
}
.footer-label {
  line-height: 80rpx;
  widows: 150rpx;
}
</style>

 

标签:uniapp,优惠券,color,height,item,vue3,font,margin,size
From: https://www.cnblogs.com/zengbingqian/p/17876470.html

相关文章

  • Vue3 实现网页水印
    一些公司和组织出于系统文件或信息安全保密的需要,需要在系统网页上增加带有个人标识的水印。首先我们来看这样一个水印功能的实现思路,通常是在我们原有的网页上附上一个DIV层,将它设置绝对定位铺满整个窗口,然后z-index值尽量往大了设,保证让水印层处于当前网页所有元素的上面,又不......
  • uniapp获取用户信息
    新接口getUserProfileFn内置login,如果必须要login返回的参数要隔离开vue3书写要对按钮配置属性<button@click="logintou"data-eventsync="true"class="main-login-bottom">授权登录</button>——————————————————constapp=getApp()exportletloginFn......
  • vue3 setup 父组件向子组件传递参数、方法|子组件向父组件传递数据,函数
    https://blog.csdn.net/qq_27517377/article/details/123163381https://blog.csdn.net/qq_27517377/article/details/123166367vue3setup父组件向子组件传递参数参数<template><el-rowclass="mb-4"> <el-buttontype="danger">props.vue传......
  • 手写类似于BetterScroll样式的左右联动菜单 uni-app+vue3+ts (使用了script setup语法
     注意:在模拟器用鼠标滚动是不会切换光标的,因为使用的是触摸滑动。【自定义类型贴在最后了】script部分如下:import{onMounted}from'vue'importtype{orderDetail}from'@/types/category'importtype{mainArr}from'@/types/main-arr'import{nextTick,ref}......
  • vue3使用::v-deep深度选择器不生效
    会出现 ::v-deepusageasacombinatorhasbeendeprecated.Use:deep(<inner-selector>)insteadof::v-deep<inner-selector>.的报错::v-depth用作组合子已被弃用。使用:deep(<内部选择器>)而不是::v-deep<内部选择器>。需要改成:deep(class),示例代码如下:deep(.el-checkbo......
  • Vue3用户代码片段
    1.defineComponent语法{ "Printtoconsole":{ "prefix":"vue3", "body":[ "<template>", "<divclass=\"container\">", "", "</div>&q......
  • 基于uQRCode封装的Vue3二维码生成插件
    标题:基于uQRCode封装的Vue3二维码生成插件摘要:本文介绍了一种基于uQRCode封装的Vue3二维码生成插件,可以在Javascript运行环境下生成二维码并返回图片地址。该插件适用于所有Javascript运行环境,并且支持微信小程序。本文将详细介绍该插件的使用方法,并给出一个基于Vue3的示例。关......
  • 自定义精美商品分类列表组件 侧边栏商品分类组件 category组件(适配vue3)
    随着技术的发展,开发的复杂度也越来越高,传统开发方式将一个系统做成了整块应用,经常出现的情况就是一个小小的改动或者一个小功能的增加可能会引起整体逻辑的修改,造成牵一发而动全身。通过组件化开发,可以有效实现单独开发,单独维护,而且他们之间可以随意的进行组合。大大提升开发效率......
  • vue3中css使用js中的变量
    <scriptsetuplang="ts">import{SoundOutlined}from'@ant-design/icons-vue'constprops=defineProps({title:{type:String,default:''},color:{type:String,default:'#000'}......
  • uniapp 通过命令行创建,运行,发布
    环境安装npminstall-g@vue/cli创建uni-appVue3js版npxdegitdcloudio/uni-preset-vue#viteuniapp-vue3-project源码git: https://gitee.com/dcloud/uni-preset-vue运行、发布uni-appcduniapp-vue3-projectnpminstallnpmrundev:%PLATFORM%npmrunbuild:%PLATFORM%%P......