Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jz_Travel
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
zhengke
jz_Travel
Commits
852f7ed3
Commit
852f7ed3
authored
Oct 15, 2021
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
56449934
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
15 deletions
+19
-15
jz_Reserve.vue
pages/jiuzhai/jz_Reserve.vue
+4
-13
utils.js
plugin/utils.js
+15
-2
No files found.
pages/jiuzhai/jz_Reserve.vue
View file @
852f7ed3
...
...
@@ -297,7 +297,7 @@
<view
class=
"big-title"
>
<text>
{{
currentPriceInfo
.
startCityName
}}
出发
</text>
</view>
<view
class=
"jz_ReseQue"
@
click=
"subscribeMsgAli"
>
<view
class=
"jz_ReseQue"
>
<img
src=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/CustomizedCar/zuanshi.png"
/>
即时确认:本产品付款后可快速确认,放心期待您的旅行
...
...
@@ -887,17 +887,6 @@ export default {
// #endif
// #ifdef MP-ALIPAY
//支付宝支付
subscribeMsgAli
()
{
let
idsArr
=
uni
.
getStorageSync
(
"basedata"
)?.
mall
?.
alimessage
??
[];
let
ids
=
[];
if
(
idsArr
.
length
>
0
)
{
idsArr
.
map
((
e
)
=>
{
ids
.
push
(
e
.
MessageId
);
});
}
console
.
log
(
"ids"
,
ids
);
this
.
$utils
.
SubscribeMsgAli
(
ids
,
()
=>
{});
},
querenAli
(
data
)
{
let
that
=
this
;
let
url
=
"/api/WeChatPay/GetTravlePayInfo"
;
...
...
@@ -915,7 +904,9 @@ export default {
(
res
)
=>
{
this
.
orderInfo
=
JSON
.
parse
(
res
.
data
);
if
(
res
.
data
)
{
that
.
PayAli
(
res
.
data
,
data
);
that
.
$utils
.
SubscribeMsgAli
(()
=>
{
that
.
PayAli
(
res
.
data
,
data
);
});
}
else
{
uni
.
showToast
({
title
:
"获取交易号失败"
,
...
...
plugin/utils.js
View file @
852f7ed3
...
...
@@ -40,13 +40,22 @@ function getretailer() {//判断是否是分销商
// #ifdef MP-ALIPAY
// 引入消息模板方法
const
{
requestSubscribeMessage
}
=
requirePlugin
(
"subscribeMsg"
);
function
SubscribeMsgAli
(
ids
,
cb
)
{
//支付宝小程序订阅消息
//支付宝小程序订阅消息
function
SubscribeMsgAli
(
cb
)
{
let
idsArr
=
uni
.
getStorageSync
(
"basedata"
)?.
mall
?.
alimessage
??
[];
let
ids
=
[];
if
(
idsArr
.
length
>
0
)
{
idsArr
.
map
((
e
)
=>
{
ids
.
push
(
e
.
MessageId
);
});
}
if
(
ids
.
length
===
0
)
{
my
.
showToast
({
type
:
'fail'
,
content
:
'请传入模板id'
,
duration
:
3000
,
});
cb
();
return
;
}
requestSubscribeMessage
({
// 触发消息订阅弹框
...
...
@@ -54,12 +63,16 @@ function SubscribeMsgAli(ids, cb) {//支付宝小程序订阅消息
callback
(
res
)
{
console
.
log
(
'订阅回调'
,
res
);
if
(
res
.
success
)
{
uni
.
showToast
({
title
:
"订阅成功"
,
duration
:
1000
,
});
cb
();
}
else
{
switch
(
res
.
errorCode
)
{
case
11
:
{
my
.
call
(
'toast'
,
{
content
:
'用户
未订阅关闭弹窗
'
,
content
:
'用户
取消订阅
'
,
});
break
;
}
...
...
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