| | |
| | | const { cateList, tagCodes, activeParam, activeIndex } = this.data |
| | | const index = tagCodes.indexOf(code) |
| | | |
| | | if (index === -1) { |
| | | if (cateList[activeIndex].tempParamIndex==null || cateList[activeIndex].tempParamIndex != paramIndex) { |
| | | // // 同param里code重复 |
| | | // if (activeParam && activeParam.length > 0) { |
| | | // activeParam.forEach(item => { |
| | |
| | | <!-- param --> |
| | | <view wx:if="{{ activeParam && activeParam.length > 0 }}" class="query_param"> |
| | | <view class="list"> |
| | | <view data-index="{{index}}" data-code="{{ item.labelValueCode }}" bindtap="tagClick" wx:for="{{ activeParam }}" class="item {{ cateList[activeIndex].tempParamIndex === index ? 'active' : '' }}">{{ item.labelValueName }}</view> |
| | | <view data-index="{{index}}" data-tempindex="{{item.tempParamIndex}}" data-code="{{ item.labelValueCode }}" bindtap="tagClick" wx:for="{{ activeParam }}" class="item {{ cateList[activeIndex].tempParamIndex === index ? 'active' : '' }}">{{ item.labelValueName }}</view> |
| | | </view> |
| | | <view class="btns"> |
| | | <view class="btn" bindtap="cancelParam">取消</view> |
| | |
| | | console.log('code', code) |
| | | console.log('tagCodes', tagCodes) |
| | | console.log(secondCateList) |
| | | if (index === -1) { |
| | | if ( secondCateList[activeIndex].tempParamIndex==null || secondCateList[activeIndex].tempParamIndex != paramIndex) { |
| | | // 同param里code重复 |
| | | // if (activeParam && activeParam.length > 0) { |
| | | // activeParam.forEach(item => { |
| | |
| | | </view> |
| | | <view wx:if="{{ activeParam.length > 0 }}" class="query_form"> |
| | | <view class="list"> |
| | | <view data-index="{{index}}" data-code="{{ item.labelValueCode }}" bindtap="tagClick" wx:for="{{ activeParam }}" class="item {{ secondCateList[activeIndex].tempParamIndex === index ? 'active' : '' }}">{{ item.labelValueName }}</view> |
| | | <view data-index="{{index}}" data-tempindex="{{item.tempParamIndex}}" data-code="{{ item.labelValueCode }}" bindtap="tagClick" wx:for="{{ activeParam }}" class="item {{ secondCateList[activeIndex].tempParamIndex === index ? 'active' : '' }}">{{ item.labelValueName }}</view> |
| | | </view> |
| | | <view class="btns"> |
| | | <view class="btn" bindtap="cancelParam">取消</view> |
| | |
| | | }, |
| | | videoClick(e) { |
| | | const { videourl } = e.currentTarget.dataset |
| | | wx.previewMedia({ |
| | | sources: [{ url: videourl, type: 'video' }] |
| | | }) |
| | | |
| | | let videoPlay = this.selectComponent('.videoPlay'); |
| | | if(videoPlay){ |
| | | videoPlay.startPlayVideo(videourl,this ); |
| | | } |
| | | console.log(videourl+"-------------------------------------") |
| | | // wx.previewMedia({ |
| | | // sources: [{ url: videourl, type: 'video' }] |
| | | // }) |
| | | }, |
| | | priviewFull(e){ |
| | | const item = e.currentTarget.dataset.item |
| | |
| | | const item = e.currentTarget.dataset.item |
| | | console.log('item', item); |
| | | if(item.openType == 'video'){ |
| | | wx.previewMedia({ |
| | | sources: [{ url: item.openContent, type: 'video' }] |
| | | }) |
| | | |
| | | let videoPlay = this.selectComponent('.videoPlay'); |
| | | if(videoPlay){ |
| | | videoPlay.startPlayVideo(item.openContent,this ); |
| | | } |
| | | // wx.previewMedia({ |
| | | // sources: [{ url: item.openContent, type: 'video' }] |
| | | // }) |
| | | } |
| | | if(item.openType == 'link'){ |
| | | wx.navigateTo({ |
| | |
| | | const code = e.currentTarget.dataset.code |
| | | const paramIndex = e.currentTarget.dataset.index |
| | | const { cateList, tagCodes, activeParam, activeIndex } = this.data |
| | | const index = tagCodes.indexOf(code) |
| | | |
| | | if(index === -1){ |
| | | // if(activeParam && activeParam.length > 0){ |
| | | // activeParam.forEach(item => { |
| | | // const indexTemp = tagCodes.indexOf(item.labelValueCode) |
| | | // if(indexTemp > -1){ |
| | | // tagCodes.splice(indexTemp, 1) |
| | | // } |
| | | // }) |
| | | // } |
| | | // tagCodes.push(code) |
| | | const index = tagCodes.indexOf(code) |
| | | if( cateList[activeIndex].tempParamIndex==null || cateList[activeIndex].tempParamIndex != paramIndex){ |
| | | |
| | | cateList[activeIndex].tempParamIndex = paramIndex |
| | | cateList[activeIndex].tempParamName = activeParam[paramIndex].labelValueName |
| | | cateList[activeIndex].tempParamCode = code |
| | |
| | | right: 32rpx; |
| | | font-size: 20rpx; |
| | | color: rgba(255, 255, 255, 0.8); |
| | | width: 112rpx; |
| | | height: 42rpx; |
| | | width:52rpx; |
| | | height: 46rpx; |
| | | background: rgba(0, 0, 0, 0.54); |
| | | border-radius: 30rpx; |
| | | border-radius: 8rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | |
| | | <!-- param --> |
| | | <view wx:if="{{ activeParam && activeParam.length > 0 }}" class="query_param"> |
| | | <view class="list"> |
| | | <view data-index="{{index}}" data-code="{{ item.labelValueCode }}" bindtap="tagClick" wx:for="{{ activeParam }}" class="item {{ cateList[activeIndex].tempParamIndex === index ? 'active' : '' }}">{{ item.labelValueName }}</view> |
| | | <view data-index="{{index}}" data-tempindex="{{item.tempParamIndex}}" data-code="{{ item.labelValueCode }}" bindtap="tagClick" wx:for="{{ activeParam }}" class="item {{ cateList[activeIndex].tempParamIndex === index ? 'active' : '' }}">{{ item.labelValueName }}</view> |
| | | </view> |
| | | <view class="btns"> |
| | | <view class="btn" bindtap="cancelParam">取消</view> |
| | |
| | | </view> |
| | | |
| | | |
| | | <videoPlay class="videoPlay"/> |
| | | </view> |
| | |
| | | right: 32rpx; |
| | | font-size: 20rpx; |
| | | color: rgba(255, 255, 255, 0.8); |
| | | width: 112rpx; |
| | | height: 42rpx; |
| | | width:52rpx; |
| | | height: 46rpx; |
| | | background: rgba(0, 0, 0, 0.54); |
| | | border-radius: 30rpx; |
| | | border-radius: 8rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | |
| | | return |
| | | } |
| | | const code = e.currentTarget.dataset.code |
| | | const paramIndex = e.currentTarget.dataset.index |
| | | const paramIndex = e.currentTarget.dataset.index |
| | | const { cateList, tagCodes, activeParam, activeIndex } = this.data |
| | | const index = tagCodes.indexOf(code) |
| | | |
| | | if(index === -1){ |
| | | const index = tagCodes.indexOf(code) |
| | | if( cateList[activeIndex].tempParamIndex==null || cateList[activeIndex].tempParamIndex != paramIndex){ |
| | | cateList[activeIndex].tempParamIndex = paramIndex |
| | | cateList[activeIndex].tempParamName = activeParam[paramIndex].labelValueName |
| | | cateList[activeIndex].tempParamCode = code |
| | |
| | | <!-- param --> |
| | | <view wx:if="{{ activeParam && activeParam.length > 0 }}" class="query_param"> |
| | | <view class="list"> |
| | | <view data-index="{{index}}" data-code="{{ item.labelValueCode }}" bindtap="tagClick" wx:for="{{ activeParam }}" class="item {{ cateList[activeIndex].tempParamIndex === index ? 'active' : '' }}">{{ item.labelValueName }}</view> |
| | | <view data-index="{{index}}" data-tempindex="{{item.tempParamIndex}}" data-code="{{ item.labelValueCode }}" bindtap="tagClick" wx:for="{{ activeParam }}" class="item {{ cateList[activeIndex].tempParamIndex === index ? 'active' : '' }}">{{ item.labelValueName }}</view> |
| | | </view> |
| | | <view class="btns"> |
| | | <view class="btn" bindtap="cancelParam">取消</view> |
| | |
| | | tagClick(e) { |
| | | const code = e.currentTarget.dataset.code |
| | | const paramIndex = e.currentTarget.dataset.index |
| | | const { secondCateList, tagCodes, activeParam, activeIndex } = this.data |
| | | const index = tagCodes.indexOf(code) |
| | | if(index === -1){ |
| | | const { secondCateList, tagCodes, activeParam, activeIndex } = this.data |
| | | if( secondCateList[activeIndex].tempParamIndex==null || secondCateList[activeIndex].tempParamIndex != paramIndex){ |
| | | // 同param里code重复 |
| | | // if (activeParam && activeParam.length > 0) { |
| | | // activeParam.forEach(item => { |
| | |
| | | </view> |
| | | <view wx:if="{{ activeParam.length > 0 }}" class="query_form"> |
| | | <view class="list"> |
| | | <view data-index="{{index}}" data-code="{{ item.labelValueCode }}" bindtap="tagClick" wx:for="{{ activeParam }}" class="item {{ secondCateList[activeIndex].tempParamIndex === index ? 'active' : '' }}">{{ item.labelValueName }}</view> |
| | | <view data-index="{{index}}" data-tempindex="{{item.tempParamIndex}}" data-code="{{ item.labelValueCode }}" bindtap="tagClick" wx:for="{{ activeParam }}" class="item {{ secondCateList[activeIndex].tempParamIndex === index ? 'active' : '' }}">{{ item.labelValueName }}</view> |
| | | </view> |
| | | <view class="btns"> |
| | | <view class="btn" bindtap="cancelParam">取消</view> |
| | |
| | | } |
| | | const code = e.currentTarget.dataset.code |
| | | const paramIndex = e.currentTarget.dataset.index |
| | | const { cateList, tagCodes, activeParam, activeIndex } = this.data |
| | | const index = tagCodes.indexOf(code) |
| | | |
| | | if(index === -1){ |
| | | // if(activeParam && activeParam.length > 0){ |
| | | // activeParam.forEach(item => { |
| | | // const indexTemp = tagCodes.indexOf(item.labelValueCode) |
| | | // if(indexTemp > -1){ |
| | | // tagCodes.splice(indexTemp, 1) |
| | | // } |
| | | // }) |
| | | // } |
| | | // tagCodes.push(code) |
| | | const { cateList, tagCodes, activeParam, activeIndex } = this.data |
| | | if( cateList[activeIndex].tempParamIndex==null || cateList[activeIndex].tempParamIndex != paramIndex){ |
| | | cateList[activeIndex].tempParamIndex = paramIndex |
| | | cateList[activeIndex].tempParamName = activeParam[paramIndex].labelValueName |
| | | cateList[activeIndex].tempParamCode = code |
| | | console.log(code) |
| | | }else{ |
| | | cateList[activeIndex].tempParamIndex = -1 |
| | | cateList[activeIndex].tempParamName = null |
| | | cateList[activeIndex].tempParamCode = null |
| | | cateList[activeIndex].tempParamCode = null |
| | | console.log(1) |
| | | } |
| | | this.setData({ cateList }) |
| | | console.log(cateList) |
| | | }, |
| | | cancelParam() { |
| | | const { cateList } = this.data |