Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
million
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
viitto
million
Commits
d9109bfc
Commit
d9109bfc
authored
Jul 07, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/viitto/million
parents
060c7e0d
66367012
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
291 additions
and
8 deletions
+291
-8
utils.js
src/boot/utils.js
+52
-0
orderlist.vue
src/pages/usercenter/orderlist.vue
+239
-8
No files found.
src/boot/utils.js
View file @
d9109bfc
...
...
@@ -19,6 +19,8 @@ Vue.prototype.domainManager = function () {
DomainUrl
:
domainUrl
,
//常用提交数据URL
PostUrl
:
domainUrl
+
"/api/common/post"
,
javaUrl
:
'http://efficient.oytour.com'
};
return
obj
;
}
...
...
@@ -59,6 +61,56 @@ Vue.prototype.apipost = function (cmd, msg, successCall, faildCall) {
},
faildCall
)
}
Vue
.
prototype
.
apiJavaPost
=
function
(
cmd
,
msg
,
successCall
,
faildCall
)
{
if
(
msg
==
null
||
msg
==
""
)
{
msg
=
{}
}
var
apiurl
=
this
.
domainManager
().
javaUrl
+
cmd
;
var
timestamp
=
(
new
Date
()).
valueOf
();
this
.
apiurl
=
apiurl
;
var
token
=
""
;
var
key
=
""
;
if
(
this
.
getLocalStorage
()
!=
null
)
{
token
=
this
.
getLocalStorage
().
token
;
key
=
this
.
getLocalStorage
().
secretKey
;
}
var
encodeMsg
=
encodeURIComponent
(
JSON
.
stringify
(
msg
)).
toLowerCase
();
var
md5Str
=
md5
(
`msg=
${
encodeMsg
}
×tamp=
${
timestamp
}
&token=
${
token
}
&key=
${
key
}
`
);
var
postData
=
{
"msg"
:
msg
,
"timestamp"
:
timestamp
,
"token"
:
token
,
"sign"
:
md5Str
}
if
(
localStorage
.
g
&&
localStorage
.
g
!=
'undefined'
)
{
var
groupJson
=
JSON
.
parse
(
localStorage
.
g
);
postData
.
groupId
=
groupJson
.
i
;
}
this
.
$axios
.
post
(
apiurl
,
postData
,
{
headers
:
{
'Content-Type'
:
'application/json'
,
'Referer-Viitto'
:
this
.
$route
.
path
}
})
.
then
(
res
=>
{
if
(
res
.
data
.
resultCode
==
10000
||
res
.
data
.
resultCode
==
10001
)
{
this
.
$router
.
push
({
path
:
'/login'
})
}
else
if
(
res
.
data
.
resultCode
==
10005
)
{
this
.
$router
.
go
(
-
1
)
}
else
{
if
(
res
.
data
.
award
&&
res
.
data
.
award
.
mName
!==
null
)
{
this
.
MsgBus
.
$emit
(
'openRaffleTickets'
,
res
.
data
.
award
)
}
successCall
(
res
)
}
},
faildCall
)
},
//获取缓存
Vue
.
prototype
.
getLocalStorage
=
function
()
{
try
{
...
...
src/pages/usercenter/orderlist.vue
View file @
d9109bfc
<
style
>
.demandlist
{
padding
:
30px
20px
;
width
:
100%
;
max-width
:
1200px
;
margin
:
0
auto
;
}
.order-header
{
display
:
flex
;
align-items
:
flex-start
;
margin
:
20px
0
;
}
.order-header
.order_title
{
margin-right
:
20px
;
font-size
:
25px
;
color
:
#666
;
font-weight
:
400
;
}
.order-header
.type-item
{
margin
:
0
15px
;
cursor
:
pointer
;
}
.order-header
.type-item
a
{
font-size
:
16px
;
padding
:
0
2px
12px
;
text-decoration
:
none
;
}
.type-item
.is-acted
{
color
:
#00afff
;
border-bottom
:
2px
solid
#00afff
;
}
.type-bar
{
display
:
flex
;
align-items
:
center
;
margin
:
0
;
padding
:
0
;
}
.type-bar
li
{
list-style-type
:
none
;
}
.order_link
{
display
:
block
;
padding
:
20px
25px
;
}
.order-list
li
{
margin-bottom
:
15px
;
font-size
:
0
;
background-color
:
#fff
;
box-shadow
:
0
2px
4px
0
rgba
(
10
,
8
,
8
,
.5
);
transition
:
transform
.2s
ease
,
box-shadow
.2s
ease
;
}
.order_link
.order_tour
{
font-size
:
16px
;
padding-right
:
10px
;
width
:
calc
(
100%
-
90px
);
display
:
inline-block
;
vertical-align
:
middle
;
}
.tour-name
{
margin-bottom
:
5px
;
color
:
#333
;
}
.order_link
.order-status
{
font-size
:
15px
;
display
:
inline-block
;
vertical-align
:
middle
;
color
:
#999
;
}
.order-list
li
.order-status
:not
(
:last-child
)
{
margin-right
:
20px
;
}
.order-status-ch
{
width
:
90px
;
color
:
#333
;
text-align
:
center
;
display
:
inline-block
;
vertical-align
:
middle
;
}
.order-status-tag
{
padding
:
2px
12px
;
background-color
:
#e2f0fb
;
color
:
#00afff
;
border-radius
:
50px
;
background-clip
:
padding-box
;
display
:
inline-block
;
vertical-align
:
middle
;
font-size
:
13px
;
}
@media
only
screen
and
(
min-width
:
768px
)
{
.order-list
li
:hover
{
-webkit-transform
:
translate
(
0
,
-4px
);
-moz-transform
:
translate
(
0
,
-4px
);
-ms-transform
:
translate
(
0
,
-4px
);
-o-transform
:
translate
(
0
,
-4px
);
transform
:
translate
(
0
,
-4px
);
-webkit-box-shadow
:
0
4px
25px
0
rgba
(
0
,
0
,
0
,
.2
),
0
0
0
0
rgba
(
0
,
0
,
0
,
.1
);
-moz-box-shadow
:
0
4px
25px
0
rgba
(
0
,
0
,
0
,
.2
),
0
0
0
0
rgba
(
0
,
0
,
0
,
.1
);
box-shadow
:
0
4px
25px
0
rgba
(
0
,
0
,
0
,
.2
),
0
0
0
0
rgba
(
0
,
0
,
0
,
.1
);
}
}
.demandlist
.items-center
{
justify-content
:
center
;
}
</
style
>
<
template
>
<q-page>
<div
class=
"orderlist"
>
订单列表
<div
class=
"demandlist"
>
<div
class=
"order-header"
>
<div
class=
"order_title"
>
我的訂單
</div>
<ul
class=
"type-bar"
>
<li
class=
"type-item"
v-for=
"(item,index) in TitList"
@
click=
"handleClick(item)"
:key=
"index"
>
<a
:class=
"
{'is-acted':checked==item.ID}">
{{
item
.
Type
}}
</a>
</li>
</ul>
</div>
<ul
class=
"order-list"
>
<li
v-for=
"(item,index) in DataList"
:key=
"index"
>
<a
class=
"order_link"
>
<div
class=
"order_tour"
>
<div
class=
"tour-name"
>
{{
item
.
title
}}
</div>
<div
class=
"order-status"
>
訂購日期:
{{
item
.
createDate
}}
</div>
<div
class=
"order-status"
>
出發日期:
{{
item
.
startDate
}}
</div>
<div
class=
"order-status"
>
訂單編號:
{{
item
.
orderId
}}
</div>
<div
class=
"order-status"
>
旅客:
{{
item
.
guestNum
}}
</div>
<div
class=
"order-status"
>
總額:
{{
item
.
preferPrice
}}
</div>
</div>
<div
class=
"order-status-ch"
>
<div
class=
"order-status-tag"
>
<span
v-if=
"item.orderState === 1"
>
待付定金
</span>
<span
v-else-if=
"item.orderState === 2"
>
待付尾款
</span>
<span
v-else-if=
"item.orderState === 3"
>
待发团
</span>
<span
v-else-if=
"item.orderState === 4"
>
交易完成
</span>
<span
v-else-if=
"item.orderState === 5"
>
取消
</span>
</div>
</div>
</a>
</li>
<q-pagination
v-if=
"pageCount>1"
v-model=
"getOrderMsg.pageIndex"
:max=
"pageCount"
@
input=
"gerOrderList()"
:direction-links=
"true"
>
</q-pagination>
</ul>
</div>
</q-page>
</
template
>
...
...
@@ -11,18 +177,83 @@
props
:
[],
data
()
{
return
{
qMsg
:
{
PageIndex
:
1
,
PageSize
:
10
,
CreateBy
:
0
,
},
DataList
:
[],
pageCount
:
0
,
checked
:
-
1
,
getOrderMsg
:
{
pageIndex
:
1
,
pageSize
:
5
,
orderType
:
1
,
queryDays
:
0
,
orderState
:
-
1
,
CustomerId
:
""
},
TitList
:
[{
Type
:
"全部"
,
ID
:
-
1
},
{
Type
:
"待付定金"
,
ID
:
1
},
{
Type
:
"待付尾款"
,
ID
:
2
},
{
Type
:
"待发团"
,
ID
:
3
},
{
Type
:
"交易完成"
,
ID
:
4
},
{
Type
:
"取消"
,
ID
:
5
}
],
};
},
created
()
{
},
mounted
()
{
if
(
localStorage
.
b2bUser
)
{
var
b2bUser
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'b2bUser'
))
if
(
b2bUser
)
{
this
.
qMsg
.
CreateBy
=
b2bUser
.
accountId
;
this
.
getOrderMsg
.
CustomerId
=
b2bUser
.
customerId
;
this
.
gerOrderList
();
}
}
},
methods
:
{
getContract
()
{
gerOrderList
:
function
()
{
this
.
apiJavaPost
(
"/api/b2b/user/getrecentorder"
,
this
.
getOrderMsg
,
res
=>
{
if
(
res
.
data
.
resultCode
==
1
)
{
this
.
DataList
=
res
.
data
.
data
.
pageData
;
this
.
pageCount
=
res
.
data
.
data
.
pageCount
;
}
else
{
}
},
null
);
},
handleClick
(
item
)
{
this
.
checked
=
item
.
ID
;
this
.
getOrderMsg
.
orderState
=
item
.
ID
;
this
.
gerOrderList
();
}
},
};
...
...
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