卡券效果制作

.coupon {
 width: 300px;
  height: 100px;
  line-height: 100px;
  margin: 50px auto;
  text-align: center;
  position: relative;
  background: radial-gradient(circle at right bottom, transparent 10px, #ffffff 0) top right /50% 51px no-repeat,
  radial-gradient(circle at left bottom, transparent 10px, #ffffff 0) top left / 50% 51px no-repeat,
  radial-gradient(circle at right top, transparent 10px, #ffffff 0) bottom right / 50% 51px no-repeat,
  radial-gradient(circle at left top, transparent 10px, #ffffff 0) bottom left / 50% 51px no-repeat;
  filter: drop-shadow(2px 2px 2px rgba(0, 0, 0, .2));
}
.coupon span {
  display: inline-block;
  vertical-align: middle;
  margin-right: 10px;
  color: red;
  font-size: 50px;
  font-weight: 400;
}

<p class="coupon">
 <span>200</span>优惠券
</p>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,下面是一个简单的 C# 卡券系统 demo,包括创建优惠券、查询优惠券、使用优惠券等操作。 ```csharp using System; using System.Collections.Generic; namespace CouponSystemDemo { class Program { static void Main(string[] args) { // 创建优惠券对象列表 List<Coupon> coupons = new List<Coupon>(); // 创建优惠券对象并添加到列表中 Coupon coupon1 = new Coupon("满100减20", 100, 20); coupons.Add(coupon1); Coupon coupon2 = new Coupon("满200减50", 200, 50); coupons.Add(coupon2); // 显示优惠券列表 Console.WriteLine("优惠券列表:"); foreach(Coupon coupon in coupons) { Console.WriteLine(coupon.ToString()); } // 查询优惠券 Console.WriteLine("请输入优惠券名称:"); string couponName = Console.ReadLine(); Coupon foundCoupon = null; foreach(Coupon coupon in coupons) { if(coupon.Name == couponName) { foundCoupon = coupon; break; } } if(foundCoupon == null) { Console.WriteLine("未找到该优惠券"); } else { // 使用优惠券 Console.WriteLine("请输入消费金额:"); double cost = double.Parse(Console.ReadLine()); double discount = foundCoupon.GetDiscount(cost); Console.WriteLine("使用优惠券 " + foundCoupon.Name + ",折扣金额为:" + discount); } Console.ReadKey(); } } class Coupon { public string Name { get; set; } // 优惠券名称 public double MinCost { get; set; } // 最低消费金额 public double Discount { get; set; } // 优惠金额 public Coupon(string name, double minCost, double discount) { this.Name = name; this.MinCost = minCost; this.Discount = discount; } // 获取折扣金额 public double GetDiscount(double cost) { if(cost < this.MinCost) { return 0; } else { return this.Discount; } } public override string ToString() { return this.Name + "(满" + this.MinCost + "减" + this.Discount + ")"; } } } ``` 这个 demo 实现了一个简单的卡券系统,包括创建优惠券、查询优惠券、使用优惠券等操作。你可以根据自己的需求进行修改和扩展。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值