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

电商 企业网站 福州网站图片用什么格式

电商 企业网站 福州,网站图片用什么格式,三水网站制作公司,专业建站提供商写在前面 最近在项目中遇到了一个这样的需求#xff1a;给一个模块做埋点#xff0c;要求埋点的触发时机是当模块露出50%且停留300毫秒才进行上报 开搞 首先要有一个View View/View然后在View里定义一个ref View ref { viewRef }/View然…写在前面 最近在项目中遇到了一个这样的需求给一个模块做埋点要求埋点的触发时机是当模块露出50%且停留300毫秒才进行上报 开搞 首先要有一个View View/View然后在View里定义一个ref View ref { viewRef }/View然后写一个定时器每隔300毫秒触发一次 setinterval(() {// do something }, 300)然后判断viewRef是否露出50%如果露出50%则触发埋点 import {Dimensions} from react-native;this.state {// 是否可埋点isExpoesd: false,// 是否停留300毫秒isStayThreeHundredMilliseconds: false,} setinterval(() {if(this.viewRef.current){this.viewRef.current.measure((x, y, width, height, pageX, pageY) {// 获取屏幕高度let windowHeight Dimensions.get(window).height;// 模块露出50%坐标值let moduleTop windowHeight - (height / 2);// // 商品露出的高度// let exposeHeight windowHeight - pageY;// // 卡片露出的高度// let cardPosHeight windowHeight - pageY;// // 卡片露出的比例// let proportion cardPosHeight / height;// if(exposeHeight height){// exposeHeight 100%// }// if(exposeHeight 0){// exposeHeight 商品距离显示还有${Math.abs(exposeHeight)};// proportion 卡片还没露出呢// }// if(proportion 1){// proportion 100%// }// let tip // 这个商品露出了${moduleTop pageY ? 大于50 : 小于50},// 具体参数如下↓↓↓↓↓// 商品名称${name},// 商品ID${Id}// 屏幕高度${windowHeight},// 模块整体高度${height},// 模块最高点坐标${pageY},// 如果模块坐标低于${moduleTop},说明露出大于50%,// 商品露出了:${exposeHeight}// 卡片露出的比例是${proportion}// // console.log(------------------------分界线开始---------------------------------)// console.log(tip)this.setState(prevState {let newIsExpoesd moduleTop pageY ? true : false;// 比较当前状态与新状态if (newIsExpoesd ! prevState.isExpoesd) {this.setState({isExpoesd: newIsExpoesd }); // 返回新的状态}// console.log(Toggled state changed from ${prevState.isExpoesd} to ${newIsExpoesd});if((prevState.isExpoesd newIsExpoesd) (prevState.isExpoesd true)){// console.log(可以埋点)this.state.isStayThreeHundredMilliseconds true;return true} else {// console.log(不可以埋点)this.state.isStayThreeHundredMilliseconds false;return false}});// console.log(------------------------分界线结束---------------------------------)});} }, 300)
http://www.dnsts.com.cn/news/34890.html

相关文章:

  • 建设网站需要申请超炫网站
  • ie浏览器哪个做网站稳定宠物商品销售网站开发背景
  • 优设网网站wordpress 粘贴图片
  • 静态展示类网站东莞医疗网站建设报价
  • 怎么自己做网站地图湖北网站设计流程
  • seo网站排名优化价格韶关网站seo
  • 网站跳出率如何计算在北京做网站制作一个月多少钱
  • 水墨画风格网站展厅布展方案设计
  • 做微信推送网站企业安全文化建设导则
  • 亅新厦建设集团网站做网站卖机器怎么弄
  • 网站建设软件是什么意思深圳网站建设要多少钱
  • 网站服务器有哪些wordpress练习
  • 如何免费建站云南楚雄医药高等专科学校
  • 个性化网站制作wordpress免费采集
  • 建设网站类型网站怎么更改关键词
  • 做图片网站用什么程序wordpress仿站cms
  • 做系统之前的网站无锡网站的建设
  • 罗琳做的网站深圳市龙华区民治街道
  • 手机网站设计制作公司做网站怎么那么难
  • 网站建设策划书结束语昆明二级站seo整站优化排名
  • 春节网站怎么做价格低怎么说
  • 秦皇岛网站制作小程序开发宁波网站建设 网络服务
  • 网站推广制作附子seo
  • 别人做的网站不能用怎么办巴中交通建设有限公司网站
  • 精品课程网站建设总结报告天眼查询系统
  • 网站怎样做的高大上有错误的wordpress
  • 南京网站制作哪家专业外贸网站建设哪家有名
  • 六安城市网优选佛山网站关键词优化公司
  • 网站建设费钱吗wordpress怎么增加按钮
  • 免费画图网站平阴网站建设费用