Browse Source

Merge branch 'master' of http://47.92.161.104:10080/zkx/jp-zeroWorkerStation

# Conflicts:
#	pages/tab/mine/mine.vue
zhengkaixin 1 year ago
parent
commit
df7eaac2f5

+ 9 - 0
apis/pagejs/packages.js

@@ -3,6 +3,15 @@ import request from '@/apis/utils/request'
  
 
 // 零工驿站
//  /mobile/recruit/findRecruitSearch
// status = 1
+
+// 发布共享用工信息
+export function createShareWork(data) {
+	return request({
+		method: 'post',
+		data: data,
+		url: '/mobile/recruit/createShareWork'
+	})
+}
 
 export function findRecruitSearch(data) {
  	return requestWhite({

+ 129 - 94
pages/packages/mine/employmentService/postMessage.vue

@@ -1,14 +1,14 @@
 <template>
 	<view>
-		<u-navbar back-text="发布信息" back-icon-size="28" back-icon-color="#ffffff"
-			:background="{backgroundColor: '#2795FD',}" :back-text-style="{color: '#ffffff'}"></u-navbar>
+		<u-navbar back-text="发布信息" back-icon-size="28" back-icon-color="#ffffff" :background="{backgroundColor: '#2795FD',}"
+			:back-text-style="{color: '#ffffff'}"></u-navbar>
 		<!-- 发布标题 -->
 		<view class="post-title">
 			<view class="title">
 				发布标题
 			</view>
 			<view class="title-content">
-			   <input class="input" type="text" value="" placeholder="请填写标题内容"/>
+				<input v-model="form.title" class="input" type="text" value="" placeholder="请填写标题内容" />
 			</view>
 			<!-- 类型选择 -->
 			<view class="type">
@@ -16,67 +16,94 @@
 					<text>*</text>共享类型
 				</view>
 				<!-- 单选框 -->
-				<u-radio-group v-model="value" @change="radioGroupChange">
-							<u-radio 
-								@change="radioChange" 
-								v-for="(item, index) in list" :key="index" 
-								:name="item.name"
-								:disabled="item.disabled"
-							>
-								{{item.name}}
-							</u-radio>
-						</u-radio-group>
+				<u-radio-group v-model="form.type">
+					<u-radio v-for="(item, index) in list" :key="index" :name="item.type"
+						:disabled="item.disabled">
+						{{item.name}}
+					</u-radio>
+				</u-radio-group>
 			</view>
-			
+
+		</view>
+		<!-- 内容描述 -->
+		<view class="content-description">
+			<view class="title">
+				内容描述
+			</view>
+			<view class="content-textarea">
+				<textarea v-model="form.content" class="textarea" value="" placeholder="请描述共享用工需求内容,并留下您的联系方式。" />
+			</view>
+
 		</view>
-	   <!-- 内容描述 -->
-	  <view class="content-description">
-		  <view class="title">
-		  	内容描述
-		  </view>
-		  <view class="content-textarea">
-		  	 <textarea class="textarea" value="" placeholder="请描述共享用工需求内容,并留下您的联系方式。" />
-		  </view>
-	  	
-	  </view>
-	  
-	  <!-- 底部按钮 -->
-	  
-	  	<button class="btn">发布信息</button>
+
+		<!-- 底部按钮 -->
+
+		<button class="btn" @click="publishInformation">发布信息</button>
 	</view>
 </template>
 
 <script>
-	import * as API from '@/apis/pagejs/packages.js'
+	import * as packagesAPI from '@/apis/pagejs/packages.js'
+	
 	export default {
-	data() {
-		return {
-			list: [
-				{
-					name: '急需用工',
-					disabled: false
-				},
-				{
-					name: '资源共享',
-					disabled: false
+		data() {
+			return {
+				list: [{
+						name: '急需用工',
+						type: '1',
+						disabled: false
+					},
+					{
+						name: '资源共享',
+						type: '2',
+						disabled: false
+					},
+
+				],
+				// u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
+				form: {
+					id: '',
+					type: '1',
+					title: '',
+					content: ''
 				},
-				
-			],
-			// u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
-			value: '急需用工',
-		};
-	},
-	methods: {
-		// 选中某个单选框时,由radio时触发
-		radioChange(e) {
-			// console.log(e);
+			};
 		},
-		// 选中任一radio时,由radio-group触发
-		radioGroupChange(e) {
-			// console.log(e);
+		methods: {
+			publishInformation() {
+				if(!this.form.title) {
+					uni.showToast({
+						title: "请填写标题内容",
+						icon: "none"
+					})
+					return
+				}
+				if(!this.form.content) {
+					uni.showToast({
+						title: "请描述共享用工需求内容",
+						icon: "none"
+					})
+					return
+				}
+				
+				uni.showLoading({
+					title: "加载中",
+					mask: true,
+				})
+				packagesAPI.createShareWork(this.form).then((res) => {
+					uni.hideLoading();
+					uni.navigateTo({
+						url: '/pages/packages/mine/employmentService/shareEmployment'
+					})
+				}).catch(error => {
+					uni.showToast({
+						title: error,
+						icon: "none"
+					})
+				})
+			}
 		}
-	}
-};
+	};
 </script>
 <style>
 	page {
@@ -86,73 +113,81 @@
 </style>
 <style scoped lang="scss">
 	// 发布标题
-	.post-title{
+	.post-title {
 		margin: 24rpx 32rpx 0;
 		padding: 24rpx 32rpx;
 		color: rgba(16, 16, 16, 1);
 		font-size: 36rpx;
 		background-color: #fff;
 		border-radius: 24rpx;
-		.title{
+
+		.title {
 			font-family: 'PingFangSC-medium';
 		}
-		.title-content{
-		  .input{
-			  width: 100%;
-			  height: 96rpx;
-			  line-height: 96rpx;
-			  color: rgba(136, 136, 136, 1);
-			  font-family: Microsoft Yahei;
-		  }
+
+		.title-content {
+			.input {
+				width: 100%;
+				height: 96rpx;
+				line-height: 96rpx;
+				color: rgba(136, 136, 136, 1);
+				font-family: Microsoft Yahei;
+			}
 		}
+
 		// 类型选择
-		.type{
+		.type {
 			display: flex;
 			align-items: center;
 			margin-top: 16rpx;
-			.name{
+
+			.name {
 				font-size: 32rpx;
 				color: #101010;
 				margin-right: 40rpx;
-				text{
-					color:#EE3138
+
+				text {
+					color: #EE3138
 				}
 			}
 		}
 	}
 
 	// 内容描述
-	.content-description{
-			margin: 24rpx 32rpx 0;
-				padding: 24rpx 32rpx;
-				color: rgba(16, 16, 16, 1);
-				font-size: 36rpx;
-				background-color: #fff;
-				border-radius: 24rpx;
-				.title{
-					font-family: 'PingFangSC-medium';
-				}
-				.content-textarea{
-					margin-top: 24rpx;
-					 .textarea{
-						 width: 100%;
-						 height: 640rpx;
-						 color: rgba(136, 136, 136, 1);
-						 font-family: Microsoft Yahei;
-						 line-height: 40rpx;
-					 }
-				}
+	.content-description {
+		margin: 24rpx 32rpx 0;
+		padding: 24rpx 32rpx;
+		color: rgba(16, 16, 16, 1);
+		font-size: 36rpx;
+		background-color: #fff;
+		border-radius: 24rpx;
+
+		.title {
+			font-family: 'PingFangSC-medium';
+		}
+
+		.content-textarea {
+			margin-top: 24rpx;
+
+			.textarea {
+				width: 100%;
+				height: 640rpx;
+				color: rgba(136, 136, 136, 1);
+				font-family: Microsoft Yahei;
+				line-height: 40rpx;
+			}
+		}
 	}
-	
-// 底部按钮
 
-	
-	.btn{
+	// 底部按钮
+
+
+	.btn {
 		position: fixed;
 		bottom: 32rpx;
 		left: 0;
 		right: 0;
-		background-color:#F0F0F2;
+		background-color: #F0F0F2;
 		padding: 0 32rpx;
 		border-radius: 50px;
 		background-color: rgba(34, 149, 255, 1);
@@ -161,4 +196,4 @@
 		margin: 0 32rpx;
 		box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.03);
 	}
-</style>
+</style>

+ 73 - 69
pages/packages/shareEmployment/shareEmployment.vue

@@ -1,38 +1,37 @@
 <template>
 	<view>
-	<u-navbar back-text="共享用工" back-icon-size="28" back-icon-color="#ffffff" :background="{backgroundColor: '#2795FD',}" :back-text-style="{color: '#ffffff'}"></u-navbar>
-		
+		<u-navbar back-text="共享用工" back-icon-size="28" back-icon-color="#ffffff" :background="{backgroundColor: '#2795FD',}"
+			:back-text-style="{color: '#ffffff'}"></u-navbar>
+
 		<view class="tabs">
 			<u-tabs :list="list" :is-scroll="false" :current="current" @change="change"></u-tabs>
 		</view>
-	<view class="info-card" v-for="(item,i) in list[current].list" 
-		 :key="i"  @click="gotoUrl('pages/packages/shareEmployment/articleDetail?id='+item.id)"
-	>
-		<!-- 卡片信息 -->
-		<view class="detail">
-			企业现急需熟练机床车工5名,如有资源请联系0716-8818118 刘女士。
-		</view>
-		<view class="tag">
-			<view class="item1">
-				急需用工
+		<view class="info-card" v-for="(item,i) in list[current].list" :key="i"
+			@click="gotoUrl('pages/packages/shareEmployment/articleDetail?id='+item.id)">
+			<!-- 卡片信息 -->
+			<view class="detail">
+				企业现急需熟练机床车工5名,如有资源请联系0716-8818118 刘女士。
 			</view>
-			<view class="date-item">
-				2023-06-12
+			<view class="tag">
+				<view class="item1">
+					急需用工
+				</view>
+				<view class="date-item">
+					2023-06-12
+				</view>
 			</view>
+
+
+
 		</view>
-		
-	
-		
-	</view>
-	
-	<u-divider  v-if="formList[current].recordsTotal==list[current].list.length"
-	 :isnone="formList[current].recordsTotal==0" nonetext="没有找到相关内容" 
-	border-color="#CFD2D5">已经到底了</u-divider>
-	
-	<!-- 底部按钮 -->
-	
-	
-	
+
+		<u-divider v-if="formList[current].recordsTotal==list[current].list.length"
+			:isnone="formList[current].recordsTotal==0" nonetext="没有找到相关内容" border-color="#CFD2D5">已经到底了</u-divider>
+
+		<!-- 底部按钮 -->
+
+
+
 	</view>
 </template>
 
@@ -41,38 +40,36 @@
 	export default {
 		data() {
 			return {
-				formList:[
-					{
-						
+				formList: [{
+
 						pageIndex: 1,
 						pageSize: 20,
 						recordsTotal: 1,
 						type: "1",
-						
+
 					},
 					{
-						
+
 						pageIndex: 1,
 						pageSize: 20,
 						recordsTotal: 1,
 						type: "2",
-						
+
 					}
 				],
-				list:[
-					{
+				list: [{
 						name: '急需用工',
-						
+
 						list: []
 					},
 					{
 						name: '资源共享',
-						
+
 						list: []
 					}
 				],
-					current: 0
-				
+				current: 0
+
 			}
 		},
 		onReachBottom() {
@@ -87,18 +84,18 @@
 		},
 		methods: {
 			getList() {
-			
+
 				uni.showLoading({
 					title: "加载中",
 					mask: true,
 				})
 				var list = this.list[this.current].list
-				
+
 				var listForm = this.formList[this.current]
-				
-			
+
+
 				API.shareWorksList(listForm).then((res) => {
-			
+
 					if (listForm.pageIndex == 1) {
 						list = res.data.data;
 					} else {
@@ -107,9 +104,9 @@
 							...res.data.data
 						];
 					}
-			
+
 					this.list[this.current].list = list
-			
+
 					this.formList[this.current].recordsTotal = res.data.recordsTotal;
 					uni.hideLoading();
 				}).catch(error => {
@@ -118,7 +115,7 @@
 						icon: "none"
 					})
 				})
-			
+
 			},
 			myLoadmore() {
 				this.formList[this.current].pageIndex += 1;
@@ -136,52 +133,59 @@
 </script>
 
 <style>
-	page{
+	page {
 		background: #F0F0F2;
 		padding-bottom: 100px;
 	}
 </style>
 <style scoped lang="scss">
-	.info-card{
+	.info-card {
 		margin: 24rpx 32rpx 0;
 		padding: 24rpx;
 		background-color: #fff;
 		border-radius: 24rpx;
+
 		// 卡片信息
-		.detail{
+		.detail {
 			color: rgba(16, 16, 16, 1);
 			line-height: 40rpx;
-			
+
 		}
-		.tag{
+
+		.tag {
 			display: flex;
 			justify-content: space-between;
 			margin-top: 16rpx;
 			margin-bottom: 24rpx;
-			.item1{
+
+			.item1 {
 				color: rgba(39, 149, 253, 1);
 				font-size: 24rpx;
 			}
-			.item2{
+
+			.item2 {
 				color: rgba(0, 185, 98, 1);
 				font-size: 24rpx;
 			}
 		}
+
 		// 审核
-		.check{
+		.check {
 			display: flex;
 			justify-content: space-between;
 			align-items: center;
 			margin-top: 32rpx;
-			.state{
+
+			.state {
 				color: rgba(51, 51, 51, 1);
 				font-weight: 600;
 			}
-			.handle{
+
+			.handle {
 				display: flex;
 				align-items: center;
-				
-				.unamend{
+
+				.unamend {
 					width: 120rpx;
 					height: 56rpx;
 					line-height: 56rpx;
@@ -191,7 +195,8 @@
 					border-radius: 50px;
 					opacity: 0.4;
 				}
-				.amend{
+
+				.amend {
 					width: 120rpx;
 					height: 56rpx;
 					line-height: 56rpx;
@@ -199,9 +204,10 @@
 					font-family: Microsoft Yahei;
 					border: 1px solid rgba(231, 232, 234, 1);
 					border-radius: 50px;
-					
+
 				}
-				.delete{
+
+				.delete {
 					width: 120rpx;
 					height: 56rpx;
 					line-height: 56rpx;
@@ -216,15 +222,15 @@
 		}
 	}
 
-// 底部按钮
+	// 底部按钮
+
 
-	
-	.btn{
+	.btn {
 		position: fixed;
 		bottom: 32rpx;
 		left: 0;
 		right: 0;
-		background-color:#F0F0F2;
+		background-color: #F0F0F2;
 		padding: 0 32rpx;
 		border-radius: 50px;
 		background-color: rgba(34, 149, 255, 1);
@@ -233,6 +239,4 @@
 		margin: 0 32rpx;
 		box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.03);
 	}
-
-
-</style>
+</style>

+ 10 - 1
pages/tab/mine/mine.vue

@@ -83,7 +83,9 @@
 			 			</view>
 			 			<view class="grid-text">邀请记录</view>
 			 		</u-grid-item>
-					<u-grid-item @click="gotoUrl('pages/packages/mine/employmentService/shareEmployment')">
+
+					<u-grid-item @click="toShareEmployment">
+
 						<view class="icon">
 							<img src="@/assets/img/riLine-service-line@1x.png" alt="">
 						</view>
@@ -278,6 +280,13 @@
 			toAuthentication() {
 				uni.navigateTo({
 					url: '/pages/packages/mine/otherServices/authentication'
+
+				})
+			},
+			toShareEmployment() {
+				uni.navigateTo({
+					url: '/pages/packages/mine/employmentService/shareEmployment'
+
 				})
 			}
 		}