xhj 2 роки тому
батько
коміт
bd21f26390

+ 350 - 0
components/jin-edit/jin-edit.vue

@@ -0,0 +1,350 @@
+<template>
+	<view class="container" :style="{
+		paddingBottom: showMoreTool ? '220rpx' : '120rpx'
+	}"> 
+		<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" 
+			@input="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="confirmContent"></jinIcon><!-- @click="showSetting" -->
+			</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>
+const req = require('../../utils/request.js');
+import jinIcon from './jin-icons.vue';
+export default {
+	data() {
+		return {
+			showMoreTool: false,
+			showBold: false,
+			showItalic: false,
+			showIns: false,
+			showHeader: false,
+			showCenter: false,
+			showRight: false,
+			showSettingLayer: false,
+			activeColor: '#F56C6C',
+		};
+	},
+	components: {
+		jinIcon
+	},
+	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,
+		}
+		
+	},
+	watch: {
+	},
+	computed:{
+		
+	},
+	mounted() {
+	},
+	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() {
+			let that = this;
+			uni.chooseImage({
+				count: 8,
+				sizeType: ['original', 'compressed'],
+				sourceType: ['album', 'camera'],
+				success: function({
+					tempFilePaths
+				}) {
+					var promise = Promise.all(tempFilePaths.map(tempFilePath => {
+						return new Promise(function(resolve, reject) {
+							uni.showLoading({
+								title: "正在上传中"
+							})
+							req.uploadFile('/api/nocheck/upload', tempFilePath, res => {
+								that.editorCtx.insertImage({
+									src: res.src,  // 此处需要将图片地址切换成服务器返回的真实图片地址
+									alt: '图片',
+									success: function(e) {}
+								});
+								uni.hideLoading()
+							});
+						});
+					}));
+					promise.then(function(results) {
+						console.log(results);
+					}).catch(function(err) {
+						console.log(err);
+					});
+				}
+			});
+		},
+		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(res) {
+			this.$emit('editBlur', res);
+		},
+		release(isPublic) {
+			this.showSettingLayer = false;
+			this.editorCtx.getContents({
+				success: res => {
+					Object.assign(res, {
+						isPublic: isPublic
+					})
+					this.$emit('editOk', res);
+				} 
+			})
+		},
+		confirmContent(){
+			this.editorCtx.getContents({
+				success: res => {
+					this.$emit('editOk', res);
+				} 
+			})
+		}
+	}
+};
+</script>
+
+<style scoped>
+.ql-editor.ql-blank:before {
+	/* 此处设置 placeholder 样式 */
+	color: rgba(204, 204, 204, 1);
+	font-style: normal;
+}
+
+.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;
+	font-style: normal !important;
+} 
+#editor{
+	font-style: normal !important;
+}
+.tool-view{
+	width: 100vw;
+	position: fixed;
+	bottom: 0;
+	left: 0;
+	
+}
+.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: 100rpx;
+	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{
+	position: fixed;
+	left: 0;
+	top: 0;
+	width: 100vw;
+	height: 100vh;
+	background: transparent; 
+}
+
+</style>

+ 47 - 0
components/jin-edit/jin-icons.vue

@@ -0,0 +1,47 @@
+<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'); */
+	src:url('https://at.alicdn.com/t/font_1491431_6m7ltjo8wi.ttf') format('truetype');
+	/* src: url('./font_1491431_6m7ltjo8wi.ttf') format('truetype'); */
+}
+
+.icon {
+	font-family: jin !important;
+	font-size: 34rpx;
+}
+</style>

+ 65 - 0
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
components/msg-number/index.css

@@ -0,0 +1,34 @@
+.lt-msg{
+	width: 92rpx;
+	height: 92rpx;
+	line-height: 92rpx;
+	background: #FFFFFF;
+	box-shadow: 0rpx 5rpx 15rpx 1rpx rgba(0,0,0,0.15);
+	opacity: 1;
+	position: fixed;
+	bottom:200rpx;
+	right: 30rpx;
+	border-radius: 100%;
+	z-index: 5;
+}
+.lt-msg image{
+	width: 48rpx;
+	height: 48rpx;
+	margin: auto;
+}
+.lt-msg-num{
+	width: 38rpx;
+	height: 38rpx;
+	background: #FF5700;
+	opacity: 1;
+	border: 2rpx solid #FFFFFF;
+	position: absolute;
+	top: -8rpx;
+	right: -8rpx;
+	border-radius: 100%;
+	text-align: center;
+	line-height: 38rpx;
+	font-size: 20rpx;
+	font-weight: 500;
+	color: #FFFFFF;
+}

+ 45 - 0
components/msg-number/index.vue

@@ -0,0 +1,45 @@
+<template>
+	<view>
+		<view class="lt-msg ddflex" @click="jumpConversation()">
+			<view class="ddflex" style="position: relative;width: 100%;height: 100%;">
+				<image src="../../static/pages/images/lt.png"></image>
+				<view class="lt-msg-num" v-if="getMsgNumber()>0">{{getMsgNumber()}}</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	const app = getApp();
+	const req = require("../../utils/request.js");
+
+	export default {
+		data() {
+			return {
+				picUrlss: req.public.picUrls,
+			};
+		},
+
+		components: {},
+		props: {
+		},
+		watch: {},
+
+		mounted() {
+			
+		},
+
+		methods: {
+			jumpConversation() {
+				req.jumpConversation();
+			},
+			getMsgNumber(){
+				return getApp().globalData.unReadMessageNum;
+			},
+		}
+	};
+</script>
+
+<style>
+	@import "./index.css";
+</style>

+ 4 - 0
match/activityEdit/activityEdit.css

@@ -76,6 +76,9 @@ page{
 	position: relative;
 	margin-bottom: 20rpx;
 }
