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
edf4cae0
Commit
edf4cae0
authored
Feb 06, 2020
by
pengguangpu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决home.js冲突;添加支付结果页的参数获取逻辑、打印回调逻辑;
parent
0b3d1e22
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
12 deletions
+40
-12
home.js
pages/home/home.js
+1
-5
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 @
edf4cae0
...
...
@@ -30,7 +30,6 @@ Page({
});
},
<<<<<<<
HEAD
//外接扫码枪事件
onKeyPress
(
r
)
{
...
...
@@ -40,15 +39,12 @@ Page({
url
:
"/pages/scan/scan?barcode="
+
r
,
});
},
=======
//显示弹窗,>1为显示,2loading 3 result success 4 result failed
showDialog
(){
this
.
setData
(
this
.
data
.
scanDialogDisplay
=
this
.
data
.
scanDialogDisplay
+
1
)
}
>>>>>>>
b85311896b3b12a7e29afcc50be66f821096a0f3
});
pages/paysuccess/paysuccess.axml
View file @
edf4cae0
<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 @
edf4cae0
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 @
edf4cae0
...
...
@@ -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
;
}
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