You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
2.3 KiB

<template>
<div>
5 years ago
<div class="inner my-1">
5 years ago
<a-breadcrumb>
<a-breadcrumb-item>绿谷生物</a-breadcrumb-item>
5 years ago
<a-breadcrumb-item :key="index" v-for="(item, index) in serviceArr">
5 years ago
<router-link :to="item.url">{{ item.name }}</router-link>
</a-breadcrumb-item>
</a-breadcrumb>
</div>
5 years ago
<banner :show-page="showPage" />
<div class="posi-name">
<p class="service-name">{{ obj.name }}</p>
<p class="service-eng">SERVICE</p>
</div>
<div class="inner service-box">
5 years ago
<div style="margin-bottom: 40px" v-dompurify-html="obj.content"></div>
<div>
<!-- <a-button>直接申请</a-button> -->
5 years ago
<intention-model :type-data="typeData" style="float: left; margin-right: 20px" />
<!-- <a-button type="primary">加入购物车</a-button> -->
<add-shopping :type-data="typeData" />
</div>
</div>
</div>
</template>
<script>
5 years ago
import { mapState } from 'vuex';
import { selContent } from 'config/api';
import IntentionModel from 'components/Introduce/IntentionModel.vue';
5 years ago
import Banner from 'components/Banner/Banner.vue';
import AddShopping from 'components/Introduce/AddShopping.vue';
export default {
name: 'ServiceDet',
5 years ago
components: { IntentionModel, Banner, AddShopping },
data() {
return {
5 years ago
showPage: 100,
obj: {
name: '',
id: '',
content: '',
},
typeData: {
type: 0,
Id: '',
},
};
},
5 years ago
computed: mapState('home', ['serviceArr']),
async created() {
this.typeData.Id = this.$route.params.id;
5 years ago
await this.getData(this.$route.params.id);
},
5 years ago
methods: {
async getData(id) {
try {
const params = { param: { id } };
const res = await selContent(params);
const { code, msg, data } = res.data;
if (code === 200) {
5 years ago
// console.log(data);
this.obj = data;
}
} catch (error) {
5 years ago
// console.log(error);
}
},
},
};
</script>
<style lang="stylus" scoped>
.service-box {
margin: 60px auto;
min-height: 400px;
padding: 20px;
background: #fff;
}
.posi-name {
position: absolute;
left: 20%;
top: 300px;
color: #fff;
text-align: center;
}
.service-name {
font-size: 40px;
margin-bottom: 0 !important;
}
.service-eng {
font-size: 16px;
}
</style>