306132416@qq.com 3 jaren geleden
bovenliggende
commit
f2d94604ef
4 gewijzigde bestanden met toevoegingen van 136 en 45 verwijderingen
  1. 6 6
      pages/index/activity/files.vue
  2. 130 39
      pages/index/activity/list.vue
  3. BIN
      static/files-icon/likes-empty.png
  4. BIN
      static/files-icon/likes.png

+ 6 - 6
pages/index/activity/files.vue

@@ -73,7 +73,7 @@
 				  'pdf':'../../../static/files-icon/pdf.png',
 				  'xlsx':'../../../static/files-icon/excel.png',
 				  'xls':'../../../static/files-icon/excel.png',
-				  'ppt':'../../../static/files-icon/ppt.png',
+				  'pptx':'../../../static/files-icon/ppt.png',
 				}
 			}
 		},
@@ -249,11 +249,6 @@
 		  chooseFile(){
 		  	//chooseMessageFile
 		  	let that = this;
-			uni.showLoading({
-				mask:true,
-				title:'上传中...',
-				icon:'none'
-			})  
 		  	uni.chooseMessageFile({
 		  	  count: 3,
 		  	  type: 'file',
@@ -275,6 +270,11 @@
 		  },
 		  uploadFileRequest(fileVal){
 		  	let that = this;
+			uni.showLoading({
+				mask:true,
+				title:'上传中...',
+				icon:'none'
+			})  
 			let md5Sign = md5(
 			  "method=" +"activity_file_upload" +"&timestamp=" +
 				getApp().globalData.globalTimestamp +"&secret=" +getApp().globalData.secret

+ 130 - 39
pages/index/activity/list.vue

@@ -2,33 +2,45 @@
   <view class="content">
 <!-- 	  <view>
 	  </view> -->
-	<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text" activeColor="#1c9bdc"></uni-segmented-control>
-    <view v-show="current == 0">
+	<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="text" activeColor="#1c9bdc" style="position: relative;">
+	</uni-segmented-control>
+	<text class="active-length-text">({{activiList.length || ''}})</text>
+	<text class="file-length-text">({{activeDesc.files_count || ''}})</text>
+	<text class="comment-length-text">({{activeDesc.comment_count || ''}})</text>
+	<view v-show="current == 0">
 		<view class="active-title-box">
 			<view class="header-title">{{activeDesc.name}}</view>
-			<view style="color: gray;margin-left: 3%;">{{activeDesc.start_time}}</view>
+			<view class="display-between" style="margin-left: 3%;">
+				<view style="color: gray;">{{activeDesc.start_time}}</view>
+				<view class="display-around items-center" style="margin-right: 3%;">
+					<image :src="activeDesc.like_member === '1' ? isLikes : isLikesEmpty" mode="aspectFit" @click.stop="likesFn(activeDesc.id,activeDesc.like_member)" style="width: 40rpx;height: 40rpx;margin-right: 10rpx;"></image>
+					<text>{{activeDesc.like_count}}</text>
+				</view>
+			</view>
 		</view>
 		<view class="active-box" v-for="(item,index) in activiList" :key="index" style="flex-direction: column;" :class="index===activiList.length-1?'marginB40':''">
 			<view class="active-header">
-			<!-- 	<view class="active-type">
-					<text style="margin: 0 auto;">头像</text>
-				</view> -->
-				<view class="active-content-box">
-					<view class="active-content margin-top-3">
-						<view class="active-name">{{item.author}}</view>
-						<!-- <view class="active-date">{{item.addtime}}</view> -->
+					<view class="active-content-box">
+						<view class="active-content margin-top-3">
+							<view class="active-content">
+								<view class="active-type-comment">
+									<image :src="item.avatar_url || '/static/auth-icon.png'" mode="aspectFit"></image>
+								</view>
+								<view class="active-name">{{item.author}}</view>
+							</view>
+							 <!-- <view class="active-date">{{item.addtime}}</view> -->
+						</view>
+						<view class="active-content" style="margin-top: 10rpx;">
+							<view class="active-date">{{item.addtime}}</view>
+						</view>
 					</view>
+				</view>
+				<view class="active-content-box margin-top-3">
 					<view class="active-content">
-						<view class="active-date">{{item.addtime}}</view>
+						<view class="active-title">{{item.content}}</view>
 					</view>
 				</view>
-			</view>
-			<view class="active-content-box">
-				<view class="active-content">
-					<view class="active-title">{{item.content}}</view>
-				</view>
-			</view>
-			<view class="active-content-box-img margin-top-3">
+				<view class="active-content-box-img margin-top-3">
 				<view v-for="(img,indexImg) in item.pic_list" :key="indexImg" class="marginR5">
 					<image :src="img.pic_url_resize" mode="aspectFill" @click="showLarge(item.pic_list,indexImg)"></image>
 				</view>
@@ -51,14 +63,21 @@
 	</view>
 	<view v-if="current == 1">
 		 <view class="active-box active-box-comment" v-for="(item,index) in fileList" :key="index" style="flex-direction: column;" :class="index===fileList.length-1?'marginB40':''">
-		 				<view class="active-header-comment">
-		 					<view class="active-content">
-		 						<view class="active-type-comment">
-		 							<image :src="item.avatar_url || '/static/auth-icon.png'" mode="aspectFit"></image>
-		 						</view>
-		 						<view class="active-name">{{item.author}}</view>
-		 					</view>
-		 					<view class="active-date-comment">{{item.addtime}}</view>
+		 			<view class="active-header-comment">
+							<view class="active-content-box">
+								<view class="active-content margin-top-3">
+									<view class="active-content">
+										<view class="active-type-comment">
+											<image :src="item.avatar_url || '/static/auth-icon.png'" mode="aspectFit"></image>
+										</view>
+										<view class="active-name">{{item.author}}</view>
+									</view>
+									 <!-- <view class="active-date">{{item.addtime}}</view> -->
+								</view>
+								<view class="active-content" style="margin-top: 10rpx;">
+									<view class="active-date">{{item.addtime}}</view>
+								</view>
+							</view>
 		 				</view>	
 		 				<view class="active-content-files files-class-box">
 						     	<view class="show-file-box display-evenly-column .items-center" v-for="(file,index) in item.file_list" :key="file.id" @click="()=>openFileFn(file.url)">
@@ -66,7 +85,9 @@
 						     		<view class="margin-top-3 file-font-box">{{file.name}}</view>
 						     	</view>
 						</view>
-						<view class="files-desc-box">{{item.content}}</view>
+						<view class="files-desc-box">
+							<view style="width:70rpx;">备注:</view><view>{{item.content}}</view>
+						</view>
 		 				<view class="edit-icon-box-comment">
 		 					  <image src="/static/edit-icon.png" mode="aspectFit" v-if="item.edit_auth" @click="goEditPage(item.id,'files')"></image>
 		 					  <image class="margin-right-0" src="/static/del-icon.png" mode="aspectFit" v-if="item.del_auth" @click="delProcess(item.id,'files')"></image>
@@ -77,21 +98,28 @@
 	<view v-if="current == 2">
 		 <view class="active-box active-box-comment" v-for="(item,index) in commentList" :key="index" style="flex-direction: column;" :class="index===commentList.length-1?'marginB40':''">
 				<view class="active-header-comment">
-					<view class="active-content">
-						<view class="active-type-comment">
-							<image :src="item.avatar_url" mode="aspectFit"></image>
+					<view class="active-content-box">
+						<view class="active-content margin-top-3">
+							<view class="active-content">
+								<view class="active-type-comment">
+									<image :src="item.avatar_url || '/static/auth-icon.png'" mode="aspectFit"></image>
+								</view>
+								<view class="active-name">{{item.author}}</view>
+							</view>
+							 <!-- <view class="active-date">{{item.addtime}}</view> -->
+						</view>
+						<view class="active-content" style="margin-top: 10rpx;">
+							<view class="active-date">{{item.addtime}}</view>
 						</view>
-						<view class="active-name">{{item.author}}</view>
 					</view>
-					<view class="active-date-comment">{{item.addtime}}</view>
 				</view>	
-				<view class="active-content-comment margin-top-1">{{item.content}}</view>
+				<view class="active-content-comment margin-top-3">{{item.content}}</view>
 				<view class="edit-icon-box-comment">
 					 <!-- <image src="/static/edit-icon.png" mode="aspectFit" v-if="item.edit_auth" @click="goEditPage(item.id,'comment')"></image> -->
 					  <image class="margin-right-0" src="/static/del-icon.png" mode="aspectFit" v-if="item.del_auth" @click="delProcess(item.id,'comment')"></image>
 				</view>
 		 </view>
-		<button class="footer-box-record" @click="goComment()">上传评论</button>
+		<button class="footer-box-record" @click="goComment()">添加评论</button>
 	</view>
     <share-modal  @closeShare="closeShare" :isShowShare="isShowShareModal" :class="{ shareParent: isShowShareModal}"></share-modal>
  
@@ -115,6 +143,8 @@ export default {
 	  branchId:'',
 	  recordId:'',
 	  activeDesc:{},
+	  isLikesEmpty:'../../../static/files-icon/likes-empty.png',
+	  isLikes:'../../../static/files-icon/likes.png',
 	  activiList:[],
 	  commentList:[],
 	  fileList:[],
@@ -128,16 +158,16 @@ export default {
 		  'pdf':'../../../static/files-icon/pdf.png',
 		  'xlsx':'../../../static/files-icon/excel.png',
 		  'xls':'../../../static/files-icon/excel.png',
-		  'ppt':'../../../static/files-icon/ppt.png',
+		  'pptx':'../../../static/files-icon/ppt.png',
 	  }
     };
   },
   onLoad(option) {
 	this.recordId = option.id;
-	this.readDesc(this.recordId);
 	this.readActive(this.recordId);
   },
   onShow() {
+	  this.readDesc(this.recordId);
 	// this.readActive(this.recordId);
 	 //this.getFileList(this.recordId);
   },
@@ -271,6 +301,7 @@ export default {
 					  duration: 2500,
 					  success:()=>{
 						 this.readActive(this.activeId)
+						 this.readDesc(this.recordId);
 					  }
 					});
 			      }
@@ -306,6 +337,7 @@ export default {
 					  duration: 2500,
 					  success:()=>{
 						 this.getCommentList(this.activeId)
+						 this.readDesc(this.recordId);
 					  }
 					});
 				  }