+.upload-photo-image:nth-child(5n){
+	margin-right: 0rpx;
+}
 .upload-photo-image image{
 	width: 120rpx;
 	height: 120rpx;
@@ -146,6 +149,7 @@ page{
 	border: 2rpx solid #DEDEDE;
 	margin: 0 20rpx;
 	text-align: center;
+	padding: 0 10rpx;
 }
 .form-date-select{
 	background: #F8F8F8;

+ 304 - 32
match/activityEdit/activityEdit.vue

@@ -4,19 +4,19 @@
 			<view class="form">
 				<view class="form-title">基本信息</view>
 				<view class="form-item-title">封面图</view>
-				<view class="upload-pic ddflex" v-if="true">
+				<view class="upload-pic ddflex" v-if="!pic" @click="uploadImage(1)">
 					<image src="../static/images/pic.png"></image>
 					<view style="margin-top: 30rpx;">上传封面图</view>
 				</view>
-				<image v-else class="upload-image" src="../../static/images/lj_img.png"></image>
+				<image v-else class="upload-image" :src="pic" @click="uploadImage(1)"></image>
 				<view class="form-limit">* 图片尺寸限制:680*350</view>
 				<view class="form-item-title">活动详情轮播图</view>
 				<view class="ddflex" style="margin-top: 30rpx;">
-					<view class="upload-photo-image" v-for="item in 3">
-						<image src="/static/images/lj_img.png"></image>
-						<image class="upload-photo-close" src="/static/pages/images/close3.png"></image>
+					<view class="upload-photo-image" v-for="item ,index in fileList" @click="uploadImage(2,index+1)">
+						<image :src="item" mode="aspectFill"></image>
+						<image class="upload-photo-close" src="/static/pages/images/close3.png" @click.stop="deleteImage(2,index+1)"></image>
 					</view>
-					<view class="upload-photo ddflex">
+					<view class="upload-photo ddflex" @click="uploadImage(2)" v-if="fileList.length<9">
 						<image src="../static/images/photo.png"></image>
 					</view>
 				</view>
@@ -26,20 +26,21 @@
 			<view class="form">
 				<view class="form-item-title">活动标题</view>
 				<view class="form-input-box">
-					<input placeholder-class="form-input-placeholder" placeholder="请输入活动标题"/>
+					<input v-model="title" placeholder-class="form-input-placeholder" placeholder="请输入活动标题"/>
 				</view>
 				<view class="form-item-title">活动说明</view>
 				<view class="form-input-box">
-					<input placeholder-class="form-input-placeholder" placeholder="请填写活动简介说明"/>
+					<input v-model="brief" placeholder-class="form-input-placeholder" placeholder="请填写活动简介说明"/>
 				</view>
 				<view class="form-item-title">
 					活动详情
-					<view class="more ddflex">
-						编辑
+					<view class="more ddflex" @click="jumpUrl('/match/editorContent/editorContent')">
+						<text v-if="!text">编辑</text>
+						<text v-else style="color: var(--main);">已完善</text>
 						<image  src="../../static/pages/images/more.png"></image>
 					</view>
 				</view>
-				<view class="next-btn">下一步</view>
+				<view class="next-btn" @click="next">下一步</view>
 			</view>
 		</view>
 		
@@ -50,34 +51,34 @@
 				<view class="form-item-title">最大报名人数</view>
 				<view class="form-number-select ddflex">
 					<view>-</view>
-					<input type="number" placeholder="最大报名人数" placeholder-class="form-input-placeholder"/>
+					<input v-model="personLimit" type="number" placeholder="最大报名人数" placeholder-class="form-input-placeholder"/>
 					<view>+</view>
 				</view>
 				<view class="form-item-title">报名时间</view>
 				<view  class="ddflex" style="margin-top: 20rpx;">
-					<picker mode="date" class="flex">
-						<view class="form-date-select">
-							开始日期
+					<picker v-model="enlistStartTime" mode="date" class="flex" @change="enlistStartTimeChange">
+						<view class="form-date-select" :style="enlistStartTime?'color:#333':''">
+							{{enlistStartTime?enlistStartTime:'开始日期'}}
 						</view>
 					</picker>
 					<text style="margin: 0 20rpx;">至</text>
-					<picker mode="date" class="flex">
-						<view class="form-date-select">
-							结束日期
+					<picker v-model="enlistEndTime" mode="date" class="flex" @change="enlistEndTimeChange">
+						<view class="form-date-select" :style="enlistEndTime?'color:#333':''">
+							{{enlistEndTime?enlistEndTime:'结束日期'}}
 						</view>
 					</picker>
 				</view>
 				<view class="form-item-title">活动时间</view>
 				<view  class="ddflex" style="margin-top: 20rpx;">
-					<picker mode="date" class="flex">
-						<view class="form-date-select">
-							开始日期
+					<picker v-model="startTime" mode="date" class="flex" @change="startTimeChange">
+						<view class="form-date-select" :style="startTime?'color:#333':''">
+							{{startTime?startTime:"开始日期"}}
 						</view>
 					</picker>
 					<text style="margin: 0 20rpx;">至</text>
-					<picker mode="date" class="flex">
-						<view class="form-date-select">
-							结束日期
+					<picker v-model="endTime" mode="date" class="flex" @change="endTimeChange">
+						<view class="form-date-select" :style="endTime?'color:#333':''">
+							{{endTime?endTime:"结束日期"}}
 						</view>
 					</picker>
 				</view>
@@ -87,25 +88,31 @@
 				<view class="form-title">活动地址</view>
 				<view class="form-item-title">地址名称</view>
 				<view class="form-input-box">
-					<input placeholder-class="form-input-placeholder" placeholder="请输入活动地址简称"/>
+					<input v-model="house" placeholder-class="form-input-placeholder" placeholder="请输入活动地址简称"/>
 				</view>
 				<view class="form-item-title">选择城市</view>
 				<view class="form-input-box">
-					<input placeholder-class="form-input-placeholder" placeholder="请选择活动所在城市"/>
+					<picker class="form-input-placeholder" mode="region" @change="bindRegionChange" :value="region">
+						<view class="picker" :style="region.length>0?'color: #333;':''">
+							{{region.length > 0 ? region[0]+region[1]+region[2] : '请选择所在城市'}}
+						</view>
+					</picker>
+					<!-- <image src="/card/static/images/area.png" class="loca" @click="chooseLocation()"></image> -->
 				</view>
 				<view class="form-item-title">
 					详细地址
 				</view>
 				<view class="form-input-box">
-					<input placeholder-class="form-input-placeholder" placeholder="请输入详细地址"/>
+					<input v-model="address" placeholder-class="form-input-placeholder" placeholder="请输入详细地址"/>
 				</view>
-				<view class="next-btn">提交</view>
+				<view class="next-btn" @click="submit()">提交</view>
 			</view>
 		</view>
 	</view>
 </template>
 
 <script>
+	import util from "../../utils/util.js";
 	const app = getApp();
 	const req = require("../../utils/request.js");
 
@@ -114,18 +121,283 @@
 		props: {},
 		data() {
 			return {
-				stepOne:false,
-				stepTwo:true
+				stepOne:true,
+				stepTwo:false,
+				
+				pic:'',//封面图
+				fileList:[],//banner
+				title:'',
+				brief:'',
+				text:'',
+				personLimit:-1,
+				enlistStartTime:'',
+				enlistEndTime:'',
+				startTime:'',
+				endTime:'',
+				house:'',
+				region:[],
+				address:'',
+				regionCode:[],
+				id:''
+				
 			}
 		},
 		onLoad(options) {
-
+			this.id = options.id
+			if(this.id){
+				this.getActivityInfo()
+			}
 		},
 		onShow() {
 			
 		},
 		methods: {
-			
+			jumpUrl(url){
+				uni.navigateTo({
+					url:url
+				})
+			},
+			getActivityInfo(){
+				req.getRequest('/api/match/detail',{id:this.id},res=>{
+					this.pic = res.pic
+					this.fileList = res.imageList.map(item=>{return item.url})
+					this.title = res.title
+					this.brief = res.brief
+					this.text = res.text
+					this.personLimit = res.personLimit
+					this.enlistStartTime = this.formatTime(res.enlistStartTime)
+					this.enlistEndTime = this.formatTime(res.enlistEndTime)
+					this.startTime = this.formatTime(res.startTime)
+					this.endTime = this.formatTime(res.endTime)
+					this.house = res.house
+					this.regionCode = [res.province,res.city,res.country]
+					this.region = res.areaAdd.split(',')
+					this.address = res.address
+				})
+			},
+			next(){
+				if(!this.pic){
+					return req.msg('请上传封面图')
+				}
+				if(this.fileList.length==0){
+					return req.msg('请上传活动轮播图')
+				}
+				if(!this.title){
+					return req.msg('请填写活动名称')
+				}
+				if(!this.brief){
+					return req.msg('请填写活动简介')
+				}
+				if(!this.text){
+					return req.msg('请填写活动详情')
+				}
+				this.stepOne = false
+				this.stepTwo = true
+			},
+			uploadImage(type,index){
+				let that = this;
+				let count = 1
+				if(type==1){
+					count = 1
+				}else if(type==2){
+					if(index){
+						count = 1
+					}else{
+						count = 9-that.fileList.length
+					}
+				}
+				uni.chooseImage({
+					count: count,
+					sizeType: ['original', 'compressed'],
+					sourceType: ['album', 'camera'],
+					success: function({ tempFilePaths }) {
+						var promise = Promise.all(
+							tempFilePaths.map(tempFilePath => {
+								return new Promise(function(resolve, reject) {
+									req.uploadFile('/api/nocheck/upload', tempFilePath, res => {
+										// type 1 封面图
+										if(type==1){
+											that.pic = res.src
+										}else if(type==2){
+											if(index){
+												that.fileList[index] = res.src
+												that.fileList = JSON.parse(JSON.stringify(that.fileList))
+											}else{
+												that.fileList = that.fileList.concat(res.src)
+											}
+										}
+									});
+								});
+							})
+						);
+						promise
+							.then(function(results) {
+								console.log(results);
+							})
+							.catch(function(err) {
+								console.log(err);
+							});
+					}
+				});
+			},
+			deleteImage(type,index){
+				if(type==2)
+					this.fileList.splice(index,1)
+			},
+			enlistStartTimeChange(e){
+				if(this.enlistEndTime){
+					if(this.enlistEndTime<e.detail.value)
+					return req.msg('报名开始时间不能大于结束时间')
+				}
+				this.enlistStartTime = e.detail.value
+			},
+			enlistEndTimeChange(e){
+				if(this.enlistStartTime){
+					if(this.enlistStartTime>e.detail.value)
+					return req.msg('报名结束时间不能小于开始时间')
+				}
+				this.enlistEndTime = e.detail.value
+			},
+			startTimeChange(e){
+				if(this.endTime){
+					if(this.endTime<e.detail.value)
+					return req.msg('活动开始时间不能大于结束时间')
+				}
+				this.startTime = e.detail.value
+			},
+			endTimeChange(e){
+				if(this.startTime){
+					if(this.startTime>e.detail.value)
+					return req.msg('活动结束时间不能小于开始时间')
+				}
+				this.endTime = e.detail.value
+			},
+			chooseLocation() {
+			  	var tha = this;
+			  	uni.chooseLocation({
+			  		success: function(res) {
+			  			if (res.name) {
+			  				tha.form.detailInfo = res.name;
+			  				tha.reverseGeocoder(res);
+			  				console.log('地址数据》》》:', res);
+			  			}
+			  		}
+			  	});
+			  },
+			  reverseGeocoder(location) {
+			  	QQMapWX.initMap();
+			  	QQMapWX.reverseGeocoder(location, data => {
+			  		this.region = [data.ad_info.province, data.ad_info.city, data.ad_info.district]
+			  		console.log('解析后的地址地址数据:', data);
+			  	});
+			  },
+			bindRegionChange(event) {
+				console.log(event)
+				this.region = event.detail.value
+				this.regionCode = event.detail.code
+			},
+			submit(){
+				if(!this.pic){
+					return req.msg('请上传封面图')
+				}
+				if(this.fileList.length==0){
+					return req.msg('请上传活动轮播图')
+				}
+				if(!this.title){
+					return req.msg('请填写活动名称')
+				}
+				if(!this.brief){
+					return req.msg('请填写活动简介')
+				}
+				if(!this.text){
+					return req.msg('请填写活动详情')
+				}
+				if(!this.enlistStartTime){
+					return req.msg('请选择报名开始时间')
+				}
+				if(!this.enlistEndTime){
+					return req.msg('请选择报名结束时间')
+				}
+				if(!this.startTime){
+					return req.msg('请选择活动开始时间')
+				}
+				if(!this.endTime){
+					return req.msg('请选择活动结束时间')
+				}
+				if(!this.house){
+					return req.msg('请填写活动地址')
+				}
+				if(this.regionCode.length==0){
+					return req.msg('请选择活动所在城市')
+				}
+				if(!this.address){
+					return req.msg('请填写详细地址')
+				}
+				
+				let dataP = {
+					pic:this.pic,
+					fileList:JSON.stringify(this.fileList.map(item=>{return {url:item}})),
+					title:this.title,
+					brief:this.brief,
+					text:this.text,
+					personLimit:this.personLimit,
+					enlistStartTime:this.enlistStartTime,
+					enlistEndTime:this.enlistEndTime,
+					startTime:this.startTime,
+					endTime:this.endTime,
+					house:this.house,
+					province:this.regionCode[0],
+					city:this.regionCode[1],
+					country:this.regionCode[2],
+					areaAdd:this.region.join(','),
+					address:this.address
+				}
+				
+				let url = '/api/match/save'
+				if(this.id) {
+					dataP.id = this.id
+					url = '/api/match/update'
+					uni.showModal({
+						title:'提示',
+						content:'修改活动将重新审核,确定修改?',
+						success: (res) => {
+							if(res.confirm){
+								req.postRequest(url,dataP,res=>{
+									req.msg('创建成功')
+									let pages = getCurrentPages();
+									var prevPage = pages[pages.length - 2];
+									if (prevPage) {
+										prevPage.$vm.isLoad = true
+										prevPage.$vm.form.page = 1
+										prevPage.$vm.getPageList()
+									}
+									setTimeout(()=>{
+										uni.navigateBack()
+									},1000)
+								})
+							}
+						}
+					})
+				}else{
+					req.postRequest(url,dataP,res=>{
+						req.msg('创建成功')
+						let pages = getCurrentPages();
+						var prevPage = pages[pages.length - 2];
+						if (prevPage) {
+							prevPage.$vm.isLoad = true
+							prevPage.$vm.form.page = 1
+							prevPage.$vm.getPageList()
+						}
+						setTimeout(()=>{
+							uni.navigateBack()
+						},1000)
+					})
+				}
+			},
+			formatTime(date){
+				date = new Date(date.replace(/-/g, '/'))
+				return util.formatTime(date).t3
+			},
 		},
 		mounted() {
 			

+ 24 - 0
match/activityManage/activityManage.css

@@ -138,4 +138,28 @@ page{
 	font-family: PingFang SC-Regular, PingFang SC;
 	font-weight: 400;
 	color: #FFFFFF;
+}
+
+.act-create{
+	width: 110rpx;
+	height: 110rpx;
+	background: var(--main);
+	box-shadow: 0rpx 4rpx 24rpx 1rpx rgba(0,155,98,0.2);
+	opacity: 1;
+	font-size: 24rpx;
+	font-family: PingFang SC-Regular, PingFang SC;
+	font-weight: 400;
+	color: #FFFFFF;
+	text-align: center;
+	border-radius: 100%;
+	padding: 20rpx;
+	box-sizing: border-box;
+	position: fixed;
+	bottom: 200rpx;
+	right: 30rpx;
+}
+.act-create image{
+	width: 39rpx;
+	height: 39rpx;
+	margin: auto;
 }

+ 74 - 29
match/activityManage/activityManage.vue

@@ -11,73 +11,118 @@
 		</view>
 		<view style="height: 150rpx;"></view>
 		<view class="title">
-			我的活动<text>共3个</text>
+			我的活动<text>共{{total}}个</text>
 		</view>
-		<view class="padd30">
-			<view class="act-bar ddflex" v-for="item in 3">
+		<view class="padd30" v-if="pageList.length>0">
+			<view class="act-bar ddflex" v-for="item,index in pageList">
 				<view class="act-pic">
-					<image src="/static/images/lj_img.png"></image>
-					<view class="act-pic-tag">审核中</view>
+					<image :src="item.pic" mode="aspectFill"></image>
+					<view class="act-pic-tag" v-if="item.state==0">审核中</view>
+					<view class="act-pic-tag" v-if="item.state==6">审核失败</view>
 				</view>
 				<view class="flex">
-					<view class="act-title tovers">保险大家谈 2023·山东青岛</view>
-					<view class="act-time">活动时间:2023.10.07</view>
+					<view class="act-title tovers">{{item.title}}</view>
+					<view class="act-time">活动时间:{{formatTime(item.endTime)}}</view>
 					<view class="act-bottom ddflex">
 						<view class="act-bottom-look ddflex">
-							<image src="../../static/pages/images/fw_hui.png"></image>
-							0
+							<image src="../static/images/person.png"></image>
+							{{item.person}}
 						</view>
-						<view class="act-edit" @click="jumpUrl('/match/activityEdit/activityEdit')">修改</view>
+						<view class="act-edit" @click="jumpUrl('/match/activityEdit/activityEdit?id='+item.id)">修改</view>
 					</view>
 				</view>
 			</view>
 		</view>
+		<view class="nodata nosp bgfff" v-else>
+			<image :src="picUrlss+'empty_sp.png'"></image>
+			<text>暂无活动</text>
+		</view>
+		<view class="act-create" @click="jumpUrl('/match/activityEdit/activityEdit')">
+			<image src="../static/images/add.png"></image>
+			<view>发布</view>
+		</view>
 	</view>
 </template>
 
 <script>
 	const app = getApp();
 	const req = require("../../utils/request.js");
-
+	import util from "../../utils/util.js";
 	export default {
 		components: {},
 		props: {},
 		data() {
 			return {
-				systems: {},
-				isTop:0,
+				picUrlss:req.public.picUrls,
+				pageList: [],
+				isLoad: true,
+				form: {
+					page: 1,
+					limit: 10
+				},
+				searchVal:'',
+				total:0
 			}
 		},
 		onLoad(options) {
-
+			this.getPageList()
 		},
 		onShow() {
 			
 		},
+		onReachBottom: function() {
+			this.form.page++;
+			this.getPageList(false);
+		},
 		methods: {
 			jumpUrl(url){
 				uni.navigateTo({
 					url:url
 				})
-			}
+			},
+			getPageList(isShow) {
+				if (!this.isLoad) return false;
+				this.isLoad = false;
+				let form = this.form;
+				if(this.searchVal){
+					form.search = this.searchVal
+				}else{
+					form.search = ''
+				}
+				uni.showLoading();
+				req.getRequest(
+					'/api/match/page',
+					form,
+					res => {
+						this.total = res.total
+						res  = res?res.list:[]
+						this.isShow = true;
+						if (res && res.length == 10) {
+							this.isLoad = true;
+						}
+						if (this.form.page > 1) {
+							res = this.pageList.concat(res);
+						}
+						this.pageList = res;
+						uni.hideLoading();
+					},
+					isShow
+				);
+			},
+			searchFn(){
+				this.isLoad = true
+				this.form.page=1
+				this.getPageList()
+			},
+			formatTime(date){
+				date = new Date(date.replace(/-/g, '/'))
+				return util.formatTime(date).t3
+			},
 		},
 		mounted() {
-			const systemInfo = uni.getSystemInfoSync();
-			// px转换到rpx的比例
-			let pxToRpxScale = 750 / systemInfo.windowWidth;
-			let systems = {
-				ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
-				navigationHeight: 44 * pxToRpxScale // 导航栏的高度
-			};
-			systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
-			this.systems = systems;
+			
 		},
 		onPageScroll: function(e) {
-			if (e.scrollTop > this.systems.barHeight) {
-				this.isTop = 1;
-			} else {
-				this.isTop = 0;
-			}
 		}
 	}
 </script>

+ 1 - 0
match/editorContent/editorContent.css

@@ -0,0 +1 @@
+/* editorContent.css */

+ 65 - 0
match/editorContent/editorContent.vue

@@ -0,0 +1,65 @@
+<template>
+	<view><jinEdit placeholder="请填写" @editBlur="editBlur" @editOk="editOk" :html="content" uploadFileUrl="/#"></jinEdit></view>
+</template>
+
+<script>
+const req = require('../../utils/request.js');
+import jinEdit from '../../components/jin-edit/jin-edit.vue';
+export default {
+	components: {
+		jinEdit
+	},
+	data() {
+		return {
+			content: ''
+		};
+	},
+	onLoad(options) {
+		let pages = getCurrentPages(); //获取所有页面栈实例列表
+		let prevPage = pages[pages.length - 2]; //上一页页面实例
+		this.content = prevPage.$vm.text;
+	},
+
+	onShow() {},
+
+	onUnload: function() {
+		// 页面销毁时执行保存
+		this.saveContent(this.content, false);
+	},
+
+	methods: {
+		editBlur(res) {
+			this.content = res.detail.html;
+			console.log('编辑器的数据>>>>>', this.content);
+		},
+
+		saveContent(content, isBack) {
+			let pages = getCurrentPages();
+			let prevPage = pages[pages.length - 2];
+			prevPage.$vm.text = content;
+			if (isBack) {
+				uni.navigateBack({
+					delta: 1
+				});
+			}
+		},
+
+		// 点击发布
+		editOk(res) {
+			this.saveContent(res.html, true);
+		}
+	}
+};
+</script>
+
+<style>
+	page{background: #fff;}
+</style>
+<style>
+@import './editorContent.css';
+.ql-editor.ql-blank:before {
+	/* 此处设置 placeholder 样式 */
+	color: #999;
+	font-style: normal;
+}
+</style>

BIN
match/static/images/add.png


BIN
match/static/images/person.png


+ 3 - 3
mine/userinfo/userinfo.vue

@@ -91,12 +91,12 @@
 					<editor placeholder="请输入个人简介" v-model="brief" id="editor" @ready="onEditorReadyB" @input="bindBrief" class="textarea brief"></editor>
 				</view>
 			</view>
-			<view class="li li-brief">
+			<!-- <view class="li li-brief">
 				<text>个人爱好</text>
 				<view class="item">
 					<editor placeholder="请输入个人爱好" v-model="hobbies" id="editor" @ready="onEditorReadyH" @input="bindHobbies" class="textarea hobbies"></editor>
 				</view>
-			</view>
+			</view> -->
 		</view>
 		<view style="height: 200rpx;"></view>
 		<button class="submit" @tap="confirm">确定</button>
@@ -147,7 +147,7 @@
 					req.loadIng('加载中');
 					isShowLoading = true;
 				}
-				req.getRequest('/api/user/info', {}, data => {
+				req.getRequest('/api/user/myInfo', {}, data => {
 					// console.log(data);
 					if (!data.district) {} else {
 						this.cityCode = data.district

+ 6 - 0
pages.json

@@ -1176,6 +1176,12 @@
 					"style": {
 						"navigationBarTitleText": "填写报名信息"
 					}
+				},
+				{
+					"path": "editorContent/editorContent",
+					"style": {
+						"navigationBarTitleText": "活动详情"
+					}
 				}
 			]
 		},

+ 9 - 5
pages/found/found.vue

@@ -9,9 +9,9 @@
 				</view>
 			</view>
 			<view class="image-nav ddflex">
-				<image src="/static/images/xbrm.png"></image>
-				<image src="/static/images/tbal.png"></image>
-				<image src="/static/images/lpal.png"></image>
+				<image src="/static/images/xbrm.png" @click="jumpUrl('/topic/contentList/contentList?code='+xbrmCode+'&title=小白入门')"></image>
+				<image src="/static/images/tbal.png" @click="jumpUrl('/topic/contentList/contentList?code='+tbalCode+'&title=投保案例')"></image>
+				<image src="/static/images/lpal.png" @click="jumpUrl('/topic/contentList/contentList?code='+lpalCode+'&title=理赔案例')"></image>
 			</view>
 			<view class="map-ac">
 				<scroll-view scroll-x="true" class="map-acs ddflex" style="height: 70rpx;">
@@ -43,7 +43,7 @@
 					</view>
 				</view>
 			</view>
-			<view class="nodata" v-if="!videoList||videoList.length==0">
+			<view class="nodata" v-if="!fxContentList||fxContentList.length==0">
 				<image :src="picUrlss+'empty_zb.png'"></image>
 				<text>暂无资讯</text>
 			</view>
@@ -80,7 +80,11 @@
 				
 				fxList:[],
 				fxContentList:[],
-				fxIndex:0
+				fxIndex:0,
+				
+				xbrmCode:req.public.xbrmCode,
+				tbalCode:req.public.tbalCode,
+				lpalCode:req.public.lpalCode
 			};
 		},
 

+ 38 - 0
pages/index/index.css

@@ -865,4 +865,42 @@ page{background: #fff;}
 }
 .pop-scroll::-webkit-scrollbar {
 	display: none;
+}
+
+
+.chat-fixed{
+	position: fixed;
+	bottom: 350rpx;
+	right: 30rpx;
+	z-index: 1;
+}
+.chat-box{
+	width: 88rpx;
+	height: 88rpx;
+	background-color: #fff;
+	border-radius: 100%;
+	position: relative;
+}
+.chat-box image{
+	width: 86rpx;
+	height: 86rpx;
+	margin: auto;
+	border-radius: 100%;
+}
+.chat-lyl{
+	position: absolute;
+	bottom: -13rpx;
+	left: 50%;
+	transform: translateX(-50%);
+	width: 86rpx;
+	height: 32rpx;
+	line-height: 32rpx;
+	background: var(--main);
+	border-radius: 16rpx 16rpx 16rpx 16rpx;
+	opacity: 1;
+	text-align: center;
+	color: #fff;
+	font-size: 20rpx;
+	font-family: PingFang SC-Regular, PingFang SC;
+	font-weight: 400;
 }

+ 23 - 44
pages/index/index.vue

@@ -146,7 +146,13 @@
 		
 		<!-- 真实理赔故事 -->
 		<view class="index-box" v-if="lpalList.length>0">
-			<view class="index-box-title">真实理赔故事</view>
+			<view class="index-box-title ddflex">
+				<text class="fflex">真实理赔故事</text>
+				<view class="fx-header-more ddflex" @click="jumpUrl('/topic/contentList/contentList?code='+lpalCode+'&title=理赔案例')">
+					更多
+					<image src="/static/pages/images/more.png"></image>
+				</view>
+			</view>
 			<view class="map-ac">
 				<scroll-view scroll-x="true" class="map-acs ddflex" style="height: 430rpx;">
 					<view class="lpgs-item" v-for="items,indexs in lpalList ">
@@ -207,7 +213,6 @@
 			</view>
 		</view>
 		
-		<switchStore v-if="switchStoreShow && contact.length > 0 && merchant.id" :first="first" :merchant="merchant" :storeShow="storeShow" @onFather="click"></switchStore>
 		<!-- <component v-for="(item,index) in contact" ></component> -->
 		<!-- <ad></ad> -->
 		<block v-if="contactShow">
@@ -257,6 +262,14 @@
 				复制微信号
 			</view>
 		</view>
+		<msgNumber></msgNumber>
+		
+		<view class="chat-fixed">
+			<view class="chat-box ddflex">
+				<image :src="recommendCard.avatar?recommendCard.avatar:'../../static/pages/images/userimg.png'"></image>
+				<view class="chat-lyl">聊一聊</view>
+			</view>
+		</view>
 	</view>
 </template>
 
@@ -272,27 +285,10 @@ const route = require('../../utils/route');
 const QQMapWX = require("../../utils/qqmap.js");
 import foot from '../../components/nav-bar/index';
 import footerCopyright from '../../components/footer-copyright/footer-copyright';
-import popAd from '../../template/popAd/popAd';
-import group from '../../template/activityGroup/activityGroup';
 import banner from '../../template/banner/banner';
-import bargain from '../../template/bargain/bargain';
-import customers from '../../template/customers/customers';
-import homecolumn from '../../template/homecolumn/homecolumn';
-import joingroup from '../../template/joingroup/joingroup';
-import pCategoryList from '../../template/pCategoryList/pCategoryList';
-import recommend from '../../template/recommend/recommend';
-import seckill from '../../template/seckill/seckill';
-import selected from '../../template/selected/selected';
-import arrivals from '../../template/arrivals/arrivals';
-import hot from '../../template/hot/hot';
-import specialTopic from '../../template/specialTopic/specialTopic';
-import storeOptions from '../../template/store_options/store_options';
-import redEnvelopes from '../../template/red_envelopes/index';
-import supplier from '../../template/supplier/supplier';
 import district from '../../template/king_kong_district/king_kong_district';
-import switchStore from '../../template/switchStore/switchStore';
-import suppliers from '../../template/suppliers/suppliers';
-import single from '../../template/single/single';
+import msgNumber from '../../components/msg-number/index.vue';
+
 export default {
 	data() {
 		return {
@@ -317,7 +313,6 @@ export default {
 			//广告
 			homeTemplate: [],
 			//首页栏目配置
-			pCategoryList: [],
 			storeShow: true,
 			templateType: {
 				module_ad: 'ad',
@@ -377,7 +372,9 @@ export default {
 			
 			recommendCard:{},//销售
 			
-			isShowCodePop:false
+			isShowCodePop:false,
+			
+			lpalCode:req.public.lpalCode
 		};
 	},
 
@@ -385,26 +382,8 @@ export default {
 		foot,
 		footerCopyright,
 		banner,
-		group,
-		bargain,
-		popAd,
-		customers,
-		homecolumn,
-		joingroup,
-		pCategoryList,
-		recommend,
-		seckill,
-		selected,
-		arrivals,
-		hot,
-		specialTopic,
-		storeOptions,
-		redEnvelopes,
-		supplier,
 		district,
-		switchStore,
-		suppliers,
-		single
+		msgNumber
 	},
 	props: {},
 	onLoad: async function(options) {
@@ -532,13 +511,13 @@ export default {
 		},
 		// 获取投保案例
 		async getTbal(){
-			this.tbalList = await this.getContentList('toubaoanli')
+			this.tbalList = await this.getContentList(req.public.tbalCode)
 			this.tbalList[this.tbalIndex].contentList = await this.getContentPageList(this.tbalList[this.tbalIndex].code)
 			this.$forceUpdate()
 		},
 		// 获取理赔案例
 		async getLpal(){
-			this.lpalList = await this.getContentList('lipeianli')
+			this.lpalList = await this.getContentList(req.public.lpalCode)
 			this.lpalList.map(async item=>{
 				item.contentList = await this.getContentPageList(item.code)
 				this.$forceUpdate()

+ 7 - 17
pages/user/user.vue

@@ -183,18 +183,15 @@
 				<image src="../../static/pages/images/more.png" class="rico"></image>
 			</navigator>
 		</view>
-		<footer-copyright></footer-copyright>
+		<!-- <footer-copyright></footer-copyright> -->
+		<view style="height: 80rpx;"></view>
 		<!-- <view class="placeholder-view" :style="'height:' + (bottomBlankHeignt + 115) + 'rpx'"></view> -->
 		<foot channel="user"></foot>
 		<update-userinfo :update-info="isUpdateInfo" :update-mobile="isUpdateMobile" v-if="isShowUpdate"
 			@closeUpdate="closeUpdate" @updateInfo="updateInfo" @updateMobile="updateMobile"></update-userinfo>
 
-		<view class="lt ddflex" @click="jumpConversation()">
-			<view class="ddflex" style="position: relative;width: 100%;height: 100%;">
-				<image src="../../static/pages/images/lt.png"></image>
-				<view class="lt-num" v-if="getMsgNumber()>0">{{getMsgNumber()}}</view>
-			</view>
-		</view>
+
+		<msgNumber></msgNumber>
 		
 		<view class="ceng2" v-if="isShowCodePop" @click="isShowCodePop = false"  @touchmove.stop.prevent="moveHandle"></view>
 		<view class="code-pop" v-if="isShowCodePop">
@@ -224,6 +221,7 @@
 	import foot from '../../components/nav-bar/index';
 	import footerCopyright from '../../components/footer-copyright/footer-copyright';
 	import bindJobnum from '../../components/bind-jobnum/index.vue';
+	import msgNumber from '../../components/msg-number/index.vue';
 
 	export default {
 		data() {
@@ -272,7 +270,8 @@
 		components: {
 			foot,
 			footerCopyright,
-			bindJobnum
+			bindJobnum,
+			msgNumber
 		},
 		props: {},
 
@@ -322,11 +321,6 @@
 			}
 		},
 		methods: {
-			
-			getMsgNumber(){
-				
-				return getApp().globalData.unReadMessageNum;
-			},
 
 			jumpUrl(url) {
 				if (req.isLogins(true)) {
@@ -431,10 +425,6 @@
 				this.isShowBind = false;
 			},
 
-			jumpConversation() {
-				req.jumpConversation();
-			},
-
 			// 判断强制绑定手机号
 			// isbindmobile() {
 			//   if (req.getStorage('configRes')) {

+ 110 - 1
topic/contentList/contentList.css

@@ -1,5 +1,44 @@
 /* contentList.css */
 page{background: #fff;}
+.top-fixed{
+	position: fixed;
+	top: 0;
+	right: 0;
+	left: 0;
+	background-color: #fff;
+	z-index: 101;
+}
+.search-box{
+	padding: 30rpx;
+	background-color: #fff;
+}
+
+.search-text{
+	color: #999999;
+}
+
+
+.search-input{
+	height: 76rpx;
+	line-height: 76rpx;;
+	background: #F5F5F5;
+	border-radius: 60rpx;
+	padding: 0 26rpx;
+	font-size: 24rpx;
+}
+.search-input input{
+	font-size: 24rpx;
+}
+.search-input image{
+	width: 34rpx;
+	height: 34rpx;
+	margin-right: 26rpx;
+}
+.search-all{
+	color: #2a82fd;
+	font-size: 30rpx;
+	margin-left: 46rpx;
+}
 .ban{height: 275rpx;position: relative;margin: 40rpx 32rpx 15rpx;}
 .swiper{width: 100%;height: 275rpx;border-radius: 10rpx;}
 .swiper image{width: 100%;height: 100%;border-radius: 10rpx;}
@@ -15,4 +54,74 @@ page{background: #fff;}
 .author{font-size: 28rpx;color: #999;margin-right: 24rpx;}
 .author image{width: 32rpx;height: 32rpx;border-radius: 2rpx;margin-right: 10rpx;}
 .rec-time{font-size: 28rpx;color: #999;}
-.rec-img{width: 218rpx;height: 152rpx;margin-left: 55rpx;}
+.rec-img{width: 218rpx;height: 152rpx;margin-left: 55rpx;}
+
+
+/* 行业资讯 */
+.rec-association {
+	padding: 0rpx 30rpx 0;
+	opacity: 1;
+	border-bottom: 1px solid #E8E8E8;
+	position: fixed;
+	width: 100%;
+	box-sizing: border-box;
+	height: 70rpx;
+	z-index: 5;
+	background: #fff;
+}
+.rec-association-nav{
+	position: relative;
+}
+.rec-association-nav-m{
+	position: absolute;
+	right: 0;
+	top: 0;
+	bottom:0;
+	width: 55rpx;
+	background: linear-gradient(90deg, rgba(255,255,255,0) 0%, #FFFFFF 100%);
+	/* background: #000; */
+	opacity: 1;
+}
+.rec-association-scroll {
+	white-space: nowrap;
+	overflow: hidden;
+	height: 70rpx;
+}
+
+.rec-association-scroll ::-webkit-scrollbar {
+	width: 0;
+	height: 0;
+	color: transparent;
+	display: none;
+}
+.rec-association-scroll-item{
+	/* max-width: 128rpx; */
+	overflow: hidden;
+	font-size: 32rpx;
+	display: inline-block;
+	margin-right:56rpx;
+	color: #666;
+	height: 100%;
+}
+.rec-association-scroll-item-active{
+	color: var(--main);
+	font-size: 32rpx;
+	font-weight: 500;
+	position: relative;
+}
+.rec-association-scroll-item-active::after{
+	content: '';
+	position: absolute;
+	bottom: 0px;
+	left: 50%;
+	transform: translateX(-50%);
+	width: 50%;
+	height: 6rpx;
+	background: var(--main);
+}
+.rec-association-nav-icon{
+	width: 38rpx;
+	height: 32rpx;
+	margin-left: 40rpx;
+	margin-top: 4rpx;
+}

+ 66 - 46
topic/contentList/contentList.vue

@@ -1,18 +1,30 @@
 <template>
 	<view>
-		<!-- <view class="ban">
-			<swiper class="swiper" @change="swiperChange" autoplay="true" interval="5000" duration="300">
-				<block v-for="(item, index) in bannerList" :key="index">
-					<swiper-item @click="clickBanner(item)"><image lazy-load="true" :src="item.pic" mode="aspectFill"></image></swiper-item>
-				</block>
-			</swiper>
-			<view class="dots ddflex">
-				<block v-for="(item, index) in bannerList" :key="index"><view :class="['dot', index == swiperCurrent ? 'active' : '']"></view></block>
+		<view class="top-fixed">
+			<view class="search-box ddflex">
+				<view class="search-input ddflex fflex">
+					<image src="/static/images/ssico.png"></image>
+					<input @confirm="searchFn" confirm-type="search" @input="searchFn" v-model="searchVal" class="fflex"
+						placeholder="请输入关键词" />
+				</view>
 			</view>
-		</view> -->
+			<view class="rec-association" v-if="cateList.length>0" style="">
+				<view class="dflex">
+					<view class="rec-association-nav fflex">
+						<scroll-view scroll-x="true" class="rec-association-scroll ddflex">
+							<view :class="'rec-association-scroll-item tover '+(cIndex == index?'rec-association-scroll-item-active':'')" @click="getCon(item,index)" v-for="item,index in cateList" :key="index">{{item.name}}</view>
+						</scroll-view>
+						<view class="rec-association-nav-m"></view>
+					</view>
+				</view>
+			</view>
+		</view>
+		
+		<view :style="cateList.length>0?'height: 180rpx;':'height: 100rpx;'"></view>
+		
 		<view class="box">
 			<!-- <view class="title dflex">{{title}}</view> -->
-			<view class="rec">
+			<view class="rec" v-if="contentList.length>0">
 				<navigator :url="'/topic/content/content?id=' + item.id" hover-class="none" class="li dflex" v-for="(item,index) in contentList" :key="index">
 					<view class="flex">
 						<view class="rec-tit tovers">{{item.title}}</view>
@@ -24,6 +36,10 @@
 					<image :src="item.pic" mode="aspectFill" class="rec-img"></image>
 				</navigator>
 			</view>
+			<view class="nodata" v-if="!contentList||contentList.length==0">
+				<image :src="picUrlss+'empty_zb.png'"></image>
+				<text>暂无资讯</text>
+			</view>
 		</view>
 	</view>
 </template>
@@ -36,6 +52,7 @@ const app = getApp();
 export default {
 	data() {
 		return {
+			picUrlss: req.public.picUrls,
 			title: '',
 			swiperCurrent: 0,
 			bannerList: [],
@@ -46,18 +63,23 @@ export default {
 			contentList: [],
 			isLoad: true,
 			code:null,
+			cid:null,
+			cateList:[],
+			cIndex:0,
+			searchVal:''
 		};
 	},
-	onLoad(options) {
+	async onLoad(options) {
 		this.title = options.title;
 		this.code = options.code;
 		uni.setNavigationBarTitle({
 			title: options.title
 		})
+		if(this.code)
+			await this.getCate()
+		this.getContentList();
 	},
 	onShow() {
-		this.getBannerList();
-		this.getContentList();
 	},
 	onReachBottom(){
 		this.form.page++;
@@ -65,16 +87,26 @@ export default {
 	},
 
 	methods: {
-		swiperChange(e) {
-			this.swiperCurrent = e.detail.current;
+		async getCon(item,index){
+			this.cIndex = index;
+			this.cid = item.id
+			this.form.page = 1
+			this.isLoad = true;
+			this.getContentList();
 		},
-		getBannerList() {
-			let that = this;
-			req.getRequest('/api/banner', {
-				groupId: '1196269897935630415'
-			}, data => {
-				that.bannerList = data;
-			});
+		// 获取分类
+		getCate(){
+			return new Promise((r,j)=>{
+				req.getRequest('/api/content/category/list',{parentCode: this.code},res=>{
+					this.cateList = res;
+					// 如果有二级分类,清处code和noCode
+					if(this.cateList&&this.cateList.length>0){
+						this.cid = res[0].id
+						this.code = null
+					}
+					r()
+				})
+			})
 		},
 		//为您推荐
 		getContentList() {
@@ -82,8 +114,14 @@ export default {
 			this.isLoad = false;
 			let form = this.form;
 			form.code = this.code;
+			// 如果有二级分类用分类id查
+			if(this.cid){
+				form.cid = this.cid
+			}
+			if(this.searchVal) form.title = this.searchVal
+			else form.title = ''
 			req.getRequest('/api/content/list', form,res => {
-				res = res?res.list:null
+				res = res?res:[]
 				if (res && res.length == 10) {
 					this.isLoad = true;
 				}
@@ -93,29 +131,11 @@ export default {
 				this.contentList = res;
 			});
 		},
-		clickBanner(item) {
-			let url = '';
-			if (item.type * 1 == 2 && item.content != "") {
-				url = "product/detail/detail?id=" + item.content;
-			} else if (item.type * 1 == 5) {
-				url = "product/coupon/coupon";
-			} else if (item.type * 1 == 6) {
-				url = "pages/live/live";
-			} else if (item.type * 1 == 9 && item.content != "") {
-				url = "product/list/list?id=" + item.content;
-			} else if (item.type * 1 == 10) {
-				url = "plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=" + item.content;
-				// console.log(
-				// url); // url=`plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${dt.content}`
-			} else if (item.type * 1 == 19 && item.content != "") {//文章内容
-					url = "topic/content/content?id=" + item.content;//1为普通文章内容
-			} else {
-				url = "";
-			}
-		
-			if (item.type * 1 == 6) app.globalData.switchTab(url);
-			else app.globalData.openPage(url);
-		},
+		searchFn(){
+			this.form.page = 1
+			this.isLoad = true;
+			this.getContentList();
+		}
 	}
 };
 </script>

+ 4 - 1
utils/request.js

@@ -45,7 +45,10 @@ const publics = {
 	
 	
 	// 文章栏目code
-	'fxCode':'faxian'
+	'fxCode':'faxian',//发现
+	'xbrmCode':'xiaobaorumen',//小白入门
+	'tbalCode':'toubaoanli',//投保案例
+	'lpalCode':'lipeianli',//理赔案例
 
 }
 /*