Commit 53f133ad authored by 徐一鸣's avatar 徐一鸣

应用商店服务详情优化

parent e1c7cc5a
......@@ -62,7 +62,10 @@
</div>
<div class="commodity_information">
<span>规格说明:</span>
<span class="commodity_text" v-text="specification.descript"></span>
<span
class="commodity_text"
v-text="specification && specification.descript"
></span>
</div>
<div class="commodity_information">
<span>购买方式:</span>
......@@ -125,10 +128,6 @@ export default {
(item) => item.type == this.type
);
if (this.specification.id === undefined) {
this.specification = specifications[0];
}
return specifications;
},
},
......@@ -146,6 +145,9 @@ export default {
},
changeType({ value }) {
this.type = value;
if (this.specifications.length > 0) {
this.specification = this.specifications[0];
}
},
addToCart() {
// console.log("addToCart");
......@@ -183,6 +185,11 @@ export default {
console.log("applyImmediately");
},
},
mounted() {
if (this.specifications.length > 0) {
this.specification = this.specifications[0];
}
},
};
</script>
......
......@@ -56,12 +56,15 @@ export default {
})
.then(({ data }) => {
let datas = data.data;
let specificationData = datas.serviceRequestSpcs.map((item) => ({
id: item.id,
type: item.type,
name: `访问次数:${item.pv}/日 访问量:${item.count}/日`,
descript: item.des,
}));
let specificationData =
(datas.serviceRequestSpcs &&
datas.serviceRequestSpcs.map((item) => ({
id: item.id,
type: item.type,
name: `访问次数:${item.pv}/日 访问量:${item.count}/日`,
descript: item.des,
}))) ||
[];
this.baseInfo = {
service_id: this.id,
......
......@@ -61,12 +61,14 @@ export default {
})
.then(({ data }) => {
let datas = data.data;
let specificationData = datas.serviceRequestSpcs.map((item) => ({
id: item.id,
type: item.type,
name: `访问次数:${item.pv}/日 访问量:${item.count}/日`,
descript: item.des,
}));
(datas.serviceRequestSpcs &&
datas.serviceRequestSpcs.map((item) => ({
id: item.id,
type: item.type,
name: `访问次数:${item.pv}/日 访问量:${item.count}/日`,
descript: item.des,
}))) ||
[];
this.baseInfo = {
service_id: this.id,
......
......@@ -61,12 +61,14 @@ export default {
})
.then(({ data }) => {
let datas = data.data;
let specificationData = datas.serviceRequestSpcs.map((item) => ({
id: item.id,
type: item.type,
name: `访问次数:${item.pv}/日 访问量:${item.count}/日`,
descript: item.des,
}));
(datas.serviceRequestSpcs &&
datas.serviceRequestSpcs.map((item) => ({
id: item.id,
type: item.type,
name: `访问次数:${item.pv}/日 访问量:${item.count}/日`,
descript: item.des,
}))) ||
[];
this.baseInfo = {
service_id: this.id,
......
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