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.

179 lines
5.0 KiB

3 weeks ago
<template>
1 week ago
<div class="main-content12 pb90">
<!-- 参数 在子组件页面一样用 props接收 ref绑定的组件示例 -->
<!-- 默认页面展示 的初始组件 Franchise-->
<component :is="componentsName ? componentsName : 'priceSet'" ref="dynamicComponent" :key="tableKey"
:serviceInfo="siteServiceInfo" @saveEvent="handleSaveEvent"/>
3 weeks ago
</div>
3 weeks 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'
2 weeks ago
3 weeks ago
export default {
// 服务个性化设置
name: 'siteServiceEdit',
3 weeks ago
props: [''],
components: {
priceSet,
paymentSet,
showSet,
menuColorSet,
submitSeoSet,
reportSeoSet,
domainSet,
linkSet,
3 weeks ago
},
data() {
return {
// AUTH
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTAwNTM3MjQsIm5iZiI6MTc1MDA1MzcyNCwiZXhwIjoxNzUyNjQ1NzI0LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.xyIqBLelB-k6jCifgRevBJTyg_Qrm6m1e4OcHhOpepU',
siteServiceInfo:{},
tableKey:Date.now(),
payinfo: [
{
type: 'a',
name: '传递的参数'
}
],
payType: -1,
payStatus: -1,
paySvg: '',
confirmText: '保存',
3 weeks ago
}
},
computed: {
...mapState(['pageTitle', 'componentsName']), // 从Vuex映射showSidebar状态到组件的计算属性中
3 weeks 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');
this.getSiteServiceInfo()
this.getPayList()
3 weeks ago
},
mounted() {
store.commit('SET_PAGETITLE', '服务设置');
3 weeks ago
},
methods: {
handleSaveEvent(payload) {
this.siteServiceInfo = payload
3 weeks ago
},
getSiteServiceInfo() {
const that = this
that.payList = []
this.$http('POST', '/agentnew/ajax_get_service_info', {
uid: that.uid,
type: that.type,
},{
headers:{
'Auth': this.token
}
}).then(response => {
that.$nextTick(() => {
that.siteServiceInfo = response.data.service_info
that.siteServiceInfo.paylist = []
this.tableKey = Date.now();
store.commit('SET_BREADRIGHTTEXT', response.data.site_short_name);
})
}).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,
},{
headers:{
'Auth': this.token
}
}).then(response => {
this.$nextTick(() => {
that.siteServiceInfo.paylist = response.data.paylist
that.tableKey = Date.now();
})
}).catch(error => {
console.error(error, 'error')
})
3 weeks ago
},
}
}
</script>
<style lang="scss" scoped>
1 week ago
.pb90{
padding-bottom: 90px;
}
::v-deep .flex-left{
text-align: left;
3 weeks ago
}
::v-deep .flex-right{
text-align: left;
3 weeks ago
}
::v-deep .mb16{
margin-bottom: 16px;
}
3 weeks ago
::v-deep .pageheader {
2 weeks ago
display: flex;
justify-content: space-between;
/* 关键属性 */
2 weeks ago
align-items: center;
margin-bottom: 24px;
3 weeks ago
}
::v-deep .pagetitle {
font-size: 18px;
font-weight: bold;
line-height: normal;
letter-spacing: 0.08em;
color: #1E2226;
margin-top: 8px;
3 weeks 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);
2 weeks ago
display: flex;
align-items: center;
justify-content: center;
padding: 16px 0;
z-index: 9;
3 weeks ago
}
::v-deep .payment-item{
width: 540px;
height: 95px;
padding: 0 24px;
background: #FAFAFA;
border-radius: 4px;
border: none;
margin-bottom: 12px;
}
3 weeks ago
</style>