소스 검색

Guan1邀请+被邀请

BophGuan 2 년 전
부모
커밋
7053de1452
24개의 변경된 파일546개의 추가작업 그리고 54개의 파일을 삭제
  1. 3 0
      education_family/pom.xml
  2. 23 0
      education_family/service/pom.xml
  3. 164 0
      education_family/service/service-education/src/main/java/com/xunwang/education/controller/HomeController.java
  4. 5 5
      education_family/service/service-education/src/main/java/com/xunwang/education/controller/MyFavoriteNeedsController.java
  5. 6 0
      education_family/service/service-education/src/main/java/com/xunwang/education/controller/TeacherCoursesController.java
  6. 1 1
      education_family/service/service-education/src/main/java/com/xunwang/education/entity/TeacherCourses.java
  7. 46 0
      education_family/service/service-education/src/main/java/com/xunwang/education/entity/vo/FavoriteCourseVo.java
  8. 4 0
      education_family/service/service-education/src/main/java/com/xunwang/education/mapper/TeacherCertificationsMapper.java
  9. 4 0
      education_family/service/service-education/src/main/java/com/xunwang/education/mapper/TeacherCoursesMapper.java
  10. 14 0
      education_family/service/service-education/src/main/java/com/xunwang/education/mapper/xml/TeacherCertificationsMapper.xml
  11. 8 0
      education_family/service/service-education/src/main/java/com/xunwang/education/mapper/xml/TeacherCoursesMapper.xml
  12. 4 0
      education_family/service/service-education/src/main/java/com/xunwang/education/service/TeacherCertificationsService.java
  13. 5 0
      education_family/service/service-education/src/main/java/com/xunwang/education/service/TeacherCoursesService.java
  14. 8 0
      education_family/service/service-education/src/main/java/com/xunwang/education/service/impl/TeacherCertificationsServiceImpl.java
  15. 11 0
      education_family/service/service-education/src/main/java/com/xunwang/education/service/impl/TeacherCoursesServiceImpl.java
  16. 1 1
      education_family/service/service-education/src/test/java/com/xunwang/education/CodeGenerator.java
  17. 0 1
      education_family/service/service-file/src/main/java/com/xunwang/file/controller/FileUpload.java
  18. 5 5
      education_family/service/service-ucenter/src/test/java/com/xunwang/ucenter/CodeGenerator.java
  19. 1 1
      education_uni/App.vue
  20. 34 34
      education_uni/components/my-login/my-login.vue
  21. 3 3
      education_uni/components/my-userinfo/my-userinfo.vue
  22. 1 1
      education_uni/main.js
  23. 36 0
      education_uni/pages.json
  24. 159 2
      education_uni/subpkg/my_invite/my_invite.vue

+ 3 - 0
education_family/pom.xml

@@ -120,6 +120,9 @@
                 <artifactId>commons-lang</artifactId>
                 <version>${commons-lang.version}</version>
             </dependency>
+
+
+
         </dependencies>
     </dependencyManagement>
 

+ 23 - 0
education_family/service/pom.xml

@@ -40,6 +40,7 @@
 		<dependency>
 			<groupId>mysql</groupId>
 			<artifactId>mysql-connector-java</artifactId>
+			<version>8.0.19</version>
 		</dependency>
 		<!-- velocity 模板引擎, Mybatis Plus 代码生成器需要 -->
 		<dependency>
@@ -85,6 +86,28 @@
 			<groupId>junit</groupId>
 			<artifactId>junit</artifactId>
 		</dependency>
+
+		<dependency>
+			<groupId>javax.xml.bind</groupId>
+			<artifactId>jaxb-api</artifactId>
+			<version>2.3.0</version>
+		</dependency>
+		<dependency>
+			<groupId>com.sun.xml.bind</groupId>
+			<artifactId>jaxb-impl</artifactId>
+			<version>2.3.0</version>
+		</dependency>
+		<dependency>
+			<groupId>com.sun.xml.bind</groupId>
+			<artifactId>jaxb-core</artifactId>
+			<version>2.3.0</version>
+		</dependency>
+		<dependency>
+			<groupId>javax.activation</groupId>
+			<artifactId>activation</artifactId>
+			<version>1.1.1</version>
+		</dependency>
+
 	</dependencies>
 
 	<build>

