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
b382ed0c
Commit
b382ed0c
authored
Aug 03, 2023
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
产品修改
parent
fff65a5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
23 deletions
+76
-23
scenicChooseProduct.vue
pages/scenic/scenicChooseProduct/scenicChooseProduct.vue
+76
-23
No files found.
pages/scenic/scenicChooseProduct/scenicChooseProduct.vue
View file @
b382ed0c
...
...
@@ -17,10 +17,13 @@
<view
class=
"merchant-title"
>
<view
class=
"title-left"
>
<text
>
{{
item
.
name
}}
</text>
<image
src=
"../../../static/img/scenic/coupon.png"
></image>
<text
class=
"title-coupon"
>
劵惠
</text>
<template
v-if=
"item.couponVoList&&item.couponVoList.length>0"
>
<image
src=
"../../../static/img/scenic/coupon.png"
></image>
<text
class=
"title-coupon"
>
劵惠
</text>
</
template
>
</view>
<view
v-if=
"showDistance"
class=
"title-right"
>
...
...
@@ -28,8 +31,8 @@
</view>
</view>
<label
v-for=
"(items,a) in item.productListCopy"
:key=
'a'
>
<view
class=
"product"
:class=
"
{'on':items.ifCh
oose
}">
<label
v-for=
"(items,a) in item.productListCopy"
:key=
'a'
:class=
"{'off':items.status==2}"
>
<view
class=
"product"
:class=
"{'on':items.ifCh
angeBg
}"
>
<view
class=
"product-left"
>
<checkbox
class=
"blue"
:disabled=
"items.status==2"
:value=
"JSON.stringify(items)"
:checked=
"items.ifChecked"
/>
</view>
...
...
@@ -118,13 +121,15 @@
</view>
</view>
<view
class=
"bottom-right"
>
<text
class=
"btn"
>
去预定
</text>
<text
class=
"btn"
@
click=
"goFillorder()"
>
去预定
</text>
</view>
</view>
<!-- 客服组件 -->
<customer
:scenicList=
'scenicList'
ref=
'customer'
></customer>
<!-- 购买须知 -->
<buyKnow
:buyKnowData=
'buyKnowData'
ref=
'buyKnow'
></buyKnow>
<!-- 详情明细 -->
<detail
:chooseProduct=
'chooseProduct'
ref=
'detail'
></detail>
<!-- 模态框 -->
<u-modal
v-model=
"showModal"
...
...
@@ -140,15 +145,18 @@
<
script
>
import
customer
from
'@/components/customer.vue'
//客服
import
buyKnow
from
'@/components/buyKnow.vue'
//购买须知
import
detail
from
'./components/detail.vue'
//购买须知
export
default
{
components
:{
customer
,
buyKnow
buyKnow
,
detail
},
data
()
{
return
{
merchantId
:
'z0015605022691a5945bbe463141668c'
,
//商户Id
tabbar
:[
'热门景点'
,
'一日游'
,
'摄影/旅拍'
,
'文创DIY'
],
//tabbar标题列表
merchantId
:
''
,
//商户Id
// tabbar:['热门景点','一日游','摄影/旅拍','文创DIY'],//tabbar标题列表
tabbar
:[
'热门景点'
,
'一日游'
,
'摄影/旅拍'
],
//tabbar标题列表
active
:
0
,
//导航栏下标
imgList
:[],
//图片列表
scenicList
:[],
//景区数据
...
...
@@ -157,18 +165,14 @@ export default {
chooseProduct
:[],
//选中的产品
showModal
:
false
,
//是否显示模态框
chooseMerchantProduct
:
''
,
//不支持多产品购买时,选中的景区产品
groupId
:
''
,
//组合Id
groupChannelId
:
''
,
//组合渠道Id
}
},
watch
:
{
//选中产品的数量变化
chooseProduct
:
{
handler
(
newValue
,
oldValue
){
// this.originalTotal=0
// this.sellTotal=0
// this.chooseProduct.forEach((item)=>{//通过选中的产品计算价格
// this.originalTotal+=item.originalPrice
// this.sellTotal+=item.sellingPrice
// })
//当选中产品时
if
(
newValue
.
length
>
oldValue
.
length
){
//找到当前选中的产品
...
...
@@ -204,7 +208,7 @@ export default {
item2
.
productList
.
forEach
(
item3
=>
{
if
(
item
.
id
==
item3
.
id
){
item3
.
ifChecked
=
false
item3
.
ifCh
oose
=
false
item3
.
ifCh
angeBg
=
false
}
})
})
...
...
@@ -223,6 +227,7 @@ export default {
},
onLoad
(
option
){
this
.
merchantId
=
option
.
merchantId
||
''
let
token
=
uni
.
getStorageSync
(
'token'
)
if
(
token
){
uni
.
getLocation
({
...
...
@@ -285,10 +290,12 @@ export default {
//判断是否选中产品,选中产品的背景颜色需要变化
this
.
scenicList
.
forEach
(
item
=>
{
item
.
productList
.
forEach
(
item2
=>
{
item2
.
ifCh
oose
=
false
item2
.
ifCh
angeBg
=
false
this
.
chooseProduct
.
forEach
(
item3
=>
{
if
(
item2
.
id
==
item3
.
id
){
item2
.
ifChoose
=
true
item2
.
ifChangeBg
=
true
//解决是否支持多产品购买弹窗2次之后,选中状态错误bug,需要在选中时修改状态
item2
.
ifChecked
=
true
}
})
})
...
...
@@ -304,7 +311,7 @@ export default {
item2
.
productList
.
forEach
(
item3
=>
{
if
(
item
.
id
==
item3
.
id
){
item3
.
ifChecked
=
false
item3
.
ifCh
oose
=
false
item3
.
ifCh
angeBg
=
false
}
})
})
...
...
@@ -326,7 +333,7 @@ export default {
item2
.
productList
.
forEach
(
item3
=>
{
if
(
item
.
id
==
item3
.
id
){
item3
.
ifChecked
=
false
item3
.
ifCh
oose
=
false
item3
.
ifCh
angeBg
=
false
}
})
})
...
...
@@ -339,12 +346,15 @@ export default {
initList
(
latitude
,
longitude
)
{
let
data
=
{
merchantId
:
this
.
merchantId
,
//商户id
openid
:
uni
.
getStorageSync
(
'openid'
)
||
''
,
latitude
,
longitude
}
this
.
$request
(
'/scenic/groupGood/getGroupProducts'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
'00'
)
{
this
.
scenicList
=
res
.
data
.
merchantList
this
.
scenicList
=
res
.
data
.
merchantList
||
[]
this
.
groupId
=
res
.
data
.
groupId
||
''
this
.
groupChannelId
=
res
.
data
.
groupChannelId
||
''
this
.
scenicList
.
forEach
((
item
,
index
)
=>
{
//获取当前景区图片,把当前景区放在第一位
if
(
item
.
id
==
this
.
merchantId
){
...
...
@@ -385,6 +395,45 @@ export default {
}
})
},
//---跳转填写订单页面
goFillorder
(){
for
(
let
i
=
0
;
i
<
this
.
chooseProduct
.
length
;
i
++
)
{
let
item
=
this
.
chooseProduct
[
i
]
if
(
item
.
status
==
2
)
{
uni
.
showToast
({
title
:
'售罄产品不能进行购买'
,
icon
:
'none'
})
return
}
}
if
(
this
.
chooseProduct
.
length
==
0
)
{
uni
.
showToast
({
title
:
'请选择至少一个产品'
,
icon
:
'none'
})
return
}
else
if
(
this
.
chooseProduct
.
length
==
1
)
{
let
query
=
'?merchantId='
+
this
.
chooseProduct
[
0
].
merchantId
+
'&productId='
+
this
.
chooseProduct
[
0
].
id
+
'&orderSource=3'
if
(
this
.
chooseProduct
[
0
].
ticketType
==
2
){
//联票
uni
.
navigateTo
({
url
:
'/pages/scenic/scenicJointOrder/scenicJointOrder'
+
query
})
}
else
{
//普通票
uni
.
navigateTo
({
url
:
'/pages/scenic/scenicSingleOrder/scenicSingleOrder'
+
query
})
}
}
else
{
let
productIdList
=
this
.
chooseProduct
.
map
((
item
)
=>
{
return
item
.
id
})
let
query
=
'?productIdList='
+
JSON
.
stringify
(
productIdList
)
+
'&groupId='
+
this
.
groupId
+
'&groupChannelId='
+
this
.
groupChannelId
+
'&orderSource=3'
uni
.
navigateTo
({
url
:
'/pages/combination/combiOrder/combiOrder'
+
query
})
}
}
}
}
</
script
>
...
...
@@ -431,6 +480,9 @@ export default {
margin-top
:
24rpx
;
padding
:
24rpx
;
}
.merchant
label
.off
.product
{
background
:
#F3F3F3
;
}
.merchant-title
{
display
:
flex
;
justify-content
:
space-between
;
...
...
@@ -458,11 +510,12 @@ export default {
font-size
:
24rpx
;
}
.product
{
padding
:
16rpx
;
padding
:
10rpx
16rpx
;
background
:
#ffffff
;
border-radius
:
8rpx
;
display
:
flex
;
align-items
:
center
;
margin-top
:
10rpx
;
}
.product.on
{
background
:
#E2EEFF
;
...
...
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