Преглед на файлове

新增学员需求页面完成

一个番茄酱 преди 2 години
родител
ревизия
14ed4a4b6c

+ 20 - 4
education_family/service/service-education/src/main/java/com/xunwang/education/controller/StudentRequirementsController.java

@@ -1,15 +1,18 @@
 package com.xunwang.education.controller;
 
+import com.github.xiaoymin.knife4j.annotations.ApiSupport;
+import com.xunwang.commonutils.JwtUtils;
 import com.xunwang.commonutils.R;
+import com.xunwang.commonutils.RedisIdWorker;
+import com.xunwang.education.entity.StudentRequirements;
 import com.xunwang.education.service.StudentRequirementsService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 /**
@@ -23,8 +26,21 @@ import java.util.List;
 @RestController
 @RequestMapping("/education/student-requirements")
 @Api("学生需求表")
+@ApiSupport(author = "Long")
 public class StudentRequirementsController {
 
+    @Resource
+    private StudentRequirementsService requirementsService;
 
+    @ApiOperation("发布学生需求")
+    @PostMapping("publishRequirements")
+    public R publishRequirements(@RequestBody StudentRequirements requirements, HttpServletRequest request) {
+        boolean b = requirementsService.publishRequirements(requirements, request);
+        if (b) {
+            return R.ok().message("提交成功,请等待审核");
+        } else {
+            return R.ok().message("提交失败,请稍后再试");
+        }
+    }
 }
 

+ 32 - 20
education_family/service/service-education/src/main/java/com/xunwang/education/entity/StudentRequirements.java

@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import java.util.Date;
 import com.baomidou.mybatisplus.annotation.TableId;
 import java.io.Serializable;
+
+import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -23,6 +25,7 @@ import lombok.experimental.Accessors;
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
 @ApiModel(value="StudentRequirements对象", description="需求表")
+@TableName("stu_needs")
 public class StudentRequirements implements Serializable {
 
     private static final long serialVersionUID = 1L;
@@ -32,16 +35,13 @@ public class StudentRequirements implements Serializable {
     private Integer id;
 
     @ApiModelProperty(value = "无序唯一id")
-    private String requireId;
+    private long requireId;
 
     @ApiModelProperty(value = "无序唯一id")
-    private String uid;
-
-    @ApiModelProperty(value = "是否上架,1=是,0=否")
-    private String display;
+    private long uid;
 
     @ApiModelProperty(value = "学生姓名")
-    private String studentName;
+    private String name;
 
     @ApiModelProperty(value = "学生手机号")
     private String phone;
@@ -61,12 +61,6 @@ public class StudentRequirements implements Serializable {
     @ApiModelProperty(value = "学生详细位置")
     private String locationStr;
 
-    @ApiModelProperty(value = "老师上门,学员上门,线上辅导")
-    private String positionType;
-
-    @ApiModelProperty(value = "学生性别,1=male ,0=female")
-    private String studentGender;
-
     @ApiModelProperty(value = "需求金额(分)")
     private BigDecimal salary;
 
@@ -79,7 +73,13 @@ public class StudentRequirements implements Serializable {
     @ApiModelProperty(value = "期望达到的目标和效果")
     private String goal;
 
-    @ApiModelProperty(value = "大学生,专职老师")
+    @ApiModelProperty(value = "审核不过原因")
+    private String verifyRefuseReason;
+
+    @ApiModelProperty(value = "对老师的额外需求")
+    private String teacherDemanded;
+
+    @ApiModelProperty(value = "学生教员,专职教员")
     private String teacherType;
 
     @ApiModelProperty(value = "老师学历")
@@ -91,16 +91,28 @@ public class StudentRequirements implements Serializable {
     @ApiModelProperty(value = "是否要求上传头像")
     private String teacherProfilePhoto;
 
-    @ApiModelProperty(value = "对老师的额外需求")
-    private String addRequireForTeacher;
-
     @ApiModelProperty(value = "自动,不填")
-    private Date datetime;
+    private String datetime;
+
+    @ApiModelProperty(value = "'男' '女'")
+    private String sex;
 
-    @ApiModelProperty(value = "审核状态,0=wait ,1=pass ,2=refuse")
+    @ApiModelProperty(value = "老师上门,学员上门,线上辅导")
+    private String mode;
+
+    @ApiModelProperty(value = "'审核中' '已通过' '未通过'")
     private String verifyStatus;
 
-    @ApiModelProperty(value = "审核不过原因")
-    private String verifyRefuseReason;
+    @ApiModelProperty(value = "'上架' '下架'")
+    private String display;
+
+    @ApiModelProperty(value = "'未锁' '已锁'")
+    private String locked;
+
+    @ApiModelProperty(value = "'已成交' '未成交'")
+    private String deal;
+
+    @ApiModelProperty(value = "0:'未删' , 1:'已删',这个字段保留,先不使用")
+    private String deleted;
 
 }

+ 4 - 1
education_family/service/service-education/src/main/java/com/xunwang/education/service/StudentRequirementsService.java

@@ -1,8 +1,10 @@
 package com.xunwang.education.service;
 
+import com.xunwang.commonutils.R;
 import com.xunwang.education.entity.StudentRequirements;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 /**
@@ -15,5 +17,6 @@ import java.util.List;
  */
 public interface StudentRequirementsService extends IService<StudentRequirements> {
 
-
+    // 发布学生需求
+    boolean publishRequirements(StudentRequirements requirements, HttpServletRequest request);
 }

+ 25 - 0
education_family/service/service-education/src/main/java/com/xunwang/education/service/impl/StudentRequirementsServiceImpl.java

@@ -1,11 +1,16 @@
 package com.xunwang.education.service.impl;
 
+import com.xunwang.commonutils.JwtUtils;
+import com.xunwang.commonutils.R;
+import com.xunwang.commonutils.RedisIdWorker;
 import com.xunwang.education.entity.StudentRequirements;
 import com.xunwang.education.mapper.StudentRequirementsMapper;
 import com.xunwang.education.service.StudentRequirementsService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 /**
@@ -19,4 +24,24 @@ import java.util.List;
 @Service
 public class StudentRequirementsServiceImpl extends ServiceImpl<StudentRequirementsMapper, StudentRequirements> implements StudentRequirementsService {
 
+    @Resource
+    private RedisIdWorker redisIdWorker;
+
+    /**
+     * 发布学生需求
+     * @param requirements
+     * @param request
+     * @return
+     */
+    @Override
+    public boolean publishRequirements(StudentRequirements requirements, HttpServletRequest request) {
+        String uid = JwtUtils.getUIdByJwtToken(request);
+        long userId = Long.parseLong(uid);
+        long next = redisIdWorker.nextId("requirements");
+
+        StudentRequirements studentRequirements = requirements.setUid(userId).setRequireId(next);
+
+        boolean save = save(studentRequirements);
+        return save;
+    }
 }

+ 3 - 1
education_uni/components/my-login/my-login.vue

@@ -36,8 +36,10 @@
 				
 				// 换取 token
 				const { data: loginResult } = await uni.$http.get('/ucenter/mini-program-openid-uid/wxlogin', query)
+				if (loginResult.code === 20000) {
+					uni.$showMsg('登录成功!')
+				}
 				
-				uni.$showMsg('登录成功!')
 				// console.log(loginResult)
 				
 				// 更新vuex中的token

+ 1 - 1
education_uni/components/my-userinfo/my-userinfo.vue

@@ -12,7 +12,7 @@
 		        <navigator class="infoList-text" url="myAppointment">我的邀请</navigator>
 		        <navigator class="infoList-text" url="appointment">我被邀请</navigator>
 		        <navigator class="infoList-text" url="myLessons">我的订单</navigator>
-		        <navigator class="infoList-text" url="/subpkg/stu_require/stu_require">我的需求</navigator>
+		        <navigator class="infoList-text" url="/subpkg/student_require/student_require">学员需求</navigator>
 		        <navigator class="infoList-text" url="myTeacher">我收藏的老师</navigator>
 		        <navigator class="infoList-text" url="myStudent">我收藏的学生</navigator>
 		        <navigator class="infoList-text" url="/subpkg/course_publish/course_publish">我的投诉</navigator>

+ 2 - 2
education_uni/main.js

@@ -40,8 +40,8 @@ $http.afterRequest = function(res) {
 		uni.$showMsg(res.data.message)
 		if (res.data.message === '登录过期,请重新登录') {
 			uni.setStorageSync('token', '')
-			uni.reLaunch({
-				url: '/pages/my/my.vue'
+			uni.switchTab({
+				url: '/pages/my/my'
 			})
 		}
 	}

+ 2 - 1
education_uni/manifest.json

@@ -60,7 +60,8 @@
         "usingComponents" : true,
 		"requiredPrivateInfos": [
 			"choosePoi",
-			"getFuzzyLocation"
+			"getFuzzyLocation",
+			"chooseLocation"
 		]
     },
     "vueVersion" : "2"

+ 11 - 2
education_uni/pages.json

@@ -60,10 +60,10 @@
                 
                 }
                 ,{
-                    "path" : "stu_require/stu_require",
+                    "path" : "add_stu_require/add_stu_require",
                     "style" :                                                                                    
                 {
-                    "navigationBarTitleText": "我的需求",
+                    "navigationBarTitleText": "新增学员需求",
                     "enablePullDownRefresh": false
                 }
                 
@@ -121,6 +121,15 @@
                     "enablePullDownRefresh": false
                 }
                 
