dever 4 tahun lalu
induk
melakukan
7a83547f74

+ 226 - 226
lib/community/y-DiaryItem/y-DiaryItem.vue

@@ -1,227 +1,227 @@
-<template>
-	<view class="cu-card dynamic no-card">
-		<view class="cu-item shadow">
-			<view class="cu-list menu-avatar">
-				<view class="cu-item">
-					<image :src="item.user.avatar" mode="widthFix" class="cu-avatar round lg" @click="Dever.viewPic([item.user.avatar], item.user.avatar)"></image>
-					<view class="content flex-sub">
-						<view><text v-if="item.user.author" style="margin-right:10rpx;color: #00B3FF;">[{{item.user.author}}]</text>{{ item.user.username }}<text v-if="item.user.title" style="margin-left:10rpx">({{item.user.title}})</text></view>
-						<view class="text-gray text-sm flex justify-between">
-							{{ item.cdate_string }}
-						</view>
-					</view>
-				</view>
-			</view>
-			<view class="text-content">
-				{{ 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 && 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-if="child">
-					</view>
-				</view>
-				
-				<view class="grid flex-sub padding-lr col-3 grid-square" v-if="item.pic.length > 1">
-					<view @tap.stop @tap="Dever.viewPic(item.pic, child)" class="bg-img" :style="{backgroundImage: 'url('+child+')'}"
-					 v-for="(child, idx) in item.pic" :key="idx">
-					</view>
-					
-				</view>
-			</view>
-			
-			<view class="text-gray text-sm text-right padding">
-				<text class="text-gray text-sm text-left sign" v-if="item.user.info">{{item.user.info}}</text>
-				<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(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(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="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"><text v-if="v.user.author" style="margin-right:10rpx;">[{{v.user.author}}]</text>{{v.user.username}}<text v-if="v.user.title" style="margin-left:10rpx">({{v.user.title}})</text></view>
-						<view class="text-content text-df text-content-margin">
-							<text class="text-grey" v-if="v.to_uid > 0">回复@<text v-if="v.user.author">[{{v.user.author}}]</text>{{v.to_user.username}}:</text> {{v.content}}
-						</view>
-						<view class="margin-top-sm flex justify-between">
-							<view class="text-gray text-df" style="width: max-content;">{{v.cdate_string}}</view>
-							<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">
-			<dever-publish :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"></dever-publish>
-		</view>
-	</view>
-</template>
-
-<script>
-	import deverPublish from '@/lib/dever/components/publish.vue';
-	export default {
-		props: {
-			item: {
-				type: Object
-			},
-			radius:{
-				type: Boolean,
-				default: false
-			},
-			cate_id : null,
-		},
-		components:{
-			deverPublish
-		},
-		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 {
-				title : '回复话题',
-				show : false,
-				showPop: false,
-				type : 20,
-				type_id : 0,
-				to_id : 0,
-				to_uid : 0,
-				page : 1,
-				num : 5,
-				more : '',
-				id : 0,
-				child : [],
-			};
-		},
-		methods: {
-			getRefresh : function(cate_id, type, type_id) {
-				this.item.num_comment++;
-				this.getMore(1, 1);
-			},
-			getMore : function(page, push) {
-				var self = this;
-				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.code = self.Dever.config.code;
-				send.info_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(item) {
-				var self = this;
-				if (item.is_oppose) {
-					return;
-				}
-				if (item.is_up) {
-					item.num_up--;
-					item.is_up = false;
-				} else {
-					item.num_up++;
-					item.is_up = true;
-				}
-				self.Dever.post('app/community/?l=api.up', {id:item.id,noloading:1});
-			},
-			updateOppose : function(item) {
-				var self = this;
-				if (item.is_up) {
-					return;
-				}
-				if (item.is_oppose) {
-					item.num_oppose--;
-					item.is_oppose = false;
-				} else {
-					item.num_oppose++;
-					item.is_oppose = true;
-				}
-				self.Dever.post('app/community/?l=api.oppose', {id:item.id,noloading:1});
-			},
-			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 () {
-				this.show = false;
-			}
-		}
-	};
-</script>
-
-<style lang="less" scoped>
-.cu-card {
-	
-}
-.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;
-}
-.sign {
-	float: left;
-}
+<template>
+	<view class="cu-card dynamic no-card">
+		<view class="cu-item shadow">
+			<view class="cu-list menu-avatar">
+				<view class="cu-item">
+					<image :src="item.user.avatar" mode="widthFix" class="cu-avatar round lg" @click="Dever.viewPic([item.user.avatar], item.user.avatar)"></image>
+					<view class="content flex-sub">
+						<view><rich-text type="text" :nodes="item.user.username_text"></rich-text><text v-if="item.user.title" style="margin-left:10rpx">({{item.user.title}})</text></view>
+						<view class="text-gray text-sm flex justify-between">
+							{{ item.cdate_string }}
+						</view>
+					</view>
+				</view>
+			</view>
+			<view class="text-content">
+				{{ 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 && 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-if="child">
+					</view>
+				</view>
+				
+				<view class="grid flex-sub padding-lr col-3 grid-square" v-if="item.pic.length > 1">
+					<view @tap.stop @tap="Dever.viewPic(item.pic, child)" class="bg-img" :style="{backgroundImage: 'url('+child+')'}"
+					 v-for="(child, idx) in item.pic" :key="idx">
+					</view>
+					
+				</view>
+			</view>
+			
+			<view class="text-gray text-sm text-right padding">
+				<text class="text-gray text-sm text-left sign" v-if="item.user.info">{{item.user.info}}</text>
+				<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(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(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="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"><rich-text type="text" :nodes="v.user.username_text"></rich-text><text v-if="v.user.title" style="margin-left:10rpx">({{v.user.title}})</text></view>
+						<view class="text-content text-df text-content-margin">
+							<text class="text-grey" v-if="v.to_uid > 0">回复@<text v-if="v.to_user.author">[{{v.to_user.author}}]</text>{{v.to_user.username}}:</text> {{v.content}}
+						</view>
+						<view class="margin-top-sm flex justify-between">
+							<view class="text-gray text-df" style="width: max-content;">{{v.cdate_string}}</view>
+							<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">
+			<dever-publish :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"></dever-publish>
+		</view>
+	</view>
+</template>
+
+<script>
+	import deverPublish from '@/lib/dever/components/publish.vue';
+	export default {
+		props: {
+			item: {
+				type: Object
+			},
+			radius:{
+				type: Boolean,
+				default: false
+			},
+			cate_id : null,
+		},
+		components:{
+			deverPublish
+		},
+		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 {
+				title : '回复话题',
+				show : false,
+				showPop: false,
+				type : 20,
+				type_id : 0,
+				to_id : 0,
+				to_uid : 0,
+				page : 1,
+				num : 5,
+				more : '',
+				id : 0,
+				child : [],
+			};
+		},
+		methods: {
+			getRefresh : function(cate_id, type, type_id) {
+				this.item.num_comment++;
+				this.getMore(1, 1);
+			},
+			getMore : function(page, push) {
+				var self = this;
+				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.code = self.Dever.config.code;
+				send.info_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(item) {
+				var self = this;
+				if (item.is_oppose) {
+					return;
+				}
+				if (item.is_up) {
+					item.num_up--;
+					item.is_up = false;
+				} else {
+					item.num_up++;
+					item.is_up = true;
+				}
+				self.Dever.post('app/community/?l=api.up', {id:item.id,noloading:1});
+			},
+			updateOppose : function(item) {
+				var self = this;
+				if (item.is_up) {
+					return;
+				}
+				if (item.is_oppose) {
+					item.num_oppose--;
+					item.is_oppose = false;
+				} else {
+					item.num_oppose++;
+					item.is_oppose = true;
+				}
+				self.Dever.post('app/community/?l=api.oppose', {id:item.id,noloading:1});
+			},
+			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 () {
+				this.show = false;
+			}
+		}
+	};
+</script>
+
+<style lang="less" scoped>
+.cu-card {
+	
+}
+.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;
+}
+.sign {
+	float: left;
+}
 </style>

+ 8 - 6
lib/community/y-Fab/y-Fab.vue

@@ -138,12 +138,14 @@
 					this.$emit("click", {
 						index: index
 					})
-					var key = this.btnList[index].key;
-					
-					if (key == 'bgm') {
-						this.Dever.bgm().control();
-					} else {
-						this.isOpen = false
+					if (this.btnList.length) {
+						var key = this.btnList[index].key;
+						
+						if (key == 'bgm') {
+							this.Dever.bgm().control();
+						} else {
+							this.isOpen = false
+						}
 					}
 				}
 				if (!this.isOpen) {

+ 1 - 1
lib/dever/config.js

@@ -33,7 +33,7 @@ const request = {
 
 //上传配置
 const upload = {
-	url: request.host + 'package/upload/?l=save.start',
+	url: request.host + 'package/upload/?l=save.start&key=6',
 	name: 'file',
 }
 

+ 9 - 9
lib/dever/index.js

@@ -1729,13 +1729,13 @@ var dever = {
 	
 	//滑动
 	slide : function(e) {
-		this.slideValue = {};
+		dever.slideValue = {};
 		if (e.changedTouches[0].clientX) {
-			this.slideValue.clientX = e.changedTouches[0].clientX;
-			this.slideValue.clientY = e.changedTouches[0].clientY;
+			dever.slideValue.clientX = e.changedTouches[0].clientX;
+			dever.slideValue.clientY = e.changedTouches[0].clientY;
 		} else {
-			this.slideValue.clientX = e.changedTouches[0].screenX;
-			this.slideValue.clientY = e.changedTouches[0].screenY; 
+			dever.slideValue.clientX = e.changedTouches[0].screenX;
+			dever.slideValue.clientY = e.changedTouches[0].screenY; 
 		}
 		
 	},
@@ -1743,11 +1743,11 @@ var dever = {
 	//滑动结束
 	slideEnd : function(e) {
 		if (e.changedTouches[0].clientX) {
-			var subX = e.changedTouches[0].clientX - this.slideValue.clientX;
-			var subY = e.changedTouches[0].clientY - this.slideValue.clientY;
+			var subX = e.changedTouches[0].clientX - dever.slideValue.clientX;
+			var subY = e.changedTouches[0].clientY - dever.slideValue.clientY;
 		} else {
-			var subX = e.changedTouches[0].screenX - this.slideValue.clientX;
-			var subY = e.changedTouches[0].screenY - this.slideValue.clientY;
+			var subX = e.changedTouches[0].screenX - dever.slideValue.clientX;
+			var subY = e.changedTouches[0].screenY - dever.slideValue.clientY;
 		}
 		
 		if (subY > 20) {

+ 8 - 7
pages/dream/view/momentItem.vue

@@ -5,7 +5,7 @@
 		</view>
 		
 		<view class="post_right">
-			<text class="post-username"><text v-if="item.user.author" style="margin-right:10rpx;color: #00B3FF;">[{{item.user.author}}]</text>{{item.user.username}}</text><text v-if="item.user.title" style="margin-left:10rpx">({{item.user.title}})</text>
+			<view class="post-username"><rich-text type="text" :nodes="item.user.username_text"></rich-text></view><view v-if="item.user.title" style="margin-left:10rpx">({{item.user.title}})</view>
 			<view class="paragraph">{{item.content}}</view>
 			<!-- 相册 -->
 			<view class="thumbnails" v-if="item.pic.length > 0 && item.pic[0]">
@@ -27,12 +27,12 @@
 			<view class="post-footer">
 				<view class="footer_content" v-if="item.up_list_total > 0">
 					<image class="liked" src="@/static/moment/liked.png"></image>
-					<text class="nickname" v-for="(v, k) in item.up_list.user" :key="k">{{v.username}}</text>
-					<text class="nickname" v-if="item.up_list.total > 0">还有{{item.up_list.total}}人点赞</text>
+					<view class="nickname" v-for="(v, k) in item.up_list.user" :key="k"><rich-text type="text" :nodes="v.username_text"></rich-text></view>
+					<view class="nickname" v-if="item.up_list.total > 0">还有{{item.up_list.total}}人点赞</view>
 				</view>
-				<view v-if="item.child.length" class="footer_content" v-for="(v, k) in item.child" :key="k" @tap="reply()">
-					<text class="comment-nickname">{{v.user.username}}: </text>
-					<text class="comment-content">{{v.content}}</text>
+				<view v-if="item.child.length" class="footer_content" v-for="(v, k) in item.child" :key="k" @tap="updateComment(item.id, v.id, v.uid)">
+					<view class="comment-nickname"><rich-text type="text" :nodes="v.user.username_text"></rich-text></view>
+					<view class="comment-content"><text class="text-grey" v-if="v.to_uid > 0">回复@<text v-if="v.to_user.author">[{{v.to_user.author}}]</text>{{v.to_user.username}}</text>: {{v.content}}</view>
 				</view>
 				<view class="text-grey flex solid-bottom padding justify-center more" style="padding: 8rpx;" @click="getMore" v-if="item.child_total > 1">{{more}}</view>
 			</view>
@@ -160,7 +160,8 @@
 					this.item.up_list.user['user_' + this.user.id] = {};
 					this.item.up_list.user['user_' + this.user.id]['id'] = this.user.id;
 					this.item.up_list.user['user_' + this.user.id]['username'] = this.user.username;
-					this.item.up_list.user['user_' + this.user.id]['author'] = this.user.author;
+					this.item.up_list.user['user_' + this.user.id]['author'] = this.user.author;
+					this.item.up_list.user['user_' + this.user.id]['username_text'] = this.user.username_text;
 					this.item.up_list_total += 1;
 				}
 				self.Dever.post('app/community/?l=api.up', {id:this.item.id,type:this.type,noloading:1});