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

网站开通支付宝接口美容营销型网站

网站开通支付宝接口,美容营销型网站,网站制作成品,百度网站推广方案效果图#xff1a; 旋转 放大#xff1a;手机上可以双指放大缩小 拖拽 代码实现#xff1a; html div idhome class v-cloak!-- 上面三个按钮 图片自己解决 --div classheadImage v-ifshowBtn 旋转 放大手机上可以双指放大缩小 拖拽 代码实现 html div idhome class v-cloak!-- 上面三个按钮 图片自己解决 --div classheadImage v-ifshowBtndiv classleftPhoto clickleftPhoto()imgstylewidth: 2.2rem; height: 2.2remsrc../../../common/image/left_xuanzhuan.pngalt//divdiv classrightPhoto clickrightPhoto()imgstylewidth: 2.2rem; height: 2.2remsrc../../../common/image/right_xuanzhuan.pngalt//divdiv classcomeBack clickcomeBack()imgstylewidth: 2.4rem; height: 2.4remsrc../../../common/image/fanhui.pngalt//div/div!-- 展示图片位置 --div classpage !-- 缩放 --div classpinch-zoomimgv-showshowBtnidimageIdstyleheight: 95% !important; width: 100%; object-fit: contain:srcgraphPhoto//div/div/div js代码 script typetext/javascriptlet vm new Vue({el: #home,data() {return {graphPhoto: , //图片地址showBtn: false, //判断是否显示按钮};},methods: {// 返回comeBack() {// 根据逻辑返回就行},leftPhoto() {// 使用示例this.rotateBase64Image(this.graphPhoto, 90) // 旋转90度.then((rotatedBase64) {this.graphPhoto rotatedBase64;});},rightPhoto() {this.rotateBase64Image(this.graphPhoto, -90) // 旋转90度.then((rotatedBase64) {this.graphPhoto rotatedBase64;});},// 接口查询getPhoto() {let that this;//.... 你的接口返回的数据 base 如果没有可以暂时用本地的图片代替一下if (base) {that.graphPhoto ../../../common/image/WechatIMG624.jpg;that.showBtn true; //是否展示按钮that.rotateBase64Image(that.graphPhoto, 0) // 默认调用 旋转0度.then((rotatedBase64) {that.graphPhoto rotatedBase64;});} else {that.showBtn false;mui.confirm(未获取到图形, 提示, [返回], function (e) {if (e.index 0) {//根据自己逻辑写就行 }});}});},rotateBase64Image(base64ImageData, degree) {let that this;return new Promise((resolve, reject) {const img new Image(); // 创建一个imgimg.onload () {// 创建一个 canvasconst canvas document.createElement(canvas);const ctx canvas.getContext(2d);// 计算旋转后的尺寸const maxDim Math.max(img.width, img.height);canvas.width maxDim;canvas.height maxDim;// 将图片绘制到canvas上并旋转指定的角度ctx.translate(maxDim / 2, maxDim / 2);ctx.rotate((degree * Math.PI) / 180);ctx.drawImage(img,-img.width / 2,-img.height / 2,img.width,img.height);// 将旋转后的canvas转换回Base64编码的图片数据const rotatedBase64 canvas.toDataURL(image/png);resolve(rotatedBase64);};img.onerror () {that.showBtn false;mui.confirm(图形解析异常, 提示, [返回], function (e) {if (e.index 0) {//根据自己逻辑写就行 }});};img.src base64ImageData;});},},mounted() {this.getPhoto();},}); /script // 单独把双指放大缩小之类的引入 我用的jq 你可以直接用js获取 script typetext/javascript$(function () {$(div.pinch-zoom).each(function () {new RTP.PinchZoom($(this), {});});}); /script 还需要引入缩放这个具体文件需要的自提 通过网盘分享的文件pinchzoom.js 链接: https://pan.baidu.com/s/1p83enqDMmrNOHyH8W4gUtQ?pwdies7 提取码: ies7 scripttypetext/javascriptsrc../../../common/js/pinchzoom.js/script css 样式 .headImage {margin-top: 1rem;margin-right: 0.5rem;margin-bottom: 1rem;display: flex;align-items: center;justify-content: flex-end;height: 3.8rem;}.headImage div {width: 3.8rem;height: 3.8rem;border-radius: 0.6rem;margin: 0.4rem;background-color: #e8eff1;line-height: 2rem;text-align: center;}.page img {width: 100%;height: auto;}.page {height: 100%;width: 100%;} // 这块比较重要 不设置的话 默认会根据你的宽或者高 生成一个正方形区域.pinch-zoom {height: 95% !important;width: 100% !important;}.page div {height: 100% !important;width: 100% !important;}.leftPhoto,.rightPhoto,.comeBack {display: flex;align-items: center;justify-content: center;}
http://www.tj-hxxt.cn/news/135740.html

相关文章:

  • 建设玩偶网站最终目的做盗版电影网站教程
  • 不再更新的网站个人网站开发
  • 做效果图网站有哪些vue做企业网站
  • 企业做网站需要多少钱重庆网络货运平台
  • 佛山市网站建设平台现在北京能不能去
  • 网站图片设计制作2021最火电商平台
  • 摄影网站建设公司wordpress中文语言包
  • 温州外贸网站制作长沙网页制作网站
  • 陕西省平安建设网站市场推广方法
  • 深圳网站建设好凡客官网免费制作小程序
  • 百度提交网站入口北京舞美设计制作公司
  • wap网站建设方案 pdf有没有哪个网站怎么做动漫新闻的
  • 织梦建设网站需要什么软件移动端网站 优帮云
  • 商洛网站建设公司网站建设需要哪些东西
  • wow做宏的网站google引擎免费入口
  • 山西省城乡住房建设厅网站云之创网站建设
  • 中小企业网站建设费用国外做vj的网站
  • 外国人做的篆字网站西安软件公司排名
  • 现在网站后台有哪几种模板形式.net网站源码下载
  • 如何用html制作网站北京四大设计院
  • 个人网站设计案例恒华大厦做网站公司
  • 宁波网站推广软件哪家强wordpress获取所有分类
  • 设计网站考虑哪些因素防火墙放行图片域名
  • 厦门橄榄网站建设国内新闻热点事件
  • 福建省住房和城乡建设厅网站电话seo是网络优化吗
  • 网站流量盈利模式wordpress媒体库地址
  • 网站规划与建设重点内容网站建设5000费用
  • 广东省做网站推广公司wordpress 行业模版
  • 做流量网站怎么做推广普通话的宣传语
  • 改图网网站谁做的织梦做中英文网站步骤