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
8cee6ef9
Commit
8cee6ef9
authored
Jul 21, 2023
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
影集项目新建
parent
11bf8463
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
227 additions
and
92 deletions
+227
-92
test.vue
pages/photos/test.vue
+8
-0
detail.vue
pages/scenic/scenicChooseProduct/components/detail.vue
+83
-2
scenicChooseProduct.vue
pages/scenic/scenicChooseProduct/scenicChooseProduct.vue
+136
-90
No files found.
pages/photos/test.vue
0 → 100644
View file @
8cee6ef9
<
template
>
</
template
>
<
script
>
</
script
>
<
style
>
</
style
>
\ No newline at end of file
pages/scenic/scenicChooseProduct/components/detail.vue
View file @
8cee6ef9
<
template
>
<
template
>
<!-- 详情 -->
<!-- 详情 -->
<u-popup
v-model=
"showPop"
mode=
"bottom"
border-radius=
"14"
closeable
height=
"85%"
>
<view
class=
"son-wrap"
>
<view
class=
"title"
>
明细
</view>
<view
class=
"middle"
>
</view>
<view
class=
"bottom"
>
<text
class=
"bottom-left"
>
<view></view>
<view></view>
</text>
<view
class=
"bottom-right"
>
<text
class=
"btn"
>
去预订
</text>
</view>
</view>
</view>
</u-popup>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
props
:
[
'chooseProduct'
],
data
()
{
return
{
showPop
:
false
,
//控制弹窗显示隐藏
}
},
methods
:
{
}
}
</
script
>
</
script
>
<
style
>
<
style
scoped=
"scoped"
>
.son-wrap
{
position
:
relative
;
}
.title
{
text-align
:
center
;
font-size
:
32
rpx
;
font-weight
:
bold
;
text-align
:
center
;
padding
:
30
rpx
0
;
position
:
fixed
;
top
:
0
;
width
:
100%
;
background
:
#fff
;
z-index
:
1
;
}
.middle
{
padding
:
100
rpx
24
rpx
0
24
rpx
;
}
.bottom
{
display
:
flex
;
justify-content
:
space-between
;
padding
:
0
24
rpx
;
height
:
100
rpx
;
align-items
:
center
;
position
:
fixed
;
bottom
:
0
;
width
:
100%
;
z-index
:
9
;
background
:
#FFFFFF
;
box-sizing
:
border-box
;
}
.bottom-left
{
color
:
#f9690e
;
}
.bottom-left
text
{
font-size
:
36
rpx
;
font-weight
:
bolder
;
}
.bottom
view
{
display
:
flex
;
align-items
:
center
;
}
.btn
{
padding
:
16
rpx
48
rpx
;
border-radius
:
20
rpx
;
font-size
:
32
rpx
;
}
</
style
>
</
style
>
pages/scenic/scenicChooseProduct/scenicChooseProduct.vue
View file @
8cee6ef9
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<swiper
:current=
"active"
@
animationfinish=
"animationfinish"
class=
"swiper-box"
>
<swiper
:current=
"active"
@
animationfinish=
"animationfinish"
class=
"swiper-box"
>
<swiper-item
class=
"swiper-item"
>
<swiper-item
class=
"swiper-item"
>
<scroll-view
scroll-y
style=
"height:100%;width: 100%;"
>
<scroll-view
scroll-y
style=
"height:100%;width: 100%;"
>
<checkbox-group
@
change=
"checkboxChange"
>
<view
class=
"merchant"
v-for=
"(item,index) in scenicList"
:key=
'index'
>
<view
class=
"merchant"
v-for=
"(item,index) in scenicList"
:key=
'index'
>
<view
class=
"merchant-title"
>
<view
class=
"merchant-title"
>
<view
class=
"title-left"
>
<view
class=
"title-left"
>
...
@@ -26,11 +27,11 @@
...
@@ -26,11 +27,11 @@
距您
{{
item
.
distance
?
parseFloat
((
item
.
distance
/
1000
).
toFixed
(
2
)):
0
}}
km
距您
{{
item
.
distance
?
parseFloat
((
item
.
distance
/
1000
).
toFixed
(
2
)):
0
}}
km
</view>
</view>
</view>
</view>
<checkbox-group
@
change=
"checkboxChange"
>
<label
v-for=
"(items,a) in item.productListCopy"
:key=
'a'
>
<label
v-for=
"(items,a) in item.productListCopy"
:key=
'a'
>
<view
class=
"product"
:class=
"
{'on':items.ifChoose}">
<view
class=
"product"
:class=
"
{'on':items.ifChoose}">
<view
class=
"product-left"
>
<view
class=
"product-left"
>
<checkbox
class=
"blue"
:disabled=
"items.status==2"
:value=
"JSON.stringify(items)
"
/>
<checkbox
class=
"blue"
:disabled=
"items.status==2"
:value=
"JSON.stringify(items)"
:checked=
"items.ifChecked
"
/>
</view>
</view>
<view
class=
"product-right"
>
<view
class=
"product-right"
>
...
@@ -65,7 +66,7 @@
...
@@ -65,7 +66,7 @@
</view>
</view>
</view>
</view>
</label>
</label>
</checkbox-group>
<view
class=
"product-more"
v-if=
"index>0&&item.productList.length>2"
>
<view
class=
"product-more"
v-if=
"index>0&&item.productList.length>2"
>
<view
v-if=
"item.productListCopy.length!=item.productList.length"
@
click=
"showMoreProduct(item)"
>
<view
v-if=
"item.productListCopy.length!=item.productList.length"
@
click=
"showMoreProduct(item)"
>
更多
更多
...
@@ -78,6 +79,7 @@
...
@@ -78,6 +79,7 @@
</view>
</view>
</view>
</view>
</view>
</view>
</checkbox-group>
<u-empty
text=
"空空如也..."
mode=
"list"
v-if=
"scenicList.length==0"
></u-empty>
<u-empty
text=
"空空如也..."
mode=
"list"
v-if=
"scenicList.length==0"
></u-empty>
</scroll-view>
</scroll-view>
</swiper-item>
</swiper-item>
...
@@ -105,7 +107,7 @@
...
@@ -105,7 +107,7 @@
<text
class=
"bottom-three"
></text>
<text
class=
"bottom-three"
></text>
</view>
</view>
<view
class=
"bottom-detail"
:style=
"
{'top':chooseProduct.length>0?'-28rpx':'0'}">
<view
class=
"bottom-detail"
@
click=
"showDetail()"
:style=
"
{'top':chooseProduct.length>0?'-28rpx':'0'}">
<text>
<text>
明细
明细
</text>
</text>
...
@@ -123,6 +125,8 @@
...
@@ -123,6 +125,8 @@
<customer
:scenicList=
'scenicList'
ref=
'customer'
></customer>
<customer
:scenicList=
'scenicList'
ref=
'customer'
></customer>
<!-- 购买须知 -->
<!-- 购买须知 -->
<buyKnow
:buyKnowData=
'buyKnowData'
ref=
'buyKnow'
></buyKnow>
<buyKnow
:buyKnowData=
'buyKnowData'
ref=
'buyKnow'
></buyKnow>
<!-- 详情明细 -->
<detail
:chooseProduct=
'chooseProduct'
ref=
'detail'
></detail>
<!-- 模态框 -->
<!-- 模态框 -->
<u-modal
<u-modal
v-model=
"showModal"
v-model=
"showModal"
...
@@ -138,10 +142,12 @@
...
@@ -138,10 +142,12 @@
<
script
>
<
script
>
import
customer
from
'@/components/customer.vue'
//客服
import
customer
from
'@/components/customer.vue'
//客服
import
buyKnow
from
'@/components/buyKnow.vue'
//购买须知
import
buyKnow
from
'@/components/buyKnow.vue'
//购买须知
import
detail
from
'@/components/detail.vue'
//购买须知
export
default
{
export
default
{
components
:{
components
:{
customer
,
customer
,
buyKnow
buyKnow
,
detail
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -154,6 +160,7 @@ export default {
...
@@ -154,6 +160,7 @@ export default {
buyKnowData
:
''
,
//购买须知数据
buyKnowData
:
''
,
//购买须知数据
chooseProduct
:[],
//选中的产品
chooseProduct
:[],
//选中的产品
showModal
:
false
,
//是否显示模态框
showModal
:
false
,
//是否显示模态框
chooseMerchantProduct
:
''
,
//不支持多产品购买时,选中的景区产品
}
}
},
},
watch
:
{
watch
:
{
...
@@ -168,13 +175,49 @@ export default {
...
@@ -168,13 +175,49 @@ export default {
// })
// })
//当选中产品时
//当选中产品时
if
(
newValue
.
length
>
oldValue
.
length
){
if
(
newValue
.
length
>
oldValue
.
length
){
let
item
=
newValue
[
newValue
.
length
-
1
]
//找到当前选中的产品
if
(
item
.
isMoreBuy
!==
0
){
let
product
=
newValue
[
newValue
.
length
-
1
]
//不支持多产品购买时,删除该景区的其他产品
//商家一级
let
merchant
=
''
//通过产品一级找到商家一级
this
.
scenicList
.
forEach
(
item
=>
{
if
(
item
.
id
==
product
.
merchantId
){
merchant
=
item
}
})
//当选中产品的景区有2个以上选中产品时
let
number
=
0
this
.
chooseProduct
.
forEach
(
item
=>
{
if
(
merchant
.
id
==
item
.
merchantId
){
number
+=
1
}
})
if
(
product
.
isMoreBuy
!==
0
){
if
(
number
>
1
){
//显示确认弹窗
this
.
showModal
=
true
this
.
showModal
=
true
//当前选中的景区产品,用于确定以及取消方法取值
this
.
chooseMerchantProduct
=
product
}
}
else
{
}
else
{
//支持多产品购买时,删除该景区其他产品不支持多产品购买的产品
//支持多产品购买时,删除该景区其他产品不支持多产品购买的产品
this
.
chooseProduct
.
forEach
((
item
,
index
)
=>
{
if
(
merchant
.
id
==
item
.
merchantId
&&
item
.
isMoreBuy
!==
0
){
//取消选中状态和选中背景颜色
this
.
scenicList
.
forEach
(
item2
=>
{
item2
.
productList
.
forEach
(
item3
=>
{
if
(
item
.
id
==
item3
.
id
){
item3
.
ifChecked
=
false
item3
.
ifChoose
=
false
}
})
})
delete
this
.
chooseProduct
[
index
]
}
})
this
.
chooseProduct
=
this
.
chooseProduct
.
filter
(
function
(
val
)
{
return
val
})
}
}
}
}
},
},
...
@@ -221,6 +264,10 @@ export default {
...
@@ -221,6 +264,10 @@ export default {
this
.
buyKnowData
=
data
this
.
buyKnowData
=
data
this
.
$refs
.
buyKnow
.
showPop
=
true
this
.
$refs
.
buyKnow
.
showPop
=
true
},
},
//---展示明细弹窗
showDetail
(){
this
.
$refs
.
detail
.
showPop
=
true
},
//---展示更多产品
//---展示更多产品
showMoreProduct
(
item
){
showMoreProduct
(
item
){
item
.
productListCopy
=
item
.
productList
item
.
productListCopy
=
item
.
productList
...
@@ -251,47 +298,46 @@ export default {
...
@@ -251,47 +298,46 @@ export default {
})
})
})
})
},
},
//---不支持多选产品
弹窗
,选择确定事件
//---不支持多选产品,选择确定事件
chooseConfirm
(){
chooseConfirm
(){
this
.
chooseProduct
.
forEach
((
item
2
,
index
)
=>
{
this
.
chooseProduct
.
forEach
((
item
,
index
)
=>
{
//删除选中产品以外的其他所有产品
//删除选中产品以外的其他所有产品
if
(
this
.
chooseMerchant
Id
==
item2
.
merchantId
&&
JSON
.
stringify
(
item2
)
!=
JSON
.
stringify
(
this
.
chooseMerchantProduct
)){
if
(
this
.
chooseMerchant
Product
.
merchantId
==
item
.
merchantId
&&
JSON
.
stringify
(
item
)
!=
JSON
.
stringify
(
this
.
chooseMerchantProduct
)){
delete
this
.
chooseProduct
[
index
]
//取消选中状态和选中背景颜色
//找到删除下标,然后找到对应的多选框不让选中
this
.
scenicList
.
forEach
(
item2
=>
{
this
.
scenicList
.
forEach
((
item3
,
x
)
=>
{
item2
.
productList
.
forEach
(
item3
=>
{
item3
.
productList
.
forEach
((
item4
,
y
)
=>
{
if
(
item
.
id
==
item3
.
id
)
{
if
(
JSON
.
stringify
(
item2
)
==
JSON
.
stringify
(
item4
)){
item3
.
ifChecked
=
false
document
.
querySelectorAll
(
'.list'
)[
x
].
children
[
1
].
children
[
y
].
children
[
0
].
children
[
0
].
children
[
0
].
checked
=
false
item3
.
ifChoose
=
false
}
}
})
})
})
})
delete
this
.
chooseProduct
[
index
]
}
}
})
})
this
.
chooseProduct
=
this
.
chooseProduct
.
filter
(
function
(
val
)
{
this
.
chooseProduct
=
this
.
chooseProduct
.
filter
(
function
(
val
)
{
return
val
return
val
})
})
this
.
show
Config
=
false
this
.
show
Modal
=
false
},
},
//---不支持多选产品
弹窗
,选择取消事件
//---不支持多选产品,选择取消事件
chooseCancel
(){
chooseCancel
(){
//删除选中产品
//删除选中产品
this
.
chooseProduct
.
forEach
((
item
2
,
index
)
=>
{
this
.
chooseProduct
.
forEach
((
item
,
index
)
=>
{
if
(
JSON
.
stringify
(
item2
)
===
JSON
.
stringify
(
this
.
chooseMerchantProduct
)
){
if
(
item
.
id
===
this
.
chooseMerchantProduct
.
id
){
delete
this
.
chooseProduct
[
index
]
//取消选中状态和选中背景颜色
//找到删除下标,然后找到对应的多选框不让选中
this
.
scenicList
.
forEach
(
item2
=>
{
this
.
scenicList
.
forEach
((
item3
,
x
)
=>
{
item2
.
productList
.
forEach
(
item3
=>
{
item3
.
productList
.
forEach
((
item4
,
y
)
=>
{
if
(
item
.
id
==
item3
.
id
)
{
if
(
JSON
.
stringify
(
item2
)
==
JSON
.
stringify
(
item4
)){
item3
.
ifChecked
=
false
document
.
querySelectorAll
(
'.list'
)[
x
].
children
[
1
].
children
[
y
].
children
[
0
].
children
[
0
].
children
[
0
].
checked
=
false
item3
.
ifChoose
=
false
}
}
})
})
})
})
this
.
chooseProduct
.
splice
(
index
,
1
)
}
}
})
})
this
.
chooseProduct
=
this
.
chooseProduct
.
filter
(
function
(
val
)
{
this
.
showModal
=
false
return
val
})
this
.
showConfig
=
false
},
},
//---商品列表
//---商品列表
initList
(
latitude
,
longitude
)
{
initList
(
latitude
,
longitude
)
{
...
...
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