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
d801a642
Commit
d801a642
authored
Feb 19, 2020
by
gaodapeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整了UI,增加了获取店铺号的逻辑,增加了结算页面返回的逻辑
parent
3022cb49
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
86 additions
and
50 deletions
+86
-50
actioncmd.js
const/actioncmd.js
+3
-0
home.axml
pages/home/home.axml
+2
-3
home.json
pages/home/home.json
+2
-4
index.acss
pages/index/index.acss
+14
-18
index.axml
pages/index/index.axml
+12
-9
index.js
pages/index/index.js
+53
-16
No files found.
const/actioncmd.js
View file @
d801a642
...
...
@@ -27,3 +27,6 @@ export const ACTION_ON_PAY_FAILED = "ACTION_ON_PAY_FAILED";
//跳转首页
export
const
ACTION_GO_HOME
=
"ACTION_GO_HOME"
;
//获取账户信息
export
const
ACTION_GET_ACCOUNT
=
"ACTION_GET_ACCOUNT"
;
pages/home/home.axml
View file @
d801a642
<view class="page">
<view class="topView">
<!--back button-->
<
!-- <
view class="store">
<view class="store">
<image mode="aspectFit" style="position:absolute;width:24rpx;height:21rpx;left: 19rpx;top:19rpx;" src="/images/icon_store.png"/>
<text style="position:absolute;font-size:19rpx;font-family:PingFangSC-Regular,PingFang SC;font-weight:400;color:rgba(0,0,0,0.85);line-height:22rpx;left:55rpx;top:19rpx;">{{storeName}}</text>
</view>
-->
</view>
<view style="position:absolute;font-size:22rpx;font-family:PingFangSC-Medium,PingFang SC;font-weight:500;color:rgba(51,51,51,1);line-height:22rpx;top:19rpx;width:100%;text-align:center;">首页</view>
<view style="display:flex;flex-direction:row-reverse;position:absolute;right:19rpx;top:19rpx;">
<view style="font-size:19rpx;font-family:PingFangSC-Regular,PingFang SC;font-weight:400;color:rgba(51,51,51,1);line-height:22rpx;">退出</view>
...
...
@@ -21,5 +21,4 @@
</view>
</view>
\ No newline at end of file
pages/home/home.json
View file @
d801a642
{
"transparentTitle"
:
"always"
,
"usingComponents"
:{
"grid"
:
"mini-antui/es/grid/index"
}
"transparentTitle"
:
"always"
}
\ No newline at end of file
pages/index/index.acss
View file @
d801a642
/* 公共样式 */
.topView {
position: relative;
width: 768rpx;
height: 60rpx;
background: #ffffff;
box-shadow: 0rpx 2rpx 7rpx 0rpx rgba(153, 153, 153, 0.16);
/* border: 2px solid red; */
}
/* home样式 */
...
...
@@ -22,7 +12,7 @@
.homeTopView {
position: relative;
width: 7
46
rpx;
width: 7
50
rpx;
height: 60rpx;
background: #ffffff;
/* border: 2px solid red; */
...
...
@@ -41,10 +31,6 @@
width: 100%;
height: 100%;
background: #ffffff;
/* padding-top: 15rpx;
padding-left: 36rpx;
padding-right: 36rpx;
padding-bottom: 28rpx; */
/* border: 2px solid red; */
}
...
...
@@ -55,8 +41,8 @@
align-items: center;
margin-top: 15rpx;
margin-bottom: 15rpx;
margin-left: 3
9
rpx;
margin-right: 3
9
rpx;
margin-left: 3
8
rpx;
margin-right: 3
8
rpx;
}
.homeItemImage {
...
...
@@ -79,6 +65,16 @@
*/
.topView {
position: relative;
width: 768rpx;
height: 60rpx;
background: #ffffff;
box-shadow: 0rpx 2rpx 7rpx 0rpx rgba(153, 153, 153, 0.16);
/* border: 2px solid red; */
}
.backButton {
color: #333333;
font-size: 19rpx;
...
...
@@ -511,7 +507,7 @@
/* 结算页 */
.
t
opView {
.
balanceT
opView {
position: relative;
width: 768rpx;
height: 60rpx;
...
...
pages/index/index.axml
View file @
d801a642
...
...
@@ -7,18 +7,21 @@
</view>
<view style="position:absolute;font-size:22rpx;font-family:PingFangSC-Medium,PingFang SC;font-weight:500;color:rgba(51,51,51,1);line-height:22rpx;left:0rpx;top:19rpx;width:100%;text-align:center;">首页</view>
<view style="display:flex;flex-direction:row-reverse;position:absolute;right:19rpx;top:19rpx;width:auto;background:#ffffff;">
<view style="font-size:19rpx;font-family:PingFangSC-Regular,PingFang SC;font-weight:400;color:rgba(51,51,51,1);line-height:22rpx;
margin-right:19rpx;
">退出</view>
<view style="font-size:19rpx;font-family:PingFangSC-Regular,PingFang SC;font-weight:400;color:rgba(51,51,51,1);line-height:22rpx;">退出</view>
<image mode="aspectFit" src="/images/icon_exit.png" style="position:relative;width:19rpx;height:19rpx;margin-right:8rpx;margin-top:1rpx;"/>
</view>
</view>
<view class="homeBodyView">
<!-- 还需要加一层swiper -->
<view class="homeGridItem" catchTap="sendGoToCollections">
<image mode="aspectFit" src="/images/collections.png" class="homeItemImage"/>
<view class="homeItemText">收银</view>
</view>
<view style="display:flex;flex-direction:row;position:relative;margin-top: 14rpx;margin-left: 32rpx;margin-right: 32rpx;">
<view class="homeGridItem" catchTap="sendGoToCollections">
<image mode="aspectFit" src="/images/collections.png" class="homeItemImage"/>
<view class="homeItemText">收银</view>
</view>
</view>
</view>
</view>
...
...
@@ -99,9 +102,9 @@
<!-- 结算页 -->
<view class="balance" hidden="{{!pageShow['waitoperate']}}">
<view class="
t
opView">
<view class="
balanceT
opView">
<!--back button-->
<view class="backButton">
<view c
atchTap="waitOperateBack" c
lass="backButton">
<image mode="aspectFit" style="position:absolute;width:11rpx;height:17rpx;left: 18rpx;top:22rpx;" src="/images/icon_back.png"/>
<text>返回</text>
</view>
...
...
@@ -129,8 +132,8 @@
<view class="rightBody">
<view class="remindText">等待顾客付款…</view>
<image mode="aspectFit" style="width:166rpx;height:143rpx;margin-top:39rpx;" src="/images/icon_wait_operate.png"/>
<view style="width:252rpx;height:60rpx;background:rgba(255,255,255,1);border-radius:5rpx;border:2rpx solid rgba(0,122,255,1);position:relative;box-sizing: border-box;margin-top:32rpx;">
<view
on
Tap="cancelCollect" style="width:100%;height:60rpx;margin:0 auto;text-align:center;font-size:24rpx;font-family:PingFangSC-Medium,PingFang SC;font-weight:500;color:rgba(0,122,255,1);line-height:60rpx;">取消收款</view>
<view
catchTap="waitOperateBack"
style="width:252rpx;height:60rpx;background:rgba(255,255,255,1);border-radius:5rpx;border:2rpx solid rgba(0,122,255,1);position:relative;box-sizing: border-box;margin-top:32rpx;">
<view
catch
Tap="cancelCollect" style="width:100%;height:60rpx;margin:0 auto;text-align:center;font-size:24rpx;font-family:PingFangSC-Medium,PingFang SC;font-weight:500;color:rgba(0,122,255,1);line-height:60rpx;">取消收款</view>
</view>
</view>
</view>
...
...
pages/index/index.js
View file @
d801a642
...
...
@@ -9,7 +9,7 @@ import { ACTION_GO_SCAN } from '../../const/actioncmd'
import
{
ACTION_ON_PAY_SUCCESS
}
from
'../../const/actioncmd'
import
{
ACTION_ON_PAY_FAILED
}
from
'../../const/actioncmd'
import
{
ACTION_GO_HOME
}
from
'../../const/actioncmd'
import
{
ACTION_GET_ACCOUNT
}
from
'../../const/actioncmd'
Page
({
data
:
{
...
...
@@ -80,9 +80,7 @@ Page({
my
.
ix
.
onBuddyMessage
({
success
:
(
res
)
=>
{
console
.
info
(
`onBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
my
.
showToast
({
content
:
JSON
.
stringify
(
res
)
});
if
(
res
.
action
==
ACTION_PRINT_RESULT
&&
context
.
data
.
pageShow
[
'payresult'
]
==
true
)
{
//获取到打印结果
var
printResultData
=
res
.
data
;
...
...
@@ -147,11 +145,14 @@ Page({
});
context
.
goPage
(
'payresult'
);
}
else
{
//未知指令
}
else
if
(
res
.
action
==
ACTION_GET_ACCOUNT
){
context
.
setData
({
storeName
:
res
.
data
.
storeName
});
}
}
});
},
onHide
()
{
// 页面隐藏
...
...
@@ -171,6 +172,7 @@ Page({
// 页面被拉到底部
},
onShareAppMessage
()
{
// 返回自定义分享信息
return
{
...
...
@@ -180,6 +182,24 @@ Page({
};
},
getAccountInfo
(){
my
.
ix
.
sendBuddyMessage
({
target
:
getApp
().
globalData
.
frontScreenAppId
,
data
:
{
action
:
ACTION_GET_ACCOUNT
,
data
:
null
},
success
:
(
res
)
=>
{
console
.
log
(
"发送收银事件到前屏小程序 成功 ===》"
+
JSON
.
stringify
(
res
));
},
fail
:
(
res
)
=>
{
console
.
log
(
"发送收银事件到前屏小程序 失败 ===》 "
+
JSON
.
stringify
(
res
));
},
});
},
/**payresult页面逻辑方法 */
onReprint
()
{
//通知前屏重新打印
...
...
@@ -224,25 +244,16 @@ Page({
action
:
ACTION_GO_SCAN
,
data
:
null
};
my
.
showToast
({
content
:
"首页发送数据"
});
my
.
ix
.
sendBuddyMessage
({
target
:
getApp
().
globalData
.
frontScreenAppId
,
data
:
commonRequest
,
success
:
(
res
)
=>
{
my
.
showToast
({
content
:
"首页发送数据成功"
});
console
.
log
(
"发送收银事件到前屏小程序 成功 ===》"
+
JSON
.
stringify
(
res
));
},
fail
:
(
res
)
=>
{
console
.
log
(
"发送收银事件到前屏小程序 失败 ===》 "
+
JSON
.
stringify
(
res
));
//发送失败重试
// context.sendGoToCollections();
my
.
showToast
({
content
:
"首页发送数据失败"
});
console
.
log
(
"发送收银事件到前屏小程序 ===》"
+
JSON
.
stringify
(
res
));
},
});
...
...
@@ -409,7 +420,33 @@ Page({
},
});
}
});
})
},
waitOperateBack
(){
//直接返回到扫码页面,并且通知前屏返回
this
.
goPage
(
'landscan'
);
my
.
ix
.
sendBuddyMessage
({
target
:
getApp
().
globalData
.
frontScreenAppId
,
data
:
{
action
:
ACTION_GO_SCAN
,
data
:
null
},
success
:
(
res
)
=>
{
console
.
log
(
"通知前屏跳转到结算页面 成功 ===》"
+
JSON
.
stringify
(
res
));
},
fail
:
(
res
)
=>
{
console
.
log
(
"通知前屏跳转到结算页面 失败 ===》 "
+
JSON
.
stringify
(
res
));
my
.
showToast
({
type
:
'fail'
,
content
:
'结算失败'
,
duration
:
3000
,
success
:
()
=>
{
},
});
}
})
},
//用券返回
...
...
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