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.rhkb.cn/news/161113.html

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

相关文章

mybatis-plus自动填充

前言 这是我在这个网站整理的笔记&#xff0c;关注我&#xff0c;接下来还会持续更新。 作者&#xff1a;神的孩子都在歌唱 mybatis-plus自动填充 大家做设计数据表的时候&#xff0c;基本上都会有del_flag&#xff0c;create_time, update_time,这三个字段&#xff0c;这也是…

问题记录1 json解析问题

问题&#xff1a; json解析int类型不符合预期&#xff0c;使用json.NewDecoder解决。 示例如下&#xff1a; package mainimport ("bytes""encoding/json""fmt" )func main() {data1 : map[string]interface{}{}data1["id"] int64(4…

windows安装npm教程

在安装和使用NPM之前&#xff0c;我们需要先了解一下&#xff0c;NPM 是什么&#xff0c;能干啥&#xff1f; 一、NPM介绍 NPM&#xff08;Node Package Manager&#xff09;是一个用于管理和共享JavaScript代码包的工具。它是Node.js生态系统的一部分&#xff0c;广泛用于构…

浅谈变电站运维技术模式及应用-安科瑞黄安南

近年来&#xff0c;市场电子资源需求量的逐步上升&#xff0c;使变电系统建设逐步向复杂环境拓展。为保障变电系统运行稳定性及人员管理安全性&#xff0c;无人值班变电站技术运用势在必行&#xff0c;是解决复杂条件下变电设备运行不稳定及人员设备管理效益低下问题的重要核心…

O2O优惠券预测

O2O优惠券预测 赛题理解赛题类型解题思路 数据探索理论知识数据可视化分布 特征工程赛题特征工程思路 模型训练与验证 赛题理解 赛题类型 本赛题要求提交的结果是预测15 天内用券的概率&#xff0c;这是一个连续值&#xff0c;但是因为用券只有用与不用两种情况&#xff0c;而…

VMware 配置记录

VMware 配置笔记 CentOS 7.9 镜像下载 官网太慢&#xff0c;建议在阿里云镜像站去CentOS配置页找标准版下载。 选标准版即可&#xff0c;各版本区别&#xff1a; DVD&#xff1a;标准版&#xff0c;包含常用软件&#xff0c;体积为 4.4 G&#xff1b;Everything&#xff1a…

接口加密解决方案:Python的各种加密实现!

01、前言 在现代软件开发中&#xff0c;接口测试已经成为了不可或缺的一部分。随着互联网的普及&#xff0c;越来越多的应用程序都采用了接口作为数据传输的方式。接口测试的目的是确保接口的正确性、稳定性和安全性&#xff0c;从而保障系统的正常运行。 在接口测试中&…

JavaFx学习问题2--音频、视频播放失败情况

文章目录 一、路径注意事项&#xff1a;① 用相对路径的时候别忘了前面的斜杠② uri问题 二、播放不了的问题① 获取的媒体文件路径本身就是不对的② 必须是uri③ 特殊情况 额外收获: 一、路径注意事项&#xff1a; 完整代码如下: import javafx.application.Application; im…

分布式链路追踪如何跨线程

背景 我们希望实现全链路信息&#xff0c;但是代码中一般都会异步的线程处理。 解决思路 我们可以对以前的 Runable 和 Callable 进行增强。 可以使用 ali 已经存在的实现方式。 TransmittableThreadLocal (TTL) 解决异步执行时上下文传递的问题 核心的实现思路如下&#…

时间复杂度为 O(n^2) 的排序算法

大家好&#xff0c;我是 方圆。对于小规模数据&#xff0c;我们可以选用时间复杂度为 O(n2) 的排序算法&#xff0c;因为时间复杂度并不代表实际代码的执行时间&#xff0c;而且它也省去了低阶、系数和常数&#xff0c;仅代表的增长趋势&#xff0c;所以在小规模数据情况下&…

PyTorch 深度学习之循环神经网络(基础篇)Basic RNN(十一)

