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
a2870eca
Commit
a2870eca
authored
Jul 30, 2021
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支付宝小程序开发
parent
651379ce
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
91 additions
and
45 deletions
+91
-45
ourPayment.vue
pages/ourPayment/ourPayment.vue
+24
-17
login.js
unpackage/dist/build/mp-alipay/pages/login/login.js
+1
-1
ourPayment.js
...ckage/dist/build/mp-alipay/pages/ourPayment/ourPayment.js
+1
-1
project.config.json
unpackage/dist/build/mp-weixin/project.config.json
+30
-5
index.js.map
...ge/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map
+1
-1
ourPayment.js.map
...v/.sourcemap/mp-weixin/pages/ourPayment/ourPayment.js.map
+1
-1
ourPayment.js
unpackage/dist/dev/mp-alipay/pages/ourPayment/ourPayment.js
+24
-17
ourPayment.js
unpackage/dist/dev/mp-weixin/pages/ourPayment/ourPayment.js
+9
-2
No files found.
pages/ourPayment/ourPayment.vue
View file @
a2870eca
...
...
@@ -113,6 +113,7 @@
timeStamp
:
""
,
//时间戳
nonceStr
:
""
,
//随机字符串
package
:
""
,
//订单详情扩展字符串
orderInfo
:
""
,
//支付宝订单号
flag
:
""
,
//setTimeout函数
couponData
:
""
,
//所有劵数据
chooseCouponObj
:
""
,
//默认选中最优价格优惠券
...
...
@@ -154,8 +155,9 @@
}
},
onLoad
(
option
)
{
this
.
companyId
=
(
new
RegExp
(
'[?|&]companyId='
+
'([^&;]+?)(&|#|;|$)'
).
exec
(
decodeURIComponent
(
option
.
q
))
||
[,
""
])[
1
].
replace
(
/
\+
/g
,
'%20'
)
||
""
this
.
merchantId
=
(
new
RegExp
(
'[?|&]merchantId='
+
'([^&;]+?)(&|#|;|$)'
).
exec
(
decodeURIComponent
(
option
.
q
))
||
[,
""
])[
1
].
replace
(
/
\+
/g
,
'%20'
)
||
""
this
.
enterUrl
=
option
.
q
let
channelId
=
this
.
getUrlKey
(
"channelId"
)
let
companyId
=
this
.
getUrlKey
(
"companyId"
)
if
(
this
.
merchantId
)
{
//大商家的有merchantId
this
.
init
()
}
else
{
//小商家没有merchantId
...
...
@@ -164,6 +166,9 @@
this
.
initCoupon
()
},
methods
:
{
getUrlKey
(
name
){
//---------------------------------------------------------------获取url
return
(
new
RegExp
(
'[?|&]'
+
name
+
'='
+
'([^&;]+?)(&|#|;|$)'
).
exec
(
decodeURIComponent
(
this
.
enterUrl
))
||
[,
""
])[
1
].
replace
(
/
\+
/g
,
'%20'
)
||
""
;
},
clickNum
(
i
,
index
,
a
)
{
//---------------------------------------------------------------------输入数字
this
.
buyMoney
+=
i
this
.
leftList
[
index
].
child
[
a
].
background
=
"#dddddd"
...
...
@@ -314,6 +319,8 @@
this
.
timeStamp
=
res
.
data
.
timestamp
this
.
nonceStr
=
res
.
data
.
noncestr
this
.
package
=
res
.
data
.
package
//支付宝入参
this
.
orderInfo
=
res
.
data
.
payInfo
||
""
this
.
goPay
()
}
else
{
uni
.
showToast
({
...
...
@@ -349,21 +356,21 @@
//#endif
// #ifdef MP-ALIPAY
uni
.
requestPayment
({
provider
:
'alipay'
,
// 服务提供商 支付宝支付: alipay 微信支付: wxpay
orderInfo
:
this
.
payInfo
.
orderN
o
,
// 支付宝订单号
success
:
function
(
res
)
{
uni
.
redirectTo
({
url
:
"../paySuccess/paySuccess"
})
},
fail
:
function
(
err
)
{
uni
.
showToast
({
title
:
err
.
errMsg
,
icon
:
"none"
})
}
})
//
uni.requestPayment({
//
provider: 'alipay', // 服务提供商 支付宝支付: alipay 微信支付: wxpay
// orderInfo: this.orderInf
o, // 支付宝订单号
//
success: function (res) {
//
uni.redirectTo({
//
url:"../paySuccess/paySuccess"
//
})
//
},
//
fail: function (err) {
//
uni.showToast({
//
title:err.errMsg,
//
icon:"none"
//
})
//
}
//
})
// #endif
}
},
...
...
unpackage/dist/build/mp-alipay/pages/login/login.js
View file @
a2870eca
(
my
[
"webpackJsonp"
]
=
my
[
"webpackJsonp"
]
||
[]).
push
([[
"pages/login/login"
],{
"2c9f"
:
function
(
e
,
n
,
t
){
"use strict"
;
var
o
;
t
.
d
(
n
,
"b"
,(
function
(){
return
c
})),
t
.
d
(
n
,
"c"
,(
function
(){
return
r
})),
t
.
d
(
n
,
"a"
,(
function
(){
return
o
}));
var
c
=
function
(){
var
e
=
this
,
n
=
e
.
$createElement
;
e
.
_self
.
_c
},
r
=
[]},
"9fb8"
:
function
(
e
,
n
,
t
){
"use strict"
;
t
.
r
(
n
);
var
o
=
t
(
"2c9f"
),
c
=
t
(
"a824"
);
for
(
var
r
in
c
)
"default"
!==
r
&&
function
(
e
){
t
.
d
(
n
,
e
,(
function
(){
return
c
[
e
]}))}(
r
);
var
a
,
i
=
t
(
"f0c5"
),
u
=
Object
(
i
[
"a"
])(
c
[
"default"
],
o
[
"b"
],
o
[
"c"
],
!
1
,
null
,
null
,
null
,
!
1
,
o
[
"a"
],
a
);
n
[
"default"
]
=
u
.
exports
},
a824
:
function
(
e
,
n
,
t
){
"use strict"
;
t
.
r
(
n
);
var
o
=
t
(
"bae4"
),
c
=
t
.
n
(
o
);
for
(
var
r
in
o
)
"default"
!==
r
&&
function
(
e
){
t
.
d
(
n
,
e
,(
function
(){
return
o
[
e
]}))}(
r
);
n
[
"default"
]
=
c
.
a
},
bae4
:
function
(
e
,
n
,
t
){
"use strict"
;(
function
(
e
){
Object
.
defineProperty
(
n
,
"__esModule"
,{
value
:
!
0
}),
n
.
default
=
void
0
;
var
t
=
{
data
:
function
(){
return
{}},
methods
:{},
onLoad
:
function
(){
var
n
=
this
;
e
.
getProvider
({
service
:
"oauth"
,
success
:
function
(
t
){
e
.
login
({
provider
:
t
.
provider
[
0
],
success
:
function
(
o
){
if
(
o
.
code
){
var
c
=
""
;
"weixin"
==
t
.
provider
[
0
]?
c
=
3
:
"alipay"
==
t
.
provider
[
0
]
&&
(
c
=
4
);
var
r
=
{
code
:
o
.
code
,
source
:
c
};
e
.
showToast
({
title
:
o
.
code
+
"source"
+
c
,
icon
:
"none"
}),
n
.
$request
(
"wechat/wx/getUserInfoByCode"
,
r
).
then
((
function
(
n
){
if
(
"00"
==
n
.
code
){
e
.
showToast
({
title
:
3
,
icon
:
"none"
});
var
t
=
n
.
data
.
openid
;
e
.
setStorageSync
(
"openid"
,
t
),
e
.
navigateBack
({
delta
:
1
})}
else
e
.
removeStorageSync
(
"openid"
),
e
.
showToast
({
title
:
n
.
message
,
icon
:
"none"
})})).
catch
((
function
(
n
){
e
.
removeStorageSync
(
"openid"
)}))}}})}})}};
n
.
default
=
t
}).
call
(
this
,
t
(
"c11b"
)[
"default"
])},
d263
:
function
(
e
,
n
,
t
){
"use strict"
;(
function
(
e
){
t
(
"6909"
),
t
(
"921b"
);
o
(
t
(
"66fd"
));
var
n
=
o
(
t
(
"9fb8"
));
function
o
(
e
){
return
e
&&
e
.
__esModule
?
e
:{
default
:
e
}}
e
(
n
.
default
)}).
call
(
this
,
t
(
"c11b"
)[
"createPage"
])}},[[
"d263"
,
"common/runtime"
,
"common/vendor"
]]]);
\ No newline at end of file
(
my
[
"webpackJsonp"
]
=
my
[
"webpackJsonp"
]
||
[]).
push
([[
"pages/login/login"
],{
"88f6"
:
function
(
e
,
n
,
t
){
"use strict"
;
var
o
;
t
.
d
(
n
,
"b"
,(
function
(){
return
r
})),
t
.
d
(
n
,
"c"
,(
function
(){
return
c
})),
t
.
d
(
n
,
"a"
,(
function
(){
return
o
}));
var
r
=
function
(){
var
e
=
this
,
n
=
e
.
$createElement
;
e
.
_self
.
_c
},
c
=
[]},
"9fb8"
:
function
(
e
,
n
,
t
){
"use strict"
;
t
.
r
(
n
);
var
o
=
t
(
"88f6"
),
r
=
t
(
"a824"
);
for
(
var
c
in
r
)
"default"
!==
c
&&
function
(
e
){
t
.
d
(
n
,
e
,(
function
(){
return
r
[
e
]}))}(
c
);
var
a
,
i
=
t
(
"f0c5"
),
u
=
Object
(
i
[
"a"
])(
r
[
"default"
],
o
[
"b"
],
o
[
"c"
],
!
1
,
null
,
null
,
null
,
!
1
,
o
[
"a"
],
a
);
n
[
"default"
]
=
u
.
exports
},
a824
:
function
(
e
,
n
,
t
){
"use strict"
;
t
.
r
(
n
);
var
o
=
t
(
"bae4"
),
r
=
t
.
n
(
o
);
for
(
var
c
in
o
)
"default"
!==
c
&&
function
(
e
){
t
.
d
(
n
,
e
,(
function
(){
return
o
[
e
]}))}(
c
);
n
[
"default"
]
=
r
.
a
},
bae4
:
function
(
e
,
n
,
t
){
"use strict"
;(
function
(
e
){
Object
.
defineProperty
(
n
,
"__esModule"
,{
value
:
!
0
}),
n
.
default
=
void
0
;
var
t
=
{
data
:
function
(){
return
{}},
methods
:{},
onLoad
:
function
(){
var
n
=
this
;
e
.
getProvider
({
service
:
"oauth"
,
success
:
function
(
t
){
e
.
login
({
provider
:
t
.
provider
[
0
],
success
:
function
(
o
){
if
(
o
.
code
){
var
r
=
""
;
"weixin"
==
t
.
provider
[
0
]?
r
=
3
:
"alipay"
==
t
.
provider
[
0
]
&&
(
r
=
4
);
var
c
=
{
code
:
o
.
code
,
source
:
r
};
n
.
$request
(
"wechat/wx/getUserInfoByCode"
,
c
).
then
((
function
(
n
){
if
(
"00"
==
n
.
code
){
var
t
=
n
.
data
.
openid
;
e
.
setStorageSync
(
"openid"
,
t
),
e
.
navigateBack
({
delta
:
1
})}
else
e
.
removeStorageSync
(
"openid"
),
e
.
showToast
({
title
:
n
.
message
,
icon
:
"none"
})})).
catch
((
function
(
n
){
e
.
removeStorageSync
(
"openid"
)}))}}})}})}};
n
.
default
=
t
}).
call
(
this
,
t
(
"c11b"
)[
"default"
])},
d263
:
function
(
e
,
n
,
t
){
"use strict"
;(
function
(
e
){
t
(
"6909"
),
t
(
"921b"
);
o
(
t
(
"66fd"
));
var
n
=
o
(
t
(
"9fb8"
));
function
o
(
e
){
return
e
&&
e
.
__esModule
?
e
:{
default
:
e
}}
e
(
n
.
default
)}).
call
(
this
,
t
(
"c11b"
)[
"createPage"
])}},[[
"d263"
,
"common/runtime"
,
"common/vendor"
]]]);
\ No newline at end of file
unpackage/dist/build/mp-alipay/pages/ourPayment/ourPayment.js
View file @
a2870eca
This diff is collapsed.
Click to expand it.
unpackage/dist/build/mp-weixin/project.config.json
View file @
a2870eca
...
...
@@ -6,8 +6,37 @@
"setting"
:
{
"urlCheck"
:
true
,
"es6"
:
true
,
"enhance"
:
false
,
"postcss"
:
true
,
"minified"
:
true
"preloadBackgroundData"
:
false
,
"minified"
:
true
,
"newFeature"
:
false
,
"coverView"
:
true
,
"nodeModules"
:
false
,
"autoAudits"
:
false
,
"showShadowRootInWxmlPanel"
:
true
,
"scopeDataCheck"
:
false
,
"uglifyFileName"
:
false
,
"checkInvalidKey"
:
true
,
"checkSiteMap"
:
true
,
"uploadWithSourceMap"
:
true
,
"compileHotReLoad"
:
false
,
"useMultiFrameRuntime"
:
true
,
"useApiHook"
:
true
,
"useApiHostProcess"
:
true
,
"babelSetting"
:
{
"ignore"
:
[],
"disablePlugins"
:
[],
"outputPath"
:
""
},
"enableEngineNative"
:
false
,
"useIsolateContext"
:
true
,
"useCompilerModule"
:
true
,
"userConfirmedUseCompilerModuleSwitch"
:
false
,
"userConfirmedBundleSwitch"
:
false
,
"packNpmManually"
:
false
,
"packNpmRelationList"
:
[],
"minifyWXSS"
:
true
},
"compileType"
:
"miniprogram"
,
"libVersion"
:
""
,
...
...
@@ -15,19 +44,15 @@
"projectname"
:
"uni-pdtravel"
,
"condition"
:
{
"search"
:
{
"current"
:
-1
,
"list"
:
[]
},
"conversation"
:
{
"current"
:
-1
,
"list"
:
[]
},
"game"
:
{
"current"
:
-1
,
"list"
:
[]
},
"miniprogram"
:
{
"current"
:
-1
,
"list"
:
[]
}
}
...
...
unpackage/dist/dev/.sourcemap/mp-weixin/pages/index/index.js.map
View file @
a2870eca
This diff is collapsed.
Click to expand it.
unpackage/dist/dev/.sourcemap/mp-weixin/pages/ourPayment/ourPayment.js.map
View file @
a2870eca
This diff is collapsed.
Click to expand it.
unpackage/dist/dev/mp-alipay/pages/ourPayment/ourPayment.js
View file @
a2870eca
...
...
@@ -254,6 +254,7 @@ __webpack_require__.r(__webpack_exports__);
timeStamp
:
""
,
//时间戳
nonceStr
:
""
,
//随机字符串
package
:
""
,
//订单详情扩展字符串
orderInfo
:
""
,
//支付宝订单号
flag
:
""
,
//setTimeout函数
couponData
:
""
,
//所有劵数据
chooseCouponObj
:
""
,
//默认选中最优价格优惠券
...
...
@@ -295,8 +296,9 @@ __webpack_require__.r(__webpack_exports__);
},
onLoad
:
function
onLoad
(
option
)
{
this
.
companyId
=
(
new
RegExp
(
'[?|&]companyId='
+
'([^&;]+?)(&|#|;|$)'
).
exec
(
decodeURIComponent
(
option
.
q
))
||
[,
""
])[
1
].
replace
(
/
\+
/g
,
'%20'
)
||
""
;
this
.
merchantId
=
(
new
RegExp
(
'[?|&]merchantId='
+
'([^&;]+?)(&|#|;|$)'
).
exec
(
decodeURIComponent
(
option
.
q
))
||
[,
""
])[
1
].
replace
(
/
\+
/g
,
'%20'
)
||
""
;
this
.
enterUrl
=
option
.
q
;
var
channelId
=
this
.
getUrlKey
(
"channelId"
);
var
companyId
=
this
.
getUrlKey
(
"companyId"
);
if
(
this
.
merchantId
)
{
//大商家的有merchantId
this
.
init
();
}
else
{
//小商家没有merchantId
...
...
@@ -305,6 +307,9 @@ __webpack_require__.r(__webpack_exports__);
this
.
initCoupon
();
},
methods
:
{
getUrlKey
:
function
getUrlKey
(
name
)
{
//---------------------------------------------------------------获取url
return
(
new
RegExp
(
'[?|&]'
+
name
+
'='
+
'([^&;]+?)(&|#|;|$)'
).
exec
(
decodeURIComponent
(
this
.
enterUrl
))
||
[,
""
])[
1
].
replace
(
/
\+
/g
,
'%20'
)
||
""
;
},
clickNum
:
function
clickNum
(
i
,
index
,
a
)
{
var
_this
=
this
;
//---------------------------------------------------------------------输入数字
this
.
buyMoney
+=
i
;
this
.
leftList
[
index
].
child
[
a
].
background
=
"#dddddd"
;
...
...
@@ -455,6 +460,8 @@ __webpack_require__.r(__webpack_exports__);
_this6
.
timeStamp
=
res
.
data
.
timestamp
;
_this6
.
nonceStr
=
res
.
data
.
noncestr
;
_this6
.
package
=
res
.
data
.
package
;
//支付宝入参
_this6
.
orderInfo
=
res
.
data
.
payInfo
||
""
;
_this6
.
goPay
();
}
else
{
uni
.
showToast
({
...
...
@@ -490,21 +497,21 @@ __webpack_require__.r(__webpack_exports__);
uni
.
requestPayment
({
provider
:
'alipay'
,
// 服务提供商 支付宝支付: alipay 微信支付: wxpay
orderInfo
:
this
.
payInfo
.
orderN
o
,
// 支付宝订单号
success
:
function
success
(
res
)
{
uni
.
redirectTo
({
url
:
"../paySuccess/paySuccess"
});
},
fail
:
function
fail
(
err
)
{
uni
.
showToast
({
title
:
err
.
errMsg
,
icon
:
"none"
});
}
});
//
uni.requestPayment({
//
provider: 'alipay', // 服务提供商 支付宝支付: alipay 微信支付: wxpay
// orderInfo: this.orderInf
o, // 支付宝订单号
// success: function
(res) {
//
uni.redirectTo({
// url:"../paySuccess/paySuccess"
// })
//
},
// fail: function
(err) {
//
uni.showToast({
// title:
err.errMsg,
// icon:"none"
// })
// }
// })
}
},
...
...
unpackage/dist/dev/mp-weixin/pages/ourPayment/ourPayment.js
View file @
a2870eca
...
...
@@ -254,6 +254,7 @@ __webpack_require__.r(__webpack_exports__);
timeStamp
:
""
,
//时间戳
nonceStr
:
""
,
//随机字符串
package
:
""
,
//订单详情扩展字符串
orderInfo
:
""
,
//支付宝订单号
flag
:
""
,
//setTimeout函数
couponData
:
""
,
//所有劵数据
chooseCouponObj
:
""
,
//默认选中最优价格优惠券
...
...
@@ -295,8 +296,9 @@ __webpack_require__.r(__webpack_exports__);
},
onLoad
:
function
onLoad
(
option
)
{
this
.
companyId
=
(
new
RegExp
(
'[?|&]companyId='
+
'([^&;]+?)(&|#|;|$)'
).
exec
(
decodeURIComponent
(
option
.
q
))
||
[,
""
])[
1
].
replace
(
/
\+
/g
,
'%20'
)
||
""
;
this
.
merchantId
=
(
new
RegExp
(
'[?|&]merchantId='
+
'([^&;]+?)(&|#|;|$)'
).
exec
(
decodeURIComponent
(
option
.
q
))
||
[,
""
])[
1
].
replace
(
/
\+
/g
,
'%20'
)
||
""
;
this
.
enterUrl
=
option
.
q
;
var
channelId
=
this
.
getUrlKey
(
"channelId"
);
var
companyId
=
this
.
getUrlKey
(
"companyId"
);
if
(
this
.
merchantId
)
{
//大商家的有merchantId
this
.
init
();
}
else
{
//小商家没有merchantId
...
...
@@ -305,6 +307,9 @@ __webpack_require__.r(__webpack_exports__);
this
.
initCoupon
();
},
methods
:
{
getUrlKey
:
function
getUrlKey
(
name
)
{
//---------------------------------------------------------------获取url
return
(
new
RegExp
(
'[?|&]'
+
name
+
'='
+
'([^&;]+?)(&|#|;|$)'
).
exec
(
decodeURIComponent
(
this
.
enterUrl
))
||
[,
""
])[
1
].
replace
(
/
\+
/g
,
'%20'
)
||
""
;
},
clickNum
:
function
clickNum
(
i
,
index
,
a
)
{
var
_this
=
this
;
//---------------------------------------------------------------------输入数字
this
.
buyMoney
+=
i
;
this
.
leftList
[
index
].
child
[
a
].
background
=
"#dddddd"
;
...
...
@@ -455,6 +460,8 @@ __webpack_require__.r(__webpack_exports__);
_this6
.
timeStamp
=
res
.
data
.
timestamp
;
_this6
.
nonceStr
=
res
.
data
.
noncestr
;
_this6
.
package
=
res
.
data
.
package
;
//支付宝入参
_this6
.
orderInfo
=
res
.
data
.
payInfo
||
""
;
_this6
.
goPay
();
}
else
{
uni
.
showToast
({
...
...
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