+                }
+                ,{
+                    "path" : "student_require/student_require",
+                    "style" :                                                                                    
+                {
+                    "navigationBarTitleText": "我发布的学员需求",
+                    "enablePullDownRefresh": false
+                }
+                
                 }
             ]
 		}

+ 2 - 2
education_uni/pages/my/my.vue

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<!-- 用户未登录时,显示登录组件 -->
-		<my-login v-if="!token || token === ''"></my-login>
+		<my-login v-if="!token && token === ''"></my-login>
 		
 		<!-- 用户登录后,显示用户信息组件 -->
 		<my-userinfo v-else></my-userinfo>
@@ -33,7 +33,7 @@
 				const message = result.message
 				// console.log("fff")
 				this.updateAuthentication(message)
-			}
+			},
 		}
 	}
 </script>

+ 550 - 0
education_uni/subpkg/add_stu_require/add_stu_require.vue

@@ -0,0 +1,550 @@
+<template>
+	<view>
+		<uni-forms ref="baseForm" :model="baseFormData" labelWidth="75px" :rules="rules" validateTrigger="bind">
+			<uni-forms-item label="姓名" name="name" required>
+				<uni-easyinput v-model="baseFormData.name" placeholder="请输入姓名" maxlength="6" trim="both" />
+			</uni-forms-item>
+			<uni-forms-item label="手机号" name="phone" required>
+				<button open-type="getPhoneNumber" type="primary" size="mini"
+					@getphonenumber="getPhoneNumber">获取手机号</button>
+			</uni-forms-item>
+			<uni-forms-item label="微信号" name="wxid" required>
+				<uni-easyinput v-model="baseFormData.wxid" placeholder="微信号(不便接听电话时微信沟通)" maxlength="25"
+					trim="both" />
+			</uni-forms-item>
+			<uni-forms-item label="地址:" name="locationStr" required>
+				<uni-easyinput type="text" v-model="baseFormData.locationStr" @focus="getLocation" maxlength="250" trim="both" />
+			</uni-forms-item>
+			<uni-forms-item label="选择课程" required>
+				<uni-data-picker placeholder="请选择课程" popup-title="课程大纲-具体课程" v-model="baseFormData.subjectSmall" :clearIcon="false"
+					:localdata="courseTree" />
+			</uni-forms-item>
+			<uni-forms-item label="辅导方式" required>
+				<uni-data-checkbox v-model="baseFormData.mode" :localdata="modes" />
+			</uni-forms-item>
+			<uni-forms-item label="学员性别" required>
+				<uni-data-checkbox v-model="baseFormData.sex" :localdata="sexs" />
+			</uni-forms-item>
+			<uni-forms-item label="课时费" name="salary" required :errorMessage="errorPrice">
+				<uni-easyinput v-model="baseFormData.salary" type="number" placeholder="请输入课时金额" />
+			</uni-forms-item>
+			<uni-forms-item label="上课时间" required>
+			</uni-forms-item>
+			<view class="tr-container">
+				<view class="tr_1">
+					<text class="th_0" decode="true">&ensp;&ensp;&ensp;&ensp;</text>
+					<text class="th_1">周一</text>
+					<text class="th_1">周二</text>
+					<text class="th_1">周三</text>
+					<text class="th_1">周四</text>
+					<text class="th_1">周五</text>
+					<text class="th_1">周六</text>
+					<text class="th_1">周日</text>
+				</view>
+				<view class="tr_2">
+					<checkbox-group @change="chechboxChangeAM">
+						<view class="th2_0">上午</view>
+						<label v-for="item in timeAM" :key="item.value">
+							<checkbox class="th2_1" :value="item.value"></checkbox>
+						</label>
+					</checkbox-group>
+				</view>
+				<view class="tr_2">
+					<checkbox-group @change="chechboxChangePM">
+						<view class="th2_0">下午</view>
+						<label v-for="item in timePM" :key="item.value">
+						<checkbox class="th2_1" :value="item.value"></checkbox>
+						</label>
+					</checkbox-group>
+				</view>
+				<view class="tr_2">
+					<checkbox-group @change="chechboxChangeEvening">
+						<view class="th2_0">晚上</view>
+						<label v-for="item in timeEvening" :key="item.value">
+						<checkbox class="th2_1" :value="item.value"></checkbox>
+						</label>
+					</checkbox-group>
+				</view>
+			</view>
+			<uni-forms-item label="期望目标" name="goal">
+				<uni-easyinput type="textarea" v-model="baseFormData.goal" maxlength="100" trim="both" />
+			</uni-forms-item>
+			<uni-forms-item label="教员身份" required>
+				<uni-data-checkbox v-model="baseFormData.teacherType" :localdata="identifies" />
+			</uni-forms-item>
+			<uni-forms-item label="教员学历" required>
+				<uni-data-select v-model="baseFormData.teacherEdu" :localdata="educations" />
+			</uni-forms-item>
+			<uni-forms-item label="教员性别" required>
+				<uni-data-checkbox v-model="baseFormData.teacherGender" :localdata="sexsTeacher" />
+			</uni-forms-item>
+			<uni-forms-item label="教员照片" required>
+				<uni-data-checkbox v-model="baseFormData.teacherProfilePhoto" :localdata="hasPhotoes" />
+			</uni-forms-item>
+			<uni-forms-item label="对教员要求" name="teacherDemanded">
+				<uni-easyinput type="textarea" v-model="baseFormData.teacherDemanded" maxlength="100" trim="both" />
+			</uni-forms-item>
+		</uni-forms>
+		<view>
+			<button type="primary" @click="submit">提交需求</button>
+		</view>
+	</view>
+</template>
+
+<script>
+	import { mapState } from 'vuex'
+	
+	export default {
+		computed: {
+			...mapState('m_user', ['userinfo'])
+		},
+		data() {
+			return {
+				loading: false,
+				errorPrice: '',
+				courseAM: [],
+				coursePM: [],
+				courseEV: [],
+				// 表单数据
+				baseFormData: {
+					name: '',
+					phone: '',
+					wxid: '',
+					subjectSmall: '1-1',
+					mode: '教员上门',
+					sex: '男',
+					salary: 0,
+					courseWeekday: [],
+					goal: '',
+					teacherType: '专职教员',
+					teacherEdu: '',
+					teacherGender: '男',
+					teacherProfilePhoto: '有',
+					teacherDemanded: '',
+					locationStr: '',
+					locationAl: ''
+				},
+				coursePrice: [],
+				// 选择课程
+				courseTree: [{
+						text: '一年级',
+						value: '1-0',
+						children: [{
+								text: '1.1班',
+								value: '1-1'
+							}
+						]
+					}
+				],
+				// 单选辅导方式数据源
+				modes: [{
+					text: '教员上门',
+					value: '教员上门'
+				}, {
+					text: '学员上门',
+					value: '学员上门'
+				}, {
+					text: '线上辅导',
+					value: '线上辅导'
+				}],
+				// 单选性别数据源
+				sexs: [{
+					text: '男',
+					value: '男'
+				}, {
+					text: '女',
+					value: '女'
+				}],
+				// 单选老师身份
+				identifies: [{
+					text: '专职教员',
+					value: '专职教员'
+				}, {
+					text: '学生教员',
+					value: '学生教员'
+				}],
+				educations: [{
+					value: '专科在读',
+					text: '专科在读及以上'
+				}, {
+					value: '专科毕业',
+					text: '专科毕业及以上'
+				}, {
+					value: '本科在读',
+					text: '本科在读及以上'
+				}, {
+					value: '本科毕业',
+					text: '本科毕业及以上'
+				}, {
+					value: '硕士在读',
+					text: '硕士在读及以上'
+				}, {
+					value: '硕士毕业',
+					text: '硕士毕业及以上'
+				}, {
+					value: '博士在读',
+					text: '博士在读及以上'
+				}, {
+					value: '博士毕业',
+					text: '博士毕业及以上'
+				}, {
+					value: '不限',
+					text: '不限'
+				}],
+				// 单选老师性别
+				sexsTeacher: [{
+					text: '男',
+					value: '男'
+				}, {
+					text: '女',
+					value: '女'
+				}],
+				// 单选老师有无照片
+				hasPhotoes: [{
+					text: '有',
+					value: '有'
+				}, {
+					text: '无',
+					value: '无'
+				}],
+				// 上课时间
+				// 上午
+				timeAM: [{
+					value: 'A1',
+						name: '1'
+						
+					},
+					{
+						name: '2',
+						value: 'A2'
+					},
+					{
+						name: '3',
+						value: 'A3'
+					},
+					{
+						name: '4',
+						value: 'A4'
+					},
+					{
+						name: '5',
+						value: 'A5'
+					},
+					{
+						name: '6',
+						value: 'A6'
+					},
+					{
+						name: '7',
+						value: 'A7'
+					}
+				],
+				// 下午
+				timePM: [{
+					value: 'P1',
+						name: '1'
+						
+					},
+					{
+						name: '2',
+						value: 'P2'
+					},
+					{
+						name: '3',
+						value: 'P3'
+					},
+					{
+						name: '4',
+						value: 'P4'
+					},
+					{
+						name: '5',
+						value: 'P5'
+					},
+					{
+						name: '6',
+						value: 'P6'
+					},
+					{
+						name: '7',
+						value: 'P7'
+					}
+				],
+				// 晚上
+				timeEvening: [{
+						name: '1',
+						value: 'E1'
+					},
+					{
+						name: '2',
+						value: 'E2'
+					},
+					{
+						name: '3',
+						value: 'E3'
+					},
+					{
+						name: '4',
+						value: 'E4'
+					},
+					{
+						name: '5',
+						value: 'E5'
+					},
+					{
+						name: '6',
+						value: 'E6'
+					},
+					{
+						name: '7',
+						value: 'E7'
+					}
+				],
+				rules: {
+					name: {
+						rules: [{
+							required: true,
+							errorMessage: '请输入姓名',
+						}]
+					},
+					wxid: {
+						rules: [{
+							required: true,
+							errorMessage: '请输入微信号',
+						}, {
+							errorMessage: '请输入正确的微信号',
+							pattern: '^[a-zA-Z][a-zA-Z\\d_-]{5,19}$',
+						}]
+					},
+					salary: {
+						rules: [{
+							required: true,
+							errorMessage: '请输入课时费'
+						}]
+					},
+				}
+			};
+		},
+		created() {
+			this.getPriceAndTree()
+		},
+		methods: {
+			// 手机号
+			// 手机号
+			async getPhoneNumber(e) {
+				// console.log(e.detail.code)
+				if (e.detail.code === undefined) return uni.$showMsg('获取手机号失败!')
+				const query = {
+					code: e.detail.code
+				}
+				const {
+					data: result
+				} = await uni.$http.get('/ucenter/mini-program-openid-uid/wxGetPhone', query)
+				if (result.code === 20000) {
+					this.baseFormData.phone = result.data.phone
+					return uni.$showMsg('获取手机成功!')
+				}
+			},
+			// 树形结构的课程和价格表
+			async getPriceAndTree() {
+				const {
+					data: result
+				} = await uni.$http.get('/education/course-price/treeAndPrice')
+				// console.log(result)
+				this.courseTree = result.data.treeCourse
+				this.coursePrice = result.data.coursePrice
+			},
+			// 上午复选框
+			chechboxChangeAM(e) {
+				this.courseAM.push(e.detail.value)
+			},
+			// 下午复选框
+			chechboxChangePM(e) {
+				this.coursePM.push(e.detail.value)
+			},
+			// 晚上复选框
+			chechboxChangeEvening(e) {
+				this.courseEV.push(e.detail.value)
+			},
+			// 获取老师地理位置
+			getLocation() {
+				// wx.choosePoi({
+				// 	success: res => {
+				// 		console.log(res)
+				// 		if (res.type === 0) {
+				// 			// 不显示位置
+				// 			this.baseFormData.locationStr = ''
+				// 		} else if (res.type === 2) {
+				// 			// 详细位置
+				// 			this.baseFormData.locationStr = res.address
+				// 		} else if (res.type === 1) {
+				// 			// 概要位置
+				// 			this.baseFormData.locationStr = res.city
+				// 		}
+						
+				// 	}
+				// })
+				wx.chooseLocation({
+					success: res => {
+						if (res.errMsg === 'chooseLocation:ok') {
+							this.baseFormData.locationStr = res.address + res.name
+							this.baseFormData.locationAl = res.latitude + ',' + res.longitude
+						} 
+					}
+				})
+			},
+			// 提交
+			submit() {
+				if (this.isLoading) {
+					return uni.$showMsg('操作过快,请耐心等待…')
+				}
+				this.isLoading = true
+				this.baseFormData.courseWeekday = []
+				this.$refs.baseForm.validate().then(res => {
+					if (this.baseFormData.phone === '') return uni.$showMsg('手机号未获取!')
+					if (this.baseFormData.locationStr === '') return uni.$showMsg('请选择地址!')
+					if (this.baseFormData.subjectSmall === '1-1' || this.baseFormData.subjectSmall === '') return uni.$showMsg('请选择课程')
+					if (this.courseAM.length === 0 && this.coursePM.length === 0 && this.courseEV.length === 0) return uni.$showMsg('请选择上课时间!')
+					if (this.courseAM[this.courseAM.length - 1] == '' && this.coursePM.length === 0 && this.courseEV.length === 0) return uni.$showMsg('请选择上课时间!')
+					if (this.courseAM.length === 0 && this.coursePM[this.coursePM.length - 1] == '' && this.courseEV.length === 0) return uni.$showMsg('请选择上课时间!')
+					if (this.courseAM.length === 0 && this.coursePM.length === 0 && this.courseEV[this.courseEV.length - 1] == '') return uni.$showMsg('请选择上课时间!')
+					if (this.courseAM[this.courseAM.length - 1] == '' && this.coursePM[this.coursePM.length - 1] == '' && this.courseEV.length === 0) return uni.$showMsg('请选择上课时间!')
+					if (this.courseAM[this.courseAM.length - 1] == '' && this.coursePM.length === 0 && this.courseEV[this.courseEV.length - 1] == '') return uni.$showMsg('请选择上课时间!')
+					if (this.courseAM.length === 0 && this.coursePM[this.coursePM.length - 1] == '' && this.courseEV[this.courseEV.length - 1] == '') return uni.$showMsg('请选择上课时间!')
+					if (this.courseAM[this.courseAM.length - 1] == '' && this.coursePM[this.coursePM.length - 1] == '' && this.courseEV[this.courseEV.length - 1] == '') return uni.$showMsg('请选择上课时间!')
+					if (this.courseAM.length > 0) {
+						this.baseFormData.courseWeekday.push(this.courseAM[this.courseAM.length - 1])
+					}
+					if (this.coursePM.length > 0) {
+						this.baseFormData.courseWeekday.push(this.coursePM[this.coursePM.length - 1])
+					}
+					if (this.courseEV.length > 0) {
+						this.baseFormData.courseWeekday.push(this.courseEV[this.courseEV.length - 1])
+					}
+					// 上课时间
+					this.baseFormData.courseWeekday = this.baseFormData.courseWeekday.join()
+					// console.log(this.baseFormData.courseWeekday)
+					// 教员学历
+					if (this.baseFormData.teacherEdu === '') return uni.$showMsg('请选择教员学历!')
+					
+					// 课时费
+					let city = this.userinfo.city
+					for(let i = 0; i < this.coursePrice.length; i++) {
+						if(this.coursePrice[i].courseName === this.baseFormData.subjectSmall) {
+							// console.log(this.coursePrice[i].priceMapping.stu_price_2_l)
+							// 二线城市
+							if (city != '北京' || city != '上海' || city != '广州' || city != '深圳') {
+								// 学生
+								if (this.baseFormData.teacherType === '学生教员') {
+									if (this.coursePrice[i].priceMapping.stu_price_2_l > this.baseFormData.salary || this.baseFormData.salary > this.coursePrice[i].priceMapping.stu_price_2_h) {
+										this.errorPrice = '价格在' + this.coursePrice[i].priceMapping.stu_price_2_l + '~' + this.coursePrice[i].priceMapping.stu_price_2_h + '之间'
+										return uni.$showMsg('请合理选择课时费')
+									}
+								} else {
+									if (this.coursePrice[i].priceMapping.fulltime_price_2_l > this.baseFormData.salary || this.baseFormData.salary > this.coursePrice[i].priceMapping.fulltime_price_2_h) {
+										this.errorPrice = '价格在' + this.coursePrice[i].priceMapping.fulltime_price_2_l + '~' + this.coursePrice[i].priceMapping.fulltime_price_2_h + '之间'
+										return uni.$showMsg('请合理选择课时费')
+									}
+								}
+							} else {
+								// 学生
+								if (this.baseFormData.teacherType === '学生教员') {
+									if (this.coursePrice[i].priceMapping.stu_price_1_l > this.baseFormData.salary || this.baseFormData.salary > this.coursePrice[i].priceMapping.stu_price_1_h) {
+										this.errorPrice = '价格在' + this.coursePrice[i].priceMapping.stu_price_1_l + '~' + this.coursePrice[i].priceMapping.stu_price_1_h + '之间'
+										return uni.$showMsg('请合理选择课时费')
+									}
+								} else {
+									if (this.coursePrice[i].priceMapping.fulltime_price_1_l > this.baseFormData.salary || this.baseFormData.salary > this.coursePrice[i].priceMapping.fulltime_price_1_h) {
+										this.errorPrice = '价格在' + this.coursePrice[i].priceMapping.fulltime_price_1_l + '~' + this.coursePrice[i].priceMapping.fulltime_price_1_h + '之间'
+										return uni.$showMsg('请合理选择课时费')
+									}
+								}
+							}
+						}
+					}
+					console.log(this.baseFormData)
+					
+					uni.request({
+						url: 'http://192.168.0.207:8222/education/student-requirements/publishRequirements',
+						data: this.baseFormData,
+						header: {
+							token: uni.getStorageSync('token')
+						},
+						method: 'POST',
+						success: res => {
+							uni.$showMsg(res.data.message)
+							setTimeout(() => {
+								uni.navigateBack()
+							}, 1000)
+						}
+					})
+					
+				}).catch(err => {
+
+					this.isLoading = false
+					// console.log(err)
+				})
+				this.isLoading = false
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.tr-container{
+	    display: flex;
+	    position: relative;
+	    width: 96%;
+	    flex-direction: column;
+	    font-size: 26rpx;
+	    /* border: 1rpx solid gray; */
+	    margin: -10px 20rpx;
+		margin-bottom: 20px;
+	}
+	
+	.tr_1 {
+	    display: flex;
+	    position: relative;
+	    height: 80rpx;
+	    line-height: 80rpx;
+	}
+	.tr_2{
+	    display: block;
+	    height: 80rpx;
+	    line-height: 80rpx;
+	}
+	
+	.th_0,
+	.th_1,
+	.th_2,
+	.th2_0,
+	.th2_1,
+	.th2_2{
+	    width: 12%;
+	    height: 80rpx;
+	    line-height: 80rpx;
+	    border-right: 1rpx solid gray;
+	    border-bottom: 1rpx solid gray;
+	    text-align: center;
+	}
+	
+	.th_0,
+	.th_1,
+	.th_2{
+	    border-top: 1rpx solid gray;
+	}
+	
+	.th_0,
+	.th2_0{
+	    border-left: 1rpx solid gray;
+	}
+	
+	.th2_0{
+	    float: left;
+	    width: 12%;
+	    height: 80rpx;
+	    line-height: 80rpx;
+	    text-align: center;
+	    /* background-color: greenyellow; */
+	}
+</style>

+ 0 - 210
education_uni/subpkg/stu_require/stu_require.vue

@@ -1,210 +0,0 @@
-<template>
-	<view>
-		<uni-forms ref="baseForm" :model="baseFormData" labelWidth="75px">
-			<uni-forms-item label="姓名" name="name" required>
-				<uni-easyinput v-model="baseFormData.name" placeholder="请输入姓名" maxlength="6" trim="both" />
-			</uni-forms-item>
-			<uni-forms-item label="手机号" name="name" required>
-				<button open-type="getPhoneNumber" type="primary" size="mini"
-					@getphonenumber="getPhoneNumber">获取手机号</button>
-			</uni-forms-item>
-			<uni-forms-item label="微信号" name="weixinId" required>
-				<uni-easyinput v-model="baseFormData.weixinId" placeholder="微信号(不便接听电话时微信沟通)" maxlength="25"
-					trim="both" />
-			</uni-forms-item>
-			<uni-forms-item label="选择课程" required>
-				<uni-data-picker placeholder="请选择课程" popup-title="课程大纲-具体课程" v-model="baseFormData.course" :clearIcon="false"
-					:localdata="courseTree" />
-			</uni-forms-item>
-			<uni-forms-item label="辅导方式" required>
-				<uni-data-checkbox v-model="baseFormData.mode" multiple :localdata="modes" />
-			</uni-forms-item>
-			<uni-forms-item label="学生性别" required>
-				<uni-data-checkbox v-model="baseFormData.sex" :localdata="sexs" />
-			</uni-forms-item>
-			<uni-forms-item label="课时费" required>
-				<uni-easyinput v-model="baseFormData.fee" type="number" placeholder="请输入课时金额" />
-			</uni-forms-item>
-			<uni-forms-item label="上课时间" required="">
-				<uni-datetime-picker v-model="baseFormData.datetimerange" type="datetimerange" rangeSeparator="至" />
-			</uni-forms-item>
-			<uni-forms-item label="期望目标" name="target">
-				<uni-easyinput type="textarea" v-model="baseFormData.target" maxlength="100" trim="both" />
-			</uni-forms-item>
-			<uni-forms-item label="老师身份" required>
-				<uni-data-checkbox v-model="baseFormData.identify" :localdata="identifies" />
-			</uni-forms-item>
-			<uni-forms-item label="老师学历" required>
-				<uni-data-select v-model="baseFormData.education" :localdata="educations" />
-			</uni-forms-item>
-			<uni-forms-item label="老师性别" required>
-				<uni-data-checkbox v-model="baseFormData.sexTeacher" :localdata="sexsTeacher" />
-			</uni-forms-item>
-			<uni-forms-item label="老师照片" required>
-				<uni-data-checkbox v-model="baseFormData.hasPhoto" :localdata="hasPhotoes" />
-			</uni-forms-item>
-			<uni-forms-item label="对老师要求" name="demandTeacher">
-				<uni-easyinput type="textarea" v-model="baseFormData.demandTeacher" maxlength="100" trim="both" />
-			</uni-forms-item>
-		</uni-forms>
-		<view>
-			<button type="primary">提交需求</button>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				// 表单数据
-				baseFormData: {
-					name: '',
-					phone: '',
-					weixinId: '',
-					course: '1-2',
-					mode: '',
-					sex: '保密',
-					fee: '',
-					datetimerange: '',
-					target: '',
-					identify: '不限',
-					education: '',
-					sexTeacher: '不限',
-					hasPhoto: '不限',
-					demandTeacher: ''
-				},
-				// 选择课程
-				courseTree: [{
-						text: '一年级',
-						value: '1-0',
-						children: [{
-								text: '1.1班',
-								value: '1-1'
-							},
-							{
-								text: '1.2班',
-								value: '1-2'
-							}
-						]
-					},
-					{
-						text: '二年级',
-						value: '2-0',
-						children: [{
-								text: '2.1班',
-								value: '2-1'
-							},
-							{
-								text: '2.2班',
-								value: '2-2'
-							}
-						]
-					}
-				],
-				// 多选辅导方式数据源
-				modes: [{
-					text: '老师上门',
-					value: '老师上门'
-				}, {
-					text: '学员上门',
-					value: '学员上门'
-				}, {
-					text: '线上辅导',
-					value: '线上辅导'
-				}],
-				// 单选性别数据源
-				sexs: [{
-					text: '男',
-					value: '男'
-				}, {
-					text: '女',
-					value: '女'
-				}, {
-					text: '保密',
-					value: '保密'
-				}],
-				// 单选老师身份
-				identifies: [{
-					text: '不限',
-					value: '不限'
-				}, {
-					text: '专职老师',
-					value: '专职老师'
-				}, {
-					text: '在校大学生',
-					value: '在校大学生'
-				}],
-				educations: [{
-					value: '专科在读',
-					text: '专科在读'
-				}, {
-					value: '专科毕业',
-					text: '专科毕业'
-				}, {
-					value: '本科在读',
-					text: '本科在读'
-				}, {
-					value: '本科毕业',
-					text: '本科毕业'
-				}, {
-					value: '硕士在读',
-					text: '硕士在读'
-				}, {
-					value: '硕士毕业',
-					text: '硕士毕业'
-				}, {
-					value: '博士在读',
-					text: '博士在读'
-				}, {
-					value: '博士毕业',
-					text: '博士毕业'
-				}],
-				// 单选老师性别
-				sexsTeacher: [{
-					text: '不限',
-					value: '不限'
-				}, {
-					text: '男',
-					value: '男'
-				}, {
-					text: '女',
-					value: '女'
-				}],
-				// 单选老师有无照片
-				hasPhotoes: [{
-					text: '不限',
-					value: '不限'
-				}, {
-					text: '有照片',
-					value: '有照片'
-				}]
-			};
-		},
-		created() {
-			this.getPriceAndTree()
-		},
-		methods: {
-			// 手机号
-			async getPhoneNumber(e) {
-				// console.log(e.detail.code)
-				const query = {
-					code: e.detail.code
-				}
-				const { data: result } = await uni.$http.get('/ucenter/mini-program-openid-uid/wxGetPhone', query)
-				if (result.code === 20000) return uni.$showMsg('获取手机成功!')
-			},
-			// 树形结构的课程和价格表
-			async getPriceAndTree() {
-				const {
-					data: result
-				} = await uni.$http.get('/education/course-price/treeAndPrice')
-				this.courseTree = result.data.treeCourse
-			}
-			
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-</style>

+ 66 - 0
education_uni/subpkg/student_require/student_require.vue

@@ -0,0 +1,66 @@
+<template>
+	<view>
+		<uni-swipe-action>
+			<!-- <template v-for="(item, index) in courses" > -->
+				<uni-swipe-action-item :threshold="0" :right-options="options" @click="bindClick()">
+					<view class="requires">
+						<uni-row class="demo-uni-row">
+							<view>需求号:1231411312123131334244</view>
+						</uni-row>
+						<uni-row class="demo-uni-row">
+							<view>需求科目:xxx</view>
+						</uni-row>
+						<uni-row class="demo-uni-row">
+							<uni-col :span="12">
+								<view>需求金额:xxx</view>
+							</uni-col>
+							<uni-col :span="4" >
+								已通过
+							</uni-col>
+							<uni-col :span="4" >
+								未成交
+							</uni-col>
+							<uni-col :span="4" >
+								未锁
+							</uni-col>
+						</uni-row>
+					</view>
+				</uni-swipe-action-item>
+			<!-- </template> -->
+		</uni-swipe-action>
+		
+		<uni-fab  :pattern="pattern" horizontal="left" vertical="bottom"
+					:direction="direction"  @fabClick="fabClick" />
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				options: '上架',
+				pattern: {
+					color: '#7A7E83',
+					backgroundColor: '#fff',
+					selectedColor: '#C00000',
+					buttonColor: '#C00000',
+					iconColor: '#fff'
+				}
+			};
+		},
+		methods: {
+			fabClick() {
+				uni.navigateTo({
+					url: '/subpkg/add_stu_require/add_stu_require'
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+.requires {
+	background-color: #FFF2CC;
+}
+</style>

+ 5 - 5
education_uni/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue

@@ -293,7 +293,7 @@
 		flex-direction: row;
 		align-items: center;
 		border-bottom: solid 1px $uni-border-3;
-		width: 100px;
+		width: 100%;
 		flex: 1;
 		height: 35px;
 
@@ -368,10 +368,10 @@
 		text-align: center;
 		/* border-bottom: solid 1px $uni-border-3; */
 		padding: 0px 10px;
-		width: 100px;
-		white-space: nowrap;
-		overflow: hidden;
-		text-overflow: ellipsis;
+		width: 100%;
+		// white-space: nowrap;
+		// overflow: hidden;
+		// text-overflow: ellipsis;
 	}
 
 	.uni-select__selector-item:hover {