0.Revision: DNN dense 重义层 全连接 RNN处理带有序列的数据 1. What is RNNs? linear layer 1.1 What is RNN? tanh (-1, 1) 1.2 RNN Cell in PyTorch 1.3 How to use RNNCell *先把维度搞清楚 多了一个序列的维度 2. How to use RNN 2.1 How to use RNN - numLayers…

基于变电站自动化系统中的安全措施分析及应用

摘要&#xff1a;阐述变电运行中的问题&#xff0c;电气自动化系统与安全运行措施&#xff0c;包括自动控制设备的投入&#xff0c;电气自动 化与计算机技术相、设备数据的采集与处理、自动化系统的升级、人工智能技术的应用。 关键词&#xff1a;自动控制&#xff1b;数据采…

铜死亡+多组机器学习+WGCNA+分型

今天给同学们分享一篇铜死亡多组机器学习WGCNA分型的生信文章“Machine learning screening for Parkinsons disease-related cuproptosis-related typing development and validation and exploration of personalized drugs for cuproptosis genes”&#xff0c;这篇文章于20…

zabbix内置宏、自动发现与注册

一、zabbix内置宏 1、概念&#xff1a; 在Zabbix中&#xff0c;内置宏是一种特殊的变量&#xff0c;通常用在 Trigger 名称和表达式中&#xff0c;引用有关监控对象的信息。 2、种类&#xff1a; {HOST.NAME} 主机名 {HOST.IP} 主机 IP 地址 {TRIGGER.DESCRIPTION} 触…

Leetcode刷题详解——将x减到0的最小操作数

1. 题目链接&#xff1a;1658. 将 x 减到 0 的最小操作数 2. 题目描述: 给你一个整数数组 nums 和一个整数 x 。每一次操作时&#xff0c;你应当移除数组 nums 最左边或最右边的元素&#xff0c;然后从 x 中减去该元素的值。请注意&#xff0c;需要 修改 数组以供接下来的操作…

017 基于Spring Boot的食堂管理系统

基于Spring Boot的食堂管理系统 项目介绍 本项目是基于Java的管理系统。采用前后端分离开发。前端基于bootstrap框架实现&#xff0c;后端使用Java语言开发&#xff0c;技术栈包括但不限于SpringBoot、MyBatis、MySQL、Maven等&#xff0c;开发工具为IDEA。 功能介绍 主页 …

TX Text Control .NET Server for ASP.NET 32.0 Crack

TX Text Control .NET Server for ASP.NET 是VISUAL STUDIO 2022、ASP.NET CORE .NET 6 和 .NET 7 支持&#xff0c;将文档处理集成到 Web 应用程序中&#xff0c;为您的 ASP.NET Core、ASP.NET 和 Angular 应用程序添加强大的文档处理功能。 客户端用户界面 文档编辑器 将功能…

C语言,指针的一些运算

若创建一个数组&#xff1a;int arr[10] 0; 用指针变量来储存数组首元素的地址&#xff1a;int* p arr,这里arr是数组名&#xff0c;表示首元素地址。 若p p 1或者p之后p本来指向数组首元素地址&#xff0c;就变成了指向第二个元素的地址&#xff0c;p n即指向第n 1个地…

C++对象模型(12)-- 构造函数语义学:构造函数

1、默认构造函数生成规则 编译器不一定会为类生成默认构造函数&#xff0c;但在下列情况下&#xff0c;编译器会生成默认构造函数。 &#xff08;1&#xff09;该类没有任何构造函数&#xff0c;但包含一个类类型的成员变量&#xff0c;且成员变量所属的类有默认构造函数。 …

idea使用debug无法启动,使用run可以启动

1、将调试断点清除 使用快捷键ctrl shift F8&#xff0c;将勾选的选项去除即可 2、Error running SampleApplication: Command line is too long. Shorten command line for SampleApplication or also for Spring Boot default configuration&#xff0c;报这种错误&#x…