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
867a9f39
Commit
867a9f39
authored
Feb 27, 2020
by
jiangjiantao
Browse files
Options
Browse Files
Download
Plain Diff
mergefixed
parents
2ce7fb06
b5f4c19a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
278 additions
and
60 deletions
+278
-60
app.js
app.js
+2
-1
actioncmd.js
const/actioncmd.js
+3
-3
index.acss
pages/index/index.acss
+100
-1
index.axml
pages/index/index.axml
+58
-4
index.js
pages/index/index.js
+115
-51
No files found.
app.js
View file @
867a9f39
App
({
App
({
globalData
:
{
globalData
:
{
version
:
"1.0.0.20200226"
,
TEST_URL
:
"https://cashier.test.miyahub.net/"
,
TEST_URL
:
"https://cashier.test.miyahub.net/"
,
RELEASE_URL
:
"https://cashier.miyahub.com/"
,
RELEASE_URL
:
"https://cashier.miyahub.com/"
,
appId
:
"2021001107617164"
,
appId
:
"2021001107617164"
,
frontScreenAppId
:
"2021001107603212"
,
frontScreenAppId
:
"2021001107603212"
,
},
},
onLaunch
(
options
)
{
onLaunch
(
options
)
{
...
...
const/actioncmd.js
View file @
867a9f39
...
@@ -31,9 +31,6 @@ export const ACTION_ON_PAY_FAILED = "ACTION_ON_PAY_FAILED";
...
@@ -31,9 +31,6 @@ export const ACTION_ON_PAY_FAILED = "ACTION_ON_PAY_FAILED";
//跳转首页
//跳转首页
export
const
ACTION_GO_HOME
=
"ACTION_GO_HOME"
;
export
const
ACTION_GO_HOME
=
"ACTION_GO_HOME"
;
//获取账户信息
export
const
ACTION_GET_ACCOUNT
=
"ACTION_GET_ACCOUNT"
;
//直接收款
//直接收款
export
const
ACTION_DIRECT_PAYMENT
=
"ACTION_DIRECT_PAYMENT"
;
export
const
ACTION_DIRECT_PAYMENT
=
"ACTION_DIRECT_PAYMENT"
;
...
@@ -64,6 +61,9 @@ export const ACTION_SEND_SEL_AD = "ACTION_SEND_SEL_AD";
...
@@ -64,6 +61,9 @@ export const ACTION_SEND_SEL_AD = "ACTION_SEND_SEL_AD";
//使用优惠券
//使用优惠券
export
const
ACTION_USE_COUPON
=
"ACTION_USE_COUPON"
;
export
const
ACTION_USE_COUPON
=
"ACTION_USE_COUPON"
;
//系统设置
export
const
ACTION_SYSTEM_SETTING
=
"ACTION_SYSTEM_SETTING"
;
const
FLOW_IDLE
=
"idle"
;
const
FLOW_IDLE
=
"idle"
;
const
FLOW_COLLECTIONS
=
"collections"
;
//收款
const
FLOW_COLLECTIONS
=
"collections"
;
//收款
const
FLOW_REFUND
=
"refund"
;
//退款
const
FLOW_REFUND
=
"refund"
;
//退款
...
...
pages/index/index.acss
View file @
867a9f39
...
@@ -1062,6 +1062,7 @@
...
@@ -1062,6 +1062,7 @@
/**
/**
海报页面样式
海报页面样式
*/
*/
.posterPage {
.posterPage {
display: flex;
display: flex;
flex-direction: column;
flex-direction: column;
...
@@ -1158,7 +1159,105 @@
...
@@ -1158,7 +1159,105 @@
align-content: center;
align-content: center;
}
}
.posterSelected image{
.posterSelected image
{
border-radius: 5rpx;
border-radius: 5rpx;
border: 0rpx solid white;
border: 0rpx solid white;
}
}
/* 关于系统 */
.about-system-top {
position: relative;
width: 750rpx;
height: 60rpx;
display: flex;
flex-direction: row;
align-items: center;
box-shadow: 0rpx 2rpx 7rpx 0rpx rgba(153, 153, 153, 0.16);
}
.about-system-back-icon {
width: 9rpx;
height: 18rpx;
}
.about-system-back {
width: 95rpx;
height: 60rpx;
justify-content: center;
align-items: center;
display: flex;
flex-direction: row
}
.about-system-back-text {
font-size: 19rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(51, 51, 51, 1);
line-height: 22rpx;
margin-left: 5rpx
}
.about-system-title {
font-size: 21px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 21px;
position: absolute;
width: 100%;
text-align: center;
}
.about-system-body {
width: 750rpx;
height: 363rpx;
position: relative;
display: flex;
flex-direction: column;
}
.about-system-item {
margin-left: 282rpx;
width: auto;
margin-top: 23rpx;
display: flex;
flex-direction: row;
}
.about-system-item-title {
font-size: 21rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(91, 105, 129, 1);
line-height: 21rpx;
}
.about-system-item-desc {
font-size: 21rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: rgba(91, 105, 129, 1);
line-height: 21rpx;
}
/* 应用设置 */
.app-setting-item {
margin-left: 38rpx;
width: auto;
margin-top: 44rpx;
display: flex;
flex-direction: row;
align-items: center;
}
.app-setting-print-text {
font-size: 23rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: rgba(91, 105, 129, 1);
line-height: 21rpx;
margin-right: 6rpx;
}
\ No newline at end of file
pages/index/index.axml
View file @
867a9f39
...
@@ -386,9 +386,7 @@
...
@@ -386,9 +386,7 @@
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 键盘 -->
<land-keybord scene="{{scene}}" onKeyBordFinished="onKeyBordFinished" onKeyBordClose="onKeyBordClose">
</land-keybord>
<!-- 等待前屏登录 -->
<!-- 等待前屏登录 -->
<view class="login-waiting-page" a:if="{{!isFrontScreenLoginOK}}">
<view class="login-waiting-page" a:if="{{!isFrontScreenLoginOK}}">
<image class="login-waiting-left" mode="aspectFill" src="/images/login_wait_left.png"/>
<image class="login-waiting-left" mode="aspectFill" src="/images/login_wait_left.png"/>
...
@@ -398,7 +396,7 @@
...
@@ -398,7 +396,7 @@
</view>
</view>
<!-- 操作结果页 -->
<!-- 操作结果页 -->
<view hidden="{{!pageShow['operate
R
esult']}}">
<view hidden="{{!pageShow['operate
r
esult']}}">
<view class="operateTopView"></view>
<view class="operateTopView"></view>
<view class="operateBodyView">
<view class="operateBodyView">
<block a:if="{{operateSuccess}}">
<block a:if="{{operateSuccess}}">
...
@@ -426,6 +424,62 @@
...
@@ -426,6 +424,62 @@
</block>
</block>
</view>
</view>
</view>
</view>
<!-- 关于系统 -->
<view hidden="{{!pageShow['aboutsystem']}}" style="background:#ffffff">
<view class="about-system-top">
<view class="about-system-back" catchTap="goHome">
<image class="about-system-back-icon" mode="aspectFit" src="/images/icon_back.png"/>
<text class="about-system-back-text">返回</text>
</view>
<view class="about-system-title">关于系统</view>
</view>
<view class="about-system-body">
<view class="about-system-item" style="margin-top:60rpx;">
<view class="about-system-item-title">门店:</view>
<view class="about-system-item-desc">{{storeName}}</view>
</view>
<view class="about-system-item">
<view class="about-system-item-title">门店号:</view>
<view class="about-system-item-desc">{{storeId}}</view>
</view>
<view class="about-system-item">
<view class="about-system-item-title">SN码:</view>
<view class="about-system-item-desc">{{serialNo}}</view>
</view>
<view class="about-system-item">
<view class="about-system-item-title">登录账号:</view>
<view class="about-system-item-desc">{{userName}}</view>
</view>
<view class="about-system-item">
<view class="about-system-item-title">容器版本:</view>
<view class="about-system-item-desc">{{containerVersion}}</view>
</view>
<view class="about-system-item">
<view class="about-system-item-title">版本号:</view>
<view class="about-system-item-desc">{{version}}</view>
</view>
</view>
</view>
<!-- 应用设置 -->
<view hidden="{{!pageShow['appsetting']}}" style="background:#ffffff">
<view class="about-system-top">
<view class="about-system-back" catchTap="goHome">
<image class="about-system-back-icon" mode="aspectFit" src="/images/icon_back.png"/>
<text class="about-system-back-text">返回</text>
</view>
<view class="about-system-title">应用设置</view>
</view>
<view class="about-system-body">
<view class="app-setting-item">
<view class="app-setting-print-text">打印小票:</view>
<switch color="rgba(24,144,255,1)" checked="{{printEnabled}}" onChange="onPrintEnabledSwitch"/>
</view>
</view>
</view>
<!-- 以下是控件部分 -->
<!-- 键盘 -->
<land-keybord scene="{{scene}}" onKeyBordFinished="onKeyBordFinished" onKeyBordClose="onKeyBordClose">
</land-keybord>
<!-- 重新检查弹窗 -->
<!-- 重新检查弹窗 -->
<view class="recheckPage" hidden="{{!recheckShow}}">
<view class="recheckPage" hidden="{{!recheckShow}}">
<view class="recheckDialog">
<view class="recheckDialog">
...
...
pages/index/index.js
View file @
867a9f39
var
api
=
require
(
"../../utils/api.js"
);
var
api
=
require
(
"../../utils/api.js"
);
import
{
import
{
ACTION_USE_COUPON
,
ACTION_GOODS
,
ACTION_MEMBER
,
ACTION_USE_COUPON
,
ACTION_GOODS
,
ACTION_MEMBER
,
ACTION_GO_BALANCE
,
ACTION_REQUEST_GOOD_INFO
,
ACTION_PRINT_RESULT
,
ACTION_GO_BALANCE
,
ACTION_REQUEST_GOOD_INFO
,
ACTION_PRINT_RESULT
,
ACTION_REPRINT
,
ACTION_GO_SCAN
,
ACTION_ON_PAY_SUCCESS
,
ACTION_REPRINT
,
ACTION_GO_SCAN
,
ACTION_ON_PAY_SUCCESS
,
ACTION_ON_PAY_FAILED
,
ACTION_GO_HOME
,
ACTION_GET_ACCOUNT
,
ACTION_ON_PAY_FAILED
,
ACTION_GO_HOME
,
ACTION_GET_ACCOUNT
,
ACTION_DIRECT_PAYMENT
,
ACTION_CONVERT_COUPON
,
ACTION_LOGIN_OK
,
ACTION_DIRECT_PAYMENT
,
ACTION_CONVERT_COUPON
,
ACTION_LOGIN_OK
,
ACTION_REFUND
,
ACTION_REFUND_SUCCESS
,
ACTION_REFUND_FAILED
,
ACTION_REFUND
,
ACTION_REFUND_SUCCESS
,
ACTION_REFUND_FAILED
,
ACTION_PRINT_LAST_ORDER
,
ACTION_GET_CUR_AD
,
ACTION_SEND_SEL_AD
,
ACTION_PRINT_LAST_ORDER
,
ACTION_GET_CUR_AD
,
ACTION_SEND_SEL_AD
,
}
from
'../../const/actioncmd'
ACTION_SYSTEM_SETTING
,
}
from
'../../const/actioncmd'
import
{
FLOW_IDLE
,
FLOW_COLLECTIONS
,
FLOW_REFUND
,
FLOW_DIRECT_PAYMENT
}
from
'../../const/actioncmd'
import
{
FLOW_IDLE
,
FLOW_COLLECTIONS
,
FLOW_REFUND
,
FLOW_DIRECT_PAYMENT
}
from
'../../const/actioncmd'
...
@@ -19,14 +20,25 @@ Page({
...
@@ -19,14 +20,25 @@ Page({
"landscan"
:
false
,
"landscan"
:
false
,
"waitoperate"
:
false
,
"waitoperate"
:
false
,
"payresult"
:
false
,
"payresult"
:
false
,
"operate
R
esult"
:
false
,
"operate
r
esult"
:
false
,
"printlastorder"
:
false
,
"printlastorder"
:
false
,
"poster"
:
false
"poster"
:
false
,
"aboutsystem"
:
false
,
"appsetting"
:
false
,
},
},
// 前屏是否完成登录
// 前屏是否完成登录
isFrontScreenLoginOK
:
false
,
isFrontScreenLoginOK
:
false
,
flowType
:
""
,
//流程类型:用于区分易混淆的流程,以及共同界面使用时用该标识位作为区分
flowType
:
""
,
//流程类型:用于区分易混淆的流程,以及共同界面使用时用该标识位作为区分
/**账号信息 */
storeName
:
"--"
,
storeName
:
"--"
,
storeId
:
"--"
,
userName
:
"--"
,
serialNo
:
"--"
,
containerVersion
:
"--"
,
version
:
"--"
,
printEnabled
:
true
,
/**支付结果页相关参数 */
/**支付结果页相关参数 */
payFailedReason
:
"xxxxxxxxxxx"
,
payFailedReason
:
"xxxxxxxxxxx"
,
isPaySuccess
:
true
,
isPaySuccess
:
true
,
...
@@ -40,7 +52,7 @@ Page({
...
@@ -40,7 +52,7 @@ Page({
//优惠券 0关闭 录入券弹窗 1等待录入 2.录入中 3.录入成功 4.录入失败
//优惠券 0关闭 录入券弹窗 1等待录入 2.录入中 3.录入成功 4.录入失败
discCouponState
:
0
,
discCouponState
:
0
,
discCouponMsg
:
"录入失败!无效的优惠券码"
,
discCouponMsg
:
"录入失败!无效的优惠券码"
,
discCouponPrice
:
0
,
discCouponPrice
:
0
,
//兑换券 0关闭兑换券弹窗 1等待兑换 2.兑换中 3.兑换成功 4.兑换失败
//兑换券 0关闭兑换券弹窗 1等待兑换 2.兑换中 3.兑换成功 4.兑换失败
convertCouponState
:
0
,
convertCouponState
:
0
,
...
@@ -122,6 +134,30 @@ Page({
...
@@ -122,6 +134,30 @@ Page({
},
},
onReady
()
{
onReady
()
{
// 页面加载完成
// 页面加载完成
//获取基础信息
let
context
=
this
;
//小程序版本号
this
.
setData
({
version
:
getApp
().
globalData
.
version
})
my
.
getStorage
({
key
:
'printEnabled'
,
success
:
function
(
res
)
{
if
(
res
==
null
||
res
.
enabled
==
null
)
{
res
=
{
enabled
:
true
};
}
context
.
setData
({
printEnabled
:
res
.
enabled
})
},
fail
:
function
(
res
)
{
console
.
log
(
"打印标识位获取失败"
);
}
});
},
},
onShow
()
{
onShow
()
{
// 页面显示
// 页面显示
...
@@ -196,10 +232,6 @@ Page({
...
@@ -196,10 +232,6 @@ Page({
});
});
context
.
goPage
(
'payresult'
);
context
.
goPage
(
'payresult'
);
}
else
if
(
res
.
action
==
ACTION_GET_ACCOUNT
)
{
context
.
setData
({
storeName
:
res
.
data
.
storeName
});
}
else
if
(
res
.
action
==
ACTION_DIRECT_PAYMENT
)
{
}
else
if
(
res
.
action
==
ACTION_DIRECT_PAYMENT
)
{
//直接收款
//直接收款
if
(
res
.
data
!=
null
)
{
if
(
res
.
data
!=
null
)
{
...
@@ -214,7 +246,18 @@ Page({
...
@@ -214,7 +246,18 @@ Page({
}
}
}
else
if
(
res
.
action
==
ACTION_LOGIN_OK
)
{
}
else
if
(
res
.
action
==
ACTION_LOGIN_OK
)
{
//前屏登录完成
//前屏登录完成
context
.
setData
({
isFrontScreenLoginOK
:
true
,
storeName
:
res
.
data
.
storeName
})
var
loginOptions
=
res
.
data
;
var
sn
=
loginOptions
.
sn
;
var
account
=
loginOptions
.
account
;
var
version
=
loginOptions
.
containerVersion
;
context
.
setData
({
isFrontScreenLoginOK
:
true
,
storeName
:
account
.
storeName
,
storeId
:
account
.
storeId
,
userName
:
account
.
userName
,
serialNo
:
sn
,
containerVersion
:
version
,
})
}
else
if
(
res
.
action
==
ACTION_REFUND_SUCCESS
)
{
}
else
if
(
res
.
action
==
ACTION_REFUND_SUCCESS
)
{
//跳转到成功页面
//跳转到成功页面
context
.
setData
({
context
.
setData
({
...
@@ -267,13 +310,13 @@ Page({
...
@@ -267,13 +310,13 @@ Page({
});
});
//跳转广告页面
//跳转广告页面
context
.
goPage
(
'poster'
);
context
.
goPage
(
'poster'
);
}
else
if
(
res
.
action
==
ACTION_USE_COUPON
)
{
}
else
if
(
res
.
action
==
ACTION_USE_COUPON
)
{
//优惠券
//优惠券
let
coupon
=
res
.
data
let
coupon
=
res
.
data
context
.
setData
({
context
.
setData
({
discCouponState
:
coupon
.
discCouponState
,
discCouponState
:
coupon
.
discCouponState
,
discCouponMsg
:
coupon
.
discCouponMsg
,
discCouponMsg
:
coupon
.
discCouponMsg
,
discCouponPrice
:
coupon
.
discCouponPrice
discCouponPrice
:
coupon
.
discCouponPrice
})
})
}
}
...
@@ -340,22 +383,6 @@ Page({
...
@@ -340,22 +383,6 @@ 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
));
},
});
},
/**首页相关 */
/**首页相关 */
/**立即收款 */
/**立即收款 */
onHomeCashierImmediatelyClicked
()
{
onHomeCashierImmediatelyClicked
()
{
...
@@ -406,6 +433,9 @@ Page({
...
@@ -406,6 +433,9 @@ Page({
* 打印上一单
* 打印上一单
*/
*/
onHomePrintLastOrderClicked
()
{
onHomePrintLastOrderClicked
()
{
if
(
this
.
data
.
printEnabled
!=
true
)
{
return
;
}
//发送指令至前屏
//发送指令至前屏
//通知前屏重新打印
//通知前屏重新打印
my
.
ix
.
sendBuddyMessage
({
my
.
ix
.
sendBuddyMessage
({
...
@@ -447,25 +477,42 @@ Page({
...
@@ -447,25 +477,42 @@ Page({
/**关于系统(实际上是关于应用) */
/**关于系统(实际上是关于应用) */
onHomeAboutAppClicked
()
{
onHomeAboutAppClicked
()
{
this
.
goPage
(
"aboutsystem"
);
},
},
/**
/**
* 系统设置
* 系统设置
*/
*/
onHomeSysSettingClicked
()
{
onHomeSysSettingClicked
()
{
my
.
ix
.
sendBuddyMessage
({
// 填入目标小程序的 AppID
target
:
getApp
().
globalData
.
frontScreenAppId
,
data
:
{
action
:
ACTION_SYSTEM_SETTING
,
data
:
null
},
success
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
},
fail
:
(
res
)
=>
{
console
.
info
(
`sendBuddyMessage failed:
${
JSON
.
stringify
(
res
)}
`
);
}
});
},
},
/**
/**
* 应用设置
* 应用设置
*/
*/
onHomeAppSettingClicked
()
{
onHomeAppSettingClicked
()
{
this
.
goPage
(
"appsetting"
);
},
},
/**payresult页面逻辑方法 */
/**payresult页面逻辑方法 */
onReprint
()
{
onReprint
()
{
if
(
this
.
data
.
printEnabled
!=
true
)
{
return
;
}
//通知前屏重新打印
//通知前屏重新打印
my
.
ix
.
sendBuddyMessage
({
my
.
ix
.
sendBuddyMessage
({
// 填入目标小程序的 AppID
// 填入目标小程序的 AppID
...
@@ -514,14 +561,14 @@ Page({
...
@@ -514,14 +561,14 @@ Page({
totalDisc
:
0.00
,
totalDisc
:
0.00
,
goods
:
[
goods
:
[
],
],
discCouponState
:
0
,
discCouponState
:
0
,
discCouponMsg
:
""
,
discCouponMsg
:
""
,
discCouponPrice
:
0
,
discCouponPrice
:
0
,
})
})
var
commonRequest
=
{
var
commonRequest
=
{
action
:
ACTION_GO_SCAN
,
action
:
ACTION_GO_SCAN
,
data
:
null
data
:
{
printEnabled
:
this
.
data
.
printEnabled
}
};
};
var
context
=
this
;
var
context
=
this
;
my
.
ix
.
sendBuddyMessage
({
my
.
ix
.
sendBuddyMessage
({
...
@@ -866,7 +913,7 @@ Page({
...
@@ -866,7 +913,7 @@ Page({
},
},
//发送优惠券到前屏
//发送优惠券到前屏
sendDiscCouponToFront
(
res
)
{
sendDiscCouponToFront
(
res
)
{
let
context
=
this
;
let
context
=
this
;
my
.
ix
.
sendBuddyMessage
({
my
.
ix
.
sendBuddyMessage
({
...
@@ -1103,6 +1150,23 @@ Page({
...
@@ -1103,6 +1150,23 @@ Page({
console
.
log
(
"event==>"
+
JSON
.
stringify
(
event
));
console
.
log
(
"event==>"
+
JSON
.
stringify
(
event
));
//回首页
//回首页
this
.
goPage
(
'home'
);
this
.
goPage
(
'home'
);
},
//打印标识位
onPrintEnabledSwitch
(
e
)
{
this
.
setData
({
printEnabled
:
e
.
detail
.
value
})
console
.
log
(
"checked changed,printEnabled:"
+
e
.
detail
.
value
)
my
.
setStorage
({
key
:
'printEnabled'
,
data
:
{
enabled
:
e
.
detail
.
value
},
success
:
function
()
{
console
.
log
(
"本地数据设置完毕,printEnabled:"
+
e
.
detail
.
value
)
}
}
});
},
});
});
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