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
7f51e390
Commit
7f51e390
authored
Feb 27, 2020
by
pengguangpu
Browse files
Options
Browse Files
Download
Plain Diff
合并远程代码;
parents
7cc39e5a
3148b44c
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
219 additions
and
46 deletions
+219
-46
app.json
app.json
+2
-2
actioncmd.js
const/actioncmd.js
+2
-0
balance.js
pages/balance/balance.js
+3
-10
home.acss
pages/home/home.acss
+100
-10
home.axml
pages/home/home.axml
+25
-13
home.js
pages/home/home.js
+82
-4
scan.js
pages/scan/scan.js
+0
-2
scan.js
utils/scan.js
+5
-5
No files found.
app.json
View file @
7f51e390
{
"pages"
:
[
"pages/login/login"
,
"pages/home/home"
,
"pages/paysuccess/paysuccess"
,
"pages/balance/balance"
,
"pages/scan/scan"
,
"pages/home/home"
"pages/scan/scan"
],
"window"
:
{
"defaultTitle"
:
""
...
...
const/actioncmd.js
View file @
7f51e390
...
...
@@ -67,6 +67,8 @@ export const ACTION_SYSTEM_SETTING = "ACTION_SYSTEM_SETTING";
//结算页面back到扫商品页面
export
const
ACTION_BALANCE_BACK_GOODS
=
"ACTION_BALANCE_BACK_GOODS"
;
//提货
export
const
ACTION_PICK_UP_GOODS
=
"ACTION_PICK_UP_GOODS"
;
//打印日结订单
export
const
ACTION_DAY_CHECK
=
"ACTION_DAY_CHECK"
;
//核验
...
...
pages/balance/balance.js
View file @
7f51e390
...
...
@@ -98,13 +98,6 @@ Page({
},
onReady
()
{
if
(
my
.
canIUse
(
'hideBackHome'
))
{
my
.
hideBackHome
();
}
},
onShow
()
{
my
.
ix
.
onBuddyMessage
({
success
:
(
res
)
=>
{
...
...
@@ -138,7 +131,7 @@ Page({
//获取order
var
payAmount
=
payUtils
.
yuan2Fen
(
this
.
data
.
payPrice
);
payUtils
.
getOrder
(
/*payAmount*/
1
,
this
.
data
.
list
,
function
(
res
)
{
payUtils
.
getOrder
(
payAmount
,
this
.
data
.
list
,
function
(
res
)
{
if
(
res
!=
null
)
{
console
.
log
(
"callback调用,res="
+
JSON
.
stringify
(
res
));
...
...
@@ -227,7 +220,7 @@ Page({
this
.
setData
({
isPaying
:
true
});
//使用barCode来当面付
var
payAmount
=
payUtils
.
yuan2Fen
(
this
.
data
.
payPrice
);
payUtils
.
startPay
(
orderNo
,
payCode
,
/*payAmount*/
1
,
this
.
data
.
list
,
function
(
res
)
{
payUtils
.
startPay
(
orderNo
,
payCode
,
payAmount
,
this
.
data
.
list
,
function
(
res
)
{
my
.
hideLoading
();
console
.
log
(
"支付回调 ===>"
+
JSON
.
stringify
(
res
));
this
.
setData
({
isPaying
:
false
});
...
...
@@ -251,7 +244,7 @@ Page({
my
.
ix
.
offCashierEventReceive
();
this
.
saveData
(
this
.
data
.
list
,
res
.
data
);
my
.
redirectTo
({
url
:
'/pages/paysuccess/paysuccess
'
,
url
:
'/pages/paysuccess/paysuccess
?totalGoodsNum='
+
this
.
data
.
goodsNum
,
});
//发送支付成功到后屏
...
...
pages/home/home.acss
View file @
7f51e390
page
{
.page
{
display: flex;
flex-direction: column;
width: 100%;
...
...
@@ -6,23 +6,113 @@ page{
align-items: center;
}
.bg{
position:fixed;
width:100%;
height:100%;
left:0rpx;
top:0rpx;
bottom:0rpx;
.bg
{
position:
fixed;
width:
100%;
height:
100%;
left:
0rpx;
top:
0rpx;
bottom:
0rpx;
/* background:url(/images/bg_home.png) no-repeat fixed top; */
background-size:100% 100%;
background-size:
100% 100%;
/* border: 2px solid red; */
box-sizing: border-box;
}
.container{
.container
{
position: relative;
width: 750rpx;
height: 430rpx;
margin: 0 auto;
margin-top: 38rpx;
}
/* 商品价格 */
.good-list-item-price-font {
color: #F96146;
font-size: 44rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
margin-left: 24rpx;
}
/* 商品数量 */
.good-list-item-quantity-font {
color: #8C8C8C;
font-size: 32rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
margin-right: 24rpx
}
/* 商品名称 */
.good-list-item-name-font {
color: #333333;
font-size: 32rpx;
font-family: PingFangSC-Semibold, PingFang SC;
font-weight: 600;
margin-left: 24rpx;
margin-top: 25rpx;
}
/* 商品列表项价格和数量 */
.scan-good-list-item {
display: flex;
flex-direction: row;
width: 100%;
height: 80rpx;
justify-content: space-between;
align-items: center;
}
/* 商品列表项背景 */
.scan-list-bg {
height: 158rpx;
border-radius: 16px;
background-color: white;
margin-bottom: 24rpx;
box-shadow: 0px 2px 10px 0px rgba(77, 81, 102, 0.1);
display: flex;
flex-direction: column;
}
/* 提货商品布局 */
.page-pick-goods {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
height: 100%;
position: absolute;
background: url(/images/scan_header_bg.png) no-repeat fixed top;
background-size: 100% 200rpx;
}
/* 提货商品布局top部分 */
.pick-goods-header {
width: 100%;
height: 200rpx;
display: flex;
flex-direction: column;
font-size: 42px;
align-items: center;
justify-content: center;
font-size: 40rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(255, 255, 255, 1);
}
/* 提货商品body部分 */
.pick-goods-body {
width: 700rpx;
height: 100%;
background: transparent;
margin-top: 45rpx
}
\ No newline at end of file
pages/home/home.axml
View file @
7f51e390
<view class="page"
>
<view class="bg" onTap="homeTap">
<view class="page">
<view class="bg" onTap="homeTap"
a:if="{{pickGoodsState != 3}}"
>
<image mode="scaleToFill" style="width:100%;height:100%;" src="{{adUrl}}"/>
</view>
<!-- 弹窗 -->
<scandialog displayDialog="{{scanDialogDisplay}}"
remindText="{{dialogRemindText}}"
loadingText="{{dialogLoadingText}}"
resultSuccessRemind="{{dialogResultSuccessRemind}}"
resultSuccessText="{{dialogResultSuccessText}}"
resultFailureRemind="{{dialogResultFailureRemind}}"
resultFailureText="{{dialogResultFailureText}}"
/>
<!-- 提货布局 -->
<view class="page-pick-goods" a:if="{{pickGoodsState == 3}}">
<view class="pick-goods-header">
提货商品如下
</view>
<scroll-view class="pick-goods-body" scroll-y a:if="{{pickGoods.length > 0}}">
<block a:for="{{pickGoods}}">
<view class="scan-list-bg">
<view class="good-list-item-name-font">
{{item.name}}
</view>
<view class="scan-good-list-item">
<view class="good-list-item-price-font">¥{{item.price}}</view>
<view class="good-list-item-quantity-font">
{{item.quantity}}件
</view>
</view>
</view>
</block>
</scroll-view>
</view>
<!-- 弹窗 -->
<scandialog displayDialog="{{scanDialogDisplay}}" remindText="{{dialogRemindText}}" loadingText="{{dialogLoadingText}}" resultSuccessRemind="{{dialogResultSuccessRemind}}" resultSuccessText="{{dialogResultSuccessText}}" resultFailureRemind="{{dialogResultFailureRemind}}" resultFailureText="{{dialogResultFailureText}}" />
</view>
\ No newline at end of file
pages/home/home.js
View file @
7f51e390
...
...
@@ -10,7 +10,7 @@ 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_VERIFY_FAILED
,
ACTION_DAY_CHECK
,
ACTION_PICK_UP_GOODS
}
from
'../../const/actioncmd'
...
...
@@ -18,7 +18,7 @@ Page({
data
:
{
//显示弹窗,>1为显示,2loading 3 result success 4 result failed
scanDialogDisplay
:
0
,
dialogShowType
:
""
,
//弹窗类型:如refund coupon verify
dialogShowType
:
""
,
//弹窗类型:如refund coupon verify
pickgoods
dialogRemindText
:
"请扫描兑换码"
,
dialogLoadingText
:
"识别中"
,
dialogResultSuccessRemind
:
"兑换码已识别"
,
...
...
@@ -27,10 +27,24 @@ Page({
dialogResultFailureText
:
"兑换失败,请稍后重试!"
,
adUrl
:
"/images/img_ad1.png"
,
toSetting
:
false
,
//提货
pickGoodsState
:
0
,
pickGoodsMsg
:
"录入失败!无效的提货码"
,
pickGoods
:
[],
},
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
})
},
onShow
()
{
...
...
@@ -174,6 +188,35 @@ Page({
context
.
setData
({
toSetting
:
true
,
})
}
else
if
(
res
.
action
==
ACTION_PICK_UP_GOODS
){
//提货
context
.
setData
({
scanDialogDisplay
:
res
.
data
,
dialogShowType
:
"pickgoods"
,
//弹窗类型:如refund coupon pickgoods
dialogRemindText
:
"请扫描提货码"
,
dialogLoadingText
:
"识别中"
,
dialogResultSuccessRemind
:
"提货码已识别"
,
dialogResultSuccessText
:
"恭喜您!提货成功"
,
dialogResultFailureRemind
:
"提货失败"
,
dialogResultFailureText
:
"提货失败!无效的提货码!"
,
});
if
(
res
.
data
!=
0
)
{
var
speechContent
=
"请扫描提货码"
;
my
.
ix
.
speech
({
text
:
speechContent
,
speak
:
true
,
success
:
(
r
)
=>
{
}
});
}
//隐藏提货页面
if
(
res
.
data
==
0
){
context
.
setData
({
pickGoodsState
:
0
,
pickGoods
:[]
})
}
}
else
if
(
res
.
action
==
ACTION_DAY_CHECK
)
{
//本地先写死数据
context
.
printDayCheck
();
...
...
@@ -376,6 +419,9 @@ Page({
}
else
if
(
this
.
data
.
dialogShowType
==
"coupon"
)
{
// 兑换券
this
.
verifyCoupon
(
r
);
}
else
if
(
this
.
data
.
dialogShowType
==
"pickgoods"
)
{
// 提货
this
.
pickGoods
(
r
);
}
else
if
(
this
.
data
.
dialogShowType
==
"verify"
)
{
this
.
verify
(
r
);
}
...
...
@@ -574,7 +620,39 @@ 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
pickGoodsReq
=
{}
pickGoodsReq
.
pickGoodsState
=
3
;
pickGoodsReq
.
pickGoods
=
pickgoodsTemp
;
my
.
ix
.
sendBuddyMessage
({
target
:
getApp
().
globalData
.
backScreenAppId
,
data
:
{
action
:
ACTION_PICK_UP_GOODS
,
data
:
pickGoodsReq
},
success
:
(
sres
)
=>
{
context
.
setData
({
pickGoods
:
pickgoodsTemp
,
pickGoodsState
:
3
,
scanDialogDisplay
:
0
})
},
fail
:
(
fres
)
=>
{
console
.
info
(
`sendBuddyMessage failed:
${
JSON
.
stringify
(
res
)}
`
);
}
});
},
700
);
},
});
pages/scan/scan.js
View file @
7f51e390
...
...
@@ -146,8 +146,6 @@ Page({
context
.
sendGoodInfoToBack
();
}
})
},
700
);
},
...
...
utils/scan.js
View file @
7f51e390
...
...
@@ -9,11 +9,11 @@ export default class scan {
if
(
!
page
.
_keyEventListener
)
{
//摄像头
my
.
ix
.
onCodeScan
((
r
)
=>
{
if
(
r
.
success
){
let
cur
=
getCurrentPages
().
slice
(
-
1
)[
0
];
cur
.
onKeyPress
.
call
(
cur
,
code
);
if
(
r
.
success
)
{
let
cur
=
getCurrentPages
().
slice
(
-
1
)[
0
];
cur
.
onKeyPress
.
call
(
cur
,
code
);
}
console
.
log
(
'code: '
+
r
.
code
);
console
.
log
(
'code: '
+
r
.
code
);
});
//物理扫码枪
...
...
@@ -27,7 +27,7 @@ export default class scan {
//兼容扫描枪
cur
.
onKeyPress
.
call
(
cur
,
code
);
isScaning
=
false
},
7
00
);
},
10
00
);
}
else
{
//特殊处理 keycode需要减7
if
(
r
.
keyCode
>=
7
&&
r
.
keyCode
<=
16
)
{
...
...
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