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
0e072b0e
Commit
0e072b0e
authored
Sep 11, 2023
by
qipeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://git.tbd.yanzuoguang.com/panyongping/uni-pdtravel
into develop
parents
a9aa5d94
9de7d4dd
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
392 additions
and
379 deletions
+392
-379
pages.json
pages.json
+0
-6
index.vue
pages/indexs/index/index.vue
+40
-3
login.vue
pages/login/login.vue
+9
-10
changeNumPayment.vue
pages/payment/changeNumPayment/changeNumPayment.vue
+0
-129
orderPayment.vue
pages/payment/orderPayment/orderPayment.vue
+10
-12
ourPayment.vue
pages/payment/ourPayment/ourPayment.vue
+322
-216
paySuccess.vue
pages/payment/paySuccess/paySuccess.vue
+11
-3
No files found.
pages.json
View file @
0e072b0e
...
...
@@ -139,12 +139,6 @@
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"pages/payment/changeNumPayment/changeNumPayment"
,
"style"
:
{
"navigationBarTitleText"
:
"支付"
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"pages/indexs/center/center"
,
...
...
pages/indexs/index/index.vue
View file @
0e072b0e
...
...
@@ -11,7 +11,7 @@
<view
class=
"middle"
>
<view
class=
"tabbar"
>
<view
@
click=
"jumpPage(item.projectLinkUrl)"
v-for=
"(item,index) in iconList"
:key=
'index'
>
<view
@
click=
"jumpPage(item.projectLinkUrl)"
v-for=
"(item,index) in iconList"
:key=
'index'
v-show=
"item.projectStatus==0"
>
<image
:src=
"item.projectImgUrl"
></image>
<view>
{{
item
.
merchantExtendProjectName
}}
...
...
@@ -181,7 +181,44 @@ export default {
image
:
'http://wx.pangdly.com/static/img/home3.df60ec3.jpg'
}
],
iconList
:[],
//图标列表
iconList
:[
//图标列表
{
merchantExtendProjectName
:
'景区名称'
,
projectImgUrl
:
'/static/img/index/classify1.png'
,
projectLinkUrl
:
'/pages/scenic/scenicIndex/scenicIndex'
,
projectStatus
:
0
},
{
merchantExtendProjectName
:
'酒店民宿'
,
projectImgUrl
:
'/static/img/index/classify2.png'
,
projectLinkUrl
:
'/pages/hotel/hotelIndex/hotelIndex'
,
projectStatus
:
0
},
{
merchantExtendProjectName
:
'周边游'
,
projectImgUrl
:
'/static/img/index/classify4.png'
,
projectLinkUrl
:
'/pages/scenic/scenicIndex/scenicIndex'
,
projectStatus
:
0
},
{
merchantExtendProjectName
:
'跟团游'
,
projectImgUrl
:
'/static/img/index/classify5.png'
,
projectLinkUrl
:
'/pages/scenic/scenicIndex/scenicIndex'
,
projectStatus
:
0
},
{
merchantExtendProjectName
:
'亲子游'
,
projectImgUrl
:
'/static/img/index/classify6.png'
,
projectLinkUrl
:
'/pages/scenic/scenicIndex/scenicIndex'
,
projectStatus
:
0
},
{
merchantExtendProjectName
:
'行程订制'
,
projectImgUrl
:
'/static/img/index/classify7.png'
,
projectLinkUrl
:
'/pages/my/travelList/travelList/travelList'
,
projectStatus
:
0
}
],
}
},
onLoad
(
option
){
...
...
@@ -226,7 +263,7 @@ export default {
}
this
.
$request
(
'scenic/merchantExtendProject/loadList'
,
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
'00'
){
this
.
iconList
=
res
.
data
||
[]
this
.
iconList
=
res
.
data
}
})
},
...
...
pages/login/login.vue
View file @
0e072b0e
...
...
@@ -23,13 +23,12 @@ export default {
methods
:{
//---登录
login
(){
let
_this
=
this
uni
.
getProvider
({
service
:
'oauth'
,
success
(
proRes
)
{
success
:
proRes
=>
{
uni
.
login
({
provider
:
proRes
.
provider
[
0
],
success
:
function
(
res
)
{
success
:
res
=>
{
if
(
res
.
code
)
{
let
source
=
''
if
(
proRes
.
provider
[
0
]
==
'weixin'
)
{
...
...
@@ -45,13 +44,13 @@ export default {
if
(
uni
.
getStorageSync
(
'enterOptions'
).
query
){
data
.
companyId
=
uni
.
getStorageSync
(
'enterOptions'
).
query
.
companyId
||
''
}
_
this
.
$request
(
'wechat/wx/getUserInfoByCode'
,
data
).
then
(
res
=>
{
this
.
$request
(
'wechat/wx/getUserInfoByCode'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
'00'
)
{
let
openid
=
res
.
data
.
openid
uni
.
setStorageSync
(
'openid'
,
openid
)
let
userId
=
res
.
data
.
userId
||
''
let
datas
=
{
openid
,
source
,
userId
}
_
this
.
$request
(
'wechatUser/login/findWxUserAndLogin'
,
datas
).
then
(
res
=>
{
this
.
$request
(
'wechatUser/login/findWxUserAndLogin'
,
datas
).
then
(
res
=>
{
//通过openid获取token
if
(
res
.
code
==
'00'
)
{
let
token
=
res
.
data
.
token
||
''
...
...
@@ -71,7 +70,7 @@ export default {
url
:
'/'
+
enterOptions
.
path
+
'?'
+
queryTotal
})
//保存当前日期
let
oldDate
=
_
this
.
$commonjs
.
today
()
let
oldDate
=
this
.
$commonjs
.
today
()
uni
.
setStorageSync
(
'oldDate'
,
oldDate
)
// uni.navigateBack({
// delta:1
...
...
@@ -88,8 +87,8 @@ export default {
title
:
'登录失败,请退出并重新登录'
,
icon
:
'none'
})
_
this
.
timer
=
setTimeout
(()
=>
{
_
this
.
login
()
this
.
timer
=
setTimeout
(()
=>
{
this
.
login
()
},
2000
)
})
}
else
{
...
...
@@ -103,8 +102,8 @@ export default {
title
:
'登录失败,请退出并重新登录'
,
icon
:
'none'
})
_
this
.
timer
=
setTimeout
(()
=>
{
_
this
.
login
()
this
.
timer
=
setTimeout
(()
=>
{
this
.
login
()
},
2000
)
})
}
...
...
pages/payment/changeNumPayment/changeNumPayment.vue
deleted
100644 → 0
View file @
a9aa5d94
<
template
>
<!-- 传入价格,通过改变数量改变价格的支付页面 -->
<view
class=
"wrap"
>
<view
class=
"top"
>
<view
class=
"name"
>
皇冠大扶梯
</view>
<view
class=
"number"
>
<text>
购买数量
</text>
<u-number-box
v-model=
"buyNumber"
bg-color=
'#3688FF'
color=
'#ffffff'
:input-height=
"60"
size=
'28'
>
</u-number-box>
</view>
<view
class=
"price"
>
<text>
总价
</text>
<text>
¥6.00
</text>
</view>
<view
class=
"remark"
>
<input
placeholder=
"添加备注(20字以内)"
maxlength=
"20"
v-model
.
trim=
"remark"
style=
"margin-bottom:20rpx;"
/>
</view>
<view
class=
"tips"
>
温馨提示:请核对以上付款金额、付款对象等信息与交易匹配。
</view>
</view>
<view
class=
"bottom"
>
<text
class=
"btn"
>
立即支付
</text>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
remark
:
''
,
//备注
payType
:
''
,
//支付方式
buyNumber
:
''
,
//购买数量
}
},
onLoad
(
option
)
{
//#ifdef MP-WEIXIN
this
.
payType
=
42
//#endif
//#ifdef MP-ALIPAY
this
.
payType
=
33
//#endif
},
methods
:
{
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.wrap
{
height
:
100%
;
background
:
#ffffff
;
}
.top
{
padding
:
40rpx
24rpx
;
}
.name
{
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#191919
;
text-align
:
center
;
}
.number
{
display
:
flex
;
justify-content
:
space-between
;
font-weight
:
bold
;
margin-top
:
80rpx
;
align-items
:
center
;
}
.price
{
display
:
flex
;
justify-content
:
space-between
;
font-weight
:
bold
;
margin-top
:
48rpx
;
text
:nth-child
(
2
)
{
font-size
:
40rpx
;
color
:
$red
;
}
}
.remark
{
margin-top
:
48rpx
;
color
:
$grey
;
}
.tips
{
margin-top
:
24rpx
;
color
:
$grey
;
font-size
:
24rpx
;
}
.bottom
{
position
:
fixed
;
width
:
100%
;
height
:
100rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
bottom
:
0
;
box-shadow
:
0px
-4px
12px
2px
rgba
(
0
,
0
,
0
,
0
.08
);
background
:
#ffffff
;
}
.btn
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
width
:
90%
;
height
:
80rpx
;
background
:
#3688FF
;
border-radius
:
8rpx
;
font-size
:
32rpx
;
font-weight
:
bold
;
}
</
style
>
pages/payment/orderPayment/orderPayment.vue
View file @
0e072b0e
...
...
@@ -97,13 +97,12 @@ export default {
methods
:
{
login
()
{
//---登录
let
_this
=
this
uni
.
getProvider
({
service
:
'oauth'
,
success
(
proRes
)
{
success
:
proRes
=>
{
uni
.
login
({
provider
:
proRes
.
provider
[
0
],
success
:
function
(
res
)
{
success
:
res
=>
{
if
(
res
.
code
)
{
let
source
=
''
if
(
proRes
.
provider
[
0
]
==
'weixin'
)
{
...
...
@@ -119,12 +118,12 @@ export default {
if
(
uni
.
getStorageSync
(
'enterOptions'
).
query
){
data
.
companyId
=
uni
.
getStorageSync
(
'enterOptions'
).
query
.
companyId
||
''
}
_
this
.
$request
(
'wechat/wx/getUserInfoByCode'
,
data
)
this
.
$request
(
'wechat/wx/getUserInfoByCode'
,
data
)
.
then
(
res
=>
{
if
(
res
.
code
==
'00'
)
{
_
this
.
openid
=
res
.
data
.
openid
uni
.
setStorageSync
(
'openid'
,
_
this
.
openid
)
_
this
.
initDetail
()
this
.
openid
=
res
.
data
.
openid
uni
.
setStorageSync
(
'openid'
,
this
.
openid
)
this
.
initDetail
()
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
...
...
@@ -203,7 +202,6 @@ export default {
},
goPay
()
{
//-------------------------------------------------------去支付
let
_this
=
this
if
(
this
.
errorMessage
)
{
uni
.
showToast
({
title
:
this
.
errorMessage
,
...
...
@@ -224,9 +222,9 @@ export default {
package
:
this
.
package
,
signType
:
this
.
signType
,
paySign
:
this
.
paySign
,
success
:
function
(
res
)
{
success
:
res
=>
{
uni
.
navigateTo
({
url
:
'/pages/payment/paySuccess/paySuccess?orderId='
+
_this
.
orderId
+
'&afterBuyUrl='
+
_this
.
afterBuyUrl
+
'&ifyukuaiCode='
+
_
this
.
ifyukuaiCode
url
:
'/pages/payment/paySuccess/paySuccess?orderId='
+
this
.
orderId
+
'&afterBuyUrl='
+
this
.
afterBuyUrl
+
'&ifyukuaiCode='
+
this
.
ifyukuaiCode
})
},
fail
:
function
(
err
)
{
...
...
@@ -242,9 +240,9 @@ export default {
uni
.
requestPayment
({
provider
:
'alipay'
,
// 服务提供商 支付宝支付: alipay 微信支付: wxpay
orderInfo
:
this
.
orderInfo
,
// 支付宝订单号
success
:
function
(
res
)
{
success
:
res
=>
{
uni
.
navigateTo
({
url
:
'/pages/payment/paySuccess/paySuccess?orderId='
+
_this
.
orderId
+
'&afterBuyUrl='
+
_this
.
afterBuyUrl
+
'&ifyukuaiCode='
+
_
this
.
ifyukuaiCode
url
:
'/pages/payment/paySuccess/paySuccess?orderId='
+
this
.
orderId
+
'&afterBuyUrl='
+
this
.
afterBuyUrl
+
'&ifyukuaiCode='
+
this
.
ifyukuaiCode
})
},
fail
:
function
(
err
)
{
...
...
pages/payment/ourPayment/ourPayment.vue
View file @
0e072b0e
<
template
>
<view
class=
"bigBox"
>
<view
class=
"top"
>
<view
class=
"topName"
>
<text>
{{
name
}}
</text>
</view>
<view
class=
"topMoney"
>
<view
class=
"moneyText"
>
付款金额
<view
class=
"bigBox"
:style=
"
{background:backgroundColor}">
<template
v-if=
"showMoney"
>
<view
class=
"top"
>
<view
class=
"topName"
>
<text>
{{
companyName
}}
</text>
</view>
<view
class=
"moneyNumber"
>
<text
class=
"iconfont icon-fl-renminbi"
style=
"font-size: 56rpx"
></text>
<text>
{{
buyMoney
}}
</text>
<text></text>
<view
class=
"topMoney"
>
<view
class=
"moneyText"
>
付款金额
</view>
<view
class=
"moneyNumber"
>
<text
class=
"iconfont icon-fl-renminbi"
style=
"font-size: 56rpx"
></text>
<text>
{{
orderMoney
}}
</text>
<text></text>
</view>
</view>
</view>
<!-- -----------------------------有可用优惠券,并且未选中----------------------------------------------------- -->
<view
class=
"topCoupon"
v-if=
"couponData.masterSlaveCouponList && couponData.masterSlaveCouponList.length > 0 && chooseCouponObj == ''"
@
click=
"showCoupon()"
>
<view
class=
"couponLeft"
>
<text>
券
</text>
<text>
{{
couponData
.
masterSlaveCouponList
[
0
].
couponName
}}
</text>
<!-- -----------------------------有可用优惠券,并且未选中----------------------------------------------------- -->
<view
class=
"topCoupon"
v-if=
"couponData.masterSlaveCouponList && couponData.masterSlaveCouponList.length > 0 && chooseCouponObj == ''"
@
click=
"showCoupon()"
>
<view
class=
"couponLeft"
>
<text>
券
</text>
<text>
{{
couponData
.
masterSlaveCouponList
[
0
].
couponName
}}
</text>
</view>
<view
class=
"couponRight"
>
<text>
未选优惠券
</text>
<text
class=
"iconfont icon-you"
style=
"font-size: 32rpx"
></text>
</view>
</view>
<view
class=
"couponRight"
>
<text>
未选优惠券
</text>
<text
class=
"iconfont icon-you"
style=
"font-size: 32rpx"
></text>
<!-- -----------------------------有可用优惠券----------------------------------------------------- -->
<view
class=
"topCoupon"
v-if=
"chooseCouponObj != '' && savedMoney > 0"
@
click=
"showCoupon()"
>
<view
class=
"couponLeft"
>
<text>
券
</text>
<text>
{{
chooseCouponObj
.
couponName
}}
</text>
</view>
<view
class=
"couponRight"
>
<text>
-
</text>
<text>
{{
parseFloat
(
savedMoney
.
toFixed
(
2
))
}}
</text>
<text
class=
"iconfont icon-you"
style=
"font-size: 32rpx"
></text>
</view>
</view>
</view>
<!-- -----------------------------有可用优惠券----------------------------------------------------- -->
<view
class=
"topCoupon"
v-if=
"chooseCouponObj != '' && savedMoney > 0"
@
click=
"showCoupon()"
>
<view
class=
"couponLeft"
>
<text>
券
</text>
<text>
{{
chooseCouponObj
.
couponName
}}
</text>
<!-- -----------------------------------------------可用优惠券条件--------------------------------------- -->
<view
class=
"topCoupon"
v-if=
"ableConpon != ''"
@
click=
"showCoupon()"
>
<view
class=
"couponLeft"
>
<text>
券
</text>
<text>
{{
ableConpon
.
couponName
}}
</text>
</view>
<view
class=
"couponRight"
>
<text>
{{
ableConpon
.
couponRule
}}
</text>
<text
class=
"iconfont icon-you"
style=
"font-size: 32rpx"
></text>
</view>
</view>
<view
class=
"couponRight"
>
<text>
-
</text
>
<text>
{{
parseFloat
(
savedMoney
.
toFixed
(
2
))
}}
</text
>
<
text
class=
"iconfont icon-you"
style=
"font-size: 32rpx"
></text
>
</view>
<view
class=
"middle"
>
<view
>
<
input
placeholder=
"添加备注(20字以内)"
maxlength=
"20"
v-model
.
trim=
"remark"
style=
"margin-bottom: 20rpx"
/
>
</view>
<view
style=
"font-size: 24rpx"
>
温馨提示:请核对以上付款金额、付款对象等信息与交易匹配。
</view>
</view>
<!-- -----------------------------------------------可用优惠券条件--------------------------------------- -->
<view
class=
"topCoupon"
v-if=
"ableConpon != ''"
@
click=
"showCoupon()"
>
<view
class=
"couponLeft"
>
<text>
券
</text>
<text>
{{
ableConpon
.
couponName
}}
</text>
<view
class=
"bottom"
>
<view
class=
"botLeft"
>
<view
v-for=
"(item, index) of leftList"
:key=
"index"
>
<text
@
click=
"clickNum(items.text, index, a)"
v-for=
"(items, a) of item.child"
:key=
"a"
:style=
"
{ background: items.background }">
{{
items
.
text
}}
</text>
</view>
</view>
<view
class=
"couponRight"
>
<text>
{{
ableConpon
.
couponRule
}}
</text>
<text
class=
"iconfont icon-you"
style=
"font-size: 32rpx"
></text>
<view
class=
"botRight"
>
<view
class=
"rightOne"
@
click=
"clickEnter()"
:style=
"
{ background: spaceBackground }">
<text
class=
"iconfont icon-im_huige"
style=
"font-size: 70rpx"
></text>
</view>
<view
class=
"rightTwo"
ref=
"pay"
@
click=
"clickPay()"
:style=
"
{ background: payBackground }">
<view>
立即
</view>
<view>
支付
</view>
</view>
</view>
</view>
</view>
<view
class=
"middle"
>
<view>
<input
placeholder=
"添加备注(20字以内)"
maxlength=
"20"
v-model
.
trim=
"remark"
style=
"margin-bottom:20rpx;"
/>
</view>
<view
style=
"font-size:24rpx;"
>
温馨提示:请核对以上付款金额、付款对象等信息与交易匹配。
</view>
</view>
<view
class=
"bottom"
>
<view
class=
"botLeft"
>
<view
v-for=
"(item, index) of leftList"
:key=
"index"
>
<text
@
click=
"clickNum(items.text, index, a)"
v-for=
"(items, a) of item.child"
:key=
"a"
:style=
"
{ background: items.background }">
{{
items
.
text
}}
</text>
</
template
>
<
template
v-if=
"showNumber"
>
<view
class=
"top2"
>
<view
class=
"top2-name"
>
{{
companyName
}}
</view>
</view>
<view
class=
"botRight"
>
<view
class=
"rightOne"
@
click=
"clickEnter()"
:style=
"
{ background: spaceBackground }">
<text
class=
"iconfont icon-im_huige"
style=
"font-size: 70rpx"
></text>
<view
class=
"top2-number"
>
<text>
购买数量
</text>
<u-number-box
@
change=
'numberChange'
v-model=
"buyNum"
bg-color=
'#3688FF'
color=
'#ffffff'
:input-height=
"60"
:min=
"1"
size=
'28'
>
</u-number-box>
</view>
<view
class=
"top2-price"
>
<text>
总价
</text>
<text>
¥
{{
orderMoney
}}
</text>
</view>
<view
class=
"top2-remark"
>
<input
placeholder=
"添加备注(20字以内)"
maxlength=
"20"
v-model
.
trim=
"remark"
style=
"margin-bottom:20rpx;"
/>
</view>
<view
class=
"rightTwo"
ref=
"pay"
@
click=
"clickPay()"
:style=
"
{ background: payBackground }">
<view>
立即
</view>
<view>
支付
</view>
<view
class=
"top2-tips"
>
温馨提示:请核对以上付款金额、付款对象等信息与交易匹配。
</view>
</view>
</view>
<view
class=
"bottom2"
>
<text
class=
"btn"
@
click=
"clickPay()"
:style=
"
{ background: payBackground }">立即支付
</text>
</view>
</
template
>
<!-------------------------------------------券弹窗------------------------------>
<orderCoupon
:couponData=
"couponData"
ref=
"orderCoupon"
@
couponChoose=
"couponChoose"
:chooseCouponObj=
"chooseCouponObj"
></orderCoupon>
</view>
...
...
@@ -99,12 +138,16 @@ export default {
},
data
()
{
return
{
remark
:
''
,
//备注
enterUrl
:
''
,
//进入页面路由
buyMoney
:
''
,
//输入金额
backgroundColor
:
'#f5f5f5'
,
//背景颜色
showMoney
:
false
,
//显示输入金额页面
showNumber
:
false
,
//显示输入数量页面
tollPoint
:
''
,
//收费点信息
buyNum
:
1
,
//购买数量
remark
:
''
,
//备注
orderMoney
:
''
,
//订单金额
companyId
:
''
,
//公司Id
merchantId
:
''
,
//商户Id
n
ame
:
''
,
//商家名称
companyN
ame
:
''
,
//商家名称
payType
:
''
,
//支付类型,微信小程序42,支付宝小程序33
paySign
:
''
,
//签名
signType
:
''
,
//签名方式
...
...
@@ -160,34 +203,26 @@ export default {
},
onLoad
(
option
)
{
//#ifdef MP-WEIXIN
this
.
enterUrl
=
option
.
q
this
.
payType
=
42
//#endif
//#ifdef MP-ALIPAY
this
.
enterUrl
=
uni
.
getStorageSync
(
'alipayQrCode'
)
uni
.
removeStorageSync
(
'alipayQrCode'
)
//临时解决出租车扫码之后跳转到组合票时,参数会有问题,有时间再根本解决
this
.
payType
=
33
//#endif
if
(
this
.
enterUrl
)
{
//扫普通二维码进入
this
.
merchantId
=
this
.
getUrlKey
(
'merchantId'
)
this
.
companyId
=
this
.
getUrlKey
(
'companyId'
)
this
.
extendInfo
=
this
.
getUrlKey
(
'extendInfo'
)
}
else
{
//扫小程序二维码进入
this
.
merchantId
=
option
.
merchantId
this
.
companyId
=
option
.
companyId
this
.
extendInfo
=
option
.
extendInfo
this
.
merchantId
=
this
.
$commonjs
.
getKey
(
option
,
'merchantId'
)
this
.
companyId
=
this
.
$commonjs
.
getKey
(
option
,
'companyId'
)
this
.
extendInfo
=
this
.
$commonjs
.
getKey
(
option
,
'extendInfo'
)
if
(
!
this
.
extendInfo
){
this
.
showMoney
=
true
}
if
(
uni
.
getStorageSync
(
'openid'
))
{
this
.
openid
=
uni
.
getStorageSync
(
'openid'
)
if
(
this
.
merchantId
)
{
//大商家的有merchantId
this
.
init
()
this
.
init
Merchant
()
}
else
{
//小商家没有merchantId
this
.
init
Two
()
this
.
init
Company
()
}
this
.
initCoupon
()
}
else
{
...
...
@@ -205,13 +240,12 @@ export default {
methods
:
{
login
()
{
//---登录
let
_this
=
this
uni
.
getProvider
({
service
:
'oauth'
,
success
(
proRes
)
{
success
:
proRes
=>
{
uni
.
login
({
provider
:
proRes
.
provider
[
0
],
success
:
function
(
res
)
{
success
:
res
=>
{
if
(
res
.
code
)
{
let
source
=
''
if
(
proRes
.
provider
[
0
]
==
'weixin'
)
{
...
...
@@ -222,88 +256,80 @@ export default {
let
data
=
{
code
:
res
.
code
,
source
,
//微信小程序3,支付宝小程序4
appid
:
uni
.
getStorageSync
(
'appid'
)
||
''
}
if
(
uni
.
getStorageSync
(
'enterOptions'
).
query
)
{
data
.
companyId
=
uni
.
getStorageSync
(
'enterOptions'
).
query
.
companyId
||
''
appid
:
uni
.
getStorageSync
(
'appid'
)
||
''
,
companyId
:
this
.
companyId
}
_
this
.
$request
(
'wechat/wx/getUserInfoByCode'
,
data
).
then
(
res
=>
{
this
.
$request
(
'wechat/wx/getUserInfoByCode'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
'00'
)
{
_this
.
openid
=
res
.
data
.
openid
uni
.
setStorageSync
(
'openid'
,
_this
.
openid
)
if
(
_
this
.
merchantId
)
{
let
openid
=
res
.
data
.
openid
||
''
uni
.
setStorageSync
(
'openid'
,
openid
)
if
(
this
.
merchantId
)
{
//大商家的有merchantId
_this
.
ini
t
()
this
.
initMerchan
t
()
}
else
{
//小商家没有merchantId
_this
.
initTwo
()
this
.
initCompany
()
}
_
this
.
initCoupon
()
this
.
initCoupon
()
//用于获取token等信息
let
userId
=
res
.
data
.
userId
||
''
let
openid
=
res
.
data
.
openid
||
''
let
datas
=
{
openid
,
source
,
userId
}
_this
.
$request
(
'wechatUser/login/findWxUserAndLogin'
,
datas
)
.
then
(
res
=>
{
if
(
res
.
code
==
'00'
)
{
let
token
=
res
.
data
.
token
||
''
uni
.
setStorageSync
(
'token'
,
token
)
let
createUserId
=
res
.
data
.
personId
||
''
uni
.
setStorageSync
(
'createUserId'
,
createUserId
)
let
userId
=
res
.
data
.
userId
||
''
uni
.
setStorageSync
(
'userId'
,
userId
)
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
})
}
})
.
catch
(
err
=>
{
this
.
$request
(
'wechatUser/login/findWxUserAndLogin'
,
datas
).
then
(
res
=>
{
if
(
res
.
code
==
'00'
)
{
let
token
=
res
.
data
.
token
||
''
uni
.
setStorageSync
(
'token'
,
token
)
let
createUserId
=
res
.
data
.
personId
||
''
uni
.
setStorageSync
(
'createUserId'
,
createUserId
)
let
userId
=
res
.
data
.
userId
||
''
uni
.
setStorageSync
(
'userId'
,
userId
)
}
else
{
uni
.
showToast
({
title
:
'登录失败'
,
title
:
res
.
message
,
icon
:
'none'
})
_this
.
timer
=
setTimeout
(()
=>
{
_this
.
login
()
},
2000
)
}
}).
catch
(
err
=>
{
uni
.
showToast
({
title
:
'登录失败'
,
icon
:
'none'
})
this
.
timer
=
setTimeout
(()
=>
{
this
.
login
()
},
2000
)
})
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
})
}
})
.
catch
(
err
=>
{
uni
.
showToast
({
title
:
'登录失败'
,
icon
:
'none'
})
_this
.
timer
=
setTimeout
(()
=>
{
_this
.
login
()
},
2000
)
}).
catch
(
err
=>
{
uni
.
showToast
({
title
:
'登录失败'
,
icon
:
'none'
})
this
.
timer
=
setTimeout
(()
=>
{
this
.
login
()
},
2000
)
})
}
}
})
}
})
},
getUrlKey
(
name
)
{
//---获取url
return
(
(
new
RegExp
(
'[?|&]'
+
name
+
'='
+
'([^&;]+?)(&|#|;|$)'
).
exec
(
decodeURIComponent
(
this
.
enterUrl
))
||
[,
''
])[
1
].
replace
(
/
\+
/g
,
'%20'
)
||
''
)
//---数量改变时
numberChange
(
e
){
let
price
=
this
.
tollPoint
.
tollPointPrice
this
.
orderMoney
=
parseFloat
((
price
*
e
.
value
).
toFixed
(
2
))
},
//---输入数字
clickNum
(
i
,
index
,
a
)
{
//---输入数字
//不超过14位数
if
(
this
.
buy
Money
.
length
>
13
)
{
if
(
this
.
order
Money
.
length
>
13
)
{
return
}
this
.
buy
Money
+=
i
this
.
order
Money
+=
i
this
.
leftList
[
index
].
child
[
a
].
background
=
'#dddddd'
setTimeout
(()
=>
{
this
.
leftList
[
index
].
child
[
a
].
background
=
''
...
...
@@ -313,9 +339,9 @@ export default {
this
.
initCoupon
()
},
1500
)
},
//---退格
clickEnter
()
{
//---退格
this
.
buyMoney
=
this
.
buyMoney
.
substr
(
0
,
this
.
buyMoney
.
length
-
1
)
this
.
orderMoney
=
this
.
orderMoney
.
substr
(
0
,
this
.
orderMoney
.
length
-
1
)
this
.
spaceBackground
=
'#dddddd'
setTimeout
(()
=>
{
this
.
spaceBackground
=
''
...
...
@@ -339,57 +365,73 @@ export default {
//---展示券列表
this
.
$refs
.
orderCoupon
.
showCoupon
()
},
init
()
{
//---初始化获取商家名称,大商家
//---初始化获取商家名称,大商家
initMerchant
()
{
let
data
=
{
merchantId
:
this
.
merchantId
,
companyId
:
this
.
companyId
}
uni
.
showLoading
({
title
:
'加载中'
,
mask
:
true
})
this
.
$request
(
'scenic/order/findCodePayInfo'
,
data
)
.
then
(
res
=>
{
uni
.
hideLoading
()
if
(
res
.
code
==
'00'
)
{
this
.
name
=
res
.
data
.
name
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
})
}
})
.
catch
(
err
=>
{
uni
.
hideLoading
()
})
this
.
$request
(
'scenic/order/findCodePayInfo'
,
data
).
then
(
res
=>
{
uni
.
hideLoading
()
if
(
res
.
code
==
'00'
)
{
this
.
companyName
=
res
.
data
.
name
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
})
}
}).
catch
(
err
=>
{
uni
.
hideLoading
()
})
},
initTwo
()
{
//---初始化获取商家名称,没有merchantId的小商家
//---初始化获取商家名称,没有merchantId的小商家
initCompany
()
{
let
data
=
{
id
:
this
.
companyId
id
:
this
.
companyId
,
//公司Id
tollPoint
:
this
.
extendInfo
,
//扩展信息
}
uni
.
showLoading
({
title
:
'加载中'
,
mask
:
true
})
this
.
$request
(
'user/company/detail'
,
data
)
.
then
(
res
=>
{
uni
.
hideLoading
()
if
(
res
.
code
==
'00'
)
{
this
.
companyAttribute
=
res
.
data
.
companyVo
.
companyAttribute
this
.
paydJumpUrl
=
res
.
data
.
paydJumpUrl
if
(
this
.
companyAttribute
==
5
)
{
//出租车显示联系人姓名,其他显示公司名称
this
.
name
=
res
.
data
.
companyVo
.
contactName
}
else
{
this
.
name
=
res
.
data
.
companyVo
.
companyName
}
this
.
$request
(
'user/newCompany/findCompanyById'
,
data
).
then
(
res
=>
{
uni
.
hideLoading
()
if
(
res
.
code
==
'00'
)
{
this
.
companyAttribute
=
res
.
data
.
companyAttribute
this
.
paydJumpUrl
=
res
.
data
.
paydJumpUrl
if
(
this
.
companyAttribute
==
5
)
{
//出租车显示联系人姓名,其他显示公司名称
this
.
companyName
=
res
.
data
.
contactName
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
})
this
.
companyName
=
res
.
data
.
companyName
}
})
.
catch
(
err
=>
{
uni
.
hideLoading
()
})
let
list
=
res
.
data
.
companyTollPointVoList
list
.
forEach
(
item
=>
{
if
(
item
.
tollPoints
==
this
.
extendInfo
){
this
.
tollPoint
=
item
}
})
if
(
this
.
tollPoint
.
tollPointsModel
==
0
){
//显示输入金额页面
this
.
showMoney
=
true
}
if
(
this
.
tollPoint
.
tollPointsModel
==
1
){
//显示数量页面
this
.
backgroundColor
=
'#ffffff'
this
.
showNumber
=
true
//默认总价为一张的价格
this
.
orderMoney
=
this
.
tollPoint
.
tollPointPrice
//优先取收费点名称,然后是公司名称,然后是联系人名称
this
.
companyName
=
this
.
tollPoint
.
tollPointByname
||
res
.
data
.
companyName
||
res
.
data
.
contactName
}
}
else
{
uni
.
showToast
({
title
:
res
.
message
,
icon
:
'none'
})
}
}).
catch
(
err
=>
{
uni
.
hideLoading
()
})
},
initCoupon
()
{
//---加载优惠券
...
...
@@ -397,11 +439,11 @@ export default {
this
.
chooseCouponObj
=
''
this
.
ableConpon
=
''
let
data
=
{
money
:
parseFloat
(
this
.
buy
Money
)
||
0
,
//订单总价,不算券,和现金红包
money
:
parseFloat
(
this
.
order
Money
)
||
0
,
//订单总价,不算券,和现金红包
merchantId
:
this
.
merchantId
,
//商户Id
companyId
:
this
.
companyId
,
//公司Id
orderSource
:
this
.
orderSource
,
//订单来源 8扫码支付
openid
:
this
.
openid
openid
:
uni
.
getStorageSync
(
'openid'
)
||
''
}
this
.
$request
(
'wechatUser/myPage/usableCouponList'
,
data
).
then
(
res
=>
{
if
(
res
.
code
==
'00'
)
{
...
...
@@ -447,7 +489,7 @@ export default {
},
clickPay
()
{
//---点击立即支付,获取支付需要的参数
if
(
!
parseFloat
(
this
.
buyMoney
)
)
{
if
(
!
parseFloat
(
this
.
orderMoney
)
&&
this
.
showMoney
)
{
uni
.
showToast
({
title
:
'请输入正确金额'
,
icon
:
'none'
...
...
@@ -485,14 +527,22 @@ export default {
let
data
=
{
companyId
:
this
.
companyId
,
merchantId
:
this
.
merchantId
,
userId
:
this
.
openid
,
orderMoney
:
parseFloat
(
this
.
buyMoney
),
userId
:
uni
.
getStorageSync
(
'openid'
)
||
''
,
orderMoney
:
parseFloat
(
this
.
orderMoney
),
//总价
buyNum
:
this
.
buyNum
,
//数量
payType
:
this
.
payType
,
//支付类型,
orderSource
:
this
.
orderSource
,
//订单来源 8扫码支付
couponList
,
//券列表
extendInfo
:
this
.
extendInfo
,
//额外信息
remark
:
this
.
remark
,
//备注信息
extendInfo
:
this
.
extendInfo
,
//额外信息
remark
:
this
.
remark
//备注信息
}
if
(
this
.
showMoney
){
//输入金额页面
data
.
unitPrice
=
parseFloat
(
this
.
orderMoney
)
}
if
(
this
.
showNumber
){
//输入数量页面
data
.
unitPrice
=
this
.
tollPoint
.
tollPointPrice
}
this
.
payBackground
=
'#cccccc'
//重新加载优惠券
...
...
@@ -533,7 +583,6 @@ export default {
},
goPay
()
{
//---去支付
let
_this
=
this
// #ifdef MP-WEIXIN
uni
.
requestPayment
({
provider
:
'wxpay'
,
...
...
@@ -542,15 +591,15 @@ export default {
package
:
this
.
package
,
signType
:
this
.
signType
,
paySign
:
this
.
paySign
,
success
:
function
(
res
)
{
if
(
_
this
.
companyAttribute
==
5
)
{
success
:
res
=>
{
if
(
this
.
companyAttribute
==
5
)
{
//出租车跳转分销组合票页面
uni
.
navigateTo
({
url
:
_
this
.
paydJumpUrl
url
:
this
.
paydJumpUrl
})
}
else
{
uni
.
navigateTo
({
url
:
'/pages/payment/paySuccess/paySuccess?orderId='
+
_
this
.
orderId
url
:
'/pages/payment/paySuccess/paySuccess?orderId='
+
this
.
orderId
})
}
},
...
...
@@ -567,15 +616,15 @@ export default {
uni
.
requestPayment
({
provider
:
'alipay'
,
// 服务提供商 支付宝支付: alipay 微信支付: wxpay
orderInfo
:
this
.
orderInfo
,
// 支付宝订单号
success
:
function
(
res
)
{
if
(
_
this
.
companyAttribute
==
5
)
{
success
:
res
=>
{
if
(
this
.
companyAttribute
==
5
)
{
//出租车跳转分销组合票页面
uni
.
navigateTo
({
url
:
_
this
.
paydJumpUrl
url
:
this
.
paydJumpUrl
})
}
else
{
uni
.
navigateTo
({
url
:
'/pages/payment/paySuccess/paySuccess?orderId='
+
_
this
.
orderId
url
:
'/pages/payment/paySuccess/paySuccess?orderId='
+
this
.
orderId
})
}
},
...
...
@@ -590,31 +639,31 @@ export default {
}
},
watch
:
{
buy
Money
(
val
,
oldVal
)
{
order
Money
(
val
,
oldVal
)
{
if
(
val
==
'.'
&&
oldVal
==
''
)
{
//首位数是小数点自动加上0
this
.
buy
Money
=
0
+
'.'
this
.
order
Money
=
0
+
'.'
}
if
(
val
==
'0'
&&
oldVal
==
''
)
{
//首位数是0自动加上小数点
this
.
buy
Money
=
0
+
'.'
this
.
order
Money
=
0
+
'.'
}
if
(
val
.
length
==
2
)
{
//防止回退之后出现01,02等状况
if
(
val
.
substr
(
0
,
1
)
==
0
&&
val
.
substr
(
1
,
2
)
!=
'.'
)
{
this
.
buy
Money
=
val
.
substr
(
1
,
2
)
this
.
order
Money
=
val
.
substr
(
1
,
2
)
}
}
if
(
isNaN
(
val
)
&&
val
!=
'.'
)
{
//出现非数字,输入无效
this
.
buy
Money
=
oldVal
this
.
order
Money
=
oldVal
}
var
x
=
String
(
this
.
buy
Money
).
indexOf
(
'.'
)
+
1
//小数点的位置
var
y
=
String
(
this
.
buy
Money
).
length
-
x
//小数的位数
var
x
=
String
(
this
.
order
Money
).
indexOf
(
'.'
)
+
1
//小数点的位置
var
y
=
String
(
this
.
order
Money
).
length
-
x
//小数的位数
if
(
y
>
2
&&
x
>
0
)
{
this
.
buy
Money
=
oldVal
this
.
order
Money
=
oldVal
}
if
(
parseFloat
(
this
.
buy
Money
))
{
if
(
parseFloat
(
this
.
order
Money
))
{
this
.
payBackground
=
'#3688FF'
}
else
{
this
.
payBackground
=
'#cccccc'
...
...
@@ -625,8 +674,8 @@ export default {
</
script
>
<
style
lang=
"scss"
>
// 输入金额页面样式
.bigBox
{
background
:
#f5f5f5
;
height
:
100%
;
}
/*上部分*/
...
...
@@ -665,7 +714,7 @@ export default {
font-size
:
32rpx
;
font-weight
:
bold
;
}
.moneyNumber
{
.moneyNumber
{
margin-top
:
30rpx
;
}
.moneyNumber
text
:nth-child
(
2
)
{
...
...
@@ -792,4 +841,61 @@ export default {
opacity
:
1
;
}
}
//输入数字页面样式
.top2
{
padding
:
40rpx
24rpx
;
}
.top2-name
{
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#191919
;
text-align
:
center
;
}
.top2-number
{
display
:
flex
;
justify-content
:
space-between
;
font-weight
:
bold
;
margin-top
:
80rpx
;
align-items
:
center
;
}
.top2-price
{
display
:
flex
;
justify-content
:
space-between
;
font-weight
:
bold
;
margin-top
:
48rpx
;
text
:nth-child
(
2
)
{
font-size
:
40rpx
;
color
:
$red
;
}
}
.top2-remark
{
margin-top
:
48rpx
;
color
:
$grey
;
}
.top2-tips
{
margin-top
:
24rpx
;
color
:
$grey
;
font-size
:
24rpx
;
}
.bottom2
{
position
:
fixed
;
width
:
100%
;
height
:
100rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
bottom
:
0
;
box-shadow
:
0px
-4px
12px
2px
rgba
(
0
,
0
,
0
,
0
.08
);
background
:
#ffffff
;
}
.btn
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
width
:
90%
;
height
:
80rpx
;
border-radius
:
8rpx
;
font-size
:
32rpx
;
font-weight
:
bold
;
}
</
style
>
pages/payment/paySuccess/paySuccess.vue
View file @
0e072b0e
...
...
@@ -57,14 +57,22 @@ export default {
let
data
=
{
orderId
:
this
.
orderId
}
this
.
$request
(
'order/
o
rder/getStatusById'
,
data
).
then
((
res
)
=>
{
this
.
$request
(
'order/
userO
rder/getStatusById'
,
data
).
then
((
res
)
=>
{
if
(
res
.
code
==
'00'
)
{
this
.
status
=
res
.
data
//如果是组合票,直接跳订单列表页面
let
orderType
=
res
.
data
.
orderType
if
(
orderType
==
'10'
){
uni
.
reLaunch
({
url
:
this
.
afterBuyUrl
+
'?orderId='
+
this
.
orderId
+
'&ifyukuaiCode='
+
this
.
ifyukuaiCode
})
return
}
this
.
status
=
res
.
data
.
orderStatus
if
(
this
.
status
==
'2'
||
this
.
status
==
'4'
||
this
.
status
==
'5'
)
{
//1.跳订单列表,2.订单详情,3.停留该页面显示支付成功(ourPayment页面跳入时,无afterBuyUrl,停留在该页面)
this
.
title
=
'支付成功!'
this
.
loadImg
=
false
uni
.
re
directTo
({
uni
.
re
Launch
({
url
:
this
.
afterBuyUrl
+
'?orderId='
+
this
.
orderId
+
'&ifyukuaiCode='
+
this
.
ifyukuaiCode
})
}
...
...
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