Commit 1e113557 authored by jyx's avatar jyx

代码优化

parent f5b08422
...@@ -286,10 +286,10 @@ ...@@ -286,10 +286,10 @@
this.post({ this.post({
url: '/vTask/common/reportCompleteMsg/beginSeeTime', url: '/vTask/common/reportCompleteMsg/beginSeeTime',
showLoading: false, showLoading: false,
success: ({ success: ({
data data
}) => { }) => {
} }
}); });
}, },
...@@ -299,10 +299,10 @@ ...@@ -299,10 +299,10 @@
this.post({ this.post({
url: '/vTask/common/reportCompleteMsg/endSeeTime', url: '/vTask/common/reportCompleteMsg/endSeeTime',
showLoading: false, showLoading: false,
success: ({ success: ({
data data
}) => { }) => {
} }
}); });
}, },
...@@ -328,10 +328,10 @@ ...@@ -328,10 +328,10 @@
this.post({ this.post({
url: '/vTask/vedioPageClose', url: '/vTask/vedioPageClose',
showLoading: false, showLoading: false,
success: ({ success: ({
data data
}) => { }) => {
} }
}); });
}, },
...@@ -571,7 +571,8 @@ ...@@ -571,7 +571,8 @@
}); });
let that = this let that = this
this.ad.closeHandler = function(res) {
this.ad.onClose((res) => {
uni.hideLoading(); uni.hideLoading();
if (res && res.isEnded || res === undefined) { if (res && res.isEnded || res === undefined) {
if (that.isMoreAd) { if (that.isMoreAd) {
...@@ -592,8 +593,8 @@ ...@@ -592,8 +593,8 @@
} else { } else {
message.notify("未观看完整视频") message.notify("未观看完整视频")
} }
});
};
// 监听错误 // 监听错误
this.ad.onError((err) => { this.ad.onError((err) => {
...@@ -615,7 +616,7 @@ ...@@ -615,7 +616,7 @@
}); });
// 监听视频播放完成 // 监听视频播放完成
this.ad.onClose(this.ad.closeHandler); // this.ad.onClose(this.ad.closeHandler);
// 预加载资源 // 预加载资源
this.ad.load(); this.ad.load();
...@@ -672,6 +673,9 @@ ...@@ -672,6 +673,9 @@
success: ({ success: ({
data data
}) => { }) => {
console.log('BBBBBBBBBB')
message.notify(data.msg) message.notify(data.msg)
if (data.code == 200) { if (data.code == 200) {
......
...@@ -337,6 +337,9 @@ export function getSubList(length, list) { ...@@ -337,6 +337,9 @@ export function getSubList(length, list) {
} }
export function formateTime(dateTime, fmt) { export function formateTime(dateTime, fmt) {
if (!dateTime) {
return ''
}
let date = new Date(dateTime) let date = new Date(dateTime)
if (/(y+)/.test(fmt)) { if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length)); fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment