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
7f8864fd
Commit
7f8864fd
authored
Aug 02, 2023
by
qipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
照片价格计算
parent
f108024e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
21 deletions
+52
-21
myPhotoAlbum.vue
pages/album/myPhotoAlbum/myPhotoAlbum.vue
+52
-21
No files found.
pages/album/myPhotoAlbum/myPhotoAlbum.vue
View file @
7f8864fd
...
@@ -31,29 +31,29 @@
...
@@ -31,29 +31,29 @@
<view
class=
"album-subject"
>
<view
class=
"album-subject"
>
<view
class=
"subject-List"
v-for=
"(item,index) in previewData"
:key=
"index"
@
click=
"projectCheckPhoto(index)"
>
<view
class=
"subject-List"
v-for=
"(item,index) in previewData"
:key=
"index"
@
click=
"projectCheckPhoto(index)"
>
<image
class=
"list-image"
:src=
"item.faceSourceUrl"
></image>
<image
class=
"list-image"
:src=
"item.faceSourceUrl"
></image>
<u-checkbox
v-model=
"item.checkType"
v-if=
"checkTypeFun==true"
@
click
.
stop
.
native=
"()=>
{}" @change="stopPhoto(
$event
)" shape="circle" class="list-uCheck">
</u-checkbox>
<u-checkbox
v-model=
"item.checkType"
v-if=
"checkTypeFun==true"
@
click
.
stop
.
native=
"()=>
{}" @change="stopPhoto(
index
)" shape="circle" class="list-uCheck">
</u-checkbox>
<view
class=
"list-mask"
>
预览
</view>
<view
class=
"list-mask"
>
预览
</view>
</view>
</view>
</view>
</view>
<!--脚部-->
<!--脚部-->
<view
class=
"album-bottom"
>
<view
class=
"album-bottom"
>
<view
class=
"bottom-left"
v-if=
"maskDetail==false"
>
<view
class=
"bottom-left"
v-if=
"maskDetail==false"
>
<view
class=
"left-oldMoney"
>
¥
15.00
</view>
<view
class=
"left-oldMoney"
>
¥
{{
originalPrice
}}
</view>
<view
class=
"left-newMoney"
>
¥
10.00
</view>
<view
class=
"left-newMoney"
>
¥
{{
sellingPrice
}}
</view>
<view
class=
"left-detail"
@
click=
"maskDetail=true"
>
<view
class=
"left-detail"
@
click=
"maskDetail=true"
>
<text>
明细
</text>
<text>
明细
</text>
<u-icon
name=
"arrow-up"
></u-icon>
<u-icon
name=
"arrow-up"
></u-icon>
</view>
</view>
<view
class=
"left-num"
>
1
</view>
<view
class=
"left-num"
v-if=
"priceNum>0"
>
{{
priceNum
}}
</view>
<view
class=
"left-mask"
>
<view
class=
"left-mask"
v-if=
"priceNum>0"
>
多够更省
多够更省
<view
class=
"mask-transparent"
></view>
<view
class=
"mask-transparent"
></view>
</view>
</view>
</view>
</view>
<view
class=
"bottom-Detail"
v-if=
"maskDetail==true"
>
<view
class=
"bottom-Detail"
v-if=
"maskDetail==true"
>
<view
class=
"detail-total"
>
合计:¥
8.00
</view>
<view
class=
"detail-total"
>
合计:¥
{{
sellingPrices
}}
</view>
<view
class=
"detail-favorable"
>
优惠减:¥
2.00
</view>
<view
class=
"detail-favorable"
>
优惠减:¥
{{
favorablePrice
}}
</view>
</view>
</view>
<view
class=
"bootom-btn"
>
去下载
</view>
<view
class=
"bootom-btn"
>
去下载
</view>
</view>
</view>
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
</
template
>
</
template
>
</view>
</view>
<view
class=
"maskPreview-check"
v-if=
"checkTypeFun==true"
>
<view
class=
"maskPreview-check"
v-if=
"checkTypeFun==true"
>
<u-checkbox
v-model=
"previewData[previewNum].checkType"
@
click
.
stop
.
native=
"()=>{}"
@
change=
"stopPhoto(
$event
)"
shape=
"circle"
class=
"maskPreview-Check"
></u-checkbox>
<u-checkbox
v-model=
"previewData[previewNum].checkType"
@
click
.
stop
.
native=
"()=>{}"
@
change=
"stopPhoto(
previewNum
)"
shape=
"circle"
class=
"maskPreview-Check"
></u-checkbox>
</view>
</view>
</view>
</view>
<!--明细-->
<!--明细-->
...
@@ -88,14 +88,15 @@
...
@@ -88,14 +88,15 @@
<view
class=
"content-label"
>
我的相片
</view>
<view
class=
"content-label"
>
我的相片
</view>
<view
class=
"content-money"
>
<view
class=
"content-money"
>
<view
class=
"money-name"
>
相片
</view>
<view
class=
"money-name"
>
相片
</view>
<view
class=
"money-text"
>
1*10.00=10.00
</view>
<view
class=
"money-text"
>
{{priceNum}}*{{sellingPrice}}={{sellingPrices}}
</view>
</view>
</view>
<view
class=
"content-favorable"
>
<view
class=
"content-favorable"
>
<view
class=
"favorable-name"
>
优惠
</view>
<view
class=
"favorable-name"
>
优惠
</view>
<view
class=
"favorable-text"
>
-¥
2.00
</view>
<view
class=
"favorable-text"
>
-¥
{{favorablePrice}}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<u-toast
ref=
"uToast"
/>
</view>
</view>
</template>
</template>
...
@@ -103,11 +104,13 @@
...
@@ -103,11 +104,13 @@
import
uPicker
from
'@/uview-ui/components/u-picker/u-picker.vue'
import
uPicker
from
'@/uview-ui/components/u-picker/u-picker.vue'
import
uCheckboxGroup
from
'@/uview-ui/components/u-checkbox-group/u-checkbox-group.vue'
import
uCheckboxGroup
from
'@/uview-ui/components/u-checkbox-group/u-checkbox-group.vue'
import
uCheckbox
from
'@/uview-ui/components/u-checkbox/u-checkbox'
import
uCheckbox
from
'@/uview-ui/components/u-checkbox/u-checkbox'
import
uToast
from
'@/uview-ui/components/u-toast/u-toast.vue'
export
default
{
export
default
{
components
:
{
components
:
{
uPicker
,
uPicker
,
uCheckboxGroup
,
uCheckboxGroup
,
uCheckbox
,
uCheckbox
,
uToast
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -144,14 +147,20 @@ export default {
...
@@ -144,14 +147,20 @@ export default {
touchRight
:
0
,
touchRight
:
0
,
touchType
:
0
,
//向左0++ 向右1--
touchType
:
0
,
//向左0++ 向右1--
//左右滑动 监听结束
//左右滑动 监听结束
originalPrice
:
0
,
//原价单价
originalPrices
:
0
,
//原价
sellingPrice
:
0
,
//售价单价
sellingPrices
:
0
,
//售价
favorablePrice
:
0
,
//优惠
priceNum
:
0
,
//选购了多少照片
}
}
},
},
onLoad
(
option
)
{
onLoad
(
option
)
{
this
.
openid
=
uni
.
getStorageSync
(
'openid'
)
//获取openid
this
.
openid
=
uni
.
getStorageSync
(
'openid'
)
//获取openid
console
.
log
(
option
)
this
.
faceIds
=
JSON
.
parse
(
option
.
faceIds
)
this
.
faceIds
=
JSON
.
parse
(
option
.
faceIds
)
this
.
location
=
JSON
.
parse
(
uni
.
getStorageSync
(
'location'
))
this
.
location
=
JSON
.
parse
(
uni
.
getStorageSync
(
'location'
))
this
.
merchantId
=
uni
.
getStorageSync
(
'merchantId'
)
this
.
merchantId
=
'z0015605022691a5945bbe463141668c'
//
uni.getStorageSync('merchantId')
this
.
obtainProvince
()
//获取省市区
this
.
obtainProvince
()
//获取省市区
this
.
inquireMerchant
()
//查询所有商户
this
.
inquireMerchant
()
//查询所有商户
this
.
getPhotos
()
//照片列表
this
.
getPhotos
()
//照片列表
...
@@ -166,7 +175,7 @@ export default {
...
@@ -166,7 +175,7 @@ export default {
this
.
option
=
res
.
data
this
.
option
=
res
.
data
}
else
{
}
else
{
this
.
$refs
.
uToast
.
show
({
this
.
$refs
.
uToast
.
show
({
title
:
re
t
.
message
,
title
:
re
s
.
message
,
type
:
'error'
,
type
:
'error'
,
})
})
}
}
...
@@ -186,7 +195,7 @@ export default {
...
@@ -186,7 +195,7 @@ export default {
this
.
merchantList
=
res
.
data
this
.
merchantList
=
res
.
data
}
else
{
}
else
{
this
.
$refs
.
uToast
.
show
({
this
.
$refs
.
uToast
.
show
({
title
:
re
t
.
message
,
title
:
re
s
.
message
,
type
:
'error'
,
type
:
'error'
,
})
})
}
}
...
@@ -203,10 +212,12 @@ export default {
...
@@ -203,10 +212,12 @@ export default {
this
.
previewData
=
res
.
data
this
.
previewData
=
res
.
data
this
.
previewData
.
forEach
((
item
,
index
)
=>
{
this
.
previewData
.
forEach
((
item
,
index
)
=>
{
item
[
'checkType'
]
=
false
item
[
'checkType'
]
=
false
this
.
originalPrice
=
item
.
originalPrice
//原价.
this
.
sellingPrice
=
item
.
sellingPrice
//售价
})
})
}
else
{
}
else
{
this
.
$refs
.
uToast
.
show
({
this
.
$refs
.
uToast
.
show
({
title
:
re
t
.
message
,
title
:
re
s
.
message
,
type
:
'error'
,
type
:
'error'
,
})
})
}
}
...
@@ -229,12 +240,19 @@ export default {
...
@@ -229,12 +240,19 @@ export default {
this
.
previewNum
=
index
this
.
previewNum
=
index
this
.
maskPreviewType
=
true
this
.
maskPreviewType
=
true
},
},
stopPhoto
(){
//刷新显示
stopPhoto
(
index
){
//刷新显示
if
(
this
.
checkProjectAll
==
true
){
this
.
checkProjectAll
=
false
}
if
(
this
.
previewData
[
index
].
checkType
==
false
){
this
.
previewData
[
index
].
checkType
=
true
}
else
{
this
.
previewData
[
index
].
checkType
=
false
}
this
.
checkTypeFun
=
false
this
.
checkTypeFun
=
false
this
.
checkTypeFun
=
true
this
.
checkTypeFun
=
true
if
(
this
.
checkProjectAll
==
true
){
this
.
checkProjectAll
=
false
this
.
checkMonkey
()
}
},
},
checkProjectAllFun
(){
//是否全选
checkProjectAllFun
(){
//是否全选
if
(
this
.
checkProjectAll
==
true
){
if
(
this
.
checkProjectAll
==
true
){
...
@@ -248,7 +266,20 @@ export default {
...
@@ -248,7 +266,20 @@ export default {
item
.
checkType
=
true
item
.
checkType
=
true
})
})
}
}
this
.
checkMonkey
()
},
checkMonkey
(){
//明细价格计算
this
.
originalPrices
=
0
//原价
this
.
sellingPrices
=
0
//售价
this
.
priceNum
=
0
this
.
previewData
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
checkType
==
true
){
this
.
originalPrices
+=
item
.
originalPrice
//原价
this
.
sellingPrices
+=
item
.
sellingPrice
//售价
this
.
priceNum
++
}
})
},
},
projectMoreFun
()
{
//更多产品显示
projectMoreFun
()
{
//更多产品显示
if
(
this
.
projectMoreType
==
false
)
{
if
(
this
.
projectMoreType
==
false
)
{
...
@@ -566,7 +597,7 @@ export default {
...
@@ -566,7 +597,7 @@ export default {
border-radius
:
28rpx
;
border-radius
:
28rpx
;
opacity
:
0
.5
;
opacity
:
0
.5
;
position
:
absolute
;
position
:
absolute
;
left
:
35
0rpx
;
left
:
23
0rpx
;
top
:
-24rpx
;
top
:
-24rpx
;
z-index
:
23
;
z-index
:
23
;
...
...
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