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
4be3886e
Commit
4be3886e
authored
Feb 21, 2020
by
jiangjiantao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
兑换券
parent
be0f90c1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
31 deletions
+31
-31
home.js
pages/home/home.js
+0
-1
index.acss
pages/index/index.acss
+1
-0
index.axml
pages/index/index.axml
+14
-8
index.js
pages/index/index.js
+16
-22
No files found.
pages/home/home.js
View file @
4be3886e
...
...
@@ -5,7 +5,6 @@ import { ACTION_GO_SCAN } from '../../const/actioncmd'
Page
({
data
:
{
storeName
:
"--"
,
},
onLoad
()
{
my
.
ix
.
onBuddyMessage
({
...
...
pages/index/index.acss
View file @
4be3886e
...
...
@@ -510,6 +510,7 @@
font-weight: 500;
color: rgba(51, 51, 51, 1);
line-height: 22rpx;
margin-right: 80rpx;
}
/* 扫券码提示 */
...
...
pages/index/index.axml
View file @
4be3886e
...
...
@@ -38,22 +38,28 @@
<image class="scan-coupon-guide" mode="aspectFit" src="/images/scan_guide.png"/>
<button class="cancel-use-coupon" size="default" type="ghost" onTap="convertCouponClose">关闭</button>
</view>
<!-- 兑换中 -->
<view class="coupon-bottom" a:if="{{convertCouponState == 2}}">
<text class="scan-coupon-text">正在兑换券码…</text>
<image class="scan-coupon-guide" mode="aspectFit" src="/images/scan_guide.png"/>
</view>
<!-- 兑换成功 -->
<view class="coupon-bottom-success" a:if="{{convertCouponState == 3}}">
<image class="scan-coupon-success" mode="aspectFit" src="/images/icon_success.png"/>
<text class="scan-coupon-text-success">兑换码已识别</text>
<button class="sure-use-coupon" type="primary" size="default" onTap="convertCouponClose">确定</button>
</view>
<!-- 兑换失败 -->
<view class="coupon-bottom-fail" a:if="{{convertCouponState ==
2
}}">
<view class="coupon-bottom-fail" a:if="{{convertCouponState ==
4
}}">
<image class="scan-coupon-fail" mode="aspectFit" src="/images/icon_failed.png"/>
<text class="scan-coupon-text-fail">兑换失败</text>
<text class="scan-coupon-text-fail-desr">兑换失败!无效的兑换码</text>
<view class="failure-operation">
<button class="close-use-coupon" type="ghost" size="default" onTap="convertCouponClose">关闭</button>
<button class="again-use-coupon" type="primary" size="default" onTap="
againConvertCouponClose
">重新兑换</button>
<button class="again-use-coupon" type="primary" size="default" onTap="
convertCoupon
">重新兑换</button>
</view>
</view>
<!-- 兑换成功 -->
<view class="coupon-bottom-success" a:if="{{convertCouponState == 3}}">
<image class="scan-coupon-success" mode="aspectFit" src="/images/icon_success.png"/>
<text class="scan-coupon-text-success">兑换码已识别</text>
<button class="sure-use-coupon" type="primary" size="default" onTap="convertCouponClose">确定</button>
</view>
</view>
...
...
pages/index/index.js
View file @
4be3886e
...
...
@@ -37,8 +37,9 @@ Page({
//是否正在用券
couponUseing
:
false
,
//兑换券 0关闭兑换券弹窗 1等待兑换 2.兑换
失败 3.兑换成功
//兑换券 0关闭兑换券弹窗 1等待兑换 2.兑换
中 3.兑换成功 4.兑换失败
convertCouponState
:
0
,
convertCouponMsg
:
"兑换失败!无效的兑换码"
,
//是否正在用券
couponUseing
:
false
,
...
...
@@ -167,7 +168,10 @@ Page({
context
.
goPage
(
'waitoperate'
);
}
else
if
(
res
.
action
==
ACTION_CONVERT_COUPON
){
//兑换券
context
.
setData
({
convertCouponState
:
res
.
data
})
context
.
setData
({
convertCouponState
:
res
.
data
.
state
})
if
(
null
!=
res
.
data
.
msg
){
context
.
setData
({
convertCouponMsg
:
res
.
data
.
msg
})
}
}
}
...
...
@@ -508,41 +512,31 @@ Page({
//兑换券
convertCoupon
(
e
){
this
.
setData
({
convertCouponState
:
1
})
this
.
sendConvertCouponToFront
()
this
.
sendConvertCouponToFront
(
1
)
},
//兑换券界面关闭
convertCouponClose
(
e
){
this
.
setData
({
convertCouponState
:
0
})
this
.
sendConvertCouponToFront
()
this
.
sendConvertCouponToFront
(
0
)
},
//再次兑换
againConvertCouponClose
(
e
){
this
.
setData
({
convertCouponState
:
1
})
this
.
sendConvertCouponToFront
()
},
//发生兑换券到前屏
sendConvertCouponToFront
(){
sendConvertCouponToFront
(
res
){
let
context
=
this
;
my
.
ix
.
sendBuddyMessage
({
target
:
getApp
().
globalData
.
frontScreenAppId
,
data
:
{
action
:
ACTION_CONVERT_COUPON
,
data
:
this
.
data
.
convertCouponState
data
:
res
},
success
:
(
res
)
=>
{
console
.
log
(
"
通知前屏关闭兑换券弹窗 成功 ===》"
+
JSON
.
stringify
(
res
));
success
:
(
s
res
)
=>
{
console
.
log
(
"
兑换券通知前屏 成功 ===》"
+
JSON
.
stringify
(
s
res
));
},
fail
:
(
res
)
=>
{
console
.
log
(
"通知前屏关闭兑换券弹窗 失败 ===》 "
+
JSON
.
stringify
(
res
));
my
.
showToast
({
type
:
'fail'
,
content
:
'操作失败'
,
duration
:
3000
,
success
:
()
=>
{
},
});
fail
:
(
fres
)
=>
{
console
.
log
(
"兑换券通知前屏 失败 ===》 "
+
JSON
.
stringify
(
fres
));
context
.
sendConvertCouponToFront
(
res
)
}
})
},
...
...
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