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
63474fe0
Commit
63474fe0
authored
Mar 25, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
大图预览页不再单独做成一个页面
parent
539511b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
99 deletions
+88
-99
pages.json
take-order/pages.json
+3
-3
detail.vue
take-order/pages/photo/detail.vue
+74
-78
list.vue
take-order/pages/photo/list.vue
+11
-18
No files found.
take-order/pages.json
View file @
63474fe0
...
@@ -153,9 +153,9 @@
...
@@ -153,9 +153,9 @@
{
{
"path"
:
"pages/photo/detail"
,
"path"
:
"pages/photo/detail"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"图片展示"
,
"navigationBarTitleText"
:
"图片展示"
,
"navigationBarBackgroundColor"
:
"#FFFFFF"
,
"navigationBarBackgroundColor"
:
"#333333"
,
"
backgroundColor"
:
"#F4F5F7
"
,
"
navigationBarTextStyle"
:
"#FFFFFF
"
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
},
...
...
take-order/pages/photo/detail.vue
View file @
63474fe0
<
template
>
<
template
>
<view
class=
"backView"
>
<view
class=
"backView"
>
<!--
<view
class=
"topView"
>
<view
class=
"topView"
>
text class="topTitle">示范照片 (
{{
currentNumber
}}
/
{{
totalNumber
}}
)
</text
<!--text class="topTitle">示范照片 (
{{
currentNumber
}}
/
{{
totalNumber
}}
)
</text-->
</view>
-->
</view>
<view
class=
"wrap"
>
<view
class=
"wrap"
>
<u-swiper
<u-swiper
@
click=
"imageClick"
@
click=
"imageClick"
@
change=
"changeSwipter"
@
change=
"changeSwipter"
img-mode=
"aspectFit"
img-mode=
"aspectFit"
bg-color=
"#000000"
bg-color=
"#333333"
height=
"100%"
:height=
"600"
:list=
"swiperList"
:list=
"swiperList"
:autoplay=
"false"
:autoplay=
"false"
:circular=
'false'
:circular=
'false'
mode=
"dot"
mode=
"dot"
:current=
"done_count"
:current=
"done_count"
></u-swiper>
></u-swiper>
</view>
</view>
<!--
<view
class=
"bottomView"
>
<view
class=
"bottomView"
>
<image
class=
"takeView"
:src=
"icon_gotake"
mode=
""
@
click=
"takeClick"
></image>
<image
class=
"takeView"
:src=
"icon_gotake"
mode=
""
@
click=
"takeClick"
></image>
<image
class=
"backIcon"
:src=
"icon_arrow_down"
mode=
""
@
click=
"backClick"
></image>
<image
class=
"backIcon"
:src=
"icon_arrow_down"
mode=
""
@
click=
"backClick"
></image>
</view>
-->
</view>
</view>
</view>
</
template
>
</
template
>
...
@@ -44,12 +43,12 @@
...
@@ -44,12 +43,12 @@
current_image
:
''
,
current_image
:
''
,
done_count
:
0
,
done_count
:
0
,
images
:[],
images
:[],
//
icon_gotake:'https://qn-static.banshouhui.com/gotake.png',
icon_gotake
:
'https://qn-static.banshouhui.com/gotake.png'
,
//
icon_arrow_down:'https://qn-static.banshouhui.com/arrow_down.png',
icon_arrow_down
:
'https://qn-static.banshouhui.com/arrow_down.png'
,
//
ifFirst:true,
ifFirst
:
true
,
//
last_done_count:0,
last_done_count
:
0
,
swiperList
:[],
swiperList
:[],
//
windowHeight:0,
windowHeight
:
0
,
title
:
''
title
:
''
}
}
},
},
...
@@ -80,14 +79,14 @@
...
@@ -80,14 +79,14 @@
this
.
initData
(
e
)
this
.
initData
(
e
)
},
},
//
onShow(){
onShow
(){
//
if(this.isFirst == false){
if
(
this
.
isFirst
==
false
){
//
this.checkDoneCount()
this
.
checkDoneCount
()
//
}
}
//
},
},
methods
:
{
methods
:
{
initData
:
function
(
e
)
{
initData
:
function
(
e
)
{
...
@@ -101,11 +100,11 @@
...
@@ -101,11 +100,11 @@
}
}
if
(
e
&&
e
.
current_count
){
if
(
e
&&
e
.
current_count
){
this
.
done_count
=
Math
.
max
(
e
.
current_count
-
1
,
0
)
this
.
done_count
=
e
.
current_count
}
}
if
(
e
&&
e
.
current_count
){
if
(
e
&&
e
.
current_count
){
this
.
current_count
=
e
.
current_count
this
.
current_count
=
Math
.
max
(
e
.
current_count
-
1
,
0
)
}
}
if
(
e
&&
e
.
images
){
if
(
e
&&
e
.
images
){
...
@@ -115,14 +114,16 @@
...
@@ -115,14 +114,16 @@
if
(
e
&&
e
.
title
){
if
(
e
&&
e
.
title
){
this
.
title
=
e
.
title
this
.
title
=
e
.
title
if
(
this
.
title
.
length
>
5
){
if
(
this
.
title
.
length
>
6
){
this
.
title
=
this
.
title
.
substr
(
0
,
5
)
+
'...'
this
.
title
=
this
.
title
.
substr
(
0
,
6
)
+
'...'
}
}
}
}
uni
.
setNavigationBarTitle
({
uni
.
setNavigationBarTitle
({
title
:
this
.
title
+
'('
+
this
.
current_count
+
'/'
+
this
.
image_count
+
')'
title
:
this
.
title
+
'
('
+
this
.
current_count
+
'/'
+
this
.
image_count
+
')'
})
})
uni
.
setNavigationBarColor
({
uni
.
setNavigationBarColor
({
...
@@ -131,75 +132,75 @@
...
@@ -131,75 +132,75 @@
})
})
},
},
//
//
检查已拍照数量
//检查已拍照数量
//
checkDoneCount: function (){
checkDoneCount
:
function
(){
//
let pages = getCurrentPages();
let
pages
=
getCurrentPages
();
//
let currPage = pages[pages.length-1];
let
currPage
=
pages
[
pages
.
length
-
1
];
//
this.done_count = currPage.data.done_count
this
.
done_count
=
currPage
.
data
.
done_count
//
console.log('是否清除:')
console
.
log
(
'是否清除:'
)
//
//console.log(currPage.data.isClean)
//console.log(currPage.data.isClean)
//
if (currPage.data.done_count == this.image_count){
if
(
currPage
.
data
.
done_count
==
this
.
image_count
){
//
console.log('已拍完 所有数量照片')
console
.
log
(
'已拍完 所有数量照片'
)
//
uni.showToast({
uni
.
showToast
({
//
icon:'none',
icon
:
'none'
,
//
title:'已拍完此项照片'
title
:
'已拍完此项照片'
//
})
})
//
setTimeout(function() {
setTimeout
(
function
()
{
//
uni.navigateBack({
uni
.
navigateBack
({
//
})
})
//
}, 2000);
},
2000
);
//
}else{
}
else
{
//
if(this.done_count != this.last_done_count ){
if
(
this
.
done_count
!=
this
.
last_done_count
){
//
console.log('没有拍完 所有数量照片')
console
.
log
(
'没有拍完 所有数量照片'
)
//
this.last_done_count = this.done_count
this
.
last_done_count
=
this
.
done_count
//
this.current_count = currPage.data.done_count + 1
this
.
current_count
=
currPage
.
data
.
done_count
+
1
//
this.current_image = this.images[currPage.data.done_count]
this
.
current_image
=
this
.
images
[
currPage
.
data
.
done_count
]
//
console.log('没有拍完 所有数量照片 current_count:'+this.current_count)
console
.
log
(
'没有拍完 所有数量照片 current_count:'
+
this
.
current_count
)
//
console.log('没有拍完 所有数量照片 current_image:'+this.current_image)
console
.
log
(
'没有拍完 所有数量照片 current_image:'
+
this
.
current_image
)
//
uni.setNavigationBarTitle({
uni
.
setNavigationBarTitle
({
// title: this.title + '
(' + this.current_count + '/'+ this.image_count + ')'
title
:
this
.
title
+
'
('
+
this
.
current_count
+
'/'
+
this
.
image_count
+
')'
//
})
})
//
}
}
//
}
}
//
},
},
//照片预览
//照片预览
imageClick
:
function
(
index
)
{
imageClick
:
function
(
index
)
{
let
currentImg
=
this
.
images
[
index
]
let
currentImg
=
this
.
images
[
index
]
uni
.
previewImage
({
uni
.
previewImage
({
urls
:
this
.
images
,
urls
:
[
currentImg
]
,
current
:
index
current
:
index
})
})
},
},
changeSwipter
(
index
){
changeSwipter
(
index
){
let
txt
=
this
.
title
+
'
('
+
(
index
+
1
)
+
'/'
+
this
.
image_count
+
')'
let
txt
=
'走线照片
('
+
(
index
+
1
)
+
'/'
+
this
.
image_count
+
')'
uni
.
setNavigationBarTitle
({
uni
.
setNavigationBarTitle
({
title
:
txt
title
:
txt
})
})
},
},
//
//
拍照 点击
//拍照 点击
//
takeClick: function () {
takeClick
:
function
()
{
//
this.isFirst = false
this
.
isFirst
=
false
//
uni.navigateTo({
uni
.
navigateTo
({
//
url:'/pages/photo/try'
url
:
'/pages/photo/try'
//
})
})
//
},
},
//
//
返回 点击
//返回 点击
//
backClick: function () {
backClick
:
function
()
{
//
uni.navigateBack({
uni
.
navigateBack
({
//
})
})
//
},
},
}
}
...
@@ -209,13 +210,12 @@
...
@@ -209,13 +210,12 @@
<
style
>
<
style
>
.wrap
{
.wrap
{
width
:
100%
;
width
:
100%
;
/* height:calc(100vh - 600rpx); */
height
:
calc
(
100vh
-
600
rpx
);
height
:
100%
;
background-color
:
#333
;
background-color
:
#000000
;
/* padding:0 40rpx; */
/* padding:0 40rpx; */
}
}
.backView
{
.backView
{
background-color
:
#F
4F5F7
;
background-color
:
#F
AFAFA
;
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
left
:
0
;
left
:
0
;
...
@@ -226,11 +226,7 @@
...
@@ -226,11 +226,7 @@
align-items
:
center
;
align-items
:
center
;
}
}
.u-swiper-wrap
{
.topView
{
height
:
100%
;
}
/*.topView{
background-color
:
#333333
;
background-color
:
#333333
;
width
:
100%
;
width
:
100%
;
height
:
12%
;
height
:
12%
;
...
@@ -295,5 +291,5 @@
...
@@ -295,5 +291,5 @@
left
:
60
rpx
;
left
:
60
rpx
;
bottom
:
50
rpx
;
bottom
:
50
rpx
;
}
}
*/
</
style
>
</
style
>
take-order/pages/photo/list.vue
View file @
63474fe0
...
@@ -100,17 +100,6 @@
...
@@ -100,17 +100,6 @@
this
.
dataList
=
res
.
result
this
.
dataList
=
res
.
result
// this.dataList.forEach(item => {
// item.list.forEach(subItem => {
// subItem.isClicked = false
// })
// })
console
.
log
(
'添加 新字段 后的数组:'
)
console
.
log
(
this
.
dataList
)
var
item
=
res
.
result
[
0
]
var
item
=
res
.
result
[
0
]
this
.
rightList
=
item
.
list
this
.
rightList
=
item
.
list
},
},
...
@@ -127,13 +116,17 @@
...
@@ -127,13 +116,17 @@
// 点击图片
// 点击图片
handleClickImage
(
item
,
image
,
index
)
{
handleClickImage
(
item
,
image
,
index
)
{
uni
.
navigateTo
({
// uni.navigateTo({
url
:
'/pages/photo/detail'
+
// url: '/pages/photo/detail' +
'?current_image='
+
image
+
// '?current_image=' + image +
'&image_count='
+
item
.
images
.
length
+
// '&image_count=' + item.images.length +
'¤t_count='
+
(
index
+
1
)
+
// '¤t_count=' + (index + 1) +
'&images='
+
JSON
.
stringify
(
item
.
images
)
+
// '&images=' + JSON.stringify(item.images) +
'&title='
+
item
.
name
,
// '&title=' + item.name,
// })
uni
.
previewImage
({
urls
:
item
.
images
,
current
:
index
})
})
},
},
...
...
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