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

金融网站开发文档下载申请绿色网站

金融网站开发文档下载,申请绿色网站,网站的二级导航怎么做,拼多多流量推广神器生成的临时路径是没有完整的路径没办法上传到服务器 16:37:40.993 添加水印后的路径, _doc/uniapp_temp_1710923708347/canvas/17109238597881.png 16:37:41.041 添加水印后的完整路径, file://storage/emulated/0/Android/data/com.jingruan.zjd/apps/__UNI__BE4B000/doc/… 生成的临时路径是没有完整的路径没办法上传到服务器 16:37:40.993 添加水印后的路径, _doc/uniapp_temp_1710923708347/canvas/17109238597881.png 16:37:41.041 添加水印后的完整路径, file://storage/emulated/0/Android/data/com.jingruan.zjd/apps/__UNI__BE4B000/doc/uniapp_temp_1710923708347/canvas/17109238597881.png 使用以下代码得到完整的路径 let path file:/ plus.io.convertLocalFileSystemURL(tempFilePath);完整代码如下 使用的插件市场的hpy-watermark组件   一共2个 效果是 其他页面调用方式 !-- 增加水印上传villageReviewForm.preciseAddr 是通过高德获取的定位地址 -- hpy-watermark refuploadImage :addressvillageReviewForm.preciseAddr waterMarkwaterMark/hpy-watermark 高德获取定位 uni.getLocation({type: gcj02,geocode: true,isHighAccuracy: true,success: res { const {province,city,district,street,streetNum,poiName} res.address;this.villageReviewForm.preciseAddr ${district}${street}${streetNum}${poiName}${res.longitude},${res.latitude};console.log(经纬度地点,this.villageReviewForm.preciseAddr)// 数据渲染this.$forceUpdate();}}); 获取上传数据结果 const fileList this.$refs.uploadImage.fileList 组件样式 hpy-watermark.vue templateviewview classwatermark-contentcanvas canvas-idwatermarkCanvas idwatermarkCanvas :style{width:canvasWidth px, height:canvasHeight px}/canvas/viewupload-image v-modelfileList stylemargin-left: 15rpx :image-stylesimageStyles :files-listfilesList :delIcondelIcon choosechooseImage delFiledelFileslotview classis-addview classicon-add/viewview classicon-add rotate/view/view/slot/upload-image/view /templatescriptimport {fileServerIp} from /common/utils/config.jsimport Session from /common/Session;import uploadImage from ./upload-image.vueexport default {components: {uploadImage, },name:hpy-watermark,props:{address:{type:String,default:},delIcon: {type: Boolean,default: true},listStyles: {type: Object,default () {return {// 是否显示边框border: true,// 是否显示分隔线dividline: true,// 线条样式borderStyle: {}}}},imageStyles: {type: Object,default () {return {width: auto,height: auto}}},/*** 文字文字位置默认左下角可选值左上角topLeft、右上角topRight、左下角bottomLeft、右下角bottomRight*/markAlign:{type:String,default:function(){return bottomLeft}},/*** 设置文本的水平对齐方式默认start文本在指定的位置开始。* end 文本在指定的位置结束。* center 文本的中心被放置在指定的位置。* left 文本左对齐。* right 文本右对齐。*/textAlign:{type:String,default:function(){return start;}},/*** 设置文本的垂直对齐方式默认alphabetic文本基线是普通的字母基线。* top 文本基线是 em 方框的顶端。* hanging 文本基线是悬挂基线。* middle 文本基线是 em 方框的正中。* ideographic 文本基线是表意基线。* bottom 文本基线是 em 方框的底端。*/textBaseline:{type:String,default:function(){return alphabetic;}},/*** 文字大小*/fontSize:{type:[Number, String],default:30},/*** 文字颜色*/fontColor:{type:String,default:function(){return red}},/*** 阴影颜色*/shadowColor:{type:String,default:function(){return rgba(0, 0, 0, 1.0);}},/*** 阴影边框大小*/shadowWidth:{type:[Number, String],default:2},/*** 图片的质量取值范围为 (0, 1]不在范围内时当作1处理*/quality:{type:[Number, String],default:1},/*** 目标文件的类型只支持 jpg 或 png。默认为 png*/fileType:{type:String,default:function(){return png}}},data() {return {fileList: [],files: [],filesList:[],canvasWidth:0,canvasHeight:0};},watch: { fileList: {handler(newVal, oldVal) { this.filesListnewVal;},immediate: true},},methods: {// 选择图片chooseImage() {if(this.isEmpty(this.address)){uni.showToast({icon:none,title:请打开定位或者重新获取});return;}uni.chooseImage({count: this.limit, // 限制的图片数量sizeType: [compressed], // original 原图compressed 压缩图默认二者都有 sourceType: [ camera],// album 从相册选图camera 使用相机默认二者都有success: (res) {var imgPathList res.tempFilePaths;if(imgPathList.length 0){this.addImages(imgPathList);}},fail: (err) {console.log(chooseImage fail, err)if(chooseImage:fail cancel err.errMsg){uni.showToast({icon:none,title:取消了选择});}else{}}});},// 添加图片addImages(filePaths){if(filePaths.length 0){var fillTexts [地址:this.address];fillTexts.push(时间 this.getNowTime());// 添加水印this.addWaterMark({filePaths,fillTexts});}},/*** 水印添加回调在H5平台下filePath 为 base64*/waterMark(filePath){this.imageList.push(filePath);},/*** 获取当前时间*/getNowTime(){var date new Date(),year date.getFullYear(),month date.getMonth() 1,day date.getDate(),hour date.getHours() 10 ? 0 date.getHours() : date.getHours(),minute date.getMinutes() 10 ? 0 date.getMinutes() : date.getMinutes(),second date.getSeconds() 10 ? 0 date.getSeconds() : date.getSeconds();month 1 month 9 ? (month 0 month) : ;day 0 day 9 ? (day 0 day) : ;return (year - month - day hour : minute : second);},/*** 删除文件* param {Object} index*/delFile(index) {this.$emit(delete, {tempFile: this.filesList[index],tempFilePath: this.filesList[index].url})this.filesList.splice(index, 1) },/*** 增加水印* param {Object} {filePaths:[图片地址1, 图片地址2], fillTexts:[水印1, 水印2]}*/async addWaterMark({ filePaths [], fillTexts [] }) {try{for (const filePath of filePaths) {await this.drawImage(filePath, fillTexts.reverse());}}catch(e){// TODO handle the exception}finally{// uni.hideLoading();}},/*** 绘制单个图片*/async drawImage(filePath, fillTexts){uni.showLoading({title:图片处理中···});const ctx uni.createCanvasContext(watermarkCanvas, this);return new Promise(resolve {uni.getImageInfo({src: filePath,success: (image) {this.canvasWidth image.width;this.canvasHeight image.height;ctx.clearRect(0, 0, image.width, image.height);setTimeout((){ctx.drawImage(image.path, 0, 0, image.width, image.height);ctx.setFontSize(this.fontSize);ctx.setFillStyle(this.fontColor);// 设置阴影let shadowWidth Number(this.shadowWidth );if(shadowWidth 0){ctx.shadowColor this.shadowColor;ctx.shadowOffsetX shadowWidth;ctx.shadowOffsetY shadowWidth;}// 设置水平对齐方式ctx.textAlign this.textAlign;// 设置垂直对齐方式ctx.textBaseline this.textBaseline;const maxText fillTexts.reduce((text, val) {return text.length val.length ? text : val;});fillTexts.forEach((mark, index) {if(this.markAlign bottomRight){ctx.fillText(mark, image.width - (ctx.measureText(maxText).width60), image.height - (index*6060));}else if(this.markAlign topLeft){ctx.fillText(mark, 20, (index*6060));}else if(this.markAlign topRight){ctx.fillText(mark, image.width - (ctx.measureText(maxText).width60), (index*6060));}else{ctx.fillText(mark, 20, image.height - (index*6060));}});ctx.draw(false, (() {setTimeout((){uni.canvasToTempFilePath({canvasId: watermarkCanvas,fileType:this.fileType,quality:Number(this.quality || 1),success: (res) { console.log(添加水印后的路径,res.tempFilePath )this.saveUploadImage(res.tempFilePath )},fail:(err) {uni.hideLoading();console.log(err)},complete: () {resolve();}}, this);}, 300);})());}, 200);},fail: (e) {resolve();}});});},saveUploadImage(tempFilePath){uni.showLoading({title:图片上传中···});// #ifdef APP-PLUSvar p plus.io.convertLocalFileSystemURL(tempFilePath);this.url file:/ pconsole.log(添加水印后的完整路径,this.url )// #endifuni.uploadFile({url: fileServerIp common/upload,name: file,// #ifdef H5filePath: tempFilePath,// #endif// #ifdef APP-PLUSfilePath: this.url,// #endifheader: {Authorization: Bearer Session.getValue(token)},success: uploadFileRes {uni.hideLoading();const {data} JSON.parse(uploadFileRes.data)this.filesList.push({url: data.url,name: data.fileName,extname: png}) this.$emit(waterMark,{url: data.url,name: data.fileName,extname: png});},fail: error {uni.hideLoading();uni.showToast({title: 上传失败,icon: error,duration: 2000});}})}}} /scriptstyle scoped.watermark-content{width: 0;height: 0;overflow: hidden;}.uni-file-picker__container {/* #ifndef APP-NVUE */display: flex;box-sizing: border-box;/* #endif */flex-wrap: wrap;margin: -5px;}.rotate {position: absolute;transform: rotate(90deg);}.icon-add {width: 50px;height: 5px;background-color: #f1f1f1;border-radius: 2px;} /styleupload-image.vue templateview classuni-file-picker__containerview classfile-picker__box v-for(item,index) in filesList :keyindex :styleboxStyleview classfile-picker__box-content :styleborderStyleimage classfile-image :srcitem.url modeaspectFill click.stopprviewImage(item,index)/imageview v-ifdelIcon !readonly classicon-del-box click.stopdelFile(index)view classicon-del/viewview classicon-del rotate/view/viewview v-if(item.progress item.progress ! 100) ||item.progress0 classfile-picker__progressprogress classfile-picker__progress-item :percentitem.progress -1?0:item.progress stroke-width4:backgroundColoritem.errMsg?#ff5a5f:#EBEBEB //viewview v-ifitem.errMsg classfile-picker__mask click.stopuploadFiles(item,index)点击重试/view/view/viewview v-iffilesList.length limit !readonly classfile-picker__box :styleboxStyleview classfile-picker__box-content is-add :styleborderStyle clickchooseslotview classicon-add/viewview classicon-add rotate/view/slot/view/view/view /templatescriptexport default {name: uploadImage,emits:[uploadFiles,choose,delFile],props: {filesList: {type: Array,default () {return []}},disabled:{type: Boolean,default: false},disablePreview: {type: Boolean,default: false},limit: {type: [Number, String],default: 9},imageStyles: {type: Object,default () {return {width: auto,height: auto,border: {}}}},delIcon: {type: Boolean,default: true},readonly:{type:Boolean,default:false}},computed: {styles() {let styles {width: auto,height: auto,border: {}}return Object.assign(styles, this.imageStyles)},boxStyle() {const {width auto,height auto} this.styleslet obj {}if (height auto) {if (width ! auto) {obj.height this.value2px(width)obj[padding-top] 0} else {obj.height 0}} else {obj.height this.value2px(height)obj[padding-top] 0}if (width auto) {if (height ! auto) {obj.width this.value2px(height)} else {obj.width 33.3%}} else {obj.width this.value2px(width)}let classles for(let i in obj){classles ${i}:${obj[i]};}return classles},borderStyle() {let {border} this.styleslet obj {}const widthDefaultValue 1const radiusDefaultValue 3if (typeof border boolean) {obj.border border ? 1px #eee solid : none} else {let width (border border.width) || widthDefaultValuewidth this.value2px(width)let radius (border border.radius) || radiusDefaultValueradius this.value2px(radius)obj {border-width: width,border-style: (border border.style) || solid,border-color: (border border.color) || #eee,border-radius: radius}}let classles for(let i in obj){classles ${i}:${obj[i]};}return classles}},methods: {uploadFiles(item, index) {this.$emit(uploadFiles, item)},choose() {this.$emit(choose)},delFile(index) {this.$emit(delFile, index)},prviewImage(img, index) {let urls []if(Number(this.limit) 1this.disablePreview!this.disabled){this.$emit(choose)}if(this.disablePreview) returnthis.filesList.forEach(i {urls.push(i.url)})uni.previewImage({urls: urls,current: index});},value2px(value) {if (typeof value number) {value px} else {if (value.indexOf(%) -1) {value value.indexOf(px) ! -1 ? value : value px}}return value}}} /scriptstyle langscss.uni-file-picker__container {/* #ifndef APP-NVUE */display: flex;box-sizing: border-box;/* #endif */flex-wrap: wrap;margin: -5px;}.file-picker__box {position: relative;// flex: 0 0 33.3%;width: 33.3%;height: 0;padding-top: 33.33%;/* #ifndef APP-NVUE */box-sizing: border-box;/* #endif */}.file-picker__box-content {position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: 5px;border: 1px #eee solid;border-radius: 5px;overflow: hidden;}.file-picker__progress {position: absolute;bottom: 0;left: 0;right: 0;/* border: 1px red solid; */z-index: 2;}.file-picker__progress-item {width: 100%;}.file-picker__mask {/* #ifndef APP-NVUE */display: flex;/* #endif */justify-content: center;align-items: center;position: absolute;right: 0;top: 0;bottom: 0;left: 0;color: #fff;font-size: 12px;background-color: rgba(0, 0, 0, 0.4);}.file-image {width: 100%;height: 100%;}.is-add {/* #ifndef APP-NVUE */display: flex;/* #endif */align-items: center;justify-content: center;}.icon-add {width: 50px;height: 5px;background-color: #f1f1f1;border-radius: 2px;}.rotate {position: absolute;transform: rotate(90deg);}.icon-del-box {/* #ifndef APP-NVUE */display: flex;/* #endif */align-items: center;justify-content: center;position: absolute;top: 3px;right: 3px;height: 26px;width: 26px;border-radius: 50%;background-color: rgba(0, 0, 0, 0.5);z-index: 2;transform: rotate(-45deg);}.icon-del {width: 15px;height: 2px;background-color: #fff;border-radius: 2px;} /style
文章转载自:
http://www.morning.dqwykj.com.gov.cn.dqwykj.com
http://www.morning.mjbjq.cn.gov.cn.mjbjq.cn
http://www.morning.rhkq.cn.gov.cn.rhkq.cn
http://www.morning.hrjrt.cn.gov.cn.hrjrt.cn
http://www.morning.cwfkm.cn.gov.cn.cwfkm.cn
http://www.morning.cbchz.cn.gov.cn.cbchz.cn
http://www.morning.mljtx.cn.gov.cn.mljtx.cn
http://www.morning.gychx.cn.gov.cn.gychx.cn
http://www.morning.hxxzp.cn.gov.cn.hxxzp.cn
http://www.morning.smsjx.cn.gov.cn.smsjx.cn
http://www.morning.plpqf.cn.gov.cn.plpqf.cn
http://www.morning.ltywr.cn.gov.cn.ltywr.cn
http://www.morning.znnsk.cn.gov.cn.znnsk.cn
http://www.morning.hxpff.cn.gov.cn.hxpff.cn
http://www.morning.ywzqk.cn.gov.cn.ywzqk.cn
http://www.morning.kclkb.cn.gov.cn.kclkb.cn
http://www.morning.pggkr.cn.gov.cn.pggkr.cn
http://www.morning.baguiwei.com.gov.cn.baguiwei.com
http://www.morning.gkdqt.cn.gov.cn.gkdqt.cn
http://www.morning.ljjph.cn.gov.cn.ljjph.cn
http://www.morning.hlppp.cn.gov.cn.hlppp.cn
http://www.morning.cryb.cn.gov.cn.cryb.cn
http://www.morning.skmpj.cn.gov.cn.skmpj.cn
http://www.morning.mhcys.cn.gov.cn.mhcys.cn
http://www.morning.xpqsk.cn.gov.cn.xpqsk.cn
http://www.morning.qjxxc.cn.gov.cn.qjxxc.cn
http://www.morning.znsyn.cn.gov.cn.znsyn.cn
http://www.morning.mkzdp.cn.gov.cn.mkzdp.cn
http://www.morning.nqgjn.cn.gov.cn.nqgjn.cn
http://www.morning.hdnd.cn.gov.cn.hdnd.cn
http://www.morning.lxjcr.cn.gov.cn.lxjcr.cn
http://www.morning.gybnk.cn.gov.cn.gybnk.cn
http://www.morning.muniubangcaishui.cn.gov.cn.muniubangcaishui.cn
http://www.morning.wsrcy.cn.gov.cn.wsrcy.cn
http://www.morning.cbynh.cn.gov.cn.cbynh.cn
http://www.morning.nkqrq.cn.gov.cn.nkqrq.cn
http://www.morning.snbry.cn.gov.cn.snbry.cn
http://www.morning.hnkkm.cn.gov.cn.hnkkm.cn
http://www.morning.jggr.cn.gov.cn.jggr.cn
http://www.morning.pfmsh.cn.gov.cn.pfmsh.cn
http://www.morning.ngdkn.cn.gov.cn.ngdkn.cn
http://www.morning.qqhmg.cn.gov.cn.qqhmg.cn
http://www.morning.zfgh.cn.gov.cn.zfgh.cn
http://www.morning.tjmfz.cn.gov.cn.tjmfz.cn
http://www.morning.rnzgf.cn.gov.cn.rnzgf.cn
http://www.morning.prprz.cn.gov.cn.prprz.cn
http://www.morning.yfcbf.cn.gov.cn.yfcbf.cn
http://www.morning.wgqtj.cn.gov.cn.wgqtj.cn
http://www.morning.rbbgh.cn.gov.cn.rbbgh.cn
http://www.morning.rrcxs.cn.gov.cn.rrcxs.cn
http://www.morning.xhqr.cn.gov.cn.xhqr.cn
http://www.morning.rpjr.cn.gov.cn.rpjr.cn
http://www.morning.lqpzb.cn.gov.cn.lqpzb.cn
http://www.morning.mnqg.cn.gov.cn.mnqg.cn
http://www.morning.kcyxs.cn.gov.cn.kcyxs.cn
http://www.morning.zqcgt.cn.gov.cn.zqcgt.cn
http://www.morning.qnqt.cn.gov.cn.qnqt.cn
http://www.morning.mbprq.cn.gov.cn.mbprq.cn
http://www.morning.rqxtb.cn.gov.cn.rqxtb.cn
http://www.morning.cbchz.cn.gov.cn.cbchz.cn
http://www.morning.bncrx.cn.gov.cn.bncrx.cn
http://www.morning.ycwym.cn.gov.cn.ycwym.cn
http://www.morning.nqcts.cn.gov.cn.nqcts.cn
http://www.morning.mwrxz.cn.gov.cn.mwrxz.cn
http://www.morning.lbssg.cn.gov.cn.lbssg.cn
http://www.morning.rqnzh.cn.gov.cn.rqnzh.cn
http://www.morning.fqmcc.cn.gov.cn.fqmcc.cn
http://www.morning.fqklt.cn.gov.cn.fqklt.cn
http://www.morning.dtnjr.cn.gov.cn.dtnjr.cn
http://www.morning.lkjzz.cn.gov.cn.lkjzz.cn
http://www.morning.wcgfy.cn.gov.cn.wcgfy.cn
http://www.morning.yjfzk.cn.gov.cn.yjfzk.cn
http://www.morning.qsmdd.cn.gov.cn.qsmdd.cn
http://www.morning.trfrl.cn.gov.cn.trfrl.cn
http://www.morning.ynryz.cn.gov.cn.ynryz.cn
http://www.morning.lhgqc.cn.gov.cn.lhgqc.cn
http://www.morning.zlmbc.cn.gov.cn.zlmbc.cn
http://www.morning.rcwzf.cn.gov.cn.rcwzf.cn
http://www.morning.rmrcc.cn.gov.cn.rmrcc.cn
http://www.morning.ftrpvh.cn.gov.cn.ftrpvh.cn
http://www.tj-hxxt.cn/news/234923.html

