wkyy před 2 roky
rodič
revize
718aa42836
4 změnil soubory, kde provedl 688 přidání a 494 odebrání
  1. 24 0
      apis/news.js
  2. 454 458
      pages/index/index.vue
  3. 151 30
      pages/news/activityDetails.vue
  4. 59 6
      pages/news/index.vue

+ 24 - 0
apis/news.js

@@ -2,6 +2,30 @@ import request from '../utils/request.js';
 import Qs from 'qs';
 
 
+export function activityList(data) {
+	return request({
+		method: 'post',
+		data: Qs.stringify(data),
+		url: '/mobile/activity/activityList'
+	})
+}
+
+export function activityDetail(data) {
+	return request({
+		method: 'post',
+		data: Qs.stringify(data),
+		url: '/mobile/activity/detail'
+	})
+}
+
+export function activitySave(data) {
+	return request({
+		method: 'post',
+		data: Qs.stringify(data),
+		url: '/mobile/activity/save'
+	})
+}
+
 export function newsTypeList(data) {
 	return request({
 		method: 'post',

+ 454 - 458
pages/index/index.vue

@@ -1,498 +1,474 @@
 <template>
-	<view>
-		<u-select v-model="memberQyshow" 
-			@confirm="confirm" :default-value="defaultvalue"
-		   :list="memberQyColumns"></u-select>
-		
-		<u-navbar :is-back="false" :border-bottom="false" height="84" >
-		
-			<view class="home-head" style="width: 100%;">
-				<view class="" >
-					<img class="homeLogo" :src="homeLogo" alt="">
-				
-				</view>
-				<view>
-					<view class="homeTab" style="
-							float: left;
-						">
-						<u-tabs :list="tabList" :current="current" @change="change" :show-bar="false" active-color="#333" inactive-color="#c4c0c0"></u-tabs>
-					
-					</view>
-					<view class="homeAdd" style="
-							float: right;
-							    height: 34px;
-							    line-height: 34px;
-						" >
-						<u-icon custom-prefix="custom-icon" name="map-pin-2-fill"></u-icon>
-						<span  @click="memberQyshowBtn">{{memberQyObj.name}}</span>
-					</view>
+	<view>
+		<u-select v-model="memberQyshow" @confirm="confirm" :default-value="defaultvalue" :list="memberQyColumns">
+		</u-select>
	
+		<u-navbar :is-back="false" :border-bottom="false" height="84">
+
+			<view class="home-head" style="width: 100%;">
+				<view class="">
+					<img class="homeLogo" :src="homeLogo" alt="">
+
 				</view>
-				
-			
-			</view>
-		</u-navbar>
-		
-		<view class="homeWrap">
-			<u-swiper  v-if="wrapList.length" :list="wrapList" @click="clickBanner" :img-mode="'aspectFit'" :name="'picUrl'" height="294" border-radius="24"></u-swiper>
-		</view>
-		
-		<view class="homeUser">
-			
-			<view class="homeUser-item" 
-			@click="gotoUrl('pages/friend/personal?id='+item.id)"
-			v-for="(item ,index) in list" :key="item.id" >
-				<view class="homeUser-add">
-					<u-icon custom-prefix="custom-icon" name="map-pin-2-fill"></u-icon>
-					<span>{{item.orgAreaName}}</span>
-				</view>
-				<view class="homeUser-text">
-					<view class="homeUser-name">
-						<span>{{showName(item.realName)}}</span>
-						<u-icon custom-prefix="custom-icon" :name="(item.gender?'women-line':'men-line')" :color="item.gender?'#FF695B':'#1677FF'"></u-icon>
-					</view>
-					<view class="homeUser-info">
-						{{item.age}}岁 {{item.height?'· '+item.height+'cm':''}} {{item.weight?'· '+item.weight+'kg':''}}
-					</view>
-				</view>
-				<u-image class="homeUser-img" :src="(item.faceImage?item.faceImage:'./static/img/head.png')+'?x-oss-process=image/resize,m_fill,w_256,h_256'" height="330" mode="aspectFill"></u-image>
-			</view>
-			<u-divider color="#19be6b" style="margin-bottom:20px;" font-size="28rpx" ><span @click="changeList" v-show="timeOut" >点击刷新</span><span style="margin-left:20px" @click="onHideMethod" v-show="timeOut" >暂停</span><span style="margin-left:20px" v-show="!timeOut" @click="changeList" >自动刷新</span></u-divider>
-			
-		</view>
-
-<!-- 新闻  相亲活动-->
-<view class="news">
-	
-		<view class="news-head">
-			<view class="title">
-				新闻资讯
-			</view>
-			  <view class="more">
-			  	  更多<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
-			  </view>
-		</view>
-		<view class="news-item">
-			<view class="main">
-					<view class="content">
-						<view class="text">
-							还真别说,我幻想过,假如我脑子里有个大容量硬盘,我把维....
-						</view>
-						<view class="time">
-							2021-12-01
-						</view>
-					</view>
-					<view class="img">
-						<img src="../../static/img/news.png" alt="">
-					</view>
-			
-			</view>
-			
-		</view>
-		<view class="news-item">
-			<view class="main">
-					<view class="content">
-						<view class="text">
-							还真别说,我幻想过,假如我脑子里有个大容量硬盘,我把维....
-						</view>
-						<view class="time">
-							2021-12-01
-						</view>
+				<view>
+					<view class="homeTab" style="
+							float: left;
+						">
+						<u-tabs :list="tabList" :current="current" @change="change" :show-bar="false"
+							active-color="#333" inactive-color="#c4c0c0"></u-tabs>
+
 					</view>
-					<view class="img">
-						<img src="../../static/img/news.png" alt="">
+					<view class="homeAdd" style="
+							float: right;
+							    height: 34px;
+							    line-height: 34px;
+						">
+						<u-icon custom-prefix="custom-icon" name="map-pin-2-fill"></u-icon>
+						<span @click="memberQyshowBtn">{{memberQyObj.name}}</span>
 					</view>
-			
+				</view>
+
+
 			</view>
-			
-		</view>
-		<view class="news-item">
-			<view class="main">
-					<view class="content">
-						<view class="text">
-							还真别说,我幻想过,假如我脑子里有个大容量硬盘,我把维....
-						</view>
-						<view class="time">
-							2021-12-01
-						</view>
+		</u-navbar>
+
+		<view class="homeWrap">
+			<u-swiper v-if="wrapList.length" :list="wrapList" @click="clickBanner" :img-mode="'aspectFit'"
+				:name="'picUrl'" height="294" border-radius="24"></u-swiper>
+		</view>		
+		<view class="homeUser">		
+			<view class="homeUser-item" @click="gotoUrl('pages/friend/personal?id='+item.id)"
+				v-for="(item ,index) in list" :key="item.id">
+				<view class="homeUser-add">
+					<u-icon custom-prefix="custom-icon" name="map-pin-2-fill"></u-icon>
+					<span>{{item.orgAreaName}}</span>
+				</view>
+				<view class="homeUser-text">
+					<view class="homeUser-name">
+						<span>{{showName(item.realName)}}</span>
+						<u-icon custom-prefix="custom-icon" :name="(item.gender?'women-line':'men-line')"
+							:color="item.gender?'#FF695B':'#1677FF'"></u-icon>
 					</view>
-					<view class="img">
-						<img src="../../static/img/news.png" alt="">
+					<view class="homeUser-info">
+						{{item.age}}岁 {{item.height?'· '+item.height+'cm':''}} {{item.weight?'· '+item.weight+'kg':''}}
 					</view>
-			
+				</view>
+				<u-image class="homeUser-img"
+					:src="(item.faceImage?item.faceImage:'./static/img/head.png')+'?x-oss-process=image/resize,m_fill,w_256,h_256'"
+					height="330" mode="aspectFill"></u-image>
 			</view>
-			
+			<!-- <u-divider color="#19be6b" style="margin-bottom:20px;" font-size="28rpx" ><span @click="changeList" v-show="timeOut" >点击刷新</span><span style="margin-left:20px" @click="onHideMethod" v-show="timeOut" >暂停</span><span style="margin-left:20px" v-show="!timeOut" @click="changeList" >自动刷新</span></u-divider> -->		
 		</view>
-	
-	
-</view>
-
-<view class="activity">
-	
-		<view class="news-head">
-			<view class="title">
-				相亲活动
+
+		<!-- 新闻  相亲活动-->
+		<view class="news" v-if="newsList.length != 0">
+
+			<view class="news-head">
+				<view class="title">
+					新闻资讯
+				</view>
+				<view class="more" @click="toNews">
+					更多<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
+				</view>
 			</view>
-			  <view class="more">
-			  	  更多<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
-			  </view>
-		</view>
-		<view class="news-item">
-			<view class="main">
+			<view class="news-item" v-for="(item,index) in newsList" :key="item.id"
+				@click="gotoUrl('pages/news/detalis?id='+item.id)">
+				<view class="main">
 					<view class="content">
 						<view class="text">
-还真别说,我幻想过,假如我脑子里有个大容量硬盘,我把维... 
+							<p class="u-line-2" v-text="item.title"></p>
 						</view>
 						<view class="time">
-							2021-12-01
+							{{item.createTime}}
 						</view>
 					</view>
 					<view class="img">
-						<img src="../../static/img/news.png" alt="">
+						<img :src="item.images ? item.images : '/static/img/default_img.png'" alt="">
 					</view>
-			
+				</view>
 			</view>
-			
 		</view>
-		<view class="news-item">
-			<view class="main">
-					<view class="content">
-						<view class="text">
-							还真别说,我幻想过,假如我脑子里有个大容量硬盘,我把维....
-						</view>
-						<view class="time">
-							2021-12-01
-						</view>
-					</view>
-					<view class="img">
-						<img src="../../static/img/news.png" alt="">
-					</view>
-			
+
+		<view class="activity" v-if="activityList.length != 0">
+
+			<view class="news-head">
+				<view class="title">
+					相亲活动
+				</view>
+				<view class="more" @click="toNews">
+					更多<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
+				</view>
 			</view>
-			
-		</view>
-		<view class="news-item">
-			<view class="main">
+			<view class="news-item" v-for="(item,index) in activityList" :key="item.id" 
+			@click="gotoUrl('pages/news/activityDetails?id='+item.id)">
+				<view class="main">
 					<view class="content">
 						<view class="text">
-							还真别说,我幻想过,假如我脑子里有个大容量硬盘,我把维....
+							<p class="u-line-2" v-text="item.title"></p>
 						</view>
 						<view class="time">
-							2021-12-01
+							{{item.createTime}}
 						</view>
 					</view>
 					<view class="img">
-						<img src="../../static/img/news.png" alt="">
+						<img :src="item.images ? item.images : '/static/img/default_img.png'" alt="">
 					</view>
-			
+				</view>
 			</view>
-			
 		</view>
-	
-	
-</view>
-<view class="bottom">
-	<u-divider>已经到底了</u-divider>
-</view>
-		
- 	</view>
+		<view class="bottom">
+			<u-divider>已经到底了</u-divider>
+		</view>		
 	</view>
 </template>
 
-<script>
-	import * as Api from '@/apis/index.js'
-	import * as Api_common from '@/apis/common.js'
-	var homeLogo=require('@/static/img/homeLogo.png')
-	
-	export default {
-		data() {
-			return {
-				homeLogo:homeLogo,
- 				memberQyshow:false,
-				memberQy:0,
-				memberQyColumns:[],
-				listQy:[],
-				list:[],
-				pageIndex: 1,
-				recordsTotal:0,
-				tabList: [{
-					name: '最新'
-				}, {
-					name: '最热'
-				}],
+<script>
+	import * as Api from '@/apis/index.js'
+	import * as newsAPI from '@/apis/news.js'
+	import * as Api_common from '@/apis/common.js'
+	var homeLogo = require('@/static/img/homeLogo.png')
+
+	export default {
+		data() {
+			return {
+				homeLogo: homeLogo,
+ 				memberQyshow: false,
+				memberQy: 0,
+				memberQyColumns: [],
+				listQy: [],
+				list: [],
+				pageIndex: 1,
+				recordsTotal: 0,
+				tabList: [{
+					name: '最新'
+				}, {
+					name: '最热'
+				}],
 				current: 0,
-				wrapList: [
-				],
+				wrapList: [],
 				timeOut: false,
 				totalPage: 1,
-				uuid:'',
-			}
-		},
-		// onReachBottom() {
-		// 	if (this.list.length < this.recordsTotal) {
-				
-		// 		this.myLoadmore();
-		// 	}
-		// },
-		computed:{
-		 defaultvalue(){
-		 	for(var i in this.listQy){
-		 			
-		 		if(this.listQy[i].value==this.memberQy){
-		 			
-		 			return [i]
-		 		}
-		 	}
-		 	return [0]
-		 },
-			memberQyObj(){
-				for(var i in this.listQy){
-						
-					if(this.listQy[i].value==this.memberQy){
-					
-						return this.listQy[i]
-					}
-				}
-				return {
-					id: 0,
-					name:"荆州市"
-				}
-			}
-		},
-		methods: {
-			memberQyshowBtn(){			
-				this.memberQyshow  = true;		
-			},
-			// 回调参数为包含columnIndex、value、values
-			confirm(e) {
-				this.memberQy=e[0].value;
-				console.log(this.memberQy)
-				// var info= this.carhelp.getPersonInfo();
-				
-				// if(info){
-				// this.carhelp.set("index-defaultvalue-memberQy",this.memberQy);
-			 //  }
-				this.memberQyshow = false;
-				this.list = [];
-				this.homePage();
-			},
-			changeList() {
-				this.list = [];
-				this.pageIndex += 1;
-				if(this.pageIndex == this.totalPage+1) {
-					this.pageIndex = 1;
+				uuid: '',
+				newsList: [],
+				activityList: [],
+			}
+		},
+		// onReachBottom() {
+		// 	if (this.list.length < this.recordsTotal) {
+
+		// 		this.myLoadmore();
+		// 	}
+		// },
+		computed: {
+			defaultvalue() {
+				for (var i in this.listQy) {
+
+					if (this.listQy[i].value == this.memberQy) {
+
+						return [i]
+					}
 				}
-				this.homePage()
-				if(this.uuid){
-					clearInterval(this.uuid)
+				return [0]
+			},
+			memberQyObj() {
+				for (var i in this.listQy) {
+
+					if (this.listQy[i].value == this.memberQy) {
+
+						return this.listQy[i]
+					}
 				}
-				
-				this.uuid='';
-				if(!this.uuid){
-					this.timeOut=true;
-					this.uuid=setInterval(()=>{
-						if(this.timeOut){
-							this.timingchangeList();
-						}
-					},10*1000)
+				return {
+					id: 0,
+					name: "荆州市"
 				}
+			}
+		},
+		methods: {
+			toNews() {
+				uni.switchTab({
+					url: '/pages/news/index'
+				})
+			},
+			getActivityList() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				newsAPI.activityList({
+					pageSize: 2,
+					pageIndex: 1
+				}).then((res) => {
+					uni.hideLoading();
+
+					this.activityList = res.data.data;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			getNewsList() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				newsAPI.newscontent({
+					type: 'TZGG',
+					pageSize: 3,
+					pageIndex: 1
+				}).then((res) => {
+					uni.hideLoading()
+
+					this.newsList = res.data.data;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			memberQyshowBtn() {
+				this.memberQyshow = true;
+			},
+			// 回调参数为包含columnIndex、value、values
+			confirm(e) {
+				this.memberQy = e[0].value;
+				console.log(this.memberQy)
+				// var info= this.carhelp.getPersonInfo();
+
+				// if(info){
+				// this.carhelp.set("index-defaultvalue-memberQy",this.memberQy);
+				//  }
+				this.memberQyshow = false;
+				this.list = [];
+				this.homePage();
 			},
+			// changeList() {
+			// 	this.list = [];
+			// 	this.pageIndex += 1;
+			// 	if(this.pageIndex == this.totalPage+1) {
+			// 		this.pageIndex = 1;
+			// 	}
+			// 	this.homePage()
+			// 	if(this.uuid){
+			// 		clearInterval(this.uuid)
+			// 	}
+
+			// 	this.uuid='';
+			// 	if(!this.uuid){
+			// 		this.timeOut=true;
+			// 		this.uuid=setInterval(()=>{
+			// 			if(this.timeOut){
+			// 				this.timingchangeList();
+			// 			}
+			// 		},10*1500)
+			// 	}
+			// },
 			timingchangeList() {
 				this.list = [];
 				this.pageIndex += 1;
-				if(this.pageIndex == this.totalPage+1) {
+				if (this.pageIndex == this.totalPage + 1) {
 					this.pageIndex = 1;
 				}
 				this.homePage()
-			},
-			change(index) {
-				this.current = index;
-				this.pageIndex= 1;
-				this.list = [];
-				this.homePage()
-			},
-			getBaseDictionary(){
-				this.memberQyColumns=[];
-				var indexdefaultvaluememberQy=false;// this.carhelp.get("index-defaultvalue-memberQy");
-				 var info= this.carhelp.getPersonInfoPlus();
-				
-				if(info){
-					//this.memberQy=info.memberQy
-					this.listQy = info.qyList;
-									
-					for(var i in this.listQy){
-							
-						this.memberQyColumns.push({
-								label: this.listQy[i].name,
-								value: this.listQy[i].value
-						})
-					}
-					// if(indexdefaultvaluememberQy){
-					// 	this.memberQy=indexdefaultvaluememberQy;
-					// }
-				}else{
-					Api.getBaseDictionary({
-						
-					}).then((res) => {
-						this.listQy = res.data.qyList;
-					
-						for(var i in this.listQy){
-								
+			},
+			change(index) {
+				this.current = index;
+				this.pageIndex = 1;
+				this.list = [];
+				this.homePage()
+			},
+			getBaseDictionary() {
+				this.memberQyColumns = [];
+				var indexdefaultvaluememberQy = false; // this.carhelp.get("index-defaultvalue-memberQy");
+				var info = this.carhelp.getPersonInfoPlus();
+
+				if (info) {
+					//this.memberQy=info.memberQy
+					this.listQy = info.qyList;
+
+					for (var i in this.listQy) {
+
+						this.memberQyColumns.push({
								label: this.listQy[i].name,
								value: this.listQy[i].value
+						})
+					}
+					// if(indexdefaultvaluememberQy){
+					// 	this.memberQy=indexdefaultvaluememberQy;
+					// }
+				} else {
+					Api.getBaseDictionary({
+
+					}).then((res) => {
+						this.listQy = res.data.qyList;
+
+						for (var i in this.listQy) {
+
 							this.memberQyColumns.push({
 									label: this.listQy[i].name,
-									value: this.listQy[i].value
-								})
-						}
-						
+									value: this.listQy[i].value
								})
+						}
+
 					}).catch(error => {
-							uni.showToast({
-							
-								title: error,icon: "none"
-							})
-					})
-				}
-				
-				
-			},
-			homePage(){
+							uni.showToast({
+
+							title: error,
+							icon: "none"
+							})
+					})
+				}
+
+
+			},
+			homePage() {
 				//var indexdefaultvaluememberQy=false// this.carhelp.get("index-defaultvalue-memberQy");
 				// var info= this.carhelp.getPersonInfoPlus();
-				
+
 				// if(info){
 				// 	this.memberQy=info.memberQy
 				// 	if(indexdefaultvaluememberQy){
 				// 		this.memberQy=indexdefaultvaluememberQy;
 				// 	}
 				// }
-						
-				uni.showLoading({
-					title: "加载中",
-					mask: true,
-				})
-				var memberId=undefined;
-				if(this.carhelp.getPersonInfo()){
-					memberId=this.carhelp.getPersonInfo().id;
-				}
-				Api.homePage({
-					pageSize:8,
-					pageIndex:this.pageIndex,
-					type:this.current,
-					qy: this.memberQy,
-					memberId:memberId
-				}).then((res) => {
-					if(this.pageIndex==1){
-						this.list=[]
-					}
-					this.list = [
-							...this.list,
-							...res.data.data
-						];
-						this.recordsTotal = res.data.recordsTotal
-						this.totalPage = res.data.totalPage
-						uni.hideLoading()
-					
-					}).catch(error => {
-						uni.showToast({
-						
-							title: error,icon: "none"
-						})
-				})
-			},getBannerInfo(){
-			
-				Api_common.getBannerInfo("HOMEPAGE").then((res) => {
-					this.wrapList =res.data;
-					
-					}).catch(error => {
-						uni.showToast({
-						
-							title: error,icon: "none"
-						})
-				})
-			},clickBanner(index){
-				var obj= this.wrapList[index]
-				uni.navigateTo({
-					url:obj.linkUrl
-				})
-				
-			},
-			onHideMethod(){
-				this.timeOut = false;
-				if(this.uuid){
-					clearInterval(this.uuid)	
-					this.uuid='';
-				}
-			},
-			onShowMethod(){
-				this.timeOut=true
-				if(!this.uuid){
-					this.uuid=setInterval(()=>{
-						if(this.timeOut){
-							this.timingchangeList();
-						}
-					},10*1000)
-				}
-			}
-			
+
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				var memberId = undefined;
+				if (this.carhelp.getPersonInfo()) {
+					memberId = this.carhelp.getPersonInfo().id;
+				}
+				Api.homePage({
+					pageSize: 8,
+					pageIndex: this.pageIndex,
+					type: this.current,
+					qy: this.memberQy,
+					memberId: memberId
+				}).then((res) => {
+					if (this.pageIndex == 1) {
+						this.list = []
+					}
+					this.list = [
							...this.list,
							...res.data.data
+						]
;
+					this.recordsTotal = res.data.recordsTotal
+					this.totalPage = res.data.totalPage
+					uni.hideLoading()
+
+				}).catch(error => {
+						uni.showToast({
+
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			getBannerInfo() {
+
+				Api_common.getBannerInfo("HOMEPAGE").then((res) => {
+					this.wrapList = res.data;
+
+				}).catch(error => {
+						uni.showToast({
+
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			clickBanner(index) {
+				var obj = this.wrapList[index]
+				uni.navigateTo({
+					url: obj.linkUrl
+				})
+
+			},
+			onHideMethod() {
+				this.timeOut = false;
+				if (this.uuid) {
+					clearInterval(this.uuid)
+					this.uuid = '';
+				}
+			},
+			onShowMethod() {
+				this.timeOut = true
+				if (!this.uuid) {
+					this.uuid = setInterval(() => {
+						if (this.timeOut) {
+							this.timingchangeList();
+						}
+					}, 10 * 1500)
+				}
+			}
+
 		},
 		onUnload() {
-			if(this.uuid){
+			if (this.uuid) {
 				clearInterval(this.uuid)
 			}
 		},
-		onHide() {
+		onHide() {
 			console.log("onHide")
 			this.onHideMethod()
 		},
 		onShow() {
 			this.onShowMethod()
-		},
-		onLoad() {
-			 var  logo=this.carhelp.getConfig().logo
-			 if(logo){
-				 this.homeLogo=logo
- 			 }
-		},
-		onReady() {
-			this.getBaseDictionary()
-			this.getBannerInfo()
-			this.homePage()
-		}
-	}
+		},
+		onLoad() {
+			var logo = this.carhelp.getConfig().logo
+			if (logo) {
+				this.homeLogo = logo
+ 		 
}
+		}
,
+		onReady() {
+			this.getBaseDictionary()
+			this.getBannerInfo()
+			this.homePage()
+			this.getNewsList()
+			this.getActivityList()
+		}
+	}
 </script>
 <style>
-	/deep/.u-slot-content{
+	/deep/.u-slot-content {
 		flex-direction: column;
 		align-items: flex-start;
-	}	
+	}
 </style>
 <style lang="scss" scoped>
-	
-	.homeLogo{
+	.homeLogo {
 		margin-left: 15px;
 		height: 28px;
 		width: 148px;
 	}
-	.home-head{
-		padding-right: 15px;  
+
+	.home-head {
+		padding-right: 15px;
 		background-color: #fff;
 		z-index: 99;
-		.homeAdd{
+
+		.homeAdd {
 			// position: absolute;
 			// right: -55px;
 			// top:45px;
 			color: #FF5E5E;
-			span{
+
+			span {
 				margin-left: 3px;
 			}
 		}
 	}
-	.homeWrap{
-		padding:0 15px;
+
+	.homeWrap {
+		padding: 0 15px;
 	}
-	.homeUser{
+
+	.homeUser {
 		display: flex;
 		justify-content: space-between;
 		flex-wrap: wrap;
 		padding: 15px;
-		.homeUser-item{
+
+		.homeUser-item {
 			width: 48%;
 			height: 165px;
 			margin-bottom: 15px;
@@ -500,96 +476,116 @@
 			color: #fff;
 			border-radius: 12px;
 			overflow: hidden;
-			.homeUser-add{
+
+			.homeUser-add {
 				position: absolute;
 				z-index: 9;
 				right: 10px;
 				top: 10px;
-				background: rgba(0,0,0,0.5);
-				padding:2px 5px;
+				background: rgba(0, 0, 0, 0.5);
+				padding: 2px 5px;
 				border-radius: 12px;
-				span{
+
+				span {
 					margin-left: 3px;
 					font-size: 14px;
 				}
 			}
-			.homeUser-text{
+
+			.homeUser-text {
 				position: absolute;
 				z-index: 9;
-				left:0px ;
+				left: 0px;
 				bottom: 0px;
 				right: 0;
 				padding: 10px;
-				background: linear-gradient( 180deg,rgba(0,0,0,0),rgba(0,0,0,0.5));
+				background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.5));
 			}
-			.homeUser-name{
+
+			.homeUser-name {
 				display: flex;
 				align-items: center;
-				span{
+
+				span {
 					margin-right: 3px;
 				}
 			}
-			.homeUser-info{
+
+			.homeUser-info {
 				margin-top: 3px;
 			}
-			.homeUser-img{
+
+			.homeUser-img {
 				position: relative;
 				z-index: 0;
 			}
 		}
 	}
-// 新闻
-.news,.activity{
-	background-color: #fff;
-	margin: 20px 16px ;
-	.news-item{
-		margin-bottom: 48rpx;
-	}
-	.news-head{
-		display: flex;
-		justify-content: space-between;
-		align-items: center;
-		.title{
-			font-size: 20px;
-			color: #101010;
-		}
-		.more{
-			color: #999999;
-			font-size: 16px
+
+	// 新闻
+	.news,
+	.activity {
+		background-color: #fff;
+		margin: 20px 16px;
+
+		.news-item {
+			margin-bottom: 48rpx;
 		}
-	}
-	.main{
-		display: flex;
-		justify-content: space-between;
-		margin-top: 26rpx;
-		.content{
-			width: 67.3%;
+
+		.news-head {
 			display: flex;
-			flex-direction: column;
 			justify-content: space-between;
-			.text{
-				width: 100%;
+			align-items: center;
+
+			.title {
+				font-size: 20px;
 				color: #101010;
 			}
-			.time{
-				// margin-top: 40rpx;
-				font-size: 12px;
+
+			.more {
 				color: #999999;
+				font-size: 16px
 			}
 		}
-		.img{
-			width: 200rpx;
-			height: 150rpx;
-			border-radius: 4px;
-			overflow: hidden;
-			img{
-				width: 100%;
-				height: 100%;
+
+		.main {
+			display: flex;
+			justify-content: space-between;
+			margin-top: 26rpx;
+
+			.content {
+				width: 67.3%;
+				display: flex;
+				flex-direction: column;
+				justify-content: space-between;
+
+				.text {
+					width: 100%;
+					color: #101010;
+				}
+
+				.time {
+					// margin-top: 40rpx;
+					font-size: 12px;
+					color: #999999;
+				}
+			}
+
+			.img {
+				width: 200rpx;
+				height: 150rpx;
+				border-radius: 4px;
+				overflow: hidden;
+
+				img {
+					width: 100%;
+					height: 100%;
+				}
 			}
 		}
 	}
-}
-.bottom{
-	margin-bottom: 90px;
-}
-</style>
+
+	.bottom {
+		margin-bottom: 90px;
+	}
+</style>

+ 151 - 30
pages/news/activityDetails.vue

@@ -1,16 +1,22 @@
 <template>
 	<view>
-		<u-navbar  title="荆州工会鹊桥露营主题中秋相亲会"></u-navbar>
-		<view class="img">
+		<u-navbar title="">
+			<view class="slot-wrap">
+				<view class="slot-title">{{detail.title}}</view>
+			</view>
+		</u-navbar>
+		<!-- <view class="img">
 			<img src="../../static/img/activity.png" alt="">
-		</view>
+		</view> -->
 		<view class="details">
-			<view class="detail-item">
+			<view class="article-con"  v-html="detail.introduction" >
+				  
+			</view>
+			<!-- <view class="detail-item">
 				<view class="title">
 					活动名称:
 				</view>
-				<view class="content">
-                荆州工会鹊桥露营主题中秋相亲会
+				<view class="content" v-text="detail.title">
 				</view>
 			</view>
 			<view class="detail-item">
@@ -18,7 +24,7 @@
 					活动地址:
 				</view>
 				<view class="content">
-			    荆州市沿江路临江仙公园
+					{{detail.address}}
 				</view>
 			</view>
 			<view class="detail-item">
@@ -26,7 +32,7 @@
 					报名时间:
 				</view>
 				<view class="content">
-			    2022-09-08 18:00截止
+					{{detail.endTime}}截止
 				</view>
 			</view>
 			<view class="detail-item">
@@ -34,75 +40,189 @@
 					活动时间:
 				</view>
 				<view class="content">
-               2022-09-10 16:00-21:00
+					{{detail.activityStartTime}}~{{detail.activityEndTime}}
 				</view>
 			</view>
 			<view class="detail-item">
 				<view class="title">
-					活动介绍
+					活动介绍:
 				</view>
-				<view class="content">
-			   
+				<view class="content" v-html="detail.introduction">
 				</view>
 			</view>
 			<view class="detail-item">
 				<view class="title">
-					特别说明
+					特别说明:
 				</view>
 				<view class="content">
-			   
+					{{detail.remark}}
 				</view>
-			</view>
-			
+			</view> -->
+		</view>
+		<u-modal v-model="show" :show-title="false" :content="content" 
+			:content-style="{color: '#101010',fontSize: '16px'}"
+			@confirm="confirm" confirm-color="#FF7C70" ref="uModal" :async-close="true"></u-modal>
+		<view class="bottom">
+			<u-button v-if="detail.isShow && !detail.isJoin" @click="signUp">立即报名</u-button>
+			<u-button v-if="detail.isShow && detail.isJoin" style="background-color: #CCCCCC;">已报名</u-button>
 		</view>
-		
-		<u-button>立即报名</u-button>
 	</view>
 </template>
 
 <script>
+	import * as API from '@/apis/news.js'
+	
 	export default {
 		data() {
 			return {
-				
+				navbarTitle: '',
+				id: '',
+				detail: {},
+				userId: '',
+				show: false,
+				content: '您已报名成功!',
+			}
+		},
+		onLoad(op) {
+			if(op.id) {
+				this.id = op.id;
+				this.getActivityDetail();
+			}
+		},
+		onShow() {
+			if(this.carhelp.getPersonInfo()) {
+				this.userId = this.carhelp.getPersonInfo().id;
 			}
 		},
 		methods: {
-			
+			getActivityDetail() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.activityDetail({id:this.id}).then(response => {
+					uni.hideLoading();
+					
+					this.detail = response.data;
+					this.navbarTitle = this.detail.title;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			},
+			signUp() {
+				if(this.userId) {
+					this.show = true;
+				} else {
+					uni.navigateTo({
+						url:'../../pagesA/pages/login/index'
+					})
+				}
+			},
+			confirm() {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				API.activitySave({id:this.id}).then(response => {
+					uni.hideLoading();
+					
+					this.getActivityDetail();
+					this.show = false;
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			}
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
-	/deep/.u-line-1{
+	.slot-wrap {
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		justify-content: center;
+		flex: 1;
+		position: absolute;
+		left: 0;
+		right: 0;
+		height: 30px;
+		text-align: center;
+		flex-shrink: 0;
+		
+		.slot-title {
+			color: rgb(96, 98, 102);
+			font-size: 17px;
+			left: 125px;
+			right: 125px;
+			width: 80%;
+			overflow: hidden;
+			white-space: nowrap;
+			text-overflow: ellipsis;
+		}
+	}
+	
+	.article-con{
+		padding: 15px 0 35px;
+		font-size: 14px;
+		line-height: 28px;
+		img{
+			width: 100%;
+			margin: 10px 0;
+		}
+	}
+	
+	/deep/.u-line-1 {
 		overflow: inherit;
 	}
-    .img{
+
+	.img {
 		margin: 32rpx;
 		height: 404rpx;
-		img{
+
+		img {
 			width: 100%;
 			height: 100%;
 		}
 	}
-	
-	.details{
+
+	.details {
 		margin: 32rpx;
 		font-size: 16px;
 		color: #333333;
-		.detail-item{
+		padding-bottom: 70px;
+
+		.detail-item {
 			display: flex;
 			margin-bottom: 24rpx;
-			.title{
+
+			.title {
 				// width: 26%;
 			}
-			.content{
+
+			.content {
 				flex: 1;
 				margin-left: 24rpx;
 			}
 		}
 	}
-	.u-btn{
+
+	.bottom {
+		width: 100%;
+		height: 56px;
+		position: fixed;
+		bottom: 0;
+		background-color: #fff;
+		display: flex;
+	}
+	
+	.u-btn {
 		width: 74.4%;
 		line-height: 44px;
 		border-radius: 50px;
@@ -114,7 +234,8 @@
 		left: 0;
 		right: 0;
 	}
-	/deep/.u-hairline-border:after{
+
+	/deep/.u-hairline-border:after {
 		border: none;
 	}
 </style>

+ 59 - 6
pages/news/index.vue

@@ -11,9 +11,8 @@
 			
 		</view>
 		<view class="newsList" v-if="list.length">
-			<view class="newsList-item" 
-				 @click="gotoUrl('pages/news/detalis?id='+item.id)"
-				v-for="(item ,index) in list" :key="item.id" >
+			<view class="newsList-item" v-for="(item ,index) in list" :key="item.id"
+				@click="toDetail(item)">
 				<view class="newsList-text">
 					<h4 class="u-line-2" v-text="item.title">
 						
@@ -70,6 +69,45 @@
 		},
 		
 		methods: {
+			toDetail(item) {
+				if(this.newstype.shortName == 'HDBG') {
+					uni.navigateTo({
+						url: '/pages/news/activityDetails?id='+item.id
+					})
+				} else {
+					uni.navigateTo({
+						url: '/pages/news/detalis?id='+item.id
+					})
+				}
+			},
+			getActivityList(bl) {
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				if (bl) {
+					this.list = [];
+					this.pageIndex = 1;
+				}
+				API.activityList({
+					pageSize:5,
+					pageIndex: this.pageIndex
+				}).then((res) => {
+					
+					this.list = [
+						...this.list,
+						...res.data.data
+					];
+					this.recordsTotal = res.data.recordsTotal
+					uni.hideLoading()
+					
+				}).catch(error => {
+					uni.showToast({
+					
+						title: error,icon: "none"
+					})
+				})
+			},
 			getBannerInfo(code){
 				uni.showLoading({
 					title: "加载中",
@@ -106,7 +144,13 @@
 					if(this.tabList.length){
 						this.newstype=this.tabList[0]	
 					}
-					this.getList()
+					
+					if(this.newstype.shortName == 'HDBG') {
+						this.getActivityList(true)
+					} else {
+						this.getList(true)
+					}
+					
 					this.getBannerInfo(this.newstype.shortName)
 					
  					uni.hideLoading()
@@ -157,14 +201,23 @@
 			myLoadmore() {
 					
 				this.pageIndex += 1;
-				this.getList()
+				if(this.newstype.shortName == 'HDBG') {
+					this.getActivityList(true)
+				} else {
+					this.getList(true)
+				}
 			},
 			change(index) {
 				this.current = index;
 				if(this.tabList.length){
 					this.newstype=this.tabList[index]
 				}
-				this.getList(true)
+				
+				if(this.newstype.shortName == 'HDBG') {
+					this.getActivityList(true)
+				} else {
+					this.getList(true)
+				}
 				this.getBannerInfo(this.newstype.shortName)
 			},
 			onReady() {