提交 48c114d1 authored 作者: 王天霸's avatar 王天霸

速卖通

上级 bf52bce6
...@@ -2,7 +2,11 @@ ...@@ -2,7 +2,11 @@
<div class="app-container"> <div class="app-container">
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix">导入商品</div> <div slot="header" class="clearfix">导入商品</div>
<h3 class="cton_h3">剩余次数:{{collect_num}} <el-button type="primary" @click="dialogDetail = true" size="mini" style="float:right;">购买次数</el-button></h3> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="京东、天猫、淘宝" name="first"></el-tab-pane>
<el-tab-pane label="速卖通" name="second"></el-tab-pane>
</el-tabs>
<h3 v-if="activeName=='first'" class="cton_h3">剩余次数:{{collect_num}} <el-button type="primary" @click="dialogDetail = true" size="mini" style="float:right;">购买次数</el-button></h3>
<div class="cton_text"> <div class="cton_text">
<p>功能介绍:</p> <p>功能介绍:</p>
<p> <p>
...@@ -13,18 +17,26 @@ ...@@ -13,18 +17,26 @@
复制其它电商平台的商品链接,粘贴至商品链接输入框内,为该商品选择对应的商品分类,选择完成后点击立即获取按钮即可 复制其它电商平台的商品链接,粘贴至商品链接输入框内,为该商品选择对应的商品分类,选择完成后点击立即获取按钮即可
</p> </p>
<p>示例:</p> <p>示例:</p>
<p>京东商品链接如:https://item.jd.com/10684560542.html</p> <p v-if="activeName=='first'">京东商品链接如:https://item.jd.com/10684560542.html</p>
<p v-if="activeName=='second'">速卖通商品链接如:https://www.aliexpress.us/item/3256807290664670.html</p>
<p>温馨提示:</p> <p>温馨提示:</p>
<p>商品在获取过程中,请不要进行其它操作</p> <p>商品在获取过程中,请不要进行其它操作</p>
<p> <p>
商品抓取后,默认放入到下架商品中,请手动修改商品相关信息,再提交申请上架 商品抓取后,默认放入到下架商品中,请手动修改商品相关信息,再提交申请上架
</p> </p>
<p>请确保不要将多个平台的商品链接混合输入</p> <p>请确保不要将多个平台的商品链接混合输入</p>
<p>每个用户默认拥有1000次商品导入的机会,请慎重使用</p> <p v-if="activeName=='first'">每个用户默认拥有1000次商品导入的机会,请慎重使用</p>
<p>支持平台:</p> <p>支持平台:速卖通</p>
<p>京东、天猫、淘宝 </p>
</div> </div>
<el-form ref="form" :model="form" label-width="180px"> <el-form ref="form" :model="form" label-width="180px">
<el-form-item label="货币转换汇率:" v-if="activeName=='second'">
<el-input
style="width:700px;"
type="text"
v-model="form.exchange_rate"
placeholder="例如美元转人民币汇率"
></el-input>
</el-form-item>
<el-form-item label="商品链接:"> <el-form-item label="商品链接:">
<el-input <el-input
style="width:700px;" style="width:700px;"
...@@ -82,8 +94,10 @@ export default { ...@@ -82,8 +94,10 @@ export default {
return { return {
collect_num:0, collect_num:0,
form: { form: {
exchange_rate:"",
desc: "", desc: "",
}, },
activeName: 'first',
el_valuestatus: true, el_valuestatus: true,
el_value: [], //地址 el_value: [], //地址
options: [], options: [],
...@@ -108,6 +122,13 @@ export default { ...@@ -108,6 +122,13 @@ export default {
}, },
watch: {}, watch: {},
methods: { methods: {
handleClick(tab, event) {
// console.log(tab, event);
this.el_value = []
this.$refs.cascaderDom.$refs.panel.activePath = []
this.form.desc = ''
this.form.exchange_rate = ''
},
handleClose(){ handleClose(){
this.dialogDetail = false this.dialogDetail = false
this.info() this.info()
...@@ -120,17 +141,18 @@ export default { ...@@ -120,17 +141,18 @@ export default {
}) })
}, },
onSubmit() { onSubmit() {
if (this.collect_num <= 0) { if (this.collect_num <= 0&&this.activeName=='first') {
this.$message({type: 'warning', message: '您好,您的导入次数已用完,请您联系我们的工作人员操作充值'}); this.$message({type: 'warning', message: '您好,您的导入次数已用完,请您联系我们的工作人员操作充值'});
return; return;
} }
let urlarr let urlarr
if (this.form.desc) { if (this.form.desc) {
urlarr = this.form.desc.split(',') urlarr = this.form.desc.split(',')
//debugger //debugger
if (urlarr.length > 0 && urlarr.length <= 10) { if (urlarr.length > 0 && urlarr.length <= 10) {
if( Number(urlarr.length) > Number(this.collect_num)) { if( Number(urlarr.length) > Number(this.collect_num)&&this.activeName=='first') {
this.$message({type: 'warning',message:'您好,准备导入的商品条数过多,当前剩余次数不足,请重新输入'}); this.$message({type: 'warning',message:'您好,准备导入的商品条数过多,当前剩余次数不足,请重新输入'});
return; return;
} }
...@@ -149,7 +171,10 @@ export default { ...@@ -149,7 +171,10 @@ export default {
return false return false
} }
if(!this.form.exchange_rate&&this.activeName=='second'){
this.$message.error('请填写货币转换汇率!');
return false
}
if (this.el_value.length == 3) { if (this.el_value.length == 3) {
// this.$message.error('商品分类!'); // this.$message.error('商品分类!');
} else { } else {
...@@ -159,7 +184,10 @@ export default { ...@@ -159,7 +184,10 @@ export default {
let data = { let data = {
category_id: this.el_value[2], category_id: this.el_value[2],
third_url: urlarr third_url: urlarr,
}
if(this.activeName=='second'){
data['exchange_rate'] = this.form.exchange_rate
} }
goodsimport(data).then(res => { goodsimport(data).then(res => {
let sucCount = 0; let sucCount = 0;
...@@ -184,6 +212,7 @@ export default { ...@@ -184,6 +212,7 @@ export default {
this.el_value = [] this.el_value = []
this.$refs.cascaderDom.$refs.panel.activePath = [] this.$refs.cascaderDom.$refs.panel.activePath = []
this.form.desc = '' this.form.desc = ''
this.form.exchange_rate = ''
} else { } else {
msg = res.message || res.msg ? res.message || res.msg : '导入失败' msg = res.message || res.msg ? res.message || res.msg : '导入失败'
this.$message({ type:'error', message: msg }) this.$message({ type:'error', message: msg })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论