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 CHANGED
@@ -4,6 +4,7 @@ build_test:
4
4
  only:
5
5
  - dev
6
6
  - feature/live_marketing_iteration
7
+ - feature/remove-error-report
7
8
  - fix/record-lottery
8
9
  tags:
9
10
  - fe-group-prod-runner-2
@@ -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
- // if(state !==this.data.componentsState) {
126
- // return
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
- // if(this._freshing && DATA.data.length === 0){
134
- // finishedTxt = "no-data"
135
- // }
136
- // else
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
- // this._freshing = false
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
- // if (!this._freshing) {
171
+ if (!this._freshing) {
173
172
  friendList.push(item)
174
- // }
173
+ }
175
174
  })
176
- // if (this._freshing && !onScrolltolower) {
177
- // //下拉刷新的时候直接赋值
178
- // friendList = JSON.parse(JSON.stringify(data))
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
- const endTime = new Date(this.data.activityEndTime)
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xiaoe_mp_npm",
3
- "version": "0.3.4-t220419",
3
+ "version": "0.3.4",
4
4
  "description": "",
5
5
  "main": "miniprogram_dist/index.js",
6
6
  "scripts": {
@@ -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
- // if(state !==this.data.componentsState) {
126
- // return
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
- // if(this._freshing && DATA.data.length === 0){
134
- // finishedTxt = "no-data"
135
- // }
136
- // else
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
- // this._freshing = false
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
- // if (!this._freshing) {
171
+ if (!this._freshing) {
173
172
  friendList.push(item)
174
- // }
173
+ }
175
174
  })
176
- // if (this._freshing && !onScrolltolower) {
177
- // //下拉刷新的时候直接赋值
178
- // friendList = JSON.parse(JSON.stringify(data))
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
- const endTime = new Date(this.data.activityEndTime)
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
  }