Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
wechatapp.shangjiadao.com
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxuelai
wechatapp.shangjiadao.com
Commits
136574b7
Commit
136574b7
authored
Apr 23, 2020
by
wangxuelai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'图片标记点评完结'
parent
baf06530
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
163 additions
and
98 deletions
+163
-98
index.js
business/pages/commenteditor/index.js
+17
-14
taggedpicture.js
business/pages/commenteditor/taggedpicture.js
+115
-79
taggedpicture.wxml
business/pages/commenteditor/taggedpicture.wxml
+31
-5
No files found.
business/pages/commenteditor/index.js
View file @
136574b7
...
...
@@ -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
(()
=>
{
})
}
...
...
business/pages/commenteditor/taggedpicture.js
View file @
136574b7
This diff is collapsed.
Click to expand it.
business/pages/commenteditor/taggedpicture.wxml
View file @
136574b7
...
...
@@ -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].imageH
eight * 4}}px; position:absolute;left:-999999px"></canvas>
<canvas canvas-id="tempCanvas" disable-scroll="true" style="width: {{imgInfoList[AcSubIndex].
width * 4}}px; height:{{imgInfoList[AcSubIndex].h
eight * 4}}px; position:absolute;left:-999999px"></canvas>
<!-- style="width: {{imgInfoList[AcSubIndex].imageWidth}}px; height:{{imgInfoList[AcSubIndex].imageHeight}}px" -->
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment