Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
scrm-wx-merchant-activity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d73d13d9
authored
Aug 11, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交代码
1 parent
2ab7ee8e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
22 deletions
src/utils/draw.js
src/views/crowdfunding/orderList.vue
src/utils/draw.js
View file @
d73d13d
...
...
@@ -106,7 +106,7 @@ class Draw {
let
textArr
=
text
.
split
(
''
)
let
newText
=
''
try
{
textArr
.
map
(
e
=>
{
textArr
.
map
(
e
=>
{
newText
+=
e
if
(
this
.
getTextWidth
(
newText
)
>
width
-
fontX
-
this
.
getTextWidth
(
'…'
)
-
fontSize
)
throw
newText
})
...
...
@@ -179,7 +179,7 @@ class Draw {
this
[
_ctx_
].
stroke
()
}
drawLine
(
lineParams
)
{
drawLine
(
lineParams
,
callback
)
{
this
[
_ctx_
].
beginPath
()
let
{
opacity
,
...
...
@@ -190,6 +190,7 @@ class Draw {
endX
,
endY
,
}
=
lineParams
console
.
log
(
lineParams
)
startX
=
this
.
toRpx
(
startX
)
startY
=
this
.
toRpx
(
startY
)
width
=
this
.
toRpx
(
width
)
...
...
@@ -203,6 +204,7 @@ class Draw {
this
[
_ctx_
].
stroke
()
this
[
_ctx_
].
restore
()
this
[
_ctx_
].
save
()
if
(
callback
)
callback
()
}
setLineY
=
params
=>
{
let
{
...
...
src/views/crowdfunding/orderList.vue
View file @
d73d13d
<
template
>
<div
class=
"layout"
>
<div
class=
"title"
>
左右滑动查看核销凭证
</div>
<div
class=
"content"
>
<div
class=
"content"
@
touchend=
"end"
>
<van-swipe
class=
"img-box"
:key=
"updata"
indicator-color=
"#FFFFFF"
:width=
"347"
:loop=
"false"
@
change=
"change"
:style=
"swipeStyle"
:show-indicators=
"false"
ref=
"swipe"
duration=
"200"
>
<template
v-for=
"(i,index) in orderList"
>
<van-swipe-item
:key=
"index"
>
...
...
@@ -68,21 +71,23 @@ export default {
this
.
getOrderList
()
},
methods
:
{
change
(
e
)
{
this
.
itemIndex
=
e
let
{
track
}
=
this
.
$refs
.
swipe
.
$refs
,
{
orderList
}
=
this
end
()
{
let
{
swipe
}
=
this
.
$refs
let
{
track
}
=
swipe
.
$refs
,
{
itemIndex
}
=
this
,
{
offsetWidth
}
=
swipe
.
$children
[
0
].
$el
this
.
$nextTick
(()
=>
{
if
(
e
==
0
)
this
.
swipeStyle
=
swipeStyle
if
(
itemIndex
==
0
)
this
.
swipeStyle
=
swipeStyle
else
{
let
[
firstCss
,
last
]
=
track
.
style
.
cssText
.
split
(
'translateX(-'
)
let
[
num
,
lastCss
]
=
last
.
split
(
'px)'
)
num
=
Number
(
num
)
-
(
e
==
orderList
.
length
-
1
?
-
27
:
9
)
track
.
style
.
cssText
=
`
${
firstCss
}
translateX(-
${
num
}
px)
${
lastCss
}
`
let
width
=
track
.
style
.
cssText
.
split
(
'width:'
)[
1
]
let
num
=
offsetWidth
*
itemIndex
-
9
track
.
style
.
cssText
=
`transition-duration: 200; transform: translateX(-
${
num
}
px); width:
${
width
}
`
this
.
swipeStyle
=
''
}
})
},
change
(
e
)
{
this
.
itemIndex
=
e
},
getOrderList
()
{
let
{
id
}
=
this
.
getLocalStorage
(
'wx_scrm_link_params'
)
...
...
@@ -135,19 +140,13 @@ export default {
width
:
100%
;
height
:
422px
;
/deep/.van-swipe-item
{
text-align
:
righ
t
;
width
:
347px
!importan
t
;
}
.img
{
width
:
337px
;
height
:
422px
;
object-fit
:
contain
;
}
.move
{
position
:
absolute
;
left
:
0
;
top
:
0
;
width
:
1103px
;
height
:
100%
;
margin-left
:
10px
;
}
}
.tips
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment