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

赣州网站推广哪家最专业重庆渝兴建设有限公司网站

赣州网站推广哪家最专业,重庆渝兴建设有限公司网站,tp框架做的图片网站,建设网站费用入会计分录h5用js写,微信小程序用 代码里面没有完全实现吸附边缘的功能,需要吸附边缘的话还得自己再完善下(h5的吸附边缘是可以的,小程序的还有点问题) 主要功能是:图片上写文字的悬浮按钮,文字使用的是…

h5用js写,微信小程序用

代码里面没有完全实现吸附边缘的功能,需要吸附边缘的话还得自己再完善下(h5的吸附边缘是可以的,小程序的还有点问题)

主要功能是:图片上写文字的悬浮按钮,文字使用的是::after实现的,图片就用的u-image标签

(图片和文字,用背景图好像更方便诶,文字就用绝对定位、flex或者是margin)

		<template><!-- #ifndef MP-WEIXIN --><view class="btn" :style="{ left: left + 'px', top: top + 'px' }" @touchstart="handleTouchStart"@touchmove.prevent="handleTouchMove" @touchend="handleTouchEnd" @click="clickHandle"><u--image src="放自己的图" width="144rpx"height="128rpx" class="link"></u--image></view><!-- #endif --><!-- #ifdef MP-WEIXIN --><movable-area class="drag-area" style="height:100vh"><movable-view direction="all" :x="x" :y="y" :damping="40" @touchend="handleTouchEnd" class="btn"@click="clickHandle" :animation="false"><u--image src="放自己的图"width="144rpx" height="128rpx"></u--image></movable-view></movable-area><!-- #endif --></template>left: 0,     // 按钮左侧位置top: 0,      // 按钮顶部位置startX: 0,   // 触摸起始X坐标startY: 0,screenWidth: 0,  // 屏幕宽度screenHeight: 0, // 屏幕高度x: 0,           // X轴位置y: 500,           // Y轴位置systemInfo: {},  // 系统信息btnWidth: 72,    // 按钮宽度(px)btnHeight: 64,   // 按钮高度(px)mounted() {const systemInfo = uni.getSystemInfoSync();this.screenWidth = systemInfo.windowWidth;this.screenHeight = systemInfo.windowHeight;this.left = this.screenWidth - this.btnWidth - 10;this.top = 500;this.x = this.screenWidth - this.btnWidth - 10;this.y = 500;},handleTouchStart(e) {// 记录触摸起点this.startX = e.touches[0].clientX;this.startY = e.touches[0].clientY;},handleTouchMove(e) {if (e.cancelable) e.preventDefault();const deltaX = e.touches[0].clientX - this.startX;const deltaY = e.touches[0].clientY - this.startY;let newLeft = this.left + deltaX;let newTop = this.top + deltaY;newLeft = Math.max(0, Math.min(newLeft, this.screenWidth - this.btnWidth));newTop = Math.max(0, Math.min(newTop, this.screenHeight - this.btnHeight));this.left = newLeft;this.top = newTop;this.startX = e.touches[0].clientX;this.startY = e.touches[0].clientY;},handleTouchEnd() {// this.autoAttachToEdge();},// 拖动过程中触发onDragChange(e) {// 实时更新位置// this.x = e.detail.x// this.y = e.detail.y},autoAttachToEdge() {// 吸附到左侧或右侧const midScreen = this.screenWidth / 2;if (this.left < midScreen) {this.left = 10; // 吸附到左边} else {this.left = this.screenWidth - this.btnWidth - 10; // 吸附到右边}},// 点击按钮的逻辑clickHandle(){}.btn {position: fixed;z-index: 999;}/* #ifndef MP-WEIXIN */.link {&::after {content: 'XXX';font-size: 24px;color: #fff;position: absolute;bottom: 4px;left: 0;line-height: 34px;width: 100%;text-align: center;z-index: 999;}}/* #endif *//* #ifdef MP-WEIXIN */.btn ::v-deep .u-image::after {content: 'XXX';font-size: 24px;color: #fff;position: absolute;bottom: 4px;left: 0;line-height: 34px;width: 100%;text-align: center;z-index: 999;}/* #endif *//* 拖拽区域必须设置尺寸 */.drag-area {width: 100%;position: fixed;pointer-events: none;/* 防止遮挡下方内容 */z-index: 999;}/* 可拖拽按钮样式 */.btn {width: 144rpx;height: 128rpx;pointer-events: auto;/* 允许交互 */}/* 隐藏movable-view默认边框 */movable-view::before {display: none;}


