|
@ -20,59 +20,70 @@ |
|
|
</PromptText> --> |
|
|
</PromptText> --> |
|
|
<div class="flex-common service_info"> |
|
|
<div class="flex-common service_info"> |
|
|
<div class="service_info_wrap common_scss"> |
|
|
<div class="service_info_wrap common_scss"> |
|
|
<div class="title flex"> |
|
|
<div class="title flex gap6"> |
|
|
<img src="" alt=""> |
|
|
<img src="@/assets/site/price1.svg" alt=""> |
|
|
<b class="blue">服务信息</b> |
|
|
<b class="blue">服务信息</b> |
|
|
</div> |
|
|
</div> |
|
|
<div class="flex"> |
|
|
<div class="flex"> |
|
|
<label for="">品牌名称:</label> |
|
|
<label>品牌名称:</label> |
|
|
<p> |
|
|
<p> |
|
|
<b>{{ }}</b> |
|
|
<b>{{ }}人工摘要翻译</b> |
|
|
{{ }}dsfdsfsdfds |
|
|
{{ }}站点开通服务后,除了新增了翻译入口外,该站点的检测服务网页的右上角会显示翻译的广告宣传图,点击会跳转到已开启的翻译页面。 |
|
|
</p> |
|
|
</p> |
|
|
</div> |
|
|
</div> |
|
|
<div class="flex"> |
|
|
<div class="flex"> |
|
|
<label for="">服务名称:</label> |
|
|
<label>服务名称:</label> |
|
|
<p> |
|
|
<p> |
|
|
<b>{{ }}</b> |
|
|
<b>{{ }}</b> |
|
|
{{ }} |
|
|
{{ }} |
|
|
</p> |
|
|
</p> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<!--需要 增加条件判断 --> |
|
|
|
|
|
<div class="flex"> |
|
|
|
|
|
<label>注意事项:</label> |
|
|
|
|
|
<p class="warn"> |
|
|
|
|
|
电商禁止售卖降重类的商品,如果上架建议调整文案规避 |
|
|
|
|
|
</p> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="flex-between gap24"> |
|
|
<div class="flex-between gap24"> |
|
|
<div class="common_scss"> |
|
|
<div class="common_scss"> |
|
|
<div class="flex"> |
|
|
<div class="flex gap6"> |
|
|
<img src="" alt=""> |
|
|
<img src="@/assets/site/price2.svg" alt=""> |
|
|
<b class="blue">价格信息</b> |
|
|
<b class="blue">价格信息</b> |
|
|
</div> |
|
|
</div> |
|
|
<div class="flex"> |
|
|
<div class="flex"> |
|
|
<label for="">进货价格:</label> |
|
|
<label>进货价格:</label> |
|
|
<p> |
|
|
<p> |
|
|
{{ }} |
|
|
{{ serviceAddInfo.supply_price }}{{ serviceAddInfo.supply_price_warning }} |
|
|
</p> |
|
|
</p> |
|
|
</div> |
|
|
</div> |
|
|
<div class="flex"> |
|
|
<div class="flex" v-if="serviceAddInfo && serviceAddInfo.prompt && serviceAddInfo.prompt.title"> |
|
|
<label for="">售价规则:</label> |
|
|
<label>售价规则:</label> |
|
|
<p> |
|
|
<p> |
|
|
{{ }} |
|
|
{{ serviceAddInfo.prompt.title }} |
|
|
</p> |
|
|
</p> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="common_scss green_back"> |
|
|
<div class="common_scss green_back"> |
|
|
<div class="flex"> |
|
|
<div class="flex gap6"> |
|
|
<img src="" alt=""> |
|
|
<img src="@/assets/site/price3.svg" alt=""> |
|
|
<b class="green">利润分析</b> |
|
|
<b class="green">利润分析</b> |
|
|
</div> |
|
|
</div> |
|
|
<div class="flex"> |
|
|
<div class="flex"> |
|
|
<label for="">利润率:</label> |
|
|
<label>利润率:</label> |
|
|
<p> |
|
|
<p v-if="service_unit == '1'"> |
|
|
{{ }} |
|
|
因售卖单位设置为篇,利率无法计算 |
|
|
|
|
|
</p> |
|
|
|
|
|
<p v-if="service_unit == '0'"> |
|
|
|
|
|
约{{ calculation.profitRate }}%(因单位进制差异,利率为约数) |
|
|
</p> |
|
|
</p> |
|
|
</div> |
|
|
</div> |
|
|
<div class="flex"> |
|
|
<div class="flex"> |
|
|
<label for="">利润水平:</label> |
|
|
<label>利润额:</label> |
|
|
<p> |
|
|
<p v-if="service_unit == '1'">因售卖单位设置为篇,利润额无法计算</p> |
|
|
{{ }} |
|
|
<p v-if="service_unit == '0'"> |
|
|
|
|
|
每1000字赚{{ calculation.profitPerUnit }}元(因单位进制差异,金额为约数) |
|
|
</p> |
|
|
</p> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -80,7 +91,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="service-title flex-between" v-if="serviceAddInfo && serviceAddInfo.ver_type"> |
|
|
<!-- <div class="service-title flex-between" v-if="serviceAddInfo && serviceAddInfo.ver_type"> |
|
|
<div class="service-name flex gap12"> |
|
|
<div class="service-name flex gap12"> |
|
|
<img :src="require('@/assets/serviceIcon/ver_'+serviceAddInfo.ver_type+'.svg')" alt=""> |
|
|
<img :src="require('@/assets/serviceIcon/ver_'+serviceAddInfo.ver_type+'.svg')" alt=""> |
|
|
<span>{{ serviceAddInfo.ver_name }}_{{ serviceAddInfo.type_name }}</span> |
|
|
<span>{{ serviceAddInfo.ver_name }}_{{ serviceAddInfo.type_name }}</span> |
|
@ -89,9 +100,9 @@ |
|
|
<span class="service-status-close" @click="handleDelServiceClick">关闭服务</span> |
|
|
<span class="service-status-close" @click="handleDelServiceClick">关闭服务</span> |
|
|
<span class="service-status-desc">已开启</span> |
|
|
<span class="service-status-desc">已开启</span> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> --> |
|
|
|
|
|
|
|
|
<PromptText v-if="serviceAddInfo && serviceAddInfo.prompt && 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"> |
|
|
class="mb12"> |
|
|
<template #desc v-if="serviceAddInfo.prompt.content"> |
|
|
<template #desc v-if="serviceAddInfo.prompt.content"> |
|
|
<div class="alert-more-info mt12"> |
|
|
<div class="alert-more-info mt12"> |
|
@ -99,39 +110,42 @@ |
|
|
{{ item }}</div> |
|
|
{{ item }}</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</PromptText> |
|
|
</PromptText> --> |
|
|
|
|
|
|
|
|
<!-- 网页售价 --> |
|
|
<!-- 网页售价 --> |
|
|
<div class="flex-common mb12 price-set" v-if="serviceAddInfo.web_price_set"> |
|
|
<div class="flex-common mt12 mb12 price-set" v-if="serviceAddInfo.web_price_set"> |
|
|
<el-form class="el-row demo-ruleForm" ref="formRef"> |
|
|
<el-form class="el-row demo-ruleForm" ref="formRef"> |
|
|
<div class="price-top"> |
|
|
<div class="price-top"> |
|
|
<span class="title">网页支付与售价</span> |
|
|
<span class="title">网页端售价</span> |
|
|
<span class="desc" |
|
|
<!-- <span class="desc" |
|
|
v-if="serviceAddInfo.supply_price">供货价:{{ serviceAddInfo.supply_price }}{{ serviceAddInfo.supply_price_warning }}</span> |
|
|
v-if="serviceAddInfo.supply_price">供货价:{{ serviceAddInfo.supply_price }}{{ serviceAddInfo.supply_price_warning }}</span> --> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="flex-wrap"> |
|
|
<div class="flex-wrap"> |
|
|
<div class="flex-left"> |
|
|
<div class="flex-left"> |
|
|
<div class="flex-between mb12"> |
|
|
<!-- <div class="flex-between mb12"> |
|
|
<div>售价管理</div> |
|
|
<div>售价设置</div> |
|
|
</div> |
|
|
</div> --> |
|
|
<div class="flex-between"> |
|
|
<div class="column"> |
|
|
<div class="short-width" v-if="Object.keys(serviceAddInfo.set_units).length>1"> |
|
|
<el-tabs v-if="Object.keys(serviceAddInfo.set_units).length>1" v-model="service_unit" @tab-click="handleUnitName"> |
|
|
|
|
|
<el-tab-pane v-for="item in Object.keys(serviceAddInfo.set_units)" :label="'按'+serviceAddInfo.set_units[item] + '售卖'" :name="item" :key="item"></el-tab-pane> |
|
|
|
|
|
</el-tabs> |
|
|
|
|
|
<!-- <div class="short-width" v-if="Object.keys(serviceAddInfo.set_units).length>1"> |
|
|
<GuipSelect width="100%" v-model="service_unit" placeholder="选择计费方式" |
|
|
<GuipSelect width="100%" v-model="service_unit" placeholder="选择计费方式" |
|
|
:options="serviceAddInfo.set_units" @change="handleUnitName"/> |
|
|
:options="serviceAddInfo.set_units" @change="handleUnitName"/> |
|
|
</div> |
|
|
</div> --> |
|
|
<div class="short-width" v-if="service_unit !== '0'"> |
|
|
<div class="short-width" v-if="service_unit !== '0'"> |
|
|
<GuipInput v-model="serviceInfo.price" width="100%" |
|
|
<GuipInput v-model="serviceInfo.price" width="100%" |
|
|
ref="GuipInput" :unit="'元/'+serviceAddInfo.unit_name"></GuipInput> |
|
|
ref="GuipInput" :unit="'元/'+serviceAddInfo.unit_name"></GuipInput> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="flex-between mt12" v-if="service_unit === '0'"> |
|
|
<div class="flex-between" v-if="service_unit === '0'"> |
|
|
<div class="short-width"> |
|
|
<div class="short-width"> |
|
|
<GuipInput width="100%" v-model="serviceInfo.price" ref="GuipInput" unit="元"> |
|
|
<GuipInput width="100%" v-model="serviceInfo.price" ref="GuipInput" unit="元" @blur="priceBlur"> |
|
|
</GuipInput> |
|
|
</GuipInput> |
|
|
</div> |
|
|
</div> |
|
|
<div class="short-width"> |
|
|
<div class="short-width"> |
|
|
<GuipInput width="100%" v-model="serviceInfo.unit_num" ref="GuipInput" :unit="serviceAddInfo.unit_name"> |
|
|
<GuipInput width="100%" v-model="serviceInfo.unit_num" ref="GuipInput" :unit="serviceAddInfo.unit_name" @blur="priceBlur"> |
|
|
</GuipInput> |
|
|
</GuipInput> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -182,20 +196,23 @@ |
|
|
<el-form class="el-row demo-ruleForm" ref="formRef"> |
|
|
<el-form class="el-row demo-ruleForm" ref="formRef"> |
|
|
<div class="price-top"> |
|
|
<div class="price-top"> |
|
|
<span class="title">{{ serviceAddInfo.shop_name }}支付管理</span> |
|
|
<span class="title">{{ serviceAddInfo.shop_name }}支付管理</span> |
|
|
<span class="desc" |
|
|
<!-- <span class="desc" |
|
|
v-if="serviceAddInfo.supply_price && !serviceAddInfo.web_price_set">供货价:{{ serviceAddInfo.supply_price }}{{ serviceAddInfo.supply_price_warning }}</span> |
|
|
v-if="serviceAddInfo.supply_price && !serviceAddInfo.web_price_set">供货价:{{ serviceAddInfo.supply_price }}{{ serviceAddInfo.supply_price_warning }}</span> --> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="flex-wrap"> |
|
|
<div class="flex-wrap"> |
|
|
<div class="flex-left"> |
|
|
<div class="flex-left"> |
|
|
<div class="flex-between mb12"> |
|
|
<div class="flex-between mb12"> |
|
|
<div>售价管理</div> |
|
|
<div>售价设置</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="flex-between"> |
|
|
<div class="flex-between"> |
|
|
<div class="short-width" v-if="Object.keys(serviceAddInfo.set_units).length>1"> |
|
|
<el-tabs v-if="Object.keys(serviceAddInfo.set_units).length>1" v-model="service_unit" @tab-click="handleUnitName"> |
|
|
|
|
|
<el-tab-pane v-for="item in Object.keys(serviceAddInfo.set_units)" :label="'按'+serviceAddInfo.set_units[item] + '售卖'" :name="item" :key="item"></el-tab-pane> |
|
|
|
|
|
</el-tabs> |
|
|
|
|
|
<!-- <div class="short-width" v-if="Object.keys(serviceAddInfo.set_units).length>1"> |
|
|
<GuipSelect width="100%" v-model="service_unit" placeholder="选择计费方式" |
|
|
<GuipSelect width="100%" v-model="service_unit" placeholder="选择计费方式" |
|
|
:options="serviceAddInfo.set_units" @change="handleUnitName"/> |
|
|
:options="serviceAddInfo.set_units" @change="handleUnitName"/> |
|
|
</div> |
|
|
</div> --> |
|
|
<div class="short-width" v-if="service_unit !== '0'"> |
|
|
<div class="short-width" v-if="service_unit !== '0'"> |
|
|
<GuipInput v-model="serviceInfo.unit_piece" width="100%" |
|
|
<GuipInput v-model="serviceInfo.unit_piece" width="100%" |
|
|
ref="GuipInput" :unit="'件/'+serviceAddInfo.unit_name"></GuipInput> |
|
|
ref="GuipInput" :unit="'件/'+serviceAddInfo.unit_name"></GuipInput> |
|
@ -296,17 +313,18 @@ |
|
|
</GuipDialog> |
|
|
</GuipDialog> |
|
|
</div> |
|
|
</div> |
|
|
<div class="register-btns flex gap12"> |
|
|
<div class="register-btns flex gap12"> |
|
|
<span class="service-open-num">已开启 {{addNum}}项 服务</span><GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">返回服务列表</GuipButton> |
|
|
<!-- <span class="service-open-num">已开启 {{addNum}}项 服务</span><GuipButton type="primary" :btnstyle="{ width: '144px', height: '46px' }" @click="jumpStep">返回服务列表</GuipButton> --> |
|
|
|
|
|
<GuipButton type="system" size="page" @click="jumpStep">取消</GuipButton> |
|
|
|
|
|
<GuipButton type="primary" size="page" @click="jumpStep">设置下一项服务</GuipButton> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
</template> |
|
|
</template> |
|
|
<script> |
|
|
<script> |
|
|
import store from '@/store'; |
|
|
import store from '@/store'; |
|
|
import { mapState } from 'vuex'; |
|
|
import { mapState } from 'vuex'; |
|
|
import GuipButton from "@/components/GuipButton.vue"; |
|
|
import GuipButton from "@/components/GuipButton.vue"; |
|
|
import PromptText from "@/components/PromptText.vue"; |
|
|
// import PromptText from "@/components/PromptText.vue"; |
|
|
import GuipSelect from "@/components/GuipSelect.vue"; |
|
|
// import GuipSelect from "@/components/GuipSelect.vue"; |
|
|
import GuipInput from "@/components/GuipInput.vue"; |
|
|
import GuipInput from "@/components/GuipInput.vue"; |
|
|
import bindGoods from "@/components/bindGoods.vue"; |
|
|
import bindGoods from "@/components/bindGoods.vue"; |
|
|
import GuipDialog from "@/components/GuipDialog.vue"; |
|
|
import GuipDialog from "@/components/GuipDialog.vue"; |
|
@ -321,8 +339,8 @@ export default { |
|
|
ValueAdded, |
|
|
ValueAdded, |
|
|
GuipDialog, |
|
|
GuipDialog, |
|
|
GuipInput, |
|
|
GuipInput, |
|
|
GuipSelect, |
|
|
// GuipSelect, |
|
|
PromptText, |
|
|
// PromptText, |
|
|
GuipButton, |
|
|
GuipButton, |
|
|
bindGoods, |
|
|
bindGoods, |
|
|
}, |
|
|
}, |
|
@ -345,18 +363,32 @@ export default { |
|
|
dialogDelBindConfim: false, |
|
|
dialogDelBindConfim: false, |
|
|
delRow: {}, |
|
|
delRow: {}, |
|
|
dialogDelServiceConfim: false, |
|
|
dialogDelServiceConfim: false, |
|
|
addNum: 0 |
|
|
addNum: 0, |
|
|
|
|
|
rateNum:null, |
|
|
|
|
|
calculation: { |
|
|
|
|
|
profitRate: 0, |
|
|
|
|
|
profitPerUnit: 0, |
|
|
|
|
|
totalProfit: 0, |
|
|
|
|
|
pricePerThousand: 0, |
|
|
|
|
|
isValid: false |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
...mapState(['pageTitle','secondMenu']), // 从Vuex映射showSidebar状态到组件的计算属性中 |
|
|
...mapState(['pageTitle','secondMenu','currentMenuItem']), // 从Vuex映射showSidebar状态到组件的计算属性中 |
|
|
menuItem() { |
|
|
// menuItem() { |
|
|
return this.$store.state.currentMenuItem; |
|
|
// return this.$store.state.currentMenuItem; |
|
|
|
|
|
// } |
|
|
|
|
|
formatted() { |
|
|
|
|
|
return this.formatProfitResult(this.calculation); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
|
'$store.state.currentMenuItem': { |
|
|
'$store.state.currentMenuItem': { |
|
|
handler(newVal) { |
|
|
handler(newVal) { |
|
|
|
|
|
this.menuItem = newVal; |
|
|
|
|
|
console.log(this.menuItem,'this.menuItem==='); |
|
|
this.type = newVal.type |
|
|
this.type = newVal.type |
|
|
//查询是否添加了此服务 |
|
|
//查询是否添加了此服务 |
|
|
this.getServiceInfo() |
|
|
this.getServiceInfo() |
|
@ -375,16 +407,29 @@ export default { |
|
|
this.loadPddSDK() |
|
|
this.loadPddSDK() |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
if(this.menuItem){ |
|
|
if(this.currentMenuItem){ |
|
|
this.type = this.menuItem.type |
|
|
this.type = this.currentMenuItem.type |
|
|
//查询是否添加了此服务 |
|
|
//查询是否添加了此服务 |
|
|
this.getServiceInfo() |
|
|
this.getServiceInfo() |
|
|
this.getServiceAddInfo(); |
|
|
this.getServiceAddInfo(); |
|
|
} |
|
|
} |
|
|
store.commit('SET_PAGETITLE', '站点信息'); |
|
|
console.log(this.menuItem,'menuItem===',this.currentMenuItem); |
|
|
|
|
|
// store.commit('SET_PAGETITLE', '站点信息'); |
|
|
// this.getAddServiceList(); |
|
|
// this.getAddServiceList(); |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
extractedNumber() { |
|
|
|
|
|
const match = this.basePrice.match(/(\d+\.?\d*)/); |
|
|
|
|
|
return match ? parseFloat(match[0]) : 0; |
|
|
|
|
|
}, |
|
|
|
|
|
priceBlur(){ |
|
|
|
|
|
const price = this.serviceAddInfo.supply_price.replace(/[^\d.]/g, ''); |
|
|
|
|
|
this.calculation = this.calculateProfitRate(this.serviceInfo.price, this.serviceInfo.unit_num, Number(price)); |
|
|
|
|
|
console.log(this.calculation,'====val'); |
|
|
|
|
|
}, |
|
|
|
|
|
unitNameBlur(){ |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
handleAlert() { |
|
|
handleAlert() { |
|
|
this.alertShow = !this.alertShow |
|
|
this.alertShow = !this.alertShow |
|
|
}, |
|
|
}, |
|
@ -427,6 +472,7 @@ export default { |
|
|
text: that.serviceAddInfo.site_short_name, |
|
|
text: that.serviceAddInfo.site_short_name, |
|
|
link: that.serviceAddInfo.site_domain |
|
|
link: that.serviceAddInfo.site_domain |
|
|
}); |
|
|
}); |
|
|
|
|
|
this.priceBlur() |
|
|
}) |
|
|
}) |
|
|
return true |
|
|
return true |
|
|
} |
|
|
} |
|
@ -476,7 +522,8 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
handleUnitName(){ |
|
|
handleUnitName(){ |
|
|
this.serviceAddInfo.unit_name = this.serviceAddInfo.set_units[this.service_unit] |
|
|
this.serviceAddInfo.unit_name = this.serviceAddInfo.set_units[this.service_unit]; |
|
|
|
|
|
console.log(this.serviceAddInfo.unit_name,'this.serviceAddInfo.unit_name====---999'); |
|
|
}, |
|
|
}, |
|
|
handleDelServiceClick() { |
|
|
handleDelServiceClick() { |
|
|
this.dialogDelServiceConfim = true |
|
|
this.dialogDelServiceConfim = true |
|
@ -500,7 +547,7 @@ export default { |
|
|
}) |
|
|
}) |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
that.$message.error(response.info); |
|
|
that.$Message.error(response.info); |
|
|
}).catch(error => { |
|
|
}).catch(error => { |
|
|
console.error(error, 'error') |
|
|
console.error(error, 'error') |
|
|
}) |
|
|
}) |
|
@ -510,6 +557,9 @@ export default { |
|
|
this.serviceInfo.unit_num = '' |
|
|
this.serviceInfo.unit_num = '' |
|
|
this.serviceInfo.base_unit_price = '' |
|
|
this.serviceInfo.base_unit_price = '' |
|
|
this.serviceInfo.base_unit_num = '' |
|
|
this.serviceInfo.base_unit_num = '' |
|
|
|
|
|
|
|
|
|
|
|
// !! |
|
|
|
|
|
this.rateNum = '' |
|
|
}, |
|
|
}, |
|
|
savePrice() { |
|
|
savePrice() { |
|
|
const that = this |
|
|
const that = this |
|
@ -689,6 +739,51 @@ export default { |
|
|
console.error(error, 'error') |
|
|
console.error(error, 'error') |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
calculateProfitRate(price, num, baseCost = 2.4) { |
|
|
|
|
|
// 输入验证 |
|
|
|
|
|
if (!price || !num || price <= 0 || num <= 0) { |
|
|
|
|
|
return { |
|
|
|
|
|
profitRate: 0, |
|
|
|
|
|
profitPerUnit: 0, |
|
|
|
|
|
totalProfit: 0, |
|
|
|
|
|
pricePerThousand: 0, |
|
|
|
|
|
isValid: false |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
// 计算每1000字的售价 |
|
|
|
|
|
const pricePerThousand = (price / num) * 1000; |
|
|
|
|
|
console.log(pricePerThousand,'pricePerThousand=='); |
|
|
|
|
|
|
|
|
|
|
|
// 计算利率(利润率) |
|
|
|
|
|
const profitRate = ((pricePerThousand - baseCost) / baseCost) * 100; |
|
|
|
|
|
console.log(profitRate,'profitRate=='); |
|
|
|
|
|
|
|
|
|
|
|
// 计算每1000字的利润 |
|
|
|
|
|
const profitPerUnit = pricePerThousand - baseCost; |
|
|
|
|
|
|
|
|
|
|
|
// 计算总利润 |
|
|
|
|
|
const totalProfit = (profitPerUnit / 1000) * num; |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
|
profitRate: Number(profitRate.toFixed(2)), // 利率(百分比) |
|
|
|
|
|
profitPerUnit: Number(profitPerUnit.toFixed(2)), // 每1000字利润 |
|
|
|
|
|
totalProfit: Number(totalProfit.toFixed(2)), // 总利润 |
|
|
|
|
|
pricePerThousand: Number(pricePerThousand.toFixed(2)), // 每1000字售价 |
|
|
|
|
|
isValid: true |
|
|
|
|
|
}; |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error('计算利率时出错:', error); |
|
|
|
|
|
return { |
|
|
|
|
|
profitRate: 0, |
|
|
|
|
|
profitPerUnit: 0, |
|
|
|
|
|
totalProfit: 0, |
|
|
|
|
|
pricePerThousand: 0, |
|
|
|
|
|
isValid: false |
|
|
|
|
|
}; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
@ -698,7 +793,18 @@ export default { |
|
|
flex-direction: column; |
|
|
flex-direction: column; |
|
|
gap: 24px; |
|
|
gap: 24px; |
|
|
} |
|
|
} |
|
|
|
|
|
.gap6{ |
|
|
|
|
|
gap: 6px; |
|
|
|
|
|
} |
|
|
|
|
|
.warn{ |
|
|
|
|
|
font-size: 12px; |
|
|
|
|
|
font-weight: normal; |
|
|
|
|
|
line-height: 17px; |
|
|
|
|
|
letter-spacing: 0.03em; |
|
|
|
|
|
color: #FF4D4F !important; |
|
|
|
|
|
} |
|
|
.service_info_wrap{ |
|
|
.service_info_wrap{ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
.common_scss{ |
|
|
.common_scss{ |
|
|
width: 100%; |
|
|
width: 100%; |
|
@ -717,6 +823,7 @@ export default { |
|
|
} |
|
|
} |
|
|
p{ |
|
|
p{ |
|
|
color: #23242B; |
|
|
color: #23242B; |
|
|
|
|
|
text-align: left; |
|
|
} |
|
|
} |
|
|
.blue{ |
|
|
.blue{ |
|
|
color: #006AFF; |
|
|
color: #006AFF; |
|
@ -724,10 +831,14 @@ export default { |
|
|
.green{ |
|
|
.green{ |
|
|
color: #00C261; |
|
|
color: #00C261; |
|
|
} |
|
|
} |
|
|
|
|
|
label{ |
|
|
|
|
|
white-space: nowrap; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
.gap24{ |
|
|
.gap24{ |
|
|
gap: 24px; |
|
|
gap: 24px; |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
|
|
|
align-items: stretch; |
|
|
} |
|
|
} |
|
|
.green_back{ |
|
|
.green_back{ |
|
|
background: #EFFFE0; |
|
|
background: #EFFFE0; |
|
|