+ 164 - 0
education_family/service/service-education/src/main/java/com/xunwang/education/controller/HomeController.java

@@ -0,0 +1,164 @@
+package com.xunwang.education.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.xunwang.commonutils.R;
+import com.xunwang.education.entity.TeacherCertifications;
+import com.xunwang.education.entity.TeacherCourses;
+import com.xunwang.education.entity.vo.TeacherViewCountVo;
+import com.xunwang.education.service.TeacherCertificationsService;
+import com.xunwang.education.service.TeacherCoursesService;
+import io.swagger.annotations.ApiOperation;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.*;
+
+/**
+ * @author Guan
+ * @date 2023/1/11
+ * discription
+ */
+@RestController
+@RequestMapping("/education/home")
+@EnableScheduling
+public class HomeController {
+
+    @Autowired
+    private TeacherCoursesService teacherCoursesService;
+
+    @Autowired
+    private TeacherCertificationsService teacherCertificationsService;
+
+    @Autowired
+    private RedisTemplate redisTemplate;
+
+    //获取课程id和对应的点击量
+//    @Scheduled(cron = "*/5 * * * * ?")
+    @GetMapping("/getTeacherCourseViewCount")
+    public void getTeacherCourseViewCount(){
+        List<TeacherCourses> list = teacherCoursesService.list(null);
+        System.out.println(list);
+        for (int i = 0; i < list.size(); i++) {
+            String courseId = list.get(i).getCourseId().toString();
+            redisTemplate.opsForZSet().add("viewCount",courseId,list.get(i).getViewedCount());
+        }
+    }
+
+    @ApiOperation("获取每个老师的总点击量,并存入redis")
+    @GetMapping("/showPopularTeacher")
+    public void showPopularTeacher(){
+        String keyModel = "viewCount";
+        QueryWrapper<TeacherCertifications> wrapper = new QueryWrapper<>();
+        wrapper.eq("deleted",0 );
+        wrapper.eq("verify_status","已通过" );
+        List<TeacherCertifications> list = teacherCertificationsService.list(wrapper);//老师列表
+//        TreeMap<String, Double> idAndScore = new TreeMap<>();
+        Double score = 0.0;
+        for (int i = 0; i < list.size(); i++) {
+            List<TeacherCourses> coursesList = teacherCoursesService.getTeacherCourseId(list.get(i).getUid());//根据一个老师的Uid查询出所有课程
+            for (int j = 0; j < coursesList.size(); j++) {
+                score = score + redisTemplate.opsForZSet().score(keyModel, coursesList.get(j).getCourseId()) ;
+            }
+//            idAndScore.put(list.get(i).getUid(),score);
+            redisTemplate.opsForZSet().add("teacherAllCount",list.get(i).getUid(),score);
+            score = 0.0;
+        }
+    }
+
+    @GetMapping("/getHottestTeacher")
+    public R getHottestTeacher(){
+
+        Set teacherAllCount = redisTemplate.opsForZSet().reverseRange("teacherAllCount", 0, -1);
+        String[] array = (String[])teacherAllCount.toArray(new String[teacherAllCount.size()]);
+        for (int i = 0; i < array.length; i++) {
+            System.out.println(array[i]);
+        }
+        List<TeacherCertifications> teacherDetail = teacherCertificationsService.getTeacherDetail(array);
+        System.out.println(teacherDetail);
+        return R.ok().data("list",teacherDetail);
+    }
+
+
+
+    @GetMapping("addTest")
+    public void setOneValue(){
+        String keyModel = "viewCount";
+        String ss = "139009318069469189";
+        String teacherUid = "";
+        Double aDouble = redisTemplate.opsForZSet().incrementScore(keyModel, ss, 1);
+        Double aDouble2 = redisTemplate.opsForZSet().incrementScore("teacherAllCount", teacherUid, 1);
+        System.out.println(aDouble);
+    }
+
+
+//    @Scheduled(cron = "*/5 * * * * ?")
+    @GetMapping("return")
+    public void returnDb(){
+        String keyModel = "viewCount";
+        Long size = redisTemplate.opsForZSet().size(keyModel);
+        Set range = redisTemplate.opsForZSet().range(keyModel, 0, size - 1);
+
+        String[] array = (String[]) range.toArray(new String[range.size()]);
+
+        TeacherCourses updateVo = new TeacherCourses();
+
+
+        for (int i = 0; i < size; i++) {
+            QueryWrapper<TeacherCourses> wrapper = new QueryWrapper<>();
+            Double score = redisTemplate.opsForZSet().score(keyModel, array[i]);
+            int intValue = score.intValue();
+            updateVo.setViewedCount(intValue);
+            updateVo.setCourseId(array[i]);
+            wrapper.eq("course_id",array[i]);
+            teacherCoursesService.update(updateVo,wrapper);
+
+        }
+        System.gc();
+    }
+
+//
+//    //获取老师id和对应的点击量
+////    @Scheduled(cron = "*/5 * * * * ?")
+//    @GetMapping("/getTeacherCourseViewCount")
+//    public void getTeacherCourseViewCount(){
+//        List<TeacherCertifications> list = teacherCertificationsService.list(null);
+//        for (int i = 0; i < list.size(); i++) {
+//            Integer viewCount = teacherCoursesService.getTeacherViewCount(list.get(i).getUid());
+//            redisTemplate.opsForZSet().add("viewCount",list.get(i).getUid(),viewCount);
+//        }
+//    }
+//
+//    @GetMapping("addTest")
+//    public void setOneValue(){
+//        String keyModel = "viewCount";
+//        String ss = "1df782200000002";
+//        Double aDouble = redisTemplate.opsForZSet().incrementScore(keyModel, ss, 1);
+//        System.out.println(aDouble);
+//    }
+//
+//    @GetMapping("return")
+//    public void returnDb(){
+//        String keyModel = "viewCount";
+//        Long size = redisTemplate.opsForZSet().size(keyModel);
+//        Set range = redisTemplate.opsForZSet().range(keyModel, 0, size - 1);
+//
+//        for (int i = 0; i < size; i++) {
+//
+//        }
+//        System.out.println(size);
+//    }
+//    @Test
+//    public void test8() {
+//        //获得指定元素的分数
+//        Double score = redisTemplate.opsForZSet().score("ranking-list", "p1");
+//        System.out.println(score);
+//    }
+
+}

+ 5 - 5
education_family/service/service-education/src/main/java/com/xunwang/education/controller/MyFavoriteNeedsController.java

@@ -50,11 +50,11 @@ public class MyFavoriteNeedsController {
         return R.ok().message("取消收藏失败");
     }
 
-    @ApiOperation("查询个人收藏的学员需求")
-    @GetMapping("/findPersonCollect")
-    public R findPersonCollect(HttpServletRequest request) {
-        myFavoriteNeedsService.findPersonCollect(request)
-    }
+//    @ApiOperation("查询个人收藏的学员需求")
+//    @GetMapping("/findPersonCollect")
+//    public R findPersonCollect(HttpServletRequest request) {
+//        myFavoriteNeedsService.findPersonCollect(request)
+//    }
 
 }
 

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

@@ -5,10 +5,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.github.xiaoymin.knife4j.annotations.ApiSupport;
 import com.xunwang.commonutils.JwtUtils;
 import com.xunwang.commonutils.R;
+import com.xunwang.education.entity.TeacherCertifications;
 import com.xunwang.education.entity.TeacherCourses;
 import com.xunwang.education.entity.vo.TeacherCoursesVo;
 import com.xunwang.education.entity.vo.TeacherList;
 import com.xunwang.education.entity.vo.TeacherListQuery;
+import com.xunwang.education.service.TeacherCertificationsService;
 import com.xunwang.education.service.TeacherCoursesService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -37,6 +39,9 @@ public class TeacherCoursesController {
     @Autowired
     private TeacherCoursesService teacherCoursesService;
 
+    @Autowired
+    private TeacherCertificationsService teacherCertificationsService;
+
     @ApiOperation("课程发布")
     @PostMapping("publishCourse")
     public R publishCourse(@RequestBody TeacherCoursesVo teacherCoursesVo, HttpServletRequest request) {
@@ -106,5 +111,6 @@ public class TeacherCoursesController {
         return R.ok().data(map);
     }
 
+
 }
 

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

@@ -30,7 +30,7 @@ public class TeacherCourses implements Serializable {
 
     @ApiModelProperty(value = "无序唯一id")
     @TableId(value = "course_id", type = IdType.AUTO)
-    private Integer courseId;
+    private String courseId;
 
     @ApiModelProperty(value = "无序唯一id")
     private String uid;

+ 46 - 0
education_family/service/service-education/src/main/java/com/xunwang/education/entity/vo/FavoriteCourseVo.java

@@ -0,0 +1,46 @@
+package com.xunwang.education.entity.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.xunwang.education.entity.TeacherCourses;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @author Guan
+ * @date 2023/1/4
+ * discription
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class FavoriteCourseVo {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "自增")
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    @ApiModelProperty(value = "无序唯一id")
+    private String uid;
+
+    @ApiModelProperty(value = "无序唯一id")
+    private String courseId;
+
+    @ApiModelProperty(value = "课程对象")
+    private TeacherCourses teacherCourses;
+    @ApiModelProperty(value = "老师姓名")
+    private String teacherName;
+    @ApiModelProperty(value = "学历")
+    private String education;
+    @ApiModelProperty(value = "老师学校")
+    private String school;
+    @ApiModelProperty(value = "老师性别")
+    private String sex;
+    @ApiModelProperty(value = "老师身份")
+    private String identify;
+
+
+}

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

@@ -3,6 +3,8 @@ package com.xunwang.education.mapper;
 import com.xunwang.education.entity.TeacherCertifications;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * <p>
  * 老师认证 Mapper 接口
@@ -19,4 +21,6 @@ public interface TeacherCertificationsMapper extends BaseMapper<TeacherCertifica
      * @return
      */
     TeacherCertifications getInfosByUid(String uid);
+
+    List<TeacherCertifications> getTeacherDetail(String[] array);
 }

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

@@ -25,4 +25,8 @@ public interface TeacherCoursesMapper extends BaseMapper<TeacherCourses> {
     List<TeacherList> selectTeachers(@Param("obj") TeacherListQuery obj);
 
     String selectLatest(String uid);
+
+    int getTeacherViewCount(String uid);
+
+    List<TeacherCourses> getTeacherCourseId(String uid);
 }

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

@@ -7,4 +7,18 @@
         from teacher_certifications tc
         where uid = #{uid};
     </select>
+    <select id="getTeacherDetail" resultType="com.xunwang.education.entity.TeacherCertifications">
+        SELECT * FROM `teacher_certifications` WHERE uid IN
+        (
+        <foreach collection="array" item="one" separator=",">
+        #{one}
+        </foreach>
+        )
+        order by field(
+        uid,
+        <foreach collection="array" item="one" separator=",">
+        #{one}
+        </foreach>
+        )
+    </select>
 </mapper>

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

@@ -41,4 +41,12 @@
     <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>
+    <select id="getTeacherViewCount" resultType="java.lang.Integer">
+        SELECT IFNULL(SUM(viewed_count),0) FROM `teacher_courses` WHERE uid=#{uid}
+    </select>
+    <select id="getTeacherCourseId" resultType="com.xunwang.education.entity.TeacherCourses">
+        SELECT course_id FROM `teacher_courses` WHERE uid=#{uid}
+    </select>
+
+
 </mapper>

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

@@ -3,6 +3,8 @@ package com.xunwang.education.service;
 import com.xunwang.education.entity.TeacherCertifications;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
  * <p>
  * 老师认证 服务类
@@ -25,4 +27,6 @@ public interface TeacherCertificationsService extends IService<TeacherCertificat
      * @param uid
      */
     TeacherCertifications getInfosByUid(String uid);
+
+    List<TeacherCertifications> getTeacherDetail(String[] array);
 }

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

@@ -67,4 +67,9 @@ public interface TeacherCoursesService extends IService<TeacherCourses> {
      * @param uid
      */
     Map queryCountAndLastTime(String uid);
+
+
+    int getTeacherViewCount(String uid);
+
+    List<TeacherCourses> getTeacherCourseId(String uid);
 }

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

@@ -7,6 +7,8 @@ import com.xunwang.education.service.TeacherCertificationsService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  * 老师认证 服务实现类
@@ -43,4 +45,10 @@ public class TeacherCertificationsServiceImpl extends ServiceImpl<TeacherCertifi
         TeacherCertifications one = baseMapper.getInfosByUid(uid);
         return one;
     }
+
+    @Override
+    public List<TeacherCertifications> getTeacherDetail(String[] array) {
+        return baseMapper.getTeacherDetail(array);
+    }
+
 }

+ 11 - 0
education_family/service/service-education/src/main/java/com/xunwang/education/service/impl/TeacherCoursesServiceImpl.java

@@ -178,4 +178,15 @@ public class TeacherCoursesServiceImpl extends ServiceImpl<TeacherCoursesMapper,
 
         return hashMap;
     }
+
+    @Override
+    public int getTeacherViewCount(String uid) {
+        return baseMapper.getTeacherViewCount(uid);
+    }
+
+    @Override
+    public List<TeacherCourses> getTeacherCourseId(String uid) {
+        return baseMapper.getTeacherCourseId(uid);
+    }
+
 }

+ 1 - 1
education_family/service/service-education/src/test/java/com/xunwang/education/CodeGenerator.java

@@ -60,7 +60,7 @@ public class CodeGenerator {
 
         // 5、策略配置
         StrategyConfig strategy = new StrategyConfig();
-        strategy.setInclude("my_favorite_needs");
+        strategy.setInclude("my_favorite_courses");
         strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略
         strategy.setTablePrefix(pc.getModuleName() + "_"); //生成实体时去掉表前缀
 

+ 0 - 1
education_family/service/service-file/src/main/java/com/xunwang/file/controller/FileUpload.java

@@ -9,7 +9,6 @@ import org.apache.commons.codec.binary.Base64;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
-import sun.misc.BASE64Encoder;
 
 import javax.imageio.stream.FileImageInputStream;
 import java.io.ByteArrayOutputStream;

+ 5 - 5
education_family/service/service-ucenter/src/test/java/com/xunwang/ucenter/CodeGenerator.java

@@ -29,7 +29,7 @@ public class CodeGenerator {
         //gc.setOutputDir(projectPath + "/src/main/java");
         gc.setOutputDir(projectPath + "/src/main/java");
 
-        gc.setAuthor("Long");
+        gc.setAuthor("Guan");
         gc.setOpen(false); //生成后是否打开资源管理器
         gc.setFileOverride(false); //重新生成时文件是否覆盖
         gc.setServiceName("%sService");	//去掉Service接口的首字母I
@@ -41,16 +41,16 @@ public class CodeGenerator {
 
         // 3、数据源配置
         DataSourceConfig dsc = new DataSourceConfig();
-        dsc.setUrl("jdbc:mysql://localhost:3306/guli_edu?serverTimezone=GMT%2B8");
+        dsc.setUrl("jdbc:mysql://192.168.0.10:3306/home_teacher?serverTimezone=GMT%2B8");
         dsc.setDriverName("com.mysql.cj.jdbc.Driver");
         dsc.setUsername("root");
-        dsc.setPassword("123456");
+        dsc.setPassword("FXI@gi^l");
         dsc.setDbType(DbType.MYSQL);
         mpg.setDataSource(dsc);
 
         // 4、包配置
         PackageConfig pc = new PackageConfig();
-        pc.setParent("com.atguigu");
+        pc.setParent("com.xunwang");
         pc.setModuleName("ucenter"); //模块名
         pc.setController("controller");
         pc.setEntity("entity");
@@ -60,7 +60,7 @@ public class CodeGenerator {
 
         // 5、策略配置
         StrategyConfig strategy = new StrategyConfig();
-        strategy.setInclude("");
+        strategy.setInclude("my_favorite_courses");
         strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略
         strategy.setTablePrefix(pc.getModuleName() + "_"); //生成实体时去掉表前缀
 

+ 1 - 1
education_uni/App.vue

@@ -20,7 +20,7 @@
 	@import '@/static/customicons.css';
 	// 设置整个项目的背景色
 	page {
-		background-color: #f5f5f5;
+		background-color: #f5f5f5;//#f5f5f5
 		height: 100%;
 	}
 

+ 34 - 34
education_uni/components/my-login/my-login.vue

@@ -68,41 +68,41 @@
 			},
 			
 			// 调用登录接口,换取永久的 token
-			async getToken() {
-				var that = this
+			 getToken() {
+			// 	var that = this
 			
-				// 获取位置信息
-				wx.getSetting({
-					success(res) {
-						if (!res.authSetting['scope.userFuzzyLocation']) {
-							wx.authorize({
-								scope: 'scope.userFuzzyLocation',
-								success() {
-									// 获取经纬度
-									wx.getFuzzyLocation({
-										type: 'wgs84',
-										success (res) {
-										   that.queryObj.latitude = res.latitude
-										   that.queryObj.longitude = res.longitude
-										   that.updateLocation(that.queryObj)
-										   that.getLogin()
-										}
-									})
-								},
-								fail() {
-									// 拒绝后引导用户开启
-									if (wx.openSetting) {
-										that.openSetting()
-									}
-									return
-								}
-							})
-						} else {
-							that.getLogin()
-						}
-					}
-				})
-				
+			// 	// 获取位置信息
+			// 	wx.getSetting({
+			// 		success(res) {
+			// 			if (!res.authSetting['scope.userFuzzyLocation']) {
+			// 				wx.authorize({
+			// 					scope: 'scope.userFuzzyLocation',
+			// 					success() {
+			// 						// 获取经纬度
+			// 						wx.getFuzzyLocation({
+			// 							type: 'wgs84',
+			// 							success (res) {
+			// 							   that.queryObj.latitude = res.latitude
+			// 							   that.queryObj.longitude = res.longitude
+			// 							   that.updateLocation(that.queryObj)
+			// 							   that.getLogin()
+			// 							}
+			// 						})
+			// 					},
+			// 					fail() {
+			// 						// 拒绝后引导用户开启
+			// 						if (wx.openSetting) {
+			// 							that.openSetting()
+			// 						}
+			// 						return
+			// 					}
+			// 				})
+			// 			} else {
+			// 				that.getLogin()
+			// 			}
+			// 		}
+			// 	})
+				this.getLogin()
 			},
 			
 			// 真正的登录逻辑

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

@@ -9,11 +9,11 @@
 		        <text class="top-text" bindtap="exitLogin">退出账号</text>
 		    </view>
 		    <view class="infoList">
-		        <navigator class="infoList-text" url="myAppointment">我的邀请</navigator>
-		        <navigator class="infoList-text" url="appointment">我被邀请</navigator>
+		        <navigator class="infoList-text" url="/subpkg/my_invite/my_invite">我的邀请</navigator>
+		        <navigator class="infoList-text" url="/subpkg/my_got_invitation/my_got_invitation">我被邀请</navigator>
 		        <navigator class="infoList-text" url="myLessons">我的订单</navigator>
 		        <navigator class="infoList-text" url="/subpkg/student_require/student_require">学员需求</navigator>
-		        <navigator class="infoList-text" url="myTeacher">我收藏的老师</navigator>
+		        <navigator class="infoList-text" url="/subpkg/my_collect_course/my_collect_course">我收藏的老师</navigator>
 		        <navigator class="infoList-text" url="myStudent">我收藏的学生</navigator>
 		        <navigator class="infoList-text" url="/subpkg/course_publish/course_publish">我的投诉</navigator>
 		        <navigator class="infoList-text" url="mySuggest">我的建议</navigator>

+ 1 - 1
education_uni/main.js

@@ -31,7 +31,7 @@ $http.beforeRequest = function(options) {
 }
 
 // 请求的根路径
-$http.baseUrl = 'http://192.168.0.207:8222'
+$http.baseUrl = 'http://localhost:8222'
 
 // 响应拦截器
 $http.afterRequest = function(res) {

+ 36 - 0
education_uni/pages.json

@@ -153,6 +153,42 @@
                     "enablePullDownRefresh": false
                 }
                 
+                }
+                ,{
+                    "path" : "my_invite_detail/my_invite_detail",
+                    "style" :                                                                                    
+                {
+                    "navigationBarTitleText": "",
+                    "enablePullDownRefresh": false
+                }
+                
+                }
+                ,{
+                    "path" : "my_got_invitation/my_got_invitation",
+                    "style" :                                                                                    
+                {
+                    "navigationBarTitleText": "",
+                    "enablePullDownRefresh": false
+                }
+                
+                }
+                ,{
+                    "path" : "my_got_invitation_detail/my_got_invitation_detail",
+                    "style" :                                                                                    
+                {
+                    "navigationBarTitleText": "",
+                    "enablePullDownRefresh": false
+                }
+                
+                }
+                ,{
+                    "path" : "my_collect_course/my_collect_course",
+                    "style" :                                                                                    
+                {
+                    "navigationBarTitleText": "",
+                    "enablePullDownRefresh": false
+                }
+                
                 }
             ]
 		}

+ 159 - 2
education_uni/subpkg/my_invite/my_invite.vue

@@ -1,19 +1,176 @@
 <template>
 	<view>
-		
+		<!-- 顶部对方已读和未读按钮 -->
+			<view class="read">
+				<text class="readDetail" @click="readYes">对方已读</text>
+				<text class="readDetail" @click="readNo">对方未读</text>
+			</view>
+			<!-- 发出的邀请列表 -->
+			<view v-if="showReadYes">
+				<view v-for="(Info,index) in InviteInfoRead" :key="index">
+					<view class="invitationWrapper" @click="invitationDetail(Info)">
+						<view class="invitationTitle">
+							<view>
+								<text>邀请号</text>
+								<text class="invitatinDetail">{{Info.requireId}}</text>
+							</view>
+							<view class="other">
+								<text>对方</text>
+								<text class="invitatinDetail">{{Info.fromUname}}</text>
+							</view>
+						</view>
+						<view class="invitationContent">
+							<text>邀请内容</text>
+							<text class="invitatinDetail">{{Info.requireDetail}}</text>
+						</view>
+						<view class="invitationDateAndStatus">
+							<view>
+								<text>邀请日期</text>
+								<text class="invitatinDetailOther">{{Info.datetime}}</text>
+							</view>
+							<view class="other">
+								<text>对方状态</text>
+								<text class="invitatinStatus">{{Info.readStatus}}</text>
+							</view>
+						</view>	
+					</view>
+					
+				</view>    
+			</view>
+			<view v-if="showReadNo">
+					<view v-for="(Info,index) in InviteInfoUnRead" :key="index">
+						<view class="invitationWrapper" @click="invitationDetail(Info)">
+						<view class="invitationTitle">
+						<view>
+							<text>邀请号</text>
+							<text class="invitatinDetail">{{Info.requireId}}</text>
+						</view>
+						<view class="other">
+							<text>对方</text>
+							<text class="invitatinDetail">{{Info.fromUname}}</text>
+						</view>
+					</view>
+					<view class="invitationContent">
+						<text>邀请内容</text>
+						<text class="invitatinDetail">{{Info.requireDetail}}</text>
+					</view>
+					<view class="invitationDateAndStatus">
+						<text>邀请日期</text>
+						<text class="invitatinDetailOther">{{Info.datetime}}</text>
+					</view>
+					</view>
+					
+				</view>
+			</view>
 	</view>
 </template>
 
 <script>
+	import { mapState, mapMutations } from 'vuex'
 	export default {
 		data() {
 			return {
 				
+				showReadYes: true,
+				showReadNo: false,
+				InviteInfoRead: [],
+				InviteInfoUnRead: []
+				
 			};
+		},
+		created() {
+			this.readYes()
+		},
+		methods:{
+			async readYes(){
+				const { data: result } = await uni.$http.get('/ucenter/invite-info/getSendedInvitationRead')
+				console.log(result)
+				this.InviteInfoRead = result.data.list
+				this.showReadYes = true
+				this.showReadNo = false
+				// console.log(this.InviteInfo)
+				// this.InviteInfo.fromUname = result.data.list
+				// this.InviteInfo.requireDetail = result.data.list
+				// this.InviteInfo.datetime = result.data.list
+				// this.InviteInfo.operateStatus = result.data.list
+			},
+			async readNo(){
+				const { data: result } = await uni.$http.get('/ucenter/invite-info/getSendedInvitationUnread')
+				this.InviteInfoUnRead = result.data.list
+				this.showReadNo = true
+				this.showReadYes = false
+				
+			},
+			async invitationDetail(Info){
+				console.log(JSON.stringify(Info))
+				uni.navigateTo({
+					url: '/subpkg/my_invite_detail/my_invite_detail?Info='+ encodeURIComponent(JSON.stringify(Info))
+				})
+				
+			}
+			
 		}
 	}
 </script>
 
-<style lang="scss">
 
+<style lang="scss" scoped>
+	
+page{
+    padding: 20rpx;
+    height: 100%;
+    background-color: #E2F0D9;
+}
+
+/* 顶部对方已读和未读按钮 */
+.read{
+    display: flex;
+    justify-content: space-around;
+}
+.readDetail{
+    padding: 10rpx 20rpx;
+    border-radius: 30rpx;
+    background-color: #FFF2CC;
+    font-weight: bold;
+}
+
+/* 列表样式 */
+.invitationWrapper{
+    width: 93%;
+    padding: 20rpx;
+    margin-top: 20rpx;
+    border-radius: 20rpx;
+    background-color: #FFF2CC;
+}
+
+/* 邀请号和对方身份、邀请日期和对方状态 */
+.invitationTitle,
+.invitationDateAndStatus{
+    display: flex;
+    position: relative;
+}
+
+/* 对方身份 */
+.other{
+    position: absolute;
+    left: 60%;
+}
+/* 具体内容的样式 */
+.invitatinDetail,
+.invitatinStatus{
+    margin-left: 20rpx;
+    font-weight: bold;
+}
+.invitatinDetailOther{
+	margin-left: 20rpx;
+	font-weight: bold;
+	font-size: 26rpx;
+}
+.invitatinStatus{
+    color: red;
+}
+/* 邀请内容、邀请日期和对方状态 */
+.invitationContent{
+    margin-top: 10rpx;
+}
 </style>