All checks were successful
continuous-integration/drone/push Build is passing
- 解压官方默认主题 default_yfMBA.tar.gz 到 clientarea/hgcloud/ - .gitignore 排除压缩包和临时解压目录 - drone 新增步骤: 同步 hgcloud 到 /clientarea/template/pc/
74 lines
2.1 KiB
JavaScript
74 lines
2.1 KiB
JavaScript
(function (window, undefined) {
|
|
var old_onload = window.onload;
|
|
window.onload = function () {
|
|
const template = document.getElementsByClassName("template")[0];
|
|
Vue.prototype.lang = window.lang;
|
|
new Vue({
|
|
components: {
|
|
asideMenu,
|
|
topMenu,
|
|
},
|
|
created() {
|
|
const temp = this.getQuery(location.search);
|
|
this.id = temp.id ? temp.id : "";
|
|
this.initData();
|
|
},
|
|
mounted() {},
|
|
data() {
|
|
return {
|
|
id: "",
|
|
goods_token: "",
|
|
goods_url: "",
|
|
commonData: {},
|
|
iframeUrl: "",
|
|
};
|
|
},
|
|
filters: {
|
|
formateTime(time) {
|
|
if (time && time !== 0) {
|
|
return formateDate(time * 1000);
|
|
} else {
|
|
return "--";
|
|
}
|
|
},
|
|
filterMoney(money) {
|
|
if (isNaN(money)) {
|
|
return "0.00";
|
|
} else {
|
|
const temp = `${money}`.split(".");
|
|
return parseInt(temp[0]).toLocaleString() + "." + (temp[1] || "00");
|
|
}
|
|
},
|
|
},
|
|
|
|
methods: {
|
|
// 解析url
|
|
getQuery(url) {
|
|
const str = url.substr(url.indexOf("?") + 1);
|
|
const arr = str.split("&");
|
|
const res = {};
|
|
for (let i = 0; i < arr.length; i++) {
|
|
const item = arr[i].split("=");
|
|
res[item[0]] = item[1];
|
|
}
|
|
return res;
|
|
},
|
|
// 初始化请求数据
|
|
async initData() {
|
|
// 获取产品列表地址
|
|
await goodsList({ id: this.id }).then((res) => {
|
|
this.goods_url = encodeURIComponent(res.data.data.url);
|
|
});
|
|
// 获取token
|
|
await goodsToken().then((res) => {
|
|
this.goods_token = encodeURIComponent(res.data.data.token);
|
|
});
|
|
this.iframeUrl = `https://console.vcp.baidu.com/api/loginvcp/login/securitytoken?redirectUrl=${this.goods_url}&signinSecurityToken=${this.goods_token}`;
|
|
},
|
|
},
|
|
destroyed() {},
|
|
}).$mount(template);
|
|
typeof old_onload == "function" && old_onload();
|
|
};
|
|
})(window);
|