Web前端开发 小实训(三) 商品秒杀小练习

学生能够在本次实训中完成商品秒杀页面的基本逻辑

任务要求

能够实现某一个商品的秒杀,在倒计时结束后不再进行秒杀。

操作步骤

1、打开预设好的页面

<html>

<head>
    <meta charset="utf-8">
    <title>秒杀</title>
    <link rel="stylesheet" href="css/ms.css">

</head>

<body>
    <div class="container">
        <div class="item ms">
            <h2 class="title">
                商品秒杀
            </h2>

            <h3 class="subtitle">
                FLASH DEALS
            </h3>

            <i class="icon">
            </i>

            <p class="desc">
                本场距离结束时间
            </p>
            <div class="clock">
                <span id="hours" class="hour">00</span>
                <span class="point">:</span>
                <span id="minutes" class="minute">00</span>
                <span class="point">:</span>
                <span id="seconds" class="second">59</span>
            </div>
        </div>

        <div class="item">
            <a href="#" class="product-link">
                <img src="https://img20.360buyimg.com/seckillcms/s280x280_jfs/t28882/109/582315249/52026/e4ff99b9/5bf7cb37N98f8ac82.jpg.webp"
                    alt="商品" height="130">
                <p class="product-desc">
                    3M 节气门清洗剂【不伤镀层|多功能除油泥除积碳|8866升级】汽车金属件润滑节流阀去油污非化清剂PN18066
                </p>
                <div class="price">
                    <span class="price-new">
                        134.00
                    </span>
                    <span class="price-old">
                        208.00
                    </span>
                    <button class="button_allow">抢购 </button>

                </div>
            </a>
        </div>

        <div class="item">
            <a href="#" class="product-link">
                <img src="https:///img12.360buyimg.com/seckillcms/s280x280_jfs/t1/116581/22/13747/111761/5f2373f5E2f543b8f/8a64bb1f2303930b.jpg.webp"
                    alt="商品" height="130">
                <p class="product-desc">
                    华为nova7 SE 5G手机【12期免息可选/送碎屏险】 全网通 幻夜黑 8G+128G
                </p>
                <div class="price">
                    <span class="price-new">
                        1324.00
                    </span>
                    <span class="price-old">
                        4208.00
                    </span>
                    <button class="button_allow">抢购 </button>

                </div>
            </a>
        </div>
        <div class="item">
            <a href="#" class="product-link">
                <img src="https:///img12.360buyimg.com/seckillcms/s280x280_jfs/t1/144957/21/3917/192269/5f1fcf99E314ac8a7/75a2d6a7cabc3d72.jpg.webp"
                    alt="商品" height="130">
                <p class="product-desc">
                    雷公馆 毛呢大衣女秋冬新品毛呢外套羊毛呢宽松显瘦呢子大衣中长款单排扣品牌上衣 米白色 M
                </p>
                <div class="price">
                    <span class="price-new">
                        324.00
                    </span>
                    <span class="price-old">
                        908.00
                    </span>
                     <button class="button_allow">抢购 </button>
                </div>
            </a>
        </div>
    </div>
</body>
</html>

css

