Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨炀
/
gd_yc
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
699dfdee
authored
2024-11-20 21:23:17 +0800
by
华明祺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
no message
1 parent
5beac84c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
240 additions
and
167 deletions
src/common/hotel.js
src/common/request.js
src/pages_hotel/hotel/billDetail.vue
src/common/hotel.js
View file @
699dfde
import
request
from
'./request.js'
import
config
from
'@/config.js'
function
getTrainList
(
params
)
{
return
request
({
...
...
@@ -19,9 +18,11 @@ function getComanyList(params) {
function
getTrainDetail
(
id
)
{
return
request
({
url
:
`/train/info/getTrainByUser
/
${
id
}
`
,
url
:
`/train/info/getTrainByUser`
,
method
:
'get'
,
params
:
id
params
:
{
id
}
})
}
...
...
@@ -115,8 +116,11 @@ function getInvoiceDetailBills(invoiceId) {
function
getInvoiceDetail
(
invoiceId
)
{
return
request
({
url
:
`/train/invoice/
${
invoiceId
}
`
,
method
:
'get'
url
:
`/train/invoice/getInvoiceById`
,
method
:
'get'
,
params
:
{
id
:
invoiceId
}
})
}
...
...
@@ -126,26 +130,20 @@ function getInvoiceByUserId() {
method
:
'get'
})
}
// /-sss--sss--sssssss---ssssssssss-----////
function
getbilllist
(
userId
,
venueId
)
{
return
request
({
url
:
`/logex/order/list?createById=
${
userId
}
&venueId=
${
venueId
}
`
,
method
:
'get'
,
params
:
userId
method
:
'get'
})
}
function
getbilldetailbyId
(
orderId
)
{
return
request
({
// url: `/logex/order/${orderId}`,
url
:
`/logex/norder/
${
orderId
}
`
,
method
:
'get'
,
params
:
orderId
method
:
'get'
})
}
...
...
@@ -178,8 +176,7 @@ function cancelOrder() {
function
cancelOrder2
(
orderId
)
{
return
request
({
url
:
`/logex/norder/cancelOrderBack//
${
orderId
}
`
,
method
:
'post'
,
params
:
orderId
method
:
'post'
})
}
...
...
@@ -188,8 +185,7 @@ function payForOrder(orderId) {
return
request
({
// url: `/logex/order/payForOrder?orderId=${orderId}&openId=${nowOpenId}`,
url
:
`/train/order/payForOrder?orderId=
${
orderId
}
`
,
method
:
'post'
,
params
:
orderId
method
:
'post'
})
}
...
...
src/common/request.js
View file @
699dfde
...
...
@@ -25,17 +25,9 @@ function getToken() {
// 获取请求头
function
getHeaders
()
{
let
header
if
(
config
.
localPort
)
{
header
=
{
"isToken"
:
false
,
'content-type'
:
'application/x-www-form-urlencoded'
}
}
else
{
header
=
{
"Authorization"
:
getToken
(),
"Content-Type"
:
"application/json"
,
}
const
header
=
{
"isToken"
:
false
,
'content-type'
:
'application/x-www-form-urlencoded'
}
return
header
...
...
@@ -61,18 +53,19 @@ let request = function(req) {
const
token
=
getToken
()
let
tempUrl
=
req
.
url
// if (token) {
if
(
tempUrl
.
indexOf
(
'?'
)
>
-
1
)
{
tempUrl
+=
'&userNo='
+
token
}
else
{
tempUrl
+=
'?userNo='
+
token
if
(
token
)
{
if
(
tempUrl
.
indexOf
(
'?'
)
>
-
1
)
{
tempUrl
+=
'&userNo='
+
token
}
else
{
tempUrl
+=
'?userNo='
+
token
}
}
// }
let
url
,
data
if
(
config
.
localPort
)
{
const
baseUrl
=
config
.
localPort
+
'/jsintszxd/request'
if
(
req
.
method
===
'POST'
)
{
req
.
params
.
userNo
=
token
url
=
baseUrl
data
=
{
appSecretId
:
config
.
appSecretId
,
...
...
@@ -92,8 +85,23 @@ let request = function(req) {
url
=
`
${
baseUrl
}
?appSecretId=
${
config
.
appSecretId
}
&restApi=
${
encodeURIComponent
(
tempUrl
)}
`
}
}
else
{
if
(
req
.
method
===
'POST'
)
{
req
.
params
.
userNo
=
token
data
=
{
jsonBody
:
JSON
.
stringify
(
req
.
params
)
}
}
else
{
if
(
req
.
params
)
{
for
(
const
key
of
Object
.
keys
(
req
.
params
))
{
if
(
tempUrl
.
indexOf
(
'?'
)
>
-
1
)
{
tempUrl
+=
`&
${
key
}
=
${
req
.
params
[
key
]}
`
}
else
{
tempUrl
+=
`?
${
key
}
=
${
req
.
params
[
key
]}
`
}
}
}
}
url
=
config
.
baseUrl_api
+
tempUrl
data
=
req
.
params
}
return
new
Promise
((
resolve
,
reject
)
=>
{
...
...
src/pages_hotel/hotel/billDetail.vue
View file @
699dfde
<
template
>
<
template
>
<view
:style=
"orderType=='all'?'':'height: calc(100vh - 200rpx);overflow: auto;'"
>
<view
class=
"colorfulBg"
>
<view
class=
"name"
>
{{
form
.
name
}}
</view>
<view
class=
"whiteItem"
v-if=
"orderType==0||orderType=='all'"
>
<view
class=
"pp"
>
报到时间:
{{
form
.
reportDate
?.
substring
(
0
,
10
)
}}
</view>
<view
class=
"pp"
>
培训周期:
{{
form
.
trainStart
?.
substring
(
0
,
10
)
}}
—
{{
form
.
trainEnd
?.
substring
(
0
,
10
)
}}
</view>
<!--
<view
class=
"pp"
>
培训地点:
{{
form
.
address
}}
</view>
-->
</view>
<view
class=
"whiteItem"
v-if=
"orderType==1||orderType=='all'"
>
<view
class=
"pp"
>
入住时间:
{{
form
.
trainStart
?.
substring
(
0
,
10
)
}}
—
{{
form
.
trainEnd
?.
substring
(
0
,
10
)
}}
</view>
<view
class=
"pp"
>
房费:
{{
form
.
stayFee
}}
</view>
</view>
<view
class=
"whiteItem"
v-if=
"orderType==2||orderType=='all'"
>
<view
class=
"pp"
>
就餐次数:
{{
form
.
repastNum
}}
次
</view>
<view
class=
"pp"
>
餐费:
{{
form
.
repastFee
}}
</view>
</view>
</view>
<uni-forms>
<view
class=
"colorfulBg"
>
<view
class=
"name"
>
{{
form
.
name
}}
</view>
<view
class=
"whiteItem"
v-if=
"orderType==0||orderType=='all'"
>
<view
class=
"pp"
>
报到时间:
{{
form
.
reportDate
?.
substring
(
0
,
10
)
}}
</view>
<view
class=
"pp"
>
培训周期:
{{
form
.
trainStart
?.
substring
(
0
,
10
)
}}
—
{{
form
.
trainEnd
?.
substring
(
0
,
10
)
}}
</view>
<!--
<view
class=
"pp"
>
培训地点:
{{
form
.
address
}}
</view>
-->
</view>
<view
class=
"whiteItem"
v-if=
"orderType==1||orderType=='all'"
>
<view
class=
"pp"
>
入住时间:
{{
form
.
trainStart
?.
substring
(
0
,
10
)
}}
—
{{
form
.
trainEnd
?.
substring
(
0
,
10
)
}}
</view>
<view
class=
"pp"
>
房费:
{{
form
.
stayFee
}}
</view>
</view>
<view
class=
"whiteItem"
v-if=
"orderType==2||orderType=='all'"
>
<view
class=
"pp"
>
就餐次数:
{{
form
.
repastNum
}}
次
</view>
<view
class=
"pp"
>
餐费:
{{
form
.
repastFee
}}
</view>
</view>
</view>
<
!--
<
uni-forms>
<view>
<view
class=
"t"
>
培训人员信息
</view>
<view
class=
"t"
>
培训人员信息
</view>
<view
class=
"whiteItem"
>
<view
class=
"pp"
>
工号:
<text>
{{
detail
.
userNo
}}
</text></view>
<view
class=
"pp"
>
姓名:
<text>
{{
detail
.
nickName
}}
</text></view>
<view
class=
"pp"
>
性别:
<text>
{{
detail
.
sex
==
'0'
?
'男'
:
'女'
}}
</text></view>
<view
class=
"pp"
>
身份证号码:
<text>
{{
detail
.
card
}}
</text></view>
<view
class=
"pp"
>
单位名称:
<text>
{{
detail
.
companyName
}}
</text></view>
<view
class=
"pp"
>
部门:
<text>
{{
detail
.
deptName
}}
</text></view>
<view
class=
"pp"
>
岗位:
<text>
{{
detail
.
postName
}}
</text></view>
<view
class=
"pp"
>
联系方式:
<text>
{{
detail
.
phonenumber
}}
</text></view>
<view
class=
"pp"
>
备注信息:
<text>
{{
detail
.
userNo
}}
</text></view>
<view
class=
"pp"
>
工号:
<text>
{{
detail
.
userNo
}}
</text></view>
<view
class=
"pp"
>
姓名:
<text>
{{
detail
.
nickName
}}
</text></view>
<view
class=
"pp"
>
性别:
<text>
{{
detail
.
sex
==
'0'
?
'男'
:
'女'
}}
</text></view>
<view
class=
"pp"
>
身份证号码:
<text>
{{
detail
.
card
}}
</text></view>
<view
class=
"pp"
>
单位名称:
<text>
{{
detail
.
companyName
}}
</text></view>
<view
class=
"pp"
>
部门:
<text>
{{
detail
.
deptName
}}
</text></view>
<view
class=
"pp"
>
岗位:
<text>
{{
detail
.
postName
}}
</text></view>
<view
class=
"pp"
>
联系方式:
<text>
{{
detail
.
phonenumber
}}
</text></view>
<view
class=
"pp"
>
备注信息:
<text>
{{
detail
.
userNo
}}
</text></view>
</view>
</view>
</view>
</uni-forms>
</view>
<view
class=
"bbfix"
v-if=
"orderType!='all'"
>
<!-- 底部提交 -->
<view
class=
"price"
>
总价:
<text
v-if=
"orderType==0"
>
¥
{{
form
.
trainFee
}}
</text>
<text
v-if=
"orderType==1"
>
¥
{{
form
.
stayFee
}}
</text>
<text
v-if=
"orderType==2"
>
¥
{{
form
.
repastFee
}}
</text>
</view>
</uni-forms>
-->
</view>
<view
class=
"bbfix"
v-if=
"orderType!='all'"
>
<!-- 底部提交 -->
<view
class=
"price"
>
总价:
<text
v-if=
"orderType==0"
>
¥
{{
form
.
trainFee
}}
</text>
<text
v-if=
"orderType==1"
>
¥
{{
form
.
stayFee
}}
</text>
<text
v-if=
"orderType==2"
>
¥
{{
form
.
repastFee
}}
</text>
</view>
<view
class=
"subBtn"
@
click=
"unsubscribe"
v-if=
"status == '1'"
>
退订
</view>
</view>
<uni-popup
ref=
"tdpopup"
background-color=
"#fff"
class=
"popupMation"
type=
"bottom"
>
<view
class=
"popup-content"
>
<view
class=
"centertitle"
>
退订说明
</view>
<view>
<view
class=
"pp"
>
退订联系人:
<text>
{{
info
.
name
}}
</text>
</view>
<view
class=
"pp"
@
click=
"callphone(info.tel)"
>
联系电话:
<text>
{{
info
.
tel
}}
</text>
</view>
<view
class=
"pp"
>
邮箱:
<text>
{{
info
.
email
}}
</text>
</view>
</view>
</view>
</uni-popup>
</view>
<uni-popup
ref=
"tdpopup"
background-color=
"#fff"
class=
"popupMation"
type=
"bottom"
>
<view
class=
"popup-content"
>
<view
class=
"centertitle"
>
退订说明
</view>
<view>
<view
class=
"pp"
>
退订联系人:
<text>
{{
info
.
name
}}
</text>
</view>
<view
class=
"pp"
@
click=
"callphone(info.tel)"
>
联系电话:
<text>
{{
info
.
tel
}}
</text>
</view>
<view
class=
"pp"
>
邮箱:
<text>
{{
info
.
email
}}
</text>
</view>
</view>
</view>
</uni-popup>
</
template
>
<
script
setup
>
import
{
reactive
,
toRefs
}
from
'vue'
;
import
{
onLoad
,
onShow
}
from
'@dcloudio/uni-app'
;
import
*
as
api
from
'@/common/api.js'
;
import
*
as
hotel
from
'@/common/hotel.js'
;
import
{
reactive
,
toRefs
}
from
'vue'
;
import
{
onLoad
,
onShow
}
from
'@dcloudio/uni-app'
;
import
*
as
api
from
'@/common/api.js'
;
import
*
as
hotel
from
'@/common/hotel.js'
;
const
data
=
reactive
({
form
:
{
},
status
:
null
,
tdpopup
:
null
,
detail
:{},
info
:{},
orderType
:
''
form
:
{},
status
:
null
,
tdpopup
:
null
,
detail
:
{},
info
:
{},
orderType
:
''
})
const
{
form
,
detail
,
orderType
,
info
,
status
,
tdpopup
}
=
toRefs
(
data
);
let
trainId
=
''
onLoad
((
options
)
=>
{
trainId
=
options
.
trainId
orderType
.
value
=
options
.
orderType
console
.
log
(
orderType
.
value
)
status
.
value
=
options
.
status
init
()
})
function
init
(){
getData
()
}
function
getData
(){
// 培训详情
hotel
.
getTrainDetail
(
trainId
).
then
(
res
=>
{
form
.
value
=
res
.
data
})
// 用户信息
api
.
checkReport
().
then
((
res
)
=>
{
detail
.
value
=
res
.
data
})
}
function
unsubscribe
(){
hotel
.
cancelOrder
().
then
(
res
=>
{
info
.
value
=
res
.
data
tdpopup
.
value
.
open
()
})
}
form
,
detail
,
orderType
,
info
,
status
,
tdpopup
}
=
toRefs
(
data
);
let
trainId
=
''
onLoad
((
options
)
=>
{
trainId
=
options
.
trainId
orderType
.
value
=
options
.
orderType
console
.
log
(
orderType
.
value
)
status
.
value
=
options
.
status
init
()
})
function
init
()
{
getData
()
}
function
getData
()
{
// 培训详情
hotel
.
getTrainDetail
(
trainId
).
then
(
res
=>
{
form
.
value
=
res
.
data
})
// 用户信息
// api.checkReport().then((res)=>{
// detail.value = res.data
// })
}
function
unsubscribe
()
{
hotel
.
cancelOrder
().
then
(
res
=>
{
info
.
value
=
res
.
data
tdpopup
.
value
.
open
()
})
}
function
callphone
(
number
)
{
uni
.
makePhoneCall
({
phoneNumber
:
number
});
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
:deep
(
.uni-forms-item__inner
)
{
padding-bottom
:
10
rpx
;}
:deep
(
.uni-forms-item__content
)
{
line-height
:
36px
;}
.t
{
padding
:
20
rpx
;}
.hotel
{
}
.whiteItem
{
width
:
700
rpx
;
<
style
lang=
"scss"
scoped
>
:deep
(
.uni-forms-item__inner
)
{
padding-bottom
:
10
rpx
;
}
:deep
(
.uni-forms-item__content
)
{
line-height
:
36px
;
}
.t
{
padding
:
20
rpx
;
}
.hotel
{}
.whiteItem
{
width
:
700
rpx
;
box-sizing
:
border-box
;
margin
:
0
auto
26
rpx
;
padding
:
26
rpx
;
background
:
#FFFFFF
;
box-shadow
:
0
rpx
0
rpx
27
rpx
0
rpx
#DEDEDE
;
border-radius
:
15
rpx
;}
.roomType
{
color
:
#4C5359
;
font-size
:
28
rpx
;
margin
:
10
rpx
0
;}
.roomInfo
{
color
:
#4C5359
;
font-size
:
28
rpx
;}
.tip
{
font-size
:
28
rpx
;
color
:
#E60012
;}
border-radius
:
15
rpx
;
}
.roomType
{
color
:
#4C5359
;
font-size
:
28
rpx
;
margin
:
10
rpx
0
;
}
.roomInfo
{
color
:
#4C5359
;
font-size
:
28
rpx
;
}
.tip
{
font-size
:
28
rpx
;
color
:
#E60012
;
}
.bbfix
{
background
:
#fff
;
height
:
150
rpx
;
...
...
@@ -161,23 +199,54 @@ function unsubscribe(){
color
:
#ff8124
;
}
}
.subBtn
{
font-size
:
32
rpx
;
color
:
#1EC886
;
border
:
1px
solid
#1EC886
;
color
:
#1EC886
;
border
:
1px
solid
#1EC886
;
background
:
transparent
;
height
:
60
rpx
;
margin
:
15
rpx
;
height
:
60
rpx
;
margin
:
15
rpx
;
line-height
:
60
rpx
;
padding
:
0
30
rpx
;
}
.subBtn.gray
{
color
:
#999
;
border
:
1px
solid
#999
;}
}
.ccitem
{
display
:
flex
;
justify-content
:
space-between
;
font-size
:
28
rpx
;
color
:
#666
;
margin
:
0
0
10
rpx
;
label{
font-size
:
32
rpx
;
color
:
#000
;}
text
{
color
:
#1EC886
;}
}
.colorfulBg
{
background
:
#1EC886
;
padding
:
20
rpx
10
rpx
10
rpx
;
.whiteItem{
border-radius
:
0
;
margin
:
0
;
width
:
730
rpx
;}
.name
{
color
:
#fff
;
margin
:
0
0
20
rpx
;}
}
.subBtn.gray
{
color
:
#999
;
border
:
1px
solid
#999
;
}
}
.ccitem
{
display
:
flex
;
justify-content
:
space-between
;
font-size
:
28
rpx
;
color
:
#666
;
margin
:
0
0
10
rpx
;
label
{
font-size
:
32
rpx
;
color
:
#000
;
}
text
{
color
:
#1EC886
;
}
}
.colorfulBg
{
background
:
#1EC886
;
padding
:
20
rpx
10
rpx
10
rpx
;
.whiteItem
{
border-radius
:
0
;
margin
:
0
;
width
:
730
rpx
;
}
.name
{
color
:
#fff
;
margin
:
0
0
20
rpx
;
}
}
</
style
>
\ No newline at end of file
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment