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

网站建设费用计什么科目网站维护的主要内容

网站建设费用计什么科目,网站维护的主要内容,建网站需要费用,axure直接做网站vue cli上简单的功能&#xff0c;在js上太难弄了&#xff0c;这个弹窗功能时常用到&#xff0c;保存起来备用吧 备注&#xff1a;deepseek这个人工智障写一堆有问题的我&#xff0c;还老服务器繁忙 效果图&#xff1a; html代码&#xff1a; <div class"modal-mask&qu…

vue cli上简单的功能,在js上太难弄了,这个弹窗功能时常用到,保存起来备用吧
备注:deepseek这个人工智障写一堆有问题的我,还老服务器繁忙

效果图:

在这里插入图片描述

html代码:

<div class="modal-mask" v-show="qrcodeShow" @click.self="closeModal"><div class="modal-container" ref="modal" :style="modalStyle"><divclass="modal-header"@mousedown="startDrag"@touchstart.prevent="startDrag"@mouseup="stopDrag"@touchend="stopDrag"><span>获取app</span><span class="close-btn" @click="closeModal">&times;</span></div><div class="image-container"><img :src="qrcodeImgUrl" class="modal-image" alt="弹窗图片" /></div></div>
</div>

js代码:

data: {scanCodeList: [],qrcodeShow: false,qrcodeImgUrl: "**图片地址**",isDragging: false,startX: 0,startY: 0,translateX: 0,translateY: 0,modalRect: null,
},created() {this.$nextTick(() => {// 使用jQuery添加动画效果$(".modal-container").hide();// 监听弹窗状态变化this.$watch("qrcodeShow", (newVal) => {if (newVal) {$(".modal-container").fadeIn(300);} else {$(".modal-container").fadeOut(300);}});});},computed: {modalStyle() {return {transform: `translate(${this.translateX}px, ${this.translateY}px)`,};},},methods: {showModal() {this.qrcodeShow = true;},closeModal() {this.qrcodeShow = false;},// 开始拖动startDrag(e) {this.isDragging = true;const clientX = e.touches ? e.touches[0].clientX : e.clientX;const clientY = e.touches ? e.touches[0].clientY : e.clientY;// 记录初始位置this.startX = clientX - this.translateX;this.startY = clientY - this.translateY;// 获取弹窗尺寸this.modalRect = this.$refs.modal.getBoundingClientRect();// 添加事件监听document.addEventListener("mousemove", this.onDrag);document.addEventListener("touchmove", this.onDrag, { passive: false });document.addEventListener("mouseup", this.stopDrag);document.addEventListener("touchend", this.stopDrag);// 优化拖动体验document.body.style.cursor = "grabbing";document.body.style.userSelect = "none";},// 拖动处理onDrag(e) {if (!this.isDragging) return;// 获取坐标const clientX = e.touches ? e.touches[0].clientX : e.clientX;const clientY = e.touches ? e.touches[0].clientY : e.clientY;// 计算新位置let newX = clientX - this.startX;let newY = clientY - this.startY;// 计算边界const viewportWidth = document.documentElement.clientWidth;const viewportHeight = document.documentElement.clientHeight;const modalWidth = this.modalRect.width;const modalHeight = this.modalRect.height;// 有效边界const minX = -(viewportWidth - modalWidth) / 2;const minY = -(viewportHeight - modalHeight) / 2;const maxX = (viewportWidth - modalWidth) / 2;const maxY = (viewportHeight - modalHeight) / 2;// 应用约束newX = Math.max(minX, Math.min(newX, maxX));newY = Math.max(minY, Math.min(newY, maxY));// 更新位置this.translateX = newX;this.translateY = newY;},// 停止拖动stopDrag() {this.isDragging = false;// 移除事件监听document.removeEventListener("mousemove", this.onDrag);document.removeEventListener("touchmove", this.onDrag);document.removeEventListener("mouseup", this.stopDrag);document.removeEventListener("touchend", this.stopDrag);// 恢复样式document.body.style.cursor = "";document.body.style.userSelect = "";},// 重置位置到屏幕中央resetPosition() {this.$nextTick(() => {const modal = this.$refs.modal;if (modal) {const rect = modal.getBoundingClientRect();const viewportWidth = document.documentElement.clientWidth;const viewportHeight = document.documentElement.clientHeight;this.translateX = (viewportWidth - rect.width) / 2;this.translateY = (viewportHeight - rect.height) / 2;}});},},

css代码:

/* 遮罩层样式 */.modal-mask {position: fixed;top: 0;left: 0;width: 100%;height: 100%;background: rgba(0, 0, 0, 0.5);z-index: 9998;display: flex;justify-content: center;align-items: center;/* 弹窗容器 */.modal-container {display: none;background: white;border-radius: 8px;box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33);width: 500px;height: 500px;z-index: 9999;position: relative;/* 弹窗头部 */.modal-header {height: 50px;padding: 15px;border-bottom: 1px solid #eee;display: flex;justify-content: space-between;align-items: center;cursor: move;user-select: none; /* 防止文字被选中 */span {font-size: 18px;font-weight: bold;}/* 关闭按钮样式 */.close-btn {cursor: pointer;font-size: 20px;color: #666;padding: 0 5px;}}/* 图片容器 */.image-container {padding: 20px;width: 100%;height: calc(100% - 50px);overflow: auto;img {width: 100%;height: 100%;object-fit: cover;}}}}
http://www.dtcms.com/wzjs/452421.html

相关文章:

  • 中国宁波网站西安网站制作费用
  • 最精品网站建设百分百营销软件官网
  • 极速网站建设定制多少钱怎么做好网络营销推广
  • 医疗类网站建设网络客服
  • 女人动漫做受网站运营网站是什么意思
  • 做高端网站的网络公司本地推广最好用的平台
  • 动漫网站模板宁波网站推广制作
  • 网站建设单选百度收录刷排名
  • 电商详情做的最好看的网站各大搜索引擎网址
  • 网站图片设计怎样才能高大上域名检测
  • 网站开发公司凭证平台推广精准客源
  • 做检测设备的网站有哪些职业技能培训有哪些
  • 青岛市网站建设公司短信广告投放软件
  • 画廊网站建设信息流广告优化
  • 一起装修网口碑怎么样东莞网站制作十年乐云seo
  • 怎么制作网站教程下载城关网站seo
  • js网站登录怎么做广州seo优化费用
  • 百度免费域名注册网站seo标题优化关键词
  • 义乌网站建设优化推广app推广软件有哪些
  • 织梦网站根目录在哪里seo还有前景吗
  • 做全房订制网站公司免费网站优化排名
  • 哪个网站可以做行测题目百度数据网站
  • asp漂亮的个人网站模板百度一下 你就知道首页官网
  • 山西网站建设制作推广seo网站关键词优化排名
  • 福田做网站联系电话百度文库官网首页
  • 小企业做网站怎么做长沙seo袁飞
  • 企业网站设计的深圳公司chrome官方下载
  • 怎么查网站空间化妆品推广软文
  • 网站建设与搜索app推广方案
  • 个人网站可以做企业网站吗太原搜索引擎优化