/*位置在css目录下,名字为 ms.css*/
*{
    margin: 0px;
    padding: 0px;
    font: 12px/1.5 Tahoma, Arial, Harrington, "微软雅黑" /*给标签一个初始大小 12像素 1.5倍行距 管理字体*/
}
a{
    text-decoration: none;/*去掉默认链接的下划线*/
    color: black;
}
a:hover{
    color: red;/*实现鼠标上去变色*/
}
.container{
    /*border: red solid 1px;*/
    overflow: hidden;	
}
.item{
    float: left;
    width: 190px;
    height: 260px;
    border: #877D7D solid 1px;			
}
.ms{/*秒杀模块拥有单独的背景色 且模块的字体是白色*/
    background-color: #D90D0D;
    color: white;
    text-align: center;/*表示里面所有的模块是居中的*/
}
.ms .title{/*秒杀模块的字体*/
    font-size: 30px;
    margin: 15px;/*距头顶*/
}
.ms .subtitle{
    font-size: 20px;
    color: rgba(255,255,255,0.5);/*含有透明色*/
    margin-bottom: 10px;/*和下一个模块保持距离*/
}
.ms .icon{/*那个闪电描述 这个盒子*/
    width: 30px;
    height:57px;/*此时没有显示 */
    display: block;/*i元素通过这个显示属性*/
    background-image: url(../images/3.jpg);/*此时只显示了一小部分 需要移动*/
    background-position: -130px -102px;
    margin:0 auto 15px;/*块状模块的居中*/ /*和下一个模块保持距离*/
    
}
.ms .desc{
    font-size: 16px;
    margin: 5px;
    
}
/*后代选择器*/
.ms .clock span.second,span.hour,span.minute{
    display: inline-block;/*并排显示 更是为了可以人为指定宽度*/
    width: 40px;
    height: 40px;
    background-color: black;
    font-size: 20px;
    line-height: 40px;/*让字体的显示在中间按*/	
}
.ms .clock span.point{
    display: inline-block;/*并排显示 更是为了可以人为指定宽度*/
    width: 10px;
    height: 40px;

    font-size: 20px;
    line-height: 40px;/*让字体的显示在中间按*/
}
.product-link{
    display: block;
    height: 100%;
    text-align: center;
    padding-top: 39px;
}
.product-desc{/*文字显示在一行并且没显示的用...代替*/
    white-space: nowrap;/*文字不换行*/
    width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;/*超出部分使用..代替*/
    margin: 0 auto 20px;	
    
}
.price{
    width: 160px;
    height: 20px;
    background-color: red;
    margin: 0 auto;
    padding:1px;
}
.price span{

    width: 78px;
    height: 20px;
    font-size: 14px;
    display: inline-block;
}
.price .price-new{
    line-height: 20px;
    color: antiquewhite;
    
}
.price .price-old{

    color: white;
    background-color: #766364;
    
}

.price .button_allow{
    width: 160px;
    height: 20px;
    font-size: 14px;
    margin-top: 5px;
    color: white;
    display: inline-block;
    background-color: red;

}

.price .button_forbid{
    width: 160px;
    height: 20px;
    font-size: 14px;
    margin-top: 5px;
    color: white;
    display: inline-block;
    background-color:  #766364;
}

2、设置秒杀结束时间

//单独设置一个结束时间,人为定义
let endTime = new Date("2024-5-5 10:00:00").getTime();

3、声明变量保存剩余的时间

// 2、声明变量保存剩余的时间
let hours, minutes, seconds = 0;

4、 设置定时器,实现限时秒杀效果

 function ms() {
            alert("秒杀开始了!")
            //4、设置定时器
           let interval =  window.setInterval(function () {
              //实际业务
            }, 1000);
        }
        //调用该方法
        ms();

5、 获取时间差(单位秒),并判断秒杀是否过期

 let now = new Date();//获取当前时间
  //获取设置的时间差 remaining 差距
 let remaining = endTime - now.getTime();
  //只要时间差大于0 就可以进行倒计时 
 if (remaining > 0) {
  //简易版:转化为还差多少秒
        let seconds = parseInt(remaining / 1000);//还差多少秒 转化为整数秒
        seconds = seconds < 10 ? "0"+seconds:seconds; //小于 0 则为0+秒数
        document.getElementById("seconds").innerText = seconds;
  } else {
        //结束了
         alert("秒杀结束了!");
         //复位
         document.getElementById("seconds").innerText = "00";
  }

6、取消定时器

 } else {
        //结束了
         alert("秒杀结束了!");
        //6、在停止后结束取消定时器
        window.clearInterval(interval);
}

7、设置演示当前效果(将 倒计时时间设置为大于 当前时间)

