Files
BlackFruit-UI/clientarea/hgcloud/js/newsView.js
yiqiu 3b41cffbc9
All checks were successful
continuous-integration/drone/push Build is passing
feat: 会员中心 hgcloud 主题初始化 + drone 部署步骤
- 解压官方默认主题 default_yfMBA.tar.gz 到 clientarea/hgcloud/
- .gitignore 排除压缩包和临时解压目录
- drone 新增步骤: 同步 hgcloud 到 /clientarea/template/pc/
2026-03-19 17:56:44 +08:00

79 lines
2.3 KiB
JavaScript

(function (window, undefined) {
var old_onload = window.onload;
window.onload = function () {
const template = document.getElementById("content");
Vue.prototype.lang = window.lang;
Vue.prototype.moment = window.moment;
new Vue({
created() {
this.init();
},
components: {
shadowContent,
},
data() {
return {
newDetail: {
content: "",
},
};
},
filters: {
formateTime(time) {
if (time && time !== 0) {
var date = new Date(time * 1000);
Y = date.getFullYear() + "-";
M =
(date.getMonth() + 1 < 10
? "0" + (date.getMonth() + 1)
: date.getMonth() + 1) + "-";
D =
(date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) +
" ";
h =
(date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) +
":";
m =
date.getMinutes() < 10
? "0" + date.getMinutes()
: date.getMinutes();
return Y + M + D + h + m;
} else {
return "--";
}
},
},
methods: {
init() {
this.newDetail = JSON.parse(sessionStorage.viewNewObjData);
this.newDetail.create_time = new Date().getTime() / 1000;
},
calStr(content = "") {
const temp =
content &&
content
.replace(/&lt;/g, "<")
.replace(/&gt;/g, ">")
.replace(/&quot;/g, '"')
.replace(/&amp;lt;/g, "<")
.replace(/&amp;gt;/g, ">")
.replace(/ &amp;lt;/g, "<")
.replace(/&amp;gt; /g, ">")
.replace(/&amp;gt; /g, ">")
.replace(/&amp;quot;/g, '"')
.replace(/&amp;amp;nbsp;/g, " ")
.replace(/&amp;#039;/g, "'")
.replace("<?php", "&lt;?php");
return temp;
},
},
}).$mount(template);
const mainLoading = document.getElementById("mainLoading");
setTimeout(() => {
mainLoading && (mainLoading.style.display = "none");
}, 200);
typeof old_onload == "function" && old_onload();
};
})(window);