Commit 136574b7 authored by wangxuelai's avatar wangxuelai

'图片标记点评完结'

parent baf06530
......@@ -1442,6 +1442,9 @@ Page({
this.setData({
imageUploaded: true
})
if (this.data.tempFilesImgs.length > 0) {
this.data.tempFilesImgs = [];
}
return;
}
imageBox[this.data.currentIndex].status = 'resolving';
......@@ -1683,27 +1686,27 @@ Page({
const that = this;
const imgUrls = filterImage.map((item)=>{return item.src})
this.data.imgInfoList = new Array(imgUrls.length);
const maxImgHeight = this.data.windowHeight - 180;
// const maxImgHeight = this.data.windowHeight - 180;
for(let i=0; i<imgUrls.length; i++){
// const url = imagify(imgUrls[i], 'image/resize,w_800/format,jpg/quality,q_50');
const url = imagify(imgUrls[i]);
wxGetImageInfo({src:url}).then((res)=>{
let imageWidth ='';
let imageHeight = '';
if(res.width > res.height){
imageWidth = this.data.windowWidth;
imageHeight = imageWidth * (res.height/res.width);
}else{
imageHeight = res.height>maxImgHeight ? maxImgHeight : res.height;
imageWidth = imageHeight * (res.width/res.height);
}
// let imageWidth ='';
// let imageHeight = '';
// if(res.width > res.height){
// imageWidth = this.data.windowWidth;
// imageHeight = imageWidth * (res.height/res.width);
// }else{
// imageHeight = res.height>maxImgHeight ? maxImgHeight : res.height;
// imageWidth = imageHeight * (res.width/res.height);
// }
that.data.imgInfoList[i]= {
imageHeight,
imageWidth,
imageHeight: res.height,
imageWidth: res.width,
orientation: res.orientation,
actTemPath: res.path,
src: url
}
}).catch(()=>{
})
}
......
......@@ -19,10 +19,36 @@
</view>
</view>
<view class="content-box">
<view class="img-wrapper" style="width: {{imgInfoList[AcSubIndex].imageWidth}}px; height:{{imgInfoList[AcSubIndex].imageHeight}}px">
<image class="myimg" src="{{myimg}}" wx:if="{{shortCanvas && myimg}}" style="height:{{imgInfoList[AcSubIndex].imageHeight}}px" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" />
<image class="cur-img" src="{{imgInfoList[AcSubIndex].isDraw ? imgArr[AcSubIndex] : filter.imagify(imgArr[AcSubIndex], 'image/resize,w_750/format,jpg')}}" style="height:{{imgInfoList[AcSubIndex].imageHeight}}px" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" />
<canvas class="myCanvas {{shortCanvas? 'shortCanvas': ''}}" canvas-id="myCanvas" disable-scroll="true" bindtouchstart="doodleStart" bindtouchend="doodleEnd" bindtouchmove="doodleMove" style="width: {{imgInfoList[AcSubIndex].imageWidth}}px; height:{{imgInfoList[AcSubIndex].imageHeight}}px"></canvas>
<view class="img-wrapper" style="width: {{imgInfoList[AcSubIndex].width}}px; height:{{imgInfoList[AcSubIndex].height}}px">
<image
class="myimg"
src="{{myimg}}"
wx:if="{{shortCanvas && myimg}}"
style="width: {{imgInfoList[AcSubIndex].width}}px; height:{{imgInfoList[AcSubIndex].height}}px"
mode="aspectFit|aspectFill|widthFix"
lazy-load="false"
binderror=""
bindload=""
/>
<image
class="cur-img"
src="{{imgInfoList[AcSubIndex].isDraw ? imgArr[AcSubIndex] : filter.imagify(imgArr[AcSubIndex], 'image/resize,w_750/format,jpg')}}"
style="width: {{imgInfoList[AcSubIndex].width}}px; height:{{imgInfoList[AcSubIndex].height}}px"
mode="aspectFit|aspectFill|widthFix"
lazy-load="false"
binderror=""
bindload=""
/>
<canvas
class="myCanvas {{shortCanvas? 'shortCanvas': ''}}"
canvas-id="myCanvas"
disable-scroll="true"
bindtouchstart="doodleStart"
bindtouchend="doodleEnd"
bindtouchmove="doodleMove"
style="width: {{imgInfoList[AcSubIndex].width}}px; height:{{imgInfoList[AcSubIndex].height}}px"
>
</canvas>
<block wx:if="{{textArr.length>0}}">
<view class="text-box" animation="{{animationData}}" bindtouchstart="textMoveStart" bindtouchmove="textMove" bindtouchend="textMoveEnd" wx:for="{{textArr}}" data-index="{{index}}" wx:key="index" style="left: {{item.data.left}}px; top: {{item.data.top}}px"><view class="close" bindtap="deleteText"><image class="" src="{{imageRoot}}2b/comment/icon_cancal.png" mode="aspectFit|aspectFill|widthFix" lazy-load="false" binderror="" bindload="" /></view>{{item.value}}</view>
</block>
......@@ -48,5 +74,5 @@
</view>
<!-- <canvas canvas-id="tempCanvas" disable-scroll="true" style="width:200%; height:{{imgInfoList[AcSubIndex].imageHeight*2}}px; position:absolute;left:-999999px"></canvas> -->
<canvas canvas-id="tempCanvas" disable-scroll="true" style="width: {{imgInfoList[AcSubIndex].imageWidth * 4}}px; height:{{imgInfoList[AcSubIndex].imageHeight * 4}}px; position:absolute;left:-999999px"></canvas>
<canvas canvas-id="tempCanvas" disable-scroll="true" style="width: {{imgInfoList[AcSubIndex].width * 4}}px; height:{{imgInfoList[AcSubIndex].height * 4}}px; position:absolute;left:-999999px"></canvas>
<!-- style="width: {{imgInfoList[AcSubIndex].imageWidth}}px; height:{{imgInfoList[AcSubIndex].imageHeight}}px" -->
\ No newline at end of file
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