|
|
@ -1,7 +1,7 @@ |
|
|
|
<template> |
|
|
|
<div class="serviceAdd-wrap"> |
|
|
|
<div class="ml12 mr12 overFlow-wrap"> |
|
|
|
<PromptText text="如何添加服务?" :type="1" class="add-info"> |
|
|
|
<PromptText text="如何添加服务?" :type="2" class="add-info"> |
|
|
|
<template #next_desc> |
|
|
|
<div class="alert-more flex gap12" :class="alertShow ? '' : 'alert-more-hide'" @click="handleAlert"> |
|
|
|
<div v-if="alertShow">收起</div> |
|
|
@ -19,27 +19,18 @@ |
|
|
|
</template> |
|
|
|
</PromptText> |
|
|
|
|
|
|
|
<div class="service-title flex-between" v-if="serviceAddInfo"> |
|
|
|
<div class="service-title flex-between" v-if="serviceAddInfo && serviceAddInfo.ver_type"> |
|
|
|
<div class="service-name flex gap12"> |
|
|
|
<img src="@/assets/site/step_success.png" alt=""> |
|
|
|
<img :src="require('@/assets/serviceIcon/ver_'+serviceAddInfo.ver_type+'.svg')" alt=""> |
|
|
|
<span>{{ serviceAddInfo.ver_name }}_{{ serviceAddInfo.type_name }}</span> |
|
|
|
</div> |
|
|
|
<div class="service-status" v-if="serviceInfo.status"> |
|
|
|
<div class="service-status" v-if="service_status"> |
|
|
|
<span class="service-status-close" @click="handleDelServiceClick">关闭服务</span> |
|
|
|
<span class="service-status-desc">已开启</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 网页售价 --> |
|
|
|
<div class="flex-common mb12 price-set" v-if="serviceAddInfo.web_price_set"> |
|
|
|
<el-form class="el-row demo-ruleForm" ref="formRef"> |
|
|
|
<div class="price-top"> |
|
|
|
<span class="title">网页支付与售价</span> |
|
|
|
<span class="desc" |
|
|
|
v-if="serviceAddInfo.supply_price">供货价:{{ serviceAddInfo.supply_price }}{{ serviceAddInfo.supply_price_warning }}</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<PromptText v-if="serviceAddInfo.prompt.title" :text='serviceAddInfo.prompt.title' :type="1" |
|
|
|
<PromptText v-if="serviceAddInfo && serviceAddInfo.prompt && serviceAddInfo.prompt.title" :text='serviceAddInfo.prompt.title' :type="1" |
|
|
|
class="mb12"> |
|
|
|
<template #desc v-if="serviceAddInfo.prompt.content"> |
|
|
|
<div class="alert-more-info mt12"> |
|
|
@ -49,35 +40,42 @@ |
|
|
|
</template> |
|
|
|
</PromptText> |
|
|
|
|
|
|
|
<!-- 网页售价 --> |
|
|
|
<div class="flex-common mb12 price-set" v-if="serviceAddInfo.web_price_set"> |
|
|
|
<el-form class="el-row demo-ruleForm" ref="formRef"> |
|
|
|
<div class="price-top"> |
|
|
|
<span class="title">网页支付与售价</span> |
|
|
|
<span class="desc" |
|
|
|
v-if="serviceAddInfo.supply_price">供货价:{{ serviceAddInfo.supply_price }}{{ serviceAddInfo.supply_price_warning }}</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="flex-wrap"> |
|
|
|
<div class="flex-left"> |
|
|
|
<div class="flex-between mb12"> |
|
|
|
<div>售价管理</div> |
|
|
|
</div> |
|
|
|
<div class="flex-between"> |
|
|
|
<div class="short-width"> |
|
|
|
<GuipSelect width="100%" v-model="serviceInfo.unit" placeholder="选择计费方式" |
|
|
|
:options="serviceAddInfo.set_units" /> |
|
|
|
<div class="short-width" v-if="Object.keys(serviceAddInfo.set_units).length>1"> |
|
|
|
<GuipSelect width="100%" v-model="service_unit" placeholder="选择计费方式" |
|
|
|
:options="serviceAddInfo.set_units" @change="handleUnitName"/> |
|
|
|
</div> |
|
|
|
<div class="short-width" v-if="serviceInfo.unit !== '0'"> |
|
|
|
<GuipInput v-if="serviceInfo.unit === '1'" v-model="serviceInfo.price" width="100%" |
|
|
|
ref="GuipInput" unit="元/篇"></GuipInput> |
|
|
|
<GuipInput v-if="serviceInfo.unit === '2'" v-model="serviceInfo.price" width="100%" |
|
|
|
ref="GuipInput" unit="元/页"></GuipInput> |
|
|
|
<div class="short-width" v-if="service_unit !== '0'"> |
|
|
|
<GuipInput v-model="serviceInfo.price" width="100%" |
|
|
|
ref="GuipInput" :unit="'元/'+serviceAddInfo.unit_name"></GuipInput> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="flex-between mt12" v-if="serviceInfo.unit === '0'"> |
|
|
|
<div class="flex-between mt12" v-if="service_unit === '0'"> |
|
|
|
<div class="short-width"> |
|
|
|
<GuipInput width="100%" v-model="serviceInfo.price" ref="GuipInput" unit="元"> |
|
|
|
</GuipInput> |
|
|
|
</div> |
|
|
|
<div class="short-width"> |
|
|
|
<GuipInput width="100%" v-model="serviceInfo.unit_num" ref="GuipInput" unit="字符"> |
|
|
|
<GuipInput width="100%" v-model="serviceInfo.unit_num" ref="GuipInput" :unit="serviceAddInfo.unit_name"> |
|
|
|
</GuipInput> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<template v-if="serviceAddInfo.base_set"> |
|
|
|
<template v-if="serviceAddInfo.base_set && service_unit === '0'"> |
|
|
|
<div class="flex-line"></div> |
|
|
|
<div class="flex-right"> |
|
|
|
<div class="flex-between mb12"> |
|
|
@ -112,7 +110,8 @@ |
|
|
|
<el-form class="el-row demo-ruleForm" ref="formRef"> |
|
|
|
<div class="price-top"> |
|
|
|
<span class="title">{{ serviceAddInfo.shop_name }}支付管理</span> |
|
|
|
<span class="desc"></span> |
|
|
|
<span class="desc" |
|
|
|
v-if="serviceAddInfo.supply_price && !serviceAddInfo.web_price_set">供货价:{{ serviceAddInfo.supply_price }}{{ serviceAddInfo.supply_price_warning }}</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="flex-wrap"> |
|
|
@ -121,29 +120,27 @@ |
|
|
|
<div>售价管理</div> |
|
|
|
</div> |
|
|
|
<div class="flex-between"> |
|
|
|
<div class="short-width"> |
|
|
|
<GuipSelect width="100%" v-model="serviceInfo.unit" placeholder="选择计费方式" |
|
|
|
:options="serviceAddInfo.set_units" /> |
|
|
|
<div class="short-width" v-if="Object.keys(serviceAddInfo.set_units).length>1"> |
|
|
|
<GuipSelect width="100%" v-model="service_unit" placeholder="选择计费方式" |
|
|
|
:options="serviceAddInfo.set_units" @change="handleUnitName"/> |
|
|
|
</div> |
|
|
|
<div class="short-width" v-if="serviceInfo.unit > 0"> |
|
|
|
<GuipInput v-if="serviceInfo.unit === '1'" v-model="serviceAddInfo.unit_piece" |
|
|
|
width="100%" ref="GuipInput" unit="件/篇"></GuipInput> |
|
|
|
<GuipInput v-if="serviceInfo.unit === '2'" v-model="serviceAddInfo.unit_piece" |
|
|
|
width="100%" ref="GuipInput" unit="件/页"></GuipInput> |
|
|
|
<div class="short-width" v-if="service_unit !== '0'"> |
|
|
|
<GuipInput v-model="serviceInfo.unit_piece" width="100%" |
|
|
|
ref="GuipInput" :unit="'件/'+serviceAddInfo.unit_name"></GuipInput> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="flex-between mt12" v-if="serviceInfo.unit === '0'"> |
|
|
|
<div class="flex-between mt12" v-if="service_unit === '0'"> |
|
|
|
<div class="short-width"> |
|
|
|
<GuipInput width="100%" v-model="serviceInfo.unit_piece" ref="GuipInput" unit="件"> |
|
|
|
</GuipInput> |
|
|
|
</div> |
|
|
|
<div class="short-width"> |
|
|
|
<GuipInput width="100%" v-model="serviceInfo.unit_num" ref="GuipInput" unit="字符"> |
|
|
|
<GuipInput width="100%" v-model="serviceInfo.unit_num" ref="GuipInput" :unit="serviceAddInfo.unit_name"> |
|
|
|
</GuipInput> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<template v-if="serviceAddInfo.base_set"> |
|
|
|
<template v-if="serviceAddInfo.base_set && service_unit === '0'"> |
|
|
|
<div class="flex-line"></div> |
|
|
|
<div class="flex-right"> |
|
|
|
<div class="flex-between mb12"> |
|
|
@ -174,7 +171,7 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 店铺商品绑定--> |
|
|
|
<div class="flex-common mb12 price-set" v-if="serviceAddInfo.exists_shop_pay"> |
|
|
|
<div class="flex-common mb12 price-set" v-if="serviceAddInfo.shop_price_set"> |
|
|
|
<el-form class="el-row demo-ruleForm" ref="formRef"> |
|
|
|
<div class="price-top"> |
|
|
|
<span class="title">关联电商商品</span> |
|
|
@ -263,6 +260,8 @@ export default { |
|
|
|
type: 0, |
|
|
|
prodid: 0, |
|
|
|
serviceAddInfo: {}, |
|
|
|
service_unit:'', |
|
|
|
service_status: false, |
|
|
|
serviceInfo: {}, |
|
|
|
bindList: [], |
|
|
|
alertShow: true, |
|
|
@ -324,6 +323,7 @@ export default { |
|
|
|
}, |
|
|
|
//获得要添加的服务信息 |
|
|
|
getServiceAddInfo() { |
|
|
|
this.serviceAddInfo = {} |
|
|
|
const that = this |
|
|
|
that.$http('POST', '/agentnew/ajax_get_service_add_info', { |
|
|
|
uid: that.uid, |
|
|
@ -336,6 +336,7 @@ export default { |
|
|
|
if (response.status) { |
|
|
|
that.$nextTick(() => { |
|
|
|
that.serviceAddInfo = response.data |
|
|
|
that.service_unit = that.serviceAddInfo.unit |
|
|
|
//拼多多渠道查询商品所需参数初始化 |
|
|
|
if (that.serviceAddInfo.shop_name === '拼多多') this.initPddParam(that.uid) |
|
|
|
//查询是否添加了此服务 |
|
|
@ -363,21 +364,15 @@ export default { |
|
|
|
} |
|
|
|
}).then(response => { |
|
|
|
that.$nextTick(() => { |
|
|
|
//设置默认计费方式 |
|
|
|
that.serviceInfo.unit = that.serviceAddInfo.unit |
|
|
|
//默认未开启 |
|
|
|
that.serviceInfo.status = false |
|
|
|
}) |
|
|
|
if (response.status && response.data) { |
|
|
|
that.$nextTick(() => { |
|
|
|
that.serviceInfo = response.data.service_info |
|
|
|
that.serviceInfo.status = true |
|
|
|
that.service_status = true |
|
|
|
|
|
|
|
console.log(that.serviceInfo,'ccc') |
|
|
|
}) |
|
|
|
that.getServiceBindGoods() |
|
|
|
} |
|
|
|
console.log(that.serviceInfo,'aaa') |
|
|
|
}) |
|
|
|
|
|
|
|
}).catch(error => { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
@ -402,6 +397,9 @@ export default { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleUnitName(){ |
|
|
|
this.serviceAddInfo.unit_name = this.serviceAddInfo.set_units[this.service_unit] |
|
|
|
}, |
|
|
|
handleDelServiceClick() { |
|
|
|
this.dialogDelServiceConfim = true |
|
|
|
}, |
|
|
@ -423,6 +421,7 @@ export default { |
|
|
|
that.$message.success('删除成功'); |
|
|
|
this.$nextTick(() => { |
|
|
|
that.serviceInfo = {} |
|
|
|
that.service_status = false; |
|
|
|
that.setMenuList(that.type, false) |
|
|
|
}) |
|
|
|
return true; |
|
|
@ -440,9 +439,16 @@ export default { |
|
|
|
}, |
|
|
|
savePrice() { |
|
|
|
const that = this |
|
|
|
//非字符计费 |
|
|
|
if(that.service_unit !== '0') { |
|
|
|
that.serviceInfo.unit_num = 1 |
|
|
|
that.serviceInfo.base_unit_num = '' |
|
|
|
that.serviceInfo.base_unit_price = '' |
|
|
|
} |
|
|
|
this.$http('POST', "/agentnew/ajax_set_service_price", { |
|
|
|
uid: that.uid, |
|
|
|
type: that.type, |
|
|
|
unit: that.service_unit, |
|
|
|
unit_num: that.serviceInfo.unit_num, |
|
|
|
unit_price: that.serviceInfo.price, |
|
|
|
b_unit_num: that.serviceInfo.base_unit_num, |
|
|
@ -453,8 +459,8 @@ export default { |
|
|
|
} |
|
|
|
}).then(response => { |
|
|
|
if (response.status) { |
|
|
|
if (that.serviceInfo.status === false) { |
|
|
|
that.serviceInfo.status = true |
|
|
|
if (that.service_status === false) { |
|
|
|
that.service_status = true |
|
|
|
that.setMenuList(that.type, true) |
|
|
|
} |
|
|
|
that.$message.success('保存成功'); |
|
|
@ -473,9 +479,18 @@ export default { |
|
|
|
}, |
|
|
|
saveShopPrice() { |
|
|
|
const that = this |
|
|
|
//非字符计费 单位默认为 1 |
|
|
|
//非字符计费 |
|
|
|
if(that.service_unit !== '0') { |
|
|
|
that.serviceInfo.unit_num = 1 |
|
|
|
that.serviceInfo.base_unit_num = '' |
|
|
|
that.serviceInfo.base_unit_piece = '' |
|
|
|
} |
|
|
|
console.log(that.serviceInfo,'ddd') |
|
|
|
this.$http('POST', "/agentnew/ajax_set_service_price", { |
|
|
|
uid: that.uid, |
|
|
|
type: that.type, |
|
|
|
unit: that.service_unit, |
|
|
|
unit_num: that.serviceInfo.unit_num, |
|
|
|
unit_piece: that.serviceInfo.unit_piece, |
|
|
|
b_unit_num: that.serviceInfo.base_unit_num, |
|
|
@ -486,8 +501,8 @@ export default { |
|
|
|
} |
|
|
|
}).then(response => { |
|
|
|
if (response.status) { |
|
|
|
if (that.serviceInfo.status === false) { |
|
|
|
that.serviceInfo.status = true |
|
|
|
if (that.service_status === false) { |
|
|
|
that.service_status = true |
|
|
|
that.setMenuList(that.type, true) |
|
|
|
} |
|
|
|
that.$message.success('保存成功'); |
|
|
@ -607,7 +622,20 @@ export default { |
|
|
|
}, |
|
|
|
//------绑定相关 end------ |
|
|
|
jumpStep() { |
|
|
|
this.$router.push(this.siteAddUrl + '?uid=' + this.uid) |
|
|
|
const that = this |
|
|
|
this.$http('POST', '/agentnew/ajax_get_not_finished_site', {},{ |
|
|
|
headers:{ |
|
|
|
'Auth': this.token |
|
|
|
} |
|
|
|
}).then(response => { |
|
|
|
if(Object.keys(response.data).length>0){ |
|
|
|
that.$router.push('/agent/siteAdd') |
|
|
|
} else { |
|
|
|
that.$router.push('/agent/siteServiceList?uid=' + that.uid) |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|