bding 1 year ago
parent
commit
b7a2fd9545

+ 4 - 0
config/modules/purchaser.js

@@ -102,4 +102,8 @@ export const purchaserApi = {
   getActivityTypelist: (params) => {
     return getHttp("/activity/activityTypelist", params);
   },
+  // 专栏点击记录记录阅读时长
+  YanxuanSpecialRecord: (params) => {
+    return postHttp("/yanxuan_special/record", params);
+  },
 };

+ 1 - 0
pages-purchaser/editColumnReport/editColumnReport.vue

@@ -186,6 +186,7 @@ export default {
                 ImgUrl: this.fileList.join(","),
                 DoType: 2,
                 Id: this.detailId,
+                IsApprovalPersonnel: true,
               });
               if (resSave.Ret === 200) {
                 this.$util.toast("已发布");

+ 30 - 0
pages-purchaser/noteAndViewpoint/noteAndViewpoint.vue

@@ -55,6 +55,8 @@ export default {
     return {
       detailDataForm: "",
       detailId: 0,
+      readTiem: 0,
+      setIntervalTiem: null,
     };
   },
   methods: {
@@ -118,6 +120,34 @@ export default {
     this.detailId = Number(options.id) || 0;
     this.detailId > 0 && this.getDetaliData();
   },
+  onShow() {
+    this.readTiem = 0;
+    this.setIntervalTiem = setInterval(() => {
+      this.readTiem++;
+    }, 1000);
+  },
+  onHide() {
+    //页面退出
+    if (this.detailId && this.detailId > 0) {
+      clearInterval(this.setIntervalTiem);
+      Reports.addStopTime({
+        SpecialId: this.detailId,
+        StopTime: this.readTiem,
+      }).then((res) => {});
+    }
+  },
+  onUnload() {
+    if (this.detailId && this.detailId > 0) {
+      //页面返回
+      clearInterval(this.setIntervalTiem);
+      purchaserApi
+        .YanxuanSpecialRecord({
+          SpecialId: this.detailId,
+          StopTime: this.readTiem,
+        })
+        .then((res) => {});
+    }
+  },
   /** 用户点击分享 */
   onShareAppMessage: function (res) {
     return {