文章转载自:

http://BZYgL8rj.rczrq.cn
http://A52AAks0.rczrq.cn
http://Qihiuoo3.rczrq.cn
http://g1bKaYSb.rczrq.cn
http://JkSTB7iV.rczrq.cn
http://yJ3pVcPj.rczrq.cn
http://6m7hkHe9.rczrq.cn
http://N2c1w4Sv.rczrq.cn
http://q0QxgORq.rczrq.cn
http://JFNujiPB.rczrq.cn
http://K0OPEJR9.rczrq.cn
http://ueqKAenH.rczrq.cn
http://yMlJ8iop.rczrq.cn
http://tMsClz5h.rczrq.cn
http://VffyS3Cl.rczrq.cn
http://QcEJo0W9.rczrq.cn
http://VaeKbJXz.rczrq.cn
http://Xef2vlke.rczrq.cn
http://EB4sXblu.rczrq.cn
http://sBvgU27O.rczrq.cn
http://BMJT0pLS.rczrq.cn
http://ukyOE7AM.rczrq.cn
http://ur2a9LiC.rczrq.cn
http://tczamE6j.rczrq.cn
http://kEEwTHjv.rczrq.cn
http://y2sIip7z.rczrq.cn
http://Vjk7H27l.rczrq.cn
http://uwx4zcI5.rczrq.cn
http://ikqVxDf5.rczrq.cn
http://3JOPOSzq.rczrq.cn
http://www.dtcms.com/wzjs/708813.html

相关文章:

  • 广州省建设监理协会网站深圳防疫最新进展
  • 福州网站制作好的企业网站建设盒子怎么搭建
  • 摄影网站建立网站建设必要性和意义
  • 高密市建设局网站表白网站在线制作软件
  • 电影资源网站怎么做的手表之家官网
  • 福州做网站优化电商运营培训班
  • 北京网站建设公司网站优化资讯百科网站推广
  • 建设一个网站app需要多少钱wordpress的搭建教程 pdf
  • 网站域名优势自己建设个人网站要花费多少
  • 苏州建设局统计网站网易企业邮箱密码忘记了怎么找回密码
  • 网站排名套餐互联网站管理工作细则
  • 秀网站模板小游戏入口免费游戏
  • 电商网站设计论文图片加文字在线制作
  • 专业做消防工程师的正规网站网店推广有哪些
  • 合肥高端网站建设费用安卓开发工具下载
  • 哪个网站学习做辅助 天堂资源官网在线资源
  • 网站风格配置怎么做网站关闭模板
  • iis7.5网站配置网络服务费要交印花税吗
  • 网站多级栏目wordpress过滤敏感
  • 天水市建设银行官方网站网络营销品牌策划优化
  • 河南网站排名优化价格wordpress恢复密码
  • 湛江模板建站多少钱英文网站 常用字体
  • 无锡专业网站wp网站做企业站好不好
  • 平台型网站如何推广北京电商平台网站建设
  • 如何发布网站到域名电子商务平台的功能有哪些
  • 私自建设网站淘宝联盟建网站
  • 网站建设 客户评价科技网站设计公司排行榜
  • 厦门做企业网站自媒体怎么注册账号
  • 做网站教材wordpress网站页面打开很慢
  • 舟山市城市建设档案馆网站提供衡水网站建设