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.

166 lines
4.5 KiB

5 months ago
<template>
5 months ago
<div class="main-content12 pb90">
<!-- 参数 在子组件页面一样用 props接收 ref绑定的组件示例 -->
<!-- 默认页面展示 的初始组件 Franchise-->
<component :is="componentsName ? componentsName : 'priceSet'" ref="dynamicComponent" :key="tableKey"
:serviceInfo="siteServiceInfo" @saveEvent="handleSaveEvent"/>
5 months ago
</div>
5 months ago
</template>
<script>
import store from '@/store';
import { mapState } from 'vuex';
import priceSet from '@/components/site/serviceSetting/priceSet.vue'
import paymentSet from '@/components/site/serviceSetting/paymentSet.vue'
import showSet from '@/components/site/serviceSetting/showSet.vue'
import menuColorSet from '@/components/site/serviceSetting/menuColorSet.vue'
import submitSeoSet from '@/components/site/serviceSetting/submitSeoSet.vue'
import reportSeoSet from '@/components/site/serviceSetting/reportSeoSet.vue'
import domainSet from '@/components/site/serviceSetting/domainSet.vue'
import linkSet from '@/components/site/serviceSetting/linkSet.vue'
5 months ago
5 months ago
export default {
// 服务个性化设置
name: 'siteServiceEdit',
5 months ago
props: [''],
components: {
priceSet,
paymentSet,
showSet,
menuColorSet,
submitSeoSet,
reportSeoSet,
domainSet,
linkSet,
5 months ago
},
data() {
return {
siteServiceInfo:{},
tableKey:Date.now(),
5 months ago
}
},
computed: {
...mapState(['pageTitle', 'componentsName']), // 从Vuex映射showSidebar状态到组件的计算属性中
5 months ago
},
created() {
if(!this.$route.query.uid && !this.$route.query.type) {
this.$message.error('非法请求');
this.$router.push('/agent/siteList')
}
this.uid = this.$route.query.uid;
this.type = this.$route.query.type;
store.commit('SET_CUSTOMIZE', true);
store.commit('SET_SLIDER_MENU', 'siteServiceSettingData');
5 months ago
this.loadPddSDK()
this.getSiteServiceInfo()
5 months ago
},
mounted() {
store.commit('SET_PAGETITLE', '服务设置');
5 months ago
},
methods: {
5 months ago
loadPddSDK() {
const script = document.createElement('script');
script.src = 'https://pfile.pddpic.com/galerie-go/open_sdk/pc.202102201613.js';
document.head.appendChild(script);
},
handleSaveEvent(payload) {
this.siteServiceInfo = payload
5 months ago
},
getSiteServiceInfo() {
const that = this
that.payList = []
this.$http('POST', '/agentnew/ajax_get_service_info', {
uid: that.uid,
type: that.type,
}).then(response => {
that.$nextTick(() => {
4 months ago
that.siteServiceInfo = response.data
store.commit('SET_BREADRIGHTTEXT', {
text: response.data.site_short_name,
link: response.data.site_domain
});
5 months ago
that.getPayList()
})
}).catch(error => {
console.error(error, 'error')
})
},
getPayList() {
const that = this
that.payList = []
this.$http('POST', '/agentnew/ajax_get_service_pay_list', {
uid: that.uid,
type: that.type,
}).then(response => {
this.$nextTick(() => {
that.siteServiceInfo.paylist = response.data.paylist
that.tableKey = Date.now();
})
}).catch(error => {
console.error(error, 'error')
})
5 months ago
},
}
}
</script>
<style lang="scss" scoped>
5 months ago
.pb90{
padding-bottom: 90px;
}
::v-deep .flex-left{
text-align: left;
5 months ago
}
::v-deep .flex-right{
text-align: left;
5 months ago
}
::v-deep .mb16{
margin-bottom: 16px;
}
5 months ago
::v-deep .pageheader {
5 months ago
display: flex;
justify-content: space-between;
/* 关键属性 */
5 months ago
align-items: center;
margin-bottom: 24px;
5 months ago
}
::v-deep .pagetitle {
font-size: 18px;
font-weight: bold;
line-height: normal;
letter-spacing: 0.08em;
color: #1E2226;
margin-top: 8px;
5 months ago
}
::v-deep .save-button{
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background: #fff;
box-shadow: 0 4px 16px 0 rgba(17, 55, 143, 0.12);
5 months ago
display: flex;
align-items: center;
justify-content: center;
padding: 16px 0;
z-index: 9;
5 months ago
}
::v-deep .payment-item{
width: 540px;
height: 95px;
padding: 0 24px;
background: #FAFAFA;
border-radius: 4px;
border: none;
margin-bottom: 12px;
}
5 months ago
</style>