Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
4aa3f204
Commit
4aa3f204
authored
May 18, 2018
by
Junling Bu
Browse files
fix[litemall-wx]: 用户足迹删除不成功。
parent
d97bb18c
Changes
2
Hide whitespace changes
Inline
Side-by-side
litemall-wx/pages/ucenter/footprint/footprint.js
View file @
4aa3f204
...
@@ -41,7 +41,9 @@ Page({
...
@@ -41,7 +41,9 @@ Page({
},
},
deleteItem
(
event
){
deleteItem
(
event
){
let
that
=
this
;
let
that
=
this
;
let
footprint
=
event
.
currentTarget
.
dataset
.
footprint
;
let
index
=
event
.
currentTarget
.
dataset
.
index
;
let
iindex
=
event
.
currentTarget
.
dataset
.
iindex
;
let
goodsId
=
this
.
data
.
footprintList
[
index
][
iindex
].
id
;
var
touchTime
=
that
.
data
.
touchEnd
-
that
.
data
.
touchStart
;
var
touchTime
=
that
.
data
.
touchEnd
-
that
.
data
.
touchStart
;
console
.
log
(
touchTime
);
console
.
log
(
touchTime
);
//如果按下时间大于350为长按
//如果按下时间大于350为长按
...
@@ -51,15 +53,20 @@ Page({
...
@@ -51,15 +53,20 @@ Page({
content
:
'
要删除所选足迹?
'
,
content
:
'
要删除所选足迹?
'
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
if
(
res
.
confirm
)
{
util
.
request
(
api
.
FootprintDelete
,
{
footprintId
:
f
oo
tprint
.
i
d
},
'
POST
'
).
then
(
function
(
res
)
{
util
.
request
(
api
.
FootprintDelete
,
{
footprintId
:
g
oo
dsI
d
},
'
POST
'
).
then
(
function
(
res
)
{
if
(
res
.
errno
===
0
)
{
if
(
res
.
errno
===
0
)
{
wx
.
showToast
({
wx
.
showToast
({
title
:
'
删除成功
'
,
title
:
'
删除成功
'
,
icon
:
'
success
'
,
icon
:
'
success
'
,
duration
:
2000
duration
:
2000
});
});
that
.
data
.
footprintList
=
[];
that
.
data
.
footprintList
[
index
].
splice
(
iindex
,
1
)
that
.
getFootprintList
();
if
(
that
.
data
.
footprintList
[
index
].
length
==
0
){
that
.
data
.
footprintList
.
splice
(
index
,
1
)
}
that
.
setData
({
footprintList
:
that
.
data
.
footprintList
});
}
}
});
});
}
}
...
@@ -67,7 +74,7 @@ Page({
...
@@ -67,7 +74,7 @@ Page({
});
});
}
else
{
}
else
{
wx
.
navigateTo
({
wx
.
navigateTo
({
url
:
'
/pages/goods/goods?id=
'
+
footprint
.
goodsId
,
url
:
'
/pages/goods/goods?id=
'
+
goodsId
,
});
});
}
}
...
...
litemall-wx/pages/ucenter/footprint/footprint.wxml
View file @
4aa3f204
...
@@ -6,10 +6,10 @@
...
@@ -6,10 +6,10 @@
</view>
</view>
</view>
</view>
<view class="footprint" wx:if="{{footprintList.length > 0}}">
<view class="footprint" wx:if="{{footprintList.length > 0}}">
<view class="day-item" wx:for="{{footprintList}}" wx:key="*this">
<view class="day-item" wx:for="{{footprintList}}" wx:key="*this"
wx:for-index="index"
>
<view class="day-hd" wx:if="{{item.length > 0}}">{{item[0].addTime}}</view>
<view class="day-hd" wx:if="{{item.length > 0}}">{{item[0].addTime}}</view>
<view class="day-list" wx:if="{{item.length > 0}}">
<view class="day-list" wx:if="{{item.length > 0}}">
<view class="item" data-
footprint
="{{ii
tem
}}" bindtouchstart="touchStart" bindtouchend="touchEnd" bindtap="deleteItem" wx:for="{{item}}" wx:for-item="iitem" wx:key="id">
<view class="item" data-
index="{{index}}" data-iindex
="{{ii
ndex
}}" bindtouchstart="touchStart" bindtouchend="touchEnd" bindtap="deleteItem" wx:for="{{item}}"
wx:for-index="iindex"
wx:for-item="iitem" wx:key="id">
<image class="img" src="{{iitem.listPicUrl}}"></image>
<image class="img" src="{{iitem.listPicUrl}}"></image>
<view class="info">
<view class="info">
<view class="name">{{iitem.name}}</view>
<view class="name">{{iitem.name}}</view>
...
...
Write
Preview
Supports
Markdown
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