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
61257b89
Commit
61257b89
authored
Mar 23, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页、列表页的界面修改
parent
01df1405
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
378 additions
and
204 deletions
+378
-204
pages.json
take-order/pages.json
+19
-15
detail.vue
take-order/pages/photo/detail.vue
+5
-1
list.vue
take-order/pages/photo/list.vue
+120
-75
product.vue
take-order/pages/photo/product.vue
+234
-113
arrow.png
take-order/static/photo/arrow.png
+0
-0
No files found.
take-order/pages.json
View file @
61257b89
...
...
@@ -4,8 +4,21 @@
"^u-(.*)"
:
"@/uview-ui/components/u-$1/u-$1.vue"
},
"pages"
:
[
//pages数组中第一项表示应用启动页,参考:https
:
//uniapp.dcloud.io/collocation/pages
"pages"
:
[
//pages数组中第一项表示应用启动页,参考:https
:
//uniapp.dcloud.io/collocation/pages
{
"path"
:
"pages/photo/product"
,
"style"
:
{
"navigationBarTitleText"
:
"扳手会工单规范"
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"backgroundColor"
:
"#F4F5F7"
}
},
{
"path"
:
"pages/photo/index"
,
"style"
:
{
"navigationBarTitleText"
:
"拍照小工具首页"
}
},
{
"path"
:
"pages/index/index"
,
"style"
:
{
...
...
@@ -117,18 +130,7 @@
"navigationBarTitleText"
:
"工单详情"
}
},
{
"path"
:
"pages/photo/index"
,
"style"
:
{
"navigationBarTitleText"
:
"拍照小工具首页"
}
},
{
"path"
:
"pages/photo/product"
,
"style"
:
{
"navigationBarTitleText"
:
"扳手会工单规范"
}
},
{
"path"
:
"pages/photo/take"
,
"style"
:
{
...
...
@@ -160,7 +162,9 @@
{
"path"
:
"pages/photo/list"
,
"style"
:
{
"navigationBarTitleText"
:
"规范展示"
"navigationBarTitleText"
:
"规范展示"
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"backgroundColor"
:
"#F4F5F7"
}
},
...
...
take-order/pages/photo/detail.vue
View file @
61257b89
...
...
@@ -100,7 +100,11 @@
}
if
(
e
&&
e
.
current_count
){
this
.
current_count
=
e
.
current_count
this
.
done_count
=
e
.
current_count
}
if
(
e
&&
e
.
current_count
){
this
.
current_count
=
Math
.
max
(
e
.
current_count
-
1
,
0
)
}
if
(
e
&&
e
.
images
){
...
...
take-order/pages/photo/list.vue
View file @
61257b89
<
template
>
<view
class=
"backView"
>
<view
class=
"topView"
>
<view
:class=
"activeTop == ikey ? 'topItemView whiteBackColor' : 'topItemView FAbackColor'
"
@
click=
"topItemClick(ikey,item)"
v-for=
"(item,ikey) in dataList"
:key=
"ikey"
>
<text
class=
"topActiveItemTitle"
v-if=
"activeTop == ikey"
>
{{
item
.
type
}}
</text>
<text
class=
"topItemTitle"
v-if=
"activeTop != ikey
"
>
{{
item
.
type
}}
</text>
<view
class=
"topItemView
"
@
click=
"topItemClick(ikey,item)"
v-for=
"(item,ikey) in dataList"
:key=
"ikey"
>
<text
:class=
"['ph-lst-top-index', activeTop == ikey ? 'active-index-text' : 'index-text']"
>
{{
ikey
+
1
}}
</text>
<text
:class=
"activeTop == ikey ? 'topActiveItemTitle' : 'topItemTitle'
"
>
{{
item
.
type
}}
</text>
</view>
</view>
<view
class=
"rightView"
>
<view
class=
"right-view-title"
>
拍照项有:
</view>
<template
v-for=
"(item,ikey) in rightList"
>
<view
:class=
"['rightItemView',item.clickable ? 'FAbackColor' : '']"
@
click=
"rightItemClick(item,ikey)"
:key=
"ikey"
>
<view
:class=
" item.images ? 'rightContentView width_50' : 'rightContentView width_100' "
>
<text
:class=
" item.clickable ? 'gray999Color rightTitle u-m-t-30 u-m-l-30' : 'rightTitle u-m-t-30 u-m-l-30' "
>
{{
item
.
name
}}
(
{{
item
.
image_count
}}
张)
</text>
<text
class=
"rightContent u-m-t-14 u-m-l-30 u-p-b-30"
>
{{
item
.
describe
}}
</text>
<view
class=
"rightItemView"
@
click=
"rightItemClick(item,ikey)"
:key=
"ikey"
>
<view
class=
"['rightContentView', item.images.length > 0 ? 'gray666Color' : 'rightTitle']"
>
<text
class=
"ph-lst-item-index"
>
{{
ikey
+
1
}}
</text>
<text
class=
""
>
{{
item
.
name
}}
(
{{
item
.
image_count
}}
张)
</text>
<cover-image
class=
"ph-list-item-arrow"
src=
"/static/photo/arrow.png"
></cover-image>
<!--
<text
class=
"rightContent u-m-t-14 u-m-l-30 u-p-b-30"
>
{{
item
.
describe
}}
</text>
-->
</view>
<view
class=
"rightImageView"
v-if=
"item.images"
>
<image
class=
"rightImage"
:src=
"item.images[0]
"
mode=
""
></image>
<image
class=
"rightImage"
v-for=
"(image, index) in item.images"
:src=
"image"
:key=
"image"
@
click=
"handleClickImage(item, image, index)
"
mode=
""
></image>
</view>
</view>
</
template
>
...
...
@@ -121,29 +124,41 @@
uni
.
pageScrollTo
({
scrollTop
:
0
,
duration
:
0
});
},
//右侧点击
rightItemClick
:
function
(
item
,
ikey
)
{
// for (let i = 0; i
<
this
.
rightList
.
length
;
i
++
)
{
// var subItem = this.rightList[i]
// if(i == ikey){
// subItem.isClicked = true
// }
// }
// item.clickable = true
this
.
$set
(
this
.
rightList
[
ikey
],
'clickable'
,
true
)
var
current_image
=
item
.
images
[
0
]
var
current_count
=
1
// 点击图片
handleClickImage
(
item
,
image
,
index
)
{
uni
.
navigateTo
({
url
:
'/pages/photo/detail'
+
'?current_image='
+
current_
image
+
'?current_image='
+
image
+
'&image_count='
+
item
.
image_count
+
'¤t_count='
+
current_count
+
'¤t_count='
+
(
index
+
1
)
+
'&images='
+
JSON
.
stringify
(
item
.
images
)
+
'&title='
+
item
.
name
,
})
},
//右侧点击
rightItemClick
:
function
(
item
,
ikey
)
{
// // for (let i = 0; i
<
this
.
rightList
.
length
;
i
++
)
{
// // var subItem = this.rightList[i]
// // if(i == ikey){
// // subItem.isClicked = true
// // }
// // }
// // item.clickable = true
// this.$set(this.rightList[ikey],'clickable',true)
// var current_image = item.images[0]
// var current_count = 1
// uni.navigateTo({
// url:'/pages/photo/detail'
// +'?current_image=' + current_image
// +'&image_count=' + item.image_count
// +'¤t_count=' + current_count
// +'&images=' + JSON.stringify(item.images)
// +'&title=' + item.name,
// })
},
}
}
...
...
@@ -173,50 +188,80 @@
margin-top
:
80
rpx
;
width
:
100%
;
}
.leftView
{
background-color
:
#FFFFFF
;
width
:
20%
;
display
:
flex
;
flex-direction
:
column
;
.ph-lst-top-index
{
font-size
:
26
rpx
;
font-weight
:
bold
;
color
:
#FFFFFF
;
border-radius
:
8
rpx
;
background-color
:
#999999
;
width
:
36
rpx
;
height
:
36
rpx
;
line-height
:
36
rpx
;
text-align
:
center
;
}
.leftItemView
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
width
:
100%
;
height
:
80
rpx
;
border-bottom
:
2
rpx
solid
#F3F3F3
;
.active-index-text
{
background-color
:
#2272FF
;
}
.leftItemText
{
font-size
:
28
rpx
;
.index-text
{
background-color
:
#999999
;
}
.rightView
{
background-color
:
#F
FFFFF
;
background-color
:
#F
4F5F7
;
width
:
100%
;
display
:
flex
;
flex-direction
:
column
;
margin
-top
:
96
rpx
;
margin
:
100
rpx
;
}
.right
ItemView
{
width
:
100%
;
display
:
flex
;
flex-direction
:
row
;
justify-content
:
space-between
;
border-bottom
:
20
rpx
solid
#F3F3F3
;
.right
-view-title
{
font-size
:
36
rpx
;
font-weight
:
bold
;
height
:
104
rpx
;
line-height
:
104
rpx
;
margin-left
:
30
rpx
;
}
.rightItemView
{
/* width: 100%; */
/* display: flex; */
/* flex-direction: row; */
/* justify-content: space-between; */
/* border-bottom: 20rpx solid #F3F3F3; */
margin
:
0
rpx
30
rpx
20
rpx
30
rpx
;
padding
:
36
rpx
30
rpx
18
rpx
30
rpx
;
border-radius
:
12
rpx
;
background-color
:
#FFFFFF
;
}
.ph-lst-item-index
{
font-size
:
28
rpx
;
font-weight
:
bold
;
border-radius
:
4
rpx
;
width
:
34
rpx
;
height
:
34
rpx
;
line-height
:
30
rpx
;
text-align
:
center
;
border-width
:
1px
;
border-style
:
solid
;
margin-right
:
10
rpx
;
}
.rightContentView
{
display
:
flex
;
flex-direction
:
column
;
border-left
:
2
rpx
solid
#F3F3F3
;
align-items
:
center
;
width
:
100%
;
/* flex-direction: column; */
/* border-left: 2rpx solid #F3F3F3; */
}
.rightActiveContentView
{
.ph-list-item-arrow
{
position
:
absolute
;
width
:
56
rpx
;
height
:
56
rpx
;
right
:
30
rpx
;
}
/* .rightActiveContentView{
background-color: #4CD964;
display: flex;
flex-direction: column;
...
...
@@ -230,70 +275,69 @@
.width_100{
width: 100%;
}
}
*/
.rightTitle
{
font-size
:
3
2
rpx
;
color
:
#
4D87EA
;
font-size
:
3
0
rpx
;
color
:
#
2272FF
;
}
.rightContent
{
font-size
:
28
rpx
;
font-size
:
30
rpx
;
color
:
#333333
;
line-height
:
40
rpx
;
}
.rightImageView
{
width
:
300
rpx
;
height
:
320
rpx
;
/* width: 300rpx; */
/* height: 320rpx; */
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
flex-start
;
flex-wrap
:
wrap
;
margin-top
:
26
rpx
;
}
.rightImage
{
background-color
:
#F3F3F3
;
width
:
240
rpx
;
height
:
240
rpx
;
width
:
116
rpx
;
height
:
116
rpx
;
margin
:
0
rpx
12
rpx
12
rpx
0
rpx
;
}
.topView
{
background-color
:
#FAFAFA
;
width
:
100%
;
height
:
96
rpx
;
height
:
100
rpx
;
position
:
fixed
;
display
:
flex
;
flex-direction
:
row
;
}
.topItemView
{
width
:
210
rpx
;
height
:
96
rpx
;
/* width: 210rpx; */
height
:
100
rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.whiteBackColor
{
-webkit-flex
:
1
;
flex
:
1
;
background-color
:
#FFFFFF
;
}
.FAbackColor
{
background-color
:
#FAFAFA
;
}
.topItemTitle
{
font-size
:
3
2
rpx
;
font-size
:
3
6
rpx
;
color
:
#999999
;
font-weight
:
bold
;
padding-left
:
30
rpx
;
}
.topActiveItemTitle
{
font-size
:
3
2
rpx
;
font-size
:
3
6
rpx
;
font-weight
:
bold
;
color
:
#
333333
;
color
:
#
2272FF
;
padding-left
:
30
rpx
;
}
...
...
@@ -301,8 +345,9 @@
background-color
:
#4CD964
;
}
.gray999Color
{
color
:
#999999
;
.gray666Color
{
color
:
#666666
;
border-color
:
#666666
;
}
...
...
take-order/pages/photo/product.vue
View file @
61257b89
<
template
>
<view
class=
"backView"
>
<text
class=
"topTitle"
>
选择产品
</text>
<view
class=
"u-p-b-48"
>
<view
class=
"itemView u-m-t-48"
@
click=
"itemClick(item)"
v-for=
"(item,ikey) in productList"
:key=
"ikey"
>
<text
class=
"itemTitle"
>
{{
item
.
name
}}
</text>
</view>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
productList
:[],
product_code
:
''
,
product
:
''
,
}
},
onLoad
(
e
)
{
getApp
().
trackPage
(
'选择产品页'
)
this
.
getProductList
()
},
onShareAppMessage
(
res
)
{
let
shareObj
=
{
title
:
''
,
path
:
'/pages/photo/product'
,
imageUrl
:
''
,
success
(){},
fail
(){}
}
return
shareObj
},
methods
:
{
getProductList
:
function
(){
let
that
=
this
this
.
$u
.
cloudApi
.
getAllProduct
().
then
(
res
=>
{
console
.
log
(
'获取产品数据:'
)
console
.
log
(
res
)
if
(
res
.
result
&&
res
.
result
.
data
){
that
.
productList
=
res
.
result
.
data
}
})
<
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
:class=
"param[item.type + '_code'] === item.code ? 'select-item-view' : 'item-view'"
@
click=
"itemClick(item)"
v-for=
"(item,ikey) in dataItem.data"
:key=
"item.code"
>
<text
class=
"itemTitle"
>
{{
item
.
name
}}
</text>
</view>
</view>
</
template
>
</view>
<button
class=
"ph-pr-button"
type=
"primary"
@
click=
"handleClick"
:style=
"selectedAll ? 'background-color: #2272FF;' : 'background-color: #D1D4D4;'"
>
下一步
</button>
</view>
</template>
<
script
>
export
default
{
data
()
{
return
{
productList
:
[],
sysList
:
[],
brandList
:
[],
product_code
:
''
,
product
:
''
,
param
:
{
brand_code
:
''
,
brand
:
''
,
product_code
:
''
,
product
:
''
},
selectedAll
:
false
,
}
},
computed
:
{
list
()
{
return
[{
title
:
'请选择类别'
,
data
:
this
.
productList
},
{
title
:
'请选择系统'
,
data
:
this
.
sysList
},
{
title
:
'请选择品牌'
,
data
:
this
.
brandList
}
]
}
},
onLoad
(
e
)
{
getApp
().
trackPage
(
'选择产品页'
)
this
.
getProductList
()
},
onShareAppMessage
(
res
)
{
let
shareObj
=
{
title
:
''
,
path
:
'/pages/photo/product'
,
imageUrl
:
''
,
success
()
{},
fail
()
{}
}
return
shareObj
},
methods
:
{
getProductList
:
function
()
{
let
that
=
this
this
.
$u
.
cloudApi
.
getAllProduct
().
then
(
res
=>
{
console
.
log
(
'获取产品数据:'
)
console
.
log
(
res
)
if
(
res
.
result
&&
res
.
result
.
data
)
{
that
.
productList
=
res
.
result
.
data
}
})
},
//选择 点击
itemClick
:
function
(
item
)
{
switch
(
item
.
type
)
{
case
'product'
:
this
.
initSelect
()
this
.
param
.
product_code
=
item
.
code
this
.
param
.
product
=
item
.
name
this
.
$u
.
cloudApi
.
getBrand
({
product_code
:
this
.
param
.
product_code
}).
then
(
res
=>
{
console
.
log
(
'获取品牌数据:'
,
res
)
if
(
res
.
result
.
data
)
{
res
.
result
.
data
.
filter
((
value
)
=>
{
value
.
type
=
'brand'
})
this
.
brandList
=
res
.
result
.
data
this
.
changeSelectedAll
()
}
})
break
default
:
this
.
param
.
brand_code
=
item
.
code
this
.
param
.
brand
=
item
.
name
this
.
changeSelectedAll
()
}
// uni.navigateTo({
// url: '/pages/photo/brand' +
// '?product_code=' + this.param.product_code +
// '&product=' + this.param.product,
// })
},
// 点击下一步
handleClick
()
{
uni
.
navigateTo
({
url
:
'/pages/photo/list'
+
'?brand_code='
+
this
.
param
.
brand_code
+
'&brand='
+
this
.
param
.
brand
+
'&product_code='
+
this
.
param
.
product_code
+
'&product='
+
this
.
param
.
product
,
})
},
// 修改下一步按钮是否可以点击
changeSelectedAll
()
{
for
(
var
item
in
this
.
param
)
{
if
(
!
this
.
param
[
item
])
{
this
.
selectedAll
=
false
return
}
}
this
.
selectedAll
=
true
},
//选择 点击
itemClick
:
function
(
item
)
{
if
(
item
.
code
){
this
.
product_code
=
item
.
code
// 初始化选择
initSelect
()
{
this
.
param
=
{
brand_code
:
''
,
brand
:
''
,
product_code
:
''
,
product
:
''
}
if
(
item
.
name
){
this
.
product
=
item
.
name
}
uni
.
navigateTo
({
url
:
'/pages/photo/brand'
+
'?product_code='
+
this
.
product_code
+
'&product='
+
this
.
product
,
})
},
}
}
</
script
>
<
style
>
.backView
{
background-color
:
#FAFAFA
;
position
:
absolute
;
top
:
0
;
left
:
0
;
width
:
100%
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
}
.topTitle
{
margin-top
:
192
rpx
;
font-size
:
32
rpx
;
}
.itemView
{
background-color
:
#FFFFFF
;
width
:
548
rpx
;
height
:
96
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
;
}
.itemTitle
{
font-size
:
32
rpx
;
font-weight
:
bold
;
}
this
.
brandList
=
[]
this
.
selectedAll
=
false
}
}
}
</
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
;
}
</
style
>
take-order/static/photo/arrow.png
0 → 100644
View file @
61257b89
4.86 KB
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