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
e7d8777a
Commit
e7d8777a
authored
Mar 02, 2020
by
gaodapeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加退出的逻辑
parent
7df4cb78
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
20 deletions
+56
-20
actioncmd.js
const/actioncmd.js
+3
-0
landkeybord.js
pages/components/landkeybord/landkeybord.js
+14
-8
index.axml
pages/index/index.axml
+3
-1
index.js
pages/index/index.js
+36
-11
No files found.
const/actioncmd.js
View file @
e7d8777a
...
...
@@ -83,6 +83,9 @@ export const ACTION_VERIFY_FAILED = "ACTION_VERIFY_FAILED";
//提货
export
const
ACTION_PICK_UP_GOODS
=
"ACTION_PICK_UP_GOODS"
;
//退出
export
const
ACTION_QUIT
=
"ACTION_QUIT"
;
const
FLOW_IDLE
=
"idle"
;
const
FLOW_COLLECTIONS
=
"collections"
;
//收款
const
FLOW_REFUND
=
"refund"
;
//退款
...
...
pages/components/landkeybord/landkeybord.js
View file @
e7d8777a
...
...
@@ -3,7 +3,7 @@ Component({
data
:
{
result
:
""
,
scenes
:
2
,
errMsg
:
""
errMsg
:
""
},
props
:
{
...
...
@@ -11,7 +11,7 @@ Component({
//场景 1.输入商品码 2.会员 3.收款 4.退款
scene
:
1
,
//错误提示
errMsg
:
''
errMsg
:
''
},
didMount
()
{
},
didUpdate
()
{
},
...
...
@@ -22,7 +22,7 @@ Component({
if
(
nextProps
.
scene
==
0
)
{
this
.
setData
({
result
:
''
,
errMsg
:
''
,
errMsg
:
''
,
});
}
...
...
@@ -67,18 +67,24 @@ Component({
this
.
setData
({
result
:
''
});
}
},
finish
(
e
)
{
this
.
setData
({
errMsg
:
""
})
if
(
this
.
data
.
scenes
==
3
||
this
.
data
.
scenes
==
4
)
{
//判断价格是否参数合法
var
priceReg
=
/
(
^
[
1-9
]\d
*
(\.\d{1,2})?
$
)
|
(
^0
(\.\d{1,2})?
$
)
/
;
if
(
!
priceReg
.
test
(
this
.
data
.
result
))
{
//错误提示
this
.
setData
({
errMsg
:
"金额格式有误"
})
//错误提示
this
.
setData
({
errMsg
:
"金额格式有误"
})
return
}
}
else
if
(
this
.
data
.
scenes
==
2
)
{
if
(
this
.
data
.
result
==
null
||
this
.
data
.
result
.
length
!=
11
)
{
this
.
setData
({
errMsg
:
"会员号格式有误"
})
return
}
}
this
.
props
.
onKeyBordFinished
(
this
.
data
.
result
);
},
closeKeybord
(
e
)
{
this
.
props
.
onKeyBordClose
();
this
.
props
.
onKeyBordFinished
(
this
.
data
.
result
);
},
closeKeybord
(
e
)
{
this
.
props
.
onKeyBordClose
();
}
...
...
pages/index/index.axml
View file @
e7d8777a
...
...
@@ -6,7 +6,9 @@
<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 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;">退出</view><image mode="aspectFit" src="/images/icon_exit.png" style="position:relative;width:19rpx;height:19rpx;margin-right:8rpx;margin-top:1rpx;"/></view> -->
<view style="display:flex;flex-direction:row-reverse;position:absolute;right:19rpx;top:19rpx;width:auto;background:#ffffff;" onTap="onQuit">
<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" style="height:100%;">
<swiper indicator-dots="{{true}}">
...
...
pages/index/index.js
View file @
e7d8777a
...
...
@@ -3,7 +3,7 @@ import {
ACTION_USE_COUPON
,
ACTION_GOODS
,
ACTION_MEMBER
,
ACTION_GO_BALANCE
,
ACTION_REQUEST_GOOD_INFO
,
ACTION_PRINT_RESULT
,
ACTION_REPRINT
,
ACTION_GO_SCAN
,
ACTION_ON_PAY_SUCCESS
,
ACTION_ON_PAY_FAILED
,
ACTION_GO_HOME
,
ACTION_ON_PAY_FAILED
,
ACTION_GO_HOME
,
ACTION_QUIT
,
ACTION_DIRECT_PAYMENT
,
ACTION_CONVERT_COUPON
,
ACTION_LOGIN_OK
,
ACTION_REFUND
,
ACTION_REFUND_SUCCESS
,
ACTION_REFUND_FAILED
,
ACTION_PRINT_LAST_ORDER
,
ACTION_GET_CUR_AD
,
ACTION_SEND_SEL_AD
,
...
...
@@ -115,6 +115,9 @@ Page({
{
url
:
"/images/img_ad1.png"
,
selected
:
true
},
{
url
:
"/images/img_ad2.png"
,
selected
:
false
},
],
/**键盘 */
keyboardErrMsg
:
""
,
},
/**
...
...
@@ -424,6 +427,32 @@ Page({
// 页面被拉到底部
},
onQuit
()
{
console
.
log
(
"onQuit"
);
this
.
setData
({
isFrontScreenLoginOK
:
false
,
storeName
:
"--"
,
storeId
:
"--"
,
userName
:
"--"
,
})
this
.
goPage
(
'home'
)
my
.
ix
.
sendBuddyMessage
({
target
:
getApp
().
globalData
.
frontScreenAppId
,
data
:
{
action
:
ACTION_QUIT
,
data
:
null
},
success
:
(
res
)
=>
{
console
.
log
(
"通知前屏退出 成功 ===》"
+
JSON
.
stringify
(
res
));
},
fail
:
(
res
)
=>
{
console
.
log
(
"通知前屏退出 失败 ===》"
+
JSON
.
stringify
(
res
));
}
})
},
//回到首页
goHome
()
{
...
...
@@ -795,9 +824,6 @@ Page({
}
else
if
(
this
.
data
.
scene
==
1
)
{
this
.
sendGoodsInfoToFront
(
result
)
}
else
if
(
this
.
data
.
scene
==
2
)
{
if
(
result
.
length
!=
11
)
{
return
;
//键盘不给消失
}
this
.
sendMemberLogin
(
result
);
}
else
if
(
this
.
data
.
scene
==
4
)
{
this
.
sendRefund
(
result
);
...
...
@@ -850,7 +876,7 @@ Page({
//清空商品信息
clearGood
(
e
)
{
this
.
setData
({
goods
:
[],
discCouponPrice
:
0
})
this
.
setData
({
goods
:
[],
discCouponPrice
:
0
})
this
.
calculation
([]);
},
...
...
@@ -925,14 +951,13 @@ Page({
this
.
sendGoodInfoToFront
()
},
fen2Yuan
(
num
)
{
if
(
typeof
num
!==
"number"
||
isNaN
(
num
))
return
null
;
return
(
num
/
100
).
toFixed
(
2
);
fen2Yuan
(
num
)
{
if
(
typeof
num
!==
"number"
||
isNaN
(
num
))
return
null
;
return
(
num
/
100
).
toFixed
(
2
);
},
sendMemberLogin
(
result
)
{
this
.
setData
({
memberPhone
:
result
})
...
...
@@ -1130,10 +1155,10 @@ Page({
//使用券
useCoupon
(
e
)
{
if
(
this
.
data
.
goods
.
length
==
0
)
{
if
(
this
.
data
.
goods
.
length
==
0
)
{
this
.
showToast
(
"请先录入商品"
)
return
}
}
this
.
setData
({
discCouponState
:
1
})
var
request
=
{};
...
...
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