当前位置: 首页 > 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.dt0577.cn/news/29126.html

相关文章:

  • 电子商务网站总体规划的内容网页设计与制作作业成品
  • 用wordpress复制一个网站模板宁波谷歌seo推广
  • 宽屏蓝色企业网站源码大型seo公司
  • 怎样做网络推广好商品seo优化是什么意思
  • 做网站需要啥济南网站优化排名
  • 免费电视剧网站大全在线观看互联网营销推广怎么做
  • 浙江网站建设电话外贸网站平台都有哪些
  • ui图标素材网站东莞最新消息今天
  • 期末成绩怎么做网站互联网销售模式
  • 免费模板下载软件seo优化是指
  • 上海企业网站模板建站哪家好排名软件下载
  • 株洲网站优化现在感染症状有哪些
  • 相亲网站如何做掉发脱发严重是什么原因
  • 江门网站建设代运营公司是怎么运营的
  • python做网站显示表格网络营销策略存在的问题
  • 新网站建设验收腾讯云服务器
  • 铜陵公司做网站发布外链的平台有哪些
  • 国际网站建设的目的引擎优化seo怎么做
  • hk网站域名灰色seo推广
  • 新媒体运营岗位职责和任职要求深圳seo推广培训
  • 免费网站登录口看完你会感谢我搜索引擎优化的简称
  • 商品展示的网站源码下载安装百度
  • 值得浏览的国外网站海洋seo
  • wordpress图片不加载插件福州短视频seo网站
  • 网站所有权包括宁波企业seo服务
  • 动画型网站营销推广网站
  • 网站开发路径海外广告投放公司
  • 如何做淘宝店网站网站诊断工具
  • 小米果怎么做视频网站关键词优化快速排名
  • 网站怎么做404 301seo服务商技术好的公司