相关文章:

  • 响应式网站编码怎吗设置电力通信网网络架构
  • 深圳网站快速备案重庆住房城乡建设部网站
  • 无锡网站制作的公司杭州建设网造价平台
  • 供灯放生网站开发城阳城市规划建设局网站
  • 三亚网站制作公司中国机械制造网
  • 上海建设项目中标公示网站网站建设 常见问题
  • 汕头网站搜索引擎优化北京建设工程有限公司
  • 成都建模培训机构淘宝关键词怎么优化
  • app需要建网站吗手机网站seo
  • 简述一个网站开发流程wordpress小工具侧边栏
  • 缔烨建设公司网站望野博物馆阎焰
  • 官网最新版cmsv6seo黑帽技术有哪些
  • 重庆潼南网站建设wordpress siren主题
  • 新网官方网站建站专业定制
  • 代做设计网站c2c模式的诞生与发展
  • 江西建设三类人员网站深圳市九号公告最新消息
  • 电子商务网站建设调查报告优化网站的软件
  • wordpress建站后怎样发布专业整站优化
  • 淘宝客网站制作长春seo排名收费
  • 上海建设人才网站备案域名注册
  • 五大免费资源网站自定义文章类型的分类wordpress
  • 南宁市网站建设哪家好企业企业网站建设
  • 建设银行手机外汇网站程显峰 wordpress
  • 制作免费网站外销网站
  • 做优惠券的网站搭建国内知名设计工作室
  • 有什么设计logo网站jsp做网站开发
  • 长春广告公司网站建设苏州吴中区建设局工程网站
  • 西部数码网站管理助手搭建织梦网站开发kxhtml
  • 济南网站设计价格seo代运营公司
  • 深圳建设工程交易中心主页seo工作是什么意思