zkx 1 年之前
父節點
當前提交
a909e67c1e
共有 2 個文件被更改,包括 42 次插入45 次删除
  1. 33 42
      components/u-column-notice/u-column-notice.vue
  2. 9 3
      components/u-row-notice/u-row-notice.vue

+ 33 - 42
components/u-column-notice/u-column-notice.vue

@@ -22,27 +22,29 @@
 					:style="[textStyle]"
 					@tap="click(index)"
 					:class="['u-type-' + type]"
-				>
-					<ujp-row-notice
-						:type="type"
-						:color="color"
-						:bgColor="bgColor"
-						:list="[item]"
-						:volumeIcon="volumeIcon"
-						:moreIcon="moreIcon"
-						:volumeSize="volumeSize"
-						:closeIcon="closeIcon"
-						:mode="mode"
-						:fontSize="fontSize"
-						:speed="speed"
-						:playState="current2==index?'play':'playState'"
-						:an="current2==index"
-						:padding="padding"
-						@getMore="getMore"
-						@close="close"
-						@click="click"
-						@getAnimationend="getAnimationend(index)"
+				>
+					<ujp-row-notice v-if="current2==index"
+						:type="type"
+						:color="color"
+						:bgColor="bgColor"
+						:list="[item]"
+						:volumeIcon="volumeIcon"
+						:moreIcon="moreIcon"
+						:volumeSize="volumeSize"
+						:closeIcon="closeIcon"
+						:mode="mode"
+						:fontSize="fontSize"
+						:speed="speed"
+						:playState="current2==index?'play':'playState'"
+						:an="current2==index"
+						:anindex="index"
+						:padding="padding"
+						@getMore="getMore"
+						@close="close"
+						@click="click"
+						@getAnimationend="getAnimationend"
 					></ujp-row-notice>
+				
 				</view>
 			</swiper-item>
 		</swiper>
@@ -185,34 +187,23 @@ export default {
 	data() {
 		return {
 			an:true,
-			current2:0
+			current2:0,
+			an2:true,
 			// animation: false
 		};
 	},
 	methods: {
 		getAnimationend(index){
-			
+			console.log(index,this.current2)
 			if(index==this.current2){
-				
-				
-				//this.$forceUpdate()
-				this.an=false
-				setTimeout(()=>{
-					console.log("getAnimationend",this.current2)
-					var c=this.current2+1;
-					if(c==this.list.length){
-						this.current2=0
-					}else{
-						this.current2=c
-					}
-					
-					setTimeout(()=>{
-						this.an=true
-						
-					},1000)
-				},50)
-				
-				console.log(this.current2)
+				//	this.an=false
+				console.log("getAnimationend",this.current2)
+				var c=this.current2+1;
+				if(c==this.list.length){
+					this.current2=0
+				}else{
+					this.current2=c
+				}
 			}
 			
 		},

+ 9 - 3
components/u-row-notice/u-row-notice.vue

@@ -49,6 +49,10 @@ export default {
 		an: {
 			type: Boolean,
 			default: false
+		},
+		anindex: {
+			type: [Number, String],
+			default: 0
 		},
 		// 滚动通知设置圆角
 		borderRadius: {
@@ -237,9 +241,11 @@ export default {
 		// 点击更多箭头按钮
 		getMore() {
 			this.$emit('getMore');
-		},getAnimationend(){
-			//console.log(this.playState)
-			this.$emit('getAnimationend');
+		},getAnimationend(){
+			
+			this.$emit('getAnimationend',this.anindex);
+			
+			
 		}
 	}
 };