Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
gl_tape
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
3
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 742df99b
authored
Jun 18, 2024
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit 默认车型
1 parent
bd13d3c8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
192 additions
and
182 deletions
components/Canvas/wn-canvas.vue
components/CarBrands.vue
pages/equity/detail/components/Media_1.vue
pages/equity/index.vue
components/Canvas/wn-canvas.vue
View file @
742df99
...
...
@@ -59,7 +59,7 @@
</view>
</template>
<movable-area
class=
"canvas-box
"
:class=
"['canvas-box',{fill:custom}]
"
scale-area
:style=
"{height:height}"
>
...
...
@@ -73,25 +73,29 @@
@
scale=
"scale"
>
<canvas
class=
"board-canvas
"
:class=
"['board-canvas',{'draw-canvas':drawStatus}]
"
:canvas-id=
"canvasId"
:disable-scroll=
"drawStatus"
@
touchstart=
"touchStart"
@
touchmove=
"touchMove"
@
touchend=
"touchEnd"
></canvas>
<!-- <image :src="drawImage" class="under-image" mode="" v-if="isUnderBkg"></image> -->
<
template
v-if=
"aspectRatio"
>
<view
class=
"under-image"
:style=
"
{backgroundImage:`URL(${drawImage})`,aspectRatio:aspectRatio}"
>
</view>
<
template
v-if=
"custom"
>
<slot
name=
"customContent"
></slot>
</
template
>
<
template
v-else
>
<view
class=
"skeleton-box"
></view>
<!--
<image
:src=
"drawImage"
class=
"under-image"
mode=
""
v-if=
"isUnderBkg"
></image>
-->
<template
v-if=
"aspectRatio"
>
<view
class=
"under-image"
:style=
"
{backgroundImage:`URL(${drawImage})`,aspectRatio:aspectRatio}"
>
</view>
</
template
>
<
template
v-else
>
<view
class=
"skeleton-box"
></view>
</
template
>
</template>
<!-- <image class="under-image" :src="drawImage"
mode="scaleToFill"
/> -->
...
...
@@ -238,7 +242,8 @@ export default {
canvasId
:
{
type
:
String
,
default
:
'drawCanvas'
}
},
custom
:
Boolean
,
//自定义
},
computed
:
{
watchStatus
()
{
...
...
@@ -839,41 +844,44 @@ export default {
//清空画板
clearBoard
()
{
this
.
defaultScaleValue
=
1.1
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
defaultScaleValue
=
1
},
100
)
},
100
)
this
.
historyList
=
[];
this
.
drawContext
?.
draw
()
},
async
initBoard
()
{
const
systemInfo
=
uni
.
getSystemInfoSync
();
if
(
systemInfo
.
screenWidth
>
systemInfo
.
screenHeight
)
{
this
.
isLandScape
=
true
}
else
{
this
.
isLandScape
=
false
}
if
(
this
.
drawImage
)
{
let
imageInfoObj
=
(
await
uni
.
getImageInfo
({
src
:
this
.
drawImage
}))[
1
]
||
{};
try
{
const
systemInfo
=
uni
.
getSystemInfoSync
();
if
(
systemInfo
.
screenWidth
>
systemInfo
.
screenHeight
)
{
this
.
isLandScape
=
true
}
else
{
this
.
isLandScape
=
false
}
if
(
this
.
drawImage
)
{
let
imageInfoObj
=
(
await
uni
.
getImageInfo
({
src
:
this
.
drawImage
}))[
1
]
||
{};
this
.
aspectRatio
=
imageInfoObj
.
width
/
imageInfoObj
.
height
;
this
.
height
=
`
${
imageInfoObj
.
height
*
(
systemInfo
.
windowWidth
/
imageInfoObj
.
width
)}
px`
}
if
(
this
.
isUnderBkg
)
{
this
.
bgColor
=
"rgba(0,0,0,0)"
}
else
{
this
.
bgColor
=
"rgb(255,255,255)"
this
.
aspectRatio
=
imageInfoObj
.
width
/
imageInfoObj
.
height
;
this
.
height
=
`
${
imageInfoObj
.
height
*
(
systemInfo
.
windowWidth
/
imageInfoObj
.
width
)}
px`
}
if
(
this
.
isUnderBkg
)
{
this
.
bgColor
=
"rgba(0,0,0,0)"
}
else
{
this
.
bgColor
=
"rgba(255,255,255,0)"
}
this
.
drawContext
.
setLineCap
(
'round'
)
// 让线条圆润
this
.
drawContext
.
strokeStyle
=
this
.
currentColor
;
//设置画笔颜色
this
.
drawContext
.
setLineWidth
(
this
.
lineWidth
);
//设置画笔粗细
this
.
$nextTick
(()
=>
{
this
.
drawContext
.
setLineWidth
(
this
.
lineWidth
)
this
.
fillBackground
();
})
}
catch
(
error
)
{
console
.
log
(
error
)
}
this
.
drawContext
.
setLineCap
(
'round'
)
// 让线条圆润
this
.
drawContext
.
strokeStyle
=
this
.
currentColor
;
//设置画笔颜色
this
.
drawContext
.
setLineWidth
(
this
.
lineWidth
);
//设置画笔粗细
this
.
$nextTick
(()
=>
{
this
.
drawContext
.
setLineWidth
(
this
.
lineWidth
)
this
.
fillBackground
();
})
},
/**缩放 */
scale
(
e
)
{
...
...
@@ -1024,6 +1032,7 @@ export default {
//
margin-right
:
2.2rem
;
position
:
relative
;
//
height
:
100vh
;
z-index
:
99
;
.canvas-view
{
height
:
100%
;
width
:
100%
;
...
...
@@ -1033,7 +1042,15 @@ export default {
width
:
100%
;
position
:
absolute
;
background
:
rgba
(
0
,
0
,
0
,
0
);
pointer-events
:
none
;
z-index
:
9
;
}
.draw-canvas
{
pointer-events
:
auto
;
}
}
.fill
{
height
:
100%
!important
;
}
}
</
style
>
components/CarBrands.vue
View file @
742df99
...
...
@@ -46,6 +46,9 @@
<
script
type=
'text/ecmascript-6'
>
export
default
{
name
:
'CarBrands'
,
props
:
{
autoSelect
:
Boolean
},
data
()
{
return
{
carlist
:
[],
...
...
@@ -60,6 +63,13 @@ export default {
this
.
close
()
}
},
carBrandList
:
{
immediate
:
true
,
handler
(
newval
)
{
const
{
sceneType
}
=
uni
.
$storage
.
get
(
"userInfo"
)
if
(
newval
.
length
&&
sceneType
==
0
&&
this
.
autoSelect
)
this
.
selectCar
(
newval
[
0
],
true
)
}
},
},
computed
:
{
watchStatus
()
{
...
...
@@ -69,7 +79,7 @@ export default {
return
this
.
$store
.
state
.
user
.
customerInfo
.
carModel
},
carBrandList
()
{
return
this
.
$store
.
state
.
user
.
carBrands
return
this
.
$store
.
state
.
user
.
carBrands
||
[]
},
carBrand
()
{
return
this
.
$store
.
state
.
user
.
customerInfo
.
carBrand
...
...
@@ -81,7 +91,7 @@ export default {
open
()
{
this
.
$refs
.
carBrandListVisible
.
open
()
},
selectCar
(
e
)
{
selectCar
(
e
,
auto
=
false
)
{
let
{
clickFlga
}
=
this
if
(
clickFlga
)
return
this
.
clickFlga
=
true
...
...
@@ -95,16 +105,16 @@ export default {
carChildsBrandName
:
e
.
name
,
carChildsBrandId
:
e
.
id
}
console
.
log
(
e
)
uni
.
$api
.
commonApi
.
getCarBrandsList
({
brandId
:
e
.
brandId
,
childBrandId
:
e
.
id
}).
then
(
res
=>
{
uni
.
hideLoading
()
this
.
carlist
=
res
this
.
$refs
.
carBoxVisible
.
open
()
if
(
auto
&&
res
.
length
)
this
.
handleSelect
(
res
[
0
])
else
this
.
$refs
.
carBoxVisible
.
open
()
this
.
clickFlga
=
false
}).
catch
(
()
=>
{
}).
catch
(
err
=>
{
this
.
clickFlga
=
false
uni
.
hideLoading
()
})
...
...
pages/equity/detail/components/Media_1.vue
View file @
742df99
<
template
>
<view
class=
"layout"
>
<view
class=
"bg"
>
<!--
<image
src=
"../../../assets/images/media/bg-1.webp"
/>
-->
</view>
<view
class=
"content"
>
<view
class=
"title"
>
{{
title
}}
</view>
<view
class=
"form"
:key=
"watchStatus"
>
<template
v-for=
"(i, index) in formObject"
>
<wnCanvas
saveImageType=
"3"
canvasId=
"c-1-1"
:drawStatus=
"penSwitch"
custom
>
<template
slot=
"customContent"
>
<view
class=
"bg"
>
<!--
<image
src=
"../../../assets/images/media/bg-1.webp"
/>
-->
</view>
<view
class=
"content"
>
<view
class=
"form-
item
"
:key=
"
index
"
class=
"form-
box
"
:key=
"
watchStatus
"
>
<view
class=
"label"
>
{{
i
.
label
}}
</view>
<view
class=
"value"
>
<template
v-if=
"i.type == 'input'"
>
<input
:type=
"i.inputType"
:maxlength=
"i.maxlength"
v-model=
"customerInfo[i.key]"
class=
"input"
@
input=
"inputCustomer"
/>
</
template
>
<
template
v-else
>
<view
class=
"form"
>
<template
v-for=
"(i, index) in formObject"
>
<view
class=
"select
"
@
click=
"showPopup(i.popKey)
"
:class=
"['form-item' ,
{active:focusIndex == index}]
"
:key="index
"
>
{{
customerInfo
[
i
.
key
]
}}
<uni-icons
class=
"arrow"
type=
"down"
:size=
"16"
></uni-icons>
<view
class=
"form-item-box"
>
<template
v-if=
"i.type == 'input'"
>
<input
:type=
"i.inputType"
:maxlength=
"i.maxlength"
v-model=
"customerInfo[i.key]"
class=
"input"
@
input=
"inputCustomer"
:placeholder=
"i.placeholder"
@
focus=
"focusIndex = index"
@
blur=
"resetFocusIndex"
/>
</
template
>
<
template
v-else
>
<view
:class=
"['select flex',
{placeholderStyle:!customerInfo[i.key]}]"
@click="showPopup(i.popKey,index)"
>
<view
class=
"value text-hide"
>
{{
customerInfo
[
i
.
key
]
||
i
.
placeholder
}}
</view>
<uni-icons
class=
"arrow"
type=
"right"
:size=
"16"
></uni-icons>
</view>
</
template
>
</view>
</view>
</template>
</view>
</view>
</template>
</view>
<
template
v-for=
"(i, index) in views"
>
<view
class=
"view"
:key=
"index"
>
<wnCanvas
saveImageType=
"3"
:drawImage=
"i.detailUrl"
:canvasId=
"`c-1-$
{index}`"
:drawStatus="penSwitch"
>
</wnCanvas>
</view>
</template>
</
view
>
</
wnCanvas
>
<car-brands
ref=
"carBrandListVisible"
@
select=
"handleSelect($event,'carBrandListVisible')"
/>
<employee
ref=
"employeeBoxVisible"
@
select=
"handleSelect($event,'employeeBoxVisible')"
@
close=
"resetFocusIndex"
autoSelect
/>
</view>
</template>
...
...
@@ -72,47 +72,42 @@ export default {
props
:
{
views
:
Array
,
penSwitch
:
Boolean
,
title
:
String
title
:
String
,
},
name
:
'Media_1'
,
data
()
{
return
{
formObject
:
[
{
label
:
'车主姓名'
,
placeholder
:
'车主姓名'
,
key
:
'customerName'
,
type
:
'input'
,
inputType
:
'text'
,
maxlength
:
50
},
{
label
:
'车型'
,
key
:
'carModel'
,
type
:
'select'
,
popKey
:
'carBrandListVisible'
},
{
label
:
'电话'
,
placeholder
:
'电话'
,
key
:
'phoneNumber'
,
type
:
'input'
,
inputType
:
'tel'
,
maxlength
:
11
},
{
label
:
'销售姓名
'
,
key
:
'
staffName
'
,
placeholder
:
'车型
'
,
key
:
'
carModel
'
,
type
:
'select'
,
popKey
:
'
employeeBox
Visible'
}
popKey
:
'
carBrandList
Visible'
}
,
],
customerInfo
:
{}
customerInfo
:
{},
focusIndex
:
-
1
}
},
watch
:
{
watchCustomerInfo
:
{
immediate
:
true
,
handler
(
newval
)
{
if
(
newval
)
this
.
customerInfo
=
newval
if
(
newval
)
this
.
customerInfo
=
newval
}
},
},
...
...
@@ -137,34 +132,29 @@ export default {
this
.
$refs
.
carBrandListVisible
.
close
()
this
.
customerInfo
.
carModel
=
item
.
name
}
this
.
resetFocusIndex
()
this
.
$store
.
dispatch
(
'setCustomerInfo'
,
this
.
customerInfo
)
},
showPopup
(
e
)
{
showPopup
(
e
,
index
)
{
this
.
focusIndex
=
index
this
.
$refs
[
e
].
open
()
},
closeAllPopup
()
{
this
.
$refs
.
carBrandListVisible
.
close
()
this
.
$refs
.
employeeBoxVisible
.
close
()
}
this
.
resetFocusIndex
()
},
resetFocusIndex
()
{
this
.
focusIndex
=
-
1
},
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.layout
{
padding-top
:
192
rpx
;
position
:
relative
;
.bg
{
position
:
absolute
;
left
:
0
;
top
:
0
;
width
:
100%
;
height
:
560
rpx
;
image
{
width
:
100%
;
height
:
100%
;
}
}
width
:
100vw
;
height
:
100vh
;
.content
{
border-radius
:
40
rpx
40
rpx
0
0
;
background
:
linear-gradient
(
180deg
,
#f7f9fc
0%
,
#f7f9fc
100%
);
...
...
@@ -172,61 +162,70 @@ export default {
position
:
relative
;
z-index
:
1
;
min-height
:
calc
(
100vh
-
200
rpx
);
.title
{
font-size
:
40
rpx
;
line-height
:
48
rpx
;
color
:
#1a1a1a
;
padding
:
32
rpx
0
;
text-align
:
center
;
}
.form
{
display
:
flex
;
flex-wrap
:
wrap
;
gap
:
28
rpx
0
;
padding
:
30
rpx
0
;
&-item
{
flex
:
50%
;
box-sizing
:
border-box
;
padding-top
:
196
rpx
;
.form-box
{
height
:
80
rpx
;
margin-bottom
:
48
rpx
;
padding
:
0
64
rpx
;
.form
{
display
:
flex
;
align-items
:
center
;
color
:
#292d33
;
font-size
:
32
rpx
;
box-sizing
:
border-bo
x
;
padding-right
:
64
rpx
;
.label
{
margin-left
:
auto
;
flex-shrink
:
0
;
}
.value
{
width
:
828
rpx
;
height
:
80
rpx
;
border
:
2
rpx
solid
#e8e8ea
;
background
:
#ffffff
;
margin-left
:
32
rp
x
;
box-sizing
:
border-bo
x
;
padding
:
0
40
rpx
;
border-radius
:
8
rpx
;
gap
:
0
28
rpx
;
height
:
100%
;
&-item
{
width
:
336
rp
x
;
height
:
100%
;
position
:
relative
;
&-box
{
position
:
relative
;
width
:
100%
;
height
:
100%
;
background
:
#ffffff
;
border
:
3
rpx
solid
#a8c1ff
;
border-radius
:
16
rpx
;
box-sizing
:
border-bo
x
;
padding
:
0
24
rp
x
;
z-index
:
2
;
}
.input
,
.select
{
width
:
100%
;
height
:
100%
;
border
:
none
!important
;
outline
:
none
;
}
.select
{
display
:
fle
x
;
align-items
:
center
;
.arrow
{
margin-left
:
auto
;
font-size
:
28
rpx
;
color
:
#333333
;
border-radius
:
16
rp
x
;
box-sizing
:
border-box
;
&::placeholder
{
color
:
#999999
;
}
}
.placeholderStyle
{
color
:
#999999
;
}
.arrow
{
color
:
#999
!important
;
margin-left
:
auto
;
flex-shrink
:
0
;
}
}
.active
{
&::after
{
position
:
absolute
;
left
:
-2
rpx
;
top
:
-2
rpx
;
width
:
calc
(
100%
+
4
rpx
);
height
:
calc
(
100%
+
4
rpx
);
content
:
""
;
background-image
:
linear-gradient
(
#2f6af7
,
#75bcff
);
box-shadow
:
0
0
0
8
rpx
#2c66f71
a
;
border-radius
:
16
rpx
;
}
}
}
}
.view
{
position
:
relative
;
z-index
:
2
;
margin-top
:
44
rpx
;
}
}
}
</
style
>
pages/equity/index.vue
View file @
742df99
...
...
@@ -120,22 +120,6 @@ export default {
// 查询素材
async
getSoure
()
{
let
{
moduleList
,
toolList
}
=
await
uni
.
$api
.
systemApi
.
getMockData
(
true
);
moduleList
.
map
((
e
,
index
)
=>
{
if
(
index
==
3
)
e
.
class
=
'vertical'
else
if
(
index
==
2
)
e
.
class
=
'square'
else
{
e
.
class
=
'landscape'
e
.
style
=
{
0
:
'width:974rpx;'
,
1
:
'width:652rpx;'
,
4
:
'width: 1282rpx;height: 288rpx;'
,
5
:
'width: 1282rpx;height: 288rpx;'
,
6
:
'display:none;'
}[
index
]
}
e
.
showTitle
=
false
});
console
.
log
(
moduleList
)
this
.
moduleList
=
moduleList
this
.
toolList
=
toolList
},
...
...
@@ -264,9 +248,9 @@ export default {
&
-text
{
width
:
100%
;
height
:
100%
;
background
:
#
999
;
background
:
#
fff
;
justify-content
:
center
;
color
:
#
fff
;
color
:
#
3773f8
;
}
}
.landscape
{
...
...
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