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
396643b7
Commit
396643b7
authored
Nov 17, 2023
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
填写订单页面开发
parent
34f47abe
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
219 additions
and
234 deletions
+219
-234
common.js
common/common.js
+1
-1
contactList.vue
pages/scenic/scenicComponents/contactList.vue
+48
-23
editContacts.vue
pages/scenic/scenicComponents/editContacts.vue
+110
-136
scenicOrder.vue
pages/scenic/scenicOrder/scenicOrder.vue
+60
-74
No files found.
common/common.js
View file @
396643b7
...
@@ -96,7 +96,7 @@ export default{
...
@@ -96,7 +96,7 @@ export default{
return
d
*
(
1
+
fl
*
(
h1
*
sf
*
(
1
-
sg
)
-
h2
*
(
1
-
sf
)
*
sg
))
return
d
*
(
1
+
fl
*
(
h1
*
sf
*
(
1
-
sg
)
-
h2
*
(
1
-
sf
)
*
sg
))
},
},
phoneReg
:
function
(){
//手机正则
phoneReg
:
function
(){
//手机正则
return
/^
(
13
[
0-9
]
|14
[
0-9
]
|15
[
0-9
]
|18
[
0-9
]
|17
[
0-9
]
|19
[
0-9
]
|16
[
0-9
])\d{8}
$/
return
/^
(
13
[
0-9
]
|14
[
0-9
]
|15
[
0-9
]
|18
[
0-9
]
|17
[
0-9
]
|19
[
0-9
]
|16
[
0-9
]
|12
[
0-9
]
)\d{8}
$/
},
},
idReg
:
function
(){
//身份证正则
idReg
:
function
(){
//身份证正则
return
/^
[
1-9
]\d{5}[
1-9
]\d{3}((
0
\d)
|
(
1
[
0-2
]))(([
0|1|2
]\d)
|3
[
0-1
])\d{3}([
0-9
]
|X|x
)
$/
return
/^
[
1-9
]\d{5}[
1-9
]\d{3}((
0
\d)
|
(
1
[
0-2
]))(([
0|1|2
]\d)
|3
[
0-1
])\d{3}([
0-9
]
|X|x
)
$/
...
...
pages/scenic/scenicComponents/contactList.vue
View file @
396643b7
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<view
class=
"son-wrap"
>
<view
class=
"son-wrap"
>
<view
class=
"top"
>
<view
class=
"top"
>
<view
class=
"top-num"
>
<view
class=
"top-num"
>
需填写
{{
buy
Num
}}
位联系人
需填写
{{
contact
Num
}}
位联系人
</view>
</view>
<view
@
click=
"showEdit()"
class=
"top-add"
>
<view
@
click=
"showEdit()"
class=
"top-add"
>
<text>
<text>
...
@@ -14,20 +14,25 @@
...
@@ -14,20 +14,25 @@
<view
class=
"bottom"
>
<view
class=
"bottom"
>
<checkbox-group
@
change=
"chooseContactChange"
>
<checkbox-group
@
change=
"chooseContactChange"
>
<view
class=
"bottom-list"
v-for=
"(item,index) of
contactData
"
:key=
"item.id"
>
<view
class=
"bottom-list"
v-for=
"(item,index) of
listTotal
"
:key=
"item.id"
>
<label>
<label>
<checkbox
:value=
"JSON.stringify(item)"
:checked=
"item.ifChoose"
color=
"#3688ff"
/>
<checkbox
:value=
"JSON.stringify(item)"
:checked=
"item.ifChoose"
color=
"#3688ff"
/>
<view
class=
"bottom-content"
>
<view
class=
"bottom-content"
>
<view>
<view>
{{
item
.
name
}}
{{
item
.
name
}}
</view>
</view>
<view>
<view>
<text>
<text>
身份证
身份证
</text>
</text>
{{
item
.
credentialNumber
?
item
.
credentialNumber
.
substr
(
0
,
3
)
+
"****"
+
item
.
credentialNumber
.
substr
(
14
,
4
):
"无"
}}
{{
item
.
credentialNumber
?
item
.
credentialNumber
.
substr
(
0
,
3
)
+
"****"
+
item
.
credentialNumber
.
substr
(
14
,
4
):
"无"
}}
</view>
</view>
<view>
<text>
手机号
</text>
{{
item
.
phone
?
item
.
phone
.
substr
(
0
,
3
)
+
"****"
+
item
.
phone
.
substr
(
7
,
4
):
"无"
}}
</view>
</view>
</view>
</label>
</label>
...
@@ -38,12 +43,12 @@
...
@@ -38,12 +43,12 @@
<u-icon
name=
"trash-fill"
color=
"#3688ff"
size=
"56"
></u-icon>
<u-icon
name=
"trash-fill"
color=
"#3688ff"
size=
"56"
></u-icon>
</view>
</view>
</view>
</view>
<view
style=
"margin: 40rpx 0;text-align: center;"
v-if=
'
contactData&&contactData
.length>0'
>
<view
style=
"margin: 40rpx 0;text-align: center;"
v-if=
'
listTotal&&listTotal
.length>0'
>
已展示所有联系人
已展示所有联系人
</view>
</view>
</checkbox-group>
</checkbox-group>
<view
class=
"bottom-sure"
>
<view
class=
"bottom-sure"
@
click=
"config()"
>
确定
确定
</view>
</view>
</view>
</view>
...
@@ -54,12 +59,12 @@
...
@@ -54,12 +59,12 @@
<
script
>
<
script
>
export
default
{
export
default
{
props
:
[
'contact
Data'
,
'orderTouristList'
,
'buy
Num'
],
props
:
[
'contact
Total'
,
'contact
Num'
],
watch
:
{
watch
:
{
orderTouristList
:
{
contactTotal
:
{
handler
(
newValue
,
oldValue
)
{
handler
(
newValue
,
oldValue
)
{
if
(
newValue
)
{
if
(
newValue
)
{
this
.
chooseContact
=
this
.
orderTouristList
this
.
listTotal
=
this
.
contactTotal
}
}
},
},
deep
:
true
,
deep
:
true
,
...
@@ -69,7 +74,7 @@ export default {
...
@@ -69,7 +74,7 @@ export default {
data
()
{
data
()
{
return
{
return
{
showPop
:
false
,
//控制联系人弹窗显示隐藏
showPop
:
false
,
//控制联系人弹窗显示隐藏
chooseContact
:
[],
//选中的
联系人
listTotal
:[],
//所有
联系人
showModal
:
false
,
//确认弹窗显示隐藏
showModal
:
false
,
//确认弹窗显示隐藏
contactId
:
''
,
//删除联系人的Id
contactId
:
''
,
//删除联系人的Id
...
@@ -91,20 +96,41 @@ export default {
...
@@ -91,20 +96,41 @@ export default {
//---确定选中的联系人
//---确定选中的联系人
config
()
{
config
()
{
this
.
showPop
=
false
this
.
showPop
=
false
this
.
$emit
(
'contactListConfig'
,
this
.
chooseContact
)
//选中的排在前面
this
.
listTotal
.
sort
(
function
(
a
,
b
)
{
return
b
.
ifChoose
-
a
.
ifChoose
})
this
.
$parent
.
contactTotal
=
this
.
listTotal
let
chooseArr
=
[]
this
.
listTotal
.
forEach
(
item
=>
{
if
(
item
.
ifChoose
){
chooseArr
.
push
(
item
)
}
})
this
.
$parent
.
chooseContact
=
chooseArr
},
},
//---联系人姓名变化
//---联系人姓名变化
chooseContactChange
(
e
){
chooseContactChange
(
e
){
let
value
=
e
.
detail
.
value
let
value
=
e
.
detail
.
value
if
(
value
.
length
>
this
.
contactNum
)
{
let
number
=
value
.
length
-
this
.
contactNum
value
=
value
.
slice
(
number
)
}
let
arr
=
[]
let
arr
=
[]
value
.
forEach
(
item
=>
{
value
.
forEach
(
item
=>
{
arr
.
push
(
JSON
.
parse
(
item
))
arr
.
push
(
JSON
.
parse
(
item
))
})
})
this
.
chooseContact
=
arr
//先全部取消选中,后面根据选中的值来判断谁选中
if
(
arr
.
length
>
this
.
buyNum
)
{
this
.
listTotal
.
forEach
(
item
=>
{
arr
.
shift
()
item
.
ifChoose
=
false
})
arr
.
forEach
(
item
=>
{
this
.
listTotal
.
forEach
(
item2
=>
{
if
(
item
.
id
==
item2
.
id
){
item2
.
ifChoose
=
true
}
}
})
})
},
},
//---点击删除
//---点击删除
clickDele
(
id
)
{
clickDele
(
id
)
{
...
@@ -123,7 +149,6 @@ export default {
...
@@ -123,7 +149,6 @@ export default {
icon
:
'none'
icon
:
'none'
})
})
this
.
showModal
=
false
this
.
showModal
=
false
this
.
showPop
=
false
this
.
$parent
.
getContactList
()
this
.
$parent
.
getContactList
()
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
...
...
pages/scenic/scenicComponents/editContacts.vue
View file @
396643b7
<
template
>
<
template
>
<view
class=
"editBox"
v-show=
"showEdit"
>
<view
class=
"editBox"
v-show=
"showEdit"
>
<view
@
click=
"close()"
class=
"return"
>
<view
@
click=
"close()"
class=
"return"
>
<u-icon
name=
"close"
></u-icon>
<u-icon
name=
"close"
bold
></u-icon>
</view>
</view>
<view
class=
"editTop"
>
<view
class=
"editTop"
>
</view>
</view>
<view
class=
"editBottom"
>
<view
class=
"editBottom"
>
<view
class=
"bottomContent"
>
<view
class=
"bottomContent"
>
<view>
<view>
<text>
<text>
姓名:
姓名:
</text>
</text>
<input
v-model
.
trim=
"name"
placeholder=
"请输入中文姓名"
/>
<input
v-model
.
trim=
"name"
placeholder=
"请输入中文姓名
,必填
"
/>
</view>
</view>
<view>
<view>
<text>
<text>
身份证:
身份证:
</text>
</text>
<input
v-model
.
trim=
"credentialNumber"
maxlength=
"18"
placeholder=
"请输入身份证号码"
/>
<input
v-model
.
trim=
"credentialNumber"
maxlength=
"18"
placeholder=
"请输入身份证号码,必填"
/>
</view>
<view>
<text>
联系电话:
</text>
<input
v-model
.
trim=
"phone"
maxlength=
"11"
placeholder=
"用于接收行程信息"
/>
</view>
</view>
<view>
<view>
<!--编辑-->
<a
class=
"complete"
@
click=
"keepSave()"
>
完成
</a>
<a
class=
"middle-btn"
@
click=
"keepEdit()"
v-if=
"editBtn"
>
完成
</a>
<!--新增-->
<a
class=
"middle-btn"
@
click=
"keepPlus()"
v-else=
""
>
完成
</a>
</view>
</view>
</view>
</view>
...
@@ -37,31 +38,28 @@
...
@@ -37,31 +38,28 @@
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
props
:
[
"editContact"
],
props
:
[
'editContact'
],
data
()
{
data
()
{
return
{
return
{
showEdit
:
false
,
//控制组件显示隐藏
showEdit
:
false
,
//控制组件显示隐藏
name
:
""
,
//姓名
name
:
''
,
//姓名
credentialNumber
:
""
,
//身份证号
credentialNumber
:
''
,
//身份证号
reviseContactId
:
""
,
//被修改人id
phone
:
''
,
//手机号码
editBtn
:
""
,
//控制编辑完成按钮显示隐藏
reviseContactId
:
''
,
//被修改人id
}
}
},
},
watch
:
{
watch
:
{
editContact
:
{
//
editContact
:
{
handler
(
newValue
,
oldValue
)
{
handler
(
newValue
,
oldValue
)
{
if
(
newValue
)
{
console
.
log
(
111
)
this
.
editBtn
=
true
}
else
{
this
.
editBtn
=
false
}
this
.
name
=
newValue
.
name
||
''
this
.
name
=
newValue
.
name
||
''
this
.
credentialNumber
=
newValue
.
credentialNumber
||
''
this
.
credentialNumber
=
newValue
.
credentialNumber
||
''
this
.
reviseContactId
=
newValue
.
id
||
''
this
.
reviseContactId
=
newValue
.
id
||
''
this
.
phone
=
newValue
.
phone
||
''
},
},
deep
:
fals
e
,
deep
:
tru
e
,
immediate
:
fals
e
immediate
:
tru
e
}
}
},
},
methods
:
{
methods
:
{
...
@@ -69,8 +67,8 @@
...
@@ -69,8 +67,8 @@
close
()
{
close
()
{
this
.
showEdit
=
false
this
.
showEdit
=
false
},
},
//---新增
保存
//---
保存
keepPlus
()
{
keepSave
()
{
if
(
!
this
.
$commonjs
.
nameReg
().
test
(
this
.
name
))
{
if
(
!
this
.
$commonjs
.
nameReg
().
test
(
this
.
name
))
{
uni
.
showToast
({
uni
.
showToast
({
title
:
'请输入正确的中文名字'
,
title
:
'请输入正确的中文名字'
,
...
@@ -85,66 +83,38 @@
...
@@ -85,66 +83,38 @@
})
})
return
return
}
}
let
data
=
{
if
(
this
.
phone
&&!
this
.
$commonjs
.
phoneReg
().
test
(
this
.
phone
))
{
name
:
this
.
name
,
//保存姓名
phone
:
""
,
//电话号码
credentialNumber
:
this
.
credentialNumber
,
//身份证号
category
:
""
,
//成人或者儿童
openid
:
uni
.
getStorageSync
(
"openid"
),
//用户Id
credentialsType
:
""
,
//证件类型
merchantType
:
1
,
//商户类型,1.景区,2.酒店,3.餐饮
}
this
.
$request
(
"wechatUser/contact/saveContact"
,
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
"00"
)
{
uni
.
showToast
({
uni
.
showToast
({
title
:
'保存成功'
,
title
:
'请输入正确电话号码'
,
icon
:
'none'
})
this
.
$parent
.
addChoose
()
this
.
showEdit
=
false
this
.
name
=
""
//成功之后清空数据,防止下次新增的时候出现之前的数据
this
.
credentialNumber
=
""
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
})
}
})
},
//---编辑保存
keepEdit
()
{
if
(
!
this
.
$commonjs
.
nameReg
().
test
(
this
.
name
))
{
uni
.
showToast
({
title
:
'请输入正确的中文名字'
,
icon
:
'none'
})
return
}
if
(
!
this
.
$commonjs
.
idReg
().
test
(
this
.
credentialNumber
))
{
uni
.
showToast
({
title
:
'请输入正确身份证号'
,
icon
:
'none'
icon
:
'none'
})
})
return
return
}
}
let
data
=
{
let
data
=
{
name
:
this
.
name
,
//保存姓名
name
:
this
.
name
,
//保存姓名
phone
:
""
,
//电话号码
phone
:
this
.
phone
,
//电话号码
credentialNumber
:
this
.
credentialNumber
,
//身份证号
credentialNumber
:
this
.
credentialNumber
,
//身份证号
category
:
""
,
//成人或者儿童
openid
:
uni
.
getStorageSync
(
'openid'
),
//用户Id
openid
:
uni
.
getStorageSync
(
"openid"
),
//用户Id
credentialsType
:
""
,
//证件类型
merchantType
:
1
,
//商户类型,1.景区,2.酒店,3.餐饮
merchantType
:
1
,
//商户类型,1.景区,2.酒店,3.餐饮
id
:
this
.
reviseContactId
,
//被修改人id
id
:
this
.
reviseContactId
,
//被修改人id
category
:
''
,
//成人或者儿童
credentialsType
:
''
,
//证件类型
}
let
queryUrl
=
''
if
(
this
.
reviseContactId
){
queryUrl
=
'wechatUser/contact/updateContact'
}
else
{
queryUrl
=
'wechatUser/contact/saveContact'
}
}
this
.
$request
(
"wechatUser/contact/updateContact"
,
data
).
then
((
res
)
=>
{
this
.
$request
(
queryUrl
,
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
"00"
)
{
if
(
res
.
code
==
'00'
)
{
uni
.
showToast
({
uni
.
showToast
({
title
:
'修改
成功'
,
title
:
'保存
成功'
,
icon
:
'none'
icon
:
'none'
})
})
this
.
$parent
.
getContactList
()
if
(
!
this
.
reviseContactId
){
this
.
$parent
.
addChoose
()
}
this
.
showEdit
=
false
this
.
showEdit
=
false
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
...
@@ -155,12 +125,11 @@
...
@@ -155,12 +125,11 @@
})
})
}
}
}
}
}
}
</
script
>
</
script
>
<
style
scoped=
"scoped"
>
<
style
scoped=
"scoped"
lang=
"scss"
>
.editBox
{
.editBox
{
height
:
100%
;
background
:
#F5F5F5
;
background
:
#F5F5F5
;
position
:
fixed
;
position
:
fixed
;
top
:
0
;
top
:
0
;
...
@@ -168,8 +137,6 @@
...
@@ -168,8 +137,6 @@
right
:
0
;
right
:
0
;
bottom
:
0
;
bottom
:
0
;
z-index
:
10000
;
z-index
:
10000
;
overflow-y
:
auto
;
font-size
:
28
rpx
;
}
}
.return
{
.return
{
height
:
100rpx
;
height
:
100rpx
;
...
@@ -201,7 +168,7 @@
...
@@ -201,7 +168,7 @@
}
}
.bottomContent
view
text
{
.bottomContent
view
text
{
display
:
inline-block
;
display
:
inline-block
;
width
:
1
2
0
rpx
;
width
:
1
4
0rpx
;
text-align-last
:
justify
;
text-align-last
:
justify
;
margin-right
:
20rpx
;
margin-right
:
20rpx
;
}
}
...
@@ -209,10 +176,17 @@
...
@@ -209,10 +176,17 @@
flex
:
1
;
flex
:
1
;
}
}
.bottomContent
view
:last-child
{
.bottomContent
view
:last-child
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
margin-top
:
60rpx
;
margin-top
:
60rpx
;
border
:
none
;
border
:
none
;
}
}
.complete
{
width
:
100%
;
height
:
70rpx
;
border-radius
:
16rpx
;
color
:
#FFFFFF
;
text-align
:
center
;
line-height
:
70rpx
;
background
:
$theme
;
display
:
inline-block
;
}
</
style
>
</
style
>
pages/scenic/scenicOrder/scenicOrder.vue
View file @
396643b7
...
@@ -147,19 +147,23 @@
...
@@ -147,19 +147,23 @@
<text>
游客信息
</text>
<text>
游客信息
</text>
<text>
<text>
需填
<text
class=
"title-bold"
>
{{
contactNum
}}
</text>
位出行人
需填
<text
class=
"title-bold"
>
{{
contactNum
}}
</text>
位出行人
<text
class=
"title-bold"
v-if=
"contactNum -
orderTouristList.length > 0"
>
,还需
{{
contactNum
-
orderTouristLis
t
.
length
}}
位
</text>
<text
class=
"title-bold"
v-if=
"contactNum -
chooseContact.length > 0"
>
,还需
{{
contactNum
-
chooseContac
t
.
length
}}
位
</text>
</text>
</text>
</view>
</view>
<view
class=
"visitorPlus"
>
<view
class=
"visitorPlus"
>
<!-- 这里key必须是index,如果是id会出现数据改变和样式不改变的bug -->
<view
<view
class=
"plus-list"
class=
"plus-list"
:class=
"
{
on: item.ifChoose == true
}"
:class=
"
{
on:item.ifChoose
}"
v-for="(item, index) of contact
Data
.slice(0, 3)"
v-for="(item, index) of contact
Total
.slice(0, 3)"
@click="visitorChoose(index)"
@click="visitorChoose(index)"
:key="i
tem.id
"
:key="i
ndex
"
>
>
{{
item
.
name
}}
{{
item
.
name
}}
<view
v-if=
"item.ifChoose"
class=
"date-icon"
>
<u-icon
name=
"checkmark"
color=
"#ffffff"
></u-icon>
</view>
</view>
</view>
<view
@
click=
"showContacts()"
class=
"plus-list plus-list-last"
>
<view
@
click=
"showContacts()"
class=
"plus-list plus-list-last"
>
...
@@ -168,8 +172,8 @@
...
@@ -168,8 +172,8 @@
</view>
</view>
</view>
</view>
<view
class=
"visitorEdit"
v-show=
"
orderTouristLis
t.length > 0"
>
<view
class=
"visitorEdit"
v-show=
"
chooseContac
t.length > 0"
>
<view
class=
"edit-list"
v-for=
"(item, index) of
orderTouristLis
t"
:key=
"item.id"
>
<view
class=
"edit-list"
v-for=
"(item, index) of
chooseContac
t"
:key=
"item.id"
>
<view
@
click=
"delChooseContact(item, index)"
>
<view
@
click=
"delChooseContact(item, index)"
>
<u-icon
name=
"close-circle"
color=
"#3688ff"
size=
"40"
></u-icon>
<u-icon
name=
"close-circle"
color=
"#3688ff"
size=
"40"
></u-icon>
</view>
</view>
...
@@ -297,10 +301,8 @@
...
@@ -297,10 +301,8 @@
<contactList
<contactList
ref=
"contactList"
ref=
"contactList"
@
getEditContact=
"getEditContact"
@
getEditContact=
"getEditContact"
:contactData=
"contactData"
:contactTotal=
"contactTotal"
@
contactListConfig=
"contactListConfig"
:contactNum=
"contactNum"
:orderTouristList=
"orderTouristList"
:buyNum=
"contactNum"
></contactList>
></contactList>
<!--一个站点时获取排队信息弹窗-->
<!--一个站点时获取排队信息弹窗-->
...
@@ -379,8 +381,8 @@ export default {
...
@@ -379,8 +381,8 @@ export default {
interfaceCode
:
''
,
//接口编号
interfaceCode
:
''
,
//接口编号
merchantCode
:
''
,
//商户code
merchantCode
:
''
,
//商户code
productCode
:
''
,
//产品code
productCode
:
''
,
//产品code
contact
Data
:
[],
//联系人列表数据
contact
Total
:
[],
//所有联系人列表
orderTouristLis
t
:
[],
//选中的游客信息列表
chooseContac
t
:
[],
//选中的游客信息列表
contactNum
:
1
,
//需要选择几位联系人数量
contactNum
:
1
,
//需要选择几位联系人数量
cruisePlanId
:
''
,
//班次Id
cruisePlanId
:
''
,
//班次Id
chooseTimeData
:
''
,
//选中的时间传给子组件
chooseTimeData
:
''
,
//选中的时间传给子组件
...
@@ -480,7 +482,8 @@ export default {
...
@@ -480,7 +482,8 @@ export default {
merchantCode
:
this
.
merchantCode
//商户code
merchantCode
:
this
.
merchantCode
//商户code
}
}
uni
.
showLoading
({
uni
.
showLoading
({
title
:
'加载中'
title
:
'加载中'
,
mask
:
true
})
})
this
.
$request
(
'distribution/distribution/findNewFetchInfoFromSceinc'
,
data
).
then
(
res
=>
{
this
.
$request
(
'distribution/distribution/findNewFetchInfoFromSceinc'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
'00'
)
{
if
(
res
.
code
==
'00'
)
{
...
@@ -501,7 +504,8 @@ export default {
...
@@ -501,7 +504,8 @@ export default {
merchantCode
:
this
.
merchantCode
//商户code
merchantCode
:
this
.
merchantCode
//商户code
}
}
uni
.
showLoading
({
uni
.
showLoading
({
title
:
'加载中'
title
:
'加载中'
,
mask
:
true
})
})
this
.
$request
(
'distribution/distribution/findNewFetchInfoFromSceinc'
,
data
).
then
(
res
=>
{
this
.
$request
(
'distribution/distribution/findNewFetchInfoFromSceinc'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
'00'
)
{
if
(
res
.
code
==
'00'
)
{
...
@@ -585,7 +589,7 @@ export default {
...
@@ -585,7 +589,7 @@ export default {
//如果为班次票,点击时,请求班次票接口
//如果为班次票,点击时,请求班次票接口
this
.
cruisePlanId
=
''
//清空班次id
this
.
cruisePlanId
=
''
//清空班次id
this
.
timeActive
=
10000
this
.
timeActive
=
10000
this
.
getTimeStock
(
)
uni
.
$u
.
throttle
(
this
.
getTimeStock
,
3000
)
}
}
},
},
//---日历确认事件
//---日历确认事件
...
@@ -628,56 +632,28 @@ export default {
...
@@ -628,56 +632,28 @@ export default {
//---获取点击的编辑联系人信息,传给编辑联系人组件
//---获取点击的编辑联系人信息,传给编辑联系人组件
getEditContact
(
data
)
{
getEditContact
(
data
)
{
this
.
editContact
=
data
this
.
editContact
=
data
console
.
log
(
this
.
editContact
)
},
},
//---删除选中的联系人
//---删除选中的联系人
delChooseContact
(
item
,
index
)
{
delChooseContact
(
item
,
index
)
{
//所有联系人中找到删除联系人下标,改成未选中状态
//所有联系人中找到删除联系人下标,改成未选中状态
let
sub
=
this
.
contact
Data
.
findIndex
(
item2
=>
item2
.
id
==
item
.
id
)
let
sub
=
this
.
contact
Total
.
findIndex
(
item2
=>
item2
.
id
==
item
.
id
)
this
.
contact
Data
[
sub
].
ifChoose
=
false
this
.
contact
Total
[
sub
].
ifChoose
=
false
this
.
orderTouristLis
t
.
splice
(
index
,
1
)
//删除数组
this
.
chooseContac
t
.
splice
(
index
,
1
)
//删除数组
},
},
//---展示编辑联系人
//---展示编辑联系人
showEdit
(
obj
)
{
showEdit
(
obj
)
{
this
.
$refs
.
editContacts
.
showEdit
=
true
this
.
$refs
.
editContacts
.
showEdit
=
true
this
.
editContact
=
obj
this
.
editContact
=
obj
},
},
//---联系人列表选中确定之后传值事件
contactListConfig
(
data
)
{
//把选中的联系人放在前面
this
.
contactData
.
forEach
((
item
,
index
)
=>
{
data
.
forEach
(
item2
=>
{
if
(
item
.
id
==
item2
.
id
)
{
delete
this
.
contactData
[
index
]
}
})
})
this
.
contactData
=
this
.
contactData
.
filter
(
function
(
val
)
{
return
val
})
this
.
contactData
=
data
.
concat
(
this
.
contactData
)
//获取选中的联系人
this
.
orderTouristList
=
data
//清空之前的选中状态
this
.
contactData
.
forEach
(
item
=>
{
item
.
ifChoose
=
false
})
//选中的联系人,设为选中状态
this
.
contactData
.
forEach
(
item
=>
{
this
.
orderTouristList
.
forEach
(
item2
=>
{
if
(
item
.
id
==
item2
.
id
)
{
item
.
ifChoose
=
true
}
})
})
},
//---展示新增联系人,并获取联系人列表
//---展示新增联系人,并获取联系人列表
showContacts
()
{
showContacts
()
{
this
.
$refs
.
contactList
.
showPop
=
true
this
.
$refs
.
contactList
.
showPop
=
true
},
},
//---游客选择
//---游客选择
visitorChoose
(
i
)
{
visitorChoose
(
i
)
{
let
chooseList
=
this
.
orderTouristLis
t
let
chooseList
=
this
.
chooseContac
t
let
data
=
this
.
contact
Data
let
data
=
this
.
contact
Total
data
[
i
].
ifChoose
=
!
data
[
i
].
ifChoose
data
[
i
].
ifChoose
=
!
data
[
i
].
ifChoose
if
(
data
[
i
].
ifChoose
)
{
if
(
data
[
i
].
ifChoose
)
{
if
(
chooseList
.
length
==
this
.
contactNum
)
{
if
(
chooseList
.
length
==
this
.
contactNum
)
{
...
@@ -704,12 +680,24 @@ export default {
...
@@ -704,12 +680,24 @@ export default {
}
}
if
(
this
.
productIfo
.
tripTemplateFlag
==
1
)
{
if
(
this
.
productIfo
.
tripTemplateFlag
==
1
)
{
//实名制
//实名制
this
.
contactNum
=
e
.
value
//需要填写的联系人数量等于购买数量
this
.
contactNum
=
e
.
value
if
(
this
.
c
ontactNum
<
this
.
orderTouristList
.
length
)
{
if
(
this
.
c
hooseContact
.
length
>
this
.
contactNum
)
{
//当选中联系人数量大于购买数量时
//当选中联系人数量大于购买数量时
this
.
orderTouristList
.
splice
(
this
.
orderTouristList
.
length
-
1
,
1
)
//删除多余的联系人
this
.
chooseContact
.
splice
(
this
.
chooseContact
.
length
-
1
,
1
)
//删除多余的联系人
//联系人列表重新判断是否选中
this
.
contactTotal
.
forEach
(
item
=>
{
item
.
ifChoose
=
false
})
this
.
chooseContact
.
forEach
(
item
=>
{
this
.
contactTotal
.
forEach
(
item2
=>
{
if
(
item
.
id
==
item2
.
id
){
item2
.
ifChoose
=
true
}
}
}
else
if
(
this
.
productIfo
.
tripTemplateFlag
==
0
)
{
})
})
}
}
if
(
this
.
productIfo
.
tripTemplateFlag
==
0
)
{
//非实名制
//非实名制
this
.
contactNum
=
1
this
.
contactNum
=
1
}
}
...
@@ -724,7 +712,8 @@ export default {
...
@@ -724,7 +712,8 @@ export default {
id
:
this
.
productId
//产品id
id
:
this
.
productId
//产品id
}
}
uni
.
showLoading
({
uni
.
showLoading
({
title
:
'加载中'
title
:
'加载中'
,
mask
:
true
})
})
this
.
$request
(
'scenic/groupGood/loadProduct'
,
data
).
then
(
res
=>
{
this
.
$request
(
'scenic/groupGood/loadProduct'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
'00'
)
{
if
(
res
.
code
==
'00'
)
{
...
@@ -745,9 +734,6 @@ export default {
...
@@ -745,9 +734,6 @@ export default {
this
.
merchantId
=
res
.
data
.
merchantId
//重新赋值商户id
this
.
merchantId
=
res
.
data
.
merchantId
//重新赋值商户id
this
.
beforeBookDays
=
res
.
data
.
beforeBookDays
||
0
//提前预定天数
this
.
beforeBookDays
=
res
.
data
.
beforeBookDays
||
0
//提前预定天数
this
.
buyKnowData
=
res
.
data
//购买须知,传给子组件
this
.
buyKnowData
=
res
.
data
//购买须知,传给子组件
setTimeout
(()
=>
{
console
.
log
(
this
.
buyKnowData
)
},
5000
)
this
.
loadProductResVoList
=
res
.
data
.
loadProductResVoList
//额外服务
this
.
loadProductResVoList
=
res
.
data
.
loadProductResVoList
//额外服务
this
.
afterBuyUrl
=
res
.
data
.
afterBuyUrl
||
''
//支付成功后页面跳转
this
.
afterBuyUrl
=
res
.
data
.
afterBuyUrl
||
''
//支付成功后页面跳转
//this.choooseService=res.data.data.loadProductResVoList//默认全部选中
//this.choooseService=res.data.data.loadProductResVoList//默认全部选中
...
@@ -882,12 +868,12 @@ export default {
...
@@ -882,12 +868,12 @@ export default {
productCode
:
this
.
productIfo
.
code
//产品code
productCode
:
this
.
productIfo
.
code
//产品code
}
}
uni
.
showLoading
({
uni
.
showLoading
({
title
:
'加载中'
title
:
'加载中'
,
mask
:
true
})
})
this
.
$request
(
'distribution/distribution/getTimeStock'
,
data
).
then
(
res
=>
{
this
.
$request
(
'distribution/distribution/getTimeStock'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
'00'
)
{
if
(
res
.
code
==
'00'
)
{
this
.
timeList
=
res
.
data
this
.
timeList
=
res
.
data
console
.
log
(
this
.
timeList
)
this
.
timeList
.
forEach
((
item
,
index
)
=>
{
this
.
timeList
.
forEach
((
item
,
index
)
=>
{
//增加一个时间Number字段,用于判断当前时间大于班次结束时间时,不显示该班次
//增加一个时间Number字段,用于判断当前时间大于班次结束时间时,不显示该班次
item
.
timeNumber
=
parseInt
(
this
.
$commonjs
.
changeTime
(
item
.
planDate
.
substr
(
0
,
10
)
+
item
.
endPlanTime
))
item
.
timeNumber
=
parseInt
(
this
.
$commonjs
.
changeTime
(
item
.
planDate
.
substr
(
0
,
10
)
+
item
.
endPlanTime
))
...
@@ -910,23 +896,23 @@ export default {
...
@@ -910,23 +896,23 @@ 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
.
contact
Data
=
res
.
data
this
.
contact
Total
=
res
.
data
this
.
contact
Data
.
forEach
(
item
=>
{
this
.
contact
Total
.
forEach
(
item
=>
{
//用于判断是否被选中
//用于判断是否被选中
item
.
ifChoose
=
false
item
.
ifChoose
=
false
})
})
//编辑成功重新调该方法时,把之前选中的游客,设为选中状态
//编辑成功重新调该方法时,把之前选中的游客,设为选中状态
this
.
contact
Data
.
forEach
(
item
=>
{
this
.
contact
Total
.
forEach
(
item
=>
{
this
.
orderTouristLis
t
.
forEach
(
item2
=>
{
this
.
chooseContac
t
.
forEach
(
item2
=>
{
if
(
item
.
id
==
item2
.
id
)
{
if
(
item
.
id
==
item2
.
id
)
{
item
.
ifChoose
=
true
item
.
ifChoose
=
true
}
}
})
})
})
})
//删除联系人成功重新调该方法时,之前选中的联系人,数据库可能被删除,删除该联系人
//删除联系人成功重新调该方法时,之前选中的联系人,数据库可能被删除,删除该联系人
this
.
orderTouristLis
t
.
forEach
((
item
,
index
)
=>
{
this
.
chooseContac
t
.
forEach
((
item
,
index
)
=>
{
if
(
!
this
.
contact
Data
.
find
(
item2
=>
item
.
id
==
item2
.
id
))
{
if
(
!
this
.
contact
Total
.
find
(
item2
=>
item
.
id
==
item2
.
id
))
{
this
.
orderTouristLis
t
.
splice
(
index
,
1
)
this
.
chooseContac
t
.
splice
(
index
,
1
)
}
}
})
})
}
else
{
}
else
{
...
@@ -944,14 +930,14 @@ export default {
...
@@ -944,14 +930,14 @@ 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
.
contact
Data
=
res
.
data
this
.
contact
Total
=
res
.
data
for
(
let
i
=
0
;
i
<
this
.
contactNum
;
i
++
)
{
for
(
let
i
=
0
;
i
<
this
.
contactNum
;
i
++
)
{
let
item
=
this
.
contact
Data
[
i
]
||
null
let
item
=
this
.
contact
Total
[
i
]
||
null
if
(
item
)
{
if
(
item
)
{
item
.
ifChoose
=
true
item
.
ifChoose
=
true
}
}
}
}
this
.
orderTouristList
=
this
.
contactData
.
slice
(
0
,
this
.
contactNum
)
this
.
chooseContact
=
this
.
contactTotal
.
slice
(
0
,
this
.
contactNum
)
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
title
:
res
.
message
,
title
:
res
.
message
,
...
@@ -1007,7 +993,7 @@ export default {
...
@@ -1007,7 +993,7 @@ export default {
}
}
if
(
this
.
productIfo
.
tripTemplateFlag
==
1
)
{
if
(
this
.
productIfo
.
tripTemplateFlag
==
1
)
{
//实名制
//实名制
if
(
this
.
orderTouristLis
t
.
length
!=
this
.
buyNum
)
{
if
(
this
.
chooseContac
t
.
length
!=
this
.
buyNum
)
{
uni
.
showToast
({
uni
.
showToast
({
title
:
'需要添加'
+
this
.
buyNum
+
'位出行人'
,
title
:
'需要添加'
+
this
.
buyNum
+
'位出行人'
,
icon
:
'none'
icon
:
'none'
...
@@ -1016,7 +1002,7 @@ export default {
...
@@ -1016,7 +1002,7 @@ export default {
}
}
}
else
if
(
this
.
productIfo
.
tripTemplateFlag
==
0
)
{
}
else
if
(
this
.
productIfo
.
tripTemplateFlag
==
0
)
{
//非实名制
//非实名制
if
(
this
.
orderTouristLis
t
.
length
<
1
)
{
if
(
this
.
chooseContac
t
.
length
<
1
)
{
uni
.
showToast
({
uni
.
showToast
({
title
:
'需要添加一位出行人'
,
title
:
'需要添加一位出行人'
,
icon
:
'none'
icon
:
'none'
...
@@ -1084,7 +1070,7 @@ export default {
...
@@ -1084,7 +1070,7 @@ export default {
}
}
if
(
this
.
productIfo
.
tripTemplateFlag
==
1
)
{
if
(
this
.
productIfo
.
tripTemplateFlag
==
1
)
{
//实名制
//实名制
if
(
this
.
orderTouristLis
t
.
length
!=
this
.
buyNum
)
{
if
(
this
.
chooseContac
t
.
length
!=
this
.
buyNum
)
{
uni
.
showToast
({
uni
.
showToast
({
title
:
'需要添加'
+
this
.
buyNum
+
'位出行人'
,
title
:
'需要添加'
+
this
.
buyNum
+
'位出行人'
,
icon
:
'none'
icon
:
'none'
...
@@ -1093,7 +1079,7 @@ export default {
...
@@ -1093,7 +1079,7 @@ export default {
}
}
}
else
if
(
this
.
productIfo
.
tripTemplateFlag
==
0
)
{
}
else
if
(
this
.
productIfo
.
tripTemplateFlag
==
0
)
{
//非实名制
//非实名制
if
(
this
.
orderTouristLis
t
.
length
<
1
)
{
if
(
this
.
chooseContac
t
.
length
<
1
)
{
uni
.
showToast
({
uni
.
showToast
({
title
:
'需要添加一位出行人'
,
title
:
'需要添加一位出行人'
,
icon
:
'none'
icon
:
'none'
...
@@ -1141,7 +1127,7 @@ export default {
...
@@ -1141,7 +1127,7 @@ export default {
let
bookEndTime
=
new
Date
(
endDate
).
getTime
()
let
bookEndTime
=
new
Date
(
endDate
).
getTime
()
//参数游客信息组装
//参数游客信息组装
let
reservationInfoList
=
[]
let
reservationInfoList
=
[]
this
.
orderTouristLis
t
.
forEach
((
item
,
index
)
=>
{
this
.
chooseContac
t
.
forEach
((
item
,
index
)
=>
{
reservationInfoList
.
push
({
reservationInfoList
.
push
({
category
:
0
,
category
:
0
,
name
:
item
.
name
,
name
:
item
.
name
,
...
...
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