/* pages/uni-cropper/index.wxss */ .yhdsl { background-color: #fff; position: fixed; top: 0; left: 0; right: 0; bottom: 50px; display: block; align-items: center; flex-direction: column; z-index: 998; height: 100vh; } .cropper-config { position: fixed; z-index: 999; bottom: 10px; left: 0; right: 0; width: 90%; margin: 0 auto; /* padding: 20upx 40upx; */ } .button-box { position: absolute; bottom: 0; display: flex; flex-direction: row; justify-content: space-between; width: 100%; } .button-box button { width: 25%; line-height: 35px; height: 35px; background-color: #509cff; } .cropper-content { width: 100%; min-height: 750rpx; } .uni-corpper { position: relative; overflow: hidden; box-sizing: border-box; margin: 0 auto; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; } .uni-corpper-content { position: relative; } .uni-corpper-content image { display: block; width: 100%; min-width: 0 !important; max-width: none !important; /* height: 100%; */ min-height: 0 !important; /* max-height: none !important; */ max-height: calc(100vh - 100rpx); margin: 0 auto; image-orientation: 0deg !important; } /* 移动图片效果 */ .uni-cropper-drag-box { position: absolute; z-index: 1; top: 0; right: 0; bottom: 0; left: 0; cursor: move; background: rgba(0, 0, 0, 0.479); } /* 内部的信息 */ .uni-corpper-crop-box { position: absolute; z-index: 2; max-height: calc(100vh - 100rpx); background: rgba(56, 50, 50, 0.479); } .uni-corpper-crop-box .uni-cropper-view-box { position: relative; display: block; overflow: visible; width: 100%; height: 100%; max-height: calc(100vh - 100rpx); outline: 5rpx solid rgb(43, 89, 255); outline-color: rgba(255, 255 255, 1); } /* 横向虚线 */ .uni-cropper-dashed-h { position: absolute; top: 33.33333333%; left: 0; width: 100%; height: 33.33333333%; border-top: 1rpx dashed rgba(255, 255, 255, 0.5); border-bottom: 1rpx dashed rgba(255, 255, 255, 0.5); } /* 纵向虚线 */ .uni-cropper-dashed-v { position: absolute; top: 0; left: 33.33333333%; width: 33.33333333%; height: 100%; border-right: 1rpx dashed rgba(255, 255, 255, 0.5); border-left: 1rpx dashed rgba(255, 255, 255, 0.5); } /* 四个方向的线 为了之后的拖动事件*/ .uni-cropper-line-t { position: absolute; top: 0; left: 0; display: block; width: 100%; height: 3rpx; cursor: n-resize; opacity: 0.1; background-color: white; } .uni-cropper-line-t::before { position: absolute; z-index: 11; top: 50%; right: 0rpx; bottom: 0; width: 100%; height: 41rpx; content: ""; -webkit-transform: translate3d(0, -50%, 0); transform: translate3d(0, -50%, 0); background: transparent; } .uni-cropper-line-r { position: absolute; top: 0; right: 0rpx; display: block; width: 3rpx; height: 100%; cursor: e-resize; opacity: 0.1; background-color: white; } .uni-cropper-line-r::before { position: absolute; z-index: 11; top: 0; bottom: 0; left: 50%; width: 41rpx; height: 100%; content: ""; -webkit-transform: translate3d(-50%, 0, 0); transform: translate3d(-50%, 0, 0); background: transparent; } .uni-cropper-line-b { position: absolute; bottom: 0; left: 0; display: block; width: 100%; height: 3rpx; cursor: s-resize; opacity: 0.1; background-color: white; } .uni-cropper-line-b::before { position: absolute; z-index: 11; top: 50%; right: 0rpx; bottom: 0; width: 100%; height: 41rpx; content: ""; -webkit-transform: translate3d(0, -50%, 0); transform: translate3d(0, -50%, 0); background: transparent; } .uni-cropper-line-l { position: absolute; top: 0; left: 0; display: block; width: 3rpx; height: 100%; cursor: w-resize; opacity: 0.1; background-color: white; } .uni-cropper-line-l::before { position: absolute; z-index: 11; top: 0; bottom: 0; left: 50%; width: 41rpx; height: 100%; content: ""; -webkit-transform: translate3d(-50%, 0, 0); transform: translate3d(-50%, 0, 0); background: transparent; } .uni-cropper-point { position: absolute; z-index: 3; width: 5rpx; height: 5rpx; opacity: 0.75; background-color: rgb(145, 132, 132); } .point-t { top: -3rpx; left: 50%; margin-left: -3rpx; cursor: n-resize; } .point-tr { top: -3rpx; left: 100%; margin-left: -3rpx; cursor: n-resize; } .point-r { top: 50%; left: 100%; margin-top: -3rpx; margin-left: -3rpx; cursor: n-resize; } .point-rb { position: absolute; z-index: 1112; top: 100%; left: 100%; width: 30rpx; height: 30rpx; border-radius: 50%; cursor: n-resize; -webkit-transform: translate3d(-50%, -50%, 0); transform: translate3d(-50%, -50%, 0); opacity: 1; background-color: rgb(231, 222, 222); background-color: #509cff; } .point-b { top: 100%; left: 50%; margin-top: -3rpx; margin-left: -3rpx; cursor: n-resize; } .point-bl { top: 100%; left: 0; margin-top: -3rpx; margin-left: -3rpx; cursor: n-resize; } .point-l { top: 50%; left: 0; margin-top: -3rpx; margin-left: -3rpx; cursor: n-resize; } .point-lt { top: 0; left: 0; margin-top: -3rpx; margin-left: -3rpx; cursor: n-resize; } /* 裁剪框预览内容 */ .uni-cropper-viewer { position: relative; overflow: hidden; width: 100%; height: 100%; } .uni-cropper-viewer image { position: absolute; z-index: 2; }