123456789101112131415161718192021222324252627282930313233 |
- import language from "./common/language.js";
- import Service from "./common/service.js";
- new Vue({
- el: "#app",
- data: {
- info: {},
- feature_list: [],
- sku_list: [],
- },
- mounted() {
- const id = location.href.split("?id=")[1];
- this.getDetail(id);
- },
- methods: {
- text(val) {
- return language[val][localStorage.getItem("language")];
- },
- lan_key(val) {
- return `${val}${localStorage.getItem("language") == "en" ? "_en" : ""}`;
- },
- getDetail(id) {
- Service.get_product_detail({ id })
- .then((res) => {
- this.info = res;
- this.feature_list = res.get_feature;
- this.sku_list = res.get_sku;
- })
- .catch((err) => {
- console.log(err);
- });
- },
- },
- });
|