效果:

vue:

<template>
<div class="couponItem">
<div class="itemLeft">
<span class="tagDiv">
<span class="tagLeft">折</span>
</span>
<div>
<p class="price"><strong class="priceNum">{{coupon.cdiscount}}</strong>
<span class="priceIcon">折</span></p>
<p class="coupon">满 {{coupon.minimum}} 元可使用</p>
<p class="coupon">无金额门槛</p>
</div>
</div>
<div class="itemRight">
<p class="couponName"><span class="shopTag">店铺:</span>{{coupon.deptname}}</p>
<p class="useRluer">{{coupon.cname}}</p>
<p class="useTime"><i class="timeEnd">{{coupon.validstart}}至{{coupon.validend}}</i><span class="rightBtn">立即使用</span></p>
</div>
</div>
</template> <script>
export default {
data() {
return {
coupon: {
'cdiscount': 8.8,
'minimum': 10,
'deptname': '好又多',
'cname': '全店通用',
'validstart': '2019-06-26',
'validend': '2019-06-30'
}
}
},
methods: {},
}
</script> <style scoped>
i {
font-style: normal;
} .couponItem {
width: 100%;
height: 1rem;
font-size: .14rem;
position: relative;
overflow: hidden;
background: #fff;
padding: 0 .05rem;
box-sizing: border-box;
text-align: left;
display: flex;
align-items: center;
display: -webkit-box;
display: -ms-flexbox;
display: -moz-flexbox;
margin: 1rem 0;
} .itemLeft {
width: 33%;
height: 100%;
background: -webkit-linear-gradient(left, #fa7f6d, #fc5e75);
/* Safari 5.1 - 6.0 */
background: -o-linear-gradient(right, #fa7f6d, #fc5e75);
/* Opera 11.1 - 12.0 */
background: -moz-linear-gradient(right, #fa7f6d, #fc5e75);
/* Firefox 3.6 - 15 */
background: linear-gradient(to right, #fa7f6d, #fc5e75);
/* 标准的语法 */
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
overflow: hidden;
margin-right: .1rem;
text-align: center;
} .itemLeft:before {
content: ' ';
width: 0;
height: 100%;
position: absolute;
top: 10px;
right: -2px;
border-right: 3px dotted white;/* 控制右边花纹大小 */
} .itemRight {
flex: 1;
-webkit-box-flex: 1;
-ms-flex: 1;
-moz-flex: 1;
} .rightBtn {
width: .7rem;
color: #fa644b;
border: 1px solid #fa644b;
text-align: center;
font-size: .12rem;
border-radius: 8px;
padding: .03rem 0;
} .coupon {
font-size: .12rem;
text-align: center;
color: #f4f4f4;
white-space: nowrap;
-webkit-transform: scale(0.80);
} .priceIcon {
font-size: .14rem;
margin-left: .05rem;
color: #ffffff;
} .itemLeftBttom {
font-size: .12rem;
} .price {
display: flex;
align-items: center;
justify-content: center;
} .priceNum {
font-size: .3rem;
letter-spacing: -2px;
color: #ffffff;
} .couponName {
font-size: .12rem;
padding: .05rem 0;
margin: .01rem 0 .16rem 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: rgb(77, 77, 77);
} .useRluer {
font-size: .14rem;
color: #4d4d4d;
margin-bottom: .03rem;
border-bottom: 1px dashed #cccccc;
} .useTime {
height: .3rem;
display: flex;
justify-content: space-between;
align-items: center;
font-size: .12rem;
color: #999;
} .timeEnd {
font-size: .12rem;
-webkit-transform-origin-x: 0;
-ms-transform: scale(0.8);
/* IE 9 */
-moz-transform: scale(0.8);
/* Firefox */
-webkit-transform: scale(0.8);
/* Safari 和 Chrome */
-o-transform: scale(0.8);
} .tagDiv {
background: #ff9900;
color: #fff;
position: absolute;
transform: rotate(-45deg);
font-size: .12rem;
left: -.2rem;
text-align: center;
top: -.05rem;
padding: 0 .28rem;
height: .3rem;
line-height: .3rem;
} .tagLeft {
position: absolute;
top: .035rem;
left: .22rem;
transform: rotate(45deg);
font-size: .14rem;
font-weight: bold;
}
</style>

vue 实现邮戳边缘的更多相关文章

  1. React 还是 Vue: 你应该选择哪一个Web前端框架?

    学还是要学的,用的多了,也就有更多的认识了,开发中遇到选择的时候也就简单起来了. 本文作者也做了总结: 如果你喜欢用(或希望能够用)模板搭建应用,请使用Vue    如果你喜欢简单和“能用就行”的东西 ...

  2. vue UI库iview源码解析(2)

    上篇问题 在上篇<iview源码解析(1)>中的index.js 入口文件的源码中有一段代码有点疑惑: /** * 在浏览器环境下默认加载组件 */ // auto install if ...

  3. 一个能拖动,能调整大小,能更新bind值的vue指令-vuedragx

    一. 背景说明 开发一个可自定义组件化门户配置页面,期间采用了vue框架作为前端视图引擎,作为一个刚入手vue的萌新,开发第一个功能就遇到了拦路虎.需要一个拖动并且可改变大小的容器盒子.当时查看vue ...

  4. Vue.Draggable 文档总结

    本文章转自https://blog.csdn.net/zjiang1994/article/details/79809687 Vue.Draggable学习总结 Draggable为基于Sortabl ...

  5. vue和react全面对比(详解)

    vue和react对比(详解) 放两张图镇压小妖怪 本文先讲共同之处, 再分析区别 大纲在此: 共同点: a.都使用虚拟dom b.提供了响应式和组件化的视图组件 c.注意力集中保持在核心库,而将其他 ...

  6. Vue修饰符

    为了方便大家写代码,vue.js给大家提供了很多方便的修饰符,比如我们经常用到的取消冒泡,阻止默认事件等等~ 目录 表单修饰符 事件修饰符 鼠标按键修饰符 键值修饰符 v-bind修饰符(实在不知道叫 ...

  7. 浅尝Vue.js组件(一)

    本篇目录: 组件名 组件注册 全局注册 基础组件的自动化全局注册 局部注册 在模块系统中局部注册 Prop 单向数据流 Prop验证 类型检查 非Prop特性 替换/合并已有的特性 禁用特性继承 自定 ...

  8. vue案例 - vue-awesome-swiper实现h5滑动翻页效果

    说到h5的翻页,很定第一时间想到的是swiper.但是我当时想到的却是,vue里边怎么用swiper?! 中国有句古话叫:天塌下来有个高的顶着. 在前端圈里,总有前仆后继的仁人志士相继挥洒着热汗(这里 ...

  9. vue深入了解组件——自定义事件

    一.事件名 跟组件和prop不同,事件名不存在任何自动化的大小写转换.而是触发的事件名需要完全匹配监听这个事件所用的名称.举个例子,如果重复啊一个camelCase名字的事件: this.$emit( ...

随机推荐

  1. Elasticsearch.net一些开发笔记

    .net下开发es半年多了,留下些笔记 //https://www.elastic.co/guide/cn/elasticsearch/guide/current/combining-filters. ...

  2. 【JZOJ6354】最短路(tiring)

    description analysis 显然边权有变化规律\(x,{1\over{x-1}},{x-1\over x},x,...\) 于是把一个点拆成三个点,分别表示步数到除\(3\)余\(0,1 ...

  3. csps模拟8990部分题解

    题面: 666: 重点在题意转化:每个数可以乘k,代价为k,可以减一,代价为1, 所以跑最短路即可 #include<iostream> #include<cstdio> #i ...

  4. jquery学习笔记(四):动画

    内容来自[汇智网]jquery学习课程 4.1 显示和隐藏 在jQuery中使用 hide() 和 show() 方法来隐藏和显示 HTML 元素: hide()的语法形式:$(selector).h ...

  5. 总结加密、机密jar中的class

    1.加密和解密部署到jboss中间件中的的单个class文件,原理:使用“java源程序加密解决方案(基于Classloader解密) (2014-07-13 11:31)”blog即可实现: imp ...

  6. 阿里P8架构师谈:数据库分库分表、读写分离的原理实现,使用场景

    本文转载自:阿里P8架构师谈:数据库分库分表.读写分离的原理实现,使用场景 为什么要分库分表和读写分离? 类似淘宝网这样的网站,海量数据的存储和访问成为了系统设计的瓶颈问题,日益增长的业务数据,无疑对 ...

  7. hive 总结一

    本文参考:黑泽君相关博客 本文是我总结日常工作中遇到的坑,结合黑泽君相关博客,选取.补充了部分内容. 上传数据 上传数据后执行修复 msck 命令 上传数据 hive> dfs -mkdir - ...

  8. 牛客网NOIP赛前集训营-普及组(第七场)

    链接:C 来源:牛客网 牛牛的同学给牛牛表演了一个读心术:牛牛先任意选定一个非负整数,然后进行N次操作:每次操作前,假设牛牛当前的数是a,那么这个操作可能是a = a + x, 或者a = a * x ...

  9. Searching the String ZOJ - 3228 AC自动机查询升级版

    题意:先给你一个不超过1000000长度的大串s:接下来输入一个n代表接下来输入的小串个数,小串长度不超过6. 小串分两种类型0和1类型. 0类型表示小串在大串中的最大匹配个数就是常规的AC自动机的做 ...

  10. Go前言

    Go语言为并发而生 硬件制造商正在为处理器添加越来越多的内核以来提高性能.所有数据中心都在这些处理器上运行,今天的应用程序使用多个微服务来维护数据库连接,消息队列和维护缓存.所以,开发的软件和编程语言 ...