xiaoe_mp_npm 0.3.4-t220419 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +1 -0
- package/miniprogram_dist/AliveInvite/LiveRoomVertical/components/friends/friends.js +15 -16
- package/miniprogram_dist/AliveInvite/LiveRoomVertical/components/friends/friends.wxml +1 -1
- package/miniprogram_dist/AliveInvite/LiveRoomVertical/index.js +23 -2
- package/package.json +1 -1
- package/src/AliveInvite/LiveRoomVertical/components/friends/friends.js +15 -16
- package/src/AliveInvite/LiveRoomVertical/components/friends/friends.wxml +1 -1
- package/src/AliveInvite/LiveRoomVertical/index.js +23 -2
package/.gitlab-ci.yml
CHANGED
|
@@ -77,7 +77,7 @@ Component({
|
|
|
77
77
|
this.setData({
|
|
78
78
|
finishedTxt: this.data.finished ? "没有更多了" : "加载中"
|
|
79
79
|
})
|
|
80
|
-
if(this.data.finished){
|
|
80
|
+
if(this.data.finished || this._freshing){
|
|
81
81
|
return
|
|
82
82
|
}
|
|
83
83
|
let onScrolltolower = true
|
|
@@ -122,19 +122,18 @@ Component({
|
|
|
122
122
|
let DATA = res.data;
|
|
123
123
|
if (DATA.code === 0) {
|
|
124
124
|
// 关闭弹窗的时候返回的数据丢弃 // 上拉加载与下拉刷新一起触发时丢弃上拉加载数据
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
if(state !==this.data.componentsState || (this._freshing === true && onScrolltolower) ) {
|
|
126
|
+
return
|
|
127
|
+
}
|
|
128
128
|
var total = DATA.inviteNum
|
|
129
129
|
var finishedTxt = "加载中"
|
|
130
130
|
var finished = false
|
|
131
131
|
this.formatData(DATA.data,onScrolltolower)
|
|
132
132
|
// 下拉加载,且数据返回空
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (this.data.friendList.length >= total || DATA.data.length === 0) {
|
|
133
|
+
if(this._freshing && DATA.data.length === 0){
|
|
134
|
+
finishedTxt = "no-data"
|
|
135
|
+
}
|
|
136
|
+
else if (this.data.friendList.length >= total || DATA.data.length === 0) {
|
|
138
137
|
// 获取到所有数据
|
|
139
138
|
finished = true// 没有更多了
|
|
140
139
|
finishedTxt = "没有更多了"
|
|
@@ -150,7 +149,7 @@ Component({
|
|
|
150
149
|
finished,
|
|
151
150
|
total
|
|
152
151
|
})
|
|
153
|
-
|
|
152
|
+
this._freshing = false
|
|
154
153
|
this.scrolling = false
|
|
155
154
|
} else {
|
|
156
155
|
wx.showToast({
|
|
@@ -169,14 +168,14 @@ Component({
|
|
|
169
168
|
//onScrolltolower代表是上拉加载的标识,网卡的时候有上拉加载与下拉刷新同时请求,上拉加载的数据也push进去的情况。
|
|
170
169
|
let friendList = this.data.friendList
|
|
171
170
|
data.forEach((item,index) => {
|
|
172
|
-
|
|
171
|
+
if (!this._freshing) {
|
|
173
172
|
friendList.push(item)
|
|
174
|
-
|
|
173
|
+
}
|
|
175
174
|
})
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
175
|
+
if (this._freshing && !onScrolltolower) {
|
|
176
|
+
//下拉刷新的时候直接赋值
|
|
177
|
+
friendList = JSON.parse(JSON.stringify(data))
|
|
178
|
+
}
|
|
180
179
|
this.setData({friendList})
|
|
181
180
|
},
|
|
182
181
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/>
|
|
8
8
|
<view class="count-style">邀请的好友{{'('+total+')'}}</view>
|
|
9
9
|
</view>
|
|
10
|
-
<scroll-view scroll-y="true" bindscrolltolower="onScrolltolower" style="height:calc(100vh - 700rpx)">
|
|
10
|
+
<scroll-view scroll-y="true" bindscrolltolower="onScrolltolower" refresher-triggered="{{refreshing}}" bindrefresherrefresh="onLoad" refresher-enabled="{{true}}" style="height:calc(100vh - 700rpx)">
|
|
11
11
|
<view class="friend-list">
|
|
12
12
|
<view
|
|
13
13
|
class="friend-item"
|
|
@@ -53,7 +53,8 @@ Component({
|
|
|
53
53
|
timerTop3: null, // 邀请top3头像定时器
|
|
54
54
|
topHeight: 0,
|
|
55
55
|
rightPosition: 0,
|
|
56
|
-
hasPhoneChin:false
|
|
56
|
+
hasPhoneChin:false,
|
|
57
|
+
isAndroid: true // 判断是否安卓
|
|
57
58
|
},
|
|
58
59
|
ready() {
|
|
59
60
|
},
|
|
@@ -120,6 +121,22 @@ Component({
|
|
|
120
121
|
openRuleDetail() {
|
|
121
122
|
this.triggerEvent('changePosterDisplay',"rulesDialog")
|
|
122
123
|
},
|
|
124
|
+
checkIsAndroid(){
|
|
125
|
+
const that = this
|
|
126
|
+
wx.getSystemInfo({
|
|
127
|
+
success (res) {
|
|
128
|
+
if(res.system.includes('iOS')) {
|
|
129
|
+
that.setData({
|
|
130
|
+
isAndroid: false
|
|
131
|
+
})
|
|
132
|
+
} else if(res.system.includes('Android')){
|
|
133
|
+
that.setData({
|
|
134
|
+
isAndroid: true
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
},
|
|
123
140
|
// 获取排名前三的用户
|
|
124
141
|
getTop3Inviter() {
|
|
125
142
|
if (!this.properties.roomInfo.app_id) {
|
|
@@ -167,7 +184,11 @@ Component({
|
|
|
167
184
|
if (this.data.activityEndType === 1 && !this.data.isLiveOver) {
|
|
168
185
|
flag = true
|
|
169
186
|
} else if (this.data.activityEndType === 2) {
|
|
170
|
-
|
|
187
|
+
this.checkIsAndroid()
|
|
188
|
+
let endTime = new Date(this.data.activityEndTime)
|
|
189
|
+
if(!this.data.isAndroid) {
|
|
190
|
+
endTime = new Date(this.data.activityEndTime.replaceAll('-', '/'))
|
|
191
|
+
}
|
|
171
192
|
flag = Date.now() <= endTime.getTime()
|
|
172
193
|
}
|
|
173
194
|
}
|
package/package.json
CHANGED
|
@@ -77,7 +77,7 @@ Component({
|
|
|
77
77
|
this.setData({
|
|
78
78
|
finishedTxt: this.data.finished ? "没有更多了" : "加载中"
|
|
79
79
|
})
|
|
80
|
-
if(this.data.finished){
|
|
80
|
+
if(this.data.finished || this._freshing){
|
|
81
81
|
return
|
|
82
82
|
}
|
|
83
83
|
let onScrolltolower = true
|
|
@@ -122,19 +122,18 @@ Component({
|
|
|
122
122
|
let DATA = res.data;
|
|
123
123
|
if (DATA.code === 0) {
|
|
124
124
|
// 关闭弹窗的时候返回的数据丢弃 // 上拉加载与下拉刷新一起触发时丢弃上拉加载数据
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
125
|
+
if(state !==this.data.componentsState || (this._freshing === true && onScrolltolower) ) {
|
|
126
|
+
return
|
|
127
|
+
}
|
|
128
128
|
var total = DATA.inviteNum
|
|
129
129
|
var finishedTxt = "加载中"
|
|
130
130
|
var finished = false
|
|
131
131
|
this.formatData(DATA.data,onScrolltolower)
|
|
132
132
|
// 下拉加载,且数据返回空
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (this.data.friendList.length >= total || DATA.data.length === 0) {
|
|
133
|
+
if(this._freshing && DATA.data.length === 0){
|
|
134
|
+
finishedTxt = "no-data"
|
|
135
|
+
}
|
|
136
|
+
else if (this.data.friendList.length >= total || DATA.data.length === 0) {
|
|
138
137
|
// 获取到所有数据
|
|
139
138
|
finished = true// 没有更多了
|
|
140
139
|
finishedTxt = "没有更多了"
|
|
@@ -150,7 +149,7 @@ Component({
|
|
|
150
149
|
finished,
|
|
151
150
|
total
|
|
152
151
|
})
|
|
153
|
-
|
|
152
|
+
this._freshing = false
|
|
154
153
|
this.scrolling = false
|
|
155
154
|
} else {
|
|
156
155
|
wx.showToast({
|
|
@@ -169,14 +168,14 @@ Component({
|
|
|
169
168
|
//onScrolltolower代表是上拉加载的标识,网卡的时候有上拉加载与下拉刷新同时请求,上拉加载的数据也push进去的情况。
|
|
170
169
|
let friendList = this.data.friendList
|
|
171
170
|
data.forEach((item,index) => {
|
|
172
|
-
|
|
171
|
+
if (!this._freshing) {
|
|
173
172
|
friendList.push(item)
|
|
174
|
-
|
|
173
|
+
}
|
|
175
174
|
})
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
175
|
+
if (this._freshing && !onScrolltolower) {
|
|
176
|
+
//下拉刷新的时候直接赋值
|
|
177
|
+
friendList = JSON.parse(JSON.stringify(data))
|
|
178
|
+
}
|
|
180
179
|
this.setData({friendList})
|
|
181
180
|
},
|
|
182
181
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/>
|
|
8
8
|
<view class="count-style">邀请的好友{{'('+total+')'}}</view>
|
|
9
9
|
</view>
|
|
10
|
-
<scroll-view scroll-y="true" bindscrolltolower="onScrolltolower" style="height:calc(100vh - 700rpx)">
|
|
10
|
+
<scroll-view scroll-y="true" bindscrolltolower="onScrolltolower" refresher-triggered="{{refreshing}}" bindrefresherrefresh="onLoad" refresher-enabled="{{true}}" style="height:calc(100vh - 700rpx)">
|
|
11
11
|
<view class="friend-list">
|
|
12
12
|
<view
|
|
13
13
|
class="friend-item"
|
|
@@ -53,7 +53,8 @@ Component({
|
|
|
53
53
|
timerTop3: null, // 邀请top3头像定时器
|
|
54
54
|
topHeight: 0,
|
|
55
55
|
rightPosition: 0,
|
|
56
|
-
hasPhoneChin:false
|
|
56
|
+
hasPhoneChin:false,
|
|
57
|
+
isAndroid: true // 判断是否安卓
|
|
57
58
|
},
|
|
58
59
|
ready() {
|
|
59
60
|
},
|
|
@@ -120,6 +121,22 @@ Component({
|
|
|
120
121
|
openRuleDetail() {
|
|
121
122
|
this.triggerEvent('changePosterDisplay',"rulesDialog")
|
|
122
123
|
},
|
|
124
|
+
checkIsAndroid(){
|
|
125
|
+
const that = this
|
|
126
|
+
wx.getSystemInfo({
|
|
127
|
+
success (res) {
|
|
128
|
+
if(res.system.includes('iOS')) {
|
|
129
|
+
that.setData({
|
|
130
|
+
isAndroid: false
|
|
131
|
+
})
|
|
132
|
+
} else if(res.system.includes('Android')){
|
|
133
|
+
that.setData({
|
|
134
|
+
isAndroid: true
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
})
|
|
139
|
+
},
|
|
123
140
|
// 获取排名前三的用户
|
|
124
141
|
getTop3Inviter() {
|
|
125
142
|
if (!this.properties.roomInfo.app_id) {
|
|
@@ -167,7 +184,11 @@ Component({
|
|
|
167
184
|
if (this.data.activityEndType === 1 && !this.data.isLiveOver) {
|
|
168
185
|
flag = true
|
|
169
186
|
} else if (this.data.activityEndType === 2) {
|
|
170
|
-
|
|
187
|
+
this.checkIsAndroid()
|
|
188
|
+
let endTime = new Date(this.data.activityEndTime)
|
|
189
|
+
if(!this.data.isAndroid) {
|
|
190
|
+
endTime = new Date(this.data.activityEndTime.replaceAll('-', '/'))
|
|
191
|
+
}
|
|
171
192
|
flag = Date.now() <= endTime.getTime()
|
|
172
193
|
}
|
|
173
194
|
}
|