Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
doublescreen-front
Project
Project
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pengguangpu
doublescreen-front
Commits
aa0dfba9
Commit
aa0dfba9
authored
Feb 19, 2020
by
gaodapeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加结算页面回跳,增加获取账户信息的代码
parent
1fa8c4c6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
5 deletions
+27
-5
actioncmd.js
const/actioncmd.js
+3
-0
balance.js
pages/balance/balance.js
+2
-1
home.js
pages/home/home.js
+22
-4
No files found.
const/actioncmd.js
View file @
aa0dfba9
...
@@ -24,3 +24,6 @@ export const ACTION_ON_PAY_SUCCESS = "ACTION_ON_PAY_SUCCESS";
...
@@ -24,3 +24,6 @@ export const ACTION_ON_PAY_SUCCESS = "ACTION_ON_PAY_SUCCESS";
//支付失败
//支付失败
export
const
ACTION_ON_PAY_FAILED
=
"ACTION_ON_PAY_FAILED"
;
export
const
ACTION_ON_PAY_FAILED
=
"ACTION_ON_PAY_FAILED"
;
//获取账户信息
export
const
ACTION_GET_ACCOUNT
=
"ACTION_GET_ACCOUNT"
;
pages/balance/balance.js
View file @
aa0dfba9
...
@@ -63,8 +63,9 @@ Page({
...
@@ -63,8 +63,9 @@ Page({
my
.
ix
.
onBuddyMessage
({
my
.
ix
.
onBuddyMessage
({
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
console
.
info
(
`onBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
console
.
info
(
`onBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
if
(
res
.
action
==
ACTION_GO_SCAN
){
if
(
res
.
action
==
ACTION_GO_SCAN
){
//返回扫码页
//增加跳转回去的内容
//增加跳转回去的内容
my
.
navigateBack
();
}
else
{
}
else
{
//未知指令
//未知指令
}
}
...
...
pages/home/home.js
View file @
aa0dfba9
var
api
=
require
(
"../../utils/api.js"
);
import
{
Page
}
from
'../../utils/scan'
;
import
{
Page
}
from
'../../utils/scan'
;
import
{
API_USE_COUPON
}
from
'../../const/apiurl'
import
{
API_USE_COUPON
}
from
'../../const/apiurl'
var
api
=
require
(
"../../utils/api.js"
);
import
{
ACTION_GO_SCAN
}
from
'../../const/actioncmd'
import
{
ACTION_GO_SCAN
}
from
'../../const/actioncmd'
import
{
ACTION_GET_ACCOUNT
}
from
'../../const/actioncmd'
Page
({
Page
({
data
:
{
data
:
{
...
@@ -36,8 +36,26 @@ Page({
...
@@ -36,8 +36,26 @@ Page({
console
.
info
(
`sendBuddyMessage failed:
${
JSON
.
stringify
(
res
)}
`
);
console
.
info
(
`sendBuddyMessage failed:
${
JSON
.
stringify
(
res
)}
`
);
}
}
});
});
}
else
{
}
else
if
(
res
.
action
==
ACTION_GET_ACCOUNT
){
//未知指令
var
message
=
{
data
:
getApp
().
globalData
.
localAccountInfo
,
action
:
ACTION_GET_ACCOUNT
}
my
.
ix
.
sendBuddyMessage
({
// 填入目标小程序的 AppID
target
:
getApp
().
globalData
.
backScreenAppId
,
data
:
{
action
:
ACTION_GET_ACCOUNT
,
data
:
message
},
success
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
},
fail
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage failed:
${
JSON
.
stringify
(
res
)}
`
);
}
});
}
}
}
}
});
});
...
...
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