...
|
...
|
@@ -45,12 +45,18 @@ Page({ |
|
|
},
|
|
|
//查看我的订单
|
|
|
goMyRelease() {
|
|
|
wx.redirectTo({url:'/pages/order/order-detail/order-detail?id=' + this.data.order_id})
|
|
|
this.setData({is_showRelease_modal:false,});
|
|
|
wx.navigateTo({url:'/pages/order/order-detail/order-detail?id=' + this.data.order_id})
|
|
|
},
|
|
|
//完成按钮
|
|
|
goBack() {
|
|
|
wx.redirectTo({url:'/pages/spell-list/spell-list?current=' + 0})
|
|
|
},
|
|
|
disableScroll() {
|
|
|
},
|
|
|
handleBackground() {
|
|
|
this.setData({is_showRelease_modal:false,})
|
|
|
},
|
|
|
// 问一问
|
|
|
ask(e) {
|
|
|
console.log('前问一问-display', this.data.display);
|
...
|
...
|
@@ -520,34 +526,34 @@ Page({ |
|
|
// ctx.clip();
|
|
|
//填充背景色
|
|
|
ctx.fillStyle = '#fff';
|
|
|
ctx.fillRect(0, 0, 300, 400);
|
|
|
ctx.fillRect(0, 0, 280, 400);
|
|
|
console.log(self.data.local_img);
|
|
|
console.log(self.data.qr_code);
|
|
|
//将图片转化为画布
|
|
|
ctx.drawImage(self.data.local_img, 0, 0, 300, 170);//详情图
|
|
|
ctx.drawImage(self.data.local_img, 0, 0, 280, 280);//详情图
|
|
|
console.log(111);
|
|
|
// ctx.drawImage(self.data.local_qr_code, 220, 209, 60, 60);//二维码
|
|
|
ctx.drawImage('../../../images/qr_code.jpg', 220, 209, 60, 60);//二维码
|
|
|
ctx.drawImage('../../../images/qr_code.jpg', 180, 320, 60, 60);//小程序码
|
|
|
//标题
|
|
|
ctx.setFontSize(16);
|
|
|
ctx.setFontSize(12);
|
|
|
ctx.setFillStyle('#000');
|
|
|
ctx.textAlign = "left";
|
|
|
console.log(111);
|
|
|
ctx.fillText(self.data.detail.title, 26, 196.5);
|
|
|
ctx.fillText(self.data.detail.title, 25.5, 197);
|
|
|
ctx.fillText(self.data.detail.title, 16, 306.5);
|
|
|
ctx.fillText(self.data.detail.title, 15.5, 307);
|
|
|
ctx.restore();
|
|
|
//地点
|
|
|
ctx.setFontSize(13);
|
|
|
ctx.setFontSize(9);
|
|
|
ctx.setFillStyle('#000000');
|
|
|
ctx.fillText('地点:', 25, 229);
|
|
|
const text = self.data.detail.address;
|
|
|
ctx.fillText('地点:', 16, 325);
|
|
|
const text = self.data.detail.name;
|
|
|
var chr = text.split("");//这个方法是将一个字符串分割成字符串数组
|
|
|
var temp = "";
|
|
|
var row = [];
|
|
|
ctx.setFontSize(13);
|
|
|
ctx.setFontSize(9);
|
|
|
ctx.setFillStyle('#000000');
|
|
|
for (var a = 0; a < chr.length; a++) {
|
|
|
if (ctx.measureText(temp).width < 170) {
|
|
|
if (ctx.measureText(temp).width < 100) {
|
|
|
temp += chr[a];
|
|
|
}
|
|
|
else {
|
...
|
...
|
@@ -565,7 +571,7 @@ Page({ |
|
|
var test = "";
|
|
|
var empty = [];
|
|
|
for (var a = 0; a < rowPart.length; a++) {
|
|
|
if (ctx.measureText(test).width < 170) {
|
|
|
if (ctx.measureText(test).width < 100) {
|
|
|
test += rowPart[a];
|
|
|
}
|
|
|
else {
|
...
|
...
|
@@ -578,19 +584,19 @@ Page({ |
|
|
row = rowCut;
|
|
|
}
|
|
|
for (var b = 0; b < row.length; b++) {
|
|
|
ctx.fillText(row[b], 63, 229 + b * 16, 150);
|
|
|
ctx.fillText(row[b], 40, 325 + b * 16, 150);
|
|
|
}
|
|
|
ctx.restore();
|
|
|
//时间
|
|
|
ctx.setFontSize(13);
|
|
|
ctx.setFontSize(9);
|
|
|
ctx.setFillStyle('#333333');
|
|
|
ctx.fillText('时间:', 25, 249);
|
|
|
ctx.fillText(self.data.end_time, 63, 249);
|
|
|
ctx.fillText('时间:', 16, 340);
|
|
|
ctx.fillText(self.data.end_time, 40, 340);
|
|
|
ctx.restore();
|
|
|
// ctx.drawImage("../../../../images/home-banner.png", 0, 0, 250, 150)
|
|
|
//成功执行,draw方法中进行回调
|
|
|
ctx.draw(true, function () {
|
|
|
// wx.hideLoading();
|
|
|
// wx.hideLoading();
|
|
|
console.log("draw callback success");
|
|
|
self.setData({can_save: true,show_canvas: true});
|
|
|
console.log(self.data.can_save);
|
...
|
...
|
@@ -665,10 +671,10 @@ Page({ |
|
|
wx.canvasToTempFilePath({
|
|
|
x: 0,
|
|
|
y: 0,
|
|
|
width: 300,
|
|
|
height: 300,
|
|
|
destWidth: 300,
|
|
|
destHeight: 300,
|
|
|
width: 280,
|
|
|
height: 400,
|
|
|
destWidth: 560,
|
|
|
destHeight: 800,
|
|
|
canvasId: 'canvas',
|
|
|
fileType: 'jpg',
|
|
|
quality:1,
|
...
|
...
|
|