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
603a4119
Commit
603a4119
authored
Sep 02, 2024
by
qipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
兑换票
parent
8693c8c2
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1011 additions
and
14 deletions
+1011
-14
pages.json
pages.json
+15
-1
exchangeComplete.vue
pages/my/exchangeCode/exchangeComplete/exchangeComplete.vue
+72
-0
exchangeIndex - 副本.vue
pages/my/exchangeCode/exchangeIndex/exchangeIndex - 副本.vue
+31
-0
exchangeIndex.vue
pages/my/exchangeCode/exchangeIndex/exchangeIndex.vue
+234
-13
exchangePage.vue
pages/my/exchangeCode/exchangePage/exchangePage.vue
+659
-0
GIExchange.png
pages/my/static/exchangeCode/GIExchange.png
+0
-0
GIOrder.png
pages/my/static/exchangeCode/GIOrder.png
+0
-0
GIbuyTicket.png
pages/my/static/exchangeCode/GIbuyTicket.png
+0
-0
icon01.png
pages/my/static/exchangeCode/icon01.png
+0
-0
icon02.png
pages/my/static/exchangeCode/icon02.png
+0
-0
icon03.png
pages/my/static/exchangeCode/icon03.png
+0
-0
icon04.png
pages/my/static/exchangeCode/icon04.png
+0
-0
timer01.gif
pages/my/static/exchangeCode/timer01.gif
+0
-0
No files found.
pages.json
View file @
603a4119
...
@@ -183,7 +183,7 @@
...
@@ -183,7 +183,7 @@
{
{
"path"
:
"exchangeCode/exchangeIndex/exchangeIndex"
,
"path"
:
"exchangeCode/exchangeIndex/exchangeIndex"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"
兑换
"
,
"navigationBarTitleText"
:
"
胖丁旅游
"
,
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
}
}
},
{
},
{
...
@@ -273,6 +273,20 @@
...
@@ -273,6 +273,20 @@
"navigationBarTextStyle"
:
"black"
,
"navigationBarTextStyle"
:
"black"
,
"navigationBarBackgroundColor"
:
"#F7F8FA"
"navigationBarBackgroundColor"
:
"#F7F8FA"
}
}
},
{
"path"
:
"exchangeCode/exchangePage/exchangePage"
,
"style"
:
{
"navigationBarTitleText"
:
"兑换票"
}
},
{
"path"
:
"exchangeCode/exchangeComplete/exchangeComplete"
,
"style"
:
{
"navigationBarTitleText"
:
"兑换结果"
}
}
}
]
]
},
},
...
...
pages/my/exchangeCode/exchangeComplete/exchangeComplete.vue
0 → 100644
View file @
603a4119
<
template
>
<view
class=
"bigBox"
>
<u-icon
name=
"checkmark-circle-fill"
></u-icon>
<view
class=
"exchange-name"
>
兑换成功
</view>
<view
class=
"exchange-text"
>
可在胖丁旅行“我的-我的订单”中查找您的电子门票
</view>
<view
class=
"exchange-btn"
>
完成
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
}
},
onLoad
(
option
)
{
},
methods
:
{
}
}
</
script
>
<
style
scoped
lang=
"scss"
>
.bigBox
{
height
:
100vh
;
background-color
:
#F7F8FA
;
overflow-y
:
auto
;
}
/
deep
/
.u-icon
{
margin-top
:
272rpx
;
margin-bottom
:
46rpx
;
}
/
deep
/
.u-icon__icon
{
margin
:
0
auto
;
font-size
:
112rpx
!
important
;
line-height
:
112rpx
!
important
;
color
:
#00B42B
!
important
;
}
.exchange-name
{
font-weight
:
600
;
font-size
:
40rpx
;
color
:
#333333
;
line-height
:
56rpx
;
text-align
:
center
;
margin-bottom
:
12rpx
;
}
.exchange-text
{
font-weight
:
400
;
font-size
:
28rpx
;
color
:
#999999
;
line-height
:
40rpx
;
text-align
:
center
;
padding
:
0
24rpx
;
margin-bottom
:
254rpx
;
}
.exchange-btn
{
width
:
380rpx
;
height
:
88rpx
;
background
:
#FFFFFF
;
border
:
2rpx
solid
#EDEDED
;
font-weight
:
400
;
font-size
:
28rpx
;
color
:
#333333
;
line-height
:
84rpx
;
border-radius
:
50rpx
;
text-align
:
center
;
margin
:
0
auto
;
}
</
style
>
pages/my/exchangeCode/exchangeIndex/exchangeIndex - 副本.vue
0 → 100644
View file @
603a4119
<
template
>
<view>
<web-view
:src=
"outUrl"
></web-view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
outUrl
:
''
,
//跳出页面路由
}
},
onLoad
(
option
)
{
let
merchantId
=
option
.
merchantId
||
''
let
pdOpenid
=
uni
.
getStorageSync
(
'openid'
)
||
''
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
let
pdToken
=
uni
.
getStorageSync
(
'token'
)
||
''
let
pdCreateUserId
=
uni
.
getStorageSync
(
'createUserId'
)
||
''
let
pdUserId
=
uni
.
getStorageSync
(
'userId'
)
||
''
let
baseUrl
=
this
.
$wxurl
+
'exchangeIndex?merchantId='
+
merchantId
this
.
outUrl
=
baseUrl
+
'&pdOpenid='
+
pdOpenid
+
'&pdToken='
+
pdToken
+
'&pdCreateUserId='
+
pdCreateUserId
+
'&pdUserId='
+
pdUserId
},
methods
:
{
}
}
</
script
>
<
style
>
</
style
>
pages/my/exchangeCode/exchangeIndex/exchangeIndex.vue
View file @
603a4119
<
template
>
<
template
>
<view>
<view
class=
"bigBox"
>
<web-view
:src=
"outUrl"
></web-view>
<view
class=
"exchange-btn exchange-btnTop"
@
click=
"distributionCombiChooseFun()"
>
<image
class=
"btn-img"
src=
"../../static/exchangeCode/GIbuyTicket.png"
></image>
<view
class=
"btn-name"
>
立即购票
</view>
<view
class=
"btn-ENname"
>
BUY TICKETS NOW
</view>
</view>
<view
class=
"exchange-btn"
@
click=
"exchangeCodeChoose()"
>
<image
class=
"btn-img"
src=
"../../static/exchangeCode/GIExchange.png"
></image>
<view
class=
"btn-name"
>
兑换票
</view>
<view
class=
"btn-ENname"
>
EXCHANGE TICKETS
</view>
</view>
<view
class=
"exchange-btn"
@
click=
"orderListFun()"
>
<image
class=
"btn-img"
src=
"../../static/exchangeCode/GIOrder.png"
></image>
<view
class=
"btn-name"
>
查看订单
</view>
<view
class=
"btn-ENname"
>
VIEW ORDERS
</view>
</view>
<view
class=
"exchange-mask"
v-if=
"maskType==true"
>
<view
class=
"mask-case"
>
<view
class=
"mask-list"
>
<view
class=
"list-box"
:class=
"active == index?'list-boxAct':''"
@
click=
"listNumFun(index)"
v-for=
"(item,index) in stringProduct"
:key=
"index"
>
{{
item
.
productName
}}
</view>
</view>
<view
class=
"mask-btn"
></view>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
...
@@ -8,24 +32,221 @@
...
@@ -8,24 +32,221 @@
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
outUrl
:
''
,
//跳出页面路由
productId
:
''
,
merchantId
:
''
,
ticketCode
:
''
,
userId
:
''
,
companyMess
:{},
//公司信息
companyId
:
''
,
//公司ID
fromOrderId
:
''
,
//历史ID
pdFromOrderId
:
''
,
stringProduct
:
[],
//可兑换产品列表
maskType
:
true
,
active
:
0
,
}
}
},
},
onLoad
(
option
)
{
onLoad
(
option
)
{
let
merchantId
=
option
.
merchantId
||
''
//this.userId = ''//uni.getStorageSync('openid')
let
pdOpenid
=
uni
.
getStorageSync
(
'openid'
)
||
''
//胖丁小程序openid,临时用,当公众号授权做好之后可以删除
//this.productId = option.productId||'z001700015788731bfffd2581156dcfa'
let
pdToken
=
uni
.
getStorageSync
(
'token'
)
||
''
this
.
ticketCode
=
this
.
$commonjs
.
getKey
(
option
.
ticketCode
)
||
'85729040864674'
let
pdCreateUserId
=
uni
.
getStorageSync
(
'createUserId'
)
||
''
this
.
merchantId
=
this
.
$commonjs
.
getKey
(
option
.
merchantId
)
||
'z001666149446146aaaf63f524961e53'
let
pdUserId
=
uni
.
getStorageSync
(
'userId'
)
||
''
this
.
loadMerchantInfo
()
let
baseUrl
=
this
.
$wxurl
+
'exchangeIndex?merchantId='
+
merchantId
this
.
outUrl
=
baseUrl
+
'&pdOpenid='
+
pdOpenid
+
'&pdToken='
+
pdToken
+
'&pdCreateUserId='
+
pdCreateUserId
+
'&pdUserId='
+
pdUserId
},
},
methods
:
{
methods
:
{
listNumFun
(
index
){
//当可选产品>1时 选择的产品是
this
.
active
=
index
},
loadMerchantInfo
(){
//景区详情
var
data
=
{
id
:
this
.
merchantId
,
isDetail
:
1
}
this
.
$request
(
'scenic/newMerchant/loadMerchantInfo'
,
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
'00'
){
this
.
companyMess
=
res
.
data
this
.
companyId
=
res
.
data
.
productCompanyId
this
.
productListFun
(
res
.
data
.
productCompanyId
)
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
})
}
})
},
productListFun
(
productCompanyId
){
//可兑换的产品列表
var
data
=
{
companyId
:
productCompanyId
,
}
this
.
$request
(
'scenic/exchangeProduct/loadExchangeList'
,
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
'00'
){
this
.
stringProduct
=
res
.
data
this
.
stringProduct
.
forEach
((
item
,
index
)
=>
{
var
productNameGroup
=
JSON
.
parse
(
JSON
.
stringify
(
item
.
productName
)).
split
(
'('
)
item
.
productNameGroup
=
JSON
.
parse
(
JSON
.
stringify
(
productNameGroup
))
})
console
.
log
(
this
.
stringProduct
)
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
})
}
})
},
exchangeCodeChoose
(){
//大于1出现遮罩 等于1跳转
if
(
this
.
stringProduct
.
length
>
1
){
this
.
maskType
=
true
}
else
{
this
.
exchangeCode
()
}
},
exchangeCode
(){
//订单查询
var
data
=
{
ticketCode
:
this
.
ticketCode
,
//userId : this.userId,//上线之前注销 此为普通票
//productId : this.productId,
//orderStatus : 2,//上线之前注销 此为普通票
}
this
.
$request
(
'order/userOrder/findExchangeOrderList'
,
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
'00'
){
if
(
res
.
data
.
list
.
length
>
0
)
{
this
.
checkExchangeFun
(
res
.
data
.
list
[
0
].
id
,
res
.
data
.
list
[
0
].
productId
,
res
.
data
.
list
[
0
].
userId
)
this
.
fromOrderId
=
res
.
data
.
list
[
0
].
thirdOrderId
this
.
pdFromOrderId
=
res
.
data
.
list
[
0
].
id
}
else
{
this
.
$toast
.
fail
(
'未查询到相应订单'
)
}
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
})
}
})
},
checkExchangeFun
(
id
,
productId
,
userId
){
//兑换检测
var
data
=
{
fromOrderId
:
id
,
}
this
.
$request
(
'order/exchange/checkExchange'
,
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
'00'
){
if
(
res
.
data
.
exchangeStatus
==
0
)
{
uni
.
navigateTo
({
url
:
'/pages/my/exchangeCode/exchangePage/exchangePage?productId='
+
this
.
productId
+
'&id='
+
id
+
'&userId='
+
userId
+
'&merchantId='
+
this
.
merchantId
+
'&fromOrderId='
+
this
.
fromOrderId
+
'&pdFromOrderId='
+
this
.
pdFromOrderId
+
'&ticketCode='
+
this
.
ticketCode
})
}
else
{
uni
.
showToast
({
title
:
'当前兑换码已兑换,若需兑换其他兑换码,请扫描对应门票二维码进行兑换。'
,
icon
:
'none'
})
}
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
})
}
})
},
orderListFun
(){
//跳转订单列表
uni
.
navigateTo
({
url
:
'/pages/my/order/orderList/orderList'
})
},
distributionCombiChooseFun
(){
//跳转立即购票
uni
.
navigateTo
({
url
:
'/pages/combination/distributionCombiChoose/distributionCombiChoose?channelId=1&merchantId=z0015605022691a5945bbe463141668c&groupId=z0016038113016708b8ad38c637b2f26&groupChannelId=z00160423712018998e6260ffcaf3369'
})
},
}
}
}
}
</
script
>
</
script
>
<
style
>
<
style
scoped
lang=
"scss"
>
.bigBox
{
height
:
100vh
;
background-color
:
#F4F6F8
;
overflow-y
:
auto
;
}
.exchange-btn
{
width
:
628rpx
;
height
:
216rpx
;
margin
:
0
auto
;
margin-bottom
:
54rpx
;
position
:
relative
;
.btn-img
{
display
:
block
;
width
:
628rpx
;
height
:
216rpx
;
}
.btn-name
{
font-weight
:
600
;
font-size
:
40rpx
;
color
:
#FFFFFF
;
line-height
:
56rpx
;
position
:
absolute
;
top
:
56rpx
;
left
:
60rpx
;
}
.btn-ENname
{
font-weight
:
600
;
font-size
:
24rpx
;
color
:
#FFFFFF
;
line-height
:
34rpx
;
position
:
absolute
;
top
:
120rpx
;
left
:
60rpx
;
}
}
.exchange-btnTop
{
margin-top
:
126rpx
;
}
.exchange-mask
{
position
:
fixed
;
top
:
0
;
right
:
0
;
bottom
:
0
;
left
:
0
;
z-index
:
998
;
background-color
:
rgba
(
0
,
0
,
0
,.
3
);
.mask-case
{
width
:
700rpx
;
height
:
800rpx
;
margin
:
auto
;
background-color
:
#fff
;
border-radius
:
18rpx
;
position
:
fixed
;
top
:
0
;
right
:
0
;
bottom
:
0
;
left
:
0
;
.mask-list
{
height
:
600rpx
;
overflow-y
:
auto
;
.list-box
{
width
:
680rpx
;
margin
:
0
auto
;
padding
:
30rpx
20rpx
;
border
:
solid
1px
#EEEFF0
;
line-height
:
30rpx
;
font-size
:
26rpx
;
color
:
#333333
;
}
.list-boxAct
{
border
:
1px
solid
#FE6600
;
}
}
.mask-btn
{
height
:
200rpx
;
}
}
}
</
style
>
</
style
>
pages/my/exchangeCode/exchangePage/exchangePage.vue
0 → 100644
View file @
603a4119
This diff is collapsed.
Click to expand it.
pages/my/static/exchangeCode/GIExchange.png
0 → 100644
View file @
603a4119
67.1 KB
pages/my/static/exchangeCode/GIOrder.png
0 → 100644
View file @
603a4119
68.9 KB
pages/my/static/exchangeCode/GIbuyTicket.png
0 → 100644
View file @
603a4119
53 KB
pages/my/static/exchangeCode/icon01.png
0 → 100644
View file @
603a4119
1.04 KB
pages/my/static/exchangeCode/icon02.png
0 → 100644
View file @
603a4119
778 Bytes
pages/my/static/exchangeCode/icon03.png
0 → 100644
View file @
603a4119
428 Bytes
pages/my/static/exchangeCode/icon04.png
0 → 100644
View file @
603a4119
323 Bytes
pages/my/static/exchangeCode/timer01.gif
0 → 100644
View file @
603a4119
16.9 KB
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