Browse Source

创业指引

空白格 3 years ago
parent
commit
483c1a14a0

+ 6 - 0
h5_web/common/apiurl.js

@@ -227,6 +227,12 @@ const apiurl = {
 		deleteCertificateUrl: '/certificate/',
 		// 查询学生是否报过名
 		queryIsAttendedClassUrl: '/learnpackage/queryIsAttendedClass'
+	},
+	// 创业
+	entrepreneurship: {
+		addEntrepreneurshipUrl: '/guidance',
+		getEntrepreneurshipListUrl: '/guidance',
+		getEntrepreneurshipDetailsUrl: '/guidance/getDetail/'
 	}
 }
 

+ 7 - 1
h5_web/common/http.api.js

@@ -197,6 +197,11 @@ const install = (Vue, vm) => {
 		deleteCertificateApi: (params = {}) => vm.$u.delete(apiurl.skillTraining.deleteCertificateUrl + params.id, params),
 		queryIsAttendedClassApi: (params = {}) => vm.$u.get(apiurl.skillTraining.queryIsAttendedClassUrl, params)
 	}
+	let entrepreneurship = {
+		addEntrepreneurshipApi: (params = {}) => vm.$u.post(apiurl.entrepreneurship.addEntrepreneurshipUrl, params),
+		getEntrepreneurshipListApi: (params = {}) => vm.$u.get(apiurl.entrepreneurship.getEntrepreneurshipListUrl, params),
+		getEntrepreneurshipDetailsApi: (params = {}) => vm.$u.get(apiurl.entrepreneurship.getEntrepreneurshipDetailsUrl + params.id)
+	}
 	// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
 	vm.$u.api = {
 		getPhoneLoginCode,
@@ -235,7 +240,8 @@ const install = (Vue, vm) => {
 		evaluation,
 		mine,
 		training,
-		skillTraining
+		skillTraining,
+		entrepreneurship
 	};
 }
 

+ 325 - 0
h5_web/components/jin-edit/jin-edit.vue

