Browse Source

修改提示信息

pull/112/head
zq 2 months ago
parent
commit
a924ffa017
  1. 185
      src/components/site/addSiteStep/step1.vue
  2. 12
      src/components/site/serviceSetting/domainSet.vue
  3. 2
      src/style/theme/common.scss
  4. 16
      src/views/agent/siteServiceList.vue

185
src/components/site/addSiteStep/step1.vue

@ -6,36 +6,38 @@
<h3>站点信息</h3> <h3>站点信息</h3>
<div class="flex-wrap"> <div class="flex-wrap">
<div class="flex-left"> <div class="flex-left">
<GuipFormItem column="column" class="mb24"> <GuipInput label="站点简称" class="column" ref="GuipInput" prop="short_name"
<div slot="formLeft">站点简称</div> desc="一个站点对应一个销售渠道,定义好名字好区分" :maxlength="10" :showWordLimit="true"
<div slot="formRight" class="desc">一个站点对应一个销售渠道定义好名字好区分</div>
<GuipInput slot="formDom" ref="GuipInput" prop="short_name" :maxlength="10" :showWordLimit="true"
v-model="formData.short_name" placeholder="仅自己区分站点销售渠道,客户看不到" /> v-model="formData.short_name" placeholder="仅自己区分站点销售渠道,客户看不到" />
</GuipFormItem> <GuipRadio label="销售渠道" class="column" :desc="formData.sale_channel_label"
<GuipFormItem column="column" class="channel-radio"> v-model="formData.sale_channel" :options="formData.sale_channels" prop="sale_channel"
<div slot="formLeft">销售渠道</div> :rules="formRules.sale_channel" @change="radioChange" />
<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>
</div> </div>
<div class="flex-line"></div> <div class="flex-line"></div>
<div class="flex-right"> <div class="flex-right">
<GuipFormItem column="column" class="mb24"> <GuipFormItem column="column" class="mb24">
<div slot="formLeft">域名来源</div> <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>
<GuipFormItem column="column" v-if="formData.domain_type==='1'"> <!-- <GuipFormItem column="column" v-if="formData.domain_type === '1'">
<div slot="formLeft">域名设置</div> <div slot="formLeft">域名设置</div>
<GuipInput slot="formDom" ref="GuipInput" prop="domain_prefix" placeholder="仅支持数字、字母" <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"> 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> <i slot="suffix" v-if="formData.domain_prefix" class="el-icon-close"
<span slot="appendshow">{{formData.plat_domain}}</span> @click="handleClear"></i>
<span slot="appendshow">{{ formData.plat_domain }}</span>
</GuipInput> </GuipInput>
</GuipFormItem> </GuipFormItem> -->
<GuipFormItem column="column" v-if="formData.domain_type==='2'"> <GuipInput v-if="formData.domain_type === '1'" label="域名设置" ref="GuipInput" prop="domain_prefix" placeholder="仅支持数字、字母"
<div slot="formLeft">域名设置</div> v-model="formData.domain_prefix" :rules="formRules.domain_prefix" class="column w540">
<domainBind ref="domainBind" slot="formDom" :defaultPrefix="formData.domain_prefix" :defaultDomain="formData.domain_name" @handleEvent="handleChangeDomain" /> <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> </GuipFormItem>
</div> </div>
</div> </div>
@ -46,20 +48,22 @@
<div class="flex-left"> <div class="flex-left">
<p class="flex-left-desc">销售方向</p> <p class="flex-left-desc">销售方向</p>
<div class="flex mt12"> <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>
<div class="tem-home"> <div class="tem-home">
<div class="tem-home-top"> <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>
<div class="tem-home-bottom"> <div class="tem-home-bottom">
<input type="hidden" v-model="formData.site_tpl"> <input type="hidden" v-model="formData.site_tpl">
<b>{{formData.site_tpl_name}}</b> <b>{{ formData.site_tpl_name }}</b>
<div> <div>
<!-- <div class="tem-look" @click="previewTpl">--> <!-- <div class="tem-look" @click="previewTpl">-->
<!-- <img src="@/assets/register/look-tem.svg" alt="">--> <!-- <img src="@/assets/register/look-tem.svg" alt="">-->
<!-- 预览--> <!-- 预览-->
<!-- </div>--> <!-- </div>-->
<div @click="changeTpl"> <div @click="changeTpl">
<img src="@/assets/register/edit-tem.svg" alt=""> <img src="@/assets/register/edit-tem.svg" alt="">
修改 修改
@ -89,8 +93,10 @@
</div> </div>
</div> </div>
<div class="register-btns"> <div class="register-btns">
<GuipButton v-if="skip" type="ignore" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">跳过</GuipButton> <GuipButton v-if="skip" type="ignore" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">
<GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="saveConfirm">下一步</GuipButton> 跳过</GuipButton>
<GuipButton ref="nextStepRef1" type="primary" :btnstyle="{ width: '144px', height: '46px' }"
@click="saveConfirm">下一步</GuipButton>
</div> </div>
</el-form> </el-form>
</div> </div>
@ -121,7 +127,7 @@ export default {
GuipFormItem, GuipRadio, GuipInput, GuipFormItem, GuipRadio, GuipInput,
GuipButton GuipButton
}, },
data(){ data() {
return { return {
showAlert: false, showAlert: false,
formData: { formData: {
@ -133,17 +139,17 @@ export default {
site_tpl_name: '', site_tpl_name: '',
site_tpl_ico: '', site_tpl_ico: '',
site_tpl_logo: '', site_tpl_logo: '',
picture:'', picture: '',
not_finished_uid: '', not_finished_uid: '',
plat_domain: '', plat_domain: '',
domain_type: '', domain_type: '',
domain_prefix: '', domain_prefix: '',
domain_name: '', domain_name: '',
sale_channels:{}, sale_channels: {},
sale_channels_label:{}, sale_channels_label: {},
domain_types:{}, domain_types: {},
site_types:{}, site_types: {},
site_type_tpl:{}, site_type_tpl: {},
}, },
formRules: { formRules: {
short_name: [ short_name: [
@ -183,38 +189,38 @@ export default {
}, },
mounted() { mounted() {
const formData = JSON.parse(localStorage.getItem('formData')) const formData = JSON.parse(localStorage.getItem('formData'))
if(formData){ if (formData) {
this.formData = formData; this.formData = formData;
localStorage.removeItem('formData') localStorage.removeItem('formData')
this.getSiteTplSet() this.getSiteTplSet()
return true; return true;
} }
if(this.skip && !localStorage.getItem('showAlert')) this.showAlert = true if (this.skip && !localStorage.getItem('showAlert')) this.showAlert = true
this.getAddInfo() this.getAddInfo()
}, },
methods:{ methods: {
hideAlert(){ hideAlert() {
this.showAlert = false this.showAlert = false
localStorage.setItem('showAlert', false) localStorage.setItem('showAlert', false)
}, },
async getSiteTplSet(){ async getSiteTplSet() {
const siteTplInfo = JSON.parse(localStorage.getItem('site_tpl_info')) const siteTplInfo = JSON.parse(localStorage.getItem('site_tpl_info'))
if(siteTplInfo){ if (siteTplInfo) {
this.formData.site_tpl = siteTplInfo.site_tpl this.formData.site_tpl = siteTplInfo.site_tpl
this.formData.site_tpl_name = siteTplInfo.site_tpl_name this.formData.site_tpl_name = siteTplInfo.site_tpl_name
this.formData.picture = siteTplInfo.picture this.formData.picture = siteTplInfo.picture
} }
const ico = await db.get('ico') const ico = await db.get('ico')
if(ico) this.formData.site_tpl_ico = ico if (ico) this.formData.site_tpl_ico = ico
const logo = await db.get('logo') const logo = await db.get('logo')
if(logo) this.formData.site_tpl_logo = logo if (logo) this.formData.site_tpl_logo = logo
}, },
getAddInfo() { getAddInfo() {
const that = this const that = this
this.$http('POST', '/agentnew/ajax_get_site_add_info', {}).then(response => { this.$http('POST', '/agentnew/ajax_get_site_add_info', {}).then(response => {
if(response.status){ if (response.status) {
const addInfo = response.data const addInfo = response.data
that.formData.sale_channels = addInfo.sale_channels that.formData.sale_channels = addInfo.sale_channels
that.formData.sale_channels_label = addInfo.sale_channels_label that.formData.sale_channels_label = addInfo.sale_channels_label
@ -226,13 +232,13 @@ export default {
that.formData.site_type = String(addInfo.site_type) that.formData.site_type = String(addInfo.site_type)
that.formData.site_types = addInfo.site_types that.formData.site_types = addInfo.site_types
that.formData.site_type_tpl = addInfo.site_type_tpl that.formData.site_type_tpl = addInfo.site_type_tpl
if(that.formData.site_type){ if (that.formData.site_type) {
that.formData.site_tpl = this.formData.site_type_tpl[this.formData.site_type].site_tpl 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.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.picture = this.formData.site_type_tpl[this.formData.site_type].picture
} }
if(Object.keys(that.siteInfo).length>0){ if (Object.keys(that.siteInfo).length > 0) {
that.$nextTick(() => { that.$nextTick(() => {
that.formData.short_name = that.siteInfo.short_name that.formData.short_name = that.siteInfo.short_name
that.formData.sale_channel = String(that.siteInfo.sale_channel) that.formData.sale_channel = String(that.siteInfo.sale_channel)
@ -254,13 +260,13 @@ export default {
console.error(error, 'error') console.error(error, 'error')
}) })
}, },
radioChange(){ radioChange() {
const labels = this.formData.sale_channels_label; const labels = this.formData.sale_channels_label;
const value = this.formData.sale_channel; const value = this.formData.sale_channel;
this.formData.sale_channel_label = labels && labels[value] ? labels[value] : ''; this.formData.sale_channel_label = labels && labels[value] ? labels[value] : '';
}, },
radioTypeChange(){ radioTypeChange() {
if(this.formData.site_type){ if (this.formData.site_type) {
this.formData.site_tpl = this.formData.site_type_tpl[this.formData.site_type].site_tpl 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.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 this.formData.picture = this.formData.site_type_tpl[this.formData.site_type].picture
@ -276,49 +282,84 @@ export default {
// previewTpl(){ // previewTpl(){
// window.open('http://'+this.siteInfo.domain, '_blank'); // window.open('http://'+this.siteInfo.domain, '_blank');
// }, // },
changeTpl(){ changeTpl() {
if(this.formData.site_type === ''){ if (this.formData.site_type === '') {
this.$message.warning('请选择站点类型'); this.$message.warning('请选择站点类型');
return false; return false;
} }
localStorage.setItem('formData', JSON.stringify(this.formData)) localStorage.setItem('formData', JSON.stringify(this.formData))
if(this.formData.not_finished_uid){ if (this.formData.not_finished_uid) {
this.$router.push(`/agent/siteTemplate?uid=${this.formData.not_finished_uid}`) this.$router.push(`/agent/siteTemplate?uid=${this.formData.not_finished_uid}`)
}else{ } else {
this.$router.push(`/agent/siteTemplate?site_type=${this.formData.site_type}`) this.$router.push(`/agent/siteTemplate?site_type=${this.formData.site_type}`)
} }
}, },
jumpStep(){ jumpStep() {
this.$router.push('/') 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;
flag = true;
console.log('label',prop, label);
if (!label) return
that.$positionMessage({
type: 'error',
message: label + '不得为空',
target: that.$refs.nextStepRef1, // DOM
position: 'top'
})
}
});
});
}
},
saveConfirm() { saveConfirm() {
const that = this const that = this
let formValid = false; let formValid = false;
let fields = that.$refs.formRef.fields;
that.validateFunc(fields)
that.$refs.formRef.validate((valid) => { that.$refs.formRef.validate((valid) => {
formValid = valid formValid = valid
}); });
let domainValid = false; let domainValid = false;
if(that.formData.domain_type === '2'){ if (that.formData.domain_type === '2') {
that.$refs.domainBind.$refs.bindFormRef.validate(valid => { that.$refs.domainBind.$refs.bindFormRef.validate(valid => {
domainValid = valid domainValid = valid
}) })
}else{ that.$positionMessage({
type: 'error',
message: '域名设置不得为空',
target: that.$refs.nextStepRef1, // DOM
position: 'top'
})
} else {
domainValid = true domainValid = true
} }
if (formValid && domainValid) { if (formValid && domainValid) {
that.$http('POST', '/agentnew/ajax_add_new_site', that.submitData).then(async response => { that.$http('POST', '/agentnew/ajax_add_new_site', that.submitData).then(async response => {
if(response.status && response.data.uid){ if (response.status && response.data.uid) {
await that.deleteSiteTplData() await that.deleteSiteTplData()
that.formData.uid = response.data.uid that.formData.uid = response.data.uid
that.$emit('handelSiteInfo', that.formData) that.$emit('handelSiteInfo', that.formData)
if(that.formData.sale_channel === '2'){ if (that.formData.sale_channel === '2') {
// //
that.$emit('handelStep', 3) that.$emit('handelStep', 3)
}else{ } else {
that.$emit('handelStep', 2) that.$emit('handelStep', 2)
} }
return true; return true;
@ -329,7 +370,7 @@ export default {
}) })
} }
}, },
async deleteSiteTplData(){ async deleteSiteTplData() {
localStorage.removeItem('activeStep') localStorage.removeItem('activeStep')
localStorage.removeItem('site_tpl_info') localStorage.removeItem('site_tpl_info')
await db.remove('ico') await db.remove('ico')
@ -339,13 +380,15 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.w540{ .w540 {
width: 540px; width: 540px;
} }
.mt20{
.mt20 {
margin-top: 20px; margin-top: 20px;
} }
.step1-wrap{
.step1-wrap {
padding-bottom: 12px; padding-bottom: 12px;
} }
@ -361,7 +404,8 @@ export default {
width: 100%; width: 100%;
height: 255px; height: 255px;
overflow: hidden; overflow: hidden;
img{
img {
width: 100%; width: 100%;
} }
} }
@ -387,16 +431,17 @@ export default {
} }
} }
::v-deep{ ::v-deep {
.el-input-group__append{ .el-input-group__append {
width: 175px; width: 175px;
letter-spacing: 0.08em; letter-spacing: 0.08em;
} }
.channel-radio .el-radio-group{ .channel-radio .el-radio-group {
text-align: left; text-align: left;
} }
.channel-radio .el-radio{
.channel-radio .el-radio {
min-width: 120px; min-width: 120px;
line-height: 16px; line-height: 16px;
} }

12
src/components/site/serviceSetting/domainSet.vue

@ -6,16 +6,16 @@
<div class="flex-common"> <div class="flex-common">
<div class="domain-area"> <div class="domain-area">
<el-form class="el-row demo-ruleForm" ref="formRef"> <el-form class="el-row demo-ruleForm" ref="formRef">
<div class="flex domain-info">
<span>当前服务域名</span><span>{{info.domain}}</span>
</div>
<div class="domain-from">域名来源</div> <div class="domain-from">域名来源</div>
<div class="domain-radio"> <div class="domain-radio">
<GuipRadio v-model="domain_type" :options="domain_types"/> <GuipRadio v-model="domain_type" :options="domain_types"/>
</div> </div>
<div class="flex domain-info"> <domainBind ref="domainBind" v-if="domain_type === '2'" label="独立域名"
<span>当前服务域名</span><span>{{info.domain}}</span>
</div>
<domainBind ref="domainBind" v-if="domain_type === '2'" label="域名设置"
:defaultPrefix="newDomain.prefix" :defaultDomain="newDomain.domain" @handleEvent="handleEvent"/> :defaultPrefix="newDomain.prefix" :defaultDomain="newDomain.domain" @handleEvent="handleEvent"/>
</el-form> </el-form>
</div> </div>
@ -121,7 +121,7 @@ export default {
font-size: 14px; font-size: 14px;
letter-spacing: 0.08em; letter-spacing: 0.08em;
color: #1E2226; color: #1E2226;
margin-bottom: 12px; margin-bottom: 16px;
} }
.domain-radio{ .domain-radio{

2
src/style/theme/common.scss

@ -78,7 +78,7 @@ body {
cursor: pointer; cursor: pointer;
transition: all .3s; transition: all .3s;
&:hover { & > *:hover {
transition: all .3s; transition: all .3s;
color: #006AFF !important; color: #006AFF !important;
} }

16
src/views/agent/siteServiceList.vue

@ -21,7 +21,7 @@
<!-- page content --> <!-- page content -->
<el-form> <el-form>
<GuipTable :tableData="serviceList" ref="multipleTable" :loading="tableLoading" <GuipTable :tableData="serviceList" ref="multipleTable" :loading="tableLoading"
@selection-change="handleSelectionChange" @select="handleSelect"> @selection-change="handleSelectionChange" @select="handleSelect" :row-class-name="setRowStyle">
<el-table-column type="selection" width="100"> <el-table-column type="selection" width="100">
<template slot="header"> <template slot="header">
<span class="selection-header-text">选择</span> <span class="selection-header-text">选择</span>
@ -234,6 +234,15 @@ export default {
}, },
}, },
methods: { methods: {
setRowStyle({ row }) {
// specialBack
console.log(row);
// row
// if (row.price === '2.00') {
// return 'specialBack';
// }
return '';
},
jumpAdd(prodid){ jumpAdd(prodid){
this.$router.push(this.serviceAddUrl + '?uid=' + this.uid + '&prodid=' + prodid) this.$router.push(this.serviceAddUrl + '?uid=' + this.uid + '&prodid=' + prodid)
}, },
@ -515,6 +524,11 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .specialBack{
background-color: #FAFAFA !important;
color: #626573;
opacity: .6;
}
::v-deep .custom-popover { ::v-deep .custom-popover {
position: fixed !important; position: fixed !important;
// max-height: 290px; // max-height: 290px;

Loading…
Cancel
Save