dever 4 years ago
parent
commit
0adbb66871

+ 101 - 45
lib/community/y-DiaryItem/y-DiaryItem.vue

@@ -16,9 +16,9 @@
 				{{ item.content }}
 			</view>
 			<view v-if="item.pic.length > 0">
-				<view class="grid flex-sub padding-lr col-1" v-if="item.pic.length == 1">
+				<view class="grid flex-sub padding-lr col-1" v-if="item.pic.length == 1 && item.pic[0]">
 					<view @tap.stop @tap="Dever.viewPic(item.pic, child)" class="bg-img only-img" :style="{backgroundImage: 'url('+child+')'}"
-					 v-for="(child, idx) in item.pic" :key="idx">
+					 v-for="(child, idx) in item.pic" :key="idx" v-if="child">
 					</view>
 				</view>
 				
@@ -30,44 +30,46 @@
 				</view>
 			</view>
 			<view class="text-gray text-sm text-right padding">
-				<view class="icon-display" @click="updateOppose">
+				<view class="icon-display" @click="updateOppose(item)">
 					<text class="cuIcon-flashbuyfill margin-lr-xs" :class="item.is_oppose ? 'text-red' : ''"></text> {{item.num_oppose}}
 				</view>
-				<view class="icon-display" @click="updateUp">
+				<view class="icon-display" @click="updateUp(item)">
 					<text class="cuIcon-appreciatefill margin-lr-xs" :class="item.is_up ? 'text-red' : ''"></text> {{item.num_up}}
 				</view>
-				<view class="icon-display"  @click="updateComment(20, item.id)">
+				<view class="icon-display"  @click="updateComment(item.id)">
 					<text class="cuIcon-messagefill margin-lr-xs"></text> {{item.num_comment}}
 				</view>
 			</view>
 
-			<view class="cu-list menu-avatar comment solids-top" v-if="fetch.info.length">
-				<view class="cu-item" v-for="(v, k) in fetch.info" :key="k">
+			<view class="cu-list menu-avatar comment solids-top" v-if="item.child.length">
+				<view class="cu-item" v-for="(v, k) in item.child" :key="k">
 					<image :src="v.user.avatar" mode="widthFix" class="cu-avatar round"></image>
 					<view class="content">
 						<view class="text-grey">{{v.user.username}}</view>
-						<view class="text-grays text-content text-df">
-							{{v.content}}
-						</view>
-						<view class="bg-greys padding-sm radius margin-top-sm  text-sm">
-							<view class="flex">
-								<view>凯尔:</view>
-								<view class="flex-sub">妹妹,你在帮他们给黑暗找借口吗?</view>
-							</view>
+						<view class="text-content text-df text-content-margin">
+							<text class="text-grey" v-if="v.to_uid > 0">回复@{{v.to_user.username}}:</text> {{v.content}}
 						</view>
 						<view class="margin-top-sm flex justify-between">
 							<view class="text-gray text-df">{{v.cdate_string}}</view>
-							<view>
-								<text class="cuIcon-appreciatefill text-red"></text>
-								<text class="cuIcon-messagefill text-gray margin-left-sm"></text>
+							<view class="text-gray">
+								<view class="icon-display" @click="updateOppose(v)">
+									<text class="cuIcon-flashbuyfill margin-lr-xs" :class="v.is_oppose ? 'text-red' : ''"></text> {{v.num_oppose}}
+								</view>
+								<view class="icon-display" @click="updateUp(v)">
+									<text class="cuIcon-appreciatefill margin-lr-xs" :class="v.is_up ? 'text-red' : ''"></text> {{v.num_up}}
+								</view>
+								<view class="icon-display"  @click="updateComment(item.id, v.id, v.uid)">
+									<text class="cuIcon-messagefill margin-lr-xs"></text>
+								</view>
 							</view>
 						</view>
 					</view>
 				</view>
+				<view class="text-grey flex solid-bottom padding justify-center more" @click="getMore" v-if="item.child_total > 1">{{more}}</view>
 			</view>
 		</view>
 		<view v-if="show">
-			<communityPush :title="title" :is_upload="false" @hideModal="hideModal" @getRefresh="getRefresh" :cate_id="cate_id" :type="type" :type_id="type_id"></communityPush>
+			<communityPush :title="title" :is_upload="false" @hideModal="hideModal" @getRefresh="getRefresh" :cate_id="cate_id" :type="type" :type_id="type_id" :to_id="to_id" :to_uid="to_uid"></communityPush>
 		</view>
 	</view>
 </template>
@@ -88,8 +90,12 @@
 		components:{
 			communityPush
 		},
-		mounted() {
-			this.getData(1, 20, this.item.id);
+		created() {
+			this.more = '展开'+(this.item.child_total-1)+'条回复';
+			if (this.item.child_total > 0) {
+				this.id = this.item.child[0].id;
+			}
+			this.child = this.item.child;
 		},
 		data() {
 			return {
@@ -98,50 +104,94 @@
 				showPop: false,
 				type : 20,
 				type_id : 0,
-				fetch: {
-					info : [],
-				},
+				to_id : 0,
+				to_uid : 0,
+				page : 1,
+				num : 5,
+				more : '',
+				id : 0,
+				child : [],
 			};
 		},
 		methods: {
 			getRefresh : function(cate_id, type, type_id) {
-				this.getData(1, type, type_id);
+				this.item.num_comment++;
+				this.getMore(1, 1);
 			},
-			getData : function(page, type, type_id) {
+			getMore : function(page, push) {
 				var self = this;
-				this.Dever.get(this, 'app/community/?l=api.info', {cate_id:self.cate_id, type:type, type_id:type_id}, function(t) {
+				if (page && typeof(page) != 'object') {
+					self.page = page;
+				}
+				
+				if (self.page > 1 && self.more == '收起') {
+					// 收起
+					self.item.child = self.child;
+					self.more = '展开'+(self.item.child_total-1)+'条回复';
+					self.page = 1;
+					return;
+				}
+				
+				var send = {cate_id:self.cate_id, type:self.type, type_id:self.item.id, pg:self.page, noconcat:true};
+				send.id = self.id;
+				this.Dever.get(this, 'app/community/?l=api.info', send, function(t) {
+					if (self.page == 1) {
+						self.item.child = self.child;
+					}
+					
+					if (t.info && t.info.length > 0) {
+						self.item.child = self.item.child.concat(t.info);
+						self.page = self.page + 1;
+					}
+					if (self.Dever.pageData.status == 0) {
+						self.more = '收起';
+					} else {
+						self.more = '展开更多回复';
+					}
 					self.hideModal();
 				});
 			},
-			updateUp : function() {
-				let that = this;
-				if (that.item.is_oppose) {
+			updateUp : function(item) {
+				var self = this;
+				if (item.is_oppose) {
 					return;
 				}
-				if (that.item.is_up) {
-					that.item.num_up--;
-					that.item.is_up = false;
+				if (item.is_up) {
+					item.num_up--;
+					item.is_up = false;
 				} else {
-					that.item.num_up++;
-					that.item.is_up = true;
+					item.num_up++;
+					item.is_up = true;
 				}
+				self.Dever.post('app/community/?l=api.up', {id:item.id,noloading:1});
 			},
-			updateOppose : function() {
-				let that = this;
-				if (that.item.is_up) {
+			updateOppose : function(item) {
+				var self = this;
+				if (item.is_up) {
 					return;
 				}
-				if (that.item.is_oppose) {
-					that.item.num_oppose--;
-					that.item.is_oppose = false;
+				if (item.is_oppose) {
+					item.num_oppose--;
+					item.is_oppose = false;
 				} else {
-					that.item.num_oppose++;
-					that.item.is_oppose = true;
+					item.num_oppose++;
+					item.is_oppose = true;
 				}
+				self.Dever.post('app/community/?l=api.oppose', {id:item.id,noloading:1});
 			},
-			updateComment : function (type, type_id) {
-				this.type = type;
+			updateComment : function (type_id, to_id, to_uid) {
+				this.type = this.type;
 				this.type_id = type_id;
+				if (to_id) {
+					this.to_id = to_id;
+				} else {
+					this.to_id = 0;
+				}
+				if (to_uid) {
+					this.to_uid = to_uid;
+				} else {
+					this.to_uid = 0;
+				}
 				this.show = true;
 			},
 			hideModal : function () {
@@ -158,8 +208,14 @@
 .cu-list.menu-avatar>.cu-item:after, .cu-list.menu>.cu-item:after {
 	border: 0px;
 }
+.text-content-margin {
+	margin-top:10rpx;
+}
 .icon-display {
 	display: inline;
 	margin-left: 20rpx;
 }
+.more {
+	margin-top:-40rpx;
+}
 </style>

+ 191 - 0
lib/dever/components/drawer.vue

@@ -0,0 +1,191 @@
+<template name="drawer">
+	<view :style="{background:background,zIndex:zIndex, top:top+'px'}">
+		<view class="DrawerClose" :class="show ? 'show':''" @tap="hideModal">
+			<text class="cuIcon-pullright"></text>
+		</view>
+		<scroll-view scroll-y class="DrawerWindow" :class="show ? 'show':''" :style="{width:width,padding:padding, zIndex:zIndex+1, background:slotBg}" @tap.stop="stopFun" @touchstart="Dever.slide" @touchend="end">
+			<view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg" v-if="show">
+				<slot name="links"></slot>
+			</view>
+		</scroll-view>
+	</view>
+</template>
+
+<script>
+export default {
+	name: "graceDrawer",
+	props: {
+		show : {
+			type : Boolean,
+			default : false
+		},
+		direction : {
+			type : String,
+			default : 'left'
+		},
+		width : {
+			type : String,
+			default : '60%'
+		},
+		background:{
+			type : String,
+			default : 'rgba(0, 0, 0, 0.5)'
+		},
+		slotBg:{
+			type : String,
+			default : 'rgba(255, 255, 255, 1)'
+		},
+		padding :{
+			type : String,
+			default : '30rpx'
+		},
+		zIndex : {
+			type : Number,
+			default : 1
+		},
+		// #ifdef H5
+		top:{
+			type : Number,
+			default : 44
+		},
+		// #endif
+		// #ifndef H5
+		top:{
+			type : Number,
+			default : 0
+		},
+		// #endif
+	},
+	data() {
+		return {
+			
+		};
+	},
+	methods:{
+		closeDrawer : function(){
+			this.$emit('closeDrawer');
+		},
+		end : function(e) {
+			var type = this.Dever.slideEnd(e);
+			if (type == 3 || type == 4) {
+				this.closeDrawer();
+			}
+		},
+		showModal : function(e) {
+			this.show = true;
+		},
+		hideModal : function(e) {
+			this.closeDrawer();
+		},
+		stopFun : function() {
+			
+		}
+	}
+}
+</script>
+
+<style>
+	page {
+		background-image: var(--gradualBlue);
+		width: 100vw;
+		overflow: hidden;
+	}
+
+	.DrawerPage {
+		position: fixed;
+		width: 100vw;
+		height: 100vh;
+		left: 0vw;
+		background-color: #f1f1f1;
+		transition: all 0.4s;
+	}
+
+	.DrawerPage.show {
+		transform: scale(0.9, 0.9);
+		left: 85vw;
+		box-shadow: 0 0 60upx rgba(0, 0, 0, 0.2);
+		transform-origin: 0;
+	}
+
+	.DrawerWindow {
+		position: absolute;
+		width: 85vw;
+		height: 100vh;
+		left: 0;
+		top: 0;
+		transform: scale(0.9, 0.9) translateX(-100%);
+		opacity: 0;
+		pointer-events: none;
+		transition: all 0.4s;
+	}
+
+	.DrawerWindow.show {
+		transform: scale(1, 1) translateX(0%);
+		opacity: 1;
+		pointer-events: all;
+	}
+
+	.DrawerClose {
+		position: absolute;
+		width: 40vw;
+		height: 100vh;
+		right: 0;
+		top: 0;
+		color: transparent;
+		padding-bottom: 30upx;
+		display: flex;
+		align-items: flex-end;
+		justify-content: center;
+		background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.6));
+		letter-spacing: 5px;
+		font-size: 50upx;
+		opacity: 0;
+		pointer-events: none;
+		transition: all 0.4s;
+	}
+
+	.DrawerClose.show {
+		opacity: 1;
+		pointer-events: all;
+		width: 15vw;
+		color: #fff;
+	}
+
+	.DrawerPage .cu-bar.tabbar .action button.cuIcon {
+		width: 64upx;
+		height: 64upx;
+		line-height: 64upx;
+		margin: 0;
+		display: inline-block;
+	}
+
+	.DrawerPage .cu-bar.tabbar .action .cu-avatar {
+		margin: 0;
+	}
+
+	.DrawerPage .nav {
+		flex: 1;
+	}
+
+	.DrawerPage .nav .cu-item.cur {
+		border-bottom: 0;
+		position: relative;
+	}
+
+	.DrawerPage .nav .cu-item.cur::after {
+		content: "";
+		width: 10upx;
+		height: 10upx;
+		background-color: currentColor;
+		position: absolute;
+		bottom: 10upx;
+		border-radius: 10upx;
+		left: 0;
+		right: 0;
+		margin: auto;
+	}
+
+	.DrawerPage .cu-bar.tabbar .action {
+		flex: initial;
+	}
+</style>

+ 16 - 8
lib/dever/index.js

@@ -83,7 +83,8 @@ var http = {
 			config.request.url = url;
 		}
 		var loading_method = config.request.method;
-		if (options && options.page && options.page > 0) {
+		if (options && options.page && options.page > 0) {
+			options.pg = options.page;
 			loading_method = 'page';
 		}
 		if (config.request.url.indexOf('http') == -1) {
@@ -94,7 +95,12 @@ var http = {
 			config.request.complete = (response) => {
 				dever.debug(response);
 				if (response.statusCode === 200) {
-					if (response.data.code == '0') {
+					if (response.data.code == '0') {
+						if (response.data.page) {
+							dever.pageData = response.data.page;
+						} else {
+							dever.pageData = {};
+						}
 						if (options.page && options.page > 0 && !options.noconcat) {
 							page.state = true;
 							if (page.key && response.data.data[page.key].length > 0) {
@@ -129,12 +135,12 @@ var http = {
 							   }
 								return;
 							}
-						}
+						}
+						
 						resolve(response.data.data);
 					} else if (response.data.code == '-1') {
 						//退出登录
 						self.setToken('');
-						console.info(dever);
 						dever.location('index/index', 'go');
 						reject(response.data)
 					} else {
@@ -535,7 +541,8 @@ var dever = {
 	getLoadingState : {},
 	getLoadingCall : false,
 	postLoadingCall : false,
-	pageLoadingCall : false,
+	pageLoadingCall : false,
+	pageData : {},
 	lastGetUrl : '',
 	showLoad : false,
 	btnText : '确定提交',
@@ -682,11 +689,12 @@ var dever = {
 				callback(this);
 			}
 		} else if (method == 'page') {
-			state = true;
+			//state = true;
 			if (options.page && options.page > 1) {
 				state = false;
 			}
-			if (this.pageLoadingCall && this.pageLoadingCall.yes) {
+			if (this.pageLoadingCall && this.pageLoadingCall.yes) {
+				
 				state = true;
 				var callback = this.pageLoadingCall.yes;
 				callback(this);
@@ -723,7 +731,7 @@ var dever = {
 				callback(this);
 			}
 		} else if (method == 'page') {
-			state = true;
+			//state = true;
 			if (options.page && options.page > 1) {
 				state = false;
 			}

File diff suppressed because it is too large
+ 21 - 0
lib/uni-load-more/uni-load-more.vue


+ 4 - 2
main.js

@@ -33,7 +33,8 @@ var defaultConfig = {
 	'update_time' : false,
 };
 Vue.prototype.Dever.init('', Vue, defaultConfig);
-
+
+/*
 //自定义get的loading效果,设置全屏loading
 Vue.prototype.Dever.setGetLoading(function(self) {
 	self.vue.prototype.pageLoading = true;
@@ -48,7 +49,8 @@ Vue.prototype.Dever.setPostLoading(function(self) {
 }, function(self) {
 	self.btnFinish();
 	uni.hideLoading();
-});
+});
+*/
 
 //设置switchTab
 Vue.prototype.Dever.switchTab = ['index/index'];

+ 2 - 1
pages.json

@@ -37,7 +37,8 @@
             		"titleNView": false,
             		"bounce": "none",
             		"navigationStyle": "custom"
-            	}
+            	},
+				"onReachBottomDistance":126 //距离底部多远时触发 单位px
             }
         },
 		{

+ 142 - 18
pages/dream/view.vue

@@ -1,24 +1,26 @@
 <template>
 	<gracePage :customHeader="false">
-		<view class="container" slot="gBody">
-			<swiper class="swiper" @change="change" :circular="swiper.circular" :current="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">
-						<dream ref="dream" @cate="cate" @community="community" :index="k" :item="v" :control="control" class="item"></dream>
-					</scroll-view>
-				</swiper-item>
-			</swiper>
-			<graceDrawer :show="cate_drawer.show" :zIndex="cate_drawer.index" padding="cate_drawer.padding" :top="cate_drawer.top" direction="left" width="100%" v-on:closeDrawer="closeCate">
+		<view class="container" slot="gBody">
+			<view class="DrawerPage"  :class="drawer ? 'show':''">
+				<swiper class="swiper" @change="change" :circular="swiper.circular" :current="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">
+							<dream ref="dream" @cate="cate" @community="community" :index="k" :item="v" :control="control" class="item"></dream>
+						</scroll-view>
+					</swiper-item>
+				</swiper>
+			</view>
+			<drawer :show="cate_drawer.show" :zIndex="cate_drawer.index" padding="cate_drawer.padding" :top="cate_drawer.top" direction="left" :width="drawer_width" v-on:closeDrawer="closeCate">
 				<view slot="links">
-					<cate ref="cate" @goIndex="goIndex" :index="index" :content_id="content_id" :info_id="fetch.info_id" :page_id="fetch.page_id" :parent_page_id="fetch.parent_page_id"></cate>
+					<cate ref="cate" @goIndex="goIndex" :index="index" :content_id="content_id" :info_id="fetch.info_id" :page_id="fetch.page_id" :parent_page_id="fetch.parent_page_id" :fetch="cate_drawer.data"></cate>
 				</view>
-			</graceDrawer>
+			</drawer>
 			
-			<graceDrawer :show="community_drawer.show" :zIndex="community_drawer.index" padding="community_drawer.padding" :top="community_drawer.top" direction="right" width="100%" v-on:closeDrawer="closeCommunity">
+			<drawer :show="community_drawer.show" :zIndex="community_drawer.index" padding="community_drawer.padding" :top="community_drawer.top" direction="right" :width="drawer_width" v-on:closeDrawer="closeCommunity">
 				<view slot="links">
-					<community ref="community" @goIndex="goIndex" :index="index" :content_id="content_id" :info_id="fetch.info_id" :page_id="fetch.page_id" :parent_page_id="fetch.parent_page_id" :type="community_drawer.type" :type_id="content_id"></community>
+					<community :width="drawer_width" ref="community" @goIndex="goIndex" :index="index" :content_id="content_id" :info_id="fetch.info_id" :page_id="fetch.page_id" :parent_page_id="fetch.parent_page_id" :type="community_drawer.type" :type_id="content_id"></community>
 				</view>
-			</graceDrawer>
+			</drawer>
 		</view>
 	</gracePage>
 </template>
@@ -26,6 +28,7 @@
 import cate from "@/pages/dream/view/cate.vue";
 import community from "@/pages/dream/view/community.vue";
 import dream from "@/pages/dream/view/dream.vue";
+import drawer from "@/lib/dever/components/drawer.vue";
 var graceRichText = require("@/lib/graceUI/jsTools/richText.js");
 export default{
 	data() {
@@ -50,6 +53,7 @@ export default{
 				top: 0,
 				padding: '0rpx',
 				show : false,
+				data : {},
 			},
 			community_drawer : {
 				index : 5,
@@ -57,7 +61,9 @@ export default{
 				padding: '0rpx',
 				show : false,
 				type : 3,
-			},
+			},
+			drawer : false,
+			drawer_width : '86%',
 		}
 	},
 	onLoad(option) {
@@ -75,6 +81,13 @@ export default{
 		} else {
 			this.getData();
 		}
+	},
+	// 触底刷新
+	onReachBottom: function() {
+		console.info(222);
+		if (this.community_drawer.show == true) {
+			this.$refs.community.getInfo(false, 2);
+		}
 	},
 	methods:{
 		change : function(e) {
@@ -101,7 +114,16 @@ export default{
 			this.Dever.location('dream/view?id=1');
 		},
 		getData : function() {
-			this.Dever.get(this, 'app/collection/?l=api.getContent', {id:this.id, page_id:this.page_id});
+			var self = this;
+			this.Dever.get(this, 'app/collection/?l=api.getContent', {id:this.id, page_id:this.page_id}, function(t) {
+				self.getCate(t);
+			});
+		},
+		getCate : function(info) {
+			var self = this;
+			this.Dever.get(this, 'app/collection/?l=api.category', {id:info.info_id, parent_page_id:info.parent_page_id, page_id:info.page_id, noloading:1}, function(t) {
+				self.cate_drawer.data = t;
+			});
 		},
 		goIndex : function(index) {
 			this.index = index;
@@ -113,16 +135,20 @@ export default{
 		cate : function() {
 			this.getContentId();
 			this.cate_drawer.show = !this.cate_drawer.show;
+			this.drawer = !this.drawer;
 		},
 		closeCate : function() {
 			this.cate_drawer.show = false;
+			this.drawer = false;
 		},
 		community : function() {
 			this.getContentId();
 			this.community_drawer.show = !this.community_drawer.show;
+			this.drawer = !this.drawer;
 		},
 		closeCommunity : function() {
 			this.community_drawer.show = false;
+			this.drawer = false;
 		},
 		getContentId : function() {
 			this.content_id = this.fetch.items[this.swiper.index].id;
@@ -130,7 +156,7 @@ export default{
 		
 	},
 	components:{
-		dream,cate,community
+		dream,cate,community,drawer
 	}
 }
 </script>
@@ -156,5 +182,103 @@ swiper-item image{
 }
 .scroll-height {
 	height:100%;
-}
+}
+.DrawerPage {
+		position: fixed;
+		width: 100vw;
+		height: 100vh;
+		left: 0vw;
+		background-color: #f1f1f1;
+		transition: all 0.4s;
+	}
+
+	.DrawerPage.show {
+		transform: scale(0.9, 0.9);
+		left: 85vw;
+		box-shadow: 0 0 60upx rgba(0, 0, 0, 0.2);
+		transform-origin: 0;
+	}
+
+	.DrawerWindow {
+		position: absolute;
+		width: 85vw;
+		height: 100vh;
+		left: 0;
+		top: 0;
+		transform: scale(0.9, 0.9) translateX(-100%);
+		opacity: 0;
+		pointer-events: none;
+		transition: all 0.4s;
+		padding: 100upx 0;
+	}
+
+	.DrawerWindow.show {
+		transform: scale(1, 1) translateX(0%);
+		opacity: 1;
+		pointer-events: all;
+	}
+
+	.DrawerClose {
+		position: absolute;
+		width: 40vw;
+		height: 100vh;
+		right: 0;
+		top: 0;
+		color: transparent;
+		padding-bottom: 30upx;
+		display: flex;
+		align-items: flex-end;
+		justify-content: center;
+		background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.6));
+		letter-spacing: 5px;
+		font-size: 50upx;
+		opacity: 0;
+		pointer-events: none;
+		transition: all 0.4s;
+	}
+
+	.DrawerClose.show {
+		opacity: 1;
+		pointer-events: all;
+		width: 15vw;
+		color: #fff;
+	}
+
+	.DrawerPage .cu-bar.tabbar .action button.cuIcon {
+		width: 64upx;
+		height: 64upx;
+		line-height: 64upx;
+		margin: 0;
+		display: inline-block;
+	}
+
+	.DrawerPage .cu-bar.tabbar .action .cu-avatar {
+		margin: 0;
+	}
+
+	.DrawerPage .nav {
+		flex: 1;
+	}
+
+	.DrawerPage .nav .cu-item.cur {
+		border-bottom: 0;
+		position: relative;
+	}
+
+	.DrawerPage .nav .cu-item.cur::after {
+		content: "";
+		width: 10upx;
+		height: 10upx;
+		background-color: currentColor;
+		position: absolute;
+		bottom: 10upx;
+		border-radius: 10upx;
+		left: 0;
+		right: 0;
+		margin: auto;
+	}
+
+	.DrawerPage .cu-bar.tabbar .action {
+		flex: initial;
+	}
 </style>

+ 9 - 8
pages/dream/view/cate.vue

@@ -62,24 +62,23 @@ export default {
 			type : String,
 			value : null
 		},
-		index : 0
+		index : 0,
+		fetch : {
+			type : Object,
+			value : null
+		},
 	},
 	data() {
 		return {
-			fetch: {
-				cate : [],
-				show : {},
-				child : [],
-			},
 			swiperList: [],
 		}
 	},
-	mounted() {
+	created() {
 		this.getData();
 	},
 	methods:{
 		getData : function() {
-			this.Dever.get(this, 'app/collection/?l=api.category', {id:this.info_id, parent_page_id:this.parent_page_id, page_id:this.page_id});
+			
 		},
 		choose : function(id) {
 			if (this.fetch.show[id] == 1) {
@@ -117,6 +116,7 @@ export default {
 			position: absolute;
 			top: 0;
 			bottom: 0;
+			left: 0;
 
 			.left-wrapper {
 				width: 200rpx;
@@ -220,6 +220,7 @@ export default {
 
 									.product-title {
 										font-size: 23rpx;
+										height: 50rpx;
 									}
 								}
 							}

+ 29 - 13
pages/dream/view/community.vue

@@ -2,17 +2,17 @@
 	<view class="home">
 		<view class="card-bottom">
 			<!-- 顶部分页栏 -->
-			<view class="top-tab">
+			<view class="top-tab" :style="{width:width}">
 				<view :class="['tab-item flex-center', activeTab == k ? 'active' : '']" @tap="handleTab(k)" v-for="(v, k) in fetch.cate" :key="k">{{ v.name }}</view>
 			</view>
 			<view class="scroll-wrapper">
 				<view class="margin-bottom" v-for="(v, k) in fetch.info" :key="k">
-					<y-DiaryItem :item="v" :cate_id="cate_id"/>
+					<y-DiaryItem :item="v" :cate_id="cate_id" :key="v.server_time"/>
 				</view>
-				<y-LoadMore :status="loadMoreStatus" />
+				<uni-load-more :status="more" @clickLoadMore="clickLoadMore" :contentText="contentText"></uni-load-more>
 			</view>
 			<!-- 右下角按钮 -->
-			<y-Fab :bottom="140" :right="40" @click="showModal" v-if="button_show"/>
+			<y-Fab :bottom="20" :right="20" @click="showModal" v-if="button_show"/>
 		</view>
 		
 		<view v-if="show">
@@ -23,6 +23,7 @@
 
 <script>
 import communityPush from "@/pages/dream/view/communityPush";
+import uniLoadMore from "@/lib/uni-load-more/uni-load-more.vue"
 export default {
 	name: "community",
 	props: {
@@ -50,6 +51,10 @@ export default {
 			type : String,
 			value : null
 		},
+		width : {
+			type : String,
+			default : '100%'
+		},
 		index : 0
 	},
 	data() {
@@ -63,14 +68,12 @@ export default {
 			},
 			cate_id : 0,
 			activeTab: 0,
-			loadMoreStatus: 1,
+			contentText : {contentdown: "展开更多",contentrefresh: "正在加载...",contentnomore: "没有更多数据了"},
+			more : 'more',
 		};
 	},
 	created() {
 		this.getData();
-	},
-	onReachBottom() {
-		
 	},
 	methods:{
 		getRefresh : function(cate_id, type, type_id) {
@@ -86,12 +89,22 @@ export default {
 		},
 		getInfo : function(cate_id, page) {
 			var self = this;
+			if (!cate_id) {
+				cate_id = self.cate_id;
+			}
+			if (page != 1 && self.more == 'noMore') {
+				return;
+			}
 			self.cate_id = cate_id;
-			this.Dever.get(this, 'app/community/?l=api.info', {cate_id:cate_id, type:this.type, type_id:this.type_id}, function(t) {
-				if (t && t.info.length > 0) {
-					self.loadMoreStatus = 2;
+			self.more = 'loading';
+			this.Dever.page([page, 'info'], this, 'app/community/?l=api.info', {cate_id:cate_id, type:this.type, type_id:this.type_id}, function(t) {
+				if (self.Dever.pageData.status == 1) {
+					self.more = 'more';
 				} else {
-					self.loadMoreStatus = 3;
+					self.more = 'noMore';
+				}
+				if (page == 1 && !self.Dever.pageData.total) {
+					self.fetch.info = [];
 				}
 				self.hideModal();
 			});
@@ -110,10 +123,13 @@ export default {
 		hideModal : function () {
 			this.show = false;
 			this.button_show = true;
+		},
+		clickLoadMore : function(e) {
+			this.getInfo(false, 2);
 		}
 	},
 	components:{
-		communityPush
+		communityPush,uniLoadMore
 	}
 }
 </script>

+ 6 - 2
pages/dream/view/communityPush.vue

@@ -10,7 +10,7 @@
 			<view class="padding-xl">
 				<view class="publish-wrap bg-white">
 					<view class="input-box padding-sm">
-						<textarea class="area-top" placeholder="碎碎念..." v-model="content"></textarea>
+						<textarea class="area-top" placeholder="写点啥..." v-model="content"></textarea>
 					</view>
 					<view class="cu-form-group img-box" v-if="is_upload">
 						<view class="next-title">上传图片(最多{{total}}张)</view>
@@ -48,7 +48,9 @@
 			title : '',
 			cate_id : null,
 			type : null,
-			type_id : null,
+			type_id : 0,
+			to_id : 0,
+			to_uid : 0,
 			index : 0,
 			is_upload : true,
 		},
@@ -79,6 +81,8 @@
 				data.cate_id = this.cate_id;
 				data.type = this.type;
 				data.type_id = this.type_id;
+				data.to_id = this.to_id;
+				data.to_uid = this.to_uid;
 				this.Dever.post('app/community/?l=api.add', data, function(t) {
 					self.getRefresh();
 				});

Some files were not shown because too many files changed in this diff