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
2cb5a458
Commit
2cb5a458
authored
Dec 30, 2020
by
和慭琛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
准备提测版
parent
8134a94e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
18 deletions
+103
-18
pages.json
take-order/pages.json
+9
-6
detail.vue
take-order/pages/photo/detail.vue
+41
-0
list.vue
take-order/pages/photo/list.vue
+3
-1
try.vue
take-order/pages/photo/try.vue
+50
-11
No files found.
take-order/pages.json
View file @
2cb5a458
...
@@ -5,7 +5,15 @@
...
@@ -5,7 +5,15 @@
},
},
*/
*/
"pages"
:
[
//pages数组中第一项表示应用启动页,参考:https
:
//uniapp.dcloud.io/collocation/pages
"pages"
:
[
//pages数组中第一项表示应用启动页,参考:https
:
//uniapp.dcloud.io/collocation/pages
{
"path"
:
"pages/photo/product"
,
"style"
:
{
"navigationBarTitleText"
:
"选择产品"
}
},
{
{
"path"
:
"pages/photo/try"
,
"path"
:
"pages/photo/try"
,
"style"
:
{
"style"
:
{
...
@@ -13,12 +21,7 @@
...
@@ -13,12 +21,7 @@
}
}
},
},
{
"path"
:
"pages/photo/product"
,
"style"
:
{
"navigationBarTitleText"
:
"选择产品"
}
},
{
{
"path"
:
"pages/photo/detail"
,
"path"
:
"pages/photo/detail"
,
...
...
take-order/pages/photo/detail.vue
View file @
2cb5a458
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
image_count
:
1
,
image_count
:
1
,
current_count
:
1
,
current_count
:
1
,
current_image
:
''
,
current_image
:
''
,
done_count
:
0
,
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'
,
}
}
...
@@ -27,6 +29,11 @@
...
@@ -27,6 +29,11 @@
onLoad
(
e
)
{
onLoad
(
e
)
{
this
.
initData
(
e
)
this
.
initData
(
e
)
},
},
onShow
(){
this
.
checkDoneCount
()
},
methods
:
{
methods
:
{
initData
:
function
(
e
)
{
initData
:
function
(
e
)
{
...
@@ -43,6 +50,12 @@
...
@@ -43,6 +50,12 @@
this
.
current_count
=
e
.
current_count
this
.
current_count
=
e
.
current_count
}
}
if
(
e
&&
e
.
images
){
this
.
images
=
JSON
.
parse
(
e
.
images
)
console
.
log
(
'images:'
)
console
.
log
(
this
.
images
)
}
uni
.
setNavigationBarTitle
({
uni
.
setNavigationBarTitle
({
title
:
'走线照片 ('
+
this
.
current_count
+
'/'
+
this
.
image_count
+
')'
title
:
'走线照片 ('
+
this
.
current_count
+
'/'
+
this
.
image_count
+
')'
})
})
...
@@ -53,6 +66,34 @@
...
@@ -53,6 +66,34 @@
})
})
},
},
//检查已拍照数量
checkDoneCount
:
function
(){
let
pages
=
getCurrentPages
();
let
currPage
=
pages
[
pages
.
length
-
1
];
console
.
log
(
'是否清除:'
)
//console.log(currPage.data.isClean)
if
(
currPage
.
data
.
done_count
==
this
.
image_count
){
console
.
log
(
'已拍完 所有数量照片'
)
uni
.
showToast
({
icon
:
'none'
,
title
:
'已拍完所有照片'
})
setTimeout
(
function
()
{
uni
.
navigateBack
({
})
},
2000
);
}
else
{
console
.
log
(
'没有拍完 所有数量照片'
)
this
.
current_count
=
currPage
.
data
.
done_count
this
.
current_image
=
this
.
images
[
currPage
.
data
.
done_count
]
}
},
//照片预览
//照片预览
imageClick
:
function
(
image
)
{
imageClick
:
function
(
image
)
{
uni
.
previewImage
({
uni
.
previewImage
({
...
...
take-order/pages/photo/list.vue
View file @
2cb5a458
...
@@ -99,11 +99,13 @@
...
@@ -99,11 +99,13 @@
//右侧点击
//右侧点击
rightItemClick
:
function
(
item
,
ikey
)
{
rightItemClick
:
function
(
item
,
ikey
)
{
var
current_image
=
item
.
images
[
ikey
]
var
current_image
=
item
.
images
[
ikey
]
var
current_count
=
ikey
+
1
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
'/pages/photo/detail'
url
:
'/pages/photo/detail'
+
'?current_image='
+
current_image
+
'?current_image='
+
current_image
+
'&image_count='
+
item
.
image_count
+
'&image_count='
+
item
.
image_count
+
'¤t_count='
+
ikey
,
+
'¤t_count='
+
current_count
+
'&images='
+
JSON
.
stringify
(
item
.
images
)
,
})
})
},
},
...
...
take-order/pages/photo/try.vue
View file @
2cb5a458
...
@@ -153,15 +153,36 @@
...
@@ -153,15 +153,36 @@
this
.
canvas
.
draw
()
this
.
canvas
.
draw
()
//加入 水印文字
//加入 水印文字
this
.
canvas
.
setFontSize
(
1
8
)
this
.
canvas
.
setFontSize
(
1
2
)
this
.
canvas
.
setFillStyle
(
'#
8a2929
'
)
this
.
canvas
.
setFillStyle
(
'#
FFFFFF
'
)
//this.canvas.rotate(30 * Math.PI / 180);
//this.canvas.rotate(30 * Math.PI / 180);
let
textToWidth
=
res
.
width
*
0.5
;
//
let textToWidth = res.width * 0.5;
let
textToHeight
=
res
.
height
*
0.3
;
//
let textToHeight = res.height * 0.3;
this
.
canvas
.
fillText
(
'我是水印'
,
100
,
100
)
var
currentHeight
=
res
.
height
-
20
//加入 水印图片
//时间
this
.
canvas
.
drawImage
(
this
.
markPath
,
0
,
0
,
res
.
width
/
3
,
res
.
height
/
3
)
var
date
=
'时间:'
+
this
.
date
this
.
canvas
.
fillText
(
date
,
20
,
currentHeight
)
//地址
currentHeight
=
currentHeight
-
20
var
address
=
'地址:'
+
this
.
address
this
.
canvas
.
fillText
(
address
,
20
,
currentHeight
)
//纬度
currentHeight
=
currentHeight
-
20
var
latitude
=
'纬度:'
+
this
.
latitude
this
.
canvas
.
fillText
(
latitude
,
20
,
currentHeight
)
//经度
currentHeight
=
currentHeight
-
20
var
longitude
=
'经度:'
+
this
.
longitude
this
.
canvas
.
fillText
(
longitude
,
20
,
currentHeight
)
//加入 水印图片
let
mark_x
=
res
.
width
/
4
let
mark_y
=
res
.
height
/
2
this
.
canvas
.
drawImage
(
this
.
markPath
,
mark_x
,
mark_y
,
180
,
45
)
this
.
canvas
.
draw
()
this
.
canvas
.
draw
()
...
@@ -199,10 +220,10 @@
...
@@ -199,10 +220,10 @@
setTimeout
(
function
()
{
setTimeout
(
function
()
{
that
.
saveToLocal
(
ress
.
tempFilePath
)
that
.
saveToLocal
(
ress
.
tempFilePath
)
uni
.
previewImage
({
//
uni.previewImage({
urls
:
[
ress
.
tempFilePath
],
//
urls: [ress.tempFilePath],
current
:
0
//
current:0
});
//
});
...
@@ -228,13 +249,24 @@
...
@@ -228,13 +249,24 @@
//第五步: 保存到本地相册
//第五步: 保存到本地相册
saveToLocal
(
tempImagePath
)
{
saveToLocal
(
tempImagePath
)
{
let
that
=
this
uni
.
saveImageToPhotosAlbum
({
uni
.
saveImageToPhotosAlbum
({
filePath
:
tempImagePath
,
filePath
:
tempImagePath
,
success
()
{
success
()
{
console
.
log
(
'保存本地相册 成功'
)
console
.
log
(
'保存本地相册 成功'
)
uni
.
showToast
({
icon
:
'none'
,
title
:
'已将照片保存到本地相册'
})
that
.
goBack
()
},
},
fail
()
{
fail
()
{
console
.
log
(
'保存本地相册 失败'
)
console
.
log
(
'保存本地相册 失败'
)
uni
.
showToast
({
icon
:
'none'
,
title
:
'保存本地相册失败'
})
that
.
goBack
()
}
}
})
})
},
},
...
@@ -242,6 +274,13 @@
...
@@ -242,6 +274,13 @@
//第六步 返回上层界面
//第六步 返回上层界面
goBack
:
function
(){
goBack
:
function
(){
let
pages
=
getCurrentPages
();
let
prevPage
=
pages
[
pages
.
length
-
2
];
//上一个页面
prevPage
.
$vm
.
done_count
++
;
uni
.
navigateBack
({
})
},
},
//获取当前时间
//获取当前时间
...
...
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