一个番茄酱 2 лет назад
Родитель
Сommit
b30889c86f
29 измененных файлов с 487 добавлено и 70 удалено
  1. 1 1
      education_family/common/common_utils/src/main/java/com/xunwang/commonutils/JwtUtils.java
  2. 1 1
      education_family/common/service_base/src/main/java/com/xunwang/servicebase/handler/GlobalExceptionHandler.java
  3. 8 0
      education_family/service/service-education/src/main/java/com/xunwang/education/controller/TeacherCertificationsController.java
  4. 27 0
      education_family/service/service-education/src/main/java/com/xunwang/education/controller/TeacherCoursesController.java
  5. 6 3
      education_family/service/service-education/src/main/java/com/xunwang/education/entity/TeacherCourses.java
  6. 1 0
      education_family/service/service-education/src/main/java/com/xunwang/education/entity/vo/TeacherList.java
  7. 6 0
      education_family/service/service-education/src/main/java/com/xunwang/education/mapper/TeacherCertificationsMapper.java
  8. 2 0
      education_family/service/service-education/src/main/java/com/xunwang/education/mapper/TeacherCoursesMapper.java
  9. 5 0
      education_family/service/service-education/src/main/java/com/xunwang/education/mapper/xml/TeacherCertificationsMapper.xml
  10. 6 2
      education_family/service/service-education/src/main/java/com/xunwang/education/mapper/xml/TeacherCoursesMapper.xml
  11. 6 0
      education_family/service/service-education/src/main/java/com/xunwang/education/service/TeacherCertificationsService.java
  12. 21 0
      education_family/service/service-education/src/main/java/com/xunwang/education/service/TeacherCoursesService.java
  13. 10 0
      education_family/service/service-education/src/main/java/com/xunwang/education/service/impl/TeacherCertificationsServiceImpl.java
  14. 55 5
      education_family/service/service-education/src/main/java/com/xunwang/education/service/impl/TeacherCoursesServiceImpl.java
  15. 1 1
      education_family/service/service-ucenter/src/main/java/com/xunwang/ucenter/entity/MpOpenidUid.java
  16. 2 2
      education_family/service/service-ucenter/src/main/java/com/xunwang/ucenter/mapper/MiniProgramOpenidUidMapper.java
  17. 2 2
      education_family/service/service-ucenter/src/main/java/com/xunwang/ucenter/service/MiniProgramOpenidUidService.java
  18. 13 13
      education_family/service/service-ucenter/src/main/java/com/xunwang/ucenter/service/impl/MiniProgramOpenidUidServiceImpl.java
  19. 2 2
      education_uni/main.js
  20. 11 2
      education_uni/pages.json
  21. 1 2
      education_uni/pages/my/my.vue
  22. 33 26
      education_uni/pages/teacher/teacher.vue
  23. BIN
      education_uni/static/cancel.png
  24. BIN
      education_uni/static/down.png
  25. BIN
      education_uni/static/up.png
  26. 15 2
      education_uni/subpkg/add_course/add_course.vue
  27. 18 5
      education_uni/subpkg/course_publish/course_publish.vue
  28. 229 0
      education_uni/subpkg/teacher_detail/teacher_detail.vue
  29. 5 1
      education_uni/uni_modules/uni-data-select/components/uni-data-select/uni-data-select.vue

+ 1 - 1
education_family/common/common_utils/src/main/java/com/xunwang/commonutils/JwtUtils.java

@@ -9,7 +9,7 @@ import java.util.Date;
 
 public class JwtUtils {
 
-    public static final long EXPIRE = 1000 * 60 * 60 * 24;
+    public static final long EXPIRE = 1000 * 60 * 60 * 1;
     public static final String APP_SECRET = "5ZNI9^a9FvXZ1K!5Sf@p@C5H";
 
     public static String getJwtToken(String id, String openid){

+ 1 - 1
education_family/common/service_base/src/main/java/com/xunwang/servicebase/handler/GlobalExceptionHandler.java

@@ -34,7 +34,7 @@ public class GlobalExceptionHandler {
     @ResponseBody
     public R error(ExpiredJwtException e) {
         e.printStackTrace();
-        return R.error().message("token过期,请重新登录");
+        return R.error().message("登录过期,请重新登录");
     }
 
     // 自定义异常

+ 8 - 0
education_family/service/service-education/src/main/java/com/xunwang/education/controller/TeacherCertificationsController.java

@@ -67,5 +67,13 @@ public class TeacherCertificationsController {
         return R.error().message("查询认证未知错误!");
     }
 
+    @ApiOperation("根据用户id查询认证相关信息")
+    @GetMapping("findInfosByUid")
+    public R getInfosByUid(HttpServletRequest request) {
+        String uid = request.getParameter("uid");
+        TeacherCertifications one = certificationsService.getInfosByUid(uid);
+        return R.ok().data("one", one);
+    }
+
 }
 

+ 27 - 0
education_family/service/service-education/src/main/java/com/xunwang/education/controller/TeacherCoursesController.java

@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -67,11 +68,37 @@ public class TeacherCoursesController {
         }
     }
 
+    @ApiOperation("查询个人是否有正在审核的课程")
+    @GetMapping("queryPersonVerifyCourse")
+    public R queryPersonVerifyCourse(HttpServletRequest request) {
+        String uid = JwtUtils.getUIdByJwtToken(request);
+        boolean flag = teacherCoursesService.queryPersonVerifyCourse(uid);
+        return R.ok().data("flag", flag);
+    }
+
+    @ApiOperation("查询个人未成交的课程数")
+    @GetMapping("queryPersonNoDeal")
+    public R queryPersonNoDeal(HttpServletRequest request) {
+        String uid = JwtUtils.getUIdByJwtToken(request);
+        int count = teacherCoursesService.queryPersonNoDeal(uid);
+        return R.ok().data("count", count);
+    }
+
     @ApiOperation("查询全部课程")
     @PostMapping("showCourse")
     public R showCourse(@RequestBody TeacherListQuery queryObj) {
         List<TeacherList> teacherLists = teacherCoursesService.queryAllByConditions(queryObj);
         return R.ok().data("course", teacherLists);
     }
+
+    @ApiOperation("查询老师详情总成交次数和最近成交时间")
+    @GetMapping("queryCountAndLastTime")
+    public R queryCountAndLastTime(HttpServletRequest request) {
+        String uid = request.getParameter("uid");
+        System.out.println(uid);
+        Map map = teacherCoursesService.queryCountAndLastTime(uid);
+        return R.ok().data(map);
+    }
+
 }
 

+ 6 - 3
education_family/service/service-education/src/main/java/com/xunwang/education/entity/TeacherCourses.java

@@ -71,15 +71,18 @@ public class TeacherCourses implements Serializable {
     @ApiModelProperty(value = "审核不过原因")
     private String verifyRefuseReason;
 
-    @ApiModelProperty(value = "是否显示,1=是,0=否")
-    @TableLogic(delval = "0", value = "1")
+    @ApiModelProperty(value = "是否显示")
     private String display;
 
-    @ApiModelProperty(value = "是否锁定,1=是,0=否")
+    @ApiModelProperty(value = "是否锁定")
     private String locked;
 
     @ApiModelProperty(value = "已成交,未成交")
     private String deal;
 
+    @ApiModelProperty(value = "0:未删, 1:已删")
+    @TableLogic
+    private String deleted;
+
 
 }

+ 1 - 0
education_family/service/service-education/src/main/java/com/xunwang/education/entity/vo/TeacherList.java

@@ -21,6 +21,7 @@ public class TeacherList implements Serializable {
     private String teacherType;
     private String datetime;
     private String introduce;
+    private String experience;
     private String teachAge;
     private String subject;
     @ApiModelProperty("成交总数")

+ 6 - 0
education_family/service/service-education/src/main/java/com/xunwang/education/mapper/TeacherCertificationsMapper.java

@@ -13,4 +13,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface TeacherCertificationsMapper extends BaseMapper<TeacherCertifications> {
 
+    /**
+     * 根据用户id查询认证相关信息
+     * @param uid
+     * @return
+     */
+    TeacherCertifications getInfosByUid(String uid);
 }

+ 2 - 0
education_family/service/service-education/src/main/java/com/xunwang/education/mapper/TeacherCoursesMapper.java

@@ -23,4 +23,6 @@ public interface TeacherCoursesMapper extends BaseMapper<TeacherCourses> {
 
     // 根据条件查询老师列表
     List<TeacherList> selectTeachers(@Param("obj") TeacherListQuery obj);
+
+    String selectLatest(String uid);
 }

+ 5 - 0
education_family/service/service-education/src/main/java/com/xunwang/education/mapper/xml/TeacherCertificationsMapper.xml

@@ -2,4 +2,9 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.xunwang.education.mapper.TeacherCertificationsMapper">
 
+    <select id="getInfosByUid" resultType="teacherCertifications">
+        select tc.school, tc.major, tc.native_place, tc.education
+        from teacher_certifications tc
+        where uid = #{uid};
+    </select>
 </mapper>

+ 6 - 2
education_family/service/service-education/src/main/java/com/xunwang/education/mapper/xml/TeacherCoursesMapper.xml

@@ -11,7 +11,7 @@
     </insert>
 
     <select id="selectTeachers" resultType="teacherList">
-        select tcou.uid ,tcou.introduce, tcou.teach_age, tcou.datetime, tcou.subject, tcou.teacher_type, tc.name
+        select tcou.uid ,tcou.introduce, tcou.teach_age, tcou.datetime, tcou.subject, tcou.teacher_type, tcou.experience, tc.name
         from teacher_courses tcou join teacher_certifications tc
         on tcou.uid = tc.uid
         <where>
@@ -33,8 +33,12 @@
             <if test="obj.mode != null and obj.mode != ''">
                 tcou.mode = #{obj.mode}
             </if>
-            and tcou.display = "1" and tcou.deal = "未成交"
+            and tcou.display = "上架" and tcou.deal = "未成交" and tcou.deleted = "0" and tcou.verify_status = "已通过"
         </where>
         limit #{obj.pageNum}, #{obj.pageSize}
     </select>
+    
+    <select id="selectLatest" resultType="java.lang.String">
+        select tc.datetime from teacher_courses tc where deal = '已成交' and uid = #{uid} order by datetime desc limit 1;
+    </select>
 </mapper>

+ 6 - 0
education_family/service/service-education/src/main/java/com/xunwang/education/service/TeacherCertificationsService.java

@@ -19,4 +19,10 @@ public interface TeacherCertificationsService extends IService<TeacherCertificat
      * @return
      */
     String getTeacherType(String uid);
+
+    /**
+     * 根据用户id查询认证相关信息
+     * @param uid
+     */
+    TeacherCertifications getInfosByUid(String uid);
 }

