cropImage.vue 833 字节
Newer Older
1
<!-- 图片裁剪页 -->
芊里 已提交
2 3
<template>
	<view class="content" >
L
21  
linju 已提交
4
		<limeClipper :width="options.width" :scale-ratio="2" :is-lock-width="false" :is-lock-height="false" :height="options.height" :image-url="path"  
芊里 已提交
5 6 7 8 9 10 11 12 13 14
			@success="successFn" @cancel="cancel"  />
	</view>
</template>
<script>
import limeClipper from './limeClipper/limeClipper.vue';
export default {
	components: {limeClipper},
	data() {return {path: '',options:{"width":600,"height":600}}},
	onLoad({path,options}) {
		this.path = path
15
		console.log('path-path-path-path',path);
芊里 已提交
16 17 18 19 20 21
		if(options){
			this.options = JSON.parse(options)
		}
	},
	methods:{
		successFn(e){
22 23
			this.getOpenerEventChannel().emit('success',e.url)
			uni.navigateBack()
芊里 已提交
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
		},
		cancel(){
			uni.navigateBack()
		}
	}
}
</script>

<style>
	.box{
		width: 400rpx;
	}
	.mt{
		margin-top: -10px;
	}
</style>