Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
严立
/
mini-shimao
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7cc3f14a
authored
Sep 15, 2020
by
TengFengLian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
券码核销识别
parent
f048acfc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
9 deletions
pages/pay/coupon-detail/coupon-detail.wxss
pages/pay/coupon-input/coupon-input.js
pages/pay/coupon-input/coupon-input.wxml
pages/pay/coupon-detail/coupon-detail.wxss
View file @
7cc3f14a
.container {
.container {
margin-top: 1
2
0rpx;
margin-top: 1
3
0rpx;
padding-bottom: 196rpx;
padding-bottom: 196rpx;
}
}
.list-wrapper {
.list-wrapper {
...
...
pages/pay/coupon-input/coupon-input.js
View file @
7cc3f14a
const
App
=
getApp
()
Page
({
Page
({
data
:
{
data
:
{
avatarUrl
:
'/pages/mine/home/image/avatar.png'
,
avatarUrl
:
'/pages/mine/home/image/avatar.png'
,
showDialog
:
false
showDialog
:
false
,
showDialogSmg
:
'非本店券码,无法使用'
,
couponCode
:
''
,
},
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
},
},
handleWriteOff
()
{
handleWriteOff
()
{
let
showDialog
=
true
this
.
getVolumeDetails
(
this
.
data
.
couponCode
)
},
//券码输入
bindCouponInput
(
e
)
{
this
.
setData
({
this
.
setData
({
showDialog
couponCode
:
e
.
detail
.
value
})
})
},
},
// 扫码
handleScanCode
()
{
handleScanCode
()
{
let
that
=
this
wx
.
scanCode
({
wx
.
scanCode
({
onlyFromCamera
:
true
,
onlyFromCamera
:
true
,
success
:
(
res
)
=>
{
success
:
(
res
)
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
let
result
=
res
.
result
that
.
getVolumeDetails
(
result
)
}
})
},
getVolumeDetails
(
couponCode
)
{
if
(
!
couponCode
||
couponCode
.
length
==
0
)
{
wx
.
lin
.
showToast
({
image
:
'/image/error.png'
,
title
:
'请输入券码'
,
})
return
}
let
that
=
this
wx
.
lin
.
showToast
({
icon
:
'loading'
,
title
:
'加载中'
,
show
:
true
,
mask
:
true
,
duration
:
1000
*
60
,
})
App
.
wxRequest
({
url
:
'/api/v1/volume/getVolumeDetails'
,
data
:
{
serialNumber
:
couponCode
,
},
success
:
function
(
res
)
{
wx
.
lin
.
hideToast
()
let
couponDetail
=
JSON
.
stringify
(
res
.
data
)
wx
.
navigateTo
({
url
:
'/pages/pay/coupon-detail/coupon-detail?couponDetail='
+
couponDetail
,
})
},
fail
:
function
(
err
)
{
wx
.
lin
.
hideToast
()
that
.
setData
({
showDialogSmg
:
err
.
msg
,
showDialog
:
true
})
}
}
})
})
}
}
...
...
pages/pay/coupon-input/coupon-input.wxml
View file @
7cc3f14a
<navigation class="navigation" titleText="券码核销" backIcon="/image/back.png"></navigation>
<navigation class="navigation" titleText="券码核销" backIcon="/image/back.png"></navigation>
<l-toast l-image-class="toast-image"></l-toast>
<view class="container">
<view class="container">
<!-- 头像信息 -->
<!-- 头像信息 -->
<view class="header col align-c">
<view class="header col align-c">
...
@@ -25,12 +25,12 @@
...
@@ -25,12 +25,12 @@
</view>
</view>
<!-- 核销输入框 -->
<!-- 核销输入框 -->
<view class="coupon-input-wrapper row con-b">
<view class="coupon-input-wrapper row con-b">
<input placeholder="请输入券码" placeholder-style="color: #C2C7CF"></input>
<input placeholder="请输入券码" placeholder-style="color: #C2C7CF"
bindinput="bindCouponInput" value="{{couponCode}}"
></input>
<view class="coupon-input-btn" bindtap="handleWriteOff">核销</view>
<view class="coupon-input-btn" bindtap="handleWriteOff">核销</view>
<l-dialog show="{{showDialog}}" l-class="dialog-wrapper" l-title-class="dialog-title" l-confirm-class="dialog-confirm" title="
非本店券码,无法使用
">
<l-dialog show="{{showDialog}}" l-class="dialog-wrapper" l-title-class="dialog-title" l-confirm-class="dialog-confirm" title="
{{showDialogSmg}}
">
<
view class="dialog-content">所属门店:原味舒食</view
>
<
!-- <view class="dialog-content">所属门店:原味舒食</view> --
>
</l-dialog>
</l-dialog>
<
l-toast show="{{true}}" l-image-class="toast-image" l-class="toast-bg" image="/image/success.png" title="核销成功" /
>
<
!-- <l-toast show="{{true}}" l-image-class="toast-image" l-class="toast-bg" image="/image/success.png" title="核销成功" /> --
>
</view>
</view>
<!-- 扫码核销 -->
<!-- 扫码核销 -->
...
...
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