+ 21 - 0
education_family/service/service-education/src/main/java/com/xunwang/education/service/TeacherCoursesService.java

@@ -7,6 +7,7 @@ import com.xunwang.education.entity.vo.TeacherList;
 import com.xunwang.education.entity.vo.TeacherListQuery;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * <p>
@@ -46,4 +47,24 @@ public interface TeacherCoursesService extends IService<TeacherCourses> {
      * @return
      */
     List<TeacherList> queryAllByConditions(TeacherListQuery queryObj);
+
+    /**
+     * 查询个人是否有正在审核的课程
+     * @param uid
+     * @return
+     */
+    boolean queryPersonVerifyCourse(String uid);
+
+    /**
+     * 查询个人未成交的课程数
+     * @param uid
+     * @return
+     */
+    int queryPersonNoDeal(String uid);
+
+    /**
+     * 查询老师详情总成交次数和最近成交时间
+     * @param uid
+     */
+    Map queryCountAndLastTime(String uid);
 }

+ 10 - 0
education_family/service/service-education/src/main/java/com/xunwang/education/service/impl/TeacherCertificationsServiceImpl.java

@@ -33,4 +33,14 @@ public class TeacherCertificationsServiceImpl extends ServiceImpl<TeacherCertifi
             return "专职教员";
         }
     }
+
+    /**
+     * 根据用户id查询认证相关信息
+     * @param uid
+     */
+    @Override
+    public TeacherCertifications getInfosByUid(String uid) {
+        TeacherCertifications one = baseMapper.getInfosByUid(uid);
+        return one;
+    }
 }

+ 55 - 5
education_family/service/service-education/src/main/java/com/xunwang/education/service/impl/TeacherCoursesServiceImpl.java

@@ -15,10 +15,8 @@ import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
+import javax.management.Query;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -91,7 +89,7 @@ public class TeacherCoursesServiceImpl extends ServiceImpl<TeacherCoursesMapper,
     @Override
     public List<TeacherCourses> showPersonCourse(String uid) {
         QueryWrapper<TeacherCourses> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("uid", uid).eq("display", "1").eq("verify_status", "1");
+        queryWrapper.eq("uid", uid).eq("deleted", "0").eq("verify_status", "已通过").orderByDesc("datetime").last("limit 9");
         List<TeacherCourses> teacherCourses = baseMapper.selectList(queryWrapper);
         return teacherCourses;
     }
@@ -114,8 +112,60 @@ public class TeacherCoursesServiceImpl extends ServiceImpl<TeacherCoursesMapper,
      */
     @Override
     public List<TeacherList> queryAllByConditions(TeacherListQuery queryObj) {
+        queryObj.setPageNum((queryObj.getPageNum() - 1) * queryObj.getPageSize());
         List<TeacherList> teacherLists = baseMapper.selectTeachers(queryObj);
 
         return teacherLists;
     }
+
+    /**
+     * 查询个人是否有正在审核的课程
+     * @param uid
+     * @return
+     */
+    @Override
+    public boolean queryPersonVerifyCourse(String uid) {
+        QueryWrapper<TeacherCourses> queryWrapper = new QueryWrapper();
+        queryWrapper.eq("verify_status", "审核中");
+        int count = count(queryWrapper);
+        if (count > 0) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 查询个人未成交的课程数
+     * @param uid
+     * @return
+     */
+    @Override
+    public int queryPersonNoDeal(String uid) {
+        return count(new QueryWrapper<TeacherCourses>().eq("deal", "未成交"));
+    }
+
+    /**
+     * 查询老师详情总成交次数和最近成交时间
+     * @param uid
+     */
+    @Override
+    public Map queryCountAndLastTime(String uid) {
+        // 1.查询总成交次数
+        int count = count(new QueryWrapper<TeacherCourses>().eq("deal", "已成交").eq("uid", uid));
+        // 2.最近成交
+        String latest = baseMapper.selectLatest(uid);
+        String time = "";
+        if (latest == null) {
+            time = "暂无";
+        } else {
+            String[] strings = latest.split(" ");
+            time = strings[0];
+        }
+
+        HashMap<String, Object> hashMap = new HashMap<>();
+        hashMap.put("count", count);
+        hashMap.put("time", time);
+
+        return hashMap;
+    }
 }

+ 1 - 1
education_family/service/service-ucenter/src/main/java/com/xunwang/ucenter/entity/MiniProgramOpenidUid.java → education_family/service/service-ucenter/src/main/java/com/xunwang/ucenter/entity/MpOpenidUid.java

@@ -25,7 +25,7 @@ import lombok.experimental.Accessors;
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
 @ApiModel(value="MiniProgramOpenidUid对象", description="小程序用户表")
-public class MiniProgramOpenidUid implements Serializable {
+public class MpOpenidUid implements Serializable {
 
     private static final long serialVersionUID = 1L;
 

+ 2 - 2
education_family/service/service-ucenter/src/main/java/com/xunwang/ucenter/mapper/MiniProgramOpenidUidMapper.java

@@ -1,6 +1,6 @@
 package com.xunwang.ucenter.mapper;
 
-import com.xunwang.ucenter.entity.MiniProgramOpenidUid;
+import com.xunwang.ucenter.entity.MpOpenidUid;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @author Long
  * @since 2022-11-09
  */
-public interface MiniProgramOpenidUidMapper extends BaseMapper<MiniProgramOpenidUid> {
+public interface MiniProgramOpenidUidMapper extends BaseMapper<MpOpenidUid> {
 
 }

+ 2 - 2
education_family/service/service-ucenter/src/main/java/com/xunwang/ucenter/service/MiniProgramOpenidUidService.java

@@ -1,6 +1,6 @@
 package com.xunwang.ucenter.service;
 
-import com.xunwang.ucenter.entity.MiniProgramOpenidUid;
+import com.xunwang.ucenter.entity.MpOpenidUid;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 import javax.servlet.http.HttpServletRequest;
@@ -14,7 +14,7 @@ import java.util.Map;
  * @author Long
  * @since 2022-11-09
  */
-public interface MiniProgramOpenidUidService extends IService<MiniProgramOpenidUid> {
+public interface MiniProgramOpenidUidService extends IService<MpOpenidUid> {
 
     /**
      * 获取用户openid,unionid等

+ 13 - 13
education_family/service/service-ucenter/src/main/java/com/xunwang/ucenter/service/impl/MiniProgramOpenidUidServiceImpl.java

@@ -8,7 +8,7 @@ import com.xunwang.commonutils.JwtUtils;
 import com.xunwang.commonutils.RandomNameUtils;
 import com.xunwang.commonutils.ResultCode;
 import com.xunwang.servicebase.exception.XunwangException;
-import com.xunwang.ucenter.entity.MiniProgramOpenidUid;
+import com.xunwang.ucenter.entity.MpOpenidUid;
 import com.xunwang.ucenter.mapper.MiniProgramOpenidUidMapper;
 import com.xunwang.ucenter.service.MiniProgramOpenidUidService;
 import com.xunwang.ucenter.utils.HttpClientUtils;
@@ -30,7 +30,7 @@ import java.util.Map;
  * @since 2022-11-09
  */
 @Service
-public class MiniProgramOpenidUidServiceImpl extends ServiceImpl<MiniProgramOpenidUidMapper, MiniProgramOpenidUid> implements MiniProgramOpenidUidService {
+public class MiniProgramOpenidUidServiceImpl extends ServiceImpl<MiniProgramOpenidUidMapper, MpOpenidUid> implements MiniProgramOpenidUidService {
 
     @Autowired
     private RedisTemplate<String, Object> redisTemplate;
@@ -62,13 +62,13 @@ public class MiniProgramOpenidUidServiceImpl extends ServiceImpl<MiniProgramOpen
         String ip = getIp(request);
         String city = LocationUtils.getRegionFromIp(ip);
 
-        MiniProgramOpenidUid user = baseMapper.selectOne(new QueryWrapper<MiniProgramOpenidUid>().eq("openid", openid));
+        MpOpenidUid user = baseMapper.selectOne(new QueryWrapper<MpOpenidUid>().eq("openid", openid));
         String alias = "";
         String avatar = "";
         if (user == null) {
             // 新用户注册
             avatar = "https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0";
-            user = new MiniProgramOpenidUid();
+            user = new MpOpenidUid();
             alias = RandomNameUtils.generateName();
             user.setOpenid(openid).setUnionid(unionid).setAlias(alias).setCity(city);
             baseMapper.insert(user);
@@ -102,11 +102,11 @@ public class MiniProgramOpenidUidServiceImpl extends ServiceImpl<MiniProgramOpen
      */
     @Override
     public void editAlias(String uid, String alias, String avatar) {
-        MiniProgramOpenidUid miniProgramOpenidUid = new MiniProgramOpenidUid();
-        miniProgramOpenidUid.setAlias(alias);
-        miniProgramOpenidUid.setUid(uid);
-        miniProgramOpenidUid.setAvatar(avatar);
-        int count = baseMapper.updateById(miniProgramOpenidUid);
+        MpOpenidUid mpOpenidUid = new MpOpenidUid();
+        mpOpenidUid.setAlias(alias);
+        mpOpenidUid.setUid(uid);
+        mpOpenidUid.setAvatar(avatar);
+        int count = baseMapper.updateById(mpOpenidUid);
         if (count != 1) {
             throw new XunwangException(ResultCode.ERROR, "更新昵称失败!");
         }
@@ -141,12 +141,12 @@ public class MiniProgramOpenidUidServiceImpl extends ServiceImpl<MiniProgramOpen
         String phone = phone_info.get("phoneNumber").toString();
 
         // 存入数据库
-        QueryWrapper<MiniProgramOpenidUid> queryWrapper = new QueryWrapper();
+        QueryWrapper<MpOpenidUid> queryWrapper = new QueryWrapper();
         queryWrapper.eq("uid", uid);
-        MiniProgramOpenidUid miniProgramOpenidUid = baseMapper.selectOne(queryWrapper);
-        miniProgramOpenidUid.setPhone(phone);
+        MpOpenidUid mpOpenidUid = baseMapper.selectOne(queryWrapper);
+        mpOpenidUid.setPhone(phone);
 
-        int i = this.baseMapper.updateById(miniProgramOpenidUid);
+        int i = this.baseMapper.updateById(mpOpenidUid);
         if (i != 1) {
             throw new XunwangException(ResultCode.ERROR, "更新手机号失败");
         }

+ 2 - 2
education_uni/main.js

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

+ 11 - 2
education_uni/pages.json

@@ -21,7 +21,7 @@
             "path" : "pages/teacher/teacher",
             "style" :                                                                                    
             {
-				"navigationBarTitleText": "找老师",
+				// "navigationBarTitleText": "",
                 "enablePullDownRefresh": false,
 				"onReachBottomDistance": 150
             }
@@ -99,7 +99,16 @@
                     "path" : "add_course/add_course",
                     "style" :                                                                                    
                 {
-                    "navigationBarTitleText": "",
+                    "navigationBarTitleText": "新增课程",
+                    "enablePullDownRefresh": false
+                }
+                
+                }
+                ,{
+                    "path" : "teacher_detail/teacher_detail",
+                    "style" :                                                                                    
+                {
+                    "navigationBarTitleText": "老师详情",
                     "enablePullDownRefresh": false
                 }
                 

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

@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<!-- 用户未登录时,显示登录组件 -->
-		<my-login v-if="!token"></my-login>
+		<my-login v-if="!token || token === ''"></my-login>
 		
 		<!-- 用户登录后,显示用户信息组件 -->
 		<my-userinfo v-else></my-userinfo>
@@ -20,7 +20,6 @@
 			};
 		},
 		onReady() {
-			console.log("onready")
 			this.findVerifyStatus()
 		},
 		onHide() {

+ 33 - 26
education_uni/pages/teacher/teacher.vue

@@ -3,26 +3,28 @@
 		<view class="head">
 			<uni-row>
 				<uni-col :span="3">
-					<image src="../../static/teachers.png"></image>
+					<view class="img-head">
+						<image src="../../static/teachers.png"></image>
+					</view>
 				</uni-col>
 				<uni-col :span="21">
-					<view class="title-head">
+					<view class="title-head"  @click="switchIcon">
 						<uni-title type="h4" title="找老师"></uni-title>
-						<uni-icons :type="iconType" size="20" @click="switchIcon"></uni-icons>
+						<uni-icons :type="iconType" size="20"></uni-icons>
 					</view>
 				</uni-col>
 			</uni-row>
 			
 			<view v-if="content">
 				<view class="content">
-					<uni-data-select v-model="queryObject.course" :localdata="educations" placeholder="课程详情"/>
-					<uni-data-select v-model="queryObject.identify" :localdata="identifies" placeholder="老师身份" />
-					<uni-data-select v-model="queryObject.education" :localdata="educations" placeholder="老师学历" />
+					<uni-data-select class="ff" v-model="queryObject.course" :localdata="educations" placeholder="课程详情"/>
+					<uni-data-select class="ff" v-model="queryObject.identify" :localdata="identifies" placeholder="老师身份" />
+					<uni-data-select class="ff" v-model="queryObject.education" :localdata="educations" placeholder="老师学历" />
 				</view>
 				<view class="content, content2">
-					<uni-data-select v-model="queryObject.sex" :localdata="sexs" placeholder="老师性别" />
-					<uni-data-select v-model="queryObject.school" :localdata="schools" placeholder="毕业学校" />
-					<uni-data-select v-model="queryObject.mode" :localdata="modes" placeholder="老师照片" />
+					<uni-data-select class="ff" v-model="queryObject.sex" :localdata="sexs" placeholder="老师性别" />
+					<uni-data-select class="ff" v-model="queryObject.school" :localdata="schools" placeholder="毕业学校" />
+					<uni-data-select class="ff" v-model="queryObject.mode" :localdata="modes" placeholder="老师照片" />
 				</view>
 			</view>
 		</view>
@@ -32,7 +34,7 @@
 		
 		<view v-if="!isSearch">没有找到符合条件的信息</view>
 		<view v-if="isSearch">
-			<view class="teachInfo" bindtap="toTeachDetail" v-for="(item, index) in teacherList" :key="index" >
+			<view class="teachInfo" @click="toTeachDetail(item)" v-for="(item, index) in teacherList" :key="index" >
 				<image class="teachImg" mode="widthFix" src="../../static/zly.jpeg"></image>
 				<view class="introduce">
 					<text class="teachName">{{item.name}}老师</text>
@@ -42,14 +44,6 @@
 						<text class="teachAgeIcon">龄</text>
 						<text class="teachYears">{{item.teachAge}}年教龄</text>
 					</view>
-					<view class="transactionContainer">
-						<text class="transaction">成</text>
-						<text class="transactionTotal">{{item.count || '0'}}条家教记录</text>
-					</view>
-					<view class="transactionList">
-						<text>最新接单:</text>
-						<text>{{item.latest || '无'}}</text>
-					</view>
 					<view class="courseList">
 						<text>可授课科目:</text>
 						<text>{{item.subject}}</text>
@@ -161,6 +155,13 @@
 			this.getTeacherList()
 		},
 		methods: {
+			// 老师细节
+			toTeachDetail(item) {
+				let teacher = JSON.stringify(item)
+				uni.navigateTo({
+					url: '/subpkg/teacher_detail/teacher_detail?item='+teacher
+				})
+			},
 			// 展开搜索栏
 			switchIcon() {
 				if (this.iconType === 'bottom') {
@@ -201,14 +202,13 @@
 <style scoped lang="scss">
 	.head {
 		
-		position: sticky;
-		top: 0;
-		z-index: 999;
+		// position: sticky;
+		// top: 0;
+		// z-index: 999;
 		
 		image {
-			// display: block;
-			width: 80rpx;
 			height: 80rpx;
+			width: 80rpx;
 		}
 		
 		.title-head {
@@ -220,17 +220,23 @@
 		.content {
 			display: flex;
 			justify-content: space-around;
+			
+			.ff {
+				width: 100px;
+			}
 		}
 		
 		.content2 {
-			margin-top: 20rpx;
+			margin-top: 10rpx;
+			padding-bottom: 10rpx;
 		}
+		
 	}
 	
 	/* 搜索区下方的隔离区 */
 	.interval{
 	    height: 5rpx;
-	    margin-top: 20rpx;
+	    // margin-top: 20rpx;
 	    background-color: gray;
 	}
 	
@@ -329,8 +335,9 @@
 	}
 	/* 自我介绍的内容 */
 	.introduceDetail text {
+		white-space: nowrap;
 	    overflow: hidden;
-	    text-overflow: ellipsis;
+		text-overflow: ellipsis;
 	    display: -webkit-box;
 	    /*设置对齐模式*/
 	    -webkit-box-orient: vertical;

BIN
education_uni/static/cancel.png


BIN
education_uni/static/down.png


BIN
education_uni/static/up.png


+ 15 - 2
education_uni/subpkg/add_course/add_course.vue

@@ -46,6 +46,7 @@
 		},
 		data() {
 			return {
+				countNoDeal: 1,
 				confirmText: '',
 				// 表单数据
 				baseFormData: {
@@ -125,13 +126,21 @@
 			};
 		},
 		created() {
-			this.getPriceAndTree()
+			this.getPriceAndTree(),
+			this.queryNoDealCourse()
 		},
 		mounted() {
 			this.openDialog()
 		},
 		methods: {
 			...mapMutations('m_user', ['updateAuthentication']),
+			// 查询未成交的课程
+			async queryNoDealCourse() {
+				const {
+					data: result1
+				} = await uni.$http.get('/education/teacher-courses/queryPersonNoDeal')
+				this.countNoDeal = result1.data.count
+			},
 			// 打开对话框
 			openDialog() {
 				if (this.authentication === '正在审核中…') {
@@ -163,7 +172,7 @@
 			getLocation() {
 				wx.choosePoi({
 					success: res => {
-						console.log(res)
+						// console.log(res)
 						if (res.type === 0) {
 							// 不显示位置
 							this.baseFormData.location = ''
@@ -198,6 +207,10 @@
 				this.courseTree = result.data.treeCourse
 			},
 			submit(ref) {
+				const remain = 4 - this.countNoDeal
+				if (this.dynamicsLists.length > remain - 1) {
+					return uni.$showMsg(`还剩${remain}门课程可以发布`, 2000)
+				}
 				for (let i = 1; i <= this.dynamicsLists.length + 1; i++) {
 					if (this.baseFormData.subject[i] === '1') {
 						return uni.$showMsg('请选择授课科目' + i)

+ 18 - 5
education_uni/subpkg/course_publish/course_publish.vue

@@ -8,7 +8,7 @@
 						<!-- 显示圆形头像 -->
 						<uni-list-chat :avatar-circle="true" :title="item.subject"
 							:avatar="item.image"
-							:note="item.introduce" :time="item.datetime"></uni-list-chat>
+							:note="item.deal" :time="item.datetime"></uni-list-chat>
 					</uni-list>
 				</uni-swipe-action-item>
 			</template>
@@ -50,8 +50,22 @@
 		},
 		methods: {
 			// 点击悬浮按钮
-			fabClick() {
-				if (this.courses.length === 4) return uni.$showMsg('最多发布4门课程')
+			async fabClick() {
+				// 查询是否有正在审核的课程
+				const {
+					data: result
+				} = await uni.$http.get('/education/teacher-courses/queryPersonVerifyCourse')
+				if (result.data.flag) {
+					return uni.$showMsg("正在审核中,请耐心等候")
+				}
+				
+				// 查询未成交的课程
+				const {
+					data: result1
+				} = await uni.$http.get('/education/teacher-courses/queryPersonNoDeal')
+				if (result1.data.count >= 4) {
+					return uni.$showMsg("最多同时发布4门课程")
+				}
 				uni.navigateTo({
 					url:'/subpkg/add_course/add_course'
 				})
@@ -65,7 +79,7 @@
 						let dateArray = this.courses[i].datetime.split(' ')
 						this.courses[i].datetime = dateArray[0]
 						this.courses[i].image = '/static/c' + (i+1) +'.png'
-						// console.log(this.courses[i])
+						console.log(this.courses[i])
 					}
 				}
 			},
@@ -84,5 +98,4 @@
 </script>
 
 <style scoped lang="scss">
-
 </style>

+ 229 - 0
education_uni/subpkg/teacher_detail/teacher_detail.vue

@@ -0,0 +1,229 @@
+<template>
+	<view>
+		<view class="teachDeatil">
+		    <view class="head">
+		        <image class="teachImg" mode="widthFix" src="{{teachDetail[0].imgUrl || (teachDetail[3].sex == '男' ? '../../images/boy.png' : '../../images/girl.png')}}"></image>
+		        
+		        <view class="headDetail">
+		            <text class="teachName">{{teacherCourse.name}}老师</text>
+		            <text class="attribute">身份:{{teacherCourse.teacherType}}</text>
+		            <view class="transactionContainer">
+		            	<text class="transaction">成</text>
+		            	<text class="transactionTotal">{{teacherCourse.count}}条家教记录</text>
+		            </view>
+		            <view class="transactionList">
+		            	<text>最新接单:</text>
+		            	<text>{{teacherCourse.latest}}</text>
+		            </view>
+		        </view>
+				
+		    </view>
+		    <view class="midArea">
+		        <text>高校:{{teacherCourse.school}}</text>
+		        <text>专业:{{teacherCourse.major}}</text>
+		        <text>学历:{{teacherCourse.education}}</text>
+		        <text>籍贯:{{teacherCourse.nativePlace}}</text>
+		    </view>
+		    <view class="course">
+		        <text>可授科目:</text>
+		        <view class="courseList">{{teacherCourse.subject}}</view>
+		    </view>
+			<view class="introduceDetail">
+			    <text class="introduce-title">自我介绍</text>
+			    <text class="introduce-body">{{teacherCourse.introduce}}</text>
+			</view>
+		    <view class="introduceDetail">
+		        <text class="introduce-title">成功经验</text>
+		        <text class="introduce-body">{{teacherCourse.experience}}</text>
+		    </view>
+		</view>
+		
+		<!-- 底部功能区 -->
+		<view class="bottomContainer">
+		    <view class="myCollect" bindtap="toStuCollectionTeach">我收藏的老师</view>
+		    <view class="collection" wx:if="{{!teachDetail[15].collection}}" bindtap="collectTeacher">
+		        加入收藏
+		    </view>
+		    <view class="collection" wx:else>
+		        已收藏
+		    </view>
+		    <view class="inviteTeach">预约老师</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				teacherCourse: ''
+			};
+		},
+		onLoad(option) {
+			this.teacherCourse = JSON.parse(option.item)
+			this.getCountAndLastTime()
+			this.getInfosByUid()
+			console.log(this.teacherCourse)
+		},
+		methods:{
+			// 获取最近成交时间和成交次数
+			async getCountAndLastTime() {
+				const query = {
+					uid: this.teacherCourse.uid
+				}
+				const { data: result } = await uni.$http.get('/education/teacher-courses/queryCountAndLastTime', query)
+				this.teacherCourse.count = result.data.count
+				this.teacherCourse.latest = result.data.time
+			},
+			// 根据uid获取该老师学校学历等
+			async getInfosByUid() {
+				const { data: result } = await uni.$http.get('/education/teacher-certifications/findInfosByUid', { uid: this.teacherCourse.uid })
+				this.teacherCourse.education = result.data.one.education
+				this.teacherCourse.major = result.data.one.major
+				this.teacherCourse.nativePlace = result.data.one.nativePlace
+				this.teacherCourse.school = result.data.one.school
+			}
+			
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+/* 整个页面样式 */
+.teachDeatil{
+    display: flex;
+    position: relative;
+    flex-direction: column;
+    margin-left: 20rpx;
+}
+.head{
+    display: flex;
+}
+.headDetail{
+    margin-left: 20rpx;
+    display: flex;
+    flex-direction: column;
+    font-size: 28rpx;
+}
+.teachName{
+    font-weight: bold;
+}
+.headDetail text{
+    padding-bottom: 10rpx;
+}
+/* 头像设置 */
+.teachImg{
+    width: 200rpx;
+}
+.settledDay{
+    display: block;
+    float: right;
+}
+
+/* 中部区域 */
+.midArea{
+    display: flex;
+    /* border: 1rpx solid red; */
+    width: 96%;
+    margin-top: 10rpx;
+    justify-content: space-between;
+    flex-wrap: wrap;
+}
+.midArea text{
+    /* display: block; */
+    width: 48%;
+    height: 60rpx;
+    line-height: 60rpx;
+    font-size: 28rpx;
+}
+
+/* 可授课程 */
+.course{
+    margin-top: 40rpx;
+}
+.courseList{
+    margin-top: 10rpx;
+}
+
+/* 可授课区域 */
+.teachAera{
+    margin-top: 40rpx;
+}
+.teachAreaDetail{
+    margin-top: 10rpx;
+}
+
+/* 自我介绍及案例 */
+.introduceDetail{
+    display: flex;
+    flex-direction: column;
+    margin-top: 40rpx;
+}
+.introduce-title{
+    margin-bottom: 20rpx;
+    color: yellowgreen;
+    font-weight: bold;
+}
+.introduce-body{
+    line-height: 50rpx;
+    font-size: 28rpx;
+}
+
+/* 底部区域 */
+.bottomContainer{
+    width: 99%;
+    display: flex;
+    position: absolute;
+    bottom: 50rpx;
+    /* background-color: #bfa; */
+    /* border: 1rpx solid red; */
+    justify-content: space-around;
+}
+
+.myCollect,
+.collection,
+.inviteTeach{
+    width: 30%;
+    height: 60rpx;
+    line-height: 60rpx;
+    font-weight: bold;
+    border: 1rpx solid red;
+    border-radius: 30rpx;
+    text-align: center;
+}
+/* 我收藏的老师 */
+.myCollect{
+    color: red;
+    /* background-color: blue; */
+}
+/* 收藏老师 */
+.collection{
+    color: yellowgreen;
+}
+/* 邀请老师 */
+.inviteTeach{
+    color: pink;
+}
+/* 成交记录 */
+	.transactionContainer {
+	    margin-top: 10rpx;
+	    display: flex;
+	}
+	/* 成交记录标签的背景色 */
+	.transaction {
+	    background-color: rgba(0, 128, 0, .6);
+	}
+	/* 教龄和成交记录标签后的文字 */
+	.teachYears,
+	.transactionTotal {
+	    font-size: 24rpx;
+	    margin-left: 10rpx;
+	}
+	
+	/* 最新接单 */
+	.transactionList {
+	    margin-top: 10rpx;
+	    color: green;
+	    font-size: 24rpx;
+	}
+</style>

+ 5 - 1
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: 100%;
+		width: 100px;
 		flex: 1;
 		height: 35px;
 
@@ -368,6 +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;
 	}
 
 	.uni-select__selector-item:hover {