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
643a6d9d
authored
Sep 16, 2020
by
TengFengLian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
券码核销
parent
0b5a6663
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
145 additions
and
83 deletions
app.js
pages/pay/coupon-detail/coupon-detail.js
pages/pay/coupon-detail/coupon-detail.wxml
pages/pay/coupon-detail/coupon-detail.wxss
pages/pay/coupon-input/coupon-input.js
app.js
View file @
643a6d9d
...
@@ -61,8 +61,8 @@ App({
...
@@ -61,8 +61,8 @@ App({
// console.log("返回:", res);
// console.log("返回:", res);
let
code
=
res
.
data
.
code
*
1
;
let
code
=
res
.
data
.
code
*
1
;
if
(
200
==
code
)
{
//
if (200 == code) {
//
if (200 == code && true == res.data.success) {
if
(
200
==
code
&&
true
==
res
.
data
.
success
)
{
if
(
obj
.
success
)
{
if
(
obj
.
success
)
{
obj
.
success
(
res
.
data
)
obj
.
success
(
res
.
data
)
}
}
...
...
pages/pay/coupon-detail/coupon-detail.js
View file @
643a6d9d
const
App
=
getApp
()
Page
({
Page
({
data
:
{
data
:
{
orderType
:
1
,
// 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影
orderType
:
1
,
// 1 - 年卡/月卡,2 - 次票, 3 - SPA, 4 - 文创, 5 - 餐品, 6 - 活动, 7 - 观影
couponInfo
:
{
couponInfo
:
null
,
type
:
'套票'
,
// {
store
:
'儿童营地'
,
// type: '套票',
id
:
'26719921231'
,
// store: '儿童营地',
useTime
:
'2020-11-06'
// id: '26719921231',
},
// useTime: '2020-11-06'
goodsList
:
[
// },
{
goodsList
:
null
,
id
:
0
,
// [
cover
:
''
,
// {
name
:
'咖喱蔬菜大虾'
,
// id: 0,
quantity
:
'2'
,
// cover: '',
price
:
'30.60'
// name: '咖喱蔬菜大虾',
},
// quantity: '2',
{
// price: '30.60'
id
:
1
,
// },
cover
:
''
,
// {
name
:
'南瓜坚果汤'
,
// id: 1,
quantity
:
'3'
,
// cover: '',
price
:
'30.60'
// name: '南瓜坚果汤',
},
// quantity: '3',
],
// price: '30.60'
orderInfo
:
{
// },
name
:
'林有一'
,
// ],
phone
:
'15802035122'
,
userList
:
null
,
idNum
:
'350600366462131'
,
orderInfo
:
null
,
}
// {
// name: '林有一',
// phone: '15802035122',
// idNum: '350600366462131',
// },
remarks
:
null
,
// 备注
couponDetail
:
null
,
},
},
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
console
.
log
(
options
)
console
.
log
(
options
)
if
(
options
.
type
)
options
.
type
=
Number
(
options
.
type
)
// if (options.type) options.type = Number(options.type)
let
orderType
=
options
.
type
// let orderType = options.type
this
.
setData
({
// this.setData({
orderType
// orderType
})
// })
this
.
setView
()
// this.setView()
},
if
(
options
.
couponDetail
)
{
setView
()
{
let
data
=
JSON
.
parse
(
options
.
couponDetail
)
let
orderType
=
this
.
data
.
orderType
let
tmpGoodsList
=
[];
switch
(
orderType
)
{
data
.
smOrderDetails
.
forEach
(
item
=>
{
case
4
:
var
tmpItem
=
{
this
.
setData
({
id
:
item
.
commodityId
,
goodsList
:
[
cover
:
item
.
imgUrl
,
{
name
:
item
.
name
,
cover
:
''
,
quantity
:
item
.
number
,
name
:
'《海错图》超级豪华精致古风限量版折扇'
,
price
:
item
.
totalPrices
,
quantity
:
'1'
,
}
price
:
'30.60'
tmpGoodsList
.
push
(
tmpItem
)
}
})
],
let
tmpUserList
=
[];
note
:
'身份证号变更为350600366462132'
data
.
smPersonalDetails
.
forEach
(
item
=>
{
})
var
tmpItem
=
{
break
name
:
item
.
name
,
case
5
:
phone
:
item
.
cellPhone
,
break
idNum
:
item
.
identityCard
,
}
tmpUserList
.
push
(
tmpItem
)
})
this
.
setData
({
[
'couponInfo.type'
]:
data
.
goodType
,
[
'couponInfo.store'
]:
data
.
officeName
,
[
'couponInfo.id'
]:
data
.
serialNumber
,
[
'couponInfo.useTime'
]:
data
.
expireTime
,
goodsList
:
tmpGoodsList
,
userList
:
tmpUserList
,
remarks
:
data
.
remarks
,
couponDetail
:
data
,
})
}
}
},
},
// 取消核销
cancelOperation
()
{
wx
.
navigateBack
()
},
// 确认核销'
submitOperation
()
{
let
that
=
this
wx
.
lin
.
showDialog
({
type
:
"confirm"
,
title
:
""
,
content
:
"是否确认核销券码"
,
success
:
(
res
)
=>
{
if
(
res
.
confirm
)
{
console
.
log
(
'用户点击确定'
)
that
.
doVolume
()
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
)
}
}
})
},
doVolume
()
{
let
that
=
this
wx
.
lin
.
showToast
({
icon
:
'loading'
,
title
:
'正在核销'
,
show
:
true
,
mask
:
true
,
duration
:
1000
*
60
,
})
App
.
wxRequest
({
url
:
'/api/v1/volume/doVolume'
,
data
:
{
volumeId
:
that
.
data
.
couponDetail
.
volumeId
,
},
success
:
function
(
res
)
{
wx
.
lin
.
showToast
({
image
:
'/image/success.png'
,
title
:
'核销成功'
,
})
setTimeout
(()
=>
{
wx
.
navigateBack
()
},
2000
);
},
fail
:
function
(
err
)
{
wx
.
lin
.
showToast
({
image
:
'/image/error.png'
,
title
:
err
.
msg
,
})
}
})
}
})
})
\ No newline at end of file
pages/pay/coupon-detail/coupon-detail.wxml
View file @
643a6d9d
<navigation class="navigation" titleText="券码核销" background="#ffffff" backIcon="/image/back.png"></navigation>
<navigation class="navigation" titleText="券码核销" background="#ffffff" backIcon="/image/back.png"></navigation>
<l-dialog />
<l-toast l-image-class="toast-image"></l-toast>
<view class="container">
<view class="container">
<view class="list-wrapper">
<view class="list-wrapper">
<view class="title-wrapper">兑换券信息</view>
<view class="title-wrapper">兑换券信息</view>
...
@@ -25,7 +26,7 @@
...
@@ -25,7 +26,7 @@
<view class="goods-list">
<view class="goods-list">
<view class="goods-item row align-c" wx:for="{{goodsList}}" wx:key="id">
<view class="goods-item row align-c" wx:for="{{goodsList}}" wx:key="id">
<view class="goods-img">
<view class="goods-img">
<image mode="
widthFix
" src="{{item.cover}}"></image>
<image mode="
aspectFill
" src="{{item.cover}}"></image>
</view>
</view>
<view class="goods-name">{{item.name}}</view>
<view class="goods-name">{{item.name}}</view>
<view class="goods-price-num col">
<view class="goods-price-num col">
...
@@ -38,47 +39,32 @@
...
@@ -38,47 +39,32 @@
</view>
</view>
</view>
</view>
</view>
</view>
<view class="list-wrapper">
<view class="list-wrapper"
wx:for="{{userList}}" wx:key="index"
>
<view class="title-wrapper">订单详情</view>
<view class="title-wrapper">订单详情</view>
<view class="info-wrapper row con-b">
<view class="info-wrapper row con-b">
<view class="info-name">姓名</view>
<view class="info-name">姓名</view>
<view class="info-text">{{
orderInfo
.name}}</view>
<view class="info-text">{{
item
.name}}</view>
</view>
</view>
<view class="info-wrapper row con-b">
<view class="info-wrapper row con-b"
wx:if="{{item.phone}}"
>
<view class="info-name">手机</view>
<view class="info-name">手机</view>
<view class="info-text">{{orderInfo.phone}}</view>
<view class="info-text">{{item.phone}}</view>
</view>
<view class="info-wrapper row con-b">
<view class="info-name">身份证</view>
<view class="info-text">{{orderInfo.idNum}}</view>
</view>
</view>
</view>
<view class="info-wrapper row con-b" wx:if="{{item.idNum}}">
<view class="list-wrapper">
<view class="title-wrapper">订单详情</view>
<view class="info-wrapper row con-b">
<view class="info-name">姓名</view>
<view class="info-text">{{orderInfo.name}}</view>
</view>
<view class="info-wrapper row con-b">
<view class="info-name">手机</view>
<view class="info-text">{{orderInfo.phone}}</view>
</view>
<view class="info-wrapper row con-b">
<view class="info-name">身份证</view>
<view class="info-name">身份证</view>
<view class="info-text">{{
orderInfo
.idNum}}</view>
<view class="info-text">{{
item
.idNum}}</view>
</view>
</view>
</view>
</view>
<view class="list-wrapper" wx:if="{{
note
}}">
<view class="list-wrapper" wx:if="{{
remarks
}}">
<view class="title-wrapper">备注</view>
<view class="title-wrapper">备注</view>
<view class="info-wrapper row con-b">
<view class="info-wrapper row con-b">
<view class="info-name">{{
note
}}</view>
<view class="info-name">{{
remarks
}}</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="footer-wrapper">
<view class="footer-wrapper">
<view class="footer-btn row con-b align-e">
<view class="footer-btn row con-b align-e">
<view class="cancel-btn">取消核销</view>
<view class="cancel-btn"
bindtap="cancelOperation"
>取消核销</view>
<view class="confirm-btn">确认核销</view>
<view class="confirm-btn"
bindtap="submitOperation"
>确认核销</view>
</view>
</view>
<Blank></Blank>
<Blank></Blank>
</view>
</view>
pages/pay/coupon-detail/coupon-detail.wxss
View file @
643a6d9d
.container {
.container {
margin-top: 1
3
0rpx;
margin-top: 1
5
0rpx;
padding-bottom: 196rpx;
padding-bottom: 196rpx;
}
}
.list-wrapper {
.list-wrapper {
...
...
pages/pay/coupon-input/coupon-input.js
View file @
643a6d9d
...
@@ -43,7 +43,7 @@ Page({
...
@@ -43,7 +43,7 @@ Page({
let
that
=
this
let
that
=
this
wx
.
lin
.
showToast
({
wx
.
lin
.
showToast
({
icon
:
'loading'
,
icon
:
'loading'
,
title
:
'
加载中
'
,
title
:
'
正在识别
'
,
show
:
true
,
show
:
true
,
mask
:
true
,
mask
:
true
,
duration
:
1000
*
60
,
duration
:
1000
*
60
,
...
...
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