Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
U
uni-pdtravel
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
panyongping
uni-pdtravel
Commits
e51186ea
Commit
e51186ea
authored
Aug 07, 2023
by
qipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
图片保存
parent
d3e48898
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
127 additions
and
17 deletions
+127
-17
purchasedPhotoAlbum.vue
pages/album/purchasedPhotoAlbum/purchasedPhotoAlbum.vue
+127
-17
No files found.
pages/album/purchasedPhotoAlbum/purchasedPhotoAlbum.vue
View file @
e51186ea
...
@@ -18,12 +18,19 @@
...
@@ -18,12 +18,19 @@
</view>
</view>
<!--主体循环-->
<!--主体循环-->
<
view
class=
"album-subject
"
>
<
template
v-for=
"(item,index) in previewData
"
>
<view
class=
"su
bject-List"
v-for=
"(item,index) in previewData"
:key=
"index"
>
<view
class=
"su
ject-lable"
:key=
"index"
>
<image
class=
"list-image"
:src=
"item.faceSourceUrl"
@
click=
"stopPhoto(index)
"
></image>
<image
src=
"../static/album/icon01.png
"
></image>
<
u-checkbox
v-model=
"item.checkType"
v-if=
"checkTypeFun==true"
@
click
.
stop
.
native=
"()=>
{}" @change="stopPhoto(index)" shape="circle" class="list-uCheck">
</u-checkbox
>
<
view>
{{
item
.
merchantName
}}
</view
>
</view>
</view>
<view
class=
"album-subject"
:key=
"index"
>
<view
class=
"subject-List"
v-for=
"(item2,index2) in item.list"
:key=
"index2"
>
<image
class=
"list-image"
:src=
"item2.faceSourceUrl||item2.faceAiUrl"
@
click=
"stopPhoto(index,index2)"
></image>
<u-checkbox
v-model=
"item2.checkType"
v-if=
"checkTypeFun==true"
@
click
.
stop
.
native=
"()=>
{}" @change="stopPhoto(index,index2)" shape="circle" class="list-uCheck">
</u-checkbox>
</view>
</view>
</view>
</
template
>
<!--脚部-->
<!--脚部-->
<view
class=
"album-bottom"
>
<view
class=
"album-bottom"
>
<view
class=
"bottom-left"
v-if=
"maskDetail==false"
>
<view
class=
"bottom-left"
v-if=
"maskDetail==false"
>
...
@@ -95,6 +102,8 @@ export default {
...
@@ -95,6 +102,8 @@ export default {
favorablePrice
:
0
,
//优惠
favorablePrice
:
0
,
//优惠
priceNum
:
0
,
//选购了多少照片
priceNum
:
0
,
//选购了多少照片
options
:{},
//参数
options
:{},
//参数
imgList
:[],
//下载图片列表
downImgNumber
:
0
,
//下载图片的数量
}
}
},
},
onLoad
(
option
)
{
onLoad
(
option
)
{
...
@@ -145,9 +154,9 @@ export default {
...
@@ -145,9 +154,9 @@ export default {
if
(
res
.
code
==
'00'
){
if
(
res
.
code
==
'00'
){
this
.
previewData
=
res
.
data
this
.
previewData
=
res
.
data
this
.
previewData
.
forEach
((
item
,
index
)
=>
{
this
.
previewData
.
forEach
((
item
,
index
)
=>
{
item
[
'checkType'
]
=
false
item
.
list
.
forEach
((
item2
,
index2
)
=>
{
this
.
originalPrice
=
item
.
originalPrice
//原价.
item2
[
'checkType'
]
=
false
this
.
sellingPrice
=
item
.
sellingPrice
//售价
})
})
})
}
else
{
}
else
{
this
.
$refs
.
uToast
.
show
({
this
.
$refs
.
uToast
.
show
({
...
@@ -173,14 +182,14 @@ export default {
...
@@ -173,14 +182,14 @@ export default {
cancel2
()
{
//单列 点击取消
cancel2
()
{
//单列 点击取消
this
.
merchantShow
=
false
this
.
merchantShow
=
false
},
},
stopPhoto
(
index
){
//刷新显示
stopPhoto
(
index
,
index2
){
//刷新显示
if
(
this
.
checkProjectAll
==
true
){
if
(
this
.
checkProjectAll
==
true
){
this
.
checkProjectAll
=
false
this
.
checkProjectAll
=
false
}
}
if
(
this
.
previewData
[
index
].
checkType
==
false
){
if
(
this
.
previewData
[
index
].
checkType
==
false
){
this
.
previewData
[
index
].
checkType
=
true
this
.
previewData
[
index
].
list
[
index2
].
checkType
=
true
}
else
{
}
else
{
this
.
previewData
[
index
].
checkType
=
false
this
.
previewData
[
index
].
list
[
index2
].
checkType
=
false
}
}
this
.
checkTypeFun
=
false
this
.
checkTypeFun
=
false
this
.
checkTypeFun
=
true
this
.
checkTypeFun
=
true
...
@@ -189,17 +198,101 @@ export default {
...
@@ -189,17 +198,101 @@ export default {
if
(
this
.
checkProjectAll
==
true
){
if
(
this
.
checkProjectAll
==
true
){
this
.
checkProjectAll
=
false
this
.
checkProjectAll
=
false
this
.
previewData
.
forEach
((
item
,
index
)
=>
{
this
.
previewData
.
forEach
((
item
,
index
)
=>
{
item
.
checkType
=
false
item
.
list
.
forEach
((
item2
,
index2
)
=>
{
item2
.
checkType
=
false
})
})
})
}
else
{
}
else
{
this
.
checkProjectAll
=
true
this
.
checkProjectAll
=
true
this
.
previewData
.
forEach
((
item
,
index
)
=>
{
this
.
previewData
.
forEach
((
item
,
index
)
=>
{
item
.
checkType
=
true
item
.
list
.
forEach
((
item2
,
index2
)
=>
{
item2
.
checkType
=
true
})
})
})
}
}
},
},
upLoad
(){
//下单
upLoad
(){
//下单
this
.
previewData
.
forEach
((
item
,
index
)
=>
{
item
.
list
.
forEach
((
item2
,
index2
)
=>
{
var
imgUrl
=
item2
.
faceSourceUrl
||
item2
.
faceAiUrl
this
.
imgList
.
push
(
imgUrl
)
})
})
this
.
download
()
},
//---点击下载
download
(){
this
.
downImgNumber
=
0
this
.
imgList
.
forEach
(
item
=>
{
this
.
downloadFun
(
item
)
})
},
//---下载方法
downloadFun
(
imgUrl
)
{
uni
.
showLoading
({
title
:
'下载中'
,
mask
:
true
})
let
fileName
=
new
Date
().
getTime
()
uni
.
downloadFile
({
//下载文件资源到本地
url
:
imgUrl
,
filePath
:
wx
.
env
.
USER_DATA_PATH
+
'/'
+
fileName
+
'.jpg'
,
//filePath指定文件下载后存储的路径,wx.env.USER_DATA_PATH,时间戳为文件名
success
:
res
=>
{
//下载到本地成功
if
(
res
.
statusCode
==
200
){
let
filePath
=
res
.
filePath
uni
.
saveImageToPhotosAlbum
({
//保存图片到系统相册。
filePath
,
success
:
file
=>
{
//保存成功
this
.
downImgNumber
+=
1
if
(
this
.
downImgNumber
==
this
.
imgList
.
length
){
uni
.
showToast
({
title
:
'下载成功'
,
icon
:
'success'
,
mask
:
true
})
}
},
fail
:
err
=>
{
uni
.
hideLoading
()
this
.
getPermissions
(
err
)
}
})
}
},
fail
:
err
=>
{
//下载失败
uni
.
hideLoading
()
uni
.
showToast
({
title
:
'下载失败'
,
icon
:
'none'
,
mask
:
true
})
}
})
},
//---获取授权
getPermissions
(
err
){
//拒绝授权时显示
if
(
err
.
errMsg
.
includes
(
'fail auth deny'
))
{
uni
.
showModal
({
title
:
'提示'
,
content
:
'需要您授权保存相册'
,
showCancel
:
false
,
success
:
data
=>
{
//打开权限设置
uni
.
openSetting
({
success
:
setting
=>
{
if
(
!
setting
.
authSetting
[
'scope.writePhotosAlbum'
])
{
uni
.
showModal
({
title
:
'提示'
,
content
:
'获取权限失败无法保存到相册'
,
showCancel
:
false
,
})
}
},
})
}
})
}
},
},
}
}
}
}
...
@@ -217,7 +310,7 @@ export default {
...
@@ -217,7 +310,7 @@ export default {
height
:
100%
;
height
:
100%
;
background-color
:
#F7F7F7
;
background-color
:
#F7F7F7
;
padding-bottom
:
98rpx
;
padding-bottom
:
98rpx
;
padding-top
:
1
7
4rpx
;
padding-top
:
1
4
4rpx
;
overflow
:
auto
;
overflow
:
auto
;
}
}
...
@@ -262,7 +355,23 @@ export default {
...
@@ -262,7 +355,23 @@ export default {
display
:
none
;
display
:
none
;
}
}
.suject-lable
{
display
:
flex
;
height
:
44rpx
;
margin-bottom
:
24rpx
;
padding
:
0
24rpx
0
24rpx
;
image
{
display
:
block
;
width
:
32rpx
;
height
:
32rpx
;
margin
:
6rpx
6rpx
0
0
;
}
view
{
font-size
:
32rpx
;
color
:
#333333
;
line-height
:
44rpx
;
}
}
.album-subject
{
.album-subject
{
display
:
flex
;
display
:
flex
;
flex-wrap
:
wrap
;
flex-wrap
:
wrap
;
...
@@ -323,6 +432,7 @@ export default {
...
@@ -323,6 +432,7 @@ export default {
display
:
flex
;
display
:
flex
;
line-height
:
98rpx
;
line-height
:
98rpx
;
.album-checkAll
{
.album-checkAll
{
display
:
flex
;
width
:
100%
;
width
:
100%
;
height
:
98rpx
;
height
:
98rpx
;
padding
:
0rpx
24rpx
0
0rpx
;
padding
:
0rpx
24rpx
0
0rpx
;
...
...
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