xiaoe_mp_npm 0.5.42-test29 → 0.5.42-test30

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.
@@ -13,7 +13,7 @@ import {
13
13
  PUNCH_CARD
14
14
  } from "../common/utils/constants.js";
15
15
 
16
- const {utils, sensorLog } = require("live-mp-tools");
16
+ const { utils, sensorLog } = require("live-mp-tools");
17
17
  import { showGoods } from "../common/api/liveGoodsList"
18
18
 
19
19
  const computedBehavior = require('miniprogram-computed').behavior
@@ -60,7 +60,7 @@ Component({
60
60
  let nowTime = new Date().getTime()
61
61
  let preheating = hasPreheat && nowTime > preHeatTime.getTime() && startTime2.getTime() > nowTime
62
62
  let isSeckill = currentActive === '秒杀'
63
- let checked = newVal.is_display_package === 1
63
+ let checked = newVal.is_display_package === 1
64
64
 
65
65
 
66
66
  this.setData({
@@ -128,11 +128,11 @@ Component({
128
128
  type: Boolean,
129
129
  value: false
130
130
  },
131
- style:{
131
+ style: {
132
132
  type: String,
133
133
  value: ''
134
134
  },
135
- index:{
135
+ index: {
136
136
  type: Number,
137
137
  value: -1
138
138
  },
@@ -144,7 +144,11 @@ Component({
144
144
  isManage: {
145
145
  type: Boolean,
146
146
  value: false
147
- }
147
+ },
148
+ sendingGoodId: {
149
+ type: String,
150
+ value: '',
151
+ },
148
152
  },
149
153
 
150
154
  lifetimes: {
@@ -373,19 +377,19 @@ Component({
373
377
  cmm3: isFullScreen ? '全屏' : '非全屏'
374
378
  })
375
379
  // 线下课29课时包42/拼团 --判断权益
376
- if([29,42].indexOf(this.data.goodsItem.resource_type) > -1 || this.data.goodsItem.activity_type === 6){
380
+ if ([29, 42].indexOf(this.data.goodsItem.resource_type) > -1 || this.data.goodsItem.activity_type === 6) {
377
381
  this.judgePermission()
378
382
  return
379
383
  }
380
384
  let params = {
381
- id: this.data.goodsItem.id,
382
- resource_id: this.data.goodsItem.resource_id,
383
- resource_type: this.data.goodsItem.resource_type,
384
- price: this.data.goodsItem.price,
385
- app_id:this.data.aliveInfo.app_id,
386
- user_id:this.data.aliveInfo.user_id,
387
- coupon_id: this.data.goodsItem.coupon_id,
388
- alive_id: this.data.aliveInfo.alive_id
385
+ id: this.data.goodsItem.id,
386
+ resource_id: this.data.goodsItem.resource_id,
387
+ resource_type: this.data.goodsItem.resource_type,
388
+ price: this.data.goodsItem.price,
389
+ app_id: this.data.aliveInfo.app_id,
390
+ user_id: this.data.aliveInfo.user_id,
391
+ coupon_id: this.data.goodsItem.coupon_id,
392
+ alive_id: this.data.aliveInfo.alive_id
389
393
  }
390
394
  const url = this.properties.isGrayMarketing ? snapCheckNew : snapCheck
391
395
  url(params).then(res => {
@@ -451,10 +455,10 @@ Component({
451
455
  console.log("permission", permission)
452
456
  // 有权益的情况下
453
457
  if (permission) {
454
- // 电子书20/班课35 鹅学习不支持,无权益的情况下,内嵌h5, 有权益TOAST提示
458
+ // 电子书20/班课35 鹅学习不支持,无权益的情况下,内嵌h5, 有权益TOAST提示
455
459
  if ([20, 35].indexOf(this.data.goodsItem.resource_type) > -1) {
456
460
  this.showToast('您已拥有该课程,小程序内暂不支持学习此课程')
457
- }else {
461
+ } else {
458
462
  // 弹出提示去小程序学习 有三种可能 -圈子小程序 -小鹅通小程序 -打卡小程序
459
463
  this.showdialog(this.data.goodsItem)
460
464
  }
@@ -467,8 +471,8 @@ Component({
467
471
  return new Promise((resolve, reject) => {
468
472
  let params = {
469
473
  id: this.data.goodsItem.id,
470
- app_id:this.data.aliveInfo.app_id,
471
- user_id:this.data.aliveInfo.user_id,
474
+ app_id: this.data.aliveInfo.app_id,
475
+ user_id: this.data.aliveInfo.user_id,
472
476
  }
473
477
  const url = this.properties.isGrayMarketing ? getUserPermissionNew : getUserPermission
474
478
  url(params).then((res) => {
@@ -601,111 +605,111 @@ Component({
601
605
  })
602
606
  }
603
607
  },
604
- //judgePermission里面 showDialog 外部弹窗调用
605
- toMiniProgram(goodsInfo){
606
- let { aliveInfo, sensorReportParams } = this.properties
607
- sensorLog.sensors.track('click_butt',{
608
- page_id:'e_alive#mini#first#alive_room',
609
- page_name:'直播间页面',
610
- l_program: '鹅直播',
611
- page_path: '鹅直播#小程序#首页#直播间页面',
612
- page_button: "前往",
613
- app_id: aliveInfo.app_id,
614
- c_user_id: aliveInfo.user_id,
615
- union_id: wx.getStorageSync('userInfo').universal_union_id,
616
- current_role: sensorReportParams.current_role,
617
- resource_id: aliveInfo.alive_id,
618
- $url_path: `alive/${aliveInfo.alive_id}`,
619
- type: sensorReportParams.type,
620
- cmm1: sensorReportParams.alive_type,
621
- cmm2: sensorReportParams.version_type,
622
- comm2: sensorReportParams.pay_type
623
- })
624
- let spu_type = goodsInfo.spu_type
625
- switch(spu_type){
626
- case ASSOCIATION:
627
- this.toAssociation(goodsInfo);
628
- break;
629
- case PUNCH_CARD:
630
- this.toPunchCard(goodsInfo);
631
- break;
632
- default:
633
- this.toXiaoeLearn(goodsInfo);
634
- break;
635
- }
636
- },
637
- toXiaoeLearn(goodsInfo){
638
- let { aliveInfo } = this.properties
639
- let h5_url = this.formatUrl(goodsInfo)
640
- var path
641
- // 音频 视频
642
- if(goodsInfo.resource_type === 2 || goodsInfo.resource_type === 3){
643
- path = `/pages/index/authorizePage?user_id=${aliveInfo.user_id}&app_id=${aliveInfo.app_id}&resource_id=${goodsInfo.id}&unique_type=elive`
644
- }else {
645
- // 其他
646
- path = `/pages/index/authorizePage?user_id=${aliveInfo.user_id}&app_id=${aliveInfo.app_id}&h5_url=${h5_url}`
647
- }
648
- let params = {
649
- appId: "wxa3589f1193170aa3",
650
- path,
651
- }
652
- if(this.properties.envName == 'inside' || this.properties.envName == 'test'){ //开发环境 测试环境 加上这个参数可以跳转去鹅学习体验版
653
- params.appId = 'wx9eb4d7b3f2a3e003'
654
- params.envVersion='trial'
655
- }
656
- wx.navigateToMiniProgram(params)
657
- },
658
- toPunchCard(goodsInfo){
659
- let { aliveInfo } = this.properties
660
- let path = `/pages-participate-progress/pages/participate/participate?app_id=${aliveInfo.app_id}&&activity_id=${goodsInfo.resource_id}`
661
- let params = {
662
- appId: "wx839728854b1e23ad", //现网
663
- path,
664
- }
665
- if(this.properties.envName == 'inside'){ //开发环境
666
- params.appId = 'wx802f346b1c7dcdd9'
667
- }else if(this.properties.envName == 'test'){ // 测试环境
668
- params.appId = 'wx778bc88236be97d9'
669
- }
670
- wx.navigateToMiniProgram(params)
671
- },
672
- toAssociation(goodsInfo){
673
- let { aliveInfo } = this.properties
674
- let path = `/pages-community/pages/home/index?appId=${aliveInfo.app_id}&&communityId=${goodsInfo.resource_id}`
675
- let params = {
676
- appId: "wxd0ad7e76d51ae4cc",
677
- path,
678
- }
679
- if(this.properties.envName == 'inside'){
680
- params.appId = 'wx52419e90dc6dd535' //开发环境
681
- }else if(this.properties.envName == 'test'){ //测试环境
682
- params.appId = 'wxb245d452213c48c9' //测试环境
683
- }
684
- wx.navigateToMiniProgram(params)
685
- },
686
- sendGoodsCard(e) {
687
- let dataset = e.currentTarget.dataset;
688
- // 触发父组件的send
689
- this.triggerEvent('sendGoodsCard', {
690
- datas: dataset
691
- });
692
- },
693
- changeShowType(){
694
- if(this.data.goodsItem.teacher_auth != 2){
695
- this.showToast('暂无权限')
696
- return
697
- }
698
- this.setData({
699
- switchLoading: true
700
- })
608
+ //judgePermission里面 showDialog 外部弹窗调用
609
+ toMiniProgram(goodsInfo) {
610
+ let { aliveInfo, sensorReportParams } = this.properties
611
+ sensorLog.sensors.track('click_butt', {
612
+ page_id: 'e_alive#mini#first#alive_room',
613
+ page_name: '直播间页面',
614
+ l_program: '鹅直播',
615
+ page_path: '鹅直播#小程序#首页#直播间页面',
616
+ page_button: "前往",
617
+ app_id: aliveInfo.app_id,
618
+ c_user_id: aliveInfo.user_id,
619
+ union_id: wx.getStorageSync('userInfo').universal_union_id,
620
+ current_role: sensorReportParams.current_role,
621
+ resource_id: aliveInfo.alive_id,
622
+ $url_path: `alive/${aliveInfo.alive_id}`,
623
+ type: sensorReportParams.type,
624
+ cmm1: sensorReportParams.alive_type,
625
+ cmm2: sensorReportParams.version_type,
626
+ comm2: sensorReportParams.pay_type
627
+ })
628
+ let spu_type = goodsInfo.spu_type
629
+ switch (spu_type) {
630
+ case ASSOCIATION:
631
+ this.toAssociation(goodsInfo);
632
+ break;
633
+ case PUNCH_CARD:
634
+ this.toPunchCard(goodsInfo);
635
+ break;
636
+ default:
637
+ this.toXiaoeLearn(goodsInfo);
638
+ break;
639
+ }
640
+ },
641
+ toXiaoeLearn(goodsInfo) {
642
+ let { aliveInfo } = this.properties
643
+ let h5_url = this.formatUrl(goodsInfo)
644
+ var path
645
+ // 音频 视频
646
+ if (goodsInfo.resource_type === 2 || goodsInfo.resource_type === 3) {
647
+ path = `/pages/index/authorizePage?user_id=${aliveInfo.user_id}&app_id=${aliveInfo.app_id}&resource_id=${goodsInfo.id}&unique_type=elive`
648
+ } else {
649
+ // 其他
650
+ path = `/pages/index/authorizePage?user_id=${aliveInfo.user_id}&app_id=${aliveInfo.app_id}&h5_url=${h5_url}`
651
+ }
652
+ let params = {
653
+ appId: "wxa3589f1193170aa3",
654
+ path,
655
+ }
656
+ if (this.properties.envName == 'inside' || this.properties.envName == 'test') { //开发环境 测试环境 加上这个参数可以跳转去鹅学习体验版
657
+ params.appId = 'wx9eb4d7b3f2a3e003'
658
+ params.envVersion = 'trial'
659
+ }
660
+ wx.navigateToMiniProgram(params)
661
+ },
662
+ toPunchCard(goodsInfo) {
663
+ let { aliveInfo } = this.properties
664
+ let path = `/pages-participate-progress/pages/participate/participate?app_id=${aliveInfo.app_id}&&activity_id=${goodsInfo.resource_id}`
665
+ let params = {
666
+ appId: "wx839728854b1e23ad", //现网
667
+ path,
668
+ }
669
+ if (this.properties.envName == 'inside') { //开发环境
670
+ params.appId = 'wx802f346b1c7dcdd9'
671
+ } else if (this.properties.envName == 'test') { // 测试环境
672
+ params.appId = 'wx778bc88236be97d9'
673
+ }
674
+ wx.navigateToMiniProgram(params)
675
+ },
676
+ toAssociation(goodsInfo) {
677
+ let { aliveInfo } = this.properties
678
+ let path = `/pages-community/pages/home/index?appId=${aliveInfo.app_id}&&communityId=${goodsInfo.resource_id}`
679
+ let params = {
680
+ appId: "wxd0ad7e76d51ae4cc",
681
+ path,
682
+ }
683
+ if (this.properties.envName == 'inside') {
684
+ params.appId = 'wx52419e90dc6dd535' //开发环境
685
+ } else if (this.properties.envName == 'test') { //测试环境
686
+ params.appId = 'wxb245d452213c48c9' //测试环境
687
+ }
688
+ wx.navigateToMiniProgram(params)
689
+ },
690
+ sendGoodsCard(e) {
691
+ let dataset = e.currentTarget.dataset;
692
+ // 触发父组件的send
693
+ this.triggerEvent('sendGoodsCard', {
694
+ datas: dataset
695
+ });
696
+ },
697
+ changeShowType() {
698
+ if (this.data.goodsItem.teacher_auth != 2) {
699
+ this.showToast('暂无权限')
700
+ return
701
+ }
702
+ this.setData({
703
+ switchLoading: true
704
+ })
701
705
  let params = {
702
706
  alive_id: this.properties.aliveInfo.alive_id,
703
707
  app_id: this.properties.aliveInfo.app_id,
704
708
  resource_id: this.data.goodsItem.id,
705
709
  is_display_package: this.data.checked ? 0 : 1
706
710
  };
707
- showGoods(params).then( (res) => {
708
- console.log(res,"resres")
711
+ showGoods(params).then((res) => {
712
+ console.log(res, "resres")
709
713
  let { code } = res.data
710
714
  if (code === 0) {
711
715
  this.setData({
@@ -713,7 +717,7 @@ Component({
713
717
  checked: !this.data.checked
714
718
  })
715
719
  this.showToast('操作成功')
716
- }else{
720
+ } else {
717
721
  this.setData({
718
722
  switchLoading: false
719
723
  })
@@ -70,6 +70,84 @@ $deviceWidth: 750;
70
70
  background: rgba(0,0,0,0.25) !important;
71
71
  backdrop-filter: blur(vmin(24));
72
72
  }
73
+ .goods-explaining {
74
+ position: absolute;
75
+ bottom: 0;
76
+ left: 0;
77
+ display: flex;
78
+ justify-content: center;
79
+ align-items: center;
80
+ height: vmin(40);
81
+ width: 29.9vmin;
82
+ border-bottom-right-radius: 2.13vmin;
83
+ border-bottom-left-radius: 2.13vmin;
84
+ &::before {
85
+ content: '';
86
+ position: absolute;
87
+ background: rgba(0, 0, 0, 0.2);
88
+ backdrop-filter: blur(0.22rem);
89
+ left: 0;
90
+ bottom: 0;
91
+ width: 100%;
92
+ height: vmin(40);
93
+ border-bottom-right-radius: 2.13vmin;
94
+ border-bottom-left-radius: 2.13vmin;
95
+ }
96
+ .loadingWrapper {
97
+ position: relative;
98
+ display: flex;
99
+ justify-content: center;
100
+ align-items: center;
101
+ height: vmin(21.6);
102
+ width: vmin(36);
103
+ background-repeat: no-repeat;
104
+ background-size: cover;
105
+ margin-right: 0.08rem;
106
+ .loading {
107
+ background-color: white;
108
+ height: vmin(21.6);
109
+ width: vmin(4);
110
+ border-radius: vmin(8);
111
+ transform-origin: top;
112
+ transform: translateZ(0);
113
+ -webkit-transform: translateZ(0);
114
+ position: absolute;
115
+ bottom: 0;
116
+ &:nth-child(1) {
117
+ left: 0;
118
+ animation: 0.9s ease-in-out 0.15s loading-run infinite;
119
+ }
120
+ &:nth-child(2) {
121
+ left: vmin(10);
122
+ animation: 0.9s ease-in-out 0.25s loading-run infinite;
123
+ }
124
+ &:nth-child(3) {
125
+ left: vmin(20);
126
+ animation: 0.9s ease-in-out 0.35s loading-run infinite;
127
+ }
128
+ &:nth-child(4) {
129
+ left: vmin(30);
130
+ animation: 0.9s ease-in-out 0.45s loading-run infinite;
131
+ }
132
+ }
133
+ @keyframes loading-run {
134
+ 0%,
135
+ 40%,
136
+ 100% {
137
+ height: vmin(10.8);
138
+ }
139
+ 25% {
140
+ height: vmin(21.6);
141
+ }
142
+ }
143
+ }
144
+ .text {
145
+ font-size: vmin(24);
146
+ color: #ffffff;
147
+ position: relative;
148
+ margin-left: vmin(8);
149
+ }
150
+ }
73
151
  .is-over {
74
152
  border-radius: vmin(10.67) vmin(10.67) 0 0;
75
153
  position: absolute;
@@ -437,4 +515,4 @@ $deviceWidth: 750;
437
515
  .goods-item {
438
516
  @include goods-item;
439
517
  }
440
- }
518
+ }
@@ -24,6 +24,13 @@
24
24
  class="goods-explaining"
25
25
  src="../../common/assets/images/liveGoodsList/explaining.png"
26
26
  />
27
+ <!-- 讲解中 -->
28
+ <view class="goods-explaining" wx:if="{{sendingGoodId === goodsItem.id}}">
29
+ <view class="loadingWrapper">
30
+ <view class="loading" wx:for="{{4}}" wx:key="i"></view>
31
+ </view>
32
+ <view class="text">讲解中</view>
33
+ </view>
27
34
  <view class="is-over" wx:if="{{isOver}}">- 已抢光 -</view>
28
35
  </view>
29
36
  <view class="right {{isManage?'manage-right':''}}">
@@ -144,12 +151,15 @@
144
151
  data-item="{{goodsItem}}"
145
152
  data-type="10"
146
153
  data-index="{{index}}"
154
+ data-id="{{goodsItem.id}}"
155
+ data-isExplain="{{sendingGoodId === goodsItem.id}}"
147
156
  >
148
157
  <image
149
158
  wx:if="{{sending}}"
150
159
  class="load"
151
160
  src="https://commonresource-1252524126.cdn.xiaoeknow.com/image/lik3ojn20167.png"
152
- />讲解
161
+ />
162
+ {{ sendingGoodId === goodsItem.id ? '结束讲解' : '讲解' }}
153
163
  </view>
154
164
  </block>
155
165
  <!-- 购买按钮 end -->
@@ -78,7 +78,7 @@ Component({
78
78
  console.log(newVal)
79
79
 
80
80
  newVal && this.onLoad()
81
- if(!newVal){
81
+ if (!newVal) {
82
82
  clearInterval(activityCountdownTimer)
83
83
  activityCountdownTimer = null
84
84
  clearInterval(preheatTimer)
@@ -109,7 +109,11 @@ Component({
109
109
  isManage: {
110
110
  type: Boolean,
111
111
  value: false,
112
- }
112
+ },
113
+ sendingGoodId: {
114
+ type: String,
115
+ value: '',
116
+ },
113
117
  },
114
118
  data: {
115
119
  goodsInfo: [],
@@ -214,7 +218,7 @@ Component({
214
218
  switch (type) {
215
219
  // 带货和优惠券开关操作
216
220
  case "goodsSwitch":
217
- if ([0, 1].includes(marketInfo)) this.setData({goodsSwitch: marketInfo})
221
+ if ([0, 1].includes(marketInfo)) this.setData({ goodsSwitch: marketInfo })
218
222
  break;
219
223
  case 'goodsConfList':
220
224
  // 如果已经加载完了,可以拼接数据
@@ -310,11 +314,11 @@ Component({
310
314
  })
311
315
  },
312
316
  // 管理商品多选
313
- onChange(e){
317
+ onChange(e) {
314
318
  // this.setData({
315
319
  // selectGoods:e.detail
316
320
  // })
317
- console.log("sage-------onchange",e.detail);
321
+ console.log("sage-------onchange", e.detail);
318
322
  let tempGoodsArr = []
319
323
  e.detail.forEach((item) => {
320
324
  for (let index = 0; index < this.data.goodsInfo.length; index++) {
@@ -367,7 +371,7 @@ Component({
367
371
 
368
372
  // 隐藏商品确认弹窗
369
373
  if (type === 'hide') {
370
- console.log("sage----hide",this.data.is_hide_now,this.data.selectGoods);
374
+ console.log("sage----hide", this.data.is_hide_now, this.data.selectGoods);
371
375
  if (this.data.is_hide_now === this.data.selectGoods.length) {
372
376
  this.showToast('当前选择的商品已隐藏')
373
377
  this.setData({
@@ -376,11 +380,10 @@ Component({
376
380
  return
377
381
  } else {
378
382
  wx.showModal({
379
- title: `确认隐藏${
380
- this.data.is_hide_now
381
- ? this.data.selectGoods.length - this.data.is_hide_now
382
- : this.data.selectGoods.length
383
- }个商品吗`,
383
+ title: `确认隐藏${this.data.is_hide_now
384
+ ? this.data.selectGoods.length - this.data.is_hide_now
385
+ : this.data.selectGoods.length
386
+ }个商品吗`,
384
387
  content: '用户端商品列表不展示已隐藏商品,讲师仍可通过讲解发送商品',
385
388
  confirmText: '确认',
386
389
  cancelText: '取消',
@@ -411,13 +414,13 @@ Component({
411
414
  }))
412
415
  let params = {
413
416
  alive_id: this.data.aliveInfo.alive_id,
414
- app_id: this.data.aliveInfo.app_id,
417
+ app_id: this.data.aliveInfo.app_id,
415
418
  resource_ids: tempSelectGoodsArr,
416
419
  is_display_package: state,
417
420
  }
418
421
  console.log('sage----调用接口传参数', tempSelectGoodsArr, params)
419
422
 
420
- requestChangeShow(params,false,{isNeedToken: true}).then((res) => {
423
+ requestChangeShow(params, false, { isNeedToken: true }).then((res) => {
421
424
  let { code } = res.data
422
425
  if (code === 0) {
423
426
  // let temp = `marketResource.courseList[${this.data.selectIndex}].is_display_package`
@@ -453,7 +456,7 @@ Component({
453
456
 
454
457
  // 商品总活动倒计时
455
458
  startActivityCountdown(list) {
456
-
459
+
457
460
  clearInterval(activityCountdownTimer)
458
461
  activityCountdownTimer = setInterval(() => {
459
462
  hadActivity = false
@@ -585,13 +588,13 @@ Component({
585
588
  //下拉刷新的时候直接赋值
586
589
  goodsInfo = JSON.parse(JSON.stringify(data))
587
590
  }
588
- this.setData({
591
+ this.setData({
589
592
  goodsInfo
590
- },()=>{
593
+ }, () => {
591
594
  this.getActivityStatus(this.data.goodsInfo)
592
595
  })
593
596
  },
594
- getActivityStatus(data){
597
+ getActivityStatus(data) {
595
598
  activityList = []
596
599
  preheatList = []
597
600
  data.forEach((item, index) => {
@@ -735,9 +738,9 @@ Component({
735
738
  },
736
739
  deleteGood(id) {
737
740
  let deleteGoodIndex;
738
- if(!this.data.goodsInfo) return;
741
+ if (!this.data.goodsInfo) return;
739
742
  this.data.goodsInfo.forEach((goods, index) => {
740
- if(goods.id === id) {
743
+ if (goods.id === id) {
741
744
  deleteGoodIndex = index;
742
745
  }
743
746
  })
@@ -747,12 +750,12 @@ Component({
747
750
  })
748
751
  },
749
752
  selectToast(e) {
750
- console.log("sage-----单选e",e);
753
+ console.log("sage-----单选e", e);
751
754
  let tempItemIndex = String(e.currentTarget.dataset.item)
752
755
  this.setData({
753
756
  selectId: this.data.goodsInfo[tempItemIndex].id
754
757
  })
755
- console.log("sage-----toast",this.data.selectId, this.data.selectGoodsIndexArr.length);
758
+ console.log("sage-----toast", this.data.selectId, this.data.selectGoodsIndexArr.length);
756
759
  if (this.data.selectGoodsIndexArr.length >= 10 && this.data.selectGoodsIndexArr.indexOf(this.data.selectId) === -1) {
757
760
  this.showToast('批量操作最多支持10条')
758
761
  } else {
@@ -780,18 +783,18 @@ Component({
780
783
  })
781
784
  }
782
785
  },
783
- "total": function(newVal){
784
- this.triggerEvent("totalChange",newVal)
786
+ "total": function (newVal) {
787
+ this.triggerEvent("totalChange", newVal)
785
788
  },
786
- "isManage": function(newVal){
789
+ "isManage": function (newVal) {
787
790
  this.setData({
788
791
  selectGoods: []
789
792
  })
790
793
  },
791
- "is_jurisdiction": function(newVal){
792
- this.triggerEvent("jurisdictionChange",newVal)
794
+ "is_jurisdiction": function (newVal) {
795
+ this.triggerEvent("jurisdictionChange", newVal)
793
796
  },
794
- "goodsSwitch": function(newVal){
797
+ "goodsSwitch": function (newVal) {
795
798
  if (this.data.goodsSwitchOld === 0 && newVal === 1 && this.data.showList) {
796
799
  this._freshing = true
797
800
  this.setData({
@@ -40,6 +40,8 @@
40
40
  sending="{{sending && index === sendingIndex}}"
41
41
  isFullScreen="{{isFullScreen}}"
42
42
  isManage="{{true}}"
43
+ sendingGoodId="{{sendingGoodId}}"
44
+ sendingIndex="{{sendingIndex}}"
43
45
  ></goods-item>
44
46
  </van-checkbox>
45
47
  </view>
@@ -59,6 +61,8 @@
59
61
  sending="{{sending && index === sendingIndex}}"
60
62
  isFullScreen="{{isFullScreen}}"
61
63
  isManage="{{false}}"
64
+ sendingGoodId="{{sendingGoodId}}"
65
+ sendingIndex="{{sendingIndex}}"
62
66
  ></goods-item>
63
67
  </view>
64
68
  </block>
@@ -103,4 +107,4 @@
103
107
  module.exports = {
104
108
  checkBoxDisable: checkBoxDisable
105
109
  }
106
- </wxs>
110
+ </wxs>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xiaoe_mp_npm",
3
- "version": "0.5.42-test29",
3
+ "version": "0.5.42-test30",
4
4
  "description": "",
5
5
  "main": "miniprogram_dist/index.js",
6
6
  "scripts": {
@@ -75,4 +75,4 @@
75
75
  "miniprogram-computed": "4.2.1",
76
76
  "mp-plugins-info-collection": "1.1.2"
77
77
  }
78
- }
78
+ }
@@ -13,7 +13,7 @@ import {
13
13
  PUNCH_CARD
14
14
  } from "../common/utils/constants.js";
15
15
 
16
- const {utils, sensorLog } = require("live-mp-tools");
16
+ const { utils, sensorLog } = require("live-mp-tools");
17
17
  import { showGoods } from "../common/api/liveGoodsList"
18
18
 
19
19
  const computedBehavior = require('miniprogram-computed').behavior
@@ -60,7 +60,7 @@ Component({
60
60
  let nowTime = new Date().getTime()
61
61
  let preheating = hasPreheat && nowTime > preHeatTime.getTime() && startTime2.getTime() > nowTime
62
62
  let isSeckill = currentActive === '秒杀'
63
- let checked = newVal.is_display_package === 1
63
+ let checked = newVal.is_display_package === 1
64
64
 
65
65
 
66
66
  this.setData({
@@ -128,11 +128,11 @@ Component({
128
128
  type: Boolean,
129
129
  value: false
130
130
  },
131
- style:{
131
+ style: {
132
132
  type: String,
133
133
  value: ''
134
134
  },
135
- index:{
135
+ index: {
136
136
  type: Number,
137
137
  value: -1
138
138
  },
@@ -144,7 +144,11 @@ Component({
144
144
  isManage: {
145
145
  type: Boolean,
146
146
  value: false
147
- }
147
+ },
148
+ sendingGoodId: {
149
+ type: String,
150
+ value: '',
151
+ },
148
152
  },
149
153
 
150
154
  lifetimes: {
@@ -373,19 +377,19 @@ Component({
373
377
  cmm3: isFullScreen ? '全屏' : '非全屏'
374
378
  })
375
379
  // 线下课29课时包42/拼团 --判断权益
376
- if([29,42].indexOf(this.data.goodsItem.resource_type) > -1 || this.data.goodsItem.activity_type === 6){
380
+ if ([29, 42].indexOf(this.data.goodsItem.resource_type) > -1 || this.data.goodsItem.activity_type === 6) {
377
381
  this.judgePermission()
378
382
  return
379
383
  }
380
384
  let params = {
381
- id: this.data.goodsItem.id,
382
- resource_id: this.data.goodsItem.resource_id,
383
- resource_type: this.data.goodsItem.resource_type,
384
- price: this.data.goodsItem.price,
385
- app_id:this.data.aliveInfo.app_id,
386
- user_id:this.data.aliveInfo.user_id,
387
- coupon_id: this.data.goodsItem.coupon_id,
388
- alive_id: this.data.aliveInfo.alive_id
385
+ id: this.data.goodsItem.id,
386
+ resource_id: this.data.goodsItem.resource_id,
387
+ resource_type: this.data.goodsItem.resource_type,
388
+ price: this.data.goodsItem.price,
389
+ app_id: this.data.aliveInfo.app_id,
390
+ user_id: this.data.aliveInfo.user_id,
391
+ coupon_id: this.data.goodsItem.coupon_id,
392
+ alive_id: this.data.aliveInfo.alive_id
389
393
  }
390
394
  const url = this.properties.isGrayMarketing ? snapCheckNew : snapCheck
391
395
  url(params).then(res => {
@@ -451,10 +455,10 @@ Component({
451
455
  console.log("permission", permission)
452
456
  // 有权益的情况下
453
457
  if (permission) {
454
- // 电子书20/班课35 鹅学习不支持,无权益的情况下,内嵌h5, 有权益TOAST提示
458
+ // 电子书20/班课35 鹅学习不支持,无权益的情况下,内嵌h5, 有权益TOAST提示
455
459
  if ([20, 35].indexOf(this.data.goodsItem.resource_type) > -1) {
456
460
  this.showToast('您已拥有该课程,小程序内暂不支持学习此课程')
457
- }else {
461
+ } else {
458
462
  // 弹出提示去小程序学习 有三种可能 -圈子小程序 -小鹅通小程序 -打卡小程序
459
463
  this.showdialog(this.data.goodsItem)
460
464
  }
@@ -467,8 +471,8 @@ Component({
467
471
  return new Promise((resolve, reject) => {
468
472
  let params = {
469
473
  id: this.data.goodsItem.id,
470
- app_id:this.data.aliveInfo.app_id,
471
- user_id:this.data.aliveInfo.user_id,
474
+ app_id: this.data.aliveInfo.app_id,
475
+ user_id: this.data.aliveInfo.user_id,
472
476
  }
473
477
  const url = this.properties.isGrayMarketing ? getUserPermissionNew : getUserPermission
474
478
  url(params).then((res) => {
@@ -601,111 +605,111 @@ Component({
601
605
  })
602
606
  }
603
607
  },
604
- //judgePermission里面 showDialog 外部弹窗调用
605
- toMiniProgram(goodsInfo){
606
- let { aliveInfo, sensorReportParams } = this.properties
607
- sensorLog.sensors.track('click_butt',{
608
- page_id:'e_alive#mini#first#alive_room',
609
- page_name:'直播间页面',
610
- l_program: '鹅直播',
611
- page_path: '鹅直播#小程序#首页#直播间页面',
612
- page_button: "前往",
613
- app_id: aliveInfo.app_id,
614
- c_user_id: aliveInfo.user_id,
615
- union_id: wx.getStorageSync('userInfo').universal_union_id,
616
- current_role: sensorReportParams.current_role,
617
- resource_id: aliveInfo.alive_id,
618
- $url_path: `alive/${aliveInfo.alive_id}`,
619
- type: sensorReportParams.type,
620
- cmm1: sensorReportParams.alive_type,
621
- cmm2: sensorReportParams.version_type,
622
- comm2: sensorReportParams.pay_type
623
- })
624
- let spu_type = goodsInfo.spu_type
625
- switch(spu_type){
626
- case ASSOCIATION:
627
- this.toAssociation(goodsInfo);
628
- break;
629
- case PUNCH_CARD:
630
- this.toPunchCard(goodsInfo);
631
- break;
632
- default:
633
- this.toXiaoeLearn(goodsInfo);
634
- break;
635
- }
636
- },
637
- toXiaoeLearn(goodsInfo){
638
- let { aliveInfo } = this.properties
639
- let h5_url = this.formatUrl(goodsInfo)
640
- var path
641
- // 音频 视频
642
- if(goodsInfo.resource_type === 2 || goodsInfo.resource_type === 3){
643
- path = `/pages/index/authorizePage?user_id=${aliveInfo.user_id}&app_id=${aliveInfo.app_id}&resource_id=${goodsInfo.id}&unique_type=elive`
644
- }else {
645
- // 其他
646
- path = `/pages/index/authorizePage?user_id=${aliveInfo.user_id}&app_id=${aliveInfo.app_id}&h5_url=${h5_url}`
647
- }
648
- let params = {
649
- appId: "wxa3589f1193170aa3",
650
- path,
651
- }
652
- if(this.properties.envName == 'inside' || this.properties.envName == 'test'){ //开发环境 测试环境 加上这个参数可以跳转去鹅学习体验版
653
- params.appId = 'wx9eb4d7b3f2a3e003'
654
- params.envVersion='trial'
655
- }
656
- wx.navigateToMiniProgram(params)
657
- },
658
- toPunchCard(goodsInfo){
659
- let { aliveInfo } = this.properties
660
- let path = `/pages-participate-progress/pages/participate/participate?app_id=${aliveInfo.app_id}&&activity_id=${goodsInfo.resource_id}`
661
- let params = {
662
- appId: "wx839728854b1e23ad", //现网
663
- path,
664
- }
665
- if(this.properties.envName == 'inside'){ //开发环境
666
- params.appId = 'wx802f346b1c7dcdd9'
667
- }else if(this.properties.envName == 'test'){ // 测试环境
668
- params.appId = 'wx778bc88236be97d9'
669
- }
670
- wx.navigateToMiniProgram(params)
671
- },
672
- toAssociation(goodsInfo){
673
- let { aliveInfo } = this.properties
674
- let path = `/pages-community/pages/home/index?appId=${aliveInfo.app_id}&&communityId=${goodsInfo.resource_id}`
675
- let params = {
676
- appId: "wxd0ad7e76d51ae4cc",
677
- path,
678
- }
679
- if(this.properties.envName == 'inside'){
680
- params.appId = 'wx52419e90dc6dd535' //开发环境
681
- }else if(this.properties.envName == 'test'){ //测试环境
682
- params.appId = 'wxb245d452213c48c9' //测试环境
683
- }
684
- wx.navigateToMiniProgram(params)
685
- },
686
- sendGoodsCard(e) {
687
- let dataset = e.currentTarget.dataset;
688
- // 触发父组件的send
689
- this.triggerEvent('sendGoodsCard', {
690
- datas: dataset
691
- });
692
- },
693
- changeShowType(){
694
- if(this.data.goodsItem.teacher_auth != 2){
695
- this.showToast('暂无权限')
696
- return
697
- }
698
- this.setData({
699
- switchLoading: true
700
- })
608
+ //judgePermission里面 showDialog 外部弹窗调用
609
+ toMiniProgram(goodsInfo) {
610
+ let { aliveInfo, sensorReportParams } = this.properties
611
+ sensorLog.sensors.track('click_butt', {
612
+ page_id: 'e_alive#mini#first#alive_room',
613
+ page_name: '直播间页面',
614
+ l_program: '鹅直播',
615
+ page_path: '鹅直播#小程序#首页#直播间页面',
616
+ page_button: "前往",
617
+ app_id: aliveInfo.app_id,
618
+ c_user_id: aliveInfo.user_id,
619
+ union_id: wx.getStorageSync('userInfo').universal_union_id,
620
+ current_role: sensorReportParams.current_role,
621
+ resource_id: aliveInfo.alive_id,
622
+ $url_path: `alive/${aliveInfo.alive_id}`,
623
+ type: sensorReportParams.type,
624
+ cmm1: sensorReportParams.alive_type,
625
+ cmm2: sensorReportParams.version_type,
626
+ comm2: sensorReportParams.pay_type
627
+ })
628
+ let spu_type = goodsInfo.spu_type
629
+ switch (spu_type) {
630
+ case ASSOCIATION:
631
+ this.toAssociation(goodsInfo);
632
+ break;
633
+ case PUNCH_CARD:
634
+ this.toPunchCard(goodsInfo);
635
+ break;
636
+ default:
637
+ this.toXiaoeLearn(goodsInfo);
638
+ break;
639
+ }
640
+ },
641
+ toXiaoeLearn(goodsInfo) {
642
+ let { aliveInfo } = this.properties
643
+ let h5_url = this.formatUrl(goodsInfo)
644
+ var path
645
+ // 音频 视频
646
+ if (goodsInfo.resource_type === 2 || goodsInfo.resource_type === 3) {
647
+ path = `/pages/index/authorizePage?user_id=${aliveInfo.user_id}&app_id=${aliveInfo.app_id}&resource_id=${goodsInfo.id}&unique_type=elive`
648
+ } else {
649
+ // 其他
650
+ path = `/pages/index/authorizePage?user_id=${aliveInfo.user_id}&app_id=${aliveInfo.app_id}&h5_url=${h5_url}`
651
+ }
652
+ let params = {
653
+ appId: "wxa3589f1193170aa3",
654
+ path,
655
+ }
656
+ if (this.properties.envName == 'inside' || this.properties.envName == 'test') { //开发环境 测试环境 加上这个参数可以跳转去鹅学习体验版
657
+ params.appId = 'wx9eb4d7b3f2a3e003'
658
+ params.envVersion = 'trial'
659
+ }
660
+ wx.navigateToMiniProgram(params)
661
+ },
662
+ toPunchCard(goodsInfo) {
663
+ let { aliveInfo } = this.properties
664
+ let path = `/pages-participate-progress/pages/participate/participate?app_id=${aliveInfo.app_id}&&activity_id=${goodsInfo.resource_id}`
665
+ let params = {
666
+ appId: "wx839728854b1e23ad", //现网
667
+ path,
668
+ }
669
+ if (this.properties.envName == 'inside') { //开发环境
670
+ params.appId = 'wx802f346b1c7dcdd9'
671
+ } else if (this.properties.envName == 'test') { // 测试环境
672
+ params.appId = 'wx778bc88236be97d9'
673
+ }
674
+ wx.navigateToMiniProgram(params)
675
+ },
676
+ toAssociation(goodsInfo) {
677
+ let { aliveInfo } = this.properties
678
+ let path = `/pages-community/pages/home/index?appId=${aliveInfo.app_id}&&communityId=${goodsInfo.resource_id}`
679
+ let params = {
680
+ appId: "wxd0ad7e76d51ae4cc",
681
+ path,
682
+ }
683
+ if (this.properties.envName == 'inside') {
684
+ params.appId = 'wx52419e90dc6dd535' //开发环境
685
+ } else if (this.properties.envName == 'test') { //测试环境
686
+ params.appId = 'wxb245d452213c48c9' //测试环境
687
+ }
688
+ wx.navigateToMiniProgram(params)
689
+ },
690
+ sendGoodsCard(e) {
691
+ let dataset = e.currentTarget.dataset;
692
+ // 触发父组件的send
693
+ this.triggerEvent('sendGoodsCard', {
694
+ datas: dataset
695
+ });
696
+ },
697
+ changeShowType() {
698
+ if (this.data.goodsItem.teacher_auth != 2) {
699
+ this.showToast('暂无权限')
700
+ return
701
+ }
702
+ this.setData({
703
+ switchLoading: true
704
+ })
701
705
  let params = {
702
706
  alive_id: this.properties.aliveInfo.alive_id,
703
707
  app_id: this.properties.aliveInfo.app_id,
704
708
  resource_id: this.data.goodsItem.id,
705
709
  is_display_package: this.data.checked ? 0 : 1
706
710
  };
707
- showGoods(params).then( (res) => {
708
- console.log(res,"resres")
711
+ showGoods(params).then((res) => {
712
+ console.log(res, "resres")
709
713
  let { code } = res.data
710
714
  if (code === 0) {
711
715
  this.setData({
@@ -713,7 +717,7 @@ Component({
713
717
  checked: !this.data.checked
714
718
  })
715
719
  this.showToast('操作成功')
716
- }else{
720
+ } else {
717
721
  this.setData({
718
722
  switchLoading: false
719
723
  })
@@ -70,6 +70,84 @@ $deviceWidth: 750;
70
70
  background: rgba(0,0,0,0.25) !important;
71
71
  backdrop-filter: blur(vmin(24));
72
72
  }
73
+ .goods-explaining {
74
+ position: absolute;
75
+ bottom: 0;
76
+ left: 0;
77
+ display: flex;
78
+ justify-content: center;
79
+ align-items: center;
80
+ height: vmin(40);
81
+ width: 29.9vmin;
82
+ border-bottom-right-radius: 2.13vmin;
83
+ border-bottom-left-radius: 2.13vmin;
84
+ &::before {
85
+ content: '';
86
+ position: absolute;
87
+ background: rgba(0, 0, 0, 0.2);
88
+ backdrop-filter: blur(0.22rem);
89
+ left: 0;
90
+ bottom: 0;
91
+ width: 100%;
92
+ height: vmin(40);
93
+ border-bottom-right-radius: 2.13vmin;
94
+ border-bottom-left-radius: 2.13vmin;
95
+ }
96
+ .loadingWrapper {
97
+ position: relative;
98
+ display: flex;
99
+ justify-content: center;
100
+ align-items: center;
101
+ height: vmin(21.6);
102
+ width: vmin(36);
103
+ background-repeat: no-repeat;
104
+ background-size: cover;
105
+ margin-right: 0.08rem;
106
+ .loading {
107
+ background-color: white;
108
+ height: vmin(21.6);
109
+ width: vmin(4);
110
+ border-radius: vmin(8);
111
+ transform-origin: top;
112
+ transform: translateZ(0);
113
+ -webkit-transform: translateZ(0);
114
+ position: absolute;
115
+ bottom: 0;
116
+ &:nth-child(1) {
117
+ left: 0;
118
+ animation: 0.9s ease-in-out 0.15s loading-run infinite;
119
+ }
120
+ &:nth-child(2) {
121
+ left: vmin(10);
122
+ animation: 0.9s ease-in-out 0.25s loading-run infinite;
123
+ }
124
+ &:nth-child(3) {
125
+ left: vmin(20);
126
+ animation: 0.9s ease-in-out 0.35s loading-run infinite;
127
+ }
128
+ &:nth-child(4) {
129
+ left: vmin(30);
130
+ animation: 0.9s ease-in-out 0.45s loading-run infinite;
131
+ }
132
+ }
133
+ @keyframes loading-run {
134
+ 0%,
135
+ 40%,
136
+ 100% {
137
+ height: vmin(10.8);
138
+ }
139
+ 25% {
140
+ height: vmin(21.6);
141
+ }
142
+ }
143
+ }
144
+ .text {
145
+ font-size: vmin(24);
146
+ color: #ffffff;
147
+ position: relative;
148
+ margin-left: vmin(8);
149
+ }
150
+ }
73
151
  .is-over {
74
152
  border-radius: vmin(10.67) vmin(10.67) 0 0;
75
153
  position: absolute;
@@ -437,4 +515,4 @@ $deviceWidth: 750;
437
515
  .goods-item {
438
516
  @include goods-item;
439
517
  }
440
- }
518
+ }
@@ -24,6 +24,13 @@
24
24
  class="goods-explaining"
25
25
  src="../../common/assets/images/liveGoodsList/explaining.png"
26
26
  />
27
+ <!-- 讲解中 -->
28
+ <view class="goods-explaining" wx:if="{{sendingGoodId === goodsItem.id}}">
29
+ <view class="loadingWrapper">
30
+ <view class="loading" wx:for="{{4}}" wx:key="i"></view>
31
+ </view>
32
+ <view class="text">讲解中</view>
33
+ </view>
27
34
  <view class="is-over" wx:if="{{isOver}}">- 已抢光 -</view>
28
35
  </view>
29
36
  <view class="right {{isManage?'manage-right':''}}">
@@ -144,12 +151,15 @@
144
151
  data-item="{{goodsItem}}"
145
152
  data-type="10"
146
153
  data-index="{{index}}"
154
+ data-id="{{goodsItem.id}}"
155
+ data-isExplain="{{sendingGoodId === goodsItem.id}}"
147
156
  >
148
157
  <image
149
158
  wx:if="{{sending}}"
150
159
  class="load"
151
160
  src="https://commonresource-1252524126.cdn.xiaoeknow.com/image/lik3ojn20167.png"
152
- />讲解
161
+ />
162
+ {{ sendingGoodId === goodsItem.id ? '结束讲解' : '讲解' }}
153
163
  </view>
154
164
  </block>
155
165
  <!-- 购买按钮 end -->
@@ -78,7 +78,7 @@ Component({
78
78
  console.log(newVal)
79
79
 
80
80
  newVal && this.onLoad()
81
- if(!newVal){
81
+ if (!newVal) {
82
82
  clearInterval(activityCountdownTimer)
83
83
  activityCountdownTimer = null
84
84
  clearInterval(preheatTimer)
@@ -109,7 +109,11 @@ Component({
109
109
  isManage: {
110
110
  type: Boolean,
111
111
  value: false,
112
- }
112
+ },
113
+ sendingGoodId: {
114
+ type: String,
115
+ value: '',
116
+ },
113
117
  },
114
118
  data: {
115
119
  goodsInfo: [],
@@ -214,7 +218,7 @@ Component({
214
218
  switch (type) {
215
219
  // 带货和优惠券开关操作
216
220
  case "goodsSwitch":
217
- if ([0, 1].includes(marketInfo)) this.setData({goodsSwitch: marketInfo})
221
+ if ([0, 1].includes(marketInfo)) this.setData({ goodsSwitch: marketInfo })
218
222
  break;
219
223
  case 'goodsConfList':
220
224
  // 如果已经加载完了,可以拼接数据
@@ -310,11 +314,11 @@ Component({
310
314
  })
311
315
  },
312
316
  // 管理商品多选
313
- onChange(e){
317
+ onChange(e) {
314
318
  // this.setData({
315
319
  // selectGoods:e.detail
316
320
  // })
317
- console.log("sage-------onchange",e.detail);
321
+ console.log("sage-------onchange", e.detail);
318
322
  let tempGoodsArr = []
319
323
  e.detail.forEach((item) => {
320
324
  for (let index = 0; index < this.data.goodsInfo.length; index++) {
@@ -367,7 +371,7 @@ Component({
367
371
 
368
372
  // 隐藏商品确认弹窗
369
373
  if (type === 'hide') {
370
- console.log("sage----hide",this.data.is_hide_now,this.data.selectGoods);
374
+ console.log("sage----hide", this.data.is_hide_now, this.data.selectGoods);
371
375
  if (this.data.is_hide_now === this.data.selectGoods.length) {
372
376
  this.showToast('当前选择的商品已隐藏')
373
377
  this.setData({
@@ -376,11 +380,10 @@ Component({
376
380
  return
377
381
  } else {
378
382
  wx.showModal({
379
- title: `确认隐藏${
380
- this.data.is_hide_now
381
- ? this.data.selectGoods.length - this.data.is_hide_now
382
- : this.data.selectGoods.length
383
- }个商品吗`,
383
+ title: `确认隐藏${this.data.is_hide_now
384
+ ? this.data.selectGoods.length - this.data.is_hide_now
385
+ : this.data.selectGoods.length
386
+ }个商品吗`,
384
387
  content: '用户端商品列表不展示已隐藏商品,讲师仍可通过讲解发送商品',
385
388
  confirmText: '确认',
386
389
  cancelText: '取消',
@@ -411,13 +414,13 @@ Component({
411
414
  }))
412
415
  let params = {
413
416
  alive_id: this.data.aliveInfo.alive_id,
414
- app_id: this.data.aliveInfo.app_id,
417
+ app_id: this.data.aliveInfo.app_id,
415
418
  resource_ids: tempSelectGoodsArr,
416
419
  is_display_package: state,
417
420
  }
418
421
  console.log('sage----调用接口传参数', tempSelectGoodsArr, params)
419
422
 
420
- requestChangeShow(params,false,{isNeedToken: true}).then((res) => {
423
+ requestChangeShow(params, false, { isNeedToken: true }).then((res) => {
421
424
  let { code } = res.data
422
425
  if (code === 0) {
423
426
  // let temp = `marketResource.courseList[${this.data.selectIndex}].is_display_package`
@@ -453,7 +456,7 @@ Component({
453
456
 
454
457
  // 商品总活动倒计时
455
458
  startActivityCountdown(list) {
456
-
459
+
457
460
  clearInterval(activityCountdownTimer)
458
461
  activityCountdownTimer = setInterval(() => {
459
462
  hadActivity = false
@@ -585,13 +588,13 @@ Component({
585
588
  //下拉刷新的时候直接赋值
586
589
  goodsInfo = JSON.parse(JSON.stringify(data))
587
590
  }
588
- this.setData({
591
+ this.setData({
589
592
  goodsInfo
590
- },()=>{
593
+ }, () => {
591
594
  this.getActivityStatus(this.data.goodsInfo)
592
595
  })
593
596
  },
594
- getActivityStatus(data){
597
+ getActivityStatus(data) {
595
598
  activityList = []
596
599
  preheatList = []
597
600
  data.forEach((item, index) => {
@@ -735,9 +738,9 @@ Component({
735
738
  },
736
739
  deleteGood(id) {
737
740
  let deleteGoodIndex;
738
- if(!this.data.goodsInfo) return;
741
+ if (!this.data.goodsInfo) return;
739
742
  this.data.goodsInfo.forEach((goods, index) => {
740
- if(goods.id === id) {
743
+ if (goods.id === id) {
741
744
  deleteGoodIndex = index;
742
745
  }
743
746
  })
@@ -747,12 +750,12 @@ Component({
747
750
  })
748
751
  },
749
752
  selectToast(e) {
750
- console.log("sage-----单选e",e);
753
+ console.log("sage-----单选e", e);
751
754
  let tempItemIndex = String(e.currentTarget.dataset.item)
752
755
  this.setData({
753
756
  selectId: this.data.goodsInfo[tempItemIndex].id
754
757
  })
755
- console.log("sage-----toast",this.data.selectId, this.data.selectGoodsIndexArr.length);
758
+ console.log("sage-----toast", this.data.selectId, this.data.selectGoodsIndexArr.length);
756
759
  if (this.data.selectGoodsIndexArr.length >= 10 && this.data.selectGoodsIndexArr.indexOf(this.data.selectId) === -1) {
757
760
  this.showToast('批量操作最多支持10条')
758
761
  } else {
@@ -780,18 +783,18 @@ Component({
780
783
  })
781
784
  }
782
785
  },
783
- "total": function(newVal){
784
- this.triggerEvent("totalChange",newVal)
786
+ "total": function (newVal) {
787
+ this.triggerEvent("totalChange", newVal)
785
788
  },
786
- "isManage": function(newVal){
789
+ "isManage": function (newVal) {
787
790
  this.setData({
788
791
  selectGoods: []
789
792
  })
790
793
  },
791
- "is_jurisdiction": function(newVal){
792
- this.triggerEvent("jurisdictionChange",newVal)
794
+ "is_jurisdiction": function (newVal) {
795
+ this.triggerEvent("jurisdictionChange", newVal)
793
796
  },
794
- "goodsSwitch": function(newVal){
797
+ "goodsSwitch": function (newVal) {
795
798
  if (this.data.goodsSwitchOld === 0 && newVal === 1 && this.data.showList) {
796
799
  this._freshing = true
797
800
  this.setData({
@@ -40,6 +40,8 @@
40
40
  sending="{{sending && index === sendingIndex}}"
41
41
  isFullScreen="{{isFullScreen}}"
42
42
  isManage="{{true}}"
43
+ sendingGoodId="{{sendingGoodId}}"
44
+ sendingIndex="{{sendingIndex}}"
43
45
  ></goods-item>
44
46
  </van-checkbox>
45
47
  </view>
@@ -59,6 +61,8 @@
59
61
  sending="{{sending && index === sendingIndex}}"
60
62
  isFullScreen="{{isFullScreen}}"
61
63
  isManage="{{false}}"
64
+ sendingGoodId="{{sendingGoodId}}"
65
+ sendingIndex="{{sendingIndex}}"
62
66
  ></goods-item>
63
67
  </view>
64
68
  </block>
@@ -103,4 +107,4 @@
103
107
  module.exports = {
104
108
  checkBoxDisable: checkBoxDisable
105
109
  }
106
- </wxs>
110
+ </wxs>