Przeglądaj źródła

新增新闻资讯

xiaoshushu 4 lat temu
rodzic
commit
ae74fcc0b7
8 zmienionych plików z 161 dodań i 1213 usunięć
  1. 2 33
      App.vue
  2. 0 0
      common/app.scss
  3. 3 1
      common/http.js
  4. 19 23
      pages.json
  5. 57 0
      pages/news/details.vue
  6. 0 471
      pages/news/details/details.vue
  7. 0 99
      pages/news/list.vue
  8. 80 586
      pages/news/news.vue

+ 2 - 33
App.vue

@@ -15,9 +15,7 @@ export default {
 </script>
 
 <style lang="scss">
-@import './common/app.css';
-/* 头条小程序需要把 iconfont 样式放到组件外 */
-@import 'components/m-icon/m-icon.css';
+@import './common/app.scss';
 
 @font-face {
 	font-family: 'iconfont';
@@ -29,38 +27,9 @@ export default {
 
 /*每个页面公共css */
 page {
-	min-height: 100%;
+	background-color: #eaeaea;
 }
 
-/* #ifdef MP-BAIDU */
-page {
-	width: 100%;
-	height: 100%;
-	display: block;
-}
-
-swan-template {
-	width: 100%;
-	min-height: 100%;
-	display: flex;
-}
-
-/* 原生组件模式下需要注意组件外部样式 */
-custom-component {
-	width: 100%;
-	min-height: 100%;
-	display: flex;
-}
-
-/* #endif */
-
-/* #ifdef MP-ALIPAY */
-page {
-	min-height: 100vh;
-}
-
-/* #endif */
-
 /* 原生组件模式下需要注意组件外部样式 */
 m-input {
 	width: 100%;

+ 0 - 0
common/app.css → common/app.scss


+ 3 - 1
common/http.js

@@ -1,5 +1,5 @@
 const ip = 'http://192.168.1.42:8686';
-//const ip = 'http://114.215.150.32';
+//const ip = 'http://114.215.150.32:8686';
 /**
  * 全部接口
  */
@@ -7,6 +7,8 @@ const urls = {
 	ip: ip,
 	login: ip + '/app/login', //app登陆
 	captchaSend: ip + '/app/captchaSend', //发送短信验证码
+	news: ip + '/app/news/list', //新闻资讯
+	news_detail: ip + '/app/news/', //新闻资讯
 }
 /**
  * 封装的请求

+ 19 - 23
pages.json

@@ -342,19 +342,28 @@
 		}, {
 			"path": "pages/news/news",
 			"style": {
-				"navigationBarTitleText": "资讯"
+				"navigationBarTitleText": "华夏资讯",
+				"enablePullDownRefresh": true,
+				"app-plus": {
+					"pullToRefresh": {
+						"support": true,
+						"style": "default",
+						"offset": 0
+					}
+				}
 			}
 		}, {
-			"path": "pages/news/details/details",
+			"path": "pages/news/details",
 			"style": {
-				"navigationBarBackgroundColor": "#fff",
-				"navigationBarTextStyle": "black",
-				"backgroundColorTop": "#F7F7F7",
-				"backgroundColorBottom": "#F7F7F7",
-				"navigationBarTitleText": "资讯 ",
-				"navigationStyle": "custom",
+				"navigationBarTitleText": "资讯详情",
 				"app-plus": {
-					"bounce": "vertical"
+					"titleNView": {
+						"buttons": [{
+							"text": "保存",
+							"fontSize": "15px",
+							"float": "right"
+						}]
+					}
 				}
 			}
 		}, {
@@ -392,19 +401,6 @@
 			"style": {
 				"navigationBarTitleText": "找回密码"
 			}
-		}, {
-			"path": "pages/news/list",
-			"style": {
-				"navigationBarTitleText": "新闻资讯",
-				"enablePullDownRefresh": true,
-				"app-plus": {
-					"pullToRefresh": {
-						"support": true,
-						"style": "default",
-						"offset": 0
-					}
-				}
-			}
 		}
 	],
 	"tabBar": {
@@ -440,6 +436,6 @@
 	"globalStyle": {
 		"navigationBarTextStyle": "white",
 		"navigationBarBackgroundColor": "#c74547",
-		"backgroundColor": "#efefef"
+		"backgroundColor": "whitesmoke"
 	}
 }

+ 57 - 0
pages/news/details.vue

@@ -0,0 +1,57 @@
+<template>
+	<view class="contents">
+		<view class="time">
+			<text>{{ item.createTime }}</text>
+			<text class="views" v-if="item.views">{{ item.views }} 人看过</text>
+		</view>
+		<view class="title">
+			<text v-if="item.title">【{{ item.title }}】</text>
+		</view>
+		<view><rich-text :nodes="item.contents"></rich-text></view>
+	</view>
+</template>
+<script>
+export default {
+	data() {
+		return {
+			item: {}
+		};
+	},
+	onLoad(e) {
+		this.$http.request({
+			url: this.$http.urls.news_detail + e.id,
+			success: res => {
+				this.item = res.data.data;
+				this.item.contents = res.data.data.contents.replace(/\<img/gi, '<img class="rich-img"');
+			}
+		});
+	},
+	methods: {
+		//分享
+		share() {}
+	}
+};
+</script>
+<style lang="scss">
+page {
+	background-color: white !important;
+}
+.time {
+	color: #818184;
+	padding-bottom: 12px;
+	font-size: 14px;
+	.views {
+		padding-left: 20px;
+		float: right;
+	}
+}
+.title {
+	padding-top: 8px;
+	font-size: 23px;
+	font-weight: 400;
+	margin-bottom: 20px;
+}
+.contents {
+	padding: 20px;
+}
+</style>

+ 0 - 471
pages/news/details/details.vue

@@ -1,471 +0,0 @@
-<template>
-	<view class="container">
-		<!--header-->
-		<view class="tui-header-box" :style="{ height: height + 'px', background: '#C74547', color:'#ffffff'}">
-			<view class="tui-header" :style="{ paddingTop: top + 'px', opacity: 1.024 }">资讯</view>
-			<view class="tui-header-icon-left" :style="{ marginTop: top + 'px' }">
-				<view class="tui-icon-box" :style="{ backgroundColor: 'rgba(0, 0, 0, 0)' }" @tap="back">
-					<tui-icon name="arrowleft" :size="30" :color="opcity >= 1 ? '#fff' : '#fff'"></tui-icon>
-				</view>
-			</view>
-			
-			<view class="tui-header-icon-right" :style="{ marginTop: top + 'px' }">
-				<view class="tui-icon-box tui-icon-ml" :style="{backgroundColor: 'rgba(0, 0, 0, 0)'}" @click="popup">
-					<tui-icon name="share" :size="20" :color="opcity >= 1 ? '#fff' : '#fff'"></tui-icon>
-				</view>
-			</view>
-		</view>
-		<!--header-->
-		
-		<view class="tui-center" :style="{ marginTop: height + 'px' }">
-			<view class="tui-pro-time" style="width: 100%;padding: 10px 0;">
-				<text style="float: left;margin-left: 50px;">2020.7.29</text>
-				<text style="float: right;margin-right: 50px;">229 人看过</text>
-			</view>
-			<view class="tui-pro-content">
-				<view class="tui-pro-tit">【本溪历史的今天】7月29日</view>
-				<view>
-					<view class="tui-pro-price">
-						<text class="tui-sale-price">我们每天都会这样子复制粘贴然后进行测</br>试看看字符是不是够用会不会撑开我们每天都会这样子复制粘贴然后进行测</text>
-					</view>
-				</view>
-			</view>
-			
-		</view>
-		
-		<!--底部分享弹窗-->
-		<tui-bottom-popup :show="popupShow" @close="popup">
-			<view class="tui-share">
-				<view class="tui-share-title">分享到</view>
-				<scroll-view scroll-x style="padding-right:20rpx">
-					<view class="tui-share-top">
-						<view class="tui-share-item" :class="[shareList[0].share.length-1===index?'tui-item-last':'']" v-for="(item,index) in shareList[0].share"
-						 :key="index" @tap="popup">
-							<view class="tui-share-icon" hover-class="tui-hover" :hover-stay-time="150">
-								<tui-icon :name="item.icon" :color="item.color" :size="item.size?item.size:36"></tui-icon>
-							</view>
-							<view class="tui-share-text">{{item.name}}</view>
-						</view>
-						<view class="tui-empty">!</view>
-					</view>
-		
-				</scroll-view>
-		
-				<scroll-view scroll-x class="tui-mt">
-					<view class="tui-share-bottom">
-						<view class="tui-share-item" :class="[shareList[1].operate.length-1===index?'tui-item-last':'']" v-for="(item,index) in shareList[1].operate"
-						 :key="index" @tap="popup">
-							<view class="tui-share-icon" hover-class="tui-hover" :hover-stay-time="150">
-								<tui-icon :name="item.icon" color="#404040" :size="item.size" :bold="index===2"></tui-icon>
-							</view>
-							<view class="tui-share-text">{{item.name}}</view>
-						</view>
-					</view>
-		
-				</scroll-view>
-				<view class="tui-btn-cancle" @tap="popup">取消</view>
-			</view>
-		</tui-bottom-popup>
-		<!--底部分享弹窗-->
-	</view>
-</template>
-
-<script>
-	import tuiButton from "@/components/thorui/tui-button/tui-button"
-	import tuiIcon from "@/components/thorui/tui-icon/tui-icon"
-	import tuiBadge from "@/components/thorui/tui-badge/tui-badge"
-	import tuiTag from "@/components/thorui/tui-tag/tui-tag"
-	import tuiNomore from "@/components/thorui/tui-nomore/tui-nomore"
-	import tuiTopDropdown from "@/components/thorui/tui-top-dropdown/tui-top-dropdown"
-	import tuiBottomPopup from "@/components/thorui/tui-bottom-popup/tui-bottom-popup"
-	import tuiNumberbox from "@/components/thorui/tui-numberbox/tui-numberbox"
-	
-	export default {
-		components:{
-					tuiButton,
-					tuiIcon,
-					tuiBadge,
-					tuiTag,
-					tuiNomore,
-					tuiTopDropdown,
-					tuiBottomPopup,
-					tuiNumberbox
-				},
-		data() {
-			return {
-				height: 64, //header高度
-				top: 26, //标题图标距离顶部距离
-				scrollH: 0, //滚动总高度
-				opcity: 0,
-				iconOpcity: 0.5,
-				bannerIndex: 0,
-				shareList: [{
-					share: [{
-						name: "QQ",
-						icon: "qq",
-						color: "#07BDFD",
-						size: 34
-					}, {
-						name: "微信",
-						icon: "wechat",
-						color: "#80D640"
-					}, {
-						name: "朋友圈",
-						icon: "moments",
-						color: "#80D640",
-						size: 32
-					}, {
-						name: "支付宝",
-						icon: "alipay",
-						color: "#00AAEE"
-					}, {
-						name: "新浪微博",
-						icon: "sina",
-						color: "#F9C718"
-					}, {
-						name: "小程序",
-						icon: "applets",
-						color: "#2BA348"
-					}, {
-						name: "钉钉",
-						icon: "dingtalk",
-						color: "#2DA0F1"
-					}, {
-						name: "浏览器打开",
-						icon: "explore-fill",
-						color: "#1695F7"
-					}, {
-						name: "邮件",
-						icon: "mail-fill",
-						color: "#2868E5"
-					}]
-				}, {
-					operate: [{
-						name: "投诉",
-						icon: "warning",
-						size: 30
-					}, {
-						name: "复制链接",
-						icon: "link",
-						size: 28
-					}, {
-						name: "刷新",
-						icon: "refresh",
-						size: 30
-					}, {
-						name: "搜索内容",
-						icon: "search-2",
-						size: 28
-					}]
-				}],
-				menuShow: false,
-				popupShow: false,
-				value: 1,
-				collected: false
-			};
-		},
-		onLoad: function(options) {
-			let obj = {};
-			// #ifdef MP-WEIXIN
-			obj = wx.getMenuButtonBoundingClientRect();
-			// #endif
-			// #ifdef MP-BAIDU
-			obj = swan.getMenuButtonBoundingClientRect();
-			// #endif
-			// #ifdef MP-ALIPAY
-			my.hideAddToDesktopMenu();
-			// #endif
-
-			setTimeout(() => {
-				uni.getSystemInfo({
-					success: res => {
-						this.width = obj.left || res.windowWidth;
-						this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44;
-						this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6;
-						this.scrollH = res.windowWidth;
-					}
-				});
-			}, 0);
-		},
-		methods: {
-			popup: function() {
-				this.popupShow = !this.popupShow
-			},
-			back: function() {
-				uni.navigateBack();
-			},
-		},
-		onPageScroll(e) {
-			let scroll = e.scrollTop <= 0 ? 0 : e.scrollTop;
-			let opcity = scroll / this.scrollH;
-			if (this.opcity >= 1 && opcity >= 1) {
-				return;
-			}
-			this.opcity = opcity;
-			this.iconOpcity = 0.5 * (1 - opcity < 0 ? 0 : 1 - opcity);
-		}
-	};
-</script>
-
-<style>
-	page {
-		background-color: #f7f7f7;
-	}
-
-	.container {
-		width: 100%;
-	}
-
-	.tui-header-box {
-		width: 100%;
-		left: 0;
-		top: 0;
-		z-index: 995;
-		position: fixed;
-		top: 0;
-	}
-
-	.tui-header {
-		width: 100%;
-		font-size: 18px;
-		line-height: 18px;
-		font-weight: 500;
-		height: 32px;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-	}
-
-	.tui-header-icon-left {
-		position: fixed;
-		top: 0;
-		left: 10px;
-		display: flex;
-		align-items: flex-start;
-		justify-content: space-between;
-		height: 32px;
-		transform: translateZ(0);
-		z-index: 9999;
-	}
-	.tui-header-icon-right {
-		position: fixed;
-		top: 0;
-		right: 10px;
-		display: flex;
-		align-items: flex-start;
-		justify-content: space-between;
-		height: 32px;
-		transform: translateZ(0);
-		z-index: 9999;
-	}
-
-	.tui-header-icon-left .tui-badge {
-		background: #e41f19 !important;
-		position: absolute;
-		right: -4px;
-	}
-	
-	.tui-header-icon-right .tui-badge {
-		background: #e41f19 !important;
-		position: absolute;
-		right: -4px;
-	}
-
-	.tui-icon-ml {
-		margin-left: 20rpx;
-	}
-
-	.tui-icon-box {
-		position: relative;
-		height: 20px !important;
-		width: 20px !important;
-		padding: 6px !important;
-
-		border-radius: 50%;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-	}
-
-	.tui-banner-swiper {
-		position: relative;
-	}
-
-	.tui-banner-tag {
-		position: absolute;
-		color: #fff;
-		bottom: 30rpx;
-		right: 0;
-	}
-
-	.tui-slide-image {
-		width: 100%;
-		display: block;
-	}
-	/*内容*/
-	.tui-center {
-		width: 100%;
-		height: 100%;
-		background: #fff;
-	}
-	.tui-pro-price {
-		padding-top: 18rpx;
-	}
-	.tui-sale-price {
-		font-size: 26rpx;
-		font-weight: 500;
-		color: #b5b5b5;
-	}
-	.tui-pro-content {
-		width: 100%;
-		display: flex;
-		flex-direction: column;
-		justify-content: space-between;
-		box-sizing: border-box;
-		padding: 20rpx;
-	}
-	.tui-pro-tit {
-		color: #2e2e2e;
-		font-size: 34rpx;
-		word-break: break-all;
-		overflow: hidden;
-		text-overflow: ellipsis;
-		display: -webkit-box;
-		-webkit-box-orient: vertical;
-		-webkit-line-clamp: 2;
-	}
-	/*内容日期浏览*/
-	.tui-pro-time {
-		font-size: 26rpx;
-		font-weight: 500;
-		color: #b5b5b5;
-	}
-	/*header 下拉选择*/
-	
-	.top-dropdown {
-		margin-top: 360rpx;
-		padding: 0 40rpx;
-		box-sizing: border-box;
-	}
-	
-	.tui-share-box {
-		padding: 0 50rpx;
-		box-sizing: border-box;
-	}
-	
-	.tui-drop-input-box {
-		padding: 50rpx;
-		box-sizing: border-box;
-	}
-	
-	.tui-animation {
-		display: inline-block;
-		transform: rotate(0deg);
-		transition: all 0.2s;
-	}
-	
-	.tui-animation-show {
-		transform: rotate(180deg);
-	}
-	
-	.tui-selected-list {
-		background-color: #fff;
-		border-radius: 20rpx;
-		overflow: hidden;
-		transform: translateZ(0);
-	}
-	
-	.tui-dropdown-scroll {
-		height: 400rpx;
-	}
-	
-	.tui-cell-class {
-		display: flex;
-		align-items: center;
-		padding: 26rpx 30rpx !important;
-	}
-	
-	.tui-ml-20 {
-		margin-left: 20rpx;
-	}
-	
-	.tui-share {
-		background: #e8e8e8;
-		position: relative;
-		padding-bottom: env(safe-area-inset-bottom);
-	}
-	
-	.tui-share-title {
-		font-size: 26rpx;
-		color: #7E7E7E;
-		text-align: center;
-		line-height: 26rpx;
-		padding: 20rpx 0 50rpx 0;
-	}
-	
-	.tui-share-top,
-	.tui-share-bottom {
-		min-width: 101%;
-		padding: 0 20rpx 0 30rpx;
-		white-space: nowrap;
-	}
-	
-	.tui-mt {
-		margin-top: 30rpx;
-		padding-bottom: 150rpx;
-	}
-	
-	.tui-share-item {
-		width: 126rpx;
-		display: inline-block;
-		margin-right: 24rpx;
-		text-align: center;
-	}
-	
-	.tui-item-last {
-		margin: 0;
-	}
-	
-	.tui-empty {
-		display: inline-block;
-		width: 30rpx;
-		visibility: hidden;
-	}
-	
-	.tui-share-icon {
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		background: #fafafa;
-		height: 126rpx;
-		width: 126rpx;
-		border-radius: 32rpx;
-	}
-	
-	.tui-share-text {
-		font-size: 24rpx;
-		color: #7E7E7E;
-		line-height: 24rpx;
-		padding: 20rpx 0;
-		white-space: nowrap;
-	}
-	
-	.tui-btn-cancle {
-		width: 100%;
-		height: 100rpx;
-		position: absolute;
-		left: 0;
-		bottom: 0;
-		background: #f6f6f6;
-		font-size: 36rpx;
-		color: #3e3e3e;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		padding-bottom: env(safe-area-inset-bottom);
-	}
-	
-	.tui-hover {
-		background: rgba(0, 0, 0, 0.2)
-	}
-</style>

+ 0 - 99
pages/news/list.vue

@@ -1,99 +0,0 @@
-<template>
-	<view>
-		<view class="list">
-			<view class="item">
-				<view class="time"><text>2020.7.29</text> <text class="views">269人看过</text>
-				</view>
-				<image src="../../static/images/news/20201009233729.png"></image>
-				<view class="title">【本溪历史的今天】7月29日</view>
-				<view class="desc">我们每天会分享一则咱们本溪历史上今天发生过的一些有意义的事情,希望大家能够喜欢,不足之处也欢迎各位留言补充</view>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-export default {
-	data() {
-		return {
-			ip: this.$http.urls.ip,
-			list: [],
-			param: { pageNum: 1 },
-			showLoadMore: false
-		};
-	},
-	onLoad() {
-		this.getData();
-	},
-	methods: {
-		//获取数据
-		getData() {
-			this.$http.request({
-				url: this.$http.urls.service_list,
-				data: this.param,
-				success: res => {
-					this.showLoadMore = res.data.pages > this.param.pageNum ? true : false;
-					res.data.rows.forEach(item => {
-						this.list.push(item);
-					});
-				}
-			});
-		},
-		//刷新数据
-		refresh() {
-			this.param.pageNum = 1;
-			this.list = [];
-			this.getData();
-		}
-	},
-	//下拉刷新
-	onPullDownRefresh() {
-		this.refresh();
-		uni.stopPullDownRefresh();
-	},
-	//上拉加载
-	onReachBottom() {
-		if (this.showLoadMore) {
-			this.param.pageNum++;
-			this.getData();
-		}
-	}
-};
-</script>
-
-<style lang="scss">
-.list {
-	padding: 0px 20px;
-}
-.item {
-	background-color: white;
-	overflow: hidden;
-	margin-top: 15px;
-	border-radius: 7px;
-	padding: 15px;
-	image {
-		width: 100%;
-		height: 170px !important;
-		border-radius: 7px;
-	}
-	.time {
-		color: #818184;
-		padding-bottom: 12px;
-		font-size: 13px;
-		.views {
-			padding-left: 20px;
-		}
-	}
-	.title {
-		padding-top: 8px;
-		font-size: 16px;
-		color: #252525;
-	}
-	.desc {
-		padding-top: 8px;
-		font-size: 13px;
-		letter-spacing: 1px;
-		color: #827d7d;
-	}
-}
-</style>

+ 80 - 586
pages/news/news.vue

@@ -1,616 +1,110 @@
 <template>
-	<view class="container">
-		<view class="tui-product-box">
-			<view class="tui-product-list">
-				<view class="tui-product-container">
-					<block v-for="(item, index) in newsList" :key="index" >
-						<!--商品列表-->
-						<view class="tui-pro-item" hover-class="tui-opcity" :hover-start-time="150">
-							<view class="tui-pro-content" @tap="details">
-								<view class="tui-pro-time">
-								<text>{{ item.time }}</text>
-								<text style="margin-left: 30rpx;">{{ item.views }} 人看过</text>
-								</view>
-							</view>
-							<image @tap="details" :src="item.img" class="tui-pro-img"/>
-							<view class="tui-pro-content" @tap="details">
-								<view class="tui-pro-tit">{{ item.title }}</view>
-								<view>
-									<view class="tui-pro-price">
-										<text class="tui-sale-price">{{ item.content }}</text>
-									</view>
-								</view>
-							</view>
-						</view>
-						<!--商品列表-->
-						<!-- <template is="productItem" data="{{item,index:index}}" /> -->
-					</block>
+	<view>
+		<view class="list">
+			<view class="item" v-for="(item, index) in list" @click="detail(item.id)">
+				<view class="time">
+					<text>2020.7.29</text>
+					<text class="views">269人看过</text>
 				</view>
+				<image :src="ip + item.pic"></image>
+				<view class="title">【{{ item.title }}】</view>
+				<view class="desc">{{ item.descs }}...</view>
 			</view>
 		</view>
-
-		<!--加载loadding-->
-		<tui-loadmore v-if="loadding" :index="3" type="red"></tui-loadmore>
-		<!-- <tui-nomore v-if="!pullUpOn"></tui-nomore> -->
-		<!--加载loadding-->
-		<view class="tui-safearea-bottom"></view>
 	</view>
 </template>
+
 <script>
-import tuiButton from "@/components/thorui/tui-button/tui-button"
 export default {
-	components:{
-				tuiButton,
-			},
 	data() {
 		return {
-			current: 0,
-			newsList: [
-				{
-					time: '2020.7.29',
-					views: '200',
-					img: '../../static/img/news/1.jpg',
-					title: '【本溪历史的今天】7月29日',
-					content: '我们每天都会这样子复制粘贴然后进行测试看看字符是不是够用会不会撑开我们每天都会这样子复制粘贴然后进行测试看看字符是不是够用会不会撑开我们每天都会这样子复制粘贴然后进行测试看看字符是不是够用会不会撑开'
-
-				},
-				{
-					time: '2020.7.28',
-					views: '200',
-					img: '../../static/img/news/1.jpg',
-					title: '【本溪历史的今天】7月28日',
-					content: '我们每天都会这样子复制粘贴然后进行测试看看字符是不是够用会不会撑开我们每天都会这样子复制粘贴然后进行测试看看字符是不是够用会不会撑开我们每天都会这样子复制粘贴然后进行测试看看字符是不是够用会不会撑开'
-				
-				}
-			],
-			pageIndex: 1,
-			loadding: false,
-			pullUpOn: true
+			ip: this.$http.urls.ip,
+			list: [],
+			param: { pageNum: 1, orderByColumn: 'id', isAsc: 'desc' },
+			showLoadMore: false
 		};
 	},
+	onLoad() {
+		this.getData();
+	},
 	methods: {
-		details: function() {
+		//获取数据
+		getData() {
+			this.$http.request({
+				url: this.$http.urls.news,
+				data: this.param,
+				success: res => {
+					this.showLoadMore = res.data.pages > this.param.pageNum ? true : false;
+					res.data.rows.forEach(item => {
+						this.list.push(item);
+					});
+				}
+			});
+		},
+		//详情
+		detail(id) {
 			uni.navigateTo({
-				url: '/pages/news/details/details'
+				url: 'details?id=' + id
 			});
 		},
+		//刷新数据
+		refresh() {
+			this.param.pageNum = 1;
+			this.list = [];
+			this.getData();
+		}
 	},
-	onPullDownRefresh: function() {
-		let loadData = JSON.parse(JSON.stringify(this.newsList));
-		loadData = loadData.splice(0, 10);
-		this.newsList = loadData;
-		this.pageIndex = 1;
-		this.pullUpOn = true;
-		this.loadding = false;
+	//下拉刷新
+	onPullDownRefresh() {
+		this.refresh();
 		uni.stopPullDownRefresh();
 	},
-	onReachBottom: function() {
-		if (!this.pullUpOn) return;
-		this.loadding = true;
-		if (this.pageIndex == 4) {
-			this.loadding = false;
-			this.pullUpOn = false;
-		} else {
-			let loadData = JSON.parse(JSON.stringify(this.newsList));
-			loadData = loadData.splice(0, 10);
-			if (this.pageIndex == 1) {
-				loadData = loadData.reverse();
-			}
-			this.newsList = this.newsList.concat(loadData);
-			this.pageIndex = this.pageIndex + 1;
-			this.loadding = false;
+	//上拉加载
+	onReachBottom() {
+		if (this.showLoadMore) {
+			this.param.pageNum++;
+			this.getData();
 		}
 	}
 };
 </script>
 
-<style>
+<style lang="scss">
 page {
-	background-color: #f7f7f7;
+	background-color: #dedede;
 }
-
-.container {
-	padding-bottom: 100rpx;
-	color: #333;
-	width: 100%;
+.list {
+	padding: 0px 10px;
 }
-
-	.tui-btn-box {
-		margin-bottom: 26rpx;
-	}
-
-	.tui-flex-box {
+.item {
+	background-color: white;
+	overflow: hidden;
+	margin-top: 15px;
+	border-radius: 7px;
+	padding: 15px;
+	image {
 		width: 100%;
-		display: flex;
-		align-items: center;
+		height: 170px !important;
+		border-radius: 7px;
+	}
+	.time {
+		color: #818184;
+		padding-bottom: 12px;
+		font-size: 13px;
+		.views {
+			padding-left: 20px;
 		}
-/*tabbar*/
-
-.tui-tabbar {
-	width: 100%;
-	position: fixed;
-	display: flex;
-	align-items: center;
-	justify-content: space-between;
-	z-index: 99999;
-	background: #fff;
-	height: 100rpx;
-	left: 0;
-	bottom: 0;
-	padding-bottom: env(safe-area-inset-bottom);
-}
-
-.tui-safearea-bottom {
-	width: 100%;
-	height: env(safe-area-inset-bottom);
-}
-
-.tui-tabbar::before {
-	content: '';
-	width: 100%;
-	border-top: 1rpx solid #d9d9d9;
-	position: absolute;
-	top: 0;
-	left: 0;
-	-webkit-transform: scaleY(0.5);
-	transform: scaleY(0.5);
-}
-
-.tui-tabbar-item {
-	flex: 1;
-	width: 25%;
-	display: flex;
-	align-items: center;
-	flex-direction: column;
-	justify-content: center;
-	font-size: 24rpx;
-	color: #666;
-	height: 80rpx;
-}
-
-.tui-ptop-4 {
-	padding-top: 4rpx;
-}
-
-.tui-scale {
-	font-weight: bold;
-	transform: scale(0.8);
-	transform-origin: center 100%;
-	line-height: 30rpx;
-}
-
-.tui-item-active {
-	color: #194ee4 !important;
-}
-
-/*tabbar*/
-
-.tui-header {
-	width: 100%;
-	height: 100rpx;
-	padding: 0 30rpx 0 20rpx;
-	box-sizing: border-box;
-	background-color: #194ee4;
-	display: flex;
-	align-items: center;
-	justify-content: space-between;
-	position: fixed;
-	left: 0;
-	top: 0;
-	/* #ifdef H5 */
-	top: 44px;
-	/* #endif */
-	z-index: 999;
-}
-
-.tui-rolling-search {
-	width: 100%;
-	height: 60rpx;
-	border-radius: 35rpx;
-	padding: 0 40rpx 0 30rpx;
-	box-sizing: border-box;
-	background-color: #fff;
-	display: flex;
-	align-items: center;
-	flex-wrap: nowrap;
-	color: #999;
-}
-
-.tui-category {
-	font-size: 24rpx;
-	color: #fff;
-	display: flex;
-	align-items: center;
-	justify-content: center;
-	flex-direction: column;
-	margin: 0;
-	margin-right: 22rpx;
-	flex-shrink: 0;
-}
-
-.tui-category-scale {
-	transform: scale(0.7);
-	line-height: 24rpx;
-}
-
-.tui-icon-category {
-	line-height: 20px !important;
-	margin-bottom: 0 !important;
-}
-
-.tui-swiper {
-	font-size: 26rpx;
-	height: 60rpx;
-	flex: 1;
-	padding-left: 12rpx;
-}
-
-.tui-swiper-item {
-	display: flex;
-	align-items: center;
-}
-
-.tui-hot-item {
-	line-height: 26rpx;
-	white-space: nowrap;
-	overflow: hidden;
-	text-overflow: ellipsis;
-}
-
-.tui-header-banner {
-	padding-top: 50rpx;
-	box-sizing: border-box;
-	background: #194ee4;
-}
-
-.tui-hot-search {
-	color: #fff;
-	font-size: 24rpx;
-	display: flex;
-	align-items: center;
-	justify-content: space-between;
-	padding: 0 20rpx;
-	box-sizing: border-box;
-	position: relative;
-	z-index: 2;
-}
-
-.tui-hot-tag {
-	background-color: rgba(255, 255, 255, 0.15);
-	padding: 10rpx 24rpx;
-	border-radius: 30rpx;
-	display: flex;
-	align-items: center;
-	justify-content: center;
-	line-height: 24rpx;
-}
-
-.tui-banner-bg {
-	display: flex;
-	height: 180rpx;
-	background-color: #194ee4;
-	position: relative;
-}
-
-.tui-primary-bg {
-	width: 50%;
-	display: inline-block;
-	height: 224rpx;
-	border: 1px solid transparent;
-	position: relative;
-	z-index: 1;
-	background-color: #194ee4;
-}
-
-.tui-route-left {
-	transform: skewY(8deg);
-}
-
-.tui-route-right {
-	transform: skewY(-8deg);
-}
-
-.tui-banner-box {
-	width: 100%;
-	padding: 0 20rpx;
-	box-sizing: border-box;
-	position: absolute;
-	/* overflow: hidden; */
-	z-index: 99;
-	bottom: -80rpx;
-	left: 0;
-}
-
-.tui-banner-swiper {
-	width: 100%;
-	height: 240rpx;
-	border-radius: 12rpx;
-	overflow: hidden;
-	transform: translateY(0);
-}
-
-.tui-slide-image {
-	width: 100%;
-	height: 240rpx;
-	display: block;
-}
-
-/* #ifdef MP-WEIXIN */
-.tui-banner-swiper .wx-swiper-dot {
-	width: 8rpx;
-	height: 8rpx;
-	display: inline-flex;
-	background: none;
-	justify-content: space-between;
-}
-
-.tui-banner-swiper .wx-swiper-dot::before {
-	content: '';
-	flex-grow: 1;
-	background-color: rgba(255, 255, 255, 0.8);
-	border-radius: 16rpx;
-	overflow: hidden;
-}
-
-.tui-banner-swiper .wx-swiper-dot-active::before {
-	background-color: #fff;
-}
-
-.tui-banner-swiper .wx-swiper-dot.wx-swiper-dot-active {
-	width: 16rpx;
-}
-
-/* #endif */
-
-/* #ifndef MP-WEIXIN */
->>> .tui-banner-swiper .uni-swiper-dot {
-	width: 8rpx;
-	height: 8rpx;
-	display: inline-flex;
-	background-color: none;
-	justify-content: space-between;
-}
-
->>> .tui-banner-swiper .uni-swiper-dot::before {
-	content: '';
-	flex-grow: 1;
-	background-color: rgba(255, 255, 255, 0.8);
-	border-radius: 16rpx;
-	overflow: hidden;
-}
-
->>> .tui-banner-swiper .uni-swiper-dot-active::before {
-	background-color: #fff;
-}
-
->>> .tui-banner-swiper .uni-swiper-dot.uni-swiper-dot-active {
-	width: 16rpx;
-}
-
-/* #endif */
-
-.tui-product-category {
-	background-color: #fff;
-	padding: 80rpx 20rpx 30rpx 20rpx;
-	box-sizing: border-box;
-	display: flex;
-	align-items: center;
-	justify-content: space-between;
-	flex-wrap: wrap;
-	font-size: 24rpx;
-	color: #555;
-}
-
-.tui-category-item {
-	width: 33.3%;
-	height: 64px;
-	display: flex;
-	align-items: center;
-	justify-content: space-between;
-	flex-direction: column;
-	padding-top: 30rpx;
-}
-
-.tui-category-img {
-	height: 48px;
-	width: 48px;
-	display: block;
-}
-
-.tui-category-name {
-	line-height: 12px;
-}
-
-.tui-product-box {
-	padding: 30rpx 30rpx;
-	box-sizing: border-box;
-}
-
-.tui-pb-20 {
-	padding-bottom: 20rpx;
-}
-
-.tui-bg-white {
-	background-color: #fff;
-}
-
-.tui-group-name {
-	width: 100%;
-	font-size: 32rpx;
-	font-weight: bold;
-	text-align: center;
-	padding: 24rpx 0;
-	display: flex;
-	align-items: center;
-	justify-content: center;
-}
-
-.tui-activity-box {
-	display: flex;
-	border-radius: 12rpx;
-	overflow: hidden;
-}
-
-.tui-activity-img {
-	width: 50%;
-	display: block;
-}
-
-.tui-new-box {
-	display: flex;
-	align-items: center;
-	justify-content: space-between;
-	flex-wrap: wrap;
-}
-
-.tui-new-item {
-	width: 49%;
-	height: 200rpx;
-	padding: 0 20rpx;
-	box-sizing: border-box;
-	display: flex;
-	align-items: center;
-	background: #f5f2f9;
-	position: relative;
-	border-radius: 12rpx;
-}
-
-.tui-new-mtop {
-	margin-top: 2%;
-}
-
-.tui-title-box {
-	font-size: 24rpx;
-}
-
-.tui-new-title {
-	line-height: 32rpx;
-	word-break: break-all;
-	overflow: hidden;
-	text-overflow: ellipsis;
-	display: -webkit-box;
-	-webkit-box-orient: vertical;
-	-webkit-line-clamp: 2;
-}
-
-.tui-new-price {
-	padding-top: 18rpx;
-}
-
-.tui-new-present {
-	color: #ff201f;
-	font-weight: bold;
-}
-
-.tui-new-original {
-	display: inline-block;
-	color: #a0a0a0;
-	text-decoration: line-through;
-	padding-left: 12rpx;
-	transform: scale(0.8);
-	transform-origin: center center;
-}
-
-.tui-new-img {
-	width: 160rpx;
-	height: 160rpx;
-	display: block;
-	flex-shrink: 0;
-}
-
-.tui-new-label {
-	width: 56rpx;
-	height: 56rpx;
-	border-top-left-radius: 12rpx;
-	position: absolute;
-	left: 0;
-	top: 0;
-}
-
-.tui-product-list {
-	display: flex;
-	justify-content: space-between;
-	flex-direction: row;
-	flex-wrap: wrap;
-	box-sizing: border-box;
-	/* padding-top: 20rpx; */
-}
-
-.tui-product-container {
-	flex: 1;
-	margin-right: 2%;
-}
-
-.tui-product-container:last-child {
-	margin-right: 0;
-}
-
-.tui-pro-item {
-	width: 100%;
-	margin-bottom: 4%;
-	background: #fff;
-	box-sizing: border-box;
-	border-radius: 12rpx;
-	overflow: hidden;
-}
-
-.tui-pro-img {
-	width: auto;
-	display: block;
-	height: 300rpx;
-	padding:0 20rpx;
-}
-
-.tui-pro-content {
-	display: flex;
-	flex-direction: column;
-	justify-content: space-between;
-	box-sizing: border-box;
-	padding: 20rpx;
-}
-
-.tui-pro-tit {
-	color: #2e2e2e;
-	font-size: 34rpx;
-	word-break: break-all;
-	overflow: hidden;
-	text-overflow: ellipsis;
-	display: -webkit-box;
-	-webkit-box-orient: vertical;
-	-webkit-line-clamp: 2;
-}
-
-.tui-pro-price {
-	padding-top: 18rpx;
-}
-
-.tui-pro-time {
-	font-size: 26rpx;
-	font-weight: 500;
-	color: #b5b5b5;
-}
-
-
-.tui-sale-price {
-	font-size: 26rpx;
-	font-weight: 500;
-	color: #b5b5b5;
-	-webkit-line-clamp: 3;
-	-webkit-box-orient: vertical;
-	display: -webkit-box;
-	overflow: hidden;
-}
-
-.tui-factory-price {
-	font-size: 24rpx;
-	color: #a0a0a0;
-	text-decoration: line-through;
-	padding-left: 12rpx;
-}
-
-.tui-pro-pay {
-	padding-top: 10rpx;
-	font-size: 24rpx;
-	color: #656565;
+	}
+	.title {
+		padding-top: 8px;
+		font-size: 16px;
+		color: #252525;
+	}
+	.desc {
+		padding-top: 8px;
+		font-size: 13px;
+		letter-spacing: 1px;
+		color: #827d7d;
+	}
 }
-</style>
+</style>