Commit 919fa5ca authored by 黄奎's avatar 黄奎

商品详情页,组件应用重复调整

parent 6408b9f7
......@@ -188,64 +188,67 @@
};
},
mounted() {
this.request2({
url: '/api/AppletGoods/GetAppletGoodsInfo',
data: {
GoodsId: this.good.id
}
},
res => {
this.g = res.data.goods;
this.g.totalStock = 0;
this.g.attr.forEach(x => {
this.g.totalStock += x.stock
})
this.goodimage = this.g.cover_pic;
this.mc = this.$uiConfig.mainColor;
this.fu = this.$uiConfig.secondary;
this.secondary = this.$uiConfig.secondary;
this.skuObj = this.skued.id ? this.skued : null;
if (this.skuObj) {
this.goodimage = this.skuObj.pic_url || this.g.cover_pic;
this.goodprice = (parseFloat(this.skuObj.price) * 1).toFixed(2);
this.goodamount = this.skuObj.stock;
} else {
this.goodimage = this.g.cover_pic;
this.goodprice = this.g.price_min && this.g.price_min != '' ? this.g.price_min : this.g.price_content;
this.goodamount = this.g.goods_stock;
}
this.bian = this.$utils.is_biang;
this.btn1.background = this.secondary;
this.btn2.background = this.mc;
this.btn4.background = this.mc;
if (this.optionType == 2) {
this.btn1.borderRadius = '40px 0 0 40px';
this.btn2.borderRadius = '0 40px 40px 0';
}
if (this.g.attr_groups && this.g.attr_groups.length > 0) {
this.g.attr_groups.forEach(x => {
if (!this.skuObj) {
(x.checkId = 0), (x.checkName = x.attr_list[0].attr_name);
x.checkId = x.attr_list[0].attr_id;
} else {
let sign = `:${this.skuObj.sign_id}:`;
x.attr_list.forEach(y => {
if (sign.indexOf(`:${y.attr_id}:`) != -1) {
x.checkId = y.attr_id;
x.checkName = y.attr_name;
}
});
}
});
}
this.getfu()
this.formatDisableSku();
this.formatChosenTips();
}
);
this.getGoodsInfo();
},
methods: {
getGoodsInfo() {
this.request2({
url: '/api/AppletGoods/GetAppletGoodsInfo',
data: {
GoodsId: this.good.id
}
},
res => {
this.g = res.data.goods;
this.g.totalStock = 0;
this.g.attr.forEach(x => {
this.g.totalStock += x.stock
})
this.goodimage = this.g.cover_pic;
this.mc = this.$uiConfig.mainColor;
this.fu = this.$uiConfig.secondary;
this.secondary = this.$uiConfig.secondary;
this.skuObj = this.skued.id ? this.skued : null;
if (this.skuObj) {
this.goodimage = this.skuObj.pic_url || this.g.cover_pic;
this.goodprice = (parseFloat(this.skuObj.price) * 1).toFixed(2);
this.goodamount = this.skuObj.stock;
} else {
this.goodimage = this.g.cover_pic;
this.goodprice = this.g.price_min && this.g.price_min != '' ? this.g.price_min : this.g.price_content;
this.goodamount = this.g.goods_stock;
}
this.bian = this.$utils.is_biang;
this.btn1.background = this.secondary;
this.btn2.background = this.mc;
this.btn4.background = this.mc;
if (this.optionType == 2) {
this.btn1.borderRadius = '40px 0 0 40px';
this.btn2.borderRadius = '0 40px 40px 0';
}
if (this.g.attr_groups && this.g.attr_groups.length > 0) {
this.g.attr_groups.forEach(x => {
if (!this.skuObj) {
(x.checkId = 0), (x.checkName = x.attr_list[0].attr_name);
x.checkId = x.attr_list[0].attr_id;
} else {
let sign = `:${this.skuObj.sign_id}:`;
x.attr_list.forEach(y => {
if (sign.indexOf(`:${y.attr_id}:`) != -1) {
x.checkId = y.attr_id;
x.checkName = y.attr_name;
}
});
}
});
}
this.getfu()
this.formatDisableSku();
this.formatChosenTips();
}
);
},
getDefaultDate(item) {
var result = item;
if (this.skuObj && this.skuObj.attr_list && this.skuObj.attr_list.length > 0 && this.g.mall_id == 19 && this.g.mch_id ==
......
......@@ -225,7 +225,6 @@
watch: {
defaultDate(newVal) {
console.log("newVal",newVal)
this.userDefaultDate = newVal;
if (this.userDefaultDate != "") {
this.start = this.setDefaultDate(this.userDefaultDate);
......@@ -249,13 +248,11 @@
}
if (this.priceStauts.length > 0) {
console.log(this.lastNot);
for (var i = newVal[0]; i < this.priceStauts.length; i++) {
if (i == newVal[0]) {
for (var j = newVal[1]; j < this.priceStauts[i].length; j++) {
if (this.priceStauts[i][j] == -1) {
this.lastNot = [i, j];
console.log(this.lastNot);
return;
}
}
......@@ -263,7 +260,6 @@
for (var j = 0; j < this.priceStauts[i].length; j++) {
if (this.priceStauts[i][j] == -1) {
this.lastNot = [i, j];
console.log(this.lastNot);
return;
}
}
......
......@@ -438,10 +438,6 @@
:total-stock="g.totalStock" :status="g.status" @buy="buy">
</kotragoodsaction>
</template>
<goodsku v-if="!loading && showSku&&u.TenantId!=27" border-radius="10" v-model="showSku" :mask-close-able="true"
:safe-area-inset-bottom="true" :good="g" :option-type="ot" :skued="currentSku" @close="closeSkuChosen">
</goodsku>
<template v-if="u&&u.TenantId==27">
<goodsku2 v-if="!loading && showSku" border-radius="10" v-model="showSku" :mask-close-able="true"
:safe-area-inset-bottom="true" :good="g" :option-type="ot" :skued="currentSku" @close="closeSkuChosen">
......
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