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

公司网站二维码怎么做的关键词筛选工具

公司网站二维码怎么做的,关键词筛选工具,商丘市网站建设公司,网站图片动态换名uniapp实现全局悬浮框(按钮,页面,图片自行设置) 可拖动 话不多说直接上干货 1,在components新建组件(省去了每个页面都要引用组件的麻烦) 2,实现代码 <template><view class"call-plate" :style"top: top px;left: left px;" touchmove&quo…

uniapp实现全局悬浮框(按钮,页面,图片自行设置) 可拖动
话不多说直接上干货
1,在components新建组件(省去了每个页面都要引用组件的麻烦)
在这里插入图片描述
2,实现代码

<template><view class="call-plate" :style="'top:' + top + 'px;left:' + left + 'px;'" @touchmove="touchmove" @touchend="touchend" @touchstart="touchstart" v-if="popupShow">通话中悬浮框</view>
</template><script>export default {name: "call-screen",emits: ["hide", "confirm"],props: {/*** 默认号码*/number: {type: String,default: ""}},data() {return {popupShow: true, // 是否显示当前页面top: 0,left: 0,startTop: 0,startLeft: 0,startClientTop: 0,startClientLeft: 0,}},watch: {},computed: {i18n() {return this.$t}},created() {let that = thisthis.popupShow = getApp().globalData.callShowthis.top = getApp().globalData.callShowTop // 获取全局存储的位置,也可以使用本地缓存存储this.left = getApp().globalData.callShowLeftuni.$on(getApp().globalData.$global.CALL_SHOW_UPDATE, this.callShowUpdate)uni.$on(getApp().globalData.$global.CALL_SHOW_OPEN, this.callShowOpen)uni.$on(getApp().globalData.$global.CALL_SHOW_CLOSE, this.callShowClose)},destroyed() {// 销毁通知uni.$off(getApp().globalData.$global.CALL_SHOW_UPDATE, this.callShowUpdate)uni.$off(getApp().globalData.$global.CALL_SHOW_OPEN, this.callShowOpen)uni.$off(getApp().globalData.$global.CALL_SHOW_CLOSE, this.callShowClose)},methods: {touchmove(e) {// 单指触摸if (e.touches.length !== 1) {return false;}// console.log(e)this.top = e.changedTouches[0].pageY - this.startClientTop + this.startTopthis.left = e.changedTouches[0].pageX - this.startClientLeft + this.startLeft},touchend(e) {// console.log("------结束,top:" + this.top + ",left:" + this.left)// console.log(e)getApp().globalData.callShowTop = this.topgetApp().globalData.callShowLeft = this.leftuni.$emit(getApp().globalData.$global.CALL_SHOW_UPDATE) // 更新每个页面悬浮框位置},touchstart(e) {// console.log("------开始")// console.log(e)this.startTop = this.topthis.startLeft = this.leftthis.startClientTop = e.changedTouches[0].pageYthis.startClientLeft = e.changedTouches[0].pageX},callShowUpdate() {// 更新每个页面悬浮框位置this.top = getApp().globalData.callShowTopthis.left = getApp().globalData.callShowLeft},callShowOpen() {// 打开每个页面悬浮框this.popupShow = truegetApp().globalData.callShow = true},callShowClose() {// 关闭每个页面悬浮框this.popupShow = falsegetApp().globalData.callShow = false},}}
</script><style lang="scss" scoped>.call-plate {display: flex;position: absolute;width: 90px;height: 160px;z-index: 9999999;background-color: yellow;}
</style>
在 App.vue中全局存储悬浮框位置信息
globalData: {callShowTop: 100, // 悬浮框topcallShowLeft: 100, // 悬浮框leftcallShow: false, // 悬浮框是否显示
},

3,在每个需要用到悬浮框的页面引入

<template><view class="content"><!--组件引用--><call-screen></call-screen></view>
</template>
发通知控制显示隐藏悬浮框
uni.$emit(that.global.CALL_SHOW_CLOSE)
uni.$emit(that.global.CALL_SHOW_OPEN)

4,实现效果
请添加图片描述
每个页面切换后都会更新最新位置

http://www.ritt.cn/news/6100.html

相关文章:

  • 网站会员系统模板网络销售推广平台
  • 深圳网站的网络公司北京网络营销公司
  • 做网站的宽度为多少网站域名备案信息查询
  • 格力网站建设首页环球贸易网
  • 什么网站可以做发票验证百度搜索排名怎么做
  • 网站建设要准备些什么成人教育培训机构
  • 网站开发承诺函seo怎么做优化方案
  • 申请个人网站和企业官网有什么不同现在搜什么关键词能搜到网站
  • seo查询工具网站企业网络的组网方案
  • 域名停靠app大全下载网站入口百度一下网页打开
  • 南京做网站设计公司网站制作流程
  • 网站怎么做本地测试如何免费引流推广
  • 百度网站官网入口网址青岛seo推广专员
  • 网站设计深圳公司安年软文网
  • 网站logo一般多大网站关键词怎么设置
  • 朝阳区社会建设办公室网站站长之家网站排名
  • 有哪些做婚礼平面设计的网站问卷调查网站
  • 独立做网站友链交换平台源码
  • 做网站比较专业的公司软文发稿网站
  • 湘西网站建设吧网络销售是什么
  • 教育培训营销型网站建设哪家好b2b自动发布信息软件
  • 做擦边球网站长尾关键词举例
  • 商务网站开发流程宁波seo优化公司排名
  • 电子商务搭建网站今日财经新闻
  • 申论我国政府网站建设和管理的现状内蒙古最新消息
  • 平度推广网站建设有哪些网站可以免费发布广告
  • 青海网站建设哪家强搜易网托管模式的特点
  • 简单电商网站模板下载网站怎样做推广
  • 视频多的网站建设百度关键词搜索热度
  • seo外贸仿牌网站换域名seo具体优化流程