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
dab0bd36
Commit
dab0bd36
authored
Feb 27, 2020
by
gaodapeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加核验代码,fix bugs
parent
ec00a0a0
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
91 additions
and
21 deletions
+91
-21
app.json
app.json
+1
-1
actioncmd.js
const/actioncmd.js
+9
-1
scandialog.axml
custom_widgets/scandialog/scandialog.axml
+1
-1
balance.js
pages/balance/balance.js
+9
-2
home.js
pages/home/home.js
+71
-16
No files found.
app.json
View file @
dab0bd36
const/actioncmd.js
View file @
dab0bd36
...
...
@@ -69,3 +69,11 @@ export const ACTION_BALANCE_BACK_GOODS = "ACTION_BALANCE_BACK_GOODS";
//打印日结订单
export
const
ACTION_DAY_CHECK
=
"ACTION_DAY_CHECK"
;
//核验
export
const
ACTION_VERIFY
=
"ACTION_VERIFY"
;
//核验成功
export
const
ACTION_VERIFY_SUCCESS
=
"ACTION_VERIFY_SUCCESS"
;
//核验失败
export
const
ACTION_VERIFY_FAILED
=
"ACTION_VERIFY_FAILED"
;
custom_widgets/scandialog/scandialog.axml
View file @
dab0bd36
<view class="popUpScanBg"
a:if="{{dialogDisplay >=
show}}">
<view class="popUpScanBg"
hidden="{{dialogDisplay <
show}}">
<!-- 灰黑色背景 -->
<view style="position:absolute;width:100%;height:100%;left:0rpx;top:0rpx;background-color: rgba(0, 0, 0, 0.65);background-size:100% 100%;"/>
...
...
pages/balance/balance.js
View file @
dab0bd36
...
...
@@ -82,7 +82,7 @@ Page({
}
});
var
speechContent
=
t
otal
Price
+
"元"
;
var
speechContent
=
t
his
.
data
.
pay
Price
+
"元"
;
my
.
ix
.
speech
({
text
:
speechContent
,
speak
:
true
,
...
...
@@ -98,6 +98,12 @@ Page({
},
onReady
()
{
if
(
my
.
canIUse
(
'hideBackHome'
))
{
my
.
hideBackHome
();
}
},
onShow
()
{
my
.
ix
.
onBuddyMessage
({
...
...
@@ -168,6 +174,7 @@ Page({
this
.
doPay
(
this
.
data
.
orderNo
,
res
.
barCode
);
}
},
fail
:
(
res
)
=>
{
my
.
hideLoading
();
my
.
showToast
({
type
:
'exception'
,
content
:
api
.
decodeErrorMessage
(
res
.
error
),
...
...
@@ -232,7 +239,7 @@ Page({
console
.
log
(
"支付回调成功,跳转 "
);
if
(
res
.
data
.
tradeAmount
!=
null
)
{
var
speechContent
=
"成功支付"
+
res
.
data
.
tradeAmount
+
"元"
;
var
speechContent
=
"成功支付"
+
payUtils
.
fen2Yuan
(
res
.
data
.
tradeAmount
)
+
"元"
;
my
.
ix
.
speech
({
text
:
speechContent
,
speak
:
true
,
...
...
pages/home/home.js
View file @
dab0bd36
...
...
@@ -9,7 +9,8 @@ import {
ACTION_DIRECT_PAYMENT
,
ACTION_CONVERT_COUPON
,
ACTION_GO_HOME
,
ACTION_REFUND
,
ACTION_REFUND_FAILED
,
ACTION_REFUND_SUCCESS
,
ACTION_PRINT_LAST_ORDER
,
ACTION_SYSTEM_SETTING
,
ACTION_DAY_CHECK
ACTION_SYSTEM_SETTING
,
ACTION_VERIFY
,
ACTION_VERIFY_SUCCESS
,
ACTION_VERIFY_FAILED
,
ACTION_DAY_CHECK
,
}
from
'../../const/actioncmd'
...
...
@@ -17,7 +18,7 @@ Page({
data
:
{
//显示弹窗,>1为显示,2loading 3 result success 4 result failed
scanDialogDisplay
:
0
,
dialogShowType
:
""
,
//弹窗类型:如refund coupon
dialogShowType
:
""
,
//弹窗类型:如refund coupon
verify
dialogRemindText
:
"请扫描兑换码"
,
dialogLoadingText
:
"识别中"
,
dialogResultSuccessRemind
:
"兑换码已识别"
,
...
...
@@ -38,12 +39,12 @@ Page({
success
:
(
res
)
=>
{
console
.
info
(
`onBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
if
(
res
.
action
==
ACTION_GO_SCAN
)
{
//
if (res.data.printEnabled != null) {
//
my.setStorageSync({
//
key: 'printEnabled',
//
data: { enabled: res.data.printEnabled }
// })
//
}
if
(
res
.
data
.
printEnabled
!=
null
)
{
my
.
setStorageSync
({
key
:
'printEnabled'
,
data
:
{
enabled
:
res
.
data
.
printEnabled
}
});
}
my
.
ix
.
sendBuddyMessage
({
// 填入目标小程序的 AppID
...
...
@@ -176,6 +177,25 @@ Page({
}
else
if
(
res
.
action
==
ACTION_DAY_CHECK
)
{
//本地先写死数据
context
.
printDayCheck
();
}
else
if
(
res
.
action
==
ACTION_VERIFY
)
{
console
.
log
(
"核验事件"
);
//显示弹窗
context
.
setData
({
scanDialogDisplay
:
1
,
dialogShowType
:
"verify"
,
dialogRemindText
:
"请扫描订单编码核销"
,
dialogLoadingText
:
"识别中"
,
dialogResultSuccessRemind
:
"核验通过"
,
dialogResultSuccessText
:
"核验通过!可以离场"
,
dialogResultFailureRemind
:
"核验未通过"
,
dialogResultFailureText
:
"核验未通过!无效的核验码"
,
});
var
speechContent
=
"请扫描订单编码核销"
;
my
.
ix
.
speech
({
text
:
speechContent
,
speak
:
true
,
success
:
(
r
)
=>
{
}
});
}
}
});
...
...
@@ -356,6 +376,8 @@ Page({
}
else
if
(
this
.
data
.
dialogShowType
==
"coupon"
)
{
// 兑换券
this
.
verifyCoupon
(
r
);
}
else
if
(
this
.
data
.
dialogShowType
==
"verify"
)
{
this
.
verify
(
r
);
}
}
},
...
...
@@ -432,6 +454,24 @@ Page({
});
},
//同步兑换券到后台
sendConvertCouponToBack
(
e
)
{
my
.
ix
.
sendBuddyMessage
({
// 填入目标小程序的 AppID
target
:
getApp
().
globalData
.
backScreenAppId
,
data
:
{
action
:
ACTION_CONVERT_COUPON
,
data
:
e
},
success
:
(
sres
)
=>
{
},
fail
:
(
fres
)
=>
{
sendConvertCouponToBack
(
e
)
console
.
info
(
`sendBuddyMessage failed:
${
JSON
.
stringify
(
res
)}
`
);
}
});
},
//退款
...
...
@@ -500,23 +540,38 @@ Page({
},
//同步兑换券到后台
sendConvertCouponToBack
(
e
)
{
//核验
verify
(
result
)
{
//目前缺少核验的接口,数据都是自造
var
speechContent
=
"核验通过"
;
my
.
ix
.
speech
({
text
:
speechContent
,
speak
:
true
,
success
:
(
r
)
=>
{
}
});
this
.
setData
({
scanDialogDisplay
:
3
})
this
.
onVerifyCallback
(
ACTION_VERIFY_SUCCESS
,
null
);
},
onVerifyCallback
(
action
,
result
)
{
my
.
ix
.
sendBuddyMessage
({
// 填入目标小程序的 AppID
target
:
getApp
().
globalData
.
backScreenAppId
,
data
:
{
action
:
ACTION_CONVERT_COUPON
,
data
:
e
action
:
action
,
data
:
result
},
success
:
(
sres
)
=>
{
success
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
//跳转到扫码页面
},
fail
:
(
fres
)
=>
{
sendConvertCouponToBack
(
e
)
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