linshi_temp_erweima_html

本文档提供了邻食App的下载页面源代码,详细展示了使用HTML、CSS和JavaScript进行响应式网页设计的方法,包括设备适配、触摸滚动优化及根据不同设备类型跳转至相应下载链接的技术实现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
<title>邻食</title>
</head>
<style>
html { -ms-text-size-adjust: none; -webkit-text-size-adjust: none; text-size-adjust: none; font-size: 62.5% }
body { height: 100%; margin: 0; color: #333;background-color: #fff; -webkit-overflow-scrolling: touch; font-family:sans-serif,Microsoft YaHei; }
body, html, img { margin: 0; padding: 0; border: 0; }
.img-responsive { display: block; max-width: 100%; height: auto; }
.img_full { width: 100%; }
.row { position: relative; width: 100%; height: 100%; }
.down { width: 100%; position: absolute; top: 770px; }
.down_menu { width: 45%; margin: 0 auto; }
.down_menu img { display: block; cursor: pointer; }
.m1 { padding: 8px 6px; background: #5db820; border: none; color: #fff; }
</style>
<body>
<div class="row" id="down"><img src="../images/download/down_bg.jpg" class="img-responsive img_full">
  <div class="down" id="down-m">
    <div class="down_menu"> <img src="../images/download/down_menu@x2.png" class="img-responsive img_full" id="down-btn2" onClick="down();"> </div>
  </div>
</div>
<script type="text/javascript">
        
        var userAgent = window.navigator.userAgent.toLowerCase();

        window.onload = function(){
            re_size();
            url_redirect();
        }
        window.onresize = function(){
            re_size();
        }
        function re_size(){
            var height = document.getElementById('down').offsetHeight;
            document.getElementById('down-m').style.top = parseInt(height*0.225)+'px';
        }
        
        function down(){
            if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) {
                window.location.href ="http://itunes.apple.com/cn/app/id999310673?mt=8";
            } else if (/(Android)/i.test(navigator.userAgent)) {
                window.location.href ="http://zybapp.com/res/app/android/Linshi-2.0.0.apk";
            } else {
                window.location.href ="http://linshiapp.com/";
            };
        }
    </script>
</body>
</html>

转载于:https://www.cnblogs.com/yousen/p/4764426.html

import threading import time import cv2 import rospy from cv_bridge import CvBridge, CvBridgeError from sensor_msgs.msg import Image as ROSImage from pyzbar.pyzbar import decode def read_qr_province(timeout=5): """ 读取二维码中的省份信息,超时后自动停止 功能:订阅摄像头图像,识别二维码内容并提取省份信息 参数:timeout - 超时时间(秒),默认5秒 返回:识别到的省份名称(字符串)或停止标志 """ # 省份映射表 PROVINCE_MAP = { u"四川": "sichuan", u"安徽": "anhui", u"湖南": "hunan", u"广东": "guangdong", u"浙江": "zhejiang", u"江苏": "jiangsu", u"福建": "fujian", u"河南": "henan", u"湖北": "hubei", u"广西": "guangxi" } # 内部状态变量 latest_province = ["none"] start_time = time.time() # 开始计时时间 lock = threading.Lock() bridge = CvBridge() running = [True] # 控制是否继续运行的标志 # 初始化ROS节点 if not rospy.core.is_initialized(): rospy.init_node('province_qr_reader', anonymous=True, disable_signals=True) # 图像回调函数 def image_callback(data): if not running[0]: # 如果已超时,不再处理图像 return try: # 转换图像并识别二维码 cv_image = bridge.imgmsg_to_cv2(data, "bgr8") gray_image = cv2.cvtColor(cv_image, cv2.COLOR_BGR2GRAY) decoded_objects = decode(gray_image) with lock: if decoded_objects: qr_content = decoded_objects[0].data.decode('utf-8') found = False for keyword, province in PROVINCE_MAP.items(): if keyword in qr_content: latest_province[0] = province found = True break if found: running[0] = False # 识别成功,停止识别 else: # 检查是否超时 if time.time() - start_time > timeout: latest_province[0] = "none" running[0] = False # 超时,停止识别 except CvBridgeError as e: rospy.logerr("图像转换错误: %s" % e) except Exception as e: rospy.logerr("二维码识别错误: %s" % e) # 启动图像订阅 image_sub = rospy.Subscriber( "/usb_cam/image_raw", ROSImage, image_callback, queue_size=1 ) # 清理函数 def cleanup(): running[0] = False image_sub.unregister() rospy.on_shutdown(cleanup) time.sleep(0.1) # 等待初始化 # 定义获取省份信息的函数 def get_province(): with lock: return latest_province[0] # 定义检查是否运行的函数 def is_running(): with lock: return running[0] return get_province, is_running, cleanup def read_point(): # 位置和姿态变量定义(示例值) wuxiao_position = (0, 0, 0) wuxiao_orientation = (0, 0, 0, 1) # 其他省份位置信息(省略,与之前相同) sichuan_position = (1, 1, 0) sichuan_orientation = (0, 0, 0, 1) anhui_position = (2, 2, 0) anhui_orientation = (0, 0, 0, 1) # ... 其他省份位置定义 ... try: # 获取省份读取函数和状态检查函数 get_province, is_running, cleanup = read_qr_province(timeout=5) # 等待识别完成或超时 rate = rospy.Rate(10) # 10Hz检查频率 while is_running() and not rospy.is_shutdown(): rate.sleep() # 获取最终识别结果 province = get_province() rospy.loginfo("识别结束,结果: %s" % province) # 根据结果设置位置 if province == "none": linshi_position = wuxiao_position linshi_orientation = wuxiao_orientation rospy.loginfo("超时未识别到有效省份,使用无效位置") elif province == 'sichuan': linshi_position = sichuan_position linshi_orientation = sichuan_orientation # ... 其他省份判断 ... # 这里可以添加使用位置信息的逻辑 except KeyboardInterrupt: rospy.loginfo("程序已手动停止") except Exception as e: rospy.logerr("程序出错: %s" % e) finally: cleanup() # 确保资源被清理 if __name__ == "__main__": read_point()
08-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值