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

应用商店服务详情优化

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