Commit 63e468b1 by 胡悦

修改

1 parent 5258c71a
......@@ -70,8 +70,7 @@ Component({
})
.catch((err) => {
!this.data.hideLoading && wx.hideLoading();
wx.showToast({ icon: 'none', title: err.errMsg || '生成失败' });
console.error(err);
// wx.showToast({ icon: 'none', title: err.errMsg || '生成失败' });
this.triggerEvent('fail', err);
})
},
......
......@@ -222,17 +222,18 @@ Page({
const canvasWidth = 208,
canvasHeight = 166,
textBaseline = "top";
// const draw_function = new Draw(this, {
// width: canvasWidth,
// height: canvasHeight,
// // pixelRatio: 2,
// // backgroundColor: '#096'
// });
const draw_function = new Draw(this, {
width: canvasWidth,
height: canvasHeight,
// pixelRatio: 2,
// backgroundColor: '#096'
});
const x = draw_function.getTextWidth(data.staffName, 14) + 22
const drawCard = (callBack) => {
// let index = 0;
const canvasWidth = 208,
canvasHeight = 166,
textBaseline = "top";
// const canvasWidth = 208,
// canvasHeight = 166,
// textBaseline = "top";
const iconWidth = 9,
iconHeight = 9,
iconX = 18,
......@@ -294,7 +295,7 @@ Page({
},
{
text: data.operation,
x: 51, //+ draw_function.getTextWidth(data.staffName, 14),
x: x,
y: 50,
color: "#6E6E7A",
fontWeight: 400,
......@@ -314,14 +315,16 @@ Page({
color: "#6E6E7A",
fontSize: 7,
lineNum: 2,
width: 185,
width: 324,
lineHeight: 9,
},
];
this.setData({ posterConfig: { width: 208,
height: 166,texts:textList,images:imgList} }, () => {
const width = 208
const height = 166
this.setData({ posterConfig: { width,
height,texts:textList,images:imgList, pixelRatio: 2} }, () => {
Poster.create();
});
});
// const drawImages = (callBack) => {
// draw_function.drawImages(imgList[index], () => {
// index += 1;
......@@ -356,6 +359,7 @@ Page({
*/
onPosterSuccess(src) {
const { detail } = src;
console.log(detail)
this.setData({
shareImg: detail,
},()=>{
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!