@@ -341,6 +373,7 @@ export default {
 					  duration: 2500,
 					  success:()=>{
 						 this.getFileList(this.activeId)
+						 this.readDesc(this.recordId);
 					  }
 					});
 				  }
@@ -383,6 +416,45 @@ export default {
 		  		   },
 		  		 });
 		  },
+		likesFn(id,type){
+			if(type === '1'){
+				uni.showToast({
+					title:'已经点过赞了',
+					icon:'none'
+				})
+				return
+			}
+			  let md5Sign = md5(
+				"method=" +"activity" + "&timestamp=" + getApp().globalData.globalTimestamp +
+				  "&secret=" + getApp().globalData.secret
+			  );
+			  let url = getApp().globalData.shareUrl +"api/api.php" +
+				"?method=activity&action=like&timestamp=" +
+				getApp().globalData.globalTimestamp + "&sign=" + md5Sign;
+			  uni.request({
+				url: url,
+				method: "POST",
+				header: {
+				  "content-type": "application/x-www-form-urlencoded",
+				},
+				data: {
+				  openid:getApp().globalData.open_id,
+				  id:id
+				},
+				success: (res) => {
+				  if (res.data.code === 201) {
+					this.readDesc(this.recordId);
+					uni.showToast({
+						title:'点赞成功',
+						icon:'none'
+					})
+				  }
+				},
+				fail: () => {
+				  console.log("连接失败");
+				},
+			  });
+		},  
 		  readDesc(id){
 			  let md5Sign = md5(
 				"method=" +"activity" + "&timestamp=" + getApp().globalData.globalTimestamp +
@@ -829,7 +901,7 @@ export default {
 	.edit-icon-box-comment {
 		position: absolute;
 		right: 10px;
-		bottom: 5px;
+		top: 15px;
 		image {
 			width: 30rpx;
 			height: 30rpx;
@@ -848,7 +920,7 @@ export default {
 	.edit-icon-box-file {
 		position: absolute;
 		right: 10px;
-		bottom: 5px;
+		top: 10px;
 		image {
 			width: 35rpx;
 			height: 35rpx;
@@ -862,7 +934,8 @@ export default {
 		width: 80%;
 	}
 	.files-desc-box {
-		text-align: center;
+		// text-align: center;
+		display: flex;
 		margin-top: 10px;
 	}
     .show-file-box {
@@ -876,4 +949,22 @@ export default {
 		text-overflow: ellipsis;
 		font-size: 24rpx;
 	}
+	.active-length-text {
+		position: absolute;
+		top: 10px;
+		font-size: 26rpx;
+		left: 21%;
+	}
+	.file-length-text {
+		position: absolute;
+		top: 10px;
+		font-size: 26rpx;
+		left: 54%;
+	}
+	.comment-length-text {
+		position: absolute;
+		top: 10px;
+		font-size: 26rpx;
+		right: 8.5%;
+	}
 </style>

BIN
static/files-icon/likes-empty.png


BIN
static/files-icon/likes.png