Commit 63e468b1 by 胡悦

修改

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