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
d9b2155b
Commit
d9b2155b
authored
Feb 19, 2020
by
pengguangpu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支付结果页初步联调;
parent
e52078b1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
19 deletions
+60
-19
index.acss
pages/index/index.acss
+2
-2
index.axml
pages/index/index.axml
+3
-3
index.js
pages/index/index.js
+55
-14
No files found.
pages/index/index.acss
View file @
d9b2155b
...
@@ -504,14 +504,14 @@
...
@@ -504,14 +504,14 @@
/* 结算页 */
/* 结算页 */
page{
/*
page{
display: flex;
display: flex;
flex-direction: column;
flex-direction: column;
width: 100%;
width: 100%;
height: 100%;
height: 100%;
box-sizing: border-box;
box-sizing: border-box;
align-items: center;
align-items: center;
}
}
*/
.topView{
.topView{
position: relative;
position: relative;
...
...
pages/index/index.axml
View file @
d9b2155b
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
</view>
</view>
</view>
</view>
<!--扫码页-->
<!--扫码页-->
<view hidden="{{!pageShow['landscan']}}">
<view hidden="{{!pageShow['landscan']}}">
<view class="{{scene != 0 ? 'pfilter' : 'pageland' }}">
<view class="{{scene != 0 ? 'pfilter' : 'pageland' }}">
...
@@ -176,13 +176,13 @@
...
@@ -176,13 +176,13 @@
</block>
</block>
<block a:else>
<block a:else>
<view hidden="{{isPrinting}}">
<view hidden="{{isPrinting}}">
<button type="ghost" style="
height:40rpx;margin:0 auto;border-radius:20rpx;border-color:#FF7F19;color:#FF7F19;width:166rpx;" hover-class="loginButtonHover
" onTap="onReprint">重新打印</button>
<button type="ghost" style="
margin:0 auto;font-size:28rpx;height:40rpx;border-radius:20rpx;border-color:#FF7F19;color:#FF7F19;width:166rpx;
" onTap="onReprint">重新打印</button>
</view>
</view>
</block>
</block>
</view>
</view>
</view>
</view>
<view hidden="{{isPrinting}}">
<view hidden="{{isPrinting}}">
<button type="primary" style="height:60rpx;margin-top:8rpx;border-radius:5rpx;background-color:#007AFF;border-color:#007AFF;opacity: 0.7;width:252rpx;" hover-class="loginButtonHover" onTap="">继续付款</button>
<button type="primary" style="height:60rpx;margin-top:8rpx;border-radius:5rpx;background-color:#007AFF;border-color:#007AFF;opacity: 0.7;width:252rpx;" hover-class="loginButtonHover" onTap="
onNextPayFromPayResult
">继续付款</button>
</view>
</view>
</block>
</block>
<block a:else>
<block a:else>
...
...
pages/index/index.js
View file @
d9b2155b
...
@@ -10,19 +10,19 @@ Page({
...
@@ -10,19 +10,19 @@ Page({
data
:
{
data
:
{
//页面控制相关参数
//页面控制相关参数
pageShow
:
{
pageShow
:
{
"home"
:
tru
e
,
"home"
:
fals
e
,
"landscan"
:
fals
e
,
"landscan"
:
tru
e
,
"waitoperate"
:
false
,
"waitoperate"
:
false
,
"payresult"
:
false
"payresult"
:
false
},
},
storeName
:
"--"
,
storeName
:
"--"
,
/**支付结果页相关参数 */
/**支付结果页相关参数 */
payFailedReason
:
"xxxxxxxxxxx"
,
payFailedReason
:
"xxxxxxxxxxx"
,
isPaySuccess
:
true
,
isPaySuccess
:
true
,
payPriceYuan
:
"--.--"
,
payPriceYuan
:
"--.--"
,
printResult
:
"正在打印小票..."
,
printResult
:
"正在打印小票..."
,
isPrinting
:
false
,
isPrinting
:
false
,
isPrintSuccess
:
tru
e
,
isPrintSuccess
:
fals
e
,
/**商品扫码页相关参数 */
/**商品扫码页相关参数 */
//是否正在用券
//是否正在用券
couponUseing
:
false
,
couponUseing
:
false
,
...
@@ -40,15 +40,26 @@ Page({
...
@@ -40,15 +40,26 @@ Page({
/**跳转页面方法 */
/**跳转页面方法 */
goPage
(
pageName
)
{
goPage
(
pageName
)
{
var
pageShowTemp
=
{
"home"
:
false
,
"landscan"
:
false
,
"waitoperate"
:
false
,
"payresult"
:
false
};
//遍历pageShow
//遍历pageShow
for
(
var
key
in
this
.
data
.
pageShow
)
{
for
(
var
key
in
pageShowTemp
)
{
if
(
key
==
pageName
)
{
if
(
key
==
pageName
)
{
this
.
data
.
pageShow
[
key
]
=
true
;
pageShowTemp
[
key
]
=
true
;
my
.
showToast
({
content
:
"跳页"
});
}
else
{
}
else
{
this
.
data
.
pageShow
[
key
]
=
false
;
pageShowTemp
[
key
]
=
false
;
}
}
}
}
this
.
setData
({
pageShow
:
pageShowTemp
});
},
},
...
@@ -61,13 +72,32 @@ Page({
...
@@ -61,13 +72,32 @@ Page({
},
},
onShow
()
{
onShow
()
{
// 页面显示
// 页面显示
let
context
=
this
;
//开启后屏监听
//开启后屏监听
my
.
ix
.
onBuddyMessage
({
my
.
ix
.
onBuddyMessage
({
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
console
.
info
(
`onBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
console
.
info
(
`onBuddyMessage success:
${
JSON
.
stringify
(
res
)}
`
);
if
(
res
.
action
==
ACTION_PRINT_RESULT
)
{
my
.
showToast
({
content
:
JSON
.
stringify
(
res
)
});
if
(
res
.
action
==
ACTION_PRINT_RESULT
&&
context
.
data
.
pageShow
[
'payresult'
]
==
true
)
{
//获取到打印结果
//获取到打印结果
var
printResult
=
res
.
data
;
var
printResultData
=
res
.
data
;
if
(
printResultData
.
code
==
0
)
{
//打印成功
context
.
setData
({
isPrintSuccess
:
true
,
isPrinting
:
false
,
printResult
:
"打印成功"
});
}
else
{
//打印失败
context
.
setData
({
isPrintSuccess
:
false
,
isPrinting
:
false
,
printResult
:
"打印失败"
});
}
}
else
if
(
res
.
action
==
ACTION_GOODS
)
{
}
else
if
(
res
.
action
==
ACTION_GOODS
)
{
//商品信息同步
//商品信息同步
my
.
hideLoading
();
my
.
hideLoading
();
...
@@ -80,7 +110,7 @@ Page({
...
@@ -80,7 +110,7 @@ Page({
totalDisc
:
viewGoodsInfo
.
totalDisc
,
totalDisc
:
viewGoodsInfo
.
totalDisc
,
})
})
}
}
}
else
if
(
res
.
action
==
ACTION
)
{
}
else
if
(
res
.
action
==
ACTION
)
{
//未知指令
//未知指令
}
}
}
}
...
@@ -118,7 +148,7 @@ Page({
...
@@ -118,7 +148,7 @@ Page({
//通知前屏重新打印
//通知前屏重新打印
my
.
ix
.
sendBuddyMessage
({
my
.
ix
.
sendBuddyMessage
({
// 填入目标小程序的 AppID
// 填入目标小程序的 AppID
target
:
"****************"
,
target
:
getApp
().
globalData
.
frontScreenAppId
,
data
:
{
data
:
{
action
:
ACTION_REPRINT
,
action
:
ACTION_REPRINT
,
data
:
null
data
:
null
...
@@ -132,6 +162,16 @@ Page({
...
@@ -132,6 +162,16 @@ Page({
});
});
},
},
onNextPayFromPayResult
()
{
//重制打印状态
this
.
setData
({
isPrinting
:
true
,
printResult
:
"正在打印..."
});
//跳转首页
this
.
goPage
(
'home'
);
},
/**landscan页面逻辑方法 */
/**landscan页面逻辑方法 */
//把所有的商品数据发送到后屏
//把所有的商品数据发送到后屏
...
@@ -294,7 +334,8 @@ Page({
...
@@ -294,7 +334,8 @@ Page({
});
});
}
}
})
})
//跳转结算页
this
.
goPage
(
'waitoperate'
);
},
},
//用券返回
//用券返回
...
...
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