当前位置: 首页 > news >正文

uniapp开发小程序-显示左滑删除效果

一、效果图:

在这里插入图片描述

二、代码实现:

<template><view class="container"><view class="myorderList"><uni-swipe-action><uni-swipe-action-item class="swipe-action-item" :right-options="options" @click="bindClick"@change="swipeChange($event, index)" v-for="(item,index) in myorderList"><view class="list_item"><image class="orderImg" :src="item.imgurl"></image><view class="item_right"><view class="">文件名:{{item.name}}</view><view class="">打印页数:{{item.pages}}</view><view class="btn" @click="seleGuige">选规格</view><view class="numbox"><uni-number-box :min="0" :value="item.num" @change="bindChange" /></view></view></view></uni-swipe-action-item></uni-swipe-action></view></view>
</template><script>export default {data() {return {myorderList: [{name: '承诺书',imgurl: '../../static/images/contact_ht@2x.png',pages: 10,num: 1},{name: '企业画册',imgurl: '../../static/images/contact_ht@2x.png',pages: 1,num: 2},{name: '承诺书',imgurl: '../../static/images/contact_ht@2x.png',pages: 10,num: 1},],options: [{text: '取消',style: {backgroundColor: '#B4B4B4',color: '#fff'}}, {text: '删除',style: {backgroundColor: '#1CCD7F',color: '#fff'}}],}},methods: {bindClick(e) {console.log('点击了' + (e.position === 'left' ? '左侧' : '右侧') + e.content.text + '按钮')},swipeChange(e, index) {console.log('当前状态:' + e + ',下标:' + index)},bindChange(value) {console.log('返回数值:', value);},}}
</script>
<style lang="scss" scoped>//去掉自定义组件里的图标/deep/ .header .left image {display: none !important;}.container {box-sizing: border-box;padding: 0 30rpx;}.myorderList {margin-top: 40rpx;}.swipe-action-item {width: 690rpx;height: 260rpx;.list_item {width: 100%;height: 260rpx;background: #FFFFFF;box-shadow: 0rpx 0rpx 13rpx 0rpx rgba(34, 23, 20, 0.08);border-radius: 20rpx;margin-bottom: 34rpx;box-sizing: border-box;padding: 30rpx 24rpx 30rpx 30rpx;display: flex;font-size: 26rpx;font-family: Microsoft YaHei UI;font-weight: 400;color: #333333;.orderImg {width: 155rpx;height: 200rpx;border-radius: 10rpx;box-sizing: border-box;border: 2rpx solid #20A746;margin-right: 32rpx;}.item_right {height: 100%;box-sizing: border-box;width: 450rpx;view {margin-top: 15rpx;}.numbox {display: flex;align-items: center;justify-content: flex-end;}.btn {width: 150rpx;height: 43rpx;background: #1CCD7F;border-radius: 20rpx;font-size: 26rpx;font-family: Microsoft YaHei UI;font-weight: 400;color: #FFFFFF;display: flex;align-items: center;justify-content: center;margin-top: 20rpx;}}}}
</style>

ending~

http://www.lryc.cn/news/91807.html

相关文章:

  • FPGA 的数字信号处理:Verilog 实现简单的 FIR 滤波器
  • 使用粒子群优化算法(PSO)辨识锂电池二阶RC模型参数(附MATLAB代码)
  • 如何利用地面控制点实现倾斜摄影三维模型数据的几何坐标变换和纠正?
  • 设计规则之里氏替换原则
  • 【叠高高】叠蛋糕游戏的微信小程序开发流程详解
  • 收集关键词的方法有哪些?(如何查找精准的行业流量关键词)
  • 【GreenDao】RxQuery查询并修改GreenDao数据库,完成后更新UI
  • Modifier ‘public‘ is redundant for interface methods错误
  • Redis缓存击穿及解决问题
  • 环境感知算法——2.CenterNet基于KITTI数据集训练
  • JUC 高并发编程基础篇
  • 【十二】设计模式~~~行为型模式~~~命令模式(Java)
  • 可再生能源的不确定性和储能系统的时间耦合的鲁棒性和非预期性区域微电网的运行可行性研究(Matlab代码实现)
  • Revit中如何使创建的族文件内存变小
  • ClassLoader源码
  • Kafka分区消息积压排查指南
  • 数据库 期末复习(4) 概念数据库的设计
  • WuThreat身份安全云-TVD每日漏洞情报-2023-05-26
  • 关于Idea的一些常用设置项
  • Python使用WMI模块获取Windows系统的硬件信息,并使用pyinstaller库编译打包成exe的可执行文件
  • JavaScript语句(七)
  • 孪生诱捕网络在欺骗防御领域的应用
  • 【性能测试】Jenkins+Ant+Jmeter自动化框架的搭建思路
  • ARM体系结构与异常处理
  • 招聘网站—Hive数据分析
  • 双指针滑动窗口整理1——长度最小的子数组、水果成篮
  • textarea之换行、replace、\n、br、innerHTML
  • SKD240
  • 大数据采集怎么做呢?
  • 【学习日记】操作系统-入门知识-个人学习记录