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
0e3880a1
Commit
0e3880a1
authored
Feb 06, 2020
by
jiangjiantao
Browse files
Options
Browse Files
Download
Plain Diff
核销券
parents
87d52a91
edf4cae0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
13 deletions
+45
-13
home.js
pages/home/home.js
+6
-6
paysuccess.axml
pages/paysuccess/paysuccess.axml
+2
-2
paysuccess.js
pages/paysuccess/paysuccess.js
+30
-2
api.js
utils/api.js
+7
-3
No files found.
pages/home/home.js
View file @
0e3880a1
...
...
@@ -26,15 +26,14 @@ Page({
},
homeTap
()
{
this
.
showDialog
();
//
this.showDialog();
//FIXME 这里是跳转到新的界面
//
my.navigateTo({
//
url: "/pages/balance/balance"
//
});
my
.
navigateTo
({
url
:
"/pages/balance/balance"
});
},
//外接扫码枪事件
onKeyPress
(
r
)
{
console
.
log
(
" onKeyPress==>"
+
r
);
...
...
@@ -49,12 +48,12 @@ Page({
},
//显示弹窗,>1为显示,2loading 3 result success 4 result failed
showDialog
()
{
this
.
setData
({
scanDialogDisplay
:
1
}
)
console
.
log
(
this
.
data
.
scanDialogDisplay
);
},
...
...
@@ -95,4 +94,5 @@ Page({
});
pages/paysuccess/paysuccess.axml
View file @
0e3880a1
<view class="page">
<view class="topTitle">
<view style="margin:0 auto;margin-top:38rpx;">
<image mode="aspectFit" style="width:53rpx;height:53rpx;margin-right:26rpx;float:left;" src="/images/ic_success.png"/>
<image mode="aspectFit" style="width:53rpx;height:53rpx;margin-right:26rpx;float:left;" src="/images/ic
on
_success.png"/>
<view style="height:53rpx;display:flex;">
<text>支付成功</text>
</view>
...
...
@@ -25,7 +25,7 @@
</view>
</view>
<view class="printLoading">
<i-spin></i-spin>
<i-spin
hidden="{{!isShowPrinting}}"
></i-spin>
<view style="position:absolute;width:100%;height:100%;left:0rpx;top:0rpx;color:#000000;font-weight:bold;">
<view style="display: absolute;margin:0 auto;align-content: center;align-items: center;text-align:center;line-height:186rpx;">
<text>{{printerStatus}}</text>
...
...
pages/paysuccess/paysuccess.js
View file @
0e3880a1
Page
({
data
:
{
orderPriceYuan
:
"--.--"
,
orderPriceFen
:
0
,
couponPriceYuan
:
"--.--"
,
couponPriceFen
:
0
,
payPriceYuan
:
"--.--"
,
totalCount
:
"0"
,
payPriceFen
:
0
,
totalCount
:
0
,
printerStatus
:
"小票打印中"
,
couponPriceYuan
:
"--.--"
,
couponHint
:
"xxxxxx"
,
couponName
:
"xxxxxxxx"
,
couponDateDuration
:
"xxxx.xx.xx-xxxx.xx.xx"
,
isShowCoupon
:
true
isShowCoupon
:
false
,
isShowPrinting
:
true
},
onLoad
(
query
)
{
console
.
info
(
`Page onLoad with query:
${
JSON
.
stringify
(
query
)}
`
);
//单位转换&赋值
this
.
data
.
orderPriceFen
=
query
.
orderPrice
;
this
.
data
.
couponPriceFen
=
query
.
couponPrice
;
this
.
data
.
payPriceFen
=
query
.
payPrice
;
this
.
data
.
totalCount
=
query
.
totalCount
;
var
miyapay
=
require
(
"../../utils/miyapay4.js"
);
this
.
data
.
orderPriceYuan
=
miyapay
.
fen2Yuan
(
this
.
data
.
orderPriceFen
);
this
.
data
.
couponPriceYuan
=
miyapay
.
fen2Yuan
(
this
.
data
.
couponPriceFen
);
this
.
data
.
payPriceYuan
=
miyapay
.
fen2Yuan
(
this
.
data
.
payPriceFen
);
},
print
()
{
...
...
@@ -63,6 +77,20 @@ Page({
console
.
info
(
`sendBuddyMessage failed:
${
JSON
.
stringify
(
res
)}
`
);
}
});
this
.
setData
({
isShowPrinting
:
false
});
if
(
res
.
code
==
-
1
)
{
//打印失败
this
.
setData
({
printerStatus
:
"打印失败"
});
}
else
{
//打印成功
this
.
setData
({
printerStatus
:
"打印成功"
});
}
},
onShow
()
{
...
...
utils/api.js
View file @
0e3880a1
...
...
@@ -50,10 +50,14 @@ function createCommonRequest() {
};
commonRequest
.
appId
=
app
.
globalData
.
appId
;
//token 设置到公共请求体
if
(
app
.
globalData
.
localAccountInfo
!=
null
)
{
if
(
app
.
globalData
.
localAccountInfo
!=
null
)
{
commonRequest
.
token
=
app
.
globalData
.
localAccountInfo
.
token
;
}
commonRequest
.
deviceNo
=
app
.
globalData
.
sn
;
if
(
app
.
globalData
.
sn
==
null
||
app
.
globalData
.
sn
==
""
)
{
commonRequest
.
deviceNo
=
"unknow"
;
}
else
{
commonRequest
.
deviceNo
=
app
.
globalData
.
sn
;
}
commonRequest
.
batchNo
=
""
;
commonRequest
.
timestamp
=
timestampToTime
();
commonRequest
.
format
=
"JSON"
;
...
...
@@ -70,7 +74,7 @@ function timestampToTime() {
var
date
=
new
Date
();
var
Y
=
date
.
getFullYear
()
+
'-'
;
var
M
=
(
date
.
getMonth
()
+
1
<
10
?
'0'
+
(
date
.
getMonth
()
+
1
)
:
date
.
getMonth
()
+
1
)
+
'-'
;
var
D
=
date
.
getDate
()
<
10
?
'0'
+
date
.
getDate
()
+
' '
:
date
.
getDate
()
+
' '
;
var
D
=
date
.
getDate
()
<
10
?
'0'
+
date
.
getDate
()
+
' '
:
date
.
getDate
()
+
' '
;
var
h
=
date
.
getHours
()
+
':'
;
var
m
=
date
.
getMinutes
()
+
':'
;
var
s
=
date
.
getSeconds
();
...
...
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