订单相关修改提测
This commit is contained in:
@@ -156,10 +156,10 @@
|
||||
type: {
|
||||
type: String,
|
||||
default: () => {
|
||||
// #ifdef MP-WEIXIN
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
return '2d';
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
// #ifndef MP-WEIXIN || MP-ALIPAY
|
||||
return 'normal';
|
||||
// #endif
|
||||
}
|
||||
@@ -294,6 +294,7 @@
|
||||
},
|
||||
value: {
|
||||
handler() {
|
||||
console.log(this.auto)
|
||||
if (this.auto) {
|
||||
this.remake();
|
||||
}
|
||||
@@ -331,7 +332,7 @@
|
||||
this.templateOptions.canvasWidth = this.templateOptions.size;
|
||||
this.templateOptions.canvasHeight = this.templateOptions.size;
|
||||
if (this.canvasType == '2d') {
|
||||
// #ifndef MP-WEIXIN
|
||||
// #ifndef MP-WEIXIN || MP-ALIPAY
|
||||
this.templateOptions.canvasTransform = `scale(${this.templateOptions.size / this.templateOptions.canvasWidth}, ${this.templateOptions.size /
|
||||
this.templateOptions.canvasHeight})`;
|
||||
// #endif
|
||||
@@ -462,7 +463,7 @@
|
||||
let canvasContext = null;
|
||||
// #ifndef APP-NVUE
|
||||
if (this.canvasType === '2d') {
|
||||
// #ifdef MP-WEIXIN
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
/* 微信小程序获取canvas2d上下文方式 */
|
||||
const canvas = (this.canvas = await new Promise(resolve => {
|
||||
uni
|
||||
@@ -502,7 +503,7 @@
|
||||
});
|
||||
});
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
// #ifndef MP-WEIXIN || MP-ALIPAY
|
||||
/* 非微信小程序不支持2d,切换回uniapp获取canvas上下文方式 */
|
||||
canvasContext = this.canvasContext = uni.createCanvasContext(this.canvasId, this);
|
||||
/* 使用dynamicSize,可以解决小块间出现白线问题,再通过scale缩放至size,使其达到所设尺寸 */
|
||||
@@ -752,7 +753,7 @@
|
||||
|
||||
// #ifndef APP-NVUE
|
||||
if (this.canvasType === '2d') {
|
||||
// #ifdef MP-WEIXIN
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
try {
|
||||
let dataURL = null;
|
||||
// #ifdef VUE3
|
||||
@@ -831,7 +832,7 @@
|
||||
success: res => {
|
||||
// #ifndef H5
|
||||
if (this.canvasType === '2d') {
|
||||
// #ifdef MP-WEIXIN
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
/* 需要将 data:image/png;base64, 这段去除 writeFile 才能正常打开文件,否则是损坏文件,无法打开 */
|
||||
const reg = new RegExp('^data:image/png;base64,', 'g');
|
||||
const dataURL = res.tempFilePath.replace(reg, '');
|
||||
|
||||
Reference in New Issue
Block a user