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
ed48e552
Commit
ed48e552
authored
Mar 02, 2020
by
gaodapeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加退出的确认
parent
194b3a14
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
32 deletions
+53
-32
actioncmd.js
const/actioncmd.js
+3
-0
home.js
pages/home/home.js
+50
-32
No files found.
const/actioncmd.js
View file @
ed48e552
...
...
@@ -79,3 +79,6 @@ export const ACTION_VERIFY_SUCCESS = "ACTION_VERIFY_SUCCESS";
//核验失败
export
const
ACTION_VERIFY_FAILED
=
"ACTION_VERIFY_FAILED"
;
//退出事件
export
const
ACTION_QUIT
=
"ACTION_QUIT"
;
\ No newline at end of file
pages/home/home.js
View file @
ed48e552
...
...
@@ -10,7 +10,8 @@ import {
ACTION_GO_HOME
,
ACTION_REFUND
,
ACTION_REFUND_FAILED
,
ACTION_REFUND_SUCCESS
,
ACTION_PRINT_LAST_ORDER
,
ACTION_SYSTEM_SETTING
,
ACTION_VERIFY
,
ACTION_VERIFY_SUCCESS
,
ACTION_VERIFY_FAILED
,
ACTION_DAY_CHECK
,
ACTION_PICK_UP_GOODS
ACTION_VERIFY_FAILED
,
ACTION_DAY_CHECK
,
ACTION_PICK_UP_GOODS
,
ACTION_QUIT
,
}
from
'../../const/actioncmd'
...
...
@@ -35,15 +36,15 @@ Page({
onLoad
()
{
let
pickgoodsTemp
=
[]
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
var
good
=
{};
good
.
name
=
"SK-II R.N.A.超肌能紧致弹力精华"
good
.
price
=
"1098"
good
.
quantity
=
1
pickgoodsTemp
.
push
(
good
)
}
this
.
setData
({
pickGoods
:
pickgoodsTemp
})
let
pickgoodsTemp
=
[]
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
var
good
=
{};
good
.
name
=
"SK-II R.N.A.超肌能紧致弹力精华"
good
.
price
=
"1098"
good
.
quantity
=
1
pickgoodsTemp
.
push
(
good
)
}
this
.
setData
({
pickGoods
:
pickgoodsTemp
})
},
...
...
@@ -184,11 +185,17 @@ Page({
console
.
log
(
"启动系统设置"
);
my
.
ix
.
startApp
({
appName
:
'settings'
,
success
:
(
res
)
=>
{
console
.
log
(
"启动系统设置成功 success==>"
+
JSON
.
stringify
(
res
));
},
fail
:
(
res
)
=>
{
console
.
log
(
"启动系统设置失败 failed==>"
+
JSON
.
stringify
(
res
));
}
});
context
.
setData
({
toSetting
:
true
,
})
}
else
if
(
res
.
action
==
ACTION_PICK_UP_GOODS
)
{
}
else
if
(
res
.
action
==
ACTION_PICK_UP_GOODS
)
{
//提货
context
.
setData
({
scanDialogDisplay
:
res
.
data
,
...
...
@@ -209,13 +216,13 @@ Page({
}
});
}
//隐藏提货页面
if
(
res
.
data
==
0
)
{
context
.
setData
({
pickGoodsState
:
0
,
pickGoods
:
[]
})
if
(
res
.
data
==
0
)
{
context
.
setData
({
pickGoodsState
:
0
,
pickGoods
:
[]
})
}
}
else
if
(
res
.
action
==
ACTION_DAY_CHECK
)
{
//本地先写死数据
...
...
@@ -239,6 +246,17 @@ Page({
speak
:
true
,
success
:
(
r
)
=>
{
}
});
}
else
if
(
res
.
action
==
ACTION_QUIT
)
{
console
.
log
(
"退出事件"
)
my
.
removeStorageSync
({
key
:
'localAccountInfo'
,
});
my
.
removeStorageSync
({
key
:
'localLoginInfo'
,
})
my
.
reLaunch
({
url
:
"/pages/login/login"
,
});
}
}
});
...
...
@@ -278,7 +296,7 @@ Page({
//打印日期
printer
.
printNowDate
(),
//门店号
printer
.
printText
(
"门店号:"
+
getApp
().
globalData
.
localAccountInfo
.
storeName
),
printer
.
printText
(
"门店号:"
+
getApp
().
globalData
.
localAccountInfo
.
storeName
),
//收款总额
printer
.
printText
(
'收款总额:10.00元'
),
printer
.
feedPaper
(),
...
...
@@ -419,7 +437,7 @@ Page({
}
else
if
(
this
.
data
.
dialogShowType
==
"coupon"
)
{
// 兑换券
this
.
verifyCoupon
(
r
);
}
else
if
(
this
.
data
.
dialogShowType
==
"pickgoods"
)
{
}
else
if
(
this
.
data
.
dialogShowType
==
"pickgoods"
)
{
// 提货
this
.
pickGoods
(
r
);
}
else
if
(
this
.
data
.
dialogShowType
==
"verify"
)
{
...
...
@@ -620,23 +638,23 @@ Page({
},
//提货商品
//提货商品
pickGoods
(
code
)
{
let
context
=
this
;
this
.
setData
({
scanDialogDisplay
:
2
})
setTimeout
(()
=>
{
//模拟提货数据
let
pickgoodsTemp
=
[]
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
var
good
=
{};
good
.
name
=
"SK-II R.N.A.超肌能紧致弹力精华"
good
.
price
=
"1098"
good
.
quantity
=
1
pickgoodsTemp
.
push
(
good
)
}
//模拟提货数据
let
pickgoodsTemp
=
[]
for
(
var
i
=
0
;
i
<
3
;
i
++
)
{
var
good
=
{};
good
.
name
=
"SK-II R.N.A.超肌能紧致弹力精华"
good
.
price
=
"1098"
good
.
quantity
=
1
pickgoodsTemp
.
push
(
good
)
}
let
pickGoodsReq
=
{}
pickGoodsReq
.
pickGoodsState
=
3
;
pickGoodsReq
.
pickGoodsState
=
3
;
pickGoodsReq
.
pickGoods
=
pickgoodsTemp
;
my
.
ix
.
sendBuddyMessage
({
target
:
getApp
().
globalData
.
backScreenAppId
,
...
...
@@ -645,13 +663,13 @@ Page({
data
:
pickGoodsReq
},
success
:
(
sres
)
=>
{
context
.
setData
({
pickGoods
:
pickgoodsTemp
,
pickGoodsState
:
3
,
scanDialogDisplay
:
0
})
context
.
setData
({
pickGoods
:
pickgoodsTemp
,
pickGoodsState
:
3
,
scanDialogDisplay
:
0
})
},
fail
:
(
fres
)
=>
{
console
.
info
(
`sendBuddyMessage failed:
${
JSON
.
stringify
(
res
)}
`
);
}
});
},
700
);
},
...
...
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