xiaoe_mp_npm 1.1.26-test03 → 1.1.26-test05

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.
@@ -65,6 +65,8 @@ Component({
65
65
  this.setData({
66
66
  show: newVal,
67
67
  refreshing: newVal,
68
+ refreshBtnStatus: false,
69
+ refreshHandleStatus: false,
68
70
  })
69
71
  newVal && this.data.explainingGoods?.resource_id && this.getExplainingGoodsInfo()
70
72
  newVal && !this.data.isLottery && this.getPreferentialPriceSetting() // 抽奖弹窗不调优惠券接口
@@ -230,6 +232,7 @@ Component({
230
232
  isGoodsTagGroupOn: false, // 商品标签开关
231
233
  tagGroupList: [], // 商品标签列表
232
234
  refreshBtnStatus: false, // 刷新按钮展示状态
235
+ refreshHandleStatus: false, // 刷新按钮点击状态
233
236
  tag_group_id: '0', // 当前选中的商品标签ID
234
237
  popupHeaderStyle: 'border-radius: 24rpx 24rpx 0 0;',
235
238
  contentStyle: "",
@@ -312,8 +315,10 @@ Component({
312
315
  },
313
316
  methods: {
314
317
  handleRefresh() {
315
- this.searchBack()
316
- this.onLoad()
318
+ this.setData({refreshHandleStatus: true}, () => {
319
+ this.searchBack()
320
+ this.onLoad()
321
+ })
317
322
  },
318
323
  handleExplainingGoods(val) {
319
324
  if (!val.id || val.id === -1) {
@@ -932,6 +937,7 @@ Component({
932
937
  finishedTxt,
933
938
  finished,
934
939
  refreshBtnStatus: (page_index === 1 || this.data.page_index === 1) ? false : this.data.refreshBtnStatus,
940
+ refreshHandleStatus: false,
935
941
  total
936
942
  }, () => {
937
943
  this.triggerEvent('getGoodsListLength', {
@@ -85,7 +85,7 @@
85
85
  <view wx:if="{{refreshBtnStatus}}" class="refresh" catch:tap="handleRefresh">
86
86
  <view class="text">商品列表有更新</view>
87
87
  <image
88
- class="icon {{!finished && 'icon-refresh'}}"
88
+ class="icon {{refreshHandleStatus && 'icon-refresh'}}"
89
89
  src="https://commonresource-1252524126.cdn.xiaoeknow.com/image/mjl231wm0vsf.svg"
90
90
  />
91
91
  </view>
@@ -7,7 +7,7 @@
7
7
  * @LastEditTime: 2021-11-18 19:52:02
8
8
  */
9
9
 
10
- import { getGoodsList, requestChangeShow, requestChangePrice, getSearchList, editGoodsOrderSequence } from '../common/api/liveGoodsList'
10
+ import { getGoodsListNew, requestChangeShow, requestChangePrice, getSearchList, editGoodsOrderSequence } from '../common/api/liveGoodsList'
11
11
  import { teaFormatItem } from '../common/utils/liveGoods'
12
12
  const computedBehavior = require('miniprogram-computed').behavior
13
13
 
@@ -65,6 +65,8 @@ Component({
65
65
  observer(newVal) {
66
66
  this.setData({
67
67
  refreshing: newVal,
68
+ refreshBtnStatus: false,
69
+ refreshHandleStatus: false,
68
70
  })
69
71
  console.log(newVal)
70
72
 
@@ -117,7 +119,7 @@ Component({
117
119
  },
118
120
  data: {
119
121
  goodsInfo: [],
120
- page_size: 5,
122
+ page_size: 20,
121
123
  page_index: 1,
122
124
  total: 0,
123
125
  refreshing: false,
@@ -140,6 +142,7 @@ Component({
140
142
  changeStateLoading: false, // 商品状态更改中
141
143
  searchStatus: false, // 是否是搜索状态
142
144
  refreshBtnStatus: false, // 刷新按钮展示状态
145
+ refreshHandleStatus: false, // 刷新按钮点击状态
143
146
  allSearchList: [], // 所有搜索商品列表
144
147
  },
145
148
  lifetimes: {
@@ -157,6 +160,7 @@ Component({
157
160
  handleRefresh() {
158
161
  this.setData({
159
162
  refreshing: true,
163
+ refreshHandleStatus: true
160
164
  }, () => {
161
165
  this.onLoad()
162
166
  })
@@ -289,7 +293,7 @@ Component({
289
293
  if (item.id === goodsInfo[index].id) {
290
294
  // 遍历插入相应的修改值
291
295
  for (let key in item) {
292
- goodsInfo[index][key] = item[key]
296
+ if (item[key] !== null) goodsInfo[index][key] = item[key]
293
297
  }
294
298
  break
295
299
  }
@@ -747,14 +751,16 @@ Component({
747
751
  this.getGoodsList()
748
752
  },
749
753
  getGoodsList() {
754
+ const { app_id, alive_id, user_id } = this.data.aliveInfo
750
755
  let params = {
751
- alive_id: this.data.aliveInfo.alive_id,
752
- type: 1,
756
+ alive_id,
757
+ app_id,
758
+ user_id,
753
759
  page_size: this.data.page_size,
754
760
  page: this.data.page_index,
755
761
  port: 2,
756
762
  }
757
- getGoodsList(params).then((res) => {
763
+ getGoodsListNew(params).then((res) => {
758
764
  let { data, code } = res.data
759
765
  if (code === 0) {
760
766
  var total = data[0] ? data[0].total : this.data.total
@@ -785,6 +791,7 @@ Component({
785
791
  finishedTxt,
786
792
  finished,
787
793
  refreshBtnStatus: this.data.page_index === 1 ? false : this.data.refreshBtnStatus,
794
+ refreshHandleStatus: false,
788
795
  total,
789
796
  is_jurisdiction,
790
797
  })
@@ -1086,7 +1093,7 @@ Component({
1086
1093
  this.triggerEvent('isNullDate')
1087
1094
  this.setData({
1088
1095
  goodsInfo: [],
1089
- page_size: 5,
1096
+ page_size: 20,
1090
1097
  page_index: 1,
1091
1098
  total: 0,
1092
1099
  refreshing: false,
@@ -19,7 +19,7 @@
19
19
  <view wx:if="{{refreshBtnStatus}}" class="refresh" catch:tap="handleRefresh">
20
20
  <view class="text">商品列表有更新</view>
21
21
  <image
22
- class="icon {{refreshing && 'icon-refresh'}}"
22
+ class="icon {{refreshHandleStatus && 'icon-refresh'}}"
23
23
  src="https://commonresource-1252524126.cdn.xiaoeknow.com/image/mjl231wm0vsf.svg"
24
24
  />
25
25
  </view>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xiaoe_mp_npm",
3
- "version": "1.1.26-test03",
3
+ "version": "1.1.26-test05",
4
4
  "description": "",
5
5
  "main": "miniprogram_dist/index.js",
6
6
  "scripts": {
@@ -65,6 +65,8 @@ Component({
65
65
  this.setData({
66
66
  show: newVal,
67
67
  refreshing: newVal,
68
+ refreshBtnStatus: false,
69
+ refreshHandleStatus: false,
68
70
  })
69
71
  newVal && this.data.explainingGoods?.resource_id && this.getExplainingGoodsInfo()
70
72
  newVal && !this.data.isLottery && this.getPreferentialPriceSetting() // 抽奖弹窗不调优惠券接口
@@ -230,6 +232,7 @@ Component({
230
232
  isGoodsTagGroupOn: false, // 商品标签开关
231
233
  tagGroupList: [], // 商品标签列表
232
234
  refreshBtnStatus: false, // 刷新按钮展示状态
235
+ refreshHandleStatus: false, // 刷新按钮点击状态
233
236
  tag_group_id: '0', // 当前选中的商品标签ID
234
237
  popupHeaderStyle: 'border-radius: 24rpx 24rpx 0 0;',
235
238
  contentStyle: "",
@@ -312,8 +315,10 @@ Component({
312
315
  },
313
316
  methods: {
314
317
  handleRefresh() {
315
- this.searchBack()
316
- this.onLoad()
318
+ this.setData({refreshHandleStatus: true}, () => {
319
+ this.searchBack()
320
+ this.onLoad()
321
+ })
317
322
  },
318
323
  handleExplainingGoods(val) {
319
324
  if (!val.id || val.id === -1) {
@@ -932,6 +937,7 @@ Component({
932
937
  finishedTxt,
933
938
  finished,
934
939
  refreshBtnStatus: (page_index === 1 || this.data.page_index === 1) ? false : this.data.refreshBtnStatus,
940
+ refreshHandleStatus: false,
935
941
  total
936
942
  }, () => {
937
943
  this.triggerEvent('getGoodsListLength', {
@@ -85,7 +85,7 @@
85
85
  <view wx:if="{{refreshBtnStatus}}" class="refresh" catch:tap="handleRefresh">
86
86
  <view class="text">商品列表有更新</view>
87
87
  <image
88
- class="icon {{!finished && 'icon-refresh'}}"
88
+ class="icon {{refreshHandleStatus && 'icon-refresh'}}"
89
89
  src="https://commonresource-1252524126.cdn.xiaoeknow.com/image/mjl231wm0vsf.svg"
90
90
  />
91
91
  </view>
@@ -7,7 +7,7 @@
7
7
  * @LastEditTime: 2021-11-18 19:52:02
8
8
  */
9
9
 
10
- import { getGoodsList, requestChangeShow, requestChangePrice, getSearchList, editGoodsOrderSequence } from '../common/api/liveGoodsList'
10
+ import { getGoodsListNew, requestChangeShow, requestChangePrice, getSearchList, editGoodsOrderSequence } from '../common/api/liveGoodsList'
11
11
  import { teaFormatItem } from '../common/utils/liveGoods'
12
12
  const computedBehavior = require('miniprogram-computed').behavior
13
13
 
@@ -65,6 +65,8 @@ Component({
65
65
  observer(newVal) {
66
66
  this.setData({
67
67
  refreshing: newVal,
68
+ refreshBtnStatus: false,
69
+ refreshHandleStatus: false,
68
70
  })
69
71
  console.log(newVal)
70
72
 
@@ -117,7 +119,7 @@ Component({
117
119
  },
118
120
  data: {
119
121
  goodsInfo: [],
120
- page_size: 5,
122
+ page_size: 20,
121
123
  page_index: 1,
122
124
  total: 0,
123
125
  refreshing: false,
@@ -140,6 +142,7 @@ Component({
140
142
  changeStateLoading: false, // 商品状态更改中
141
143
  searchStatus: false, // 是否是搜索状态
142
144
  refreshBtnStatus: false, // 刷新按钮展示状态
145
+ refreshHandleStatus: false, // 刷新按钮点击状态
143
146
  allSearchList: [], // 所有搜索商品列表
144
147
  },
145
148
  lifetimes: {
@@ -157,6 +160,7 @@ Component({
157
160
  handleRefresh() {
158
161
  this.setData({
159
162
  refreshing: true,
163
+ refreshHandleStatus: true
160
164
  }, () => {
161
165
  this.onLoad()
162
166
  })
@@ -289,7 +293,7 @@ Component({
289
293
  if (item.id === goodsInfo[index].id) {
290
294
  // 遍历插入相应的修改值
291
295
  for (let key in item) {
292
- goodsInfo[index][key] = item[key]
296
+ if (item[key] !== null) goodsInfo[index][key] = item[key]
293
297
  }
294
298
  break
295
299
  }
@@ -747,14 +751,16 @@ Component({
747
751
  this.getGoodsList()
748
752
  },
749
753
  getGoodsList() {
754
+ const { app_id, alive_id, user_id } = this.data.aliveInfo
750
755
  let params = {
751
- alive_id: this.data.aliveInfo.alive_id,
752
- type: 1,
756
+ alive_id,
757
+ app_id,
758
+ user_id,
753
759
  page_size: this.data.page_size,
754
760
  page: this.data.page_index,
755
761
  port: 2,
756
762
  }
757
- getGoodsList(params).then((res) => {
763
+ getGoodsListNew(params).then((res) => {
758
764
  let { data, code } = res.data
759
765
  if (code === 0) {
760
766
  var total = data[0] ? data[0].total : this.data.total
@@ -785,6 +791,7 @@ Component({
785
791
  finishedTxt,
786
792
  finished,
787
793
  refreshBtnStatus: this.data.page_index === 1 ? false : this.data.refreshBtnStatus,
794
+ refreshHandleStatus: false,
788
795
  total,
789
796
  is_jurisdiction,
790
797
  })
@@ -1086,7 +1093,7 @@ Component({
1086
1093
  this.triggerEvent('isNullDate')
1087
1094
  this.setData({
1088
1095
  goodsInfo: [],
1089
- page_size: 5,
1096
+ page_size: 20,
1090
1097
  page_index: 1,
1091
1098
  total: 0,
1092
1099
  refreshing: false,
@@ -19,7 +19,7 @@
19
19
  <view wx:if="{{refreshBtnStatus}}" class="refresh" catch:tap="handleRefresh">
20
20
  <view class="text">商品列表有更新</view>
21
21
  <image
22
- class="icon {{refreshing && 'icon-refresh'}}"
22
+ class="icon {{refreshHandleStatus && 'icon-refresh'}}"
23
23
  src="https://commonresource-1252524126.cdn.xiaoeknow.com/image/mjl231wm0vsf.svg"
24
24
  />
25
25
  </view>