Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
0cdb3cd9
Commit
0cdb3cd9
authored
Aug 22, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add: 退款加减
parent
2edf8c70
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
5 deletions
+65
-5
refund.js
src/pages/refund/refund.js
+62
-0
refund.wxml
src/pages/refund/refund.wxml
+3
-5
No files found.
src/pages/refund/refund.js
View file @
0cdb3cd9
...
...
@@ -161,6 +161,68 @@ wxService.page({
curType
:
this
.
data
.
resonType
[
event
.
detail
.
value
]
})
},
minusNum
:
function
(
e
)
{
// 减少数量
var
cartList
=
this
.
data
.
cartList
var
index
=
e
.
currentTarget
.
dataset
.
index
let
proNum
=
cartList
[
index
].
count
console
.
log
(
'减少数量'
,
proNum
)
if
(
proNum
>
1
)
{
proNum
--
}
else
{
wx
.
showToast
({
title
:
'数量不能为0'
,
icon
:
'none'
})
return
false
}
cartList
[
index
].
count
=
proNum
this
.
setData
({
cartList
:
cartList
},
()
=>
{
// this.getReturnPrice()
// this.editOk(cartList[e]) //调用完成
})
},
addNum
:
function
(
e
)
{
// 增加数量
var
index
=
e
.
currentTarget
.
dataset
.
index
var
cartList
=
this
.
data
.
cartList
var
proNum
=
cartList
[
index
].
count
console
.
log
(
'增加数量'
,
proNum
)
proNum
++
cartList
[
index
].
count
=
proNum
this
.
setData
({
cartList
:
cartList
},
()
=>
{
})
},
inputNum
:
function
(
e
)
{
// 输入数量
var
newNum
=
e
.
detail
.
value
var
order
=
this
.
data
.
cartList
var
index
=
e
.
currentTarget
.
dataset
.
index
var
refundNum
=
order
[
index
].
count
console
.
log
(
'inputNum'
,
index
,
newNum
,
refundNum
)
if
(
newNum
===
''
||
newNum
===
'0'
)
{
newNum
=
1
}
else
{
newNum
=
parseInt
(
newNum
)
if
(
newNum
>
refundNum
)
{
newNum
=
refundNum
}
}
order
[
index
].
count
=
refundNum
this
.
setData
({
order
:
order
},
()
=>
{
// this.getReturnPrice()
})
},
/**
* 生命周期函数--监听页面加载
*/
...
...
src/pages/refund/refund.wxml
View file @
0cdb3cd9
...
...
@@ -21,17 +21,15 @@
<view class="pro-price">
<view class="price">¥ {{item.price}}</view>
<view class="pro-num-edit">
<button class="redus-num" data-index="{{
j
}}" catchtap="minusNum">-</button>
<button class="redus-num" data-index="{{
index
}}" catchtap="minusNum">-</button>
<input
class="pro-num-edit-input"
type="number"
data-index="{{j}}"
catchtap
bindblur="blurNum"
data-index="{{index}}"
bindinput="inputNum"
value="{{item.count}}"
/>
<button class="add-num" data-index="{{
j
}}" catchtap="addNum">+</button>
<button class="add-num" data-index="{{
index
}}" catchtap="addNum">+</button>
</view>
</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