|
|
@ -6,36 +6,38 @@ |
|
|
|
<h3>站点信息</h3> |
|
|
|
<div class="flex-wrap"> |
|
|
|
<div class="flex-left"> |
|
|
|
<GuipFormItem column="column" class="mb24"> |
|
|
|
<div slot="formLeft">站点简称</div> |
|
|
|
<div slot="formRight" class="desc">一个站点对应一个销售渠道,定义好名字好区分</div> |
|
|
|
<GuipInput slot="formDom" ref="GuipInput" prop="short_name" :maxlength="10" :showWordLimit="true" |
|
|
|
v-model="formData.short_name" placeholder="仅自己区分站点销售渠道,客户看不到" /> |
|
|
|
</GuipFormItem> |
|
|
|
<GuipFormItem column="column" class="channel-radio"> |
|
|
|
<div slot="formLeft">销售渠道</div> |
|
|
|
<span slot="formRight" class="desc">{{formData.sale_channel_label}}</span> |
|
|
|
<GuipRadio slot="formDom" v-model="formData.sale_channel" :options="formData.sale_channels" |
|
|
|
prop="sale_channel" :rules="formRules.sale_channel" @change="radioChange" /> |
|
|
|
</GuipFormItem> |
|
|
|
<GuipInput label="站点简称" class="column" ref="GuipInput" prop="short_name" |
|
|
|
desc="一个站点对应一个销售渠道,定义好名字好区分" :maxlength="10" :showWordLimit="true" |
|
|
|
v-model="formData.short_name" placeholder="仅自己区分站点销售渠道,客户看不到" /> |
|
|
|
<GuipRadio label="销售渠道" class="column" :desc="formData.sale_channel_label" |
|
|
|
v-model="formData.sale_channel" :options="formData.sale_channels" prop="sale_channel" |
|
|
|
:rules="formRules.sale_channel" @change="radioChange" /> |
|
|
|
</div> |
|
|
|
<div class="flex-line"></div> |
|
|
|
<div class="flex-right"> |
|
|
|
<GuipFormItem column="column" class="mb24"> |
|
|
|
<div slot="formLeft">域名来源</div> |
|
|
|
<GuipRadio slot="formDom" v-model="formData.domain_type" :options="formData.domain_types" prop="domain"/> |
|
|
|
<GuipRadio slot="formDom" v-model="formData.domain_type" |
|
|
|
:options="formData.domain_types" prop="domain" /> |
|
|
|
</GuipFormItem> |
|
|
|
<GuipFormItem column="column" v-if="formData.domain_type==='1'"> |
|
|
|
<!-- <GuipFormItem column="column" v-if="formData.domain_type === '1'"> |
|
|
|
<div slot="formLeft">域名设置</div> |
|
|
|
<GuipInput slot="formDom" ref="GuipInput" prop="domain_prefix" placeholder="仅支持数字、字母" |
|
|
|
v-model="formData.domain_prefix" :rules="formRules.domain_prefix" class="w540"> |
|
|
|
<i slot="suffix" v-if="formData.domain_prefix" class="el-icon-close" @click="handleClear"></i> |
|
|
|
<span slot="appendshow">{{formData.plat_domain}}</span> |
|
|
|
<GuipInput slot="formDom" v-if="formData.domain_type === '1'" label="域名设置" ref="GuipInput" prop="domain_prefix" placeholder="仅支持数字、字母" |
|
|
|
v-model="formData.domain_prefix" :rules="formRules.domain_prefix" class="w540"> |
|
|
|
<i slot="suffix" v-if="formData.domain_prefix" class="el-icon-close" |
|
|
|
@click="handleClear"></i> |
|
|
|
<span slot="appendshow">{{ formData.plat_domain }}</span> |
|
|
|
</GuipInput> |
|
|
|
</GuipFormItem> |
|
|
|
<GuipFormItem column="column" v-if="formData.domain_type==='2'"> |
|
|
|
<div slot="formLeft">域名设置</div> |
|
|
|
<domainBind ref="domainBind" slot="formDom" :defaultPrefix="formData.domain_prefix" :defaultDomain="formData.domain_name" @handleEvent="handleChangeDomain" /> |
|
|
|
</GuipFormItem> --> |
|
|
|
<GuipInput v-if="formData.domain_type === '1'" label="域名设置" ref="GuipInput" prop="domain_prefix" placeholder="仅支持数字、字母" |
|
|
|
v-model="formData.domain_prefix" :rules="formRules.domain_prefix" class="column w540"> |
|
|
|
<i slot="suffix" v-if="formData.domain_prefix" class="el-icon-close" |
|
|
|
@click="handleClear"></i> |
|
|
|
<span slot="appendshow">{{ formData.plat_domain }}</span> |
|
|
|
</GuipInput> |
|
|
|
<GuipFormItem column="column" :required="true" label="域名设置" v-if="formData.domain_type === '2'"> |
|
|
|
<domainBind ref="domainBind" slot="formDom" :defaultPrefix="formData.domain_prefix" |
|
|
|
:defaultDomain="formData.domain_name" @handleEvent="handleChangeDomain" /> |
|
|
|
</GuipFormItem> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -46,20 +48,22 @@ |
|
|
|
<div class="flex-left"> |
|
|
|
<p class="flex-left-desc">销售方向</p> |
|
|
|
<div class="flex mt12"> |
|
|
|
<GuipRadio v-model="formData.site_type" :options="formData.site_types" :rules="formRules.sale_channel" prop="site_type" @change="radioTypeChange" /> |
|
|
|
<GuipRadio v-model="formData.site_type" :options="formData.site_types" |
|
|
|
:rules="formRules.sale_channel" prop="site_type" @change="radioTypeChange" /> |
|
|
|
</div> |
|
|
|
<div class="tem-home"> |
|
|
|
<div class="tem-home-top"> |
|
|
|
<img :src="formData.picture?formData.picture:require('@/assets/register/tem-img-normal.png')" alt=""> |
|
|
|
<img :src="formData.picture ? formData.picture : require('@/assets/register/tem-img-normal.png')" |
|
|
|
alt=""> |
|
|
|
</div> |
|
|
|
<div class="tem-home-bottom"> |
|
|
|
<input type="hidden" v-model="formData.site_tpl"> |
|
|
|
<b>{{formData.site_tpl_name}}</b> |
|
|
|
<b>{{ formData.site_tpl_name }}</b> |
|
|
|
<div> |
|
|
|
<!-- <div class="tem-look" @click="previewTpl">--> |
|
|
|
<!-- <img src="@/assets/register/look-tem.svg" alt="">--> |
|
|
|
<!-- 预览--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- <div class="tem-look" @click="previewTpl">--> |
|
|
|
<!-- <img src="@/assets/register/look-tem.svg" alt="">--> |
|
|
|
<!-- 预览--> |
|
|
|
<!-- </div>--> |
|
|
|
<div @click="changeTpl"> |
|
|
|
<img src="@/assets/register/edit-tem.svg" alt=""> |
|
|
|
修改 |
|
|
@ -89,8 +93,10 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="register-btns"> |
|
|
|
<GuipButton v-if="skip" type="ignore" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">跳过</GuipButton> |
|
|
|
<GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="saveConfirm">下一步</GuipButton> |
|
|
|
<GuipButton v-if="skip" type="ignore" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep"> |
|
|
|
跳过</GuipButton> |
|
|
|
<GuipButton ref="nextStepRef1" type="primary" :btnstyle="{ width: '144px', height: '46px' }" |
|
|
|
@click="saveConfirm">下一步</GuipButton> |
|
|
|
</div> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
@ -105,341 +111,380 @@ import domainBind from "@/components/domainBind.vue"; |
|
|
|
import db from '@/utils/indexedDBUtil' |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'domainSet', |
|
|
|
props: { |
|
|
|
siteInfo: { |
|
|
|
type: Object, |
|
|
|
required: true |
|
|
|
}, |
|
|
|
skip: { |
|
|
|
type: Boolean, |
|
|
|
required: false |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
|
domainBind, |
|
|
|
GuipFormItem, GuipRadio, GuipInput, |
|
|
|
GuipButton |
|
|
|
}, |
|
|
|
data(){ |
|
|
|
return { |
|
|
|
showAlert: false, |
|
|
|
formData: { |
|
|
|
short_name: '', |
|
|
|
sale_channel: '', |
|
|
|
sale_channel_label: '', |
|
|
|
site_type: '', |
|
|
|
site_tpl: '', |
|
|
|
site_tpl_name: '', |
|
|
|
site_tpl_ico: '', |
|
|
|
site_tpl_logo: '', |
|
|
|
picture:'', |
|
|
|
not_finished_uid: '', |
|
|
|
plat_domain: '', |
|
|
|
domain_type: '', |
|
|
|
domain_prefix: '', |
|
|
|
domain_name: '', |
|
|
|
sale_channels:{}, |
|
|
|
sale_channels_label:{}, |
|
|
|
domain_types:{}, |
|
|
|
site_types:{}, |
|
|
|
site_type_tpl:{}, |
|
|
|
}, |
|
|
|
formRules: { |
|
|
|
short_name: [ |
|
|
|
{ required: true, message: '请输入站点简称', trigger: 'blur' } |
|
|
|
], |
|
|
|
sale_channel: [ |
|
|
|
{ required: true, message: '请选择销售渠道', trigger: 'blur' } |
|
|
|
], |
|
|
|
domain_prefix: [ |
|
|
|
{ required: true, message: '请设置站点域名', trigger: 'blur' } |
|
|
|
], |
|
|
|
site_type: [ |
|
|
|
{ required: true, message: '请选择站点类型', trigger: 'blur' } |
|
|
|
], |
|
|
|
name: 'domainSet', |
|
|
|
props: { |
|
|
|
siteInfo: { |
|
|
|
type: Object, |
|
|
|
required: true |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
submitData() { |
|
|
|
let domain = ""; |
|
|
|
if (this.formData.domain_type === '1') { |
|
|
|
domain = this.formData.domain_prefix + this.formData.plat_domain |
|
|
|
} else if (this.formData.domain_type === '2') { |
|
|
|
domain = this.formData.domain_prefix + this.formData.domain_name |
|
|
|
skip: { |
|
|
|
type: Boolean, |
|
|
|
required: false |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
|
domainBind, |
|
|
|
GuipFormItem, GuipRadio, GuipInput, |
|
|
|
GuipButton |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
short_name: this.formData.short_name, |
|
|
|
domain: domain, |
|
|
|
sale_channel: this.formData.sale_channel, |
|
|
|
site_type: this.formData.site_type, |
|
|
|
site_tpl: this.formData.site_tpl, |
|
|
|
not_finished_uid: this.formData.not_finished_uid, |
|
|
|
ico: this.formData.site_tpl_ico, |
|
|
|
logo: this.formData.site_tpl_logo, |
|
|
|
showAlert: false, |
|
|
|
formData: { |
|
|
|
short_name: '', |
|
|
|
sale_channel: '', |
|
|
|
sale_channel_label: '', |
|
|
|
site_type: '', |
|
|
|
site_tpl: '', |
|
|
|
site_tpl_name: '', |
|
|
|
site_tpl_ico: '', |
|
|
|
site_tpl_logo: '', |
|
|
|
picture: '', |
|
|
|
not_finished_uid: '', |
|
|
|
plat_domain: '', |
|
|
|
domain_type: '', |
|
|
|
domain_prefix: '', |
|
|
|
domain_name: '', |
|
|
|
sale_channels: {}, |
|
|
|
sale_channels_label: {}, |
|
|
|
domain_types: {}, |
|
|
|
site_types: {}, |
|
|
|
site_type_tpl: {}, |
|
|
|
}, |
|
|
|
formRules: { |
|
|
|
short_name: [ |
|
|
|
{ required: true, message: '请输入站点简称', trigger: 'blur' } |
|
|
|
], |
|
|
|
sale_channel: [ |
|
|
|
{ required: true, message: '请选择销售渠道', trigger: 'blur' } |
|
|
|
], |
|
|
|
domain_prefix: [ |
|
|
|
{ required: true, message: '请设置站点域名', trigger: 'blur' } |
|
|
|
], |
|
|
|
site_type: [ |
|
|
|
{ required: true, message: '请选择站点类型', trigger: 'blur' } |
|
|
|
], |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
const formData = JSON.parse(localStorage.getItem('formData')) |
|
|
|
if(formData){ |
|
|
|
this.formData = formData; |
|
|
|
localStorage.removeItem('formData') |
|
|
|
this.getSiteTplSet() |
|
|
|
return true; |
|
|
|
} |
|
|
|
computed: { |
|
|
|
submitData() { |
|
|
|
let domain = ""; |
|
|
|
if (this.formData.domain_type === '1') { |
|
|
|
domain = this.formData.domain_prefix + this.formData.plat_domain |
|
|
|
} else if (this.formData.domain_type === '2') { |
|
|
|
domain = this.formData.domain_prefix + this.formData.domain_name |
|
|
|
} |
|
|
|
return { |
|
|
|
short_name: this.formData.short_name, |
|
|
|
domain: domain, |
|
|
|
sale_channel: this.formData.sale_channel, |
|
|
|
site_type: this.formData.site_type, |
|
|
|
site_tpl: this.formData.site_tpl, |
|
|
|
not_finished_uid: this.formData.not_finished_uid, |
|
|
|
ico: this.formData.site_tpl_ico, |
|
|
|
logo: this.formData.site_tpl_logo, |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
const formData = JSON.parse(localStorage.getItem('formData')) |
|
|
|
if (formData) { |
|
|
|
this.formData = formData; |
|
|
|
localStorage.removeItem('formData') |
|
|
|
this.getSiteTplSet() |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
if(this.skip && !localStorage.getItem('showAlert')) this.showAlert = true |
|
|
|
this.getAddInfo() |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
hideAlert(){ |
|
|
|
this.showAlert = false |
|
|
|
localStorage.setItem('showAlert', false) |
|
|
|
}, |
|
|
|
async getSiteTplSet(){ |
|
|
|
const siteTplInfo = JSON.parse(localStorage.getItem('site_tpl_info')) |
|
|
|
if(siteTplInfo){ |
|
|
|
this.formData.site_tpl = siteTplInfo.site_tpl |
|
|
|
this.formData.site_tpl_name = siteTplInfo.site_tpl_name |
|
|
|
this.formData.picture = siteTplInfo.picture |
|
|
|
} |
|
|
|
if (this.skip && !localStorage.getItem('showAlert')) this.showAlert = true |
|
|
|
this.getAddInfo() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
hideAlert() { |
|
|
|
this.showAlert = false |
|
|
|
localStorage.setItem('showAlert', false) |
|
|
|
}, |
|
|
|
async getSiteTplSet() { |
|
|
|
const siteTplInfo = JSON.parse(localStorage.getItem('site_tpl_info')) |
|
|
|
if (siteTplInfo) { |
|
|
|
this.formData.site_tpl = siteTplInfo.site_tpl |
|
|
|
this.formData.site_tpl_name = siteTplInfo.site_tpl_name |
|
|
|
this.formData.picture = siteTplInfo.picture |
|
|
|
} |
|
|
|
|
|
|
|
const ico = await db.get('ico') |
|
|
|
if(ico) this.formData.site_tpl_ico = ico |
|
|
|
const logo = await db.get('logo') |
|
|
|
if(logo) this.formData.site_tpl_logo = logo |
|
|
|
}, |
|
|
|
getAddInfo() { |
|
|
|
const that = this |
|
|
|
this.$http('POST', '/agentnew/ajax_get_site_add_info', {}).then(response => { |
|
|
|
if(response.status){ |
|
|
|
const addInfo = response.data |
|
|
|
that.formData.sale_channels = addInfo.sale_channels |
|
|
|
that.formData.sale_channels_label = addInfo.sale_channels_label |
|
|
|
const ico = await db.get('ico') |
|
|
|
if (ico) this.formData.site_tpl_ico = ico |
|
|
|
const logo = await db.get('logo') |
|
|
|
if (logo) this.formData.site_tpl_logo = logo |
|
|
|
}, |
|
|
|
getAddInfo() { |
|
|
|
const that = this |
|
|
|
this.$http('POST', '/agentnew/ajax_get_site_add_info', {}).then(response => { |
|
|
|
if (response.status) { |
|
|
|
const addInfo = response.data |
|
|
|
that.formData.sale_channels = addInfo.sale_channels |
|
|
|
that.formData.sale_channels_label = addInfo.sale_channels_label |
|
|
|
|
|
|
|
that.formData.domain_type = String(addInfo.domain_type) |
|
|
|
that.formData.domain_types = addInfo.domain_types |
|
|
|
that.formData.plat_domain = addInfo.plat_domain |
|
|
|
that.formData.domain_type = String(addInfo.domain_type) |
|
|
|
that.formData.domain_types = addInfo.domain_types |
|
|
|
that.formData.plat_domain = addInfo.plat_domain |
|
|
|
|
|
|
|
that.formData.site_type = String(addInfo.site_type) |
|
|
|
that.formData.site_types = addInfo.site_types |
|
|
|
that.formData.site_type_tpl = addInfo.site_type_tpl |
|
|
|
if(that.formData.site_type){ |
|
|
|
that.formData.site_tpl = this.formData.site_type_tpl[this.formData.site_type].site_tpl |
|
|
|
that.formData.site_tpl_name = this.formData.site_type_tpl[this.formData.site_type].site_tpl_name |
|
|
|
that.formData.picture = this.formData.site_type_tpl[this.formData.site_type].picture |
|
|
|
} |
|
|
|
that.formData.site_type = String(addInfo.site_type) |
|
|
|
that.formData.site_types = addInfo.site_types |
|
|
|
that.formData.site_type_tpl = addInfo.site_type_tpl |
|
|
|
if (that.formData.site_type) { |
|
|
|
that.formData.site_tpl = this.formData.site_type_tpl[this.formData.site_type].site_tpl |
|
|
|
that.formData.site_tpl_name = this.formData.site_type_tpl[this.formData.site_type].site_tpl_name |
|
|
|
that.formData.picture = this.formData.site_type_tpl[this.formData.site_type].picture |
|
|
|
} |
|
|
|
|
|
|
|
if(Object.keys(that.siteInfo).length>0){ |
|
|
|
that.$nextTick(() => { |
|
|
|
that.formData.short_name = that.siteInfo.short_name |
|
|
|
that.formData.sale_channel = String(that.siteInfo.sale_channel) |
|
|
|
that.formData.site_type = String(that.siteInfo.site_type) |
|
|
|
that.formData.site_tpl = that.siteInfo.site_tpl |
|
|
|
that.formData.site_tpl_name = that.siteInfo.site_tpl_name |
|
|
|
that.formData.picture = that.siteInfo.picture |
|
|
|
that.formData.not_finished_uid = that.siteInfo.uid |
|
|
|
if (Object.keys(that.siteInfo).length > 0) { |
|
|
|
that.$nextTick(() => { |
|
|
|
that.formData.short_name = that.siteInfo.short_name |
|
|
|
that.formData.sale_channel = String(that.siteInfo.sale_channel) |
|
|
|
that.formData.site_type = String(that.siteInfo.site_type) |
|
|
|
that.formData.site_tpl = that.siteInfo.site_tpl |
|
|
|
that.formData.site_tpl_name = that.siteInfo.site_tpl_name |
|
|
|
that.formData.picture = that.siteInfo.picture |
|
|
|
that.formData.not_finished_uid = that.siteInfo.uid |
|
|
|
|
|
|
|
that.formData.domain_type = String(that.siteInfo.domain_type) |
|
|
|
that.formData.domain_prefix = that.siteInfo.domain_prefix; |
|
|
|
that.formData.domain_name = that.siteInfo.domain_name; |
|
|
|
}) |
|
|
|
} |
|
|
|
return true |
|
|
|
} |
|
|
|
that.$message.error(response.info); |
|
|
|
}).catch(error => { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
|
}, |
|
|
|
radioChange(){ |
|
|
|
const labels = this.formData.sale_channels_label; |
|
|
|
const value = this.formData.sale_channel; |
|
|
|
this.formData.sale_channel_label = labels && labels[value] ? labels[value] : ''; |
|
|
|
}, |
|
|
|
radioTypeChange(){ |
|
|
|
if(this.formData.site_type){ |
|
|
|
this.formData.site_tpl = this.formData.site_type_tpl[this.formData.site_type].site_tpl |
|
|
|
this.formData.site_tpl_name = this.formData.site_type_tpl[this.formData.site_type].site_tpl_name |
|
|
|
this.formData.picture = this.formData.site_type_tpl[this.formData.site_type].picture |
|
|
|
} |
|
|
|
}, |
|
|
|
handleClear() { |
|
|
|
this.formData.domain_prefix = ''; |
|
|
|
}, |
|
|
|
handleChangeDomain(data) { |
|
|
|
this.formData.domain_prefix = data.prefix |
|
|
|
this.formData.domain_name = data.domain |
|
|
|
}, |
|
|
|
// previewTpl(){ |
|
|
|
// window.open('http://'+this.siteInfo.domain, '_blank'); |
|
|
|
// }, |
|
|
|
changeTpl(){ |
|
|
|
if(this.formData.site_type === ''){ |
|
|
|
this.$message.warning('请选择站点类型'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
localStorage.setItem('formData', JSON.stringify(this.formData)) |
|
|
|
if(this.formData.not_finished_uid){ |
|
|
|
this.$router.push(`/agent/siteTemplate?uid=${this.formData.not_finished_uid}`) |
|
|
|
}else{ |
|
|
|
this.$router.push(`/agent/siteTemplate?site_type=${this.formData.site_type}`) |
|
|
|
} |
|
|
|
}, |
|
|
|
jumpStep(){ |
|
|
|
this.$router.push('/') |
|
|
|
}, |
|
|
|
saveConfirm() { |
|
|
|
const that = this |
|
|
|
let formValid = false; |
|
|
|
that.$refs.formRef.validate((valid) => { |
|
|
|
formValid = valid |
|
|
|
}); |
|
|
|
that.formData.domain_type = String(that.siteInfo.domain_type) |
|
|
|
that.formData.domain_prefix = that.siteInfo.domain_prefix; |
|
|
|
that.formData.domain_name = that.siteInfo.domain_name; |
|
|
|
}) |
|
|
|
} |
|
|
|
return true |
|
|
|
} |
|
|
|
that.$message.error(response.info); |
|
|
|
}).catch(error => { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
|
}, |
|
|
|
radioChange() { |
|
|
|
const labels = this.formData.sale_channels_label; |
|
|
|
const value = this.formData.sale_channel; |
|
|
|
this.formData.sale_channel_label = labels && labels[value] ? labels[value] : ''; |
|
|
|
}, |
|
|
|
radioTypeChange() { |
|
|
|
if (this.formData.site_type) { |
|
|
|
this.formData.site_tpl = this.formData.site_type_tpl[this.formData.site_type].site_tpl |
|
|
|
this.formData.site_tpl_name = this.formData.site_type_tpl[this.formData.site_type].site_tpl_name |
|
|
|
this.formData.picture = this.formData.site_type_tpl[this.formData.site_type].picture |
|
|
|
} |
|
|
|
}, |
|
|
|
handleClear() { |
|
|
|
this.formData.domain_prefix = ''; |
|
|
|
}, |
|
|
|
handleChangeDomain(data) { |
|
|
|
this.formData.domain_prefix = data.prefix |
|
|
|
this.formData.domain_name = data.domain |
|
|
|
}, |
|
|
|
// previewTpl(){ |
|
|
|
// window.open('http://'+this.siteInfo.domain, '_blank'); |
|
|
|
// }, |
|
|
|
changeTpl() { |
|
|
|
if (this.formData.site_type === '') { |
|
|
|
this.$message.warning('请选择站点类型'); |
|
|
|
return false; |
|
|
|
} |
|
|
|
localStorage.setItem('formData', JSON.stringify(this.formData)) |
|
|
|
if (this.formData.not_finished_uid) { |
|
|
|
this.$router.push(`/agent/siteTemplate?uid=${this.formData.not_finished_uid}`) |
|
|
|
} else { |
|
|
|
this.$router.push(`/agent/siteTemplate?site_type=${this.formData.site_type}`) |
|
|
|
} |
|
|
|
}, |
|
|
|
jumpStep() { |
|
|
|
this.$router.push('/') |
|
|
|
}, |
|
|
|
validateFunc(fields){ |
|
|
|
const that = this |
|
|
|
let flag = false |
|
|
|
// 遍历每个表单项 |
|
|
|
if(Array.isArray(fields)){ |
|
|
|
fields.forEach(field => { |
|
|
|
if (flag) return |
|
|
|
// 验证单个字段 |
|
|
|
field.validate('', (error) => { |
|
|
|
if (error) { |
|
|
|
// 获取字段的label |
|
|
|
const label = field.label; |
|
|
|
const prop = field.prop; |
|
|
|
|
|
|
|
let domainValid = false; |
|
|
|
if(that.formData.domain_type === '2'){ |
|
|
|
that.$refs.domainBind.$refs.bindFormRef.validate(valid => { |
|
|
|
domainValid = valid |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
domainValid = true |
|
|
|
} |
|
|
|
flag = true; |
|
|
|
console.log('label',prop, label); |
|
|
|
if (!label) return |
|
|
|
that.$positionMessage({ |
|
|
|
type: 'error', |
|
|
|
message: label + '不得为空', |
|
|
|
target: that.$refs.nextStepRef1, // 可以是DOM元素或选择器 |
|
|
|
position: 'top' |
|
|
|
}) |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
saveConfirm() { |
|
|
|
const that = this |
|
|
|
let formValid = false; |
|
|
|
let fields = that.$refs.formRef.fields; |
|
|
|
that.validateFunc(fields) |
|
|
|
that.$refs.formRef.validate((valid) => { |
|
|
|
formValid = valid |
|
|
|
}); |
|
|
|
let domainValid = false; |
|
|
|
if (that.formData.domain_type === '2') { |
|
|
|
that.$refs.domainBind.$refs.bindFormRef.validate(valid => { |
|
|
|
domainValid = valid |
|
|
|
}) |
|
|
|
that.$positionMessage({ |
|
|
|
type: 'error', |
|
|
|
message: '域名设置不得为空', |
|
|
|
target: that.$refs.nextStepRef1, // 可以是DOM元素或选择器 |
|
|
|
position: 'top' |
|
|
|
}) |
|
|
|
} else { |
|
|
|
domainValid = true |
|
|
|
} |
|
|
|
|
|
|
|
if (formValid && domainValid) { |
|
|
|
that.$http('POST', '/agentnew/ajax_add_new_site', that.submitData).then(async response => { |
|
|
|
if(response.status && response.data.uid){ |
|
|
|
await that.deleteSiteTplData() |
|
|
|
if (formValid && domainValid) { |
|
|
|
that.$http('POST', '/agentnew/ajax_add_new_site', that.submitData).then(async response => { |
|
|
|
if (response.status && response.data.uid) { |
|
|
|
await that.deleteSiteTplData() |
|
|
|
|
|
|
|
that.formData.uid = response.data.uid |
|
|
|
that.$emit('handelSiteInfo', that.formData) |
|
|
|
that.formData.uid = response.data.uid |
|
|
|
that.$emit('handelSiteInfo', that.formData) |
|
|
|
|
|
|
|
if(that.formData.sale_channel === '2'){ |
|
|
|
//自用站点无需设置收款方式 |
|
|
|
that.$emit('handelStep', 3) |
|
|
|
}else{ |
|
|
|
that.$emit('handelStep', 2) |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
that.$message.error(response.info); |
|
|
|
}).catch(error => { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
async deleteSiteTplData(){ |
|
|
|
localStorage.removeItem('activeStep') |
|
|
|
localStorage.removeItem('site_tpl_info') |
|
|
|
await db.remove('ico') |
|
|
|
await db.remove('logo') |
|
|
|
}, |
|
|
|
} |
|
|
|
if (that.formData.sale_channel === '2') { |
|
|
|
//自用站点无需设置收款方式 |
|
|
|
that.$emit('handelStep', 3) |
|
|
|
} else { |
|
|
|
that.$emit('handelStep', 2) |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
that.$message.error(response.info); |
|
|
|
}).catch(error => { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
async deleteSiteTplData() { |
|
|
|
localStorage.removeItem('activeStep') |
|
|
|
localStorage.removeItem('site_tpl_info') |
|
|
|
await db.remove('ico') |
|
|
|
await db.remove('logo') |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style lang="scss" scoped> |
|
|
|
.w540{ |
|
|
|
width: 540px; |
|
|
|
.w540 { |
|
|
|
width: 540px; |
|
|
|
} |
|
|
|
.mt20{ |
|
|
|
margin-top: 20px; |
|
|
|
|
|
|
|
.mt20 { |
|
|
|
margin-top: 20px; |
|
|
|
} |
|
|
|
.step1-wrap{ |
|
|
|
padding-bottom: 12px; |
|
|
|
|
|
|
|
.step1-wrap { |
|
|
|
padding-bottom: 12px; |
|
|
|
} |
|
|
|
|
|
|
|
.tem-home { |
|
|
|
width: 100%; |
|
|
|
border-radius: 4px; |
|
|
|
opacity: 1; |
|
|
|
background: #FFFFFF; |
|
|
|
/* middle/middle_line_1 */ |
|
|
|
border: 1px solid #DFE2E6; |
|
|
|
|
|
|
|
.tem-home-top { |
|
|
|
width: 100%; |
|
|
|
height: 255px; |
|
|
|
overflow: hidden; |
|
|
|
img{ |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
} |
|
|
|
border-radius: 4px; |
|
|
|
opacity: 1; |
|
|
|
background: #FFFFFF; |
|
|
|
/* middle/middle_line_1 */ |
|
|
|
border: 1px solid #DFE2E6; |
|
|
|
|
|
|
|
.tem-home-bottom { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
padding: 22px 32px; |
|
|
|
justify-content: space-between; |
|
|
|
.tem-home-top { |
|
|
|
width: 100%; |
|
|
|
height: 255px; |
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
.tem-look { |
|
|
|
margin-right: 36px; |
|
|
|
img { |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
div { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
.tem-home-bottom { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
padding: 22px 32px; |
|
|
|
justify-content: space-between; |
|
|
|
|
|
|
|
img { |
|
|
|
margin-right: 6px; |
|
|
|
} |
|
|
|
.tem-look { |
|
|
|
margin-right: 36px; |
|
|
|
} |
|
|
|
|
|
|
|
div { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
|
|
|
|
img { |
|
|
|
margin-right: 6px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
::v-deep{ |
|
|
|
.el-input-group__append{ |
|
|
|
width: 175px; |
|
|
|
letter-spacing: 0.08em; |
|
|
|
} |
|
|
|
::v-deep { |
|
|
|
.el-input-group__append { |
|
|
|
width: 175px; |
|
|
|
letter-spacing: 0.08em; |
|
|
|
} |
|
|
|
|
|
|
|
.channel-radio .el-radio-group{ |
|
|
|
text-align: left; |
|
|
|
} |
|
|
|
.channel-radio .el-radio{ |
|
|
|
min-width: 120px; |
|
|
|
line-height: 16px; |
|
|
|
} |
|
|
|
.channel-radio .el-radio-group { |
|
|
|
text-align: left; |
|
|
|
} |
|
|
|
|
|
|
|
.channel-radio .el-radio { |
|
|
|
min-width: 120px; |
|
|
|
line-height: 16px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.register-btns { |
|
|
|
position: sticky; |
|
|
|
left: 0; |
|
|
|
bottom: 0; |
|
|
|
width: 100%; |
|
|
|
display: flex; |
|
|
|
flex-direction: row; |
|
|
|
justify-content: center; |
|
|
|
background: #FFFFFF; |
|
|
|
padding: 16px 0px; |
|
|
|
/* 蓝色阴影_常规 */ |
|
|
|
box-shadow: 0px 4px 16px 0px rgba(17, 55, 143, 0.12); |
|
|
|
z-index: 999; |
|
|
|
box-sizing: border-box; |
|
|
|
position: sticky; |
|
|
|
left: 0; |
|
|
|
bottom: 0; |
|
|
|
width: 100%; |
|
|
|
display: flex; |
|
|
|
flex-direction: row; |
|
|
|
justify-content: center; |
|
|
|
background: #FFFFFF; |
|
|
|
padding: 16px 0px; |
|
|
|
/* 蓝色阴影_常规 */ |
|
|
|
box-shadow: 0px 4px 16px 0px rgba(17, 55, 143, 0.12); |
|
|
|
z-index: 999; |
|
|
|
box-sizing: border-box; |
|
|
|
|
|
|
|
button:nth-child(1) { |
|
|
|
margin-right: 56px; |
|
|
|
} |
|
|
|
button:nth-child(1) { |
|
|
|
margin-right: 56px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.register-top { |
|
|
|
position: sticky; |
|
|
|
left: 0; |
|
|
|
bottom: 78px; |
|
|
|
width: 100%; |
|
|
|
align-items: center; |
|
|
|
padding: 20px 0; |
|
|
|
background: linear-gradient(270deg, #F6EEF7 3%, #EDE9FB 97%); |
|
|
|
color: #23242B; |
|
|
|
letter-spacing: 0.08em; |
|
|
|
line-height: 32px; |
|
|
|
z-index: 999; |
|
|
|
box-sizing: border-box; |
|
|
|
|
|
|
|
.register-top-left { |
|
|
|
display: flex; |
|
|
|
position: sticky; |
|
|
|
left: 0; |
|
|
|
bottom: 78px; |
|
|
|
width: 100%; |
|
|
|
align-items: center; |
|
|
|
gap: 10px; |
|
|
|
} |
|
|
|
padding: 20px 0; |
|
|
|
background: linear-gradient(270deg, #F6EEF7 3%, #EDE9FB 97%); |
|
|
|
color: #23242B; |
|
|
|
letter-spacing: 0.08em; |
|
|
|
line-height: 32px; |
|
|
|
z-index: 999; |
|
|
|
box-sizing: border-box; |
|
|
|
|
|
|
|
.register-top-left { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
gap: 10px; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |