Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
wechatapp.shangjiadao.com
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxuelai
wechatapp.shangjiadao.com
Commits
0ea5d429
Commit
0ea5d429
authored
Sep 02, 2019
by
lvtz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
7a3cdf6b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
36 deletions
+34
-36
index.js
business/pages/pointsexchangerecord/index.js
+19
-24
index.wxml
business/pages/pointsexchangerecord/index.wxml
+15
-12
No files found.
business/pages/pointsexchangerecord/index.js
View file @
0ea5d429
...
...
@@ -25,7 +25,6 @@ Page({
sid
})
this
.
pointsExchangeRecordGet
(
'init'
);
wx
.
hideShareMenu
();
},
onPullDownRefresh
:
function
()
{
this
.
setData
({
...
...
@@ -60,20 +59,15 @@ Page({
}
else
{
if
(
data
.
total
)
{
this
.
setData
({
recordTotal
:
data
.
total
})
this
.
data
.
recordTotal
=
data
.
total
;
}
switch
(
type
)
{
case
'init'
:
//页面进来第一次加载
this
.
setData
({
recordList
:
data
.
list
||
[
]
recordList
:
[
data
.
list
]
},
()
=>
{
if
(
this
.
data
.
recordTotal
>
this
.
data
.
recordList
.
length
)
{
let
page
=
this
.
data
.
page
+
1
;
this
.
setData
({
page
,
})
if
(
this
.
data
.
recordTotal
>
this
.
caculateArrLength
(
this
.
data
.
recordList
))
{
this
.
data
.
page
+=
1
;
}
else
{
// 没有更多了
this
.
setData
({
hasmore
:
false
...
...
@@ -83,13 +77,10 @@ Page({
break
;
case
'down'
:
// 页面下拉刷新
this
.
setData
({
recordList
:
data
.
list
||
[
]
recordList
:
[
data
.
list
]
},
()
=>
{
if
(
this
.
data
.
recordTotal
>
this
.
data
.
recordList
.
length
)
{
let
page
=
this
.
data
.
page
+
1
;
this
.
setData
({
page
,
})
if
(
this
.
data
.
recordTotal
>
this
.
caculateArrLength
(
this
.
data
.
recordList
))
{
this
.
data
.
page
+=
1
;
}
else
{
// 没有更多了
this
.
setData
({
hasmore
:
false
...
...
@@ -102,13 +93,10 @@ Page({
let
list
=
this
.
data
.
recordList
;
let
_list
=
list
.
concat
(
data
.
list
);
this
.
setData
({
recordList
:
_
list
[
`recordList[
${
this
.
data
.
page
-
1
}
]`
]:
data
.
list
},
()
=>
{
if
(
this
.
data
.
recordTotal
>
this
.
data
.
recordList
.
length
)
{
let
page
=
this
.
data
.
page
+
1
;
this
.
setData
({
page
,
})
if
(
this
.
data
.
recordTotal
>
this
.
caculateArrLength
(
this
.
data
.
recordList
))
{
this
.
data
.
page
+=
1
;
}
else
{
// 没有更多了
this
.
setData
({
hasmore
:
false
...
...
@@ -119,7 +107,7 @@ Page({
default
:
break
;
}
if
(
this
.
data
.
recordList
.
length
==
0
)
{
if
(
this
.
caculateArrLength
(
this
.
data
.
recordList
)
==
0
)
{
this
.
setData
({
emptyPage
:
true
})
...
...
@@ -150,5 +138,12 @@ Page({
// that.setData({
// recordList: this.data.recordList
// })
}
},
caculateArrLength
(
array
)
{
let
_length
=
0
;
array
.
forEach
(
ele
=>
{
_length
=
_length
+
ele
.
length
;
})
return
_length
;
},
})
\ No newline at end of file
business/pages/pointsexchangerecord/index.wxml
View file @
0ea5d429
<wxs src="./../../../filter/index.wxs" module="filter" />
<view class="container points-exchange-record">
<view class="record-list" wx:if="{{recordList.length!=0}}">
<view class="record-item" wx:for="{{recordList}}" wx:key="" data-info="{{item}}" bindtap="toCheckRecord">
<image class="item-points-pic" src="{{filter.imagify(item.good.cover)}}" mode="aspectFit|aspectFill|widthFix"></image>
<view class="item-content-box">
<view class="item-top">
<view class="item-title">{{item.good.title}}</view>
<view class="item-points">{{item.price}}积分</view>
<block wx:for="{{recordList}}" wx:for-item="bigitem" wx:key="bigindex" wx:for-index="bigindex">
<view class="record-item" wx:for="{{bigitem}}" wx:key="" data-info="{{item}}" bindtap="toCheckRecord">
<image class="item-points-pic" src="{{filter.imagify(item.good.cover)}}" mode="aspectFit|aspectFill|widthFix"></image>
<view class="item-content-box">
<view class="item-top">
<view class="item-title">{{item.good.title}}</view>
<view class="item-points">{{item.price}}积分</view>
</view>
<view class="item-checkperson">
<view class="checkpeople">兑换人: {{item.nickname}}</view>
<view wx:if="{{item.verify_status==1}}" class="checkstatus">待核销</view>
</view>
<image class="checkstatus-icon" wx:if="{{item.verify_status==2}}" src="{{imageRoot}}2c/mall/hasexchange.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix"></image>
</view>
<view class="item-checkperson">
<view class="checkpeople">兑换人: {{item.nickname}}</view>
<view wx:if="{{item.verify_status==1}}" class="checkstatus">待核销</view>
</view>
<image class="checkstatus-icon" wx:if="{{item.verify_status==2}}" src="{{imageRoot}}2c/mall/hasexchange.png?{{imageVersion}}" mode="aspectFit|aspectFill|widthFix"></image>
</view>
</
view
>
</
block
>
</view>
<empty-content text="暂无兑换记录~" emptyimg="" wx:if="{{recordList.length==0}}"></empty-content>
<view class="has-nomore" wx:if="{{!emptyPage && !hasmore}}">没有更多了</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