zhengkaixin 2 سال پیش
والد
کامیت
26233a1689

+ 2 - 1
App.vue

@@ -10,7 +10,8 @@
 			console.log('App Launch')
 			console.log('App Launch')
 			document.title="微官网"
 			document.title="微官网"
 			
 			
-		},
+		},
+		 
 		onShow: function() {
 		onShow: function() {
 			
 			
 			console.log('App Show')
 			console.log('App Show')

+ 5 - 7
apis/pagejs/news.js

@@ -26,15 +26,13 @@ export function tabList(formData) {
 	})
 	})
 }
 }
 
 
-export function detail(id,userId) {
-	var url= '/open/newsApi/detail/'+id;
-	if(userId){
-		url+='/'+userId
-	}
+export function detail(formData) {
+	var url= '/open/newsApi/detail/';
+	
 	return request({
 	return request({
 		url:url,
 		url:url,
-		//data: formData,
-		method: 'get',	
+		data: formData,
+		method: 'post',	
 	})
 	})
 }
 }
 
 

+ 1 - 3
apis/utils/index.js

@@ -136,9 +136,7 @@ export const parseUnixTime = (time, cFormat) => {
 export const getWeixinRedirectURI = (appid, url) =>
 export const getWeixinRedirectURI = (appid, url) =>
 	`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(url)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
 	`https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(url)}&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
 
 
-
-  
-
+ 
 //支付宝获取code
 //支付宝获取code
 export const getAlipayRedirectURI = (appid, url) =>
 export const getAlipayRedirectURI = (appid, url) =>
 	`https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id=${appid}&scope=auth_base&redirect_uri=${encodeURIComponent(url)}`
 	`https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id=${appid}&scope=auth_base&redirect_uri=${encodeURIComponent(url)}`

+ 3 - 2
config/.env.dev.js

@@ -1,6 +1,7 @@
 const UNI_APP = {  
 const UNI_APP = {  
 	ProjectName :"地方铁路",
 	ProjectName :"地方铁路",
 	BASE_URL: 'http://36.134.122.108:8086/railroad-server/',
 	BASE_URL: 'http://36.134.122.108:8086/railroad-server/',
+	IMG_URL:"http://www.jsrailway.com.cn/",
 	//BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
 	//BASE_URL: 'https://charging.xiaoxinda.com/charging-station-test/',
 	// 'http://192.168.77.162:8080/charging-station/' ,
 	// 'http://192.168.77.162:8080/charging-station/' ,
 	//BASE_URL:'http://192.168.77.162:8086/railroad-server/',
 	//BASE_URL:'http://192.168.77.162:8086/railroad-server/',
@@ -10,8 +11,8 @@ const UNI_APP = {
 	SIMPLE_RUN:true,// 无视权限控制跳转页面   , 用于样式人员快速访问各种功能 ,快速测试等
 	SIMPLE_RUN:true,// 无视权限控制跳转页面   , 用于样式人员快速访问各种功能 ,快速测试等
 
 
 	//openId:"oK9Wr57rAcNzihDN2PEdptprT0As", 
 	//openId:"oK9Wr57rAcNzihDN2PEdptprT0As", 
-	// openId:"oK9Wr54VbEh3xvWYmD_zT5NbH4AY",//zkx
-	openId:"123456",
+	// openId:"oK9Wr54VbEh3xvWYmD_zT5NbH4AY",
+	openId:"oBEnI6GDWCRQqn_xlyPlCYFY8Amg",//zkx
 	//openId:"oK9Wr59rru-i3bm7dtTtxnkR-i4s",//杨所
 	//openId:"oK9Wr59rru-i3bm7dtTtxnkR-i4s",//杨所
 	//openId:"oK9Wr5zv8lvirni3txbxRkmpg8d0",//
 	//openId:"oK9Wr5zv8lvirni3txbxRkmpg8d0",//
 	
 	

+ 3 - 1
config/.env.prod.js

@@ -1,13 +1,15 @@
 const UNI_APP = {  	
 const UNI_APP = {  	
 	ProjectName :"地方铁路",
 	ProjectName :"地方铁路",
 	BASE_URL: 'http://36.134.122.108:8086/railroad-server/',
 	BASE_URL: 'http://36.134.122.108:8086/railroad-server/',
-	
+		IMG_URL:"http://www.jsrailway.com.cn/",
 	NODE_ENV :"prod",
 	NODE_ENV :"prod",
 	SIMPLE_RUN:false,
 	SIMPLE_RUN:false,
 	openId:"oHjCawigqi8SEAwutwkQ-VEgdp3k",//测试用openId
 	openId:"oHjCawigqi8SEAwutwkQ-VEgdp3k",//测试用openId
 	openId:"123456",
 	openId:"123456",
 	//小鹏管家appid
 	//小鹏管家appid
 	VUE_APP_WXAPPID:"wx1052afafacae1c63",
 	VUE_APP_WXAPPID:"wx1052afafacae1c63",
+
+	
 	VUE_APP_ALIAPPID:"2021003131641247",
 	VUE_APP_ALIAPPID:"2021003131641247",
 }  
 }  
 
 

+ 1 - 1
config/.env.test.js

@@ -1,7 +1,7 @@
 const UNI_APP = {  
 const UNI_APP = {  
 	ProjectName :"地方铁路",
 	ProjectName :"地方铁路",
 	BASE_URL: 'http://36.134.122.108:8086/railroad-server/',
 	BASE_URL: 'http://36.134.122.108:8086/railroad-server/',
-	
+		IMG_URL:"http://www.jsrailway.com.cn/",
     //BASE_URL: 'https://charging.xiaoxinda.com/charging-station-server/',
     //BASE_URL: 'https://charging.xiaoxinda.com/charging-station-server/',
    
    
 
 

+ 1 - 1
pages/homePage/homePage.vue

@@ -222,7 +222,7 @@
 			},
 			},
 			onPageScroll(e) {
 			onPageScroll(e) {
 				this.scrollTop = e.scrollTop;
 				this.scrollTop = e.scrollTop;
-				console.log(this.scrollTop);
+				//console.log(this.scrollTop);
 				if (this.scrollTop >= 200) {
 				if (this.scrollTop >= 200) {
 					this.flag = true;
 					this.flag = true;
 				} else {
 				} else {

+ 22 - 9
pages/mine/issue.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
 	<view>
 	<view>
-		<u-navbar title="发布内容" back-icon-name="close" >
+		<u-navbar title="发布内容" back-icon-name="close" ref="refNavbar" >
 			<view class="slot-wrap"
 			<view class="slot-wrap"
 			 :class="{
 			 :class="{
 				 'slot-wrap-a':true,
 				 'slot-wrap-a':true,
@@ -114,11 +114,14 @@
 							var item=this.listshare[i]
 							var item=this.listshare[i]
 							item.index=i;
 							item.index=i;
 							if(this.itemshare.index==-1){
 							if(this.itemshare.index==-1){
+								
 								if(item.id==this.itemshare.id){
 								if(item.id==this.itemshare.id){
-										this.confirmshare({value:i,label:item.title})		
+										this.confirmshare([{value:i,label:item.title}])
+												
 								}
 								}
 							}
 							}
 						}
 						}
+				
 					
 					
 				}).catch(error => {
 				}).catch(error => {
 					uni.showToast({
 					uni.showToast({
@@ -163,14 +166,24 @@
 					
 					
 					uni.hideLoading();
 					uni.hideLoading();
 					uni.showModal({
 					uni.showModal({
-						showCancel:false,
-											 title:"提示",
+					
+						 title:"提示",
 						content:"操作成功",
 						content:"操作成功",
-											confirmText:"确定",
-											success: res1 => {
-												this.carhelp.set("addShare",1);
-												uni.navigateBack()
-											}})
+						confirmText:"前往分享空间",
+						cancelText:"返回",
+						success: res1 => {
+							this.carhelp.set("addShare",1);
+							if (res1.confirm) {
+								uni.redirectTo({
+									url:"/pages/staffHome/filesonic"
+								})
+							}else{
+								this.$refs.refNavbar.goBack()
+							}
+							
+							
+							
+						}})
 					
 					
 				}).catch(error => {
 				}).catch(error => {
 					uni.showToast({
 					uni.showToast({

+ 34 - 12
pages/mine/mine.vue

@@ -55,12 +55,13 @@
 						点赞
 						点赞
 					</view>
 					</view>
 				</view>
 				</view>
-				<view class="item">
+				<view class="item" @click="gotoUrl('pages/mine/myComment')" >
 					<view class="amout">
 					<view class="amout">
 						0
 						0
 					</view>
 					</view>
 					<view class="text">
 					<view class="text">
-						评论
+						  评论
+
 					</view>
 					</view>
 				</view>
 				</view>
 				<view class="item">
 				<view class="item">
@@ -197,19 +198,40 @@
 			}
 			}
 		},
 		},
 		onLoad() {
 		onLoad() {
-			this.plusInfo=this.carhelp.getPersonInfoPlus();
-			this.userInfo=this.carhelp.getPersonInfo();
 			
 			
-			
-			if(this.userInfo&&this.userInfo.phone){
-				var phone = this.userInfo.phone;
-				var phone1 = phone.slice(0,3);
-				var phone2 = phone.slice(-4);
-				this.userPhone = phone1 + '****' + phone2;
-			}
-		
+			this.init()
+		},
+		onShow(){
+			this.findByOpenId()
 		},
 		},
 		methods: {
 		methods: {
+			init(){
+				this.plusInfo=this.carhelp.getPersonInfoPlus();
+				this.userInfo=this.carhelp.getPersonInfo();
+				
+				
+				if(this.userInfo&&this.userInfo.phone){
+					var phone = this.userInfo.phone;
+					var phone1 = phone.slice(0,3);
+					var phone2 = phone.slice(-4);
+					this.userPhone = phone1 + '****' + phone2;
+				}
+			},
+			findByOpenId(){
+				API.findByOpenId({
+					noerror:true,
+					openId: this.carhelp.getOpenId(),
+					
+				}).then((response) => {
+					
+					this.carhelp.setPersonInfo(response.data.regUser);
+					this.carhelp.setPersonInfoPlus(response.data)
+					this.init();
+				}).catch(error => {
+					uni.hideLoading();
+					
+				})
+			},
 			logoutApi(){
 			logoutApi(){
 				uni.showLoading({
 				uni.showLoading({
 					title: "加载中",
 					title: "加载中",

+ 59 - 26
pages/mine/myComment.vue

@@ -3,59 +3,92 @@
 		<u-navbar title="我的评论"  >	
 		<u-navbar title="我的评论"  >	
 		</u-navbar>
 		</u-navbar>
 		<view class="main">
 		<view class="main">
-			<view class="like-box">
-				<view class="content">
-					<view class="title">
-						2023年度春季职工运动会活动奖励公示
-					</view>
-					<view class="else">
-						<view class="classify">
-							政务动态
-						</view>
-						<view class="date">
-							2020-12-30
-						</view>
-					</view>
-				</view>
-				<view class="picture">
-					<img src="../../assets/img/slideshow@2x.png" alt="">
-				</view>
-				
-			</view>
 			
 			
-			<view class="like-box">
+			<view class="like-box"  v-for="(item,i) in list" @click="ckInfo(item.id)" :key="i">
 				<view class="content">
 				<view class="content">
 					<view class="title">
 					<view class="title">
-						庆祝建党节书法作品大赛活动奖励公示
+						{{item.title}}
 					</view>
 					</view>
 					<view class="else">
 					<view class="else">
 						<view class="classify">
 						<view class="classify">
-							政务动态
+							{{item.typeName}}
 						</view>
 						</view>
 						<view class="date">
 						<view class="date">
-							2020-12-30
+							{{item.createTime}}
 						</view>
 						</view>
 					</view>
 					</view>
 				</view>
 				</view>
 				<view class="picture">
 				<view class="picture">
-					<img src="../../assets/img/slideshow@2x.png" alt="">
+					<img  v-if="item.pic" :src="item.pic" alt="">
+					<img  v-else src="@/assets/img/default_img.png" alt="">
+					
 				</view>
 				</view>
 				
 				
 			</view>
 			</view>
+			
 		</view>
 		</view>
-		<u-divider bg-color="#F2F4F4" border-color="#CFD2D5">已经到底了</u-divider>
+		<u-divider   v-if="list.length==recordsTotal"
+		 :isnone="list.length==0" nonetext="你还没有参与评论"
+		bg-color="#F2F4F4" border-color="#CFD2D5">已经到底了</u-divider>
 	</view>
 	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+	import * as API from '@/apis/pagejs/news.js'
+	
 	export default {
 	export default {
 		data() {
 		data() {
 			return {
 			return {
+				list:[],
+				listForm:{
+					pageIndex:1,
 				
 				
+					pageSize:20,
+				},
+				recordsTotal:0,
+			}
+		},
+		onLoad(op){
+		
+			this.getList()
+		},
+		onReachBottom() {
+			if (this.list.length < this.recordsTotal) {			
+				this.myLoadmore();
 			}
 			}
 		},
 		},
 		methods: {
 		methods: {
-			
+			ckInfo(id){
+				var url="/pages/news/articleDetails?id="+id;
+				uni.navigateTo({
+					url:url
+				})
+			},
+			myLoadmore(){
+				this.listForm.pageIndex += 1;
+				this.getList();
+			},
+			getList(){
+				
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				
+				API.newsCommentspageList(this.listForm).then((res) => {
+					uni.hideLoading();
+					this.list = [
+						...this.list,
+						...res.data.data
+					];
+					this.recordsTotal = res.data.recordsTotal;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			}
 		}
 		}
 	}
 	}
 </script>
 </script>

+ 20 - 5
pages/news/articleDetails.vue

@@ -19,7 +19,7 @@
 					</view>
 					</view>
 				</view>
 				</view>
 			</view>
 			</view>
-	    <view class="text" v-html="info.content">
+	    <view class="text news-content" v-html="info.content">
 	    	
 	    	
 	    
 	    
 	    </view>
 	    </view>
@@ -31,7 +31,7 @@
 		</view> -->
 		</view> -->
 		</view>
 		</view>
 		<!-- 评论 -->
 		<!-- 评论 -->
-		<view class="comment" v-if="info.title&&info.listComment"   >
+		<view class="comment" v-if="info.title&&info.listComment&&info.listComment.length"   >
 			<view class="title">
 			<view class="title">
 				精华评论
 				精华评论
 			</view>
 			</view>
@@ -78,7 +78,7 @@
 					<u-icon name="thumb-up"   size="32"></u-icon>
 					<u-icon name="thumb-up"   size="32"></u-icon>
 				</view>
 				</view>
 				<view class="number">
 				<view class="number">
-				
+					{{info.likesNum}}
 				</view>
 				</view>
 			</view>
 			</view>
 		</view>
 		</view>
@@ -183,7 +183,7 @@
 						title: "提交成功",
 						title: "提交成功",
 						icon: "none"
 						icon: "none"
 					})
 					})
-					
+					this.showMessage=false
 					this.getInfo();
 					this.getInfo();
 					
 					
 				}).catch(error => {
 				}).catch(error => {
@@ -225,12 +225,24 @@
 					userId=this.userInfo.id
 					userId=this.userInfo.id
 				}
 				}
 				
 				
-				API.detail(this.id,userId).then((res) => {
+				API.detail({
+					id:this.id,
+					userId:userId
+				}).then((res) => {
 					
 					
 					if(bl){
 					if(bl){
 						uni.hideLoading();
 						uni.hideLoading();
 					}
 					}
 					this.info=res.data;
 					this.info=res.data;
+					this.$nextTick(()=>{
+					    var list =document.getElementsByClassName("news-content")[0].getElementsByTagName("img");
+						
+						for(var i=0;i<list.length;i++){
+					        list[i].style='width: 100%;height: 100%;'
+							
+					    }
+							 
+					})
 				}).catch(error => {
 				}).catch(error => {
 					uni.showToast({
 					uni.showToast({
 						title: error,
 						title: error,
@@ -243,6 +255,9 @@
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
+	img{
+		width: 100% !important;
+	}
 	page{
 	page{
 		padding-bottom:100px;
 		padding-bottom:100px;
 	}
 	}

+ 1 - 1
pages/staffHome/activityCenter/activityDetail.vue

@@ -7,7 +7,7 @@
 		
 		
 		
 		
 		</view>
 		</view>
-		 <view class="bottom" @click="gotoUrl('pages/mine/issue')" >
+		 <view class="bottom" @click="gotoUrl('pages/mine/issue?id='+info.id)" >
 			<button>发布作品</button>
 			<button>发布作品</button>
 		 </view>
 		 </view>
 	</view>
 	</view>

+ 11 - 2
pages/staffHome/filesonic.vue

@@ -44,7 +44,7 @@
 				<view class="tag" :class="item.activityId" >
 				<view class="tag" :class="item.activityId" >
 					<text class="symbol">#</text>
 					<text class="symbol">#</text>
 					<text class="text">{{item.activityName}}</text>
 					<text class="text">{{item.activityName}}</text>
-					<text class="icon" v-if="false">
+					<text class="icon"   @click="gotoUrl('pages/mine/issue?id='+item.activityId)"  >
 						<u-icon size="28" color="#cccccc" name="arrow-right"></u-icon>
 						<u-icon size="28" color="#cccccc" name="arrow-right"></u-icon>
 					</text>
 					</text>
 				</view>
 				</view>
@@ -89,6 +89,7 @@
 			}
 			}
 		},
 		},
 		onLoad(op){
 		onLoad(op){
+				this.carhelp.set("addShare",0);
 				this.getList()
 				this.getList()
 		},
 		},
 		onReachBottom() {
 		onReachBottom() {
@@ -96,6 +97,14 @@
 				this.myLoadmore();
 				this.myLoadmore();
 			}
 			}
 		},
 		},
+		onShow(){
+			
+			if(	this.carhelp.get("addShare")){
+				this.listForm.pageIndex=1;
+				this.getList()
+			}
+		
+		},
 		methods: {
 		methods: {
 			previewImage(img,i) {
 			previewImage(img,i) {
 				let imgs = [];
 				let imgs = [];
@@ -121,7 +130,7 @@
 				})
 				})
 				
 				
 				API.pageList(this.listForm).then((res) => {
 				API.pageList(this.listForm).then((res) => {
-					
+					this.carhelp.set("addShare",0);
 					uni.hideLoading();
 					uni.hideLoading();
 					//this.list=response.data.data
 					//this.list=response.data.data
 					if(this.listForm.pageIndex==1){
 					if(this.listForm.pageIndex==1){

+ 9 - 2
uni_modules/uview-ui/components/u-upload-file/u-upload-file.vue

@@ -28,7 +28,12 @@
 				:percent="item.progress"
 				:percent="item.progress"
 			></u-line-progress>
 			></u-line-progress>
 			<view @tap.stop="retry(index)" v-if="item.error" class="u-error-btn">点击重试</view>
 			<view @tap.stop="retry(index)" v-if="item.error" class="u-error-btn">点击重试</view>
-			<image  class="u-preview-image" :src="item.url || item.path" :mode="imageMode"></image>
+			
+			
+			<video v-if="item.fileType=='video/mp4'" :src="item.url"
+			                    enable-danmu danmu-btn controls></video>
+			<image  class="u-preview-image" v-else :src="item.url || item.path" :mode="imageMode"></image>
+
 		</view>
 		</view>
 		<slot name="file" :file="lists"></slot>
 		<slot name="file" :file="lists"></slot>
 		<view style="display: inline-block;" @tap="selectFile" v-if="maxCount > lists.length">
 		<view style="display: inline-block;" @tap="selectFile" v-if="maxCount > lists.length">
@@ -332,11 +337,13 @@ export default {
 								this.showToast('超出最大允许的文件个数');
 								this.showToast('超出最大允许的文件个数');
 								return;
 								return;
 							}
 							}
+							 
 							lists.push({
 							lists.push({
 								url: val.path,
 								url: val.path,
 								progress: 0,
 								progress: 0,
 								error: false,
 								error: false,
-								file: val
+								file: val,
+								fileType:val.type
 							});
 							});
 						}
 						}
 					});
 					});