rabin %!s(int64=2) %!d(string=hai) anos
pai
achega
4e94541a76
Modificáronse 3 ficheiros con 30 adicións e 6 borrados
  1. 2 2
      lib/community/y-Fab/y-Fab.vue
  2. 18 4
      pages/dream/view.vue
  3. 10 0
      pages/dream/view/dream.vue

+ 2 - 2
lib/community/y-Fab/y-Fab.vue

@@ -16,7 +16,7 @@
 			<view class="yc-fab-item" :class="{'yc-active':isOpen}" :style="{width:width+'rpx',height:height+'rpx',borderRadius:radius,background:bgColor,color:color}"
 			 @tap.stop="handleClick(-1)">
 				<view class="yc-fab-icon yc-icon-plus" v-if="!icon && !text"></view>
-				<view class="yc-fab-icon" :style="style" v-if="text && !icon">{{text}}</view>
+				<view class="yc-fab-icon" :style="setStyle" v-if="text && !icon">{{text}}</view>
 				<view class="yc-fab-icon" v-if="icon" :style="{opacity:0.5,backgroundSize:'contain',width:width+'rpx',height:height+'rpx',borderRadius:radius,backgroundImage: 'url('+icon+')'}"></view>
 			</view>
 		</view>
@@ -101,7 +101,7 @@
 				type: Boolean,
 				default: false
 			},
-			style:{
+			setStyle:{
 				type: String,
 				default: ""
 			}

+ 18 - 4
pages/dream/view.vue

@@ -14,13 +14,13 @@
 						<swiper class="swiper" @change="change" :circular="swiper.circular" :current="fetch.index">
 							<swiper-item v-for="(v, k) in fetch.items"  v-if="v.data" :key="k" >
 								<scroll-view scroll-y="true" scroll-x="true" class="scroll-height" @scrolltolower="bottomCall">
-									<dream ref="dream" @showDrawer="showDrawer" :index="k" :item="v" :control="control" :bottom="bottom" class="item"></dream>
+									<dream ref="dream" @showDrawer="showDrawer" @showPage="showPage" :index="k" :item="v" :control="control" :bottom="bottom" class="item"></dream>
 								</scroll-view>
 							</swiper-item>
 						</swiper>
 					</block>
 					<block v-if="!show">
-						<dream ref="dream" @showDrawer="showDrawer" :index="fetch.index" :item="fetch.items[fetch.index]" :control="control" :bottom="bottom" class="item"></dream>
+						<dream ref="dream" @showDrawer="showDrawer" @showPage="showPage" :index="fetch.index" :item="fetch.items[fetch.index]" :control="control" :bottom="bottom" class="item"></dream>
 					</block>
 				</view>
 			</dever-drawer-page>
@@ -54,7 +54,7 @@
 				</view>
 			</dever-drawer-window>
 			
-			<y-Fab v-if="!drawer.show && fetch.user.avatar && show" :bottom="20" :right="20" :btnList="drawer.button" :bgmPlay="bgm.playing" @click="clickDrawerButton" :text="`P`+(swiper.index+1)" :icon_o="fetch.user.avatar"></y-Fab>
+			<y-Fab v-if="!drawer.show && fetch.user.avatar && show" :bottom="20" :right="20" :btnList="drawer.button" :bgmPlay="bgm.playing" @click="clickDrawerButton" :text="page_text" :icon_o="fetch.user.avatar"></y-Fab>
 			<y-Fab v-if="!show" :bottom="20" :right="20" @click="goHome" :text="`更多`"></y-Fab>
 		</view>
 		
@@ -87,7 +87,9 @@ export default{
 			swiper : {
 				index : 0,
 				circular : true,
-			},
+			},
+			page_index : 0,
+			page_text : '',
 			fetch: {
 				items : [],
 				user : {},
@@ -164,6 +166,7 @@ export default{
 		//this.Dever.login = 'user/login?code=' + option.code;
 		//this.Dever.checkLogin();
 		this.login = this.Dever.getToken();
+		this.showPage(this.swiper.index);
 		this.Dever.config.name = option.name;
 		this.Dever.config.code = option.code;
 		this.Dever.config.system = uni.getSystemInfoSync();
@@ -261,6 +264,7 @@ export default{
 		},
 		change : function(e) {
 			this.fetch.index = this.swiper.index = parseInt(e.detail.current);
+			this.showPage(this.swiper.index);
 			//用户记录
 			this.record();
 			this.controlHandle();
@@ -333,6 +337,16 @@ export default{
 			if (this.drawer.show) {
 				this.closeDrawer(this.drawer.show);
 			}
+		},
+		showPage : function(page, index) {
+			if (page >= 0) {
+				this.page_index = page;
+			}
+			if (index >= 0) {
+				this.page_text = 'P'+(this.page_index+1) + '.' + (index+1);
+			} else {
+				this.page_text = 'P'+(this.page_index+1);
+			}
 		},
 		showDrawer : function(key) {
 			this.getContentId();

+ 10 - 0
pages/dream/view/dream.vue

@@ -157,11 +157,21 @@ export default {
 				this.Dever.alert('您点错了吧~');
 			}
 		},
+		showPage : function(index) {
+			if (index > 0) {
+				this.$emit('showPage', -1, index);
+			}
+		},
 		handle : function(e) {
 			this.showDrawer(this.button[e.index].key);
 		},
 		setMargin : function(e, i) {
 			var index = i >= 0 ? i : e.detail.current;
+			/*
+			if (this.item.type == 11 || this.item.type == 13 || this.item.type == 20) {
+				this.showPage(index);
+			}
+			*/
 			if (this.item_height[this.index].length > 0 && this.item_height[this.index][index]) {
 				var height = this.item_height[this.index][index];
 				var windowHeight = this.Dever.config.system.windowHeight;