feat: 会员中心 hgcloud 主题初始化 + drone 部署步骤
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
- 解压官方默认主题 default_yfMBA.tar.gz 到 clientarea/hgcloud/ - .gitignore 排除压缩包和临时解压目录 - drone 新增步骤: 同步 hgcloud 到 /clientarea/template/pc/
This commit is contained in:
73
clientarea/hgcloud/js/product_list.js
Normal file
73
clientarea/hgcloud/js/product_list.js
Normal file
@@ -0,0 +1,73 @@
|
||||
(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);
|
||||
Reference in New Issue
Block a user