@@ -0,0 +1,325 @@
+<template>
+	<view class="container" :style="{
+		paddingBottom: showMoreTool ? '200rpx' : '0'
+	}">
+		<editor class="ql-container" :placeholder="placeholder" :show-img-size="true" :show-img-toolbar="true"
+			:show-img-resize="true" @ready="onEditorReady" id="editor" @statuschange="statuschange" @focus="editFocus"
+			@blur="editBlur" ref="editot"></editor>
+		<!-- 操作工具 -->
+		<view class="tool-view">
+			<view class="tool">
+				<jinIcon class="single" type="&#xe6f3;" font-size="44rpx" title="插入图片" @click="insertImage"></jinIcon>
+				<jinIcon class="single" type="&#xe6f9;" font-size="44rpx" title="修改文字样式" @click="showMore"
+					:color="showMoreTool ? activeColor : '#666666'"></jinIcon>
+				<jinIcon class="single" type="&#xe6eb;" font-size="44rpx" title="分割线" @click="insertDivider"></jinIcon>
+				<jinIcon class="single" type="&#xe6e8;" font-size="44rpx" title="撤销" @click="undo"></jinIcon>
+				<jinIcon class="single" type="&#xe705;" font-size="44rpx" title="重做" @click="redo"></jinIcon>
+				<jinIcon class="single" type="&#xeb8a;" font-size="44rpx" title="设置" @click="release"></jinIcon>
+			</view>
+			<!-- 文字相关操作 -->
+			<view class="font-more" :style="{ height: showMoreTool ? '100rpx' : 0 }">
+				<jinIcon class="single" type="&#xe6e7;" font-size="44rpx" title="加粗" @click="setBold"
+					:color="showBold ? activeColor : '#666666'"></jinIcon>
+				<jinIcon class="single" type="&#xe6fe;" font-size="44rpx" title="斜体" @click="setItalic"
+					:color="showItalic ? activeColor : '#666666'"></jinIcon>
+				<jinIcon class="single" type="&#xe6f8;" font-size="44rpx" title="分割线" @click="setIns"
+					:color="showIns ? activeColor : '#666666'"></jinIcon>
+				<jinIcon class="single" type="&#xe6e3;" font-size="44rpx" title="标题" @click="setHeader"
+					:color="showHeader ? activeColor : '#666666'"></jinIcon>
+				<jinIcon class="single" type="&#xe6f1;" font-size="44rpx" title="居中" @click="setCenter"
+					:color="showCenter ? activeColor : '#666666'"></jinIcon>
+				<jinIcon class="single" type="&#xe6ed;" font-size="44rpx" title="居右" @click="setRight"
+					:color="showRight ? activeColor : '#666666'"></jinIcon>
+			</view>
+			<!-- <view class="setting-layer-mask" v-if="showSettingLayer" @click="showSetting"></view> -->
+			<view class="setting-layer" v-if="showSettingLayer">
+				<view class="single" @click="release(true)">
+					<jinIcon class="icon" type="&#xe639;"></jinIcon>
+					<view>公开发布</view>
+				</view>
+				<view class="single" @click="release(false)">
+					<jinIcon class="icon" type="&#xe655;"></jinIcon>
+					<view>私密保存</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import jinIcon from './jin-icons.vue';
+	export default {
+		props: {
+			// 点击图片时显示图片大小控件
+			showImgSize: {
+				type: Boolean,
+				default: false
+			},
+			// 点击图片时显示工具栏控件
+			showImgToolbar: {
+				type: Boolean,
+				default: false
+			},
+			// 点击图片时显示修改尺寸控件
+			showImgResize: {
+				type: Boolean,
+				default: false
+			},
+			// 占位符
+			placeholder: {
+				type: String,
+				default: '开始输入...'
+			},
+			// 图片上传的地址
+			uploadFileUrl: {
+				type: String,
+				default: '#'
+			},
+			// 上传文件时的name
+			fileKeyName: {
+				type: String,
+				default: 'file'
+			},
+			// 上传图片时,http请求的header
+			header: {
+				type: Object
+			},
+			// 初始化html
+			html: {
+				type: String
+			}
+		},
+		computed: {
+
+		},
+		data() {
+			return {
+				showMoreTool: false,
+				showBold: false,
+				showItalic: false,
+				showIns: false,
+				showHeader: false,
+				showCenter: false,
+				showRight: false,
+				showSettingLayer: false,
+				activeColor: '#F56C6C'
+			};
+		},
+		components: {
+			jinIcon
+		},
+		created() {
+
+		},
+		methods: {
+			onEditorReady(e) {
+				uni.createSelectorQuery()
+					.in(this)
+					.select('.ql-container')
+					.fields({
+						size: true,
+						context: true
+					}, res => {
+						this.editorCtx = res.context;
+						this.editorCtx.setContents({
+							html: this.html
+						})
+					})
+					.exec();
+			},
+			undo() {
+				this.editorCtx.undo();
+			},
+			// 插入图片
+			insertImage() {
+				uni.chooseImage({
+					count: 9, //默认9
+					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+					sourceType: ['album', 'camera'], //从相册选择
+					success: async (res) => {
+						var tempFilePaths = res.tempFilePaths;
+						uni.showLoading({
+							title: '正在上传中...'
+						})
+						for (let temp of tempFilePaths) {
+							// 图片上传服务器
+							await uni.uploadFile({
+								url: this.uploadFileUrl,
+								filePath: temp,
+								name: this.fileKeyName,
+								header: this.header,
+								success: res => {
+									const data = JSON.parse(res.data).data
+									// 上传完成后处理
+									this.editorCtx.insertImage({
+										src: data.url, // 此处需要将图片地址切换成服务器返回的真实图片地址
+										alt: '图片',
+										success: function(e) {}
+									});
+									uni.hideLoading()
+								},
+
+							});
+						}
+					}
+				});
+			},
+			insertDivider() {
+				this.editorCtx.insertDivider();
+			},
+			redo() {
+				this.editorCtx.redo();
+			},
+			showMore() {
+				this.showMoreTool = !this.showMoreTool;
+				this.editorCtx.setContents()
+			},
+			setBold() {
+				this.showBold = !this.showBold;
+				this.editorCtx.format('bold');
+			},
+			setItalic() {
+				this.showItalic = !this.showItalic;
+				this.editorCtx.format('italic');
+			},
+			checkStatus(name, detail, obj) {
+				if (detail.hasOwnProperty(name)) {
+					this[obj] = true;
+				} else {
+					this[obj] = false;
+				}
+			},
+			statuschange(e) {
+				var detail = e.detail;
+				this.checkStatus('bold', detail, 'showBold');
+				this.checkStatus('italic', detail, 'showItalic');
+				this.checkStatus('ins', detail, 'showIns');
+				this.checkStatus('header', detail, 'showHeader');
+				if (detail.hasOwnProperty('align')) {
+					if (detail.align == 'center') {
+						this.showCenter = true;
+						this.showRight = false;
+					} else if (detail.align == 'right') {
+						this.showCenter = false;
+						this.showRight = true;
+					} else {
+						this.showCenter = false;
+						this.showRight = false;
+					}
+				} else {
+					this.showCenter = false;
+					this.showRight = false;
+				}
+			},
+			setIns() {
+				this.showIns = !this.showIns;
+				this.editorCtx.format('ins');
+			},
+			setHeader() {
+				this.showHeader = !this.showHeader;
+				this.editorCtx.format('header', this.showHeader ? 'H2' : false);
+			},
+			setCenter() {
+				this.showCenter = !this.showCenter;
+				this.editorCtx.format('align', this.showCenter ? 'center' : false);
+			},
+			setRight() {
+				this.showRight = !this.showRight;
+				this.editorCtx.format('align', this.showRight ? 'right' : false);
+			},
+			showSetting() {
+				this.showSettingLayer = !this.showSettingLayer;
+			},
+			async editFocus() {
+
+			},
+			editBlur() {
+
+			},
+			release(isPublic) {
+				this.showSettingLayer = false;
+				this.editorCtx.getContents({
+					success: res => {
+						Object.assign(res, {
+							isPublic: isPublic
+						})
+						this.$emit('editOk', res);
+					}
+				})
+			},
+		}
+	};
+</script>
+
+<style scoped>
+	.container {
+		padding: 30rpx 0;
+		box-sizing: border-box;
+		/* padding-bottom: 120rpx; */
+	}
+
+	.ql-container {
+		line-height: 160%;
+		font-size: 34rpx;
+		width: calc(100% - 60rpx);
+		height: auto;
+		margin: 0 auto;
+	}
+
+	.tool-view {
+		width: calc(100vw - 60rpx);
+	}
+
+	.tool {
+		height: 100rpx;
+		display: flex;
+		align-items: center;
+		justify-content: space-around;
+		width: 100%;
+		background: #eee;
+	}
+
+	.font-more {
+		position: absolute;
+		left: 0;
+		bottom: 100rpx;
+		display: flex;
+		align-items: center;
+		justify-content: space-around;
+		width: 100%;
+		background: rgb(235, 235, 235);
+		overflow: hidden;
+		/* transition: all 0.15s; */
+	}
+
+	.setting-layer {
+		position: absolute;
+		bottom: -20rpx;
+		background: #fff;
+		width: 250rpx;
+		right: 20rpx;
+		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
+		border-radius: 8rpx;
+	}
+
+	.setting-layer .single {
+		height: 80rpx;
+		font-size: 32rpx;
+		padding: 0 30rpx;
+		display: flex;
+		align-items: center;
+		line-height: 80rpx;
+		flex-direction: row;
+		color: #666;
+	}
+
+	.setting-layer .single .icon {
+		margin-right: 20rpx;
+	}
+
+	.setting-layer-mask {
+		width: 100vw;
+		height: 100vh;
+		background: transparent;
+	}
+</style>

+ 48 - 0
h5_web/components/jin-edit/jin-icons.vue

@@ -0,0 +1,48 @@
+<template>
+	<view class="content">
+		<view class="icon" :style="{color: color, fontSize: fontSize}" v-html="type" @click="toclick"></view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			type: {
+				type: String,
+				default: '&#xe644;'
+			},
+			color: {
+				type: String,
+				default: '#666666'
+			},
+			fontSize: {
+				type: String,
+				default: '34rpx'
+			}
+		},
+		methods: {
+			toclick() {
+				this.$emit('click');
+			}
+		}
+	}
+</script>
+
+<style scoped>
+	.content{
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+	@font-face {
+		font-family: 'jin';
+		/** 阿里巴巴矢量图标库的字体库地址,可以替换自己的字体库地址 **/
+		src: url('https://at.alicdn.com/t/font_1491431_6m7ltjo8wi.ttf') format('truetype');
+	}
+
+	.icon {
+		font-family: jin !important;
+		font-size: 34rpx;
+	}
+
+</style>

+ 65 - 0
h5_web/components/jin-edit/readme.md

@@ -0,0 +1,65 @@
+## jin-edit 基于editor的富文本编辑器
+
+### 兼容性
+
+这是一个uni-app的通用组件,兼容微信小程序端、安卓端、ios端(未测试)、H5端。作者因没有ios设备无法对ios端进行测试,其他端测试无问题。
+
+微信小程序 | APP | H5
+:--: | :--: | :--:
+√ | √ | √
+
+我的HbuilderX版本2.6.7,不同的版本可能会造成不兼容的问题。
+
+### 使用方式
+
+1. 将此组件进入你的项目中的 /components/ 目录中
+2. 在某个页面中使用该插件
+- 在 `script` 中引用组件
+```javascript
+import jinEdit from '../../components/jin-edit/jin-edit.vue';
+export default {
+	data() {
+		return {
+			
+		}
+	},
+	components: {
+		jinEdit
+	},
+	methods: {
+		// 点击发布
+		editOk(res) {
+			console.log(res);
+		}
+	}
+}
+```
+- 在 `template` 中使用组件
+```html
+<jinEdit placeholder="请输入内容" @editOk="editOk" uploadFileUrl="/#"></jinEdit> 
+```
+
+### Demo
+
+[uni-jin(一个uni-app组件集合)](https://github.com/wangjinxin613/uni-jin)
+
+### 参数
+
+属性 | 类型 | 默认值 | 说明
+:--: | :--: | :--: | :--:
+showImgSize | Boolean | false | 点击图片时显示图片大小控件
+showImgToolbar | Boolean | false | 点击图片时显示工具栏控件
+showImgResize | Boolean | false | 点击图片时显示修改尺寸控件
+placeholder | String | '' | 编辑器占位符
+uploadFileUrl | String | '#' | 图片上传的服务器地址
+fileKeyName | String | 'file' | 图片上传时的name
+header | Object | - | 图片上传http请求的header
+html | String | - | 初始化的html 
+
+### 方法
+
+方法名 | 参数 | 说明
+:--: | :--: | :--:
+editOk | e={html,text,delta,isPublic} | 点击发布按钮触发	
+
+以上

+ 34 - 0
h5_web/pages.json

@@ -549,6 +549,40 @@
 				"navigationBarTextStyle": "white"
 			}
 
+		}, {
+			"path": "pages/entrepreneurshipGuidelines/entrepreneurshipGuidelines",
+			"style": {
+				"navigationBarTitleText": "创业指引",
+				"enablePullDownRefresh": false,
+				"navigationBarBackgroundColor": "#3D5D4C",
+				"navigationBarTextStyle": "white"
+			}
+
+		}, {
+			"path": "pages/entrepreneurshipGuidelines/addPlan/addPlan",
+			"style": {
+				"navigationBarTitleText": "提交创业计划",
+				"enablePullDownRefresh": false,
+				"navigationBarBackgroundColor": "#3D5D4C",
+				"navigationBarTextStyle": "white"
+			}
+
+		}, {
+			"path": "pages/entrepreneurshipGuidelines/planDetails/planDetails",
+			"style": {
+				"navigationBarTitleText": "创业计划详情",
+				"enablePullDownRefresh": false,
+				"navigationBarBackgroundColor": "#3D5D4C",
+				"navigationBarTextStyle": "white"
+			}
+
+		}, {
+			"path": "pages/entrepreneurshipGuidelines/previewPdf/previewPdf",
+			"style": {
+				"navigationBarTitleText": "预览PDF",
+				"enablePullDownRefresh": false
+			}
+
 		}
 	],
 	"globalStyle": {

+ 281 - 0
h5_web/pages/entrepreneurshipGuidelines/addPlan/addPlan.vue

@@ -0,0 +1,281 @@
+<template>
+	<view class="plan">
+		<u-form :model="form" ref="uForm">
+			<u-form-item label="名称:" prop="title" label-position="top">
+				<u-input v-model="form.title" placeholder="请输入名称" :border="true" />
+			</u-form-item>
+			<u-form-item label="描述:" prop="description" label-position="top">
+				<view class="box">
+					<jinEdit placeholder="请输入描述" @editOk="editOk" :uploadFileUrl="config.uploadUrl"></jinEdit>
+				</view>
+			</u-form-item>
+			<u-form-item label="创业计划书:" prop="planBookUrl" label-position="top">
+				<view class="upload">
+					<view class="upload-box" @click="uploadFile">
+						<text>+上传文件,格式:pdf</text>
+					</view>
+					<view class="file-list">
+						<view class="file-list-item" v-for="(item, index) in fileList" :key="index">
+							<view>{{ item.fileName }}</view>
+							<view class="close">
+								<u-icon name="close" size="20" color="#9B9B9B" @click="delFile(index)"></u-icon>
+							</view>
+						</view>
+					</view>
+				</view>
+			</u-form-item>
+		</u-form>
+		<view class="plan-bottom">
+			<view class="plan-bottom-box" @click="submitPlan">提交</view>
+		</view>
+		<u-toast ref="uToast" />
+	</view>
+</template>
+
+<script>
+	import jinEdit from '../../../components/jin-edit/jin-edit.vue';
+	export default {
+		components: {
+			jinEdit
+		},
+		data() {
+			return {
+				form: {
+					title: '',
+					description: '',
+					planBookUrl: '',
+					planBookName: ''
+				},
+				rules: {
+					title: [
+						{
+							required: true,
+							message: '请输入名称',
+							trigger: ['change', 'blur'],
+						}
+					],
+					description: [
+						{
+							required: true,
+							message: '请输入描述',
+							trigger: ['change', 'blur'],
+						}
+					],
+					planBookUrl: [
+						{
+							required: true,
+							message: '请上传企业计划书',
+							trigger: ['change', 'blur'],
+						}
+					]
+				},
+				fileList: []
+			}
+		},
+		mounted() {
+			// this.$nextTick(function() {
+			// 	const input = document.createElement('input')
+			// 	input.style.width = "100%";
+			// 	input.type = 'file' //添加file类型
+			// 	// input.multiple = 'multiple' // 可以选择多个
+			// 	input.accept = ".pdf" // 限制只能上传PDF文件,可以不限制,能上传任何类型
+			// 	input.style.height = "100%";
+			// 	input.style.position = "absolute";
+			// 	input.style.top = "0";
+			// 	input.style.right = "0";
+			// 	input.style.opacity = "0";
+			// 	input.style.overflow = "hidden"; //防止注意input 元素溢出
+			// 	input.id = 'file';
+			// 	var _this = this;
+			// 	setTimeout(() => {
+			// 		this.$refs.input.$el.appendChild(
+			// 			input
+			// 		); // 这里可能会报$el找不到错误,所以加了延时器,报错的原因是this.$refs.input没有找到为null,所以需要等页面结构加载完后再将其添加进去
+			// 		input.onchange = (event) => { // 点击上传选择文件
+			// 			var file = event.target.files;
+			// 			if (file.length > 0) {
+			// 				file.forEach(item => { // 因为后台限制,只能一个一个文件的上传,所以当选择多个文件后,需要遍历一个一个调用上传接口
+			// 					_this.uploadAPI(item); // 上传图片
+			// 				})
+			// 			}
+			// 		}
+			// 	}, 1000)
+			// })
+		},
+		onReady() {
+			this.$refs.uForm.setRules(this.rules);
+		},
+		methods: {
+			/**
+			 * 富文本返回值
+			 * @param {Object} res
+			 */
+			editOk(res) {
+				this.form.description = res?.html
+			},
+			/**
+			 * 上传文件
+			 */
+			uploadFile() {
+				uni.chooseFile({
+					count: 1,
+					extension: ['.pdf'],
+					success: async (res) => {
+						var tempFilePaths = res.tempFilePaths;
+						uni.showLoading({
+							title: '正在上传中...'
+						})
+						for (let temp of tempFilePaths) {
+							// 图片上传服务器
+							await uni.uploadFile({
+								url: this.config.uploadUrl,
+								filePath: temp,
+								success: res => {
+									const data = JSON.parse(res.data).data
+									if (data.suffix === 'pdf') {
+										this.fileList = [{ ...data }]
+										this.form.planBookUrl = data.url
+										this.form.planBookName = data.fileName
+									} else {
+										uni.showToast({
+											title: '只能上传pdf文件',
+											duration: 2000
+										})
+									}
+									uni.hideLoading()
+								},
+								fail: err => {
+									uni.hideLoading()
+								}
+							});
+						}
+					}
+				});
+			},
+			uploadAPI(path) {
+				uni.showLoading({
+					title: '上传中'
+				})
+				var _this = this
+				var fData = new FormData();
+				fData.append("file", path);
+				var xhr = new XMLHttpRequest();
+				var surl = this.config.uploadUrl; // 文件上传地址
+				xhr.open("POST", surl, true);
+				xhr.onload = function(e) {
+					let response = JSON.parse(e.currentTarget.response)
+					let file = response.data.url; //获取服务端传过来的文件地址
+				};
+				xhr.onreadystatechange = () => {
+					if (xhr.readyState == 4 && xhr.status == 200) { //上传后台成功
+						uni.hideLoading()
+						const res = JSON.parse(xhr.responseText)
+						_this.fileList.push(res.data); // 上传成功后放进fileList数组用于展示
+					} else {
+						uni.hideLoading()
+					}
+				}
+
+				// 这里设置请求头,做的时候遇到一个问题,明明上传的是FormData,可是在请求中变成了request payload,后台需要的是FormData,解决方法,设置enctype为multipart/form-data,不要设置Content-Type,切记直接不设置Content-Type
+				xhr.setRequestHeader('enctype', "multipart/form-data");
+				xhr.send(fData)
+			},
+			/**
+			 * 删除文件
+			 * @param { Number } index
+			 */
+			delFile(index) {
+				this.fileList.splice(index, 1)
+			},
+			submitPlan() {
+				this.$refs.uForm.validate(valid => {
+					if (valid) {
+						this.$u.api.entrepreneurship.addEntrepreneurshipApi(this.form).then(res => {
+							if (res.code === 200) {
+								this.$refs.uToast.show({
+									title: '提交成功!',
+									type: 'success',
+									url: 'pages/entrepreneurshipGuidelines/entrepreneurshipGuidelines'
+								})
+							} else {
+								this.$refs.uToast.show({
+									title: res.msg,
+									type: 'error'
+								})
+							}
+						})
+					}
+				});
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.plan {
+		padding: 34rpx 30rpx;
+		font-family: PingFangSC-Regular, PingFang SC;
+		.box {
+			border: solid 1px #dcdfe6;
+		}
+		.upload {
+			width: 100%;
+			display: flex;
+			flex-direction: column;
+
+			&-box {
+				width: 100%;
+				height: 59rpx;
+				line-height: 59rpx;
+				text-align: center;
+				border: solid 1px #D1D1D1;
+				border-radius: 5rpx;
+				color: #9B9B9B;
+				font-size: 28rpx;
+				position: relative;
+			}
+
+			.file-list {
+				margin-top: 30rpx;
+
+				.file-list-item {
+					height: 59rpx;
+					line-height: 59rpx;
+					display: flex;
+					justify-content: center;
+					border: dashed 1px #0091FF;
+					color: #008FFF;
+					font-size: 28rpx;
+					position: relative;
+
+					.close {
+						position: absolute;
+						right: 30rpx;
+						top: -2rpx;
+					}
+				}
+			}
+		}
+
+		.plan-bottom {
+			position: fixed;
+			bottom: 0;
+			width: calc(100% - 60rpx);
+			height: 166rpx;
+			background-color: #fff;
+			display: flex;
+			justify-content: center;
+
+			&-box {
+				background-color: #709078;
+				width: 100%;
+				height: 80rpx;
+				line-height: 80rpx;
+				margin-top: 26rpx;
+				text-align: center;
+				font-size: 30rpx;
+				color: #fff;
+			}
+		}
+	}
+</style>

+ 67 - 0
h5_web/pages/entrepreneurshipGuidelines/entrepreneurshipGuidelines.scss

@@ -0,0 +1,67 @@
+/* 创业指引 */
+page {
+	min-height: calc(100vh - 88rpx);
+	background-color: #f2f2f2;
+}
+.entrepreneurship {
+	font-family: PingFangSC-Regular, PingFang SC;
+	&-list {
+		padding: 30rpx;
+		&-item {
+			background-color: #fff;
+			padding: 31rpx 32rpx;
+			margin-bottom: 20rpx;
+			&-title {
+				font-size: 32rpx;
+				color: #000;
+				margin-bottom: 14rpx;
+			}
+			&-content {
+				color: #545454;
+				font-size: 24rpx;
+				margin-bottom: 14rpx;
+				overflow : hidden;
+				text-overflow: ellipsis;
+				display: -webkit-box;
+				-webkit-line-clamp: 2;
+				-webkit-box-orient: vertical;
+			}
+			&-bottom {
+				display: flex;
+				justify-content: space-between;
+				.right {
+					color: #9F9F9F;
+					font-size: 22rpx;
+				}
+				.left {
+					font-size: 22rpx;
+				}
+				.waiting {
+					color: #EF6622;
+				}
+				.had {
+					color: #028DFE;
+				}
+			}
+		}
+	}
+}
+.bottom-btn {
+	position: fixed;
+	bottom: 0;
+	width: 100%;
+	height: 166rpx;
+	background-color: #fff;
+	display: flex;
+	justify-content: center;
+	&-box {
+		background-color: #709078;
+		width: calc(100% - 60rpx);
+		height: 80rpx;
+		line-height: 80rpx;
+		margin-top: 26rpx;
+		text-align: center;
+		font-size: 30rpx;
+		color: #fff;
+	}
+}

+ 79 - 0
h5_web/pages/entrepreneurshipGuidelines/entrepreneurshipGuidelines.vue

@@ -0,0 +1,79 @@
+<!-- 创业指引 -->
+<template>
+	<view class="entrepreneurship">
+		<z-paging ref="paging" v-model="list" @query="queryList">
+			<view class="entrepreneurship-list">
+				<view class="entrepreneurship-list-item" v-for="(item, index) in list" :key="index" @click="jumpPage('pages/entrepreneurshipGuidelines/planDetails/planDetails', { id: item.id })">
+					<view class="entrepreneurship-list-item-title">{{ item.title }}</view>
+					<view class="entrepreneurship-list-item-content">
+						<u-parse :html="item.description" @imgtap="imageTap"></u-parse>
+					</view>
+					<view class="entrepreneurship-list-item-bottom">
+						<view class="left" :class="item.replyStatus === 0 ? 'waiting' : 'had'">{{ item.replyStatus === 0 ? '待专家回复' : '专家已回复' }}</view>
+						<view class="right">{{ item.createTime | date('yyyy-mm-dd hh:MM:ss') }} 提交</view>
+					</view>
+				</view>
+			</view>
+		</z-paging>
+		<view class="bottom-btn">
+			<view class="bottom-btn-box" @click="jumpPage('pages/entrepreneurshipGuidelines/addPlan/addPlan')">提交创业计划</view>
+		</view>
+		<u-toast ref="uToast" />
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				list: []
+			}
+		},
+		onBackPress(e){
+			// 返回主页面tabBar
+			uni.switchTab({
+				url: "../index/index"
+			})
+		  // 此处一定要return为true,否则页面不会返回到指定路径
+		  return true;
+		},
+		methods: {
+			/**
+			 * 获取列表
+			 * @param { Number } pageNum
+			 */
+			getList(pageNum) {
+				this.$u.api.entrepreneurship.getEntrepreneurshipListApi({ pageNum: pageNum || 1 }).then(res => {
+					if (res.code === 200) {
+						this.$refs.paging.complete(res.rows)
+					} else {
+						this.$refs.uToast.show({
+							title: res.msg,
+							type: 'error'
+						})
+					}
+				})
+			},
+			/**
+			 * 下拉加载组件触发
+			 * @param { Number } pageNo
+			 * @param { Number } pageSize
+			 */
+			queryList(pageNo, pageSize) {
+				this.getList(pageNo)
+			},
+			jumpPage(url, params) {
+				this.$u.route({
+					url, params
+				})
+			},
+			imageTap(e) {
+				e.ignore()
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	@import './entrepreneurshipGuidelines.scss';
+</style>

+ 117 - 0
h5_web/pages/entrepreneurshipGuidelines/planDetails/planDetails.vue

@@ -0,0 +1,117 @@
+<template>
+	<view class="details">
+		<view class="details-content">
+			<view class="details-content-title">{{ planInfo.title }}</view>
+			<view class="details-content-createtime">{{ planInfo.createTime }}提交</view>
+			<view class="details-content-reply" :class="planInfo.replyStatus === 0 ? 'waiting' : 'reply'">
+				{{ planInfo.replyStatus === 0 ? '待专家回复' : '专家已回复' }}
+			</view>
+			<view class="details-content-description">
+				<view class="title">描述</view>
+				<view class="details-content-description-content">
+					<u-parse :html="planInfo.description"></u-parse>
+				</view>
+				<view class="details-content-description-pdf" @click="jumpPage('pages/entrepreneurshipGuidelines/previewPdf/previewPdf', { fileUrl: planInfo.planBookUrl })">
+					{{ planInfo.planBookName }}
+				</view>
+			</view>
+			<view class="details-content-description" v-if="planInfo.replyStatus === 1">
+				<view class="title">专家建议</view>
+				<view class="details-content-description-content">
+					<u-parse :html="planInfo.replyContent"></u-parse>
+				</view>
+			</view>
+		</view>
+		<u-toast ref="uToast" />
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				planId: '',
+				planInfo: {}
+			}
+		},
+		onLoad(page) {
+			if (page.id) {
+				this.planId = page.id
+			}
+		},
+		onShow() {
+			this.getDetails(this.planId)
+		},
+		methods: {
+			getDetails(id) {
+				this.$u.api.entrepreneurship.getEntrepreneurshipDetailsApi({ id }).then(res => {
+					if (res.code === 200) {
+						this.planInfo = res.data
+					} else {
+						this.$refs.uToast.show({
+							title: res.msg,
+							type: 'error'
+						})
+					}
+				})
+			},
+			jumpPage(url, params) {
+				this.$u.route({
+					url, params
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+.details {
+	padding: 26rpx 30rpx;
+	font-family: PingFangSC-Regular, PingFang SC;
+	&-content {
+		&-title {
+			color: #050505;
+			font-size: 36rpx;
+			margin-bottom: 18rpx;
+			font-weight: 600;
+		}
+		&-createtime {
+			color: #9F9F9F;
+			font-size: 24rpx;
+			margin-bottom: 18rpx;
+		}
+		.reply {
+			color: #028DFE;
+			font-size: 22rpx;
+		}
+		.waiting {
+			color: #EF6622;
+			font-size: 22rpx;
+		}
+		&-description {
+			margin-top: 32rpx;
+			margin-bottom: 72rpx;
+			.title {
+				color: #3F3F3F;
+				font-weight: 600;
+				font-size: 30rpx;
+				margin-bottom: 30rpx;
+			}
+			&-content {
+				color: #4D4D4D;
+			}
+			&-pdf {
+				width: 100%;
+				height: 59rpx;
+				line-height: 59rpx;
+				display: flex;
+				justify-content: center;
+				border: dashed 1px #0091FF;
+				color: #008FFF;
+				font-size: 28rpx;
+				margin-top: 20rpx;
+			}
+		}
+	}
+}
+</style>

+ 25 - 0
h5_web/pages/entrepreneurshipGuidelines/previewPdf/previewPdf.vue

@@ -0,0 +1,25 @@
+<template>
+	<view>
+		<web-view :src="pdfUrl"></web-view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				pdfUrl: ''
+			}
+		},
+		onLoad(page) {
+			if (page.fileUrl) {
+				this.pdfUrl = 'https://www.gjtool.cn/pdfh5/pdf.html?file=' + page.fileUrl
+			}
+		},
+		methods: {}
+	}
+</script>
+
+<style>
+
+</style>

+ 1 - 1
h5_web/pages/index/index.vue

@@ -67,7 +67,7 @@
 					</image>
 					<view class="service-item-text">学历提升</view>
 				</view>
-				<view class="service-item" @click="openPage('pages/inbuild/inbuild','创业指引')">
+				<view class="service-item" @click="openPage('pages/entrepreneurshipGuidelines/entrepreneurshipGuidelines')">
 					<image class="service-item-img" src="../../static/img/index-service-08.png" mode="aspectFill">
 					</image>
 					<view class="service-item-text">创业指导</view>

+ 1 - 21
h5_web/pages/phoneLogin/phoneLogin.vue

@@ -113,25 +113,9 @@
 									duration: 2000
 								});
 							}