8、倒计时结束前可以点击抢购获取商品(补充:onclick事件)

<button class="button_allow" onclick="alert('恭喜你抢到了清洁剂!')">抢购 </button>
<button class="button_allow" onclick="alert('恭喜你抢到了nova7SE!')">抢购 </button>
<button class="button_allow" onclick="alert('恭喜你抢到了毛呢大衣!')">抢购 </button>

9、倒计时结束后修改按钮样式,并使其不再进行点击

//结束了
alert("秒杀结束了!");
document.getElementById("seconds").innerText = "00";

//6、在停止后结束取消定时器
window.clearInterval(interval);

//8、让所有按钮修改弹出样式
let buttonList = document.getElementsByTagName("button");
for(let index = 0 ; index < buttonList.length; index ++){   
      buttonList[index].setAttribute("disabled","true");//不再进行点击
      buttonList[index].removeAttribute("onclick");//移除点击事件
      buttonList[index].classList.replace("button_allow","button_forbid");

10、查看最终效果

完整代码:

<html>

<head>
    <meta charset="utf-8">
    <title>秒杀</title>
    <link rel="stylesheet" href="css/ms.css">

</head>

<body>
    <div class="container">
        <div class="item ms">
            <h2 class="title">
                商品秒杀
            </h2>

            <h3 class="subtitle">
                FLASH DEALS
            </h3>

            <i class="icon">
            </i>

            <p class="desc">
                本场距离结束时间
            </p>
            <div class="clock">
                <span id="hours" class="hour">00</span>
                <span class="point">:</span>
                <span id="minutes" class="minute">00</span>
                <span class="point">:</span>
                <span id="seconds" class="second">59</span>
            </div>
        </div>

        <div class="item">
            <a href="#" class="product-link">
                <img src="https://img20.360buyimg.com/seckillcms/s280x280_jfs/t28882/109/582315249/52026/e4ff99b9/5bf7cb37N98f8ac82.jpg.webp"
                    alt="商品" height="130">
                <p class="product-desc">
                    3M 节气门清洗剂【不伤镀层|多功能除油泥除积碳|8866升级】汽车金属件润滑节流阀去油污非化清剂PN18066
                </p>
                <div class="price">
                    <span class="price-new">
                        134.00
                    </span>
                    <span class="price-old">
                        208.00
                    </span>
                    <button class="button_allow" onclick="alert('恭喜你抢到了3M清洁剂!')">抢购 </button>

                </div>
            </a>
        </div>

        <div class="item">
            <a href="#" class="product-link">
                <img src="//img12.360buyimg.com/seckillcms/s280x280_jfs/t1/116581/22/13747/111761/5f2373f5E2f543b8f/8a64bb1f2303930b.jpg.webp"
                    alt="商品" height="130">
                <p class="product-desc">
                    华为nova7 SE 5G手机【12期免息可选/送碎屏险】 全网通 幻夜黑 8G+128G
                </p>
                <div class="price">
                    <span class="price-new">
                        1324.00
                    </span>
                    <span class="price-old">
                        4208.00
                    </span>
                    <button class="button_allow" onclick="alert('恭喜你抢到了华为nova7 SE!')">抢购 </button>

                </div>
            </a>
        </div>
        <div class="item">
            <a href="#" class="product-link">
                <img src="//img12.360buyimg.com/seckillcms/s280x280_jfs/t1/144957/21/3917/192269/5f1fcf99E314ac8a7/75a2d6a7cabc3d72.jpg.webp"
                    alt="商品" height="130">
                <p class="product-desc">
                    雷公馆 毛呢大衣女秋冬新品毛呢外套羊毛呢宽松显瘦呢子大衣中长款单排扣品牌上衣 米白色 M
                </p>
                <div class="price">
                    <span class="price-new">
                        324.00
                    </span>
                    <span class="price-old">
                        908.00
                    </span>
                     <button class="button_allow" onclick="alert('恭喜你抢到了毛呢大衣!')">抢购 </button>
                </div>
            </a>
        </div>
    </div>


    <script>
        //  1、设置秒杀结束时间 转化为 time类型
        let endTime = new Date("2024-5-5 10:46:20").getTime(); //将时间转化为 毫秒,用于后续计算

        // 2、声明变量保存剩余的时间
        let hours, minutes, seconds = 0;

        //3、设置方法 用于计算是否到时间了
        function ms() {
            alert("秒杀开始了!")
            //4、设置定时器
           let interval =  window.setInterval(function () {
                let now = new Date();//获取当前时间
                //获取设置的时间差 remaining 差距
                let remaining = endTime - now.getTime();
                //只要时间差大于0 就可以进行倒计时 
                if (remaining > 0) {
                    //简易版:转化为还差多少秒
                    let seconds = parseInt(remaining / 1000);//还差多少秒 转化为整数秒
                    seconds = seconds < 10 ? "0"+seconds:seconds; //小于 0 则为0+秒数
                    document.getElementById("seconds").innerText = seconds;
                } else {
                    //结束了
                    alert("秒杀结束了!");
                    document.getElementById("seconds").innerText = "00";
                    //6、在停止后结束取消定时器
                    window.clearInterval(interval);

                    //让所有按钮修改弹出样式
                    let buttonList = document.getElementsByTagName("button");
                    for(let index = 0 ; index < buttonList.length; index ++){   
                        buttonList[index].setAttribute("disabled","true");//不再进行点击
                        buttonList[index].removeAttribute("onclick");//移除点击事件
                        buttonList[index].classList.replace("button_allow","button_forbid");
                    }
                }
            }, 1000);
        }
        //调用该方法
        ms();
    </script>
</body>

</html>

11、思考,如何实现小时,分钟,秒数的显示?

//参考代码
<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>秒杀</title>
    <link rel="stylesheet" href="css/ms.css">

</head>

<body>
    <div class="container">
        <div class="item ms">
            <h2 class="title">
                商品秒杀
            </h2>

            <h3 class="subtitle">
                FLASH DEALS
            </h3>

            <i class="icon">
            </i>

            <p class="desc">
                本场距离结束时间
            </p>
            <div class="clock">
                <span id="hours" class="hour">00</span>
                <span class="point">:</span>
                <span id="minutes" class="minute">00</span>
                <span class="point">:</span>
                <span id="seconds" class="second">59</span>
            </div>
        </div>

        <div class="item">
            <a href="#" class="product-link">
                <img src="https://img20.360buyimg.com/seckillcms/s280x280_jfs/t28882/109/582315249/52026/e4ff99b9/5bf7cb37N98f8ac82.jpg.webp"
                    alt="商品" height="130">
                <p class="product-desc">
                    3M 节气门清洗剂【不伤镀层|多功能除油泥除积碳|8866升级】汽车金属件润滑节流阀去油污非化清剂PN18066
                </p>
                <div class="price">
                    <span class="price-new">
                        134.00
                    </span>
                    <span class="price-old">
                        208.00
                    </span>
                    <button class="button_allow" onclick="alert('恭喜你抢到了3M清洁剂!')">抢购 </button>

                </div>
            </a>
        </div>

        <div class="item">
            <a href="#" class="product-link">
                <img src="//img12.360buyimg.com/seckillcms/s280x280_jfs/t1/116581/22/13747/111761/5f2373f5E2f543b8f/8a64bb1f2303930b.jpg.webp"
                    alt="商品" height="130">
                <p class="product-desc">
                    华为nova7 SE 5G手机【12期免息可选/送碎屏险】 全网通 幻夜黑 8G+128G
                </p>
                <div class="price">
                    <span class="price-new">
                        1324.00
                    </span>
                    <span class="price-old">
                        4208.00
                    </span>
                    <button class="button_allow" onclick="alert('恭喜你抢到了华为nova7 SE!')">抢购 </button>

                </div>
            </a>
        </div>
        <div class="item">
            <a href="#" class="product-link">
                <img src="//img12.360buyimg.com/seckillcms/s280x280_jfs/t1/144957/21/3917/192269/5f1fcf99E314ac8a7/75a2d6a7cabc3d72.jpg.webp"
                    alt="商品" height="130">
                <p class="product-desc">
                    雷公馆 毛呢大衣女秋冬新品毛呢外套羊毛呢宽松显瘦呢子大衣中长款单排扣品牌上衣 米白色 M
                </p>
                <div class="price">
                    <span class="price-new">
                        324.00
                    </span>
                    <span class="price-old">
                        908.00
                    </span>
                     <button class="button_allow" onclick="alert('恭喜你抢到了毛呢大衣!')">抢购 </button>
                </div>
            </a>
        </div>
    </div>


    <script>
        //  1、设置秒杀结束时间 转化为 time类型
        let endTime = new Date("2024-5-11 11:26:20").getTime(); //将时间转化为 毫秒,用于后续计算

        // 2、声明变量保存剩余的时间
        let hours, minutes, seconds = 0;

        //3、设置方法 用于计算是否到时间了
        function ms() {
            alert("秒杀开始了!")
            //4、设置定时器
           let interval =  window.setInterval(function () {
                let now = new Date();//获取当前时间
                //获取设置的时间差 remaining 差距
                let remaining = endTime - now.getTime();
                //只要时间差大于0 就可以进行倒计时 

                if (remaining > 0) {
                    //简易版:转化为还差多少秒
                    hours = parseInt((remaining /1000/3600));  // 计算剩余小时(除以60*60转换为小时,获取剩余的小时)
                    minutes = parseInt((remaining /1000 / 60) % 60);    // 计算剩余分钟(除以60转为分钟,与60取模,获取剩余的分钟)
                    seconds = parseInt(remaining /1000 % 60 ); //计算60秒内还有几秒
                    hours = hours < 10 ? '0' + hours : hours;
                    minutes = minutes < 10 ? '0' + minutes : minutes;
                    seconds = seconds < 10 ? '0' + seconds : seconds;
                    console.log(hours + ","+minutes+","+seconds)
                    document.getElementById("hours").innerText = hours;
                    document.getElementById("minutes").innerText = minutes;
                    document.getElementById("seconds").innerText = seconds;
                } else {

                    //结束了
                    alert("秒杀结束了!");
                    document.getElementById("hours").innerText = "00";
                    document.getElementById("minutes").innerText = "00";
                    document.getElementById("seconds").innerText = "00";
                    //6、在停止后结束取消定时器
                    window.clearInterval(interval);

                    //让所有按钮修改弹出样式
                    let buttonList = document.getElementsByTagName("button");
                    for(let index = 0 ; index < buttonList.length; index ++){   
                        buttonList[index].setAttribute("disabled","true");//不再进行点击
                        buttonList[index].removeAttribute("onclick");//移除点击事件
                        buttonList[index].classList.replace("button_allow","button_forbid");
                    }
                }
            }, 1000);
        }
        //调用该方法
        ms();
    </script>
</body>

</html>

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

vue + element-plus 开发中遇到的问题

1.问题之路由守卫 初写路由守卫&#xff0c;对于next()的理解不是很透彻&#xff0c;就想着都放行&#xff0c;不然看不到效果&#xff0c;结果控制台出现了警告&#xff0c;想着报黄的问题就不是问题&#xff0c;但仔细一看发现他说&#xff0c;如果再生产阶段就会失败&#x…

【问题分析】锁屏界面调起google语音助手后壁纸不可见【Android 14】

1 问题描述 为系统和锁屏分别设置两张不同的壁纸&#xff0c;然后在锁屏界面长按Power调起google语音助手后&#xff0c;有时候会出现壁纸不可见的情况&#xff0c;如以下截图所示&#xff1a; 有的时候又是正常的&#xff0c;但显示的也是系统壁纸&#xff0c;并非是锁屏壁纸…

【用文本生成歌声】Learn2Sing 2.0——歌声转换算法及梅尔频谱详解

一. 频谱图与梅尔谱图的介绍 频谱图&#xff1a;频谱图可以理解为一堆垂直堆叠在一起的快速傅里叶变换结果。 1.1 信号 在进入频谱图模块之前&#xff0c;首先我们需要了解信号是什么。 信号就是某一特定量随时间变化&#xff0c;对于音频来说&#xff0c;这个特定的变化量就…

韩顺平0基础学Java——第8天

p155-168 数组&#xff08;第六章&#xff09; 数组可以存放多个同一类型的数据&#xff0c;数组也是一种数据类型&#xff08;引用类型&#xff09;。 即&#xff0c;数组就是一组数据~ 例&#xff1a;double [] hens {1,2,3,4,5,6}; 新建了一组鸡&#xff0c;里面有6个。…

代码随想录算法训练营第36期DAY18

DAY18 二叉树的层序遍历 102二叉树的层序遍历 “队列先进先出&#xff0c;符合一层一层遍历的逻辑&#xff0c;而用栈先进后出适合模拟深度优先遍历也就是递归的逻辑。” 二叉树层序遍历模版&#xff1a; /** * Definition for a binary tree node. * struct TreeNode { *…

PostgreSQL的学习心得和知识总结(一百四十二)|深入理解PostgreSQL数据库数据库之 Continuous Integration

目录结构 注&#xff1a;提前言明 本文借鉴了以下博主、书籍或网站的内容&#xff0c;其列表如下&#xff1a; 1、参考书籍&#xff1a;《PostgreSQL数据库内核分析》 2、参考书籍&#xff1a;《数据库事务处理的艺术&#xff1a;事务管理与并发控制》 3、PostgreSQL数据库仓库…

办公技巧之合集文档 拆分_word

问题 如何将文档合集拆分为单独文档。 操作步骤 软件 word 365 原理简述&#xff1a; 在 word 大纲视图下&#xff0c;通过一级标题确定子文档范围&#xff0c;然后导出即可。 文档结构 从下图可见&#xff0c;文档结构为已建立大纲级别的文档&#xff0c;如果没有建立&a…

每日一题——力扣27. 移除元素(举一反三)

题目链接&#xff1a;https://leetcode.cn/problems/remove-element/description/ 菜鸡写法&#xff1a; // 函数定义&#xff0c;移除数组nums中所有值为val的元素&#xff0c;并返回新的数组长度 int removeElement(int* nums, int numsSize, int val) {// 如果数组长度为…

Steam游戏搬砖,不说破万,月入5K没问题

steam游戏搬砖项目的玩法就是打汇率差&#xff0c;在steam平台购买道具&#xff0c;挂在网易buff上出售&#xff0c;通过汇率差盈利。一天交易几百美金的道具&#xff0c;大概能搞到200块左右的利润&#xff0c;而且平台是支持这样交易的&#xff0c;还很稳定。目前最主流的游戏…

设计模式1——初步认识篇

设计模式1——初步认识篇 一、先让我们浅聊一下面向对象和设计模式。 说起设计模式&#xff0c;我第一次听到它&#xff0c;是在学习面向对象的时候。那么什么是面向对象&#xff0c;什么是设计模式&#xff0c;而且设计模式和面向对象又有什么关系呢&#xff1f; 1、什么是面…

im8mm 网络卡死 Rx packets:1037578 errors:66 dropped:0 overruns:66 frame:0

1&#xff1a;网络接收数据包异常 2&#xff1a;问题复现 问题在进行网络数据包同吞吐量测试的时候出现的。同时发现&#xff0c;在使用iperf2测试时&#xff0c;是不会出现网络中断卡死的情况&#xff0c;使用 iperf3时才会出现此问题 指令(下面的指令运行在PC2上面&#xff…

十二种网络威胁防护方案

一、SQL注入 SQL注入即是指web应用程序对用户输入数据的合法性没有判断或过滤不严&#xff0c;攻击者可以在web应用程序中事先定义好的查询语句的结尾上添加额外的SQL语句&#xff0c;在管理员不知情的情况下实现非法操作&#xff0c;以此来实现欺骗数据库服务器执行非授权的任…

kali linux更新卡在libc6:amd64 (2.37-15)

适配于linux的windows子系统,wsl2,安装kali linux,运行 sudo apt update 卡在:Setting up libc6:amd64 (2.37-15) … 关机重启、重新修复执行也不行 解决办法:kill当前apt进程或者关机重启kali-linux,然后执行: ssudo mv /usr/sbin/telinit /usr/sbin/telinit.baksu…

安装docker镜像nginx1.26.0版本,与删除docker容器【灵异事件】

为了http3 的这个模块&#xff0c;所以需要升级nginx的版本&#xff0c;需要nginx1.26.0才有 –with-http_v3_module 这个模块 为什么记录一下&#xff1f;因为觉得奇怪 1&#xff1a;删除nginx镜像&#xff0c;显示镜像还被某个容器在使用 luichunluichun:~$ docker rmi ng…

数电——集成计数器

分析 &#xff08;1&#xff09;74161 4位同步&#xff08;cp相同&#xff09;二进制&#xff0c;模16&#xff08;2的4次方&#xff09; 逻辑符号 端口 D0,D1,D2,D3为输入信号 Q0,Q1,Q2,Q3为输出信号 RCO输出进位标志&#xff1a;记满16个数后&#xff0c;输出1 P,T 控…

番外篇 | 利用PyQt5+YOLOv5来搭建目标检测系统(附可视化界面+功能介绍+源代码)

前言:Hello大家好,我是小哥谈。PyQt5是一个Python绑定的Qt库,是用于创建图形用户界面(GUI)和其他应用程序组件的工具包。PyQt5提供了许多GUI元素,如按钮、文本框、标签等,也提供了许多Qt的功能,如网络、数据库、XML等。通过PyQt5可以在Python中使用Qt的丰富功能和强大的工…

远程桌面连接不上怎么连服务器,原因是什么?如何解决?

远程桌面连接不上怎么连服务器&#xff0c;原因是什么&#xff1f;如何解决&#xff1f; 面对远程桌面连接不上的困境&#xff0c;我们有办法&#xff01; 当你尝试通过远程桌面连接服务器&#xff0c;但遭遇连接失败的挫折时&#xff0c;不要慌张。这种情况可能由多种原因引起…

Python运维之协程

目录 一、定义协程 二、并发 三、异步请求 协程是一种轻量级的线程&#xff0c;它通过保存和恢复寄存器上下文和栈来实现调度切换&#xff0c;从而保留函数执行的状态。 这种机制使得协程在处理I/O密集型任务时效率较高&#xff0c;因为它们可以在I/O操作期间让出CPU&#…

【触摸案例-手势解锁案例-错误的样式 Objective-C语言】

一、然后呢,我们再来说一下这个错误的样式 1.首先,在我们的示例程序里边,我现在来连一条线,一撒手的时候, 它先出来一个,红色的按钮的样式,那么这个时候呢,实际上,是在设置另外一种状态,给按钮的另外一种状态,再去设置另外一张红色的图片,然后呢,再去切换成那一种…

C++青少年简明教程:C++中的常量、变量、表达式和语句

C青少年简明教程&#xff1a;C中的常量、变量、表达式和语句 在C编程中&#xff0c;常量、变量、表达式和语句是基本的编程概念。 常量&#xff08;Constants&#xff09;&#xff1a;在程序中具有固定值的数据称为常量。常量可以是字面值&#xff0c;如整数、浮点数、字符或…
最新文章