|
|
@@ -107,15 +107,23 @@ export default create({
|
|
|
if (!state.canvas) {
|
|
|
return;
|
|
|
}
|
|
|
- Taro.canvasToTempFilePath({
|
|
|
- canvas: state.canvas,
|
|
|
- fileType: props.type
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- emit('confirm', res.tempFilePath);
|
|
|
+ Taro.createSelectorQuery()
|
|
|
+ .select("#spcanvas")
|
|
|
+ .fields({
|
|
|
+ node: true,
|
|
|
+ size: true,
|
|
|
})
|
|
|
- .catch((e) => {
|
|
|
- emit('confirm', e);
|
|
|
+ .exec(async (res) => {
|
|
|
+ Taro.canvasToTempFilePath({
|
|
|
+ canvas: res[0].node,
|
|
|
+ fileType: props.type,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ emit("confirm", res.tempFilePath);
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ emit("confirm", e);
|
|
|
+ });
|
|
|
});
|
|
|
};
|
|
|
|