Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
doublescreen-back
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-back
Commits
e195f375
Commit
e195f375
authored
Feb 24, 2020
by
pengguangpu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整合打印上一单页面至index;
parent
242d45e7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
353 additions
and
224 deletions
+353
-224
index.acss
pages/index/index.acss
+68
-0
index.axml
pages/index/index.axml
+185
-146
index.js
pages/index/index.js
+100
-78
No files found.
pages/index/index.acss
View file @
e195f375
...
...
@@ -852,3 +852,71 @@
width: 100%;
height: auto;
}
/**打印上一单*/
.printLastOrderPage {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
position: absolute;
}
.topView {
position: absolute;
top: 0rpx;
width: 100%;
height: 60rpx;
background: #ffffff;
box-shadow: 0rpx 2rpx 7rpx 0rpx rgba(153, 153, 153, 0.16);
/* border: 2px solid red; */
}
.printLastOrderTitleText {
position: absolute;
line-height: 60rpx;
height: 100%;
font-size: 22rpx;
font-weight: bold;
text-align: center;
align-items: center;
width: 100%;
color: #333333;
align-content: center;
/* border: 2px solid red; */
}
.printLastOrderBackButton {
position: absolute;
height: 60rpx;
text-align: center;
align-items: center;
align-content: center;
font-size: 19rpx;
line-height: 60rpx;
/* border: 2px solid red; */
padding-left: 19rpx;
padding-right: 19rpx;
}
.printLastOrderBottomView {
height: 100%;
background: white;
width: 100%;
position: absolute;
/* display: flex;
flex-direction: column; */
/* border: 2px solid red; */
}
.printLastOrderPrintStatusHint {
color: #333333;
font-size: 26rpx;
margin: 0 auto;
width: 100%;
text-align: center;
font-weight: bold;
position: absolute;
top: 89rpx;
}
\ No newline at end of file
pages/index/index.axml
View file @
e195f375
This diff is collapsed.
Click to expand it.
pages/index/index.js
View file @
e195f375
...
...
@@ -17,7 +17,7 @@ import { ACTION_REFUND } from '../../const/actioncmd'
import
{
ACTION_REFUND_SUCCESS
}
from
'../../const/actioncmd'
import
{
ACTION_REFUND_FAILED
}
from
'../../const/actioncmd'
import
{
FLOW_IDLE
,
FLOW_COLLECTIONS
,
FLOW_REFUND
}
from
'../../const/actioncmd'
import
{
FLOW_IDLE
,
FLOW_COLLECTIONS
,
FLOW_REFUND
}
from
'../../const/actioncmd'
Page
({
data
:
{
//页面控制相关参数
...
...
@@ -26,11 +26,12 @@ Page({
"landscan"
:
false
,
"waitoperate"
:
false
,
"payresult"
:
false
,
"operateResult"
:
false
"operateResult"
:
false
,
"printlastorder"
:
false
,
},
// 前屏是否完成登录
isFrontScreenLoginOK
:
fals
e
,
flowType
:
""
,
//流程类型:用于区分易混淆的流程,以及共同界面使用时用该标识位作为区分
isFrontScreenLoginOK
:
tru
e
,
flowType
:
""
,
//流程类型:用于区分易混淆的流程,以及共同界面使用时用该标识位作为区分
storeName
:
"--"
,
/**支付结果页相关参数 */
payFailedReason
:
"xxxxxxxxxxx"
,
...
...
@@ -41,7 +42,7 @@ Page({
isPrintSuccess
:
false
,
payPriceFen
:
0
,
/**商品扫码页相关参数 */
//是否正在用券
couponUseing
:
false
,
...
...
@@ -61,11 +62,17 @@ Page({
totalDisc
:
0.00
,
goods
:
[
],
operateSuccess
:
false
,
operateSuccessRemind
:
"退款成功"
,
operateSuccessDesc
:
"退款完成!会在1~2个工作日返还到付款账户"
,
operateFailedRemind
:
"退款失败"
,
operateFailedDesc
:
"核销失败!无效的订单码"
,
operateSuccess
:
false
,
operateSuccessRemind
:
"退款成功"
,
operateSuccessDesc
:
"退款完成!会在1~2个工作日返还到付款账户"
,
operateFailedRemind
:
"退款失败"
,
operateFailedDesc
:
"核销失败!无效的订单码"
,
//打印上一单页面
printLastOrderPrintStatusHint
:
"正在打印上一单..."
,
//是否打印成功
printLastOrderIsPrintSuccess
:
false
,
printLastOrderIsPrinting
:
true
},
/**跳转页面方法 */
...
...
@@ -75,7 +82,8 @@ Page({
"landscan"
:
false
,
"waitoperate"
:
false
,
"payresult"
:
false
,
"operateResult"
:
false
,
"operateResult"
:
false
,
"printlastorder"
:
false
};
//遍历pageShow
for
(
var
key
in
pageShowTemp
)
{
...
...
@@ -94,7 +102,7 @@ Page({
onLoad
(
query
)
{
// 页面加载
console
.
info
(
`Page onLoad with query:
${
JSON
.
stringify
(
query
)}
`
);
},
onReady
()
{
// 页面加载完成
...
...
@@ -155,7 +163,7 @@ Page({
context
.
goPage
(
'landscan'
);
}
else
if
(
res
.
action
==
ACTION_GO_BALANCE
)
{
//跳转
context
.
goPage
(
'waitoperate'
);
context
.
goPage
(
'waitoperate'
);
}
else
if
(
res
.
action
==
ACTION_ON_PAY_SUCCESS
)
{
//分转元
...
...
@@ -178,32 +186,32 @@ Page({
context
.
setData
({
storeName
:
res
.
data
.
storeName
});
}
else
if
(
res
.
action
==
ACTION_DIRECT_PAYMENT
)
{
//直接收款
if
(
res
.
data
!=
null
)
{
context
.
setData
({
totalPrice
:
res
.
data
})
}
context
.
goPage
(
'waitoperate'
);
}
else
if
(
res
.
action
==
ACTION_CONVERT_COUPON
)
{
//兑换券
context
.
setData
({
convertCouponState
:
res
.
data
.
state
})
if
(
null
!=
res
.
data
.
msg
)
{
context
.
setData
({
convertCouponMsg
:
res
.
data
.
msg
})
}
}
else
if
(
res
.
action
==
ACTION_LOGIN_OK
)
{
}
else
if
(
res
.
action
==
ACTION_DIRECT_PAYMENT
)
{
//直接收款
if
(
res
.
data
!=
null
)
{
context
.
setData
({
totalPrice
:
res
.
data
})
}
context
.
goPage
(
'waitoperate'
);
}
else
if
(
res
.
action
==
ACTION_CONVERT_COUPON
)
{
//兑换券
context
.
setData
({
convertCouponState
:
res
.
data
.
state
})
if
(
null
!=
res
.
data
.
msg
)
{
context
.
setData
({
convertCouponMsg
:
res
.
data
.
msg
})
}
}
else
if
(
res
.
action
==
ACTION_LOGIN_OK
)
{
//前屏登录完成
context
.
setData
({
isFrontScreenLoginOK
:
true
})
}
else
if
(
res
.
action
==
ACTION_REFUND_SUCCESS
)
{
context
.
setData
({
isFrontScreenLoginOK
:
true
})
}
else
if
(
res
.
action
==
ACTION_REFUND_SUCCESS
)
{
//跳转到成功页面
context
.
goPage
(
'operateResult'
);
}
else
if
(
res
.
action
==
ACTION_REFUND_FAILED
)
{
}
else
if
(
res
.
action
==
ACTION_REFUND_FAILED
)
{
context
.
setData
({
isPaySuccess
:
false
,
});
context
.
goPage
(
'operateResult'
);
}
}
});
...
...
@@ -255,15 +263,15 @@ Page({
/**首页相关 */
/**立即收款 */
onHomeCashierImmediatelyClicked
()
{
this
.
setData
({
scene
:
3
})
this
.
setData
({
scene
:
3
})
},
/**
* 兑换
*/
onHomeExchangeClicked
()
{
this
.
setData
({
convertCouponState
:
1
})
this
.
sendConvertCouponToFront
(
1
)
this
.
setData
({
convertCouponState
:
1
})
this
.
sendConvertCouponToFront
(
1
)
},
/**
...
...
@@ -278,17 +286,18 @@ Page({
*/
onHomeRefundClicked
()
{
this
.
setData
({
flowType
:
FLOW_REFUND
,
scene
:
4
flowType
:
FLOW_REFUND
,
scene
:
4
})
console
.
log
(
"scene:"
+
this
.
data
.
scene
)
console
.
log
(
"scene:"
+
this
.
data
.
scene
)
},
/**
* 打印上一单
*/
onHomePrintLastOrderClicked
()
{
//跳转至打印上一单页面
this
.
goPage
(
'printlastorder'
);
},
/**
...
...
@@ -390,7 +399,7 @@ Page({
});
},
//发生直接收银事件
sendPaymentToFront
(
payment
)
{
var
commonRequest
=
{
...
...
@@ -415,7 +424,7 @@ Page({
});
},
});
},
},
/**landscan页面逻辑方法 */
//把所有的商品数据发送到后屏
...
...
@@ -442,17 +451,17 @@ Page({
//键盘完成
onKeyBordFinished
(
result
)
{
if
(
this
.
data
.
scene
==
3
)
{
this
.
sendPaymentToFront
(
result
)
}
else
if
(
this
.
data
.
scene
==
1
)
{
this
.
sendGoodsInfoToFront
(
result
)
}
else
if
(
this
.
data
.
scene
==
4
)
{
if
(
this
.
data
.
scene
==
3
)
{
this
.
sendPaymentToFront
(
result
)
}
else
if
(
this
.
data
.
scene
==
1
)
{
this
.
sendGoodsInfoToFront
(
result
)
}
else
if
(
this
.
data
.
scene
==
4
)
{
this
.
sendRefund
(
result
);
return
;
}
this
.
onKeyBordClose
();
},
//把手输条码发生到前屏
sendGoodsInfoToFront
(
barcode
)
{
my
.
showLoading
({});
...
...
@@ -620,31 +629,31 @@ Page({
//兑换券界面关闭
convertCouponClose
(
e
)
{
this
.
setData
({
convertCouponState
:
0
})
//兑换券界面关闭
convertCouponClose
(
e
)
{
this
.
setData
({
convertCouponState
:
0
})
this
.
sendConvertCouponToFront
(
0
)
},
},
//发生兑换券到前屏
sendConvertCouponToFront
(
res
)
{
//发生兑换券到前屏
sendConvertCouponToFront
(
res
)
{
let
context
=
this
;
my
.
ix
.
sendBuddyMessage
({
target
:
getApp
().
globalData
.
frontScreenAppId
,
data
:
{
action
:
ACTION_CONVERT_COUPON
,
data
:
res
action
:
ACTION_CONVERT_COUPON
,
data
:
res
},
success
:
(
sres
)
=>
{
console
.
log
(
"兑换券通知前屏 成功 ===》"
+
JSON
.
stringify
(
sres
));
},
fail
:
(
fres
)
=>
{
console
.
log
(
"兑换券通知前屏 失败 ===》 "
+
JSON
.
stringify
(
fres
));
context
.
sendConvertCouponToFront
(
res
)
context
.
sendConvertCouponToFront
(
res
)
}
})
},
},
//用券返回
couponBack
(
e
)
{
...
...
@@ -654,31 +663,44 @@ Page({
useCoupon
(
e
)
{
this
.
setData
({
couponUseing
:
true
})
},
//发送退款金额.以分为单位
sendRefund
(
amount
){
sendRefund
(
amount
)
{
var
miyapay
=
require
(
"/utils/miyapay4.js"
);
var
refundAmount
=
miyapay
.
yuan2Fen
(
amount
);
console
.
log
(
"amount"
+
refundAmount
);
console
.
log
(
"amount"
+
refundAmount
);
my
.
ix
.
sendBuddyMessage
({
target
:
getApp
().
globalData
.
frontScreenAppId
,
data
:{
action
:
ACTION_REFUND
,
data
:
refundAmount
},
success
:(
res
)
=>
{
//成功发送则
console
.
log
(
"发送退款金额到前屏小程序成功 ===》"
+
JSON
.
stringify
(
res
));
},
fail
:(
res
)
=>
{
my
.
showToast
({
type
:
'fail'
,
content
:
'发送退款金额到前屏失败'
,
duration
:
3000
,
success
:
()
=>
{
},
});
}
})
}
target
:
getApp
().
globalData
.
frontScreenAppId
,
data
:
{
action
:
ACTION_REFUND
,
data
:
refundAmount
},
success
:
(
res
)
=>
{
//成功发送则
console
.
log
(
"发送退款金额到前屏小程序成功 ===》"
+
JSON
.
stringify
(
res
));
},
fail
:
(
res
)
=>
{
my
.
showToast
({
type
:
'fail'
,
content
:
'发送退款金额到前屏失败'
,
duration
:
3000
,
success
:
()
=>
{
},
});
}
})
},
/**
* 打印上一单页面
*/
onPrintLastOrderCancelClicked
()
{
},
onPrintLastOrderConfirmClicked
()
{
},
onPrintLastOrderRePrintClicked
()
{
},
onPrintLastOrderBackClicked
(){}
});
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