opened
Kavf
username_0
以下是一些代码片段
`
Page({
   data:{
src: null, // 裁剪图片地址
        visible: false, // 是否显示
        size: { //裁剪尺寸
            width: 112,
            height: 140
        },
        cropSizePercent: 0.9, //裁剪框显示比例
        borderColor: '#fff', //裁剪框边框颜色
        result: '', //裁剪结果地址
},

upload_logo() {
        var that = this;
        wx.chooseImage({
            count: 1,
            success: function (res) {
                var tempFilePaths = res.tempFilePaths;
                that.setData({
                    visible: true,
                    src: tempFilePaths[0],
                })
            }
        })
    },
    //选取裁剪图片成功回调
    uploadCallback: function (event) {
        console.log(event);
    },
    //裁剪图片回调
    cropCallback: function (event) {
        var that = this;
        console.log(event);
        this.setData({
            visible: false,
            result: event.detail.resultSrc,
        });
        wx.uploadFile({
            url: 'https://domain.com/apidocs/upload/singlefile',
            filePath: event.detail.resultSrc,
            name: 'file',
            formData: {
                token: '123',
                wxapp_id: '456',
                type: 'cardPhoto',
            },
            success: function (res) {
                console.log(res);
                var data = JSON.parse(res.data);
                if (data.code == 200) {
                    that.setData({
                        'formData.logo': data.data.fileUrl,
                    })
                }
            }
        })
    },
    //关闭回调
    closeCallback: function (event) {
        console.log(event);
        this.setData({
            visible: false,
        });
    },
})

`
裁剪之后图像变得特别模糊，但是在示例小程序里面图像是清晰的
issue
created
newbieYoung
username_1
微信小程序是可以分享代码片段的，你粘贴的看不出啥问题
comment
created
Kavf
username_0
大佬，这个问题解决了，是因为我给的裁剪尺寸太小了，这里乘以 2 看起来就不模糊了

size: { //裁剪尺寸
width: 112*2,
height: 140*2
},
comment
created
newbieYoung
username_1
行吧
comment
closed
newbieYoung
username_1
issue