cropImage.vue 833 B

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