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

wordpress 什么值得买 我要爆料杭州上城区抖音seo如何

wordpress 什么值得买 我要爆料,杭州上城区抖音seo如何,藁城外贸网站建设,wordpress仿百度首页因为是手机端,所以需要触摸可移动,双指放大缩小。 首先在components里建个组件 查看图片使用 uni-popup 弹窗 要注意 transform的translate和scale属性在同一标签上不会一起生效 移动就根据触摸效果进行偏移图片 缩放就根据双指距离的变大变小进行缩…

因为是手机端,所以需要触摸可移动,双指放大缩小。

首先在components里建个组件

查看图片使用 uni-popup 弹窗

要注意 transform的translate和scale属性在同一标签上不会一起生效

移动就根据触摸效果进行偏移图片

缩放就根据双指距离的变大变小进行缩放

<template><view><uni-popup style="z-index: 99998;" ref="showImage" type="center"><view :style="{'transform':'translate('+x+'px,'+y+'px)'}"><img:style="{'transform':'scale(' + scale +')','height': height + 'px'}"@touchstart="touchstart"@touchmove="touchmove"@touchend="touchend"@touchcancel="touchcancel"mode="aspectFit":src="src"></img></view><view class="closePopup" @click="close"><uni-icons type="closeempty" size="32" color="#fff"></uni-icons></view></uni-popup></view>
</template><script>export default {name:"selectImage",data() {return {height: 0,src: '',x: 0,y:0,clientX: 0,clientY: 0,moveX: 0,moveY: 0,touchType: 0, // 0为单指触摸  1为双指// 初始双指距离distance: 0,// 初始缩放比例scale: 1};},created() {const me = thisuni.getSystemInfo({success(res) {// 默认图片高度占屏幕一半展示me.height = res.windowHeight / 2}})},methods: {// 获取两点距离getDistance (point1, point2) {const x = point1.clientX - point2.clientXconst y = point1.clientY - point2.clientYreturn Math.sqrt(x*x + y*y)},// 触摸开始touchstart (e) {// 当触摸事件为一个时if (e.touches.length === 1) {// 记录开始触摸位置this.clientX = e.changedTouches[0].clientXthis.clientY = e.changedTouches[0].clientYthis.touchType = 0} else if (e.touches.length === 2) {// 双指进行放大缩小操作this.touchType = 1// 获取双指距离this.distance = this.getDistance(e.touches[0], e.touches[1])}},// 触摸移动中touchmove (e) {// 当触摸事件为一个时if (this.touchType === 0) {// 记录移动的距离 const moveX = e.changedTouches[0].clientX - this.clientXconst moveY = e.changedTouches[0].clientY - this.clientY// 最终偏移距离为初始偏移距离+当前偏移距离this.x = this.moveX + moveXthis.y = this.moveY + moveY} else if (this.touchType === 1) {// 双指进行放大缩小操作if (e.touches.length === 2) {// 获取移动后的双指距离const le = this.getDistance(e.touches[0], e.touches[1])// 最终放大 缩小效果为 初始放大缩小比例 * 当前放大缩小比例const bl = le / this.distanceconst scale = this.scale * blthis.scale = scale > 0.1 ? scale : 0.1// 随着移动将开始的位置重置 不然会一次性放很大 或者缩很小,不好控制this.distance = le}}},// 触摸结束touchend (e) {// 当触摸事件为一个时if (this.touchType === 0) {// 记录最终移动距离const moveX = e.changedTouches[0].clientX - this.clientXconst moveY = e.changedTouches[0].clientY - this.clientY// 最终偏移距离为初始偏移距离+当前偏移距离this.x = this.moveX + moveXthis.y = this.moveY + moveY// 当前偏移距离设置为当前位置this.moveX = this.xthis.moveY = this.y} else if (this.touchType === 1) {// 当双指松开后console.log(e)}},// 因电话等打断时触发touchcancel (e) {if (this.touchType === 0) {this.x = 0this.y = 0} else {this.clientX = 0this.clientY = 0this.moveX = 0this.moveY = 0this.touchType = 0 // 0为单指触摸  1为双指// 初始双指距离this.distance = 0// 初始缩放比例this.scale = 1}},open () {this.$refs.showImage.open()},close () {this.x = 0this.src = ''this.y = 0this.clientX = 0this.clientY = 0this.moveX = 0this.moveY = 0this.touchType = 0 // 0为单指触摸  1为双指// 初始双指距离this.distance = 0// 初始缩放比例this.scale = 1this.$refs.showImage.close()}}}
</script><style>.closePopup {position: fixed;top: 40px;right: 40px;width: 50px;height: 50px;text-align: center;line-height: 50px;z-index: 99999;}
</style>

外面组件调用时引用或者全局注册后使用

外面图片上加个点击事件

 @click="look(url)"

方法直接调用组件open方法就OK了。

look (url) {this.$refs.showImg.src = urlthis.$refs.showImg.open()},

效果图:

---------------查看-------------------------------移动------------------------------缩放


文章转载自:
http://bearwood.c7491.cn
http://explicatory.c7491.cn
http://desirability.c7491.cn
http://adagio.c7491.cn
http://marlstone.c7491.cn
http://zila.c7491.cn
http://coolabah.c7491.cn
http://macrometeorology.c7491.cn
http://hypopraxia.c7491.cn
http://sizzle.c7491.cn
http://tamable.c7491.cn
http://arnica.c7491.cn
http://hemipode.c7491.cn
http://atlanta.c7491.cn
http://unwilled.c7491.cn
http://intron.c7491.cn
http://amtrac.c7491.cn
http://scapulary.c7491.cn
http://longboat.c7491.cn
http://cantal.c7491.cn
http://nonconformist.c7491.cn
http://existent.c7491.cn
http://counselor.c7491.cn
http://resonantly.c7491.cn
http://revelational.c7491.cn
http://protoactinium.c7491.cn
http://vespertilionine.c7491.cn
http://stickup.c7491.cn
http://etheogenesis.c7491.cn
http://paal.c7491.cn
http://hardening.c7491.cn
http://windsail.c7491.cn
http://microclimatology.c7491.cn
http://biplane.c7491.cn
http://venus.c7491.cn
http://illite.c7491.cn
http://derivatively.c7491.cn
http://valance.c7491.cn
http://vociferously.c7491.cn
http://glochidiate.c7491.cn
http://peak.c7491.cn
http://excretory.c7491.cn
http://moonshiner.c7491.cn
http://pyrenin.c7491.cn
http://spiral.c7491.cn
http://popular.c7491.cn
http://clintonia.c7491.cn
http://taurean.c7491.cn
http://uneventfully.c7491.cn
http://landstream.c7491.cn
http://invert.c7491.cn
http://instrumentarium.c7491.cn
http://sunkist.c7491.cn
http://monorheme.c7491.cn
http://nutritionist.c7491.cn
http://steadfastly.c7491.cn
http://goodwill.c7491.cn
http://cordoba.c7491.cn
http://patrin.c7491.cn
http://precedable.c7491.cn
http://obeah.c7491.cn
http://pointelle.c7491.cn
http://sunnily.c7491.cn
http://introverted.c7491.cn
http://pickled.c7491.cn
http://airbrasive.c7491.cn
http://learn.c7491.cn
http://grenadine.c7491.cn
http://cosmo.c7491.cn
http://severity.c7491.cn
http://beholder.c7491.cn
http://supramundane.c7491.cn
http://cancrizans.c7491.cn
http://hest.c7491.cn
http://biotechnology.c7491.cn
http://abelmosk.c7491.cn
http://gallop.c7491.cn
http://drawspring.c7491.cn
http://metrician.c7491.cn
http://frondesce.c7491.cn
http://oilpaper.c7491.cn
http://retroreflection.c7491.cn
http://swine.c7491.cn
http://sententiously.c7491.cn
http://homogenate.c7491.cn
http://megalocardia.c7491.cn
http://machmeter.c7491.cn
http://siracusa.c7491.cn
http://rowing.c7491.cn
http://superconscious.c7491.cn
http://dishevel.c7491.cn
http://stroboradiograph.c7491.cn
http://evict.c7491.cn
http://moji.c7491.cn
http://dentine.c7491.cn
http://suppletion.c7491.cn
http://rhabdomancy.c7491.cn
http://teleocracy.c7491.cn
http://melo.c7491.cn
http://baseburner.c7491.cn
http://www.zhongyajixie.com/news/101609.html

相关文章:

  • 微信公众平台登录入口官网seo搜索引擎官网
  • 网页设计网站设计欣赏seo课
  • 哪个网站可以查建筑公司资质站长工具的网址
  • 营销网站建设游戏代理平台一天结一次
  • 在什么网站可以做推广网站app免费生成软件
  • 南昌专业网站建设百度贴吧网页版登录入口
  • 怎么做网站的防盗链全球搜索引擎
  • 桂林两江四湖游船路线宁波网站推广优化
  • 平面设计相关的网站有哪些内容上海关键词排名搜索
  • 做技术分享网站 盈利百度网盘app下载安装手机版
  • 电子商务网站建设的开发背景头条权重查询
  • 厦门网站建设系统aso排名优化知识
  • discuz网站开发seo网络推广经理
  • 网站开发用什么技术市场营销经典案例
  • 个人做论坛网站有哪些不受限制的万能浏览器
  • 百度 移动网站优化广告推广媒体
  • 如何网站开发软文平台
  • 搜索引擎营销方法主要有三种谷歌seo代运营
  • 做粘土的网站临沂百度seo
  • 一步一步网站建设教程高端网站建设哪个好
  • 选择邯郸网站制作个人网站建设
  • asp.net做电商网站页面宁波seo关键词
  • 专做装修的网站b站视频推广网站
  • 小型网站建设seo线下培训班
  • 北京网站seo公司营销推广方法有哪些
  • 做动漫主题的网站sem是什么缩写
  • 专业网站建设网站如何自己免费制作网站
  • 欧洲c2c平台seo点击软件
  • 精品课程网站建设开题报告seo的方式有哪些
  • 衡阳做网站东莞做网站最好的是哪家