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
64c68248
Commit
64c68248
authored
Jan 10, 2024
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
组合下单开发
parent
b60597a6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
96 deletions
+113
-96
distributionCombiChoose.vue
...ation/distributionCombiChoose/distributionCombiChoose.vue
+4
-4
scenicCombiOrder.vue
pages/scenic/scenicCombiOrder/scenicCombiOrder.vue
+91
-77
editContacts.vue
pages/scenic/scenicComponents/editContacts.vue
+1
-1
scenicSingleOrder.vue
pages/scenic/scenicSingleOrder/scenicSingleOrder.vue
+17
-14
No files found.
pages/combination/distributionCombiChoose/distributionCombiChoose.vue
View file @
64c68248
pages/scenic/scenicCombiOrder/scenicCombiOrder.vue
View file @
64c68248
...
@@ -411,7 +411,7 @@ export default {
...
@@ -411,7 +411,7 @@ export default {
this
.
docQuery
=
uni
.
createSelectorQuery
().
in
(
this
)
this
.
docQuery
=
uni
.
createSelectorQuery
().
in
(
this
)
},
},
methods
:
{
methods
:
{
//---页面初始化数据,获取产品基本信息
---已修改
//---页面初始化数据,获取产品基本信息
initData
()
{
initData
()
{
let
data
=
{
let
data
=
{
productList
:
this
.
productIdList
,
//产品id列表
productList
:
this
.
productIdList
,
//产品id列表
...
@@ -449,7 +449,7 @@ export default {
...
@@ -449,7 +449,7 @@ export default {
}
}
})
})
},
},
//---获取产品价格库存列表
---已修改
//---获取产品价格库存列表
getPriceList
()
{
getPriceList
()
{
let
data
=
{
let
data
=
{
productIds
:
this
.
productIdList
,
//产品id集合
productIds
:
this
.
productIdList
,
//产品id集合
...
@@ -542,7 +542,7 @@ export default {
...
@@ -542,7 +542,7 @@ export default {
}
}
})
})
},
},
//---排号是否上下架
---已修改
//---排号是否上下架
sortUpDown
(
item
)
{
sortUpDown
(
item
)
{
let
data
=
{
let
data
=
{
merchantCode
:
item
.
merchantVo
.
code
//商户code
merchantCode
:
item
.
merchantVo
.
code
//商户code
...
@@ -589,7 +589,7 @@ export default {
...
@@ -589,7 +589,7 @@ export default {
}
}
})
})
},
},
//---获取班次票
---已修改
//---获取班次票
getTimeStock
(
item
)
{
getTimeStock
(
item
)
{
item
.
timeList
=
[]
item
.
timeList
=
[]
let
data
=
{
let
data
=
{
...
@@ -625,50 +625,8 @@ export default {
...
@@ -625,50 +625,8 @@ export default {
}
}
})
})
},
},
//---初始化联系人列表
getContactList
()
{
let
data
=
{
openid
:
this
.
openid
}
this
.
$request
(
'wechatUser/contact/findContactList'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
'00'
)
{
let
contactTotal
=
res
.
data
||
[]
contactTotal
.
forEach
(
item
=>
{
//用于判断是否被选中
item
.
ifChoose
=
false
})
this
.
productList
.
forEach
((
item
)
=>
{
item
.
contactTotal
=
JSON
.
parse
(
JSON
.
stringify
(
contactTotal
))
//数据不出现问题
this
.
$forceUpdate
()
})
//编辑成功重新调该方法时,把之前选中的游客,设为选中状态
this
.
productList
.
forEach
(
item
=>
{
item
.
contactTotal
.
forEach
(
item2
=>
{
item
.
chooseContact
.
forEach
(
item3
=>
{
if
(
item2
.
id
==
item3
.
id
)
{
item2
.
ifChoose
=
true
item3
=
JSON
.
parse
(
JSON
.
stringify
(
item2
))
}
})
})
})
// //删除联系人成功重新调该方法时,之前选中的联系人,数据库可能被删除,删除该联系人
//---计算价格
// this.chooseContact.forEach((item, index) => {
// if (!this.contactTotal.find(item2 => item.id == item2.id)) {
// this.chooseContact.splice(index, 1)
// }
// })
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
})
}
})
},
//---计算价格---已修改
computedPrice
(){
computedPrice
(){
let
savedMoney
=
0
let
savedMoney
=
0
let
original
=
0
let
original
=
0
...
@@ -713,31 +671,31 @@ export default {
...
@@ -713,31 +671,31 @@ export default {
}
}
})
})
},
},
//---获取子组件的传值
---已修改
//---获取子组件的传值
areaSure
(
data
)
{
areaSure
(
data
)
{
this
.
productList
[
this
.
areaIndex
].
areaObj
=
data
this
.
productList
[
this
.
areaIndex
].
areaObj
=
data
},
},
//---展示选择站点
---已修改
//---展示选择站点
openArea
(
index
)
{
openArea
(
index
)
{
this
.
areaIndex
=
index
this
.
areaIndex
=
index
this
.
showChooseArea
=
true
this
.
showChooseArea
=
true
},
},
//---关闭选择站点
---已修改
//---关闭选择站点
closeArea
()
{
closeArea
()
{
this
.
showChooseArea
=
false
this
.
showChooseArea
=
false
},
},
//---展示详情弹窗
---已修改
//---展示详情弹窗
showDetail
()
{
showDetail
()
{
this
.
$refs
.
detail
.
showPop
=
true
this
.
$refs
.
detail
.
showPop
=
true
},
},
//---展示日历
---已修改
//---展示日历
showCalendar
(
index
)
{
showCalendar
(
index
)
{
this
.
$refs
.
calendar
.
defaultDate
=
this
.
productList
[
index
].
chooseDate
//日历组件选中日期
this
.
$refs
.
calendar
.
defaultDate
=
this
.
productList
[
index
].
chooseDate
//日历组件选中日期
this
.
moreDateIndex
=
index
this
.
moreDateIndex
=
index
this
.
chooseDateList
=
this
.
productList
[
index
].
priceStockList
this
.
chooseDateList
=
this
.
productList
[
index
].
priceStockList
this
.
$refs
.
calendar
.
showPop
=
true
this
.
$refs
.
calendar
.
showPop
=
true
},
},
//---日期选择
---已改
//---日期选择
dateChoose
(
item
,
item2
,
index
)
{
dateChoose
(
item
,
item2
,
index
)
{
item
.
dateActive
=
index
//修改选中样式
item
.
dateActive
=
index
//修改选中样式
this
.
maxBookNum
=
999
//默认可以去支付
this
.
maxBookNum
=
999
//默认可以去支付
...
@@ -769,7 +727,7 @@ export default {
...
@@ -769,7 +727,7 @@ export default {
//解决点击日期无反应的情况
//解决点击日期无反应的情况
this
.
$forceUpdate
()
this
.
$forceUpdate
()
},
},
//---日历确认事件
---已修改
//---日历确认事件
dateConfig
(
data
)
{
dateConfig
(
data
)
{
let
index2
=
this
.
chooseDateList
.
findIndex
(
item
=>
{
let
index2
=
this
.
chooseDateList
.
findIndex
(
item
=>
{
return
item
.
startTime
.
substr
(
0
,
10
)
==
data
return
item
.
startTime
.
substr
(
0
,
10
)
==
data
...
@@ -783,7 +741,7 @@ export default {
...
@@ -783,7 +741,7 @@ export default {
this
.
$forceUpdate
()
this
.
$forceUpdate
()
}).
exec
()
}).
exec
()
},
},
//---展示更多时间
---已改好
//---展示更多时间
showTime
(
item
,
index
)
{
showTime
(
item
,
index
)
{
this
.
chooseTimeList
=
item
.
timeList
this
.
chooseTimeList
=
item
.
timeList
this
.
moreTimeIndex
=
index
this
.
moreTimeIndex
=
index
...
@@ -794,7 +752,7 @@ export default {
...
@@ -794,7 +752,7 @@ export default {
}
}
this
.
$refs
.
times
.
showPop
=
true
this
.
$refs
.
times
.
showPop
=
true
},
},
//---时间选择
---已改好
//---时间选择
chooseTime
(
item
,
item2
,
index2
)
{
chooseTime
(
item
,
item2
,
index2
)
{
if
(
item2
.
copyLast
!=
'售罄'
){
if
(
item2
.
copyLast
!=
'售罄'
){
item
.
timeActive
=
index2
item
.
timeActive
=
index2
...
@@ -807,7 +765,7 @@ export default {
...
@@ -807,7 +765,7 @@ export default {
this
.
$forceUpdate
()
this
.
$forceUpdate
()
}
}
},
},
//---时间确认事件
---已改好
//---时间确认事件
timeConfig
(
index2
)
{
timeConfig
(
index2
)
{
let
item
=
this
.
productList
[
this
.
moreTimeIndex
]
let
item
=
this
.
productList
[
this
.
moreTimeIndex
]
let
item2
=
this
.
chooseTimeList
[
index2
]
let
item2
=
this
.
chooseTimeList
[
index2
]
...
@@ -819,7 +777,7 @@ export default {
...
@@ -819,7 +777,7 @@ export default {
this
.
$forceUpdate
()
this
.
$forceUpdate
()
}).
exec
()
}).
exec
()
},
},
//---删除选中的联系人
---已修改
//---删除选中的联系人
delChooseContact
(
item
,
item2
,
index2
)
{
delChooseContact
(
item
,
item2
,
index2
)
{
//所有联系人中找到删除联系人下标,改成未选中状态
//所有联系人中找到删除联系人下标,改成未选中状态
let
sub
=
item
.
contactTotal
.
findIndex
(
item3
=>
item3
.
id
==
item2
.
id
)
let
sub
=
item
.
contactTotal
.
findIndex
(
item3
=>
item3
.
id
==
item2
.
id
)
...
@@ -828,18 +786,18 @@ export default {
...
@@ -828,18 +786,18 @@ export default {
//解决样式和数据未及时更新问题
//解决样式和数据未及时更新问题
this
.
$forceUpdate
()
this
.
$forceUpdate
()
},
},
//---展示编辑联系人
---已修改
//---展示编辑联系人
showEdit
(
data
)
{
showEdit
(
data
)
{
let
obj
=
data
||
''
let
obj
=
data
||
''
this
.
$refs
.
editContacts
.
showPop
=
true
this
.
$refs
.
editContacts
.
showPop
=
true
this
.
editContactData
=
obj
this
.
editContactData
=
obj
},
},
//---展示新增联系人,并获取联系人列表
---已修改
//---展示新增联系人,并获取联系人列表
showContacts
(
index
)
{
showContacts
(
index
)
{
this
.
moreContactIndex
=
index
this
.
moreContactIndex
=
index
this
.
$refs
.
contactList
.
showPop
=
true
this
.
$refs
.
contactList
.
showPop
=
true
},
},
//---联系人列表弹窗确认选中
---已修改
//---联系人列表弹窗确认选中
contactListConfig
(
data
){
contactListConfig
(
data
){
let
index
=
this
.
moreContactIndex
let
index
=
this
.
moreContactIndex
this
.
productList
[
index
].
chooseContact
=
data
this
.
productList
[
index
].
chooseContact
=
data
...
@@ -859,7 +817,7 @@ export default {
...
@@ -859,7 +817,7 @@ export default {
//选中样式以及选中数据的更新
//选中样式以及选中数据的更新
this
.
$forceUpdate
()
this
.
$forceUpdate
()
},
},
//---游客选择
---已修改
//---游客选择
visitorChoose
(
index
,
index2
)
{
visitorChoose
(
index
,
index2
)
{
//底层原理不明,特殊情况,需特殊处理
//底层原理不明,特殊情况,需特殊处理
//直接传入item,item2时 会报错,故选择传入下标
//直接传入item,item2时 会报错,故选择传入下标
...
@@ -886,6 +844,51 @@ export default {
...
@@ -886,6 +844,51 @@ export default {
//解决选中联系人样式不更新的bug
//解决选中联系人样式不更新的bug
this
.
$forceUpdate
()
this
.
$forceUpdate
()
},
},
//---初始化联系人列表
getContactList
()
{
let
data
=
{
openid
:
this
.
openid
}
this
.
$request
(
'wechatUser/contact/findContactList'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
'00'
)
{
let
contactTotal
=
res
.
data
||
[]
contactTotal
.
forEach
(
item
=>
{
//用于判断是否被选中
item
.
ifChoose
=
false
})
this
.
productList
.
forEach
((
item
)
=>
{
item
.
contactTotal
=
JSON
.
parse
(
JSON
.
stringify
(
contactTotal
))
if
(
item
.
chooseContact
&&
item
.
chooseContact
.
length
>
0
){
//编辑成功重新调该方法时,把之前选中的游客,设为选中状态
item
.
contactTotal
.
forEach
(
item2
=>
{
item
.
chooseContact
.
forEach
(
item3
=>
{
if
(
item2
.
id
==
item3
.
id
)
{
item2
.
ifChoose
=
true
//更新选中的联系人的值
item3
.
credentialNumber
=
item2
.
credentialNumber
item3
.
name
=
item2
.
name
item3
.
phone
=
item2
.
phone
}
})
})
//删除联系人成功重新调该方法时,之前选中的联系人,数据库可能被删除,删除该联系人
item
.
chooseContact
.
forEach
((
item2
,
index
)
=>
{
if
(
!
item
.
contactTotal
.
find
(
item3
=>
item2
.
id
==
item3
.
id
))
{
item
.
chooseContact
.
splice
(
index
,
1
)
}
})
}
//数据不出现问题
this
.
$forceUpdate
()
})
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
})
}
})
},
//---添加并选中联系人--用于添加联系人之后直接从联系人列表选出需要填写的几位联系人
//---添加并选中联系人--用于添加联系人之后直接从联系人列表选出需要填写的几位联系人
addChoose
()
{
addChoose
()
{
let
data
=
{
let
data
=
{
...
@@ -893,14 +896,25 @@ export default {
...
@@ -893,14 +896,25 @@ export default {
}
}
this
.
$request
(
'wechatUser/contact/findContactList'
,
data
).
then
(
res
=>
{
this
.
$request
(
'wechatUser/contact/findContactList'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
'00'
)
{
if
(
res
.
code
==
'00'
)
{
this
.
contactTotal
=
res
.
data
let
contactTotal
=
res
.
data
||
[]
for
(
let
i
=
0
;
i
<
this
.
contactNum
;
i
++
)
{
contactTotal
.
forEach
(
item
=>
{
let
item
=
this
.
contactTotal
[
i
]
||
null
//用于判断是否被选中
if
(
item
)
{
item
.
ifChoose
=
false
item
.
ifChoose
=
true
})
this
.
productList
.
forEach
((
item
)
=>
{
item
.
contactTotal
=
JSON
.
parse
(
JSON
.
stringify
(
contactTotal
))
for
(
let
i
=
0
;
i
<
item
.
contactNum
;
i
++
)
{
let
item2
=
item
.
contactTotal
[
i
]
||
null
if
(
item2
)
{
item2
.
ifChoose
=
true
}
}
}
}
this
.
chooseContact
=
this
.
contactTotal
.
slice
(
0
,
this
.
contactNum
)
item
.
chooseContact
=
item
.
contactTotal
.
slice
(
0
,
item
.
contactNum
)
//数据不出现问题
this
.
$forceUpdate
()
})
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
title
:
res
.
message
,
title
:
res
.
message
,
...
@@ -909,7 +923,7 @@ export default {
...
@@ -909,7 +923,7 @@ export default {
}
}
})
})
},
},
//---订单数量变化
---已修改
//---订单数量变化
buyNumChange
(
e
)
{
buyNumChange
(
e
)
{
let
value
=
e
.
value
let
value
=
e
.
value
let
index
=
e
.
name
let
index
=
e
.
name
...
@@ -952,12 +966,12 @@ export default {
...
@@ -952,12 +966,12 @@ export default {
this
.
initCoupon
(
item
)
this
.
initCoupon
(
item
)
},
1500
)
},
1500
)
},
},
//---展示购票须知
---已修改
//---展示购票须知
showBuyKnow
(
index
)
{
showBuyKnow
(
index
)
{
this
.
buyKnowData
=
this
.
productList
[
index
]
this
.
buyKnowData
=
this
.
productList
[
index
]
this
.
$refs
.
buyKnow
.
showPop
=
true
this
.
$refs
.
buyKnow
.
showPop
=
true
},
},
//---加载优惠券
---已修改
//---加载优惠券
initCoupon
(
item
)
{
initCoupon
(
item
)
{
let
savedMoneyList
=
[]
let
savedMoneyList
=
[]
item
.
chooseCouponObj
=
''
item
.
chooseCouponObj
=
''
...
@@ -1009,7 +1023,7 @@ export default {
...
@@ -1009,7 +1023,7 @@ export default {
}
}
})
})
},
},
//---子组件券选择之后触发的事件
---已修改
//---子组件券选择之后触发的事件
couponChoose
(
data
)
{
couponChoose
(
data
)
{
if
(
data
){
if
(
data
){
this
.
productList
[
this
.
couponIndex
].
chooseCouponObj
=
data
this
.
productList
[
this
.
couponIndex
].
chooseCouponObj
=
data
...
@@ -1020,14 +1034,14 @@ export default {
...
@@ -1020,14 +1034,14 @@ export default {
//复制公众号,还未复现是否需要
//复制公众号,还未复现是否需要
this
.
$forceUpdate
()
this
.
$forceUpdate
()
},
},
//---展示券列表
---已修改
//---展示券列表
showCoupon
(
index
)
{
showCoupon
(
index
)
{
this
.
couponIndex
=
index
this
.
couponIndex
=
index
this
.
couponData
=
this
.
productList
[
index
].
couponData
this
.
couponData
=
this
.
productList
[
index
].
couponData
this
.
chooseCouponObj
=
this
.
productList
[
index
].
chooseCouponObj
this
.
chooseCouponObj
=
this
.
productList
[
index
].
chooseCouponObj
this
.
$refs
.
orderCoupon
.
showPop
=
true
this
.
$refs
.
orderCoupon
.
showPop
=
true
},
},
//---下单
---已修改
//---下单
goPay
()
{
goPay
()
{
if
(
this
.
orderStatus
==
1
)
{
if
(
this
.
orderStatus
==
1
)
{
//下架状态,点击无效
//下架状态,点击无效
...
...
pages/scenic/scenicComponents/editContacts.vue
View file @
64c68248
...
@@ -117,7 +117,7 @@ export default {
...
@@ -117,7 +117,7 @@ export default {
//新增的时候
//新增的时候
this
.
$parent
.
addChoose
()
this
.
$parent
.
addChoose
()
//显示联系人列表弹窗
//显示联系人列表弹窗
this
.
$parent
.
showContacts
()
this
.
$parent
.
$refs
.
contactList
.
showPop
=
true
//成功之后清空数据,防止下次新增的时候出现之前的数据
//成功之后清空数据,防止下次新增的时候出现之前的数据
this
.
name
=
''
this
.
name
=
''
this
.
credentialNumber
=
''
this
.
credentialNumber
=
''
...
...
pages/scenic/scenicSingleOrder/scenicSingleOrder.vue
View file @
64c68248
...
@@ -926,21 +926,24 @@ export default {
...
@@ -926,21 +926,24 @@ export default {
this
.
contactTotal
.
forEach
(
item
=>
{
this
.
contactTotal
.
forEach
(
item
=>
{
//用于判断是否被选中
//用于判断是否被选中
item
.
ifChoose
=
false
item
.
ifChoose
=
false
})
if
(
this
.
chooseContact
.
length
>
0
){
//编辑成功重新调该方法时,把之前选中的游客,设为选中状态
//编辑成功重新调该方法时,把之前选中的游客,设为选中状态
this
.
contactTotal
.
forEach
(
item
=>
{
this
.
chooseContact
.
forEach
(
item2
=>
{
this
.
chooseContact
.
forEach
(
item2
=>
{
if
(
item
.
id
==
item2
.
id
)
{
if
(
item
.
id
==
item2
.
id
)
{
item
.
ifChoose
=
true
item
.
ifChoose
=
true
item2
.
credentialNumber
=
item
.
credentialNumber
item2
.
name
=
item
.
name
item2
.
phone
=
item
.
phone
}
}
})
})
})
//删除联系人成功重新调该方法时,之前选中的联系人,数据库可能被删除,删除该联系人
//删除联系人成功重新调该方法时,之前选中的联系人,数据库可能被删除,删除该联系人
this
.
chooseContact
.
forEach
((
item
,
index
)
=>
{
this
.
chooseContact
.
forEach
((
item
,
index
)
=>
{
if
(
!
this
.
contactTotal
.
find
(
item2
=>
item
.
id
==
item2
.
id
))
{
if
(
!
this
.
contactTotal
.
find
(
item2
=>
item
.
id
==
item2
.
id
))
{
this
.
chooseContact
.
splice
(
index
,
1
)
this
.
chooseContact
.
splice
(
index
,
1
)
}
}
})
})
}
})
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
title
:
res
.
message
,
title
:
res
.
message
,
...
@@ -956,7 +959,7 @@ export default {
...
@@ -956,7 +959,7 @@ export default {
}
}
this
.
$request
(
'wechatUser/contact/findContactList'
,
data
).
then
(
res
=>
{
this
.
$request
(
'wechatUser/contact/findContactList'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
'00'
)
{
if
(
res
.
code
==
'00'
)
{
this
.
contactTotal
=
res
.
data
this
.
contactTotal
=
res
.
data
||
[]
for
(
let
i
=
0
;
i
<
this
.
contactNum
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
contactNum
;
i
++
)
{
let
item
=
this
.
contactTotal
[
i
]
||
null
let
item
=
this
.
contactTotal
[
i
]
||
null
if
(
item
)
{
if
(
item
)
{
...
...
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