Commit bf2813ee authored by lvtz's avatar lvtz

fix

parent 86a9ae9f
...@@ -344,8 +344,8 @@ Component({ ...@@ -344,8 +344,8 @@ Component({
if (JSON.stringify(n) === '{}') return; if (JSON.stringify(n) === '{}') return;
if(!this.ctx) return; if(!this.ctx) return;
this.drawArr.push(new dragGraph(Object.assign({ this.drawArr.push(new dragGraph(Object.assign({
x: 30, x: 130-n.w/2,
y: 30, y: 110-n.h/2,
}, n), this.ctx, this.factor)); }, n), this.ctx, this.factor));
this.draw(); this.draw();
// 参数有变化时记录历史 // 参数有变化时记录历史
......
...@@ -175,14 +175,22 @@ Page({ ...@@ -175,14 +175,22 @@ Page({
w: 120, w: 120,
h: 120, h: 120,
type: 'image', type: 'image',
url: imagify(this.data.hasReviewImg[`${this.data.coverindex}`].src, 'image/resize,w_320/format,jpg/quality,q_50') url: imagify(this.data.hasReviewImg[`${this.data.coverindex}`].src)
}, },
},()=>{ },()=>{
wxGetImageInfo({src: that.data.graph.url}).then((res)=>{ wxGetImageInfo({src: that.data.graph.url}).then((res)=>{
let w = res.width,h=res.height,initratio = res.width/res.height;
if(initratio>=1){
w = 250,
h = 250*(res.height/res.width)
}else{
h = 210,
w = 210*(res.width/res.height)
}
that.setData({ that.setData({
graph2: { graph2: {
w: 120, w: w,
h: 120, h: h,
type: 'image', type: 'image',
url: res.path url: res.path
}, },
...@@ -535,14 +543,22 @@ Page({ ...@@ -535,14 +543,22 @@ Page({
w: 120, w: 120,
h: 120, h: 120,
type: 'image', type: 'image',
url: imagify(this.data.hasReviewImg[`${this.data.coverindex}`].src, 'image/resize,w_320/format,jpg/quality,q_50') url: imagify(this.data.hasReviewImg[`${this.data.coverindex}`].src)
}, },
},()=>{ },()=>{
wxGetImageInfo({src: that.data.graph.url}).then((res)=>{ wxGetImageInfo({src: that.data.graph.url}).then((res)=>{
let w = res.width,h=res.height,initratio = res.width/res.height;
if(initratio>=1){
w = 250,
h = 250*(res.height/res.width)
}else{
h = 210,
w = 210*(res.width/res.height)
}
that.setData({ that.setData({
graph2: { graph2: {
w: 120, w: w,
h: 120, h: h,
type: 'image', type: 'image',
url: res.path url: res.path
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment