Commit 725bb3fb by 陈玉桐

test

parent 82ac6009
<template> <template>
<div id="tool"> <div id="tool">
<div class="cropper" v-if="cropperShow"> <div class="cropper" v-if="cropperShow">
<!-- <vueCropper <vueCropper
ref="cropper" ref="cropper"
:img="option.img" :img="option.img"
:outputSize="option.size" :outputSize="option.size"
...@@ -19,16 +19,14 @@ ...@@ -19,16 +19,14 @@
<div class="cropperOpt"> <div class="cropperOpt">
<span @click="cropperShow=false">取消</span> <span @click="cropperShow=false">取消</span>
<span @click="croppSure">完成</span> <span @click="croppSure">完成</span>
</div> --> </div>
<!-- <div class="main" v-if="visible"> --> <!-- <div class="cropperOpt">
<div class="cropperOpt">
<div class="button" @click="confirm">使用</div> <div class="button" @click="confirm">使用</div>
<div class="button cancel" @click="cropperShow=false">取消</div> <div class="button cancel" @click="cropperShow=false">取消</div>
</div> </div>
<div class="content"> <div class="content">
<quick-cropper ref="cropper" :img-src="imgSrc" @finish="finish"></quick-cropper> <quick-cropper ref="cropper" :img-src="imgSrc" @finish="finish"></quick-cropper>
</div> </div> -->
<!-- </div> -->
</div> </div>
<!-- 21天模板 --> <!-- 21天模板 -->
<div id="posterCon" class="posterCon_21" v-if="days==21||days==150"> <div id="posterCon" class="posterCon_21" v-if="days==21||days==150">
...@@ -205,21 +203,21 @@ import loading from '../components/loading/loading.vue' ...@@ -205,21 +203,21 @@ import loading from '../components/loading/loading.vue'
export default { export default {
data() { data() {
return{ return{
// option: { option: {
// img: '', // 裁剪图片的地址 img: '', // 裁剪图片的地址
// info: true, // 裁剪框的大小信息 info: true, // 裁剪框的大小信息
// outputSize: 1, // 剪切后的图片质量(0.1-1) outputSize: 1, // 剪切后的图片质量(0.1-1)
// full: true, // 输出原图比例截图 props名full full: true, // 输出原图比例截图 props名full
// outputType: 'png', // 裁剪生成额图片的格式 outputType: 'png', // 裁剪生成额图片的格式
// canMove: true, // 能否拖动图片 canMove: true, // 能否拖动图片
// original: false, // 上传图片是否显示原始宽高 original: false, // 上传图片是否显示原始宽高
// canMoveBox: true, // 能否拖动截图框 canMoveBox: true, // 能否拖动截图框
// autoCrop: true, // 是否默认生成截图框 autoCrop: true, // 是否默认生成截图框
// autoCropWidth: 150, autoCropWidth: 150,
// autoCropHeight: 150, autoCropHeight: 150,
// fixedBox: false // 截图框固定大小 fixedBox: false // 截图框固定大小
// }, },
imgSrc: '', // imgSrc: '',
cropperShow: false, cropperShow: false,
...@@ -346,31 +344,32 @@ export default { ...@@ -346,31 +344,32 @@ export default {
}) })
}, },
methods: { methods: {
// croppSure() {//裁剪完成 croppSure() {//裁剪完成
// this.$refs.cropper.getCropData(data=>{ this.$refs.cropper.getCropData(data=>{
// this.option.img = '' this.option.img = ''
// this.previews = {} this.previews = {}
// this.uploadPic = data this.uploadPic = data
// this.cropperShow = false this.cropperShow = false
// })
// },
finish(base64,data){
console.log(base64,'图片base64')
console.log(data,'图片二进制')
this.uploadPic = base64
this.cropperShow = false
},
// 确定使用
confirm() {
this.$nextTick(() => {
// 确认截图
this.$refs.cropper.confirm()
}) })
}, },
// 取消
cancel(){ // finish(base64,data){
this.visible = false // console.log(base64,'图片base64')
}, // console.log(data,'图片二进制')
// this.uploadPic = base64
// this.cropperShow = false
// },
// // 确定使用
// confirm() {
// this.$nextTick(() => {
// // 确认截图
// this.$refs.cropper.confirm()
// })
// },
// // 取消
// cancel(){
// this.visible = false
// },
create() { create() {
// 使input失去焦点 // 使input失去焦点
...@@ -500,6 +499,7 @@ export default { ...@@ -500,6 +499,7 @@ export default {
wx.getLocalImgData({ wx.getLocalImgData({
localId: res.localIds[0], // 图片的localID localId: res.localIds[0], // 图片的localID
success: function (res) { success: function (res) {
console.log(res.localData)
if (res.localData.substr(0, 5) != 'data:') { if (res.localData.substr(0, 5) != 'data:') {
// me.uploadPic = 'data:image;base64,' + res.localData // me.uploadPic = 'data:image;base64,' + res.localData
...@@ -596,35 +596,35 @@ export default { ...@@ -596,35 +596,35 @@ export default {
height: 100%; height: 100%;
} }
.cropperOpt{ .cropperOpt{
position: fixed; // position: fixed;
top: 0; // top: 0;
right: 0; // right: 0;
height: 44px; // height: 44px;
// width: 100%;
// background: #303030;
// .button {
// float: right;
// height: 44px;
// line-height: 44px;
// font-size: 14px;
// margin-right: 15px;
// color: green;
// }
// .cancel{
// float:left;
// margin-left:15px;
// }
position: absolute;
bottom: 0;
width: 100%; width: 100%;
background: #303030; display: flex;
.button { justify-content: space-between;
float: right; align-items: center;
height: 44px; span{
line-height: 44px; color: #fff;
font-size: 14px; font-weight: 500;
margin-right: 15px; padding: 15px 20px;
color: green;
}
.cancel{
float:left;
margin-left:15px;
} }
// position: absolute;
// bottom: 0;
// width: 100%;
// display: flex;
// justify-content: space-between;
// align-items: center;
// span{
// color: #fff;
// font-weight: 500;
// padding: 15px 20px;
// }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment