Pārlūkot izejas kodu

新增用户视频学习日志和平台来源

xuqiaoying 3 gadi atpakaļ
vecāks
revīzija
c70f1823e1

+ 3 - 1
src/axios.js

@@ -4,8 +4,10 @@ import { Message } from 'element-ui'
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test
 // export const BASE_URL = 'https://test.xyyxt.net'   //预发布
-export const BASE_URL = 'http://192.168.1.7:5055'    //dev
+// export const BASE_URL = 'http://192.168.1.7:5055'    //dev
 // export const BASE_URL = 'http://120.79.166.78:19012'    //测试-外网
+// export const BASE_URL = 'http://42.192.164.187:19005'    //test
+export const BASE_URL = 'http://192.168.1.222:5055'    //测试
 export const tenantId = '867735392558919680'
 
 

+ 1 - 0
src/pages/course-detail/index copy.vue

@@ -5645,6 +5645,7 @@ export default {
       console.log(this);
       console.log(PlayDuration, "PlayDuration");
       let data = {
+        fromPlat: 2, //来源平台 1小程序 2网站	
         photo: self.ossAvatarUrl,
         sectionId: parseInt(this.playSectionId),
         goodsId: parseInt(this.goodsId),

+ 26 - 0
src/pages/course-detail/index.vue

@@ -5074,10 +5074,30 @@ export default {
         resolve();
       });
     },
+    // 新增用户视频学习日志
+    studyLog(moduleId, chapterId, sectionId) {
+      this.$axios({
+        url: '/user/study/log',
+        method: 'post',
+        data: {
+          goodsId: this.goodsId,
+          courseId: this.courseId,
+					moduleId: moduleId || 0,
+					chapterId: chapterId || 0,
+          sectionId: sectionId || 0,
+          fromPlat: 2, //来源平台 1小程序 2PC网站
+          goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
+          orderGoodsId: this.orderGoodsId,
+        }
+      }).then((res) => {
+        console.log('直播的用户学习日志:', res)
+      })
+    },
     /**
      * 点击节
      */
     async getResource(section) {
+      console.log('点击姐姐京津冀', section)
       //逻辑
       if (section.sectionType === 2 && section.liveStartTime && section.liveEndTime) {
         if (section.liveStartTime > this.nowTime) {
@@ -5145,6 +5165,7 @@ export default {
 
               return;
             }
+            this.studyLog(section.moduleId = 0, section.chapterId = 0, section.typeId)
           } else {
             this.$message({
               type: "warning",
@@ -5224,6 +5245,7 @@ export default {
 
               return;
             }
+            this.studyLog(section.moduleId = 0, section.chapterId = 0, section.typeId)
           } else {
             this.$message({
               type: "warning",
@@ -5268,6 +5290,7 @@ export default {
 
             return;
           }
+          this.studyLog(section.moduleId = 0, section.chapterId = 0, section.typeId)
         }
         return;
       }
@@ -5502,6 +5525,7 @@ export default {
     },
 
     async playVideo(option) {
+      console.log('asdhsuohfosufgasoug', option)
       if (option.sectionType == 1 || option.sectionType == 3) {
         //录播
 
@@ -5540,6 +5564,7 @@ export default {
         setTimeout(() => {
           this.clickLock = false;
         }, 3000);
+        this.studyLog(this.moduleId, this.chapterId, this.playSectionId)
         // uni.$emit("levelId", this.levelId);
         // uni.$emit("getSection", this.menuItem);
         // uni.$emit("isRebuild", this.isRebuild);
@@ -6087,6 +6112,7 @@ export default {
       console.log(this);
       console.log(PlayDuration, "PlayDuration");
       let data = {
+        fromPlat: 2, //来源平台 1小程序 2网站	
         photo: self.ossAvatarUrl,
         sectionId: parseInt(this.playSectionId),
         goodsId: parseInt(this.goodsId),

+ 25 - 4
src/pages/live-detail/index.vue

@@ -4733,6 +4733,25 @@ export default {
         }
       });
     },
+    // 新增用户视频学习日志
+    studyLog(moduleId, chapterId, sectionId) {
+      this.$axios({
+        url: '/user/study/log',
+        method: 'post',
+        data: {
+          goodsId: this.goodsId,
+          courseId: this.courseId,
+					moduleId: moduleId || 0,
+					chapterId: chapterId || 0,
+          sectionId: sectionId || 0,
+          fromPlat: 2, //来源平台 1小程序 2PC网站
+          goodsType: 6, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
+          orderGoodsId: this.orderGoodsId,
+        }
+      }).then((res) => {
+        console.log('直播的用户学习日志:', res)
+      })
+    },
     /**
      * 点击节
      */
@@ -4773,7 +4792,6 @@ export default {
                   orderGoodsId: this.orderGoodsId,
                 },
               });
-
               //没有答题次数限制
             } else if (section.answerNum == 0) {
               this.$router.push({
@@ -4795,6 +4813,7 @@ export default {
 
               return;
             }
+            this.studyLog(section.moduleId = 0, section.chapterId = 0, section.typeId)
           } else {
             this.$message({
               type: "warning",
@@ -4874,6 +4893,7 @@ export default {
 
               return;
             }
+            this.studyLog(section.moduleId = 0, section.chapterId = 0, section.typeId)
           } else {
             this.$message({
               type: "warning",
@@ -4896,7 +4916,6 @@ export default {
                 orderGoodsId: this.orderGoodsId,
               },
             });
-
             //没有答题次数限制
           } else if (section.answerNum == 0) {
             this.$router.push({
@@ -4918,6 +4937,7 @@ export default {
 
             return;
           }
+          this.studyLog(section.moduleId = 0, section.chapterId = 0, section.typeId)
         }
         return;
       }
@@ -5183,7 +5203,6 @@ export default {
         //播放视频
         this.showRecordStatus = false; //隐藏播放记录提示
         this.sectionItem = option;
-        console.log(option, "option");
         this.isPlayRebuild = option.rebuild;
         this.moduleId = option.moduleId || 0;
         this.chapterId = option.chapterId || 0;
@@ -5207,13 +5226,14 @@ export default {
         setTimeout(() => {
           this.clickLock = false;
         }, 3000);
+        this.studyLog(this.moduleId, this.chapterId, this.playSectionId)
         // uni.$emit("levelId", this.levelId);
         // uni.$emit("getSection", this.menuItem);
         // uni.$emit("isRebuild", this.isRebuild);
       }
       if (option.sectionType == 2) {
         //直播
-
+        // 直播下面不需要调用 this.studyLog(),因为跳到直播页面有调用
         //提交保存观看历史
         if (this.playSectionId) {
           this.postStudyRecord(0, this.playSectionId);
@@ -5759,6 +5779,7 @@ export default {
       console.log(this);
       console.log(PlayDuration, "PlayDuration");
       let data = {
+        fromPlat: 2, //来源平台 1小程序 2网站	
         photo: self.ossAvatarUrl,
         sectionId: parseInt(this.playSectionId),
         goodsId: parseInt(this.goodsId),

+ 22 - 0
src/pages/living-room/index.vue

@@ -266,6 +266,25 @@ export default {
       })
 
     },
+    // 新增用户视频学习日志
+    studyLog() {
+      this.$axios({
+        url: '/user/study/log',
+        method: 'post',
+        data: {
+          goodsId: this.goodsId,
+          courseId: this.courseId,
+					moduleId: this.moduleId || 0,
+					chapterId: this.chapterId || 0,
+          sectionId: this.sectionId || 0,
+          fromPlat: 2, //来源平台 1小程序 2PC网站
+          goodsType: 6, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
+          orderGoodsId: this.orderGoodsId,
+        }
+      }).then((res) => {
+        console.log('直播的用户学习日志:', res)
+      })
+    },
     close() {
       this.signModal = false;
       this.signSuccess = true;
@@ -288,6 +307,8 @@ export default {
           this.appId = res.data.appId;
 
           this.loadPlayerzb();
+          // 新增用户视频学习日志
+          this.studyLog()
         });
     },
 
@@ -476,6 +497,7 @@ export default {
       }
       let self = this;
       this.$request.studyRecord({
+        fromPlat: 2, //来源平台 1小程序 2网站	
         buyCourse: this.buyCourse,
         identification: this.identification,
         sectionId: parseInt(this.sectionId),

+ 22 - 1
src/pages/person-center/my-bank/bank-detailCopy/index.vue

@@ -1159,7 +1159,25 @@ export default {
           });
       });
     },
-
+    // 新增用户视频学习日志
+		studyLog(courseId, moduleId, chapterId, examId) {
+			this.$http({
+				url: '/user/study/log',
+				method: 'post',
+				data: {
+					goodsId: this.goodsId,
+					courseId: courseId,
+					moduleId: moduleId || 0,
+					chapterId: chapterId || 0,
+					sectionId: examId || 0,
+					fromPlat: 2, //来源平台 1小程序 2PC网站
+					goodsType: 2, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
+					orderGoodsId: this.orderGoodsId,
+				}
+			}).then((res) => {
+				console.log('题库的用户学习日志:', res)
+			})
+		},
     /**
      * 去做题
      */
@@ -1187,6 +1205,7 @@ export default {
           orderGoodsId: this.orderGoodsId,
         },
       });
+      this.studyLog(0, moduleId, chapterId, section.examId)
     },
 
     /**
@@ -1204,6 +1223,7 @@ export default {
           orderGoodsId: this.orderGoodsId,
         },
       });
+      this.studyLog(0, moduleId, chapterId, section.examId)
     },
 
     /**
@@ -1258,6 +1278,7 @@ export default {
             },
           });
         });
+        this.studyLog(0, moduleId, chapterId, section.examId)
     },
 
     /**