Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
take_order
Project
Project
Details
Activity
Releases
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
和慭琛
take_order
Commits
8dffc547
Commit
8dffc547
authored
Mar 31, 2021
by
李俊赕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-photo-v2' of
https://git.banshouhui.com/heyinchen/take_order
into dev-photo-v2
parents
97c7a265
61e9bd92
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
232 additions
and
224 deletions
+232
-224
index.vue
take-order/pages/photo/index.vue
+232
-224
No files found.
take-order/pages/photo/index.vue
View file @
8dffc547
<
template
>
<view
class=
"backView"
>
<view
class=
"ph-pr-arr"
v-for=
"(dataItem, index) in list"
:key=
"index"
>
<template
v-if=
"dataItem.data.length > 0"
>
<view
class=
"topTitle"
><text>
{{
dataItem
.
title
}}
</text></view>
<view
class=
"ph-pr-content"
>
<view
v-for=
"(item,ikey) in dataItem.data"
:class=
"param[dataItem.type] === item.id ? 'select-item-view' : 'item-view'"
@
click=
"itemClick(dataItem.type, item, ikey)"
:key=
"item.id"
>
<text
class=
"itemTitle"
>
{{
item
.
name
}}
</text>
</view>
</view>
</
template
>
</view>
<button
class=
"ph-pr-button"
type=
"primary"
@
click=
"handleClick"
:disabled=
"!selectedAll"
:style=
"buttonStyle"
>
下一步
</button>
</view>
</template>
<
script
>
export
default
{
data
()
{
return
{
classifyList
:
[],
systemList
:
[],
brandList
:
[],
param
:
{
classifyId
:
''
,
systemId
:
''
,
brandId
:
''
,
},
brandName
:
''
,
selectedAll
:
false
,
}
},
computed
:
{
list
()
{
return
[{
title
:
'请选择类别'
,
type
:
'classifyId'
,
data
:
this
.
classifyList
},
{
title
:
'请选择系统'
,
type
:
'systemId'
,
data
:
this
.
systemList
},
{
title
:
'请选择品牌'
,
type
:
'brandId'
,
data
:
this
.
brandList
}
]
},
buttonStyle
()
{
return
this
.
selectedAll
?
'color: #FFFFFF;background-color: #2272FF;'
:
'color: #FFFFFF;background-color: #D1D4D4;'
}
},
onLoad
(
e
)
{
getApp
().
trackPage
(
'选择产品页'
)
this
.
getRelationDictionaryV2
()
},
onShareAppMessage
(
res
)
{
let
shareObj
=
{
title
:
''
,
path
:
'/pages/photo/product'
,
imageUrl
:
''
,
success
()
{},
fail
()
{}
}
return
shareObj
},
methods
:
{
getRelationDictionaryV2
:
function
()
{
this
.
$u
.
cloudApi
.
getRelationDictionaryV2
().
then
(
res
=>
{
if
(
res
&&
res
.
result
)
{
this
.
classifyList
=
res
.
result
this
.
param
.
classifyId
=
res
.
result
[
0
].
id
this
.
systemList
=
res
.
result
[
0
].
child
}
})
},
//选择 点击
itemClick
:
function
(
type
,
item
,
ikey
)
{
switch
(
type
)
{
case
'classifyId'
:
this
.
param
=
{
classifyId
:
item
.
id
,
systemId
:
''
,
brandId
:
''
}
this
.
selectedAll
=
false
this
.
systemList
=
this
.
classifyList
[
ikey
].
child
this
.
brandList
=
[]
break
case
'systemId'
:
this
.
param
=
{
classifyId
:
this
.
param
.
classifyId
,
systemId
:
item
.
id
,
brandId
:
''
}
this
.
selectedAll
=
false
this
.
brandList
=
this
.
systemList
[
ikey
].
child
break
case
'brandId'
:
this
.
param
.
brandId
=
item
.
id
this
.
selectedAll
=
true
this
.
brandName
=
item
.
name
break
default
:
break
}
},
// 点击下一步
handleClick
()
{
// 点击下一步设置全局拍照品牌品类
const
globalData
=
getApp
().
globalData
if
(
!
globalData
.
token
)
{
uni
.
navigateTo
({
url
:
'/pages/login/wxlogin'
})
return
}
let
keys
=
[
'brandId'
,
'brandName'
,
'classifyId'
,
'systemId'
]
keys
.
map
(
key
=>
{
globalData
.
photo
.
product
[
key
]
=
this
[
key
]
||
this
.
param
[
key
]
})
uni
.
navigateTo
({
url
:
'/pages/photo/list'
+
'?brandId='
+
this
.
param
.
brandId
+
'&brand='
+
this
.
brandName
+
'&classifyId='
+
this
.
param
.
classifyId
+
'&systemId='
+
this
.
param
.
systemId
,
})
}
}
}
</
script
>
<
style
>
.backView
{
background-color
:
#FAFAFA
;
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
height
:
100%
;
}
.topTitle
{
margin-top
:
50
rpx
;
padding-left
:
30
rpx
;
font-size
:
36
rpx
;
font-weight
:
bold
;
color
:
#333333
;
}
.ph-pr-content
{
display
:
flex
;
flex-wrap
:
wrap
;
justify-content
:
flex-start
;
width
:
100%
;
padding
:
22
rpx
22
rpx
;
}
.ph-pr-arr
{
width
:
100%
;
}
.item-view
{
background-color
:
#FFFFFF
;
/* width: 548rpx; */
margin
:
0
rpx
8
rpx
24
rpx
8
rpx
;
/* flex: 1 1 0%;
max-width: 33%; */
width
:
222
rpx
;
height
:
76
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
border-style
:
solid
;
box-shadow
:
0px
2px
7px
0px
rgba
(
0
,
0
,
0
,
0.05
);
border-width
:
0
rpx
;
border-radius
:
12
rpx
;
font-size
:
26
rpx
;
color
:
#666666
;
}
.select-item-view
{
background-color
:
#2272FF
;
margin
:
0
rpx
8
rpx
24
rpx
8
rpx
;
/* flex: 1 1 0%;
max-width: 33%; */
width
:
222
rpx
;
height
:
76
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
border-style
:
solid
;
box-shadow
:
0px
2px
7px
0px
rgba
(
0
,
0
,
0
,
0.05
);
border-width
:
0
rpx
;
border-radius
:
12
rpx
;
font-size
:
26
rpx
;
color
:
#FFFFFF
;
}
.ph-pr-button
{
position
:
absolute
;
bottom
:
76
rpx
;
border-radius
:
52
rpx
;
height
:
104
rpx
;
font-size
:
32
rpx
;
width
:
600
rpx
;
line-height
:
104
rpx
;
}
<
template
>
<view
class=
"backView"
>
<view
class=
"ph-pr-arr"
v-for=
"(dataItem, index) in list"
:key=
"index"
>
<template
v-if=
"dataItem.data.length > 0"
>
<view
class=
"topTitle"
><text>
{{
dataItem
.
title
}}
</text></view>
<view
class=
"ph-pr-content"
>
<view
v-for=
"(item,ikey) in dataItem.data"
:class=
"param[dataItem.type] === item.id ? 'select-item-view' : 'item-view'"
@
click=
"itemClick(dataItem.type, item, ikey)"
:key=
"item.id"
>
<text
class=
"itemTitle"
>
{{
item
.
name
}}
</text>
</view>
</view>
</
template
>
</view>
<u-button
class=
"ph-pr-button"
type=
"primary"
shape=
"circle"
@
click=
"handleClick"
:hover-class=
"selectedAll ? '' : 'none'"
:custom-style=
"buttonStyle"
>
下一步
</u-button>
</view>
</template>
<
script
>
export
default
{
data
()
{
return
{
classifyList
:
[],
systemList
:
[],
brandList
:
[],
param
:
{
classifyId
:
''
,
systemId
:
''
,
brandId
:
''
,
},
brandName
:
''
,
selectedAll
:
false
,
}
},
computed
:
{
list
()
{
return
[{
title
:
'请选择类别'
,
type
:
'classifyId'
,
data
:
this
.
classifyList
},
{
title
:
'请选择系统'
,
type
:
'systemId'
,
data
:
this
.
systemList
},
{
title
:
'请选择品牌'
,
type
:
'brandId'
,
data
:
this
.
brandList
}
]
},
buttonStyle
()
{
return
this
.
selectedAll
?
{
'color'
:
'#FFFFFF'
,
'background-color'
:
'#2272FF;'
,
'width'
:
'600rpx'
,
'height'
:
'104rpx'
}
:
{
'color'
:
'#FFFFFF'
,
'background-color'
:
'#D1D4D4;'
,
'width'
:
'600rpx'
,
'height'
:
'104rpx'
}
}
},
onLoad
(
e
)
{
getApp
().
trackPage
(
'选择产品页'
)
this
.
getRelationDictionaryV2
()
},
onShareAppMessage
(
res
)
{
let
shareObj
=
{
title
:
''
,
path
:
'/pages/photo/product'
,
imageUrl
:
''
,
success
()
{},
fail
()
{}
}
return
shareObj
},
methods
:
{
getRelationDictionaryV2
:
function
()
{
this
.
$u
.
cloudApi
.
getRelationDictionaryV2
().
then
(
res
=>
{
if
(
res
&&
res
.
result
)
{
this
.
classifyList
=
res
.
result
this
.
param
.
classifyId
=
res
.
result
[
0
].
id
this
.
systemList
=
res
.
result
[
0
].
child
}
})
},
//选择 点击
itemClick
:
function
(
type
,
item
,
ikey
)
{
switch
(
type
)
{
case
'classifyId'
:
this
.
param
=
{
classifyId
:
item
.
id
,
systemId
:
''
,
brandId
:
''
}
this
.
selectedAll
=
false
this
.
systemList
=
this
.
classifyList
[
ikey
].
child
this
.
brandList
=
[]
break
case
'systemId'
:
this
.
param
=
{
classifyId
:
this
.
param
.
classifyId
,
systemId
:
item
.
id
,
brandId
:
''
}
this
.
selectedAll
=
false
this
.
brandList
=
this
.
systemList
[
ikey
].
child
break
case
'brandId'
:
this
.
param
.
brandId
=
item
.
id
this
.
selectedAll
=
true
this
.
brandName
=
item
.
name
break
default
:
break
}
},
// 点击下一步
handleClick
()
{
// 点击下一步设置全局拍照品牌品类
if
(
!
this
.
selectedAll
)
{
return
}
const
globalData
=
getApp
().
globalData
if
(
!
globalData
.
token
)
{
uni
.
navigateTo
({
url
:
'/pages/login/wxlogin'
})
return
}
let
keys
=
[
'brandId'
,
'brandName'
,
'classifyId'
,
'systemId'
]
keys
.
map
(
key
=>
{
globalData
.
photo
.
product
[
key
]
=
this
[
key
]
||
this
.
param
[
key
]
})
uni
.
navigateTo
({
url
:
'/pages/photo/list'
+
'?brandId='
+
this
.
param
.
brandId
+
'&brand='
+
this
.
brandName
+
'&classifyId='
+
this
.
param
.
classifyId
+
'&systemId='
+
this
.
param
.
systemId
,
})
}
}
}
</
script
>
<
style
>
.backView
{
background-color
:
#FAFAFA
;
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
height
:
100%
;
}
.topTitle
{
margin-top
:
50
rpx
;
padding-left
:
30
rpx
;
font-size
:
36
rpx
;
font-weight
:
bold
;
color
:
#333333
;
}
.ph-pr-content
{
display
:
flex
;
flex-wrap
:
wrap
;
justify-content
:
flex-start
;
width
:
100%
;
padding
:
22
rpx
22
rpx
;
}
.ph-pr-arr
{
width
:
100%
;
}
.item-view
{
background-color
:
#FFFFFF
;
/* width: 548rpx; */
margin
:
0
rpx
8
rpx
24
rpx
8
rpx
;
/* flex: 1 1 0%;
max-width: 33%; */
width
:
222
rpx
;
height
:
76
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
border-style
:
solid
;
box-shadow
:
0px
2px
7px
0px
rgba
(
0
,
0
,
0
,
0.05
);
border-width
:
0
rpx
;
border-radius
:
12
rpx
;
font-size
:
26
rpx
;
color
:
#666666
;
}
.select-item-view
{
background-color
:
#2272FF
;
margin
:
0
rpx
8
rpx
24
rpx
8
rpx
;
/* flex: 1 1 0%;
max-width: 33%; */
width
:
222
rpx
;
height
:
76
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
border-style
:
solid
;
box-shadow
:
0px
2px
7px
0px
rgba
(
0
,
0
,
0
,
0.05
);
border-width
:
0
rpx
;
border-radius
:
12
rpx
;
font-size
:
26
rpx
;
color
:
#FFFFFF
;
}
.ph-pr-button
{
position
:
absolute
;
bottom
:
76
rpx
;
font-size
:
32
rpx
;
}
</
style
>
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