-
-						}).catch(err => {
-							this.toastMsg = err.code + ":" + err.msg;
-							this.showToast();
-						});
+						})
 				}
 			},
-			// 收不到验证码选择时的选择
-			// noCaptcha() {
-			// 	uni.showActionSheet({
-			// 		itemList: ['重新获取验证码', '接听语音验证码'],
-			// 		success: function(res) {
-
-			// 		},
-			// 		fail: function(res) {
-
-			// 		}
-			// 	});
-			// },
 			// change事件侦听
 			change(value) {
 				// console.log('change', value);
@@ -164,10 +148,6 @@
 				this.$u.api.getVeteEducCheck().then(res => {
 					if (res.data != 9) {
 						this.jumpIndex()
-						// this.$u.route({
-						// 	type: 'switchTab',
-						// 	url: 'pages/index/index'
-						// });
 					} else {
 						uni.navigateTo({
 							url: '/pages/applyEducationCode/applyEducationCode'

+ 1 - 1
h5_web/uview-ui/components/u-parse/u-parse.vue

@@ -296,7 +296,7 @@
 						img.i = j++;
 						_ts.imgList.push(img.getAttribute('original-src') || img.src || img.getAttribute('data-src'));
 						img.onclick = function(e) {
-							e.stopPropagation();
+							// e.stopPropagation();
 							var preview = true;
 							this.ignore = () => preview = false;
 							_ts.$emit('imgtap', this);