微信小程序卡券样式

2023-11-03

微信小程序卡券样式## 微信小程序## 卡券

html

<nav-bar navbar-data='{{nvabarData}}'></nav-bar>
<view class="page" style='margin-top: {{height}}px'>
  <view class="tab-change">
    <view class='tab  {{currentData == 0 ? "tabBorer" : ""}}'  data-current = "0" bindtap='checkCurrent'>
      有效
      <view class=' {{currentData == 0 ? "tabBorer2" : ""}}'></view> 
    </view>
    <view class='tab  {{currentData == 1 ? "tabBorer" : ""}}'  data-current = "1" bindtap='checkCurrent'>
        已失效
        <view class=' {{currentData == 1 ? "tabBorer2" : ""}}'></view>
    </view>
  </view>
  <swiper current="{{currentData}}" class='swiper' style="height:600px;" duration="300" bindchange="bindchange">
    <swiper-item>
      <view class='swiper_con swiper_have_con'>
        <view class="wrapper" wx:for="{{coupon}}" wx:index="{{index}}">
          <view class="left">
            <view class="yh-price">{{item.price}}<text class="small-txt2">{{item.unit}}</text></view>
            <view class="describe">{{item.describe}}</view>
          </view>
          <view class="right">
            <view class="yh-name">{{item.name}}</view>
            <view class="yh-date">
              {{item.date}}
              <navigator url="/pages/coupon/index" class="yh-use">立即使用</navigator>
            </view>
            <view class="yh-apply">{{item.apply}}</view>
          </view>
        </view>
      </view>
    </swiper-item>
    <swiper-item>
      <view class="swiper_con swiper_invalid_con">
        <view class="wrapper" wx:for="{{coupon_invalid}}" wx:index="{{index}}">
          <view class="left">
            <view class="yh-price">{{item.price}}<text class="small-txt2">{{item.unit}}</text></view>
            <view class="describe">{{item.describe}}</view>
          </view>
          <view class="right">
            <view class="yh-name">{{item.name}}</view>
            <view class="yh-date">
              {{item.date}}
            </view>
            <view class="yh-apply">{{item.apply}}</view>
            <image class="invalid-image" src="{{item.invalid==1?'/static/image/mycoupon/shixiao.png':'/static/image/mycoupon/guoqi.png'}}"></image>
          </view>
        </view>
      </view>
      <view class='swiper_con swiper_not_con'>
        <image src="/static/image/mycoupon/nope.png" mode="widthFix"></image>
        <view class="nope">暂无优惠券</view>
      </view>
    </swiper-item>
  </swiper>
</view>
/* css */
page{background:#F4F5F9;width:100%;}
.page{width:inherit;}

.tab-change{width:100%;background:#fff;display: flex;border-top:1px solid #F4F5F9;}
.tab {
  width: 50%;
  text-align: center;
  padding: 28rpx 0;
  font-size: 32rpx;
  color:#000;
  position: relative;
}

.tabBorer2 {
  position:absolute;
  bottom:0;
  left:156rpx;
  /* border-bottom: 2px solid #CD2314; */
  width: 66rpx;
  height: 6rpx;
  background: #CD2314;

}
 
.swiper {
  width: 100%;
}
 
.swiper_con {
  text-align: center;
  width: 100%;
  /* height: 100%; */
  padding: 80rpx 0;
}

/* .swiper_not_con{padding-top:208rpx;} */
.swiper_not_con image{width:378rpx;height:240rpx;}
.nope{color:#999;font-size: 32rpx;margin-top:30rpx;}

.swiper_have_con{padding-top:unset;}
/* 这是第二个 */
.swiper_have_con .wrapper {
  display: flex;
  position: relative;
  width: 710rpx;
  height: 214rpx;
  margin: auto;
  filter: drop-shadow(2px 2px 3px #EAEBEE);
  margin-top:24rpx;
}

.swiper_have_con .left {
  background: #58a;
  background: radial-gradient(circle at top right, transparent 5px, #fff 0) top right, radial-gradient(circle at bottom right, transparent 5px, #fff 0) bottom right;
  background-size: 100% 60%;
  background-repeat: no-repeat;
  color: white;
  width: 218rpx;
  border-radius: 5px 0 0 5px;
}

.swiper_have_con .right {
  background: #58a;
  background: radial-gradient(circle at top left, transparent 5px, #fff 0) top left,radial-gradient(circle at bottom left, transparent 5px, #fff 0) bottom left;
  background-size: 100% 60%;
  background-repeat: no-repeat;
  width: 556rpx;
  color: white;
  border-radius: 0 5px 5px 0; 
  box-sizing: border-box;
  padding-left:32rpx;
}
.swiper_have_con .right::after{
  content: "";
  position: absolute;
  top: 15rpx;
  left:200rpx;
  height: 188rpx;
  border-left: 2rpx dashed #E0E0E0;
}

.swiper_have_con .yh-price{color:#E61515;font-size: 46rpx;margin-top:54rpx;margin-bottom:10rpx;font-weight:bold;}
.swiper_have_con .small-txt2{font-size: 24rpx;position: none;border:none;font-weight:bold;}
.swiper_have_con .describe{font-size: 24rpx;color:#999;}

.swiper_have_con .yh-name{font-size: 32rpx;color:#333;margin-top:38rpx;margin-bottom:12rpx;text-align: left;}
.swiper_have_con .yh-date{font-size: 24rpx;color:#999;display: flex;align-items: center;}
.swiper_have_con .yh-use{margin-left:76rpx;color:#CD2314;border:1px solid #CD2314;border-radius: 28rpx;text-align: center;font-size: 24rpx;box-sizing: border-box;padding:6rpx 20rpx;}
.swiper_have_con .yh-apply{margin-top:10rpx;font-size:24rpx;color:#999;text-align: left;}

/**失效**/
.swiper_invalid_con{padding-top: unset;}
.swiper_invalid_con .wrapper {
  display: flex;
  position: relative;
  width: 710rpx;
  height: 214rpx;
  margin: auto;
  filter: drop-shadow(2px 2px 3px #EAEBEE);
  margin-top:24rpx;
}

.swiper_invalid_con .left {
  background: #58a;
  background: radial-gradient(circle at top right, transparent 5px, #fff 0) top right, radial-gradient(circle at bottom right, transparent 5px, #fff 0) bottom right;
  background-size: 100% 60%;
  background-repeat: no-repeat;
  color: white;
  width: 218rpx;
  border-radius: 5px 0 0 5px;
}

.swiper_invalid_con .right {
  background: #58a;
  background: radial-gradient(circle at top left, transparent 5px, #fff 0) top left,radial-gradient(circle at bottom left, transparent 5px, #fff 0) bottom left;
  background-size: 100% 60%;
  background-repeat: no-repeat;
  width: 556rpx;
  color: white;
  border-radius: 0 5px 5px 0; 
  box-sizing: border-box;
  padding-left:32rpx;
  position: relative;
}
.swiper_invalid_con .right::after{
  content: "";
  position: absolute;
  top: 15rpx;
  left:-1rpx;
  height: 188rpx;
  border-left: 2rpx dashed #E0E0E0;
}

.swiper_invalid_con .yh-price{color:#999;font-size: 44rpx;margin-top:54rpx;margin-bottom:10rpx;font-weight:bold;}
.swiper_invalid_con .small-txt2{font-size: 24rpx;position: none;border:none;font-weight:bold;}
.swiper_invalid_con .describe{font-size: 24rpx;color:#999;}

.swiper_invalid_con .yh-name{font-size: 32rpx;color:#333;margin-top:38rpx;margin-bottom:12rpx;text-align: left;}
.swiper_invalid_con .yh-date{font-size: 24rpx;color:#999;display: flex;align-items: center;}
.swiper_invalid_con .yh-use{margin-left:76rpx;color:#CD2314;border:1px solid #CD2314;border-radius: 28rpx;text-align: center;font-size: 24rpx;box-sizing: border-box;padding:6rpx 20rpx;}
.swiper_invalid_con .yh-apply{margin-top:10rpx;font-size:24rpx;color:#999;text-align: left;}
.swiper_invalid_con .invalid-image{width:130rpx;height:140rpx;position:absolute;right:-6rpx;top:-4rpx;}

js

const app = getApp()

Page({
  data: {
    height: app.globalData.height,
    nvabarData: {
      showCapsule: 1, //是否显示左上角图标   1表示显示    0表示不显示
      title: '我的优惠券', //导航栏 中间的标题
    },
    currentData: 0,
    coupon:[
      { price: 4200,unit:'元', describe: '满600元可用', name: '梅州旅游优惠券', date: '2018.10.20-2020.09.0', apply:'适用范围:所有产品可用'},
      { price: 4200, unit: '元',describe: '满600元可用', name: '梅州旅游优惠券', date: '2018.10.20-2020.09.0', apply: '适用范围:所有产品可用' },
      { price: '兑换券', describe: '无门槛', name: '梅州旅游优惠券', date: '2018.10.20-2020.09.0', apply: '适用范围:所有产品可用' },
    ],
    coupon_invalid: [
      { price: 4200, unit: '元', describe: '满600元可用', name: '梅州旅游优惠券', date: '2018.10.20-2020.09.09', apply: '适用范围:所有产品可用', invalid: 1 },
      { price: 4200, unit: '元', describe: '满600元可用', name: '梅州旅游优惠券', date: '2018.10.20-2020.09.09', apply: '适用范围:所有产品可用', invalid: 2 },
    ],
  },
  onLoad:function(){
    
  },
  //获取当前滑块的index
  bindchange: function (e) {
    const that = this;
    that.setData({
      currentData: e.detail.current
    })
  },
  //点击切换,滑块index赋值
  checkCurrent: function (e) {
    const that = this;

    if (that.data.currentData === e.target.dataset.current) {
      return false;
    } else {

      that.setData({
        currentData: e.target.dataset.current
      })
    }
  }
})

在这里插入图片描述
在这里插入图片描述

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

微信小程序卡券样式 的相关文章

  • 每 2 行后使 html 表格的边框变厚

    我创建了一个包含一些内容的表 其中有 12 行和 2 列 我想显示边框 但每 4 行之后 我想将水平边框设置为比正常情况更粗 怎么做 请在这里帮忙 试试这个选择器 table tr nth of type 4n td border bott
  • 删除特定数据表上的所有边框

    我需要使用 PrimeFaces 隐藏一个数据表的所有边框 而不是全部 我尝试了很多事情 但没有人奏效 有谁知道该怎么做 我已将以下样式 单独 应用于ui datatable class border hidden important bo
  • 如何将 HTML 转换为 Markdown?

    我有一个类似 stackoverflow 的网站 有一个文本区域 人们可以在其中写答案 我用这个 PHP 库 http parsedown org 转换降价 我的意思是我使用该函数来转换 italic to i italic i inclu
  • 单击导航项锚链接时如何关闭切换菜单

    请看我的FIDDLE http jsfiddle net ayhpp8ax 我有一个带有 响应式 导航菜单 带有指向页面上元素的锚链接 的 1 页网站 当浏览器视口小于特定宽度 在我的情况下为 767px 时 使用此 javascript
  • 在 Android 上禁用标注(上下文菜单)

    在网络应用程序中 我需要禁用移动浏览器在触摸并按住 长按 触摸目标 例如 img 或链接 我已经在使用了 webkit touch callout none 它在 iPhone 和 iPad 上运行良好 但似乎不适用于 Android 在
  • 多语言标记验证器

    是否有免费的在线多语言标记验证服务可以正确识别和验证多语言标记 我确实找到了totalvalidator和htmlvalidator 但这些是 付费 非基于网络的解决方案 Use http validator w3 org nu http
  • 使用 python 在一个 html 页面中显示分割数据框的 HTML 代码

    我是 html css 新手 所以对以 html 格式显示的数据有疑问 我有一个很长的列表 我想将其拆分并以 html 格式显示为两个单独的列 例如 而不是 Col1 Col2 1 a 2 a 3 a 4 a 5 b 6 b 7 b 8 b
  • html 电子邮件内的背景图像 css - Gmail 不支持

    我想向我的用户发送如下所示的带有背景图像 css 的 html 正文电子邮件 div style width 500px height 1000px background color black background image none
  • div 中的中心文本?

    我有一个div 30px高和500px宽的 这div可以包含两行文本 一行在一行 并相应地设置样式 填充 但有时它只包含一行 我希望它居中 这可能吗 要水平居中 请使用text align center 要垂直居中 只能使用vertical
  • Bootstrap:如何将按钮组对齐在中心(垂直)

    在下面的代码中
  • VueJS 中数据无法正确显示

    我的 VueJS 代码有一个小问题 在 输出 压缩的 GS1 数字链接 URI 部分中 When there is no result it should have nothing display like this I have remo
  • 如何在其他div id的悬停中使用div显示块

    如何打开div悬停时标记href tag 这是我在悬停 href 标签上显示 div 标签的代码 Services is id of href tag Services is id of div tag Service hover Serv
  • CSS 继承、别名和其他很酷的东西

    有一天 我随机浏览网页 发现了一些程序 可以让你编写 CSS 别名和其他很酷的东西 我现在不记得了 举个例子 我记得你可以这样做 myclass background color red greenfont 其中 greenfont 在其他
  • 滚动时的 CSS 背景模糊

    我有固定的背景图像 滚动时我希望图像变得模糊 我知道如何在 css 中进行模糊 但在特定的滚动位置进行 这是一个例子 https medium com good music f160ba9e6c52 https medium com goo
  • 如何使用javascript确保元素仅在圆上朝一个方向移动?

    好吧 我承认我对三角学真的很糟糕 出于上下文的考虑 我将添加我在这里提到的问题中的内容 参考问题 https stackoverflow com a 39429290 168492 https stackoverflow com a 394
  • 两列表:一列尽可能小,另一列占据其余部分

    我在 div 中有一个 to columns 表 div table tbody tr td class action a a td td class content p Bigger text variable size p td tr
  • 按下回车键时不刷新页面

    我遇到了一些问题 只要表单中有输入 回车键就会触发页面刷新 下面的代码 如果按下回车并且文本区域 input 中没有输入任何文本 则不会刷新页面 但是如果按下回车并且 input中有输入或者光标位于文本区域 我不确定是什么触发了它 因为 s
  • 如何使使用 css 调整大小的图像在 IE 中看起来不错?

    当使用 css 宽度 高度或属性宽度 高度缩放图像时 IE6 和 IE7 无法很好地缩放网页中的图像 我不确定它默认使用哪种算法 但这不好 在这些浏览器中缩放时 缩放图像会显示锯齿伪影 幸运的是 有一种方法可以通过简单的 css 规则强制
  • 表单发布请求并存储收到的数据

    我有一个非常简单的表单 在提交时发出发布请求
  • css3按钮背景颜色无限过渡

    有没有办法仅使用 css3 使按钮的背景颜色从灰色渐变为蓝色 然后又回到灰色 一个很好的例子是默认操作按钮是可可 我知道这可以在 javascript 中完成 但我宁愿只使用 css 来完成此操作 您好 我已经通过 CSS3 动画制作了按钮

随机推荐

  • csv反序列化_1.6.2python 文件复制、CSV、序列化和反序列化

    1 文件复制 单个文件复制 多个文件复制 使用系统模块 os 获取指定文件夹的所有文件名 复制流程 根据地址读取源文件 将读取的写入新地址 地址用os模块获取的文件名和文件夹名整合而成 2 CSV文件的写入与读取 导入CSV模块 CSV文件
  • Qt 使用QMediaPlayer类在VS中播放音乐

    qt有许多类都可以进行播放音频文件 这里我主要讲QMediaPlayer类 如何在vs中进行播放音乐 所遇到的问题该如何解决 QMediaPlayer可以对各种后缀的音频文件进行播放 包括 wav mp3等 1 向 pro文件中添加代码 由
  • requirejs之demo

    具体的理论就不讲了 可以参考 http www ruanyifeng com blog 2012 10 javascript module html http www ruanyifeng com blog 2012 10 asynchro
  • Linux下c++遍历文件夹中文件及读取绝对路径

    文件读取等操作是程序编写的基础 因此在总结了网上多个博客的基础上 写出了如下读取文件及保存绝对路径的代码片段 整理出来供大家学习 注意 这里dirent h是只有在Linux下才有的 include
  • c高级 day2

    1 写一个1 sh脚本 将以下内容放到脚本中 在家目录下创建目录文件 dir 在dir下创建dir1和dir2 把当前目录下的所有文件拷贝到dir1中 把当前目录下的所有脚本文件拷贝到dir2中 把dir2打包并压缩为dir2 tar xz
  • ios小程序上传文件使用onHeadersReceived获取header中的参数

    在上周做小程序上传的时候出现的问题 由于使用的oss 在安卓手机上获取header中的Etag是可以正常获取的 到了ios上传获取不到header中的参数 尝试了很多方法 后来发现onHeadersReceived可以获取到header就去
  • vi中不区分大小写查找的两种方法

    2019独角兽企业重金招聘Python工程师标准 gt gt gt 在 vim中 进行关键字查找 如果内容中分了大小写的 那么 查找默认是区分了大小写的 比如 ssh的配置文件中 etc ssh sshd config中 要去禁用 root
  • sqlserver存储过程加密和解密

    加密存储过程 IF EXISTS SELECT name FROM sysobjects WHERE name encrypt this AND type P DROP PROCEDURE encrypt this GO USE pubs
  • Python 在 JMeter 中如何使用?

    要在JMeter中使用Python 需要使用JSR223 Sampler元素来执行Python脚本 使用JSR223 Sampler执行Python脚本时 需要确保已在JMeter中配置了Python解释器 并设置了正确的环境路径 1 确保
  • 性能测试-JMeter分布式测试及其详细步骤

    性能测试概要 性能测试是软件测试中的一种 它可以衡量系统的稳定性 扩展性 可靠性 速度和资源使用 它可以发现性能瓶颈 确保能满足业务需求 很多系统都需要做性能测试 如Web应用 数据库和操作系统等 性能测试种类非常多 有些概念也很相近 Lo
  • 如何编写一个完整的Linux命令

    作者 gzshun 原创作品 转载请标明出处 来源 http blog csdn net gzshun 一个完整的Linux命令需要有以下几个重要的部分组成 1 使用方法 2 命令行参数 3 移植性 1 使用方法 在每个命令当中 都需要提供
  • uniapp开发小程序,上传图片和视频功能

    1 需求 可以上传图片和视频 并且都可以删除 图片可以预览 2 效果图 3 代码
  • JS金额千分位加逗号,多种实例

    涉及到金额展示的都需要在千分位上加逗号 以下为vue项目的实例 1 在main js下挂载一个全局方法 金额千分位加逗号 Vue prototype amountRule amount gt let defaultAmount let se
  • 初探生物信息数据库——生信原理第一次实验报告(华农)

    初探生物信息数据库 生信原理第一次实验报告 华农 1 实验目的 熟悉NCBI数据库Entrez检索系统 会使用关键词检索NCBI UnitProtKB PubMed等数据库 能理解检索结果页面各条目含义 2 实验题目与解答 2 1 水稻抗病
  • quartus18.1--下载设置

    一 quartus下载流程 1 打开Quartus工程 点击 Start Compilation 按钮进行程序全编译 如下图所示 2 程序全编译无错误 编译信息如下图所示 3 3 点击 Programmer 快捷按钮 进入程序下载页面 如下
  • git修改历史提交(commit)信息

    一 修改最近一次提交的commit信息 1 首先通过 git log 查看commit信息 2 使用指令 git commit amend 进入命令模式 修改号commit信息保存后退出编辑模式 3 git push force 到远程仓库
  • 基于C++的带权无向图的实现 (二)- 遍历算法

    该系列文章是本人整理的有关带权无向图的数据结构和算法的分析与实现 若要查看源码可以访问我的github仓库 如有问题或者建议欢迎各位指出 目录 基于C 的带权无向图的实现 一 数据结构 基于C 的带权无向图的实现 二 遍历算法 基于C 的带
  • AD10创建自己的元器件库——PCB设计第二节

    一 在自己的元器件库里面添加一个七段数码管 绘制七段数码管的原理图 1 新建一个元器件库 如图所示 2 在集成库中新建两个文件并命名保存 3 打开First Schlib1 SchLib文件 在第四象限绘制一个矩形 4 添加引脚 如图所示
  • Vue中引入外部字体

    项目开发过程中 系统自带的字体通常美观性没那么强 所以有时候就需要我们自己引入字体包 来实现各种个性字体的效果 以下就是在vue项目中如何引入外部字体包并使用的方法 一 放置字体包 在assets下创建一个font文件夹 把下载的字体文件放
  • 微信小程序卡券样式

    微信小程序卡券样式 微信小程序 卡券 html