|
@@ -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 {
|