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
Show 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 @@
<view
class=
"album-subject"
>
<view
class=
"subject-List"
v-for=
"(item,index) in previewData"
:key=
"index"
@
click=
"projectCheckPhoto(index)"
>
<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>
</view>
<!--脚部-->
<view
class=
"album-bottom"
>
<view
class=
"bottom-left"
v-if=
"maskDetail==false"
>
<view
class=
"left-oldMoney"
>
¥
15.00
</view>
<view
class=
"left-newMoney"
>
¥
10.00
</view>
<view
class=
"left-oldMoney"
>
¥
{{
originalPrice
}}
</view>
<view
class=
"left-newMoney"
>
¥
{{
sellingPrice
}}
</view>
<view
class=
"left-detail"
@
click=
"maskDetail=true"
>
<text>
明细
</text>
<u-icon
name=
"arrow-up"
></u-icon>
</view>
<view
class=
"left-num"
>
1
</view>
<view
class=
"left-mask"
>
<view
class=
"left-num"
v-if=
"priceNum>0"
>
{{
priceNum
}}
</view>
<view
class=
"left-mask"
v-if=
"priceNum>0"
>
多够更省
<view
class=
"mask-transparent"
></view>
</view>
</view>
<view
class=
"bottom-Detail"
v-if=
"maskDetail==true"
>
<view
class=
"detail-total"
>
合计:¥
8.00
</view>
<view
class=
"detail-favorable"
>
优惠减:¥
2.00
</view>
<view
class=
"detail-total"
>
合计:¥
{{
sellingPrices
}}
</view>
<view
class=
"detail-favorable"
>
优惠减:¥
{{
favorablePrice
}}
</view>
</view>
<view
class=
"bootom-btn"
>
去下载
</view>
</view>
...
...
@@ -75,7 +75,7 @@
</
template
>
</view>
<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>
<!--明细-->
...
...
@@ -88,14 +88,15 @@
<view
class=
"content-label"
>
我的相片
</view>
<view
class=
"content-money"
>
<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
class=
"content-favorable"
>
<view
class=
"favorable-name"
>
优惠
</view>
<view
class=
"favorable-text"
>
-¥
2.00
</view>
<view
class=
"favorable-text"
>
-¥
{{favorablePrice}}
</view>
</view>
</view>
</view>
<u-toast
ref=
"uToast"
/>
</view>
</template>
...
...
@@ -103,11 +104,13 @@
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
uCheckbox
from
'@/uview-ui/components/u-checkbox/u-checkbox'
import
uToast
from
'@/uview-ui/components/u-toast/u-toast.vue'
export
default
{
components
:
{
uPicker
,
uCheckboxGroup
,
uCheckbox
,
uToast
},
data
()
{
return
{
...
...
@@ -144,14 +147,20 @@ export default {
touchRight
:
0
,
touchType
:
0
,
//向左0++ 向右1--
//左右滑动 监听结束
originalPrice
:
0
,
//原价单价
originalPrices
:
0
,
//原价
sellingPrice
:
0
,
//售价单价
sellingPrices
:
0
,
//售价
favorablePrice
:
0
,
//优惠
priceNum
:
0
,
//选购了多少照片
}
},
onLoad
(
option
)
{
this
.
openid
=
uni
.
getStorageSync
(
'openid'
)
//获取openid
console
.
log
(
option
)
this
.
faceIds
=
JSON
.
parse
(
option
.
faceIds
)
this
.
location
=
JSON
.
parse
(
uni
.
getStorageSync
(
'location'
))
this
.
merchantId
=
uni
.
getStorageSync
(
'merchantId'
)
this
.
merchantId
=
'z0015605022691a5945bbe463141668c'
//
uni.getStorageSync('merchantId')
this
.
obtainProvince
()
//获取省市区
this
.
inquireMerchant
()
//查询所有商户
this
.
getPhotos
()
//照片列表
...
...
@@ -166,7 +175,7 @@ export default {
this
.
option
=
res
.
data
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
re
t
.
message
,
title
:
re
s
.
message
,
type
:
'error'
,
})
}
...
...
@@ -186,7 +195,7 @@ export default {
this
.
merchantList
=
res
.
data
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
re
t
.
message
,
title
:
re
s
.
message
,
type
:
'error'
,
})
}
...
...
@@ -203,10 +212,12 @@ export default {
this
.
previewData
=
res
.
data
this
.
previewData
.
forEach
((
item
,
index
)
=>
{
item
[
'checkType'
]
=
false
this
.
originalPrice
=
item
.
originalPrice
//原价.
this
.
sellingPrice
=
item
.
sellingPrice
//售价
})
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
re
t
.
message
,
title
:
re
s
.
message
,
type
:
'error'
,
})
}
...
...
@@ -229,12 +240,19 @@ export default {
this
.
previewNum
=
index
this
.
maskPreviewType
=
true
},
stopPhoto
(){
//刷新显示
this
.
checkTypeFun
=
false
this
.
checkTypeFun
=
true
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
=
true
this
.
checkMonkey
()
},
checkProjectAllFun
(){
//是否全选
if
(
this
.
checkProjectAll
==
true
){
...
...
@@ -248,6 +266,19 @@ export default {
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
()
{
//更多产品显示
...
...
@@ -566,7 +597,7 @@ export default {
border-radius
:
28rpx
;
opacity
:
0
.5
;
position
:
absolute
;
left
:
35
0rpx
;
left
:
23
0rpx
;
top
:
-24rpx
;
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