uniapp订单循环列表倒计时

目录

    • 效果图片
    • 插件uni-countdown
    • 代码
    • 最后

效果图片

请添加图片描述

插件uni-countdown

地址

代码

<template><view class=""><!-- 下面循环两个列表 --><view class="item" v-for="(item, index) in listData" :key="index"><!-- <text class="shoppay-right1">{{ item.state_text }}</text><view v-if="item.state_text == '待付款'"><uni-countdown :showDay="false" :showHour="true" :fontSize="12" color="#F81111"splitorColor='#F81111' :minute="item.minute" :second="item.second"@timeup="handleTimeup(index)" style=""></uni-countdown></view> --><uni-countdown :showDay="false" :showHour="true" :fontSize="12" color="#F81111" splitorColor='#F81111':minute="item.minute" :second="item.second" style=""></uni-countdown></view></view>
</template><script>export default {data() {return {// listData: [],//定义一个假数据listData: [{"order_id": 70,"order_no": "2023101751999997","total_price": "345.00","order_price": "345.00","coupon_id": 0,"coupon_money": "0.00","coupon_id_sys": 0,"coupon_money_sys": "0.00","points_money": "0.00","points_num": 0,"pay_price": "345.00","update_price": {"symbol": "+","value": "0.00"},"fullreduce_money": 0,"fullreduce_remark": "","product_reduce_money": "0.00","buyer_remark": "","pay_type": {"text": "微信支付","value": 20},"pay_source": "","pay_status": {"text": "待付款","value": 10},"pay_time": 0,"pay_end_time": 1697538731,"delivery_type": {"text": "快递配送","value": 10},"extract_store_id": 0,"extract_clerk_id": 0,"express_price": "0.00","express_id": 0,"express_company": "","express_no": "","delivery_status": {"text": "待发货","value": 10},"delivery_time": 0,"receipt_status": {"text": "待收货","value": 10},"receipt_time": 0,"order_status": {"text": "进行中","value": 10},"points_bonus": 0,"is_settled": 0,"transaction_id": "","is_comment": 0,"order_source": 10,"user_id": 1,"is_refund": 0,"assemble_status": 0,"activity_id": 0,"is_agent": 1,"shop_supplier_id": 3,"supplier_money": "345.00","sys_money": "0.00","room_id": 0,"cancel_remark": "","virtual_auto": 0,"virtual_content": "","balance": "0.00","online_money": "0.00","refund_money": "0.00","trade_no": "2023101751999997","wx_delivery_status": 10,"is_delete": 0,"app_id": 10001,"create_time": "2023-10-17 18:22:11","product_id": 12,"category_id": 8,"name": "智能设备","spec_name": "小时","logo_id": 13,"storage": "local","save_name": "20230926/478df4597d5266ccb33c5fb1f1b5782c.png","file_url": "","file_name": "20230926155419ee8325089.png","pay_end_time_format": "6分钟","file_path": "http://bangke.yunjingwl.com/uploads/20230926/478df4597d5266ccb33c5fb1f1b5782c.png","product": [{"order_product_id": 44,"product_id": 12,"product_name": "测试456","image_id": 37,"deduct_stock_type": 10,"spec_type": 10,"spec_sku_id": "0","product_sku_id": 19,"product_attr": "","product_no": "123","product_price": "345.00","line_price": "345.00","product_weight": 34553435,"is_user_grade": 0,"grade_ratio": 0,"grade_product_price": "0.00","grade_total_money": "0.00","coupon_money_sys": "0.00","coupon_money": "0.00","points_money": "0.00","points_num": 0,"points_bonus": 0,"total_num": 1,"total_price": "345.00","total_pay_price": "345.00","supplier_money": "345.00","sys_money": "0.00","fullreduce_money": "0.00","product_reduce_money": "0.00","is_agent": 0,"is_ind_agent": 0,"agent_money_type": 10,"first_money": "0.00","second_money": "0.00","third_money": "0.00","is_comment": 0,"order_id": 70,"user_id": 1,"product_source_id": 0,"sku_source_id": 0,"bill_source_id": 0,"virtual_content": "","app_id": 10001,"create_time": "2023-10-17 18:22:11","image": {"file_id": 37,"storage": "local","group_id": 0,"file_url": "","save_name": "20231009/cfd4f6da754767b47f60197f1dd3e40b.png","file_name": "2023100910385524eb17726.png","file_size": 890511,"file_type": "image","real_name": "371fa09067c9b88007071d53a38303a4@2x.png","extension": "png","is_user": 0,"is_recycle": 0,"shop_supplier_id": 3,"is_delete": 0,"app_id": 10001,"create_time": "2023-10-09 10:38:55","update_time": 0,"file_path": "http://bangke.yunjingwl.com/uploads/20231009/cfd4f6da754767b47f60197f1dd3e40b.png"}}],"supplier": {"shop_supplier_id": 3,"name": "测试3","user_id": 3},"advance": null,"state_text": "待付款","order_source_text": "普通","pay_end_time_text": "2023-10-17 18:32:11"},{"order_id": 69,"order_no": "2023101799545110","total_price": "100.00","order_price": "100.00","coupon_id": 0,"coupon_money": "0.00","coupon_id_sys": 0,"coupon_money_sys": "0.00","points_money": "0.00","points_num": 0,"pay_price": "100.00","update_price": {"symbol": "+","value": "0.00"},"fullreduce_money": 0,"fullreduce_remark": "","product_reduce_money": "0.00","buyer_remark": "","pay_type": {"text": "微信支付","value": 20},"pay_source": "","pay_status": {"text": "待付款","value": 10},"pay_time": 0,"pay_end_time": 1697537876,"delivery_type": {"text": "快递配送","value": 10},"extract_store_id": 0,"extract_clerk_id": 0,"express_price": "0.00","express_id": 0,"express_company": "","express_no": "","delivery_status": {"text": "待发货","value": 10},"delivery_time": 0,"receipt_status": {"text": "待收货","value": 10},"receipt_time": 0,"order_status": {"text": "已取消","value": 20},"points_bonus": 0,"is_settled": 0,"transaction_id": "","is_comment": 0,"order_source": 10,"user_id": 1,"is_refund": 0,"assemble_status": 0,"activity_id": 0,"is_agent": 1,"shop_supplier_id": 1,"supplier_money": "100.00","sys_money": "0.00","room_id": 0,"cancel_remark": "","virtual_auto": 0,"virtual_content": "","balance": "0.00","online_money": "0.00","refund_money": "0.00","trade_no": "2023101799545110","wx_delivery_status": 10,"is_delete": 0,"app_id": 10001,"create_time": "2023-10-17 18:07:56","product_id": 2,"category_id": 3,"name": "热门分类","spec_name": "小时","logo_id": 1,"storage": "local","save_name": "20230926/0a1de3d0cf3ee4e7db4d84af5995237f.png","file_url": "","file_name": "202309261307338cdd12520.png","pay_end_time_format": "","file_path": "http://bangke.yunjingwl.com/uploads/20230926/0a1de3d0cf3ee4e7db4d84af5995237f.png","product": [{"order_product_id": 43,"product_id": 2,"product_name": "哈哈哈","image_id": 15,"deduct_stock_type": 10,"spec_type": 10,"spec_sku_id": "0","product_sku_id": 2,"product_attr": "","product_no": "123","product_price": "100.00","line_price": "1000.00","product_weight": 1,"is_user_grade": 0,"grade_ratio": 0,"grade_product_price": "0.00","grade_total_money": "0.00","coupon_money_sys": "0.00","coupon_money": "0.00","points_money": "0.00","points_num": 0,"points_bonus": 0,"total_num": 1,"total_price": "100.00","total_pay_price": "100.00","supplier_money": "100.00","sys_money": "0.00","fullreduce_money": "0.00","product_reduce_money": "0.00","is_agent": 0,"is_ind_agent": 0,"agent_money_type": 10,"first_money": "0.00","second_money": "0.00","third_money": "0.00","is_comment": 0,"order_id": 69,"user_id": 1,"product_source_id": 0,"sku_source_id": 0,"bill_source_id": 0,"virtual_content": "","app_id": 10001,"create_time": "2023-10-17 18:07:56","image": {"file_id": 15,"storage": "local","group_id": 0,"file_url": "","save_name": "20230926/98b35fa4f297b138ddf44899da654c5f.jpg","file_name": "20230926160205343ec9076.jpg","file_size": 267265,"file_type": "image","real_name": "1695715325238_wx_camera_1695603440923.jpg","extension": "jpg","is_user": 1,"is_recycle": 0,"shop_supplier_id": 0,"is_delete": 0,"app_id": 10001,"create_time": "2023-09-26 16:02:05","update_time": 0,"file_path": "http://bangke.yunjingwl.com/uploads/20230926/98b35fa4f297b138ddf44899da654c5f.jpg"}}],"supplier": {"shop_supplier_id": 1,"name": "测试1-1","user_id": 1},"advance": null,"state_text": "已取消","order_source_text": "普通","pay_end_time_text": "2023-10-17 18:17:56"}]}},mounted() {/*获取订单列表*/this.getData();},methods: {handleTimeup(index) {this.listData[index].state_text = '服务已取消';},/*获取数据*/getData() {let self = this;self.loading = true;let dataType = self.dataType;self._get('user.order/lists', {dataType: dataType,page: self.page,pay_source: self.getPlatform(),list_rows: self.list_rows},function(res) {self.loading = false;self.listData = self.listData.concat(res.data.list.data);console.log(res.data.list.data, '返回数据1111111111');let result = res.data.list.data.map(item => {let {day,hour,minute,second} = self.countdowm(item.pay_end_time)// console.log(item.pay_end_time,'pay_end_time时间戳');// let {// 	day: deliveryday,// 	hour: deliveryhour,// 	minute: deliveryminute,// 	second: deliverysecond// } = self.countdowm(item.delivery_end_time)// let {// 	day: receiptday,// 	hour: receipthour,// 	minute: receiptminute,// 	second: receiptsecond// } = self.countdowm(item.receipt_end_time)item.day = dayitem.hour = houritem.minute = minuteitem.second = second// console.log(day, 'day');// console.log(hour, 'hour');// console.log(minute, 'minute');// console.log(second, 'second');// item.deliveryday = deliveryday// item.deliveryhour = deliveryhour// item.deliveryminute = deliveryminute// item.deliverysecond = deliverysecond// item.receiptday = receiptday// item.receipthour = receipthour// item.receiptminute = receiptminute// item.receiptsecond = receiptsecond// if(item.product.refund && item.product.refund.refund_end_time){// 	let {// 		day: refundday,// 		hour: refundhour,// 		minute: refundminute,// 		second: refundsecond// 	} = this.countdowm(item.product.refund.refund_end_time)	// 	item.refundday = refundday// 	item.refundhour = refundhour// 	item.refundminute = refundminute// 	item.refundsecond = refundsecond// 	return item// }return item})// 格式化后结果,赋值给data里面listData数组,然后再view循环即可self.listData = result;});},// 计算时分秒	格式化countdowm(timestamp) {let nowTime = new Date();let endTime = new Date(timestamp * 1000);let t = endTime.getTime() - nowTime.getTime();console.log(t, 'ttttttttttttttt');if (t > 0) {let day = Math.floor(t / 86400000);let hour = Math.floor((t / 3600000) % 24);let min = Math.floor((t / 60000) % 60);let sec = Math.floor((t / 1000) % 60);return {day,hour,minute: min,second: sec}} else {return {day: 0,hour: 0,minute: 0,second: 0}}},}}
</script><style>.item{width: 100%;height: 100rpx;border: 1rpx solid blue;margin-bottom: 100rpx;}
</style>

最后

感觉文章好的话记得点个心心和关注和收藏,有错的地方麻烦指正一下,如果需要转载,请标明出处,多谢!!!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/108368.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

LeetCode 2 两数相加

题目描述 链接&#xff1a;https://leetcode.cn/problems/add-two-numbers/?envTypefeatured-list&envId2ckc81c?envTypefeatured-list&envId2ckc81c 难度&#xff1a;中等 给你两个 非空 的链表&#xff0c;表示两个非负的整数。它们每位数字都是按照 逆序 的方式…

【Hello Algorithm】暴力递归到动态规划(三)

暴力递归到动态规划&#xff08;三&#xff09; 最长公共子序列递归版本动态规划 最长回文串子序列方法一方法二递归版本动态规划 象棋问题递归版本动态规划 咖啡机问题递归版本动态规划 最长公共子序列 这是leetcode上的一道原题 题目连接如下 最长公共子序列 题目描述如下…

在 rider 里用配置 Perforce(P4)的注意事项

整个配置界面里&#xff0c;关键就配2处位置&#xff0c;但是都有些误导性。 1是连接形参的4个参数都得填&#xff0c;字符集看你项目的要求&#xff0c;这里工作区其实指的是你的工作空间&#xff0c;还不如显示英文的 Workspace 呢&#xff0c;搞得我一开始没填&#xff0c;…

【数字IC设计】DC自动添加门控时钟

简介 数字电路的动态功耗主要是由于寄存器翻转带来的&#xff0c;为了降低芯片内部功耗&#xff0c;门控时钟的方案应运而生。作为低功耗设计的一种方法&#xff0c;门控时钟是指在数据无效时将寄存器的时钟关闭&#xff0c;以此来降低动态功耗。 在下图中&#xff0c;展示了…

软信天成:流程管理是企业精细化管理的一大利器

流程管理&#xff08;BPM&#xff09;是指组织和管理内部或跨部门的工作流程&#xff0c;主要包括设计、建模、执行、监控和优化业务流程&#xff0c;确保工作按照标准化的步骤进行&#xff0c;从而提高效率、降低成本&#xff0c;促进业务增长。 一、流程管理生命周期五大步骤…

Hadoop3教程(九):MapReduce框架原理概述

文章目录 简介参考文献 简介 这属于整个MR中最核心的一块&#xff0c;后续小节会展开描述。 整个MR处理流程&#xff0c;是分为Map阶段和Reduce阶段。 一般&#xff0c;我们称Map阶段的进程是MapTask&#xff0c;称Reduce阶段是ReduceTask。 其完整的工作流程如图&#xff…

2023亿发智能数字化解决方案供应商,贵州一体化企业信息管理系统

企业数字化服务的解决方案是指运用数字技术对企业运营进行全方位的数字化升级和优化&#xff0c;提供以数字化服务为核 心的全面解决方案&#xff0c;解决企业在数字化转型过程中面临的技术和业务难题。 数字化服务解决方案的功能 在数字化时代的背景下&#xff0c;贵州企业的…

【微信小程序】数字化会议OA系统之首页搭建(附源码)

&#x1f389;&#x1f389;欢迎来到我的CSDN主页&#xff01;&#x1f389;&#x1f389; &#x1f3c5;我是Java方文山&#xff0c;一个在CSDN分享笔记的博主。&#x1f4da;&#x1f4da; &#x1f31f;推荐给大家我的专栏《微信小程序开发实战》。&#x1f3af;&#x1f3a…

警惕这款记录音频和电话的Android木马软件SpyNote

导语&#xff1a;近日&#xff0c;一款名为SpyNote的Android木马软件被揭示出其多样化的信息收集功能。该木马软件通常通过短信钓鱼攻击传播&#xff0c;攻击链通过欺骗潜在受害者点击嵌入链接来安装该应用程序。除了要求入侵性权限以访问通话记录、摄像头、短信和外部存储等&a…

python+django高校体育乒乓球场地预约管理系统_s2409

本系统提供给管理员对首页&#xff0c;个人中心&#xff0c;用户管理&#xff0c;乒乓球场管理,场地类型管理,场地预约管理,暂离申请管理,离开申请管理,管理员管理,留言反馈,系统管理等诸多功能进行管理。本系统对于用户输入的任何信息都进行了一定的验证&#xff0c;为管理员操…

C++项目实战——基于多设计模式下的同步异步日志系统-⑫-日志宏全局接口设计(代理模式)

文章目录 专栏导读日志宏&全局接口设计全局接口测试项目目录结构整理示例代码拓展示例代码 专栏导读 &#x1f338;作者简介&#xff1a;花想云 &#xff0c;在读本科生一枚&#xff0c;C/C领域新星创作者&#xff0c;新星计划导师&#xff0c;阿里云专家博主&#xff0c;C…

【前端学习】—bind、call、apply(四)

【前端学习】—bind、call、apply(四) 一、代码题 <script>var name="freeman";function sayAuthor(){var name=

PCLVisualizer显示点云的深层用法

以下代码均是在QT中使用QVTKOpenGLNativeWidget的简单教程以及案例-CSDN博客文章的基础上&#xff0c;修改按钮对应的槽函数中的程序。 1.显示文件中点云颜色属性信息&#xff0c;利用PointCloudColorHandlerRGBField得到每个点云对应的颜色。 pcl::PointCloud<pcl::PointX…

Vuex中多个参数显示undefined的解决方案

笔者今天在使用Vuex中的mutations改变state里面的全局状态的值&#xff0c;获取到的数据却怎么都是第一个参数是可以获取到,但是第二个就获取不到&#xff0c;就显示undefined 问题代码 mutations: {multiparameter(state,id,newStatus) {console.log("数据的Key&#x…

【前端】Js

目 录 一.前置知识第一个程序JavaScript 的书写形式注释输入输出 二.语法概览变量的使用理解 动态类型基本数据类型 三.运算符算术运算符赋值运算符 & 复合赋值运算符自增自减运算符比较运算符逻辑运算符位运算移位运算 四.条件语句if 语句三元表达式switch 五.循环语句whi…

ORA-12541:TNS:no listener 无监听程序

问题截图 解决方法 1、删除Listener 新建一个新的 2、主机为服务器ip 3、设置数据库环境 只需要设置实例名不需要设置路径 4、服务命名 一样设置为ip 服务名与监听名一直 eg&#xff1a;orcl

Variations-of-SFANet-for-Crowd-Counting记录

论文&#xff1a;Encoder-Decoder Based Convolutional Neural Networks with Multi-Scale-Aware Modules for Crowd Counting 论文链接&#xff1a;https://arxiv.org/abs/2003.05586 源码链接&#xff1a;GitHub - Pongpisit-Thanasutives/Variations-of-SFANet-for-Crowd-C…

云原生场景下高可用架构的最佳实践

作者&#xff1a;刘佳旭&#xff08;花名&#xff1a;佳旭&#xff09;&#xff0c;阿里云容器服务技术专家 引言 随着云原生技术的快速发展以及在企业 IT 领域的深入应用&#xff0c;云原生场景下的高可用架构&#xff0c;对于企业服务的可用性、稳定性、安全性越发重要。通…

GFS分布式文件系统实验

GFS概念 Gluster 是一个开源的分布式文件系统 它是一个C/S架构 由存储服务器、客户端以及NFS/Samba存储网关组成 没有元数据服务器组件&#xff0c;这有助于提升整个系统的性能&#xff0c;可靠性和稳定性 文件系统定义 负责实现数据存储方式&#xff0c;以什么格式保存在…

Spring5应用之高级注解开发

作者简介&#xff1a;☕️大家好&#xff0c;我是Aomsir&#xff0c;一个爱折腾的开发者&#xff01; 个人主页&#xff1a;Aomsir_Spring5应用专栏,Netty应用专栏,RPC应用专栏-CSDN博客 当前专栏&#xff1a;Spring5应用专栏_Aomsir的博客-CSDN博客 文章目录 参考文献前言Conf…