|
@@ -40,7 +40,7 @@ Page({
|
|
|
height: 132
|
|
|
},
|
|
|
rpx: 1,
|
|
|
- obverseImgObject:['', '/customized/images/customized/cup_black_big.png', '/customized/images/customized/cup_black_side.png', '/customized/images/customized/cup_black_handle.png', '/customized/images/customized/cup_black_bottom.png'],
|
|
|
+ obverseImgObject: ['', '/customized/images/customized/cup_black_big.png', '/customized/images/customized/cup_black_side.png', '/customized/images/customized/cup_black_handle.png', '/customized/images/customized/cup_black_bottom.png', '/customized/images/customized/box_white_big_1.png', '/customized/images/customized/box_white_big_2.png'],
|
|
|
|
|
|
|
|
|
|
|
@@ -54,9 +54,7 @@ Page({
|
|
|
imgSrcArray: [],
|
|
|
buildSrcArrayText:{
|
|
|
'1':'正面',
|
|
|
- '2':'侧面',
|
|
|
- '3':'手柄',
|
|
|
- '4':'底部',
|
|
|
+ '2':'背面',
|
|
|
},
|
|
|
buildSrcArray: [],
|
|
|
customGoodsImg:"",
|
|
@@ -67,19 +65,6 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
|
|
|
|
|
@@ -91,24 +76,12 @@ Page({
|
|
|
title: '图片合成中...'
|
|
|
})
|
|
|
let that = this, result = true;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
- if (wx.getStorageSync('madeCupImgData1') || wx.getStorageSync('madeCupFontData1')) {
|
|
|
- that.getCombImg(that, 1);
|
|
|
- result = false
|
|
|
- } else if (wx.getStorageSync('madeCupImgData2') || wx.getStorageSync('madeCupFontData2')) {
|
|
|
- that.getCombImg(that, 2);
|
|
|
- result = false
|
|
|
- } else if (wx.getStorageSync('madeCupImgData3') || wx.getStorageSync('madeCupFontData3')) {
|
|
|
- that.getCombImg(that, 3);
|
|
|
+ if (wx.getStorageSync('madeCupImgData5') || wx.getStorageSync('madeCupFontData5')) {
|
|
|
+ that.getCombImg(that, 5);
|
|
|
result = false
|
|
|
- } else if (wx.getStorageSync('madeCupImgData4') || wx.getStorageSync('madeCupFontData4')) {
|
|
|
- that.getCombImg(that, 4);
|
|
|
+ } else if (wx.getStorageSync('madeCupImgData6') || wx.getStorageSync('madeCupFontData6')) {
|
|
|
+ that.getCombImg(that, 6);
|
|
|
result = false
|
|
|
}
|
|
|
|
|
@@ -239,27 +212,12 @@ Page({
|
|
|
ctx.fillText(fontTouch.fontContent, 0, simulationFont.height / 5 * 4 + 1)
|
|
|
}
|
|
|
ctx.restore()
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
ctx.draw(false,function () {
|
|
|
wx.canvasToTempFilePath({
|
|
|
canvasId: 'comb-font'+i,
|
|
|
success: function (res) {
|
|
|
console.log(res)
|
|
|
that.getCombFontImg(that, res.tempFilePath, fontTouch,i)
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}, that)
|
|
|
})
|
|
@@ -280,11 +238,11 @@ Page({
|
|
|
|
|
|
const ctx = wx.createCanvasContext('comb-font' + i + '-2');
|
|
|
|
|
|
- let movex = fontTouch.x + 218 * rpx / 2;
|
|
|
- let movey = fontTouch.y + 218 * rpx / 2;
|
|
|
+ let movex = fontTouch.x + 536 * rpx / 2;
|
|
|
+ let movey = fontTouch.y + 712 * rpx / 2;
|
|
|
ctx.translate(movex, movey);
|
|
|
ctx.rotate(fontTouch.angle * Math.PI / 180);
|
|
|
- ctx.drawImage(img, -218 * rpx / 2, -218 * rpx / 2, 218 * rpx, 218 * rpx)
|
|
|
+ ctx.drawImage(img, -536 * rpx / 2, -712 * rpx / 2, 536 * rpx, 712 * rpx)
|
|
|
ctx.draw(false, function () {
|
|
|
wx.canvasToTempFilePath({
|
|
|
canvasId: 'comb-font' + i + '-2',
|
|
@@ -316,7 +274,7 @@ Page({
|
|
|
rpx: rpx
|
|
|
});
|
|
|
const ctx = wx.createCanvasContext('comb-canvas' + i);
|
|
|
- ctx.drawImage(canvasBg, 0, 0, 750 * rpx, 588 * rpx);
|
|
|
+ ctx.drawImage(canvasBg, 0, 0, 750 * rpx, 800 * rpx);
|
|
|
|
|
|
ctx.draw(true)
|
|
|
imgSrcArray.forEach((res) => {
|
|
@@ -339,7 +297,7 @@ Page({
|
|
|
buildSrcArray: buildSrcArray,
|
|
|
})
|
|
|
console.log(that.data.buildSrcArray, "buildSrcArray")
|
|
|
- if (i < 4) {
|
|
|
+ if (i < 7) {
|
|
|
i = i + 1
|
|
|
that.getCombImg(that, i);
|
|
|
} else {
|