lhl 2 years ago
parent
commit
a51457ff13

+ 142 - 122
pages/index/artDetail.vue

@@ -1,130 +1,150 @@
-<template>
-	<view class="center">
-		<!-- <view class="title clamp">{{ item.title }}</view>
-		<view class="time">{{ item.add_time }}</view> -->
-		<view class="main" v-for="(ls, index) in item.content" :key="index">
-			<view v-if="ls.type == 'rich-text'" v-html="ls.value" class="main"></view>
-			<video v-if="ls.type == 'video' && ls.value" :src="ls.value" style="width:100%;height: 300px" frameborder="0"></video>
-		</view>
-	</view>
-</template>
-
-<script>
-import { details } from '@/api/user.js';
-export default {
-	data() {
-		return {
-			id: '',
-			item: ''
-		};
-	},
-	onLoad(option) {
-		this.id = option.id;
-		this.loadData();
-	},
-	onShareAppMessage(options) {
-		// 设置菜单中的转发按钮触发转发事件时的转发内容
-		let pages = getCurrentPages(); //获取加载的页面
-		let currentPage = pages[pages.length - 1]; //获取当前页面的对象
-		let url = currentPage.route; //当前页面url
-		let item = currentPage.options; //如果要获取url中所带的参数可以查看options
-		let shareObj = {
-			title: '水箱计算', // 默认是小程序的名称(可以写slogan等)
-			path: url + '?id=' + item.id, // 默认是当前页面,必须是以‘/’开头的完整路径
-			imageUrl: '',
-			success: function(res) {
-				// 转发成功之后的回调
-				if (res.errMsg == 'shareAppMessage:ok') {}
-			},
-			fail: function() {
-				// 转发失败之后的回调
-				if (res.errMsg == 'shareAppMessage:fail cancel') {
-					// 用户取消转发
-				} else if (res.errMsg == 'shareAppMessage:fail') {
-					// 转发失败,其中 detail message 为详细失败信息
+<template>
+	<view class="center">
+		<!-- <view class="title clamp">{{ item.title }}</view>
+		<view class="time">{{ item.add_time }}</view> -->
+		<view class="main" v-for="(ls, index) in item.content" :key="index">
+			<view v-if="ls.type == 'rich-text'" v-html="ls.value" class="main"></view>
+			<video v-if="ls.type == 'video' && ls.value" :src="ls.value" style="width:100%;height: 300px"
+				frameborder="0"></video>
+		</view>
+		<view class="uu" v-if="item.url" @click="navto(item.url)">
+			点击跳转查看更多
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		details
+	} from '@/api/user.js';
+	export default {
+		data() {
+			return {
+				id: '',
+				item: ''
+			};
+		},
+		onLoad(option) {
+			this.id = option.id;
+			this.loadData();
+		},
+		methods: {
+			navto(uu) {
+				if(uu.indexOf('http') == -1) {
+					uni.navigateTo({
+						url:uu,
+						fail() {
+							uni.switchTab({
+								url:uu
+							})
+						}
+					})
+				}else {
+					window.location.href = uu
 				}
+				
+			},
+			loadData() {
+				details({}, this.id).then(({
+					data
+				}) => {
+					console.log(data);
+					data.content = data.content.replace(/<img/g, '<img class="rich-img"').replace(/<p>\s*<img/g,
+						'<p class="pHeight"><img').replace(/<div/g, '<div style="max-width: 50% !important;"');
+					data.content = this.getVideo(data.content);
+					this.item = data;
+				});
+			},
+			// 富文本视频解析
+			getVideo(data) {
+				let videoList = [];
+				let videoReg = /<video.*?(?:>|\/>)/gi; //匹配到字符串中的 video 标签
+				let srcReg = /src=[\'\"]?([^\'\"]*)[\'\"]?/i; //匹配到字符串中的 video 标签 的路径
+				let arr = data.match(videoReg) || []; // arr 为包含所有video标签的数组
+				let articleList = data.split('</video>'); // 把字符串  从视频标签分成数组
+				arr.forEach((item, index) => {
+					var src = item.match(srcReg);
+					videoList.push(src[1]); //所要显示的字符串中 所有的video 标签 的路径
+				});
+				let needArticleList = [];
+				articleList.forEach((item, index) => {
+					if (item != '' && item != undefined) {
+						//  常见的标签渲染
+						needArticleList.push({
+							type: 'rich-text',
+							value: item + '</video>'
+						});
+					}
+					let articleListLength = articleList.length; // 插入到原有video 标签位置
+					if (index < articleListLength && videoList[index] != undefined) {
+						needArticleList.push({
+							type: 'video',
+							value: videoList[index]
+						});
+					}
+				});
+				return needArticleList;
 			}
-		};
-		return shareObj;
-	},
-	methods: {
-		loadData() {
-			details({}, this.id).then(({ data }) => {
-				console.log(data);
-				data.content = data.content.replace(/<img/g, '<img class="rich-img"').replace(/<p>\s*<img/g, '<p class="pHeight"><img').replace(/<div/g, '<div style="max-width: 50% !important;"');
-				data.content = this.getVideo(data.content);
-				this.item = data;
-			});
-		},
-		// 富文本视频解析
-		getVideo(data) {
-			let videoList = [];
-			let videoReg = /<video.*?(?:>|\/>)/gi; //匹配到字符串中的 video 标签
-			let srcReg = /src=[\'\"]?([^\'\"]*)[\'\"]?/i; //匹配到字符串中的 video 标签 的路径
-			let arr = data.match(videoReg) || []; // arr 为包含所有video标签的数组
-			let articleList = data.split('</video>'); // 把字符串  从视频标签分成数组
-			arr.forEach((item, index) => {
-				var src = item.match(srcReg);
-				videoList.push(src[1]); //所要显示的字符串中 所有的video 标签 的路径
-			});
-			let needArticleList = [];
-			articleList.forEach((item, index) => {
-				if (item != '' && item != undefined) {
-					//  常见的标签渲染
-					needArticleList.push({
-						type: 'rich-text',
-						value: item + '</video>'
-					});
-				}
-				let articleListLength = articleList.length; // 插入到原有video 标签位置
-				if (index < articleListLength && videoList[index] != undefined) {
-					needArticleList.push({
-						type: 'video',
-						value: videoList[index]
-					});
-				}
-			});
-			return needArticleList;
-		}
-	}
-};
-</script>
-
+		}
+	};
+</script>
+
 <style lang="scss">
 	page {
 		background-color: #fff;
 		min-height: 100%;
 		height: auto;
-	}
-.center {
-	min-height: 100%;
-	height: auto;
-	background: #ffffff;
-	padding: 10rpx 24rpx 0;
-}
-.title {
-	font-size: 32rpx;
-	font-family: PingFang SC;
-	font-weight: bold;
-	color: #333333;
-}
-.time {
-	font-size: 24rpx;
-	font-family: PingFangSC;
-	font-weight: 500;
-	color: #999999;
-	margin-top: 40rpx;
-}
-.main {
-	// margin-top: 60rpx;
-}
-/deep/ .main {
-	.rich-img {
-		width: 100% !important;
-		height: auto;
 	}
-	* {
-		max-width: 100% !important;
-	}
-}
-</style>
+
+	.center {
+		min-height: 100%;
+		height: auto;
+		background: #ffffff;
+		padding: 10rpx 24rpx 0;
+	}
+
+	.title {
+		font-size: 32rpx;
+		font-family: PingFang SC;
+		font-weight: bold;
+		color: #333333;
+	}
+
+	.time {
+		font-size: 24rpx;
+		font-family: PingFangSC;
+		font-weight: 500;
+		color: #999999;
+		margin-top: 40rpx;
+	}
+
+	.main {
+		// margin-top: 60rpx;
+	}
+
+	/deep/ .main {
+		text-align: justify;
+		.rich-img {
+			width: 100% !important;
+			height: auto;
+		}
+
+		* {
+			max-width: 100% !important;
+		}
+
+		li {
+			list-style: none;
+			padding: 0;
+			margin: 0;
+		}
+
+		ul {
+			padding: 0;
+			margin: 0;
+		}
+	}
+	.uu {
+		padding-bottom: 40rpx;
+	}
+</style>

+ 3 - 4
pages/user/award.vue

@@ -168,11 +168,11 @@ export default {
 			let index = this.tabCurrentIndex;
 			let navItem = this.navList[index];
 			let state = navItem.state;
-			if (source === 'tabChange' && navItem.loaded === true) {
+			if (source === 'tabChange' && navItem.loaded == true) {
 				//tab切换只有第一次需要加载数据
 				return;
 			}
-			if (navItem.loadingType === 'loading') {
+			if (navItem.loadingType == 'loading' || navItem.loadingType == 'noMore') {
 				//防止重复加载
 				return;
 			}
@@ -192,14 +192,13 @@ export default {
 					obj.sr = data.general_expend;
 					obj.zc = data.general_income;
 					navItem.orderList = navItem.orderList.concat(data.list);
+					navItem.page++
 					//判断是否还有数据, 有改为more, 没有改为noMore
 					if (navItem.limit == data.list.length) {
 						navItem.loadingType = 'more';
-						return;
 					} else {
 						navItem.loadingType = 'noMore';
 					}
-					uni.hideLoading();
 					this.$set(navItem, 'loaded', true);
 				})
 				.catch(e => {

BIN
unpackage/dist/build/h5/h5.rar → unpackage/dist/build/h5/4-3-1.rar


+ 1 - 1
unpackage/dist/build/h5/index.html

@@ -1,2 +1,2 @@
 <!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><title>满园春</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
-            document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/index/static/index.63b34199.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/index/static/js/chunk-vendors.2784987b.js></script><script src=/index/static/js/index.d686118b.js></script></body></html>
+            document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel=stylesheet href=/index/static/index.63b34199.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/index/static/js/chunk-vendors.48a05ccf.js></script><script src=/index/static/js/index.943bd479.js></script></body></html>

BIN
unpackage/dist/build/h5/static/img/download.b5ebe9e3.png


BIN
unpackage/dist/build/h5/static/img/download.png


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/h5/static/js/chunk-vendors.2784987b.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/h5/static/js/chunk-vendors.48a05ccf.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/h5/static/js/index.943bd479.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/h5/static/js/index.d686118b.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-index-artDetail.35986126.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-index-artDetail.def1546c.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-index-downLoad.8a40a586.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-public-forget.3ee754e9.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-public-forget.a124a2ef.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-user-award.2cdcf81f.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-user-award.40cd60cc.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-user-user.22ee0081.js


File diff suppressed because it is too large
+ 0 - 0
unpackage/dist/build/h5/static/js/pages-user-user.7501235d.js


Some files were not shown because too many files changed in this diff