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
Show 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";
...
@@ -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_PICK_UP_GOODS
=
"ACTION_PICK_UP_GOODS"
;
//退出
export
const
ACTION_QUIT
=
"ACTION_QUIT"
;
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/components/landkeybord/landkeybord.js
View file @
e7d8777a
...
@@ -3,7 +3,7 @@ Component({
...
@@ -3,7 +3,7 @@ Component({
data
:
{
data
:
{
result
:
""
,
result
:
""
,
scenes
:
2
,
scenes
:
2
,
errMsg
:
""
errMsg
:
""
},
},
props
:
{
props
:
{
...
@@ -11,7 +11,7 @@ Component({
...
@@ -11,7 +11,7 @@ Component({
//场景 1.输入商品码 2.会员 3.收款 4.退款
//场景 1.输入商品码 2.会员 3.收款 4.退款
scene
:
1
,
scene
:
1
,
//错误提示
//错误提示
errMsg
:
''
errMsg
:
''
},
},
didMount
()
{
},
didMount
()
{
},
didUpdate
()
{
},
didUpdate
()
{
},
...
@@ -22,7 +22,7 @@ Component({
...
@@ -22,7 +22,7 @@ Component({
if
(
nextProps
.
scene
==
0
)
{
if
(
nextProps
.
scene
==
0
)
{
this
.
setData
({
this
.
setData
({
result
:
''
,
result
:
''
,
errMsg
:
''
,
errMsg
:
''
,
});
});
}
}
...
@@ -67,17 +67,23 @@ Component({
...
@@ -67,17 +67,23 @@ Component({
this
.
setData
({
result
:
''
});
this
.
setData
({
result
:
''
});
}
}
},
finish
(
e
)
{
},
finish
(
e
)
{
this
.
setData
({
errMsg
:
""
})
if
(
this
.
data
.
scenes
==
3
||
this
.
data
.
scenes
==
4
)
{
if
(
this
.
data
.
scenes
==
3
||
this
.
data
.
scenes
==
4
)
{
//判断价格是否参数合法
//判断价格是否参数合法
var
priceReg
=
/
(
^
[
1-9
]\d
*
(\.\d{1,2})?
$
)
|
(
^0
(\.\d{1,2})?
$
)
/
;
var
priceReg
=
/
(
^
[
1-9
]\d
*
(\.\d{1,2})?
$
)
|
(
^0
(\.\d{1,2})?
$
)
/
;
if
(
!
priceReg
.
test
(
this
.
data
.
result
))
{
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
return
}
}
}
}
this
.
props
.
onKeyBordFinished
(
this
.
data
.
result
);
this
.
props
.
onKeyBordFinished
(
this
.
data
.
result
);
},
closeKeybord
(
e
)
{
},
closeKeybord
(
e
)
{
this
.
props
.
onKeyBordClose
();
this
.
props
.
onKeyBordClose
();
}
}
...
...
pages/index/index.axml
View file @
e7d8777a
...
@@ -6,7 +6,9 @@
...
@@ -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>
<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;left:0rpx;top:19rpx;width:100%;text-align:center;">首页</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>
<view class="homeBodyView" style="height:100%;">
<view class="homeBodyView" style="height:100%;">
<swiper indicator-dots="{{true}}">
<swiper indicator-dots="{{true}}">
...
...
pages/index/index.js
View file @
e7d8777a
...
@@ -3,7 +3,7 @@ import {
...
@@ -3,7 +3,7 @@ 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_ON_PAY_FAILED
,
ACTION_GO_HOME
,
ACTION_QUIT
,
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
,
...
@@ -115,6 +115,9 @@ Page({
...
@@ -115,6 +115,9 @@ Page({
{
url
:
"/images/img_ad1.png"
,
selected
:
true
},
{
url
:
"/images/img_ad1.png"
,
selected
:
true
},
{
url
:
"/images/img_ad2.png"
,
selected
:
false
},
{
url
:
"/images/img_ad2.png"
,
selected
:
false
},
],
],
/**键盘 */
keyboardErrMsg
:
""
,
},
},
/**
/**
...
@@ -424,6 +427,32 @@ Page({
...
@@ -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
()
{
goHome
()
{
...
@@ -795,9 +824,6 @@ Page({
...
@@ -795,9 +824,6 @@ Page({
}
else
if
(
this
.
data
.
scene
==
1
)
{
}
else
if
(
this
.
data
.
scene
==
1
)
{
this
.
sendGoodsInfoToFront
(
result
)
this
.
sendGoodsInfoToFront
(
result
)
}
else
if
(
this
.
data
.
scene
==
2
)
{
}
else
if
(
this
.
data
.
scene
==
2
)
{
if
(
result
.
length
!=
11
)
{
return
;
//键盘不给消失
}
this
.
sendMemberLogin
(
result
);
this
.
sendMemberLogin
(
result
);
}
else
if
(
this
.
data
.
scene
==
4
)
{
}
else
if
(
this
.
data
.
scene
==
4
)
{
this
.
sendRefund
(
result
);
this
.
sendRefund
(
result
);
...
@@ -850,7 +876,7 @@ Page({
...
@@ -850,7 +876,7 @@ Page({
//清空商品信息
//清空商品信息
clearGood
(
e
)
{
clearGood
(
e
)
{
this
.
setData
({
goods
:
[],
discCouponPrice
:
0
})
this
.
setData
({
goods
:
[],
discCouponPrice
:
0
})
this
.
calculation
([]);
this
.
calculation
([]);
},
},
...
@@ -932,7 +958,6 @@ Page({
...
@@ -932,7 +958,6 @@ Page({
sendMemberLogin
(
result
)
{
sendMemberLogin
(
result
)
{
this
.
setData
({
this
.
setData
({
memberPhone
:
result
memberPhone
:
result
})
})
...
@@ -1130,7 +1155,7 @@ Page({
...
@@ -1130,7 +1155,7 @@ Page({
//使用券
//使用券
useCoupon
(
e
)
{
useCoupon
(
e
)
{
if
(
this
.
data
.
goods
.
length
==
0
)
{
if
(
this
.
data
.
goods
.
length
==
0
)
{
this
.
showToast
(
"请先录入商品"
)
this
.
showToast
(
"请先录入商品"
)
return
return
}
}
...
...
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