File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
uni_modules/wot-design-uni/components/wd-img-cropper Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 11<!--
22 * @Author: weisheng
33 * @Date: 2023-09-20 11:10:41
4- * @LastEditTime: 2023-11-20 18:35:28
4+ * @LastEditTime: 2024-02-29 13:17:27
55 * @LastEditors: weisheng
66 * @Description:
77 * @FilePath: \wot-design-uni\src\pages\imgCropper\Index.vue
1414 <!-- #endif -->
1515 <demo-block title =" 基本用法" style =" text-align : center " >
1616 <wd-img-cropper
17- id =" wd-img-cropper"
1817 v-model =" show"
1918 :img-src =" src"
2019 @confirm =" handleConfirm"
Original file line number Diff line number Diff line change 11<template >
22 <!-- 绘制的图片canvas -->
3- <view id = " wd-img-cropper " v-if =" modelValue" :class =" `wd-img-cropper ${customClass}`" @touchmove =" preventTouchMove" >
3+ <view v-if =" modelValue" :class =" `wd-img-cropper ${customClass}`" @touchmove =" preventTouchMove" >
44 <!-- 展示在用户面前的裁剪框 -->
55 <view class =" wd-img-cropper__wrapper" >
66 <!-- 画出裁剪框 -->
@@ -146,6 +146,10 @@ const props = withDefaults(defineProps<Props>(), {
146146const imgAngle = ref <number >(0 )
147147// 是否开启动画
148148const isAnimation = ref <boolean >(false )
149+ // #ifdef MP-ALIPAY || APP-PLUS
150+ // hack 避免钉钉小程序、支付宝小程序、app抛出相关异常
151+ const animation: any = null
152+ // #endif
149153
150154// 裁剪框的宽高
151155const picWidth = ref <number >(0 )
@@ -588,12 +592,12 @@ function canvasToImage() {
588592 fileType ,
589593 quality ,
590594 canvasId: ' wd-img-cropper-canvas' ,
591- success : (res ) => {
592- emit ( ' confirm ' , {
593- tempFilePath: res . tempFilePath ,
594- width: cutWidth . value * exportScale ,
595- height: cutHeight . value * exportScale
596- } )
595+ success : (res : any ) => {
596+ const result = { tempFilePath: res . tempFilePath , width: cutWidth . value * exportScale , height: cutHeight . value * exportScale }
597+ // #ifdef MP-DINGTALK
598+ result . tempFilePath = res . filePath
599+ // #endif
600+ emit ( ' confirm ' , result )
597601 },
598602 complete : () => {
599603 emit (' update:modelValue' , false )
You can’t perform that action at this time.
0 commit comments