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
ee0f3a2e
Commit
ee0f3a2e
authored
Feb 19, 2020
by
gaodapeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加首页跳转到扫码页
parent
0f20aa29
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
3 deletions
+45
-3
actioncmd.js
const/actioncmd.js
+5
-0
home.js
pages/home/home.js
+40
-3
No files found.
const/actioncmd.js
View file @
ee0f3a2e
...
...
@@ -13,3 +13,8 @@ export const ACTION_GO_BALANCE = "ACTION_GO_BALANCE";
//请求商品条码
export
const
ACTION_REQUEST_GOOD_INFO
=
"ACTION_REQUEST_GOOD_INFO"
;
//去扫码页面
export
const
ACTION_GO_SCAN
=
"ACTION_GO_SCAN"
;
//获取店铺信息
export
const
ACTION_STORE_INFO
=
"ACTION_STORE_INFO"
;
\ No newline at end of file
pages/home/home.js
View file @
ee0f3a2e
...
...
@@ -2,6 +2,8 @@ import { Page } from '../../utils/scan';
import
{
API_USE_COUPON
}
from
'../../const/apiurl'
var
api
=
require
(
"../../utils/api.js"
);
import
{
ACTION_GO_SCAN
}
from
'../../const/actioncmd'
Page
({
data
:
{
scanDialogDisplay
:
0
...
...
@@ -11,6 +13,43 @@ Page({
},
onshow
(){
my
.
ix
.
onBuddyMessage
({
success
:
(
res
)
=>
{
console
.
info
(
`onBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
if
(
res
.
action
==
ACTION_GO_SCAN
){
//跳转到扫码页面
my
.
redirectTo
({
url
:
"/pages/scan/scan"
});
my
.
ix
.
sendBuddyMessage
({
// 填入目标小程序的 AppID
target
:
getApp
().
globalData
.
backScreenAppId
,
data
:
{
action
:
ACTION_GO_SCAN
,
data
:
null
},
success
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
},
fail
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage failed:
${
JSON
.
stringify
(
res
)}
`
);
}
});
}
else
{
//未知指令
}
}
});
},
onHide
()
{
// 页面隐藏
//关闭后屏监听
my
.
ix
.
offBuddyMessage
();
},
onReady
()
{
if
(
my
.
canIUse
(
'hideBackHome'
))
{
my
.
hideBackHome
();
...
...
@@ -18,9 +57,7 @@ Page({
},
homeTap
()
{
my
.
redirectTo
({
url
:
"/pages/scan/scan"
});
},
//显示弹窗,>1为显示,2loading 3 result success 4 result failed
...
...
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