• uniapp 小程序优惠劵样式


    先看效果图

    上代码

    1. <view class="coupon">
    2. <view class="tickets" v-for="(item,index) in 10" :key="item">
    3. <view class="l-tickets">
    4. <view class="name">10元优惠劵view>
    5. <view class="effect">满120元可用view>
    6. <view class="end-date"> 有效期至:2023-10-30view>
    7. view>
    8. <view class="r-tickets">立即使用view>
    9. view>
    10. view>
    1. .coupon {
    2. width: 100%;
    3. .tickets {
    4. display: flex;
    5. // padding: 20rpx;
    6. width: 100%;
    7. height: 220rpx;
    8. box-sizing: border-box;
    9. margin-bottom: 30rpx;
    10. }
    11. .l-tickets {
    12. width: 75%;
    13. height: 100%;
    14. position: relative;
    15. background: radial-gradient(circle at right top, transparent 16rpx, #fff 0) right top / 100% 50% no-repeat,
    16. radial-gradient(circle at right bottom, transparent 16rpx, #fff 0) right bottom / 100% 50% no-repeat;
    17. filter: drop-shadow(0px 8rpx 4rpx rgba(0, 0, 0, 0.05)) drop-shadow(-4px 0px 4px rgba(0, 0, 0, 0.05)) drop-shadow(0px -4px 4px rgba(0, 0, 0, 0.05));
    18. padding: 20rpx;
    19. @include flex-sb;
    20. align-items: flex-start;
    21. flex-direction: column;
    22. .name{
    23. font-weight: bold;
    24. }
    25. .effect{
    26. font-size: 26rpx;
    27. color: #999;
    28. }
    29. .end-date{
    30. font-size: 24rpx;
    31. color: #999;
    32. }
    33. }
    34. .l-tickets::after {
    35. content: '';
    36. position: absolute;
    37. height: 100%;
    38. width: 8rpx;
    39. top: 0;
    40. left: -8rpx;
    41. background: radial-gradient(circle at left center, transparent 8rpx, #fff 0) left center / 8rpx 20rpx;
    42. }
    43. .r-tickets {
    44. flex: 1;
    45. background: #F3993A;
    46. position: relative;
    47. background: radial-gradient(circle at left top, transparent 16rpx, #F3993A 0) right top / 100% 50% no-repeat,
    48. radial-gradient(circle at left bottom, transparent 16rpx, #F3993A 0) right bottom / 100% 50% no-repeat;
    49. font-size: 36rpx;
    50. color: #fff;
    51. text-align: center;
    52. @include flex-center;
    53. font-weight: bold;
    54. border-top-right-radius: 10rpx;
    55. border-bottom-right-radius: 10rpx;
    56. }
    57. .r-tickets::after {
    58. content: '';
    59. width: 1rpx;
    60. background: linear-gradient(to top, #fff 0%, #fff 50%, transparent 50%) top left / 1rpx 20rpx repeat-y;
    61. position: absolute;
    62. left: 0;
    63. top: 16rpx;
    64. bottom: 16rpx;
    65. }
    66. }

    换一边

    1. <view class="coupon">
    2. <view class="tickets" v-for="(item,index) in 10" :key="item">
    3. <view class="l-tickets">
    4. view>
    5. <view class="r-tickets">
    6. <view class="name">
    7. 10元优惠劵
    8. view>
    9. <view class="effect">
    10. 满120元可用
    11. view>
    12. <view class="end-date">
    13. 有效期至:2023-10-30
    14. view>
    15. view>
    16. view>
    17. view>
    1. .coupon {
    2. width: 100%;
    3. .tickets {
    4. display: flex;
    5. // padding: 20rpx;
    6. width: 100%;
    7. height: 220rpx;
    8. box-sizing: border-box;
    9. margin-bottom: 30rpx;
    10. filter: drop-shadow(0px 8rpx 4rpx rgba(0, 0, 0, 0.05)) drop-shadow(-4px 0px 4px rgba(0, 0, 0, 0.05)) drop-shadow(0px -4px 4px rgba(0, 0, 0, 0.05));
    11. }
    12. .l-tickets {
    13. flex: 1;
    14. background: #F3993A;
    15. position: relative;
    16. background: radial-gradient(circle at right top, transparent 16rpx, #fff 0) right top / 100% 50% no-repeat,
    17. radial-gradient(circle at right bottom, transparent 16rpx, #fff 0) right bottom / 100% 50% no-repeat;
    18. font-size: 36rpx;
    19. color: #fff;
    20. text-align: center;
    21. @include flex-center;
    22. font-weight: bold;
    23. border-top-right-radius: 10rpx;
    24. border-bottom-right-radius: 10rpx;
    25. }
    26. .l-tickets::after {
    27. content: '';
    28. position: absolute;
    29. height: 100%;
    30. width: 8rpx;
    31. top: 0;
    32. left: -8rpx;
    33. background: radial-gradient(circle at left center, transparent 8rpx, #fff 0) left center / 8rpx 20rpx;
    34. }
    35. .r-tickets {
    36. width: 75%;
    37. height: 100%;
    38. position: relative;
    39. background: radial-gradient(circle at left top, transparent 16rpx, #fff 0) right top / 100% 50% no-repeat,
    40. radial-gradient(circle at left bottom, transparent 16rpx, #fff 0) right bottom / 100% 50% no-repeat;
    41. padding: 20rpx;
    42. @include flex-sb;
    43. align-items: flex-start;
    44. flex-direction: column;
    45. border-top-right-radius: 20rpx;
    46. border-bottom-right-radius: 20rpx;
    47. .name{
    48. font-weight: bold;
    49. }
    50. .effect{
    51. font-size: 26rpx;
    52. color: #999;
    53. }
    54. .end-date{
    55. font-size: 24rpx;
    56. color: #999;
    57. }
    58. }
    59. .r-tickets::after {
    60. content: '';
    61. width: 2rpx;
    62. background: linear-gradient(to top, #ddd 0%, #ddd 50%, transparent 50%) top left / 1rpx 20rpx repeat-y;
    63. position: absolute;
    64. left: 0;
    65. top: 16rpx;
    66. bottom: 16rpx;
    67. z-index: 999;
    68. }
    69. }

  • 相关阅读:
    数据库命名规范
    第五章 树 14 AcWing 1552. AVL树的根
    【超详细】Visual Studio 创建DLL 、LIB及调用
    数据结构与算法 - 计算表达式
    原生js计时器和时钟
    等保备案是什么意思?应该去哪里办理备案?
    中国城市规划行业发展战略及前景趋势分析报告2022-2028年版
    多线程 - 线程池
    润和软件荣获华为开发者大会2022鸿蒙使能贡献奖
    vulnhub之GeminiInc v2
  • 原文地址:https://blog.csdn.net/cwb_2120/article/details/133919976