更新
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-alert
|
||||
title="采集一个商品添加进草稿箱,将消耗20金币"
|
||||
type="success"
|
||||
:closable="false">
|
||||
</el-alert>
|
||||
<el-form class="ai-form" :model="form" label-width="140px" ref="form">
|
||||
<el-form-item label="来源:" style="width: 100%;" prop="type" :rules="[{ required: true, message: '请选择来源', trigger: 'blur' }]">
|
||||
<el-radio-group v-model="form.type" size="medium">
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
<i class="el-icon-magic-stick"></i>
|
||||
<span slot="title">选品采集</span>
|
||||
</template>
|
||||
<el-menu-item index="/niubiCopy">智能复制</el-menu-item>
|
||||
<el-menu-item index="/niubiCopy">商品采集</el-menu-item>
|
||||
<el-menu-item index="/storeTrack">店铺跟踪</el-menu-item>
|
||||
<el-menu-item index="/keywordTrack">关键字跟踪</el-menu-item>
|
||||
</el-submenu>
|
||||
|
||||
@@ -84,7 +84,7 @@ import AiCopyFromTemu from "@/components/AiCopyFromTemu.vue";
|
||||
{ slot: 'url', label: '商品地址', align: 'left' },
|
||||
{ prop: 'type', label: '来源', width: '100px', align: 'left',format: v => this.$dict.getLabel('copy_from', v), },
|
||||
{ prop: 'mallName', label: '店铺名称', width: '200px', align: 'left'},
|
||||
{ prop: 'createTime', label: '复制时间', width: '180px', fixed: 'right'}
|
||||
{ prop: 'createTime', label: '复制时间', width: '180px'}
|
||||
],
|
||||
tableData: [],
|
||||
total: 0,
|
||||
|
||||
@@ -20,6 +20,16 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-pagination
|
||||
layout="prev, pager, next"
|
||||
style="position: absolute; bottom: 0px; right: 40px;"
|
||||
:total="total"
|
||||
:page-size.sync="search.size"
|
||||
:current-page.sync="search.current"
|
||||
@current-change="getList">
|
||||
<div class="paginationPre-total">共<label class="color-primary">{{ total }}</label>条记录
|
||||
</div>
|
||||
</el-pagination>
|
||||
</div>
|
||||
</template>
|
||||
</ai-list>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<ai-list class="list">
|
||||
<ai-list class="list" v-loading="isLoading" element-loading-text="正在采集中……" element-loading-spinner="el-icon-loading">
|
||||
<ai-title
|
||||
slot="title"
|
||||
title="关键字跟踪"
|
||||
@@ -45,6 +45,11 @@
|
||||
width="790px"
|
||||
customFooter
|
||||
@close="isDlgShow = false">
|
||||
<el-alert
|
||||
title="添加一个关键字跟踪,将消耗200金币"
|
||||
type="success"
|
||||
:closable="false">
|
||||
</el-alert>
|
||||
<el-form class="ai-form" :model="form" label-width="120px" ref="form">
|
||||
<el-form-item
|
||||
prop="content"
|
||||
@@ -52,6 +57,12 @@
|
||||
:rules="[{ required: true, message: '请输入关键字', trigger: 'blur' }]">
|
||||
<el-input placeholder="请输入关键字" v-model="form.content"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
prop="orderType"
|
||||
label="排序方式"
|
||||
:rules="[{ required: true, message: '请选择排序方式', trigger: 'blur' }]">
|
||||
<ai-select :selectList="$dict.getDict('monitor_order_type')" v-model="form.orderType"></ai-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button @click="isDlgShow = false">取 消</el-button>
|
||||
@@ -76,6 +87,7 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
||||
},
|
||||
colConfigs: [
|
||||
{ prop: 'content', label: '关键字', align: 'left' },
|
||||
{ prop: 'orderType', label: '排序方式', align: 'left', format: v => this.$dict.getLabel('monitor_order_type', v) },
|
||||
{ prop: 'lastUpdateTime', label: '最后一次更新时间', align: 'left' },
|
||||
{ prop: 'status', label: '状态', align: 'left', format: v => this.$dict.getLabel('monitor_status', v), },
|
||||
{ prop: 'expireTime', label: '失效时间', align: 'left' },
|
||||
@@ -85,18 +97,21 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
||||
total: 0,
|
||||
|
||||
form: {
|
||||
content: ''
|
||||
content: '',
|
||||
orderType: '0:1'
|
||||
},
|
||||
|
||||
isDlgShow: false,
|
||||
detailsVo: {},
|
||||
pageNo: 1,
|
||||
pageSize: 120
|
||||
pageSize: 120,
|
||||
|
||||
isLoading: false
|
||||
}
|
||||
},
|
||||
|
||||
created () {
|
||||
this.$dict.load('monitor_status');
|
||||
this.$dict.load('monitor_status', 'monitor_order_type');
|
||||
this.getList()
|
||||
},
|
||||
|
||||
@@ -116,7 +131,7 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
||||
if (valid) {
|
||||
this.$http.post('/api/monitor/check',null, {params: {type: 0}}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$http.post(`/api/monitor/add`, {content: this.form.content, type: this.search.type}).then(res => {
|
||||
this.$http.post(`/api/monitor/add`, {content: this.form.content, orderType: this.form.orderType, type: this.search.type}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('添加成功!')
|
||||
this.$store.dispatch('getUserInfo')
|
||||
@@ -181,6 +196,7 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
||||
this.detailsVo.monitorId = row.id
|
||||
this.detailsVo.details = []
|
||||
this.pageNo = 1
|
||||
this.isLoading = true
|
||||
|
||||
this.beginCollect(row)
|
||||
},
|
||||
@@ -194,12 +210,12 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
||||
"offset": (this.pageNo-1) * this.pageSize,
|
||||
"pageSize": 120,
|
||||
"query": row.content,
|
||||
"filterItems": "0:1",
|
||||
"filterItems": row.orderType,
|
||||
"searchMethod": "suggest"
|
||||
}}).then((res) => {
|
||||
this.isLoading = false
|
||||
if (res.success) {
|
||||
res.result.data.goods_list.map(item => {
|
||||
console.log(item.sales_tip_text[0])
|
||||
let total = 0
|
||||
if (item.sales_tip_text[0]) {
|
||||
total = item.sales_tip_text[0]
|
||||
@@ -230,6 +246,8 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.error("采集失败,请检查网络情况")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -20,6 +20,14 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-pagination
|
||||
layout="prev, pager, next"
|
||||
style="position: absolute; bottom: 0px; right: 40px;"
|
||||
:total="total"
|
||||
:page-size.sync="search.size"
|
||||
:current-page.sync="search.current"
|
||||
@current-change="getList">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</template>
|
||||
</ai-list>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<ai-list class="list">
|
||||
<ai-list class="list" v-loading="isLoading" element-loading-text="正在采集中……" element-loading-spinner="el-icon-loading">
|
||||
<ai-title
|
||||
slot="title"
|
||||
title="店铺跟踪"
|
||||
@@ -45,6 +45,11 @@
|
||||
width="790px"
|
||||
customFooter
|
||||
@close="isDlgShow = false">
|
||||
<el-alert
|
||||
title="添加一个店铺跟踪,将消耗300金币"
|
||||
type="success"
|
||||
:closable="false">
|
||||
</el-alert>
|
||||
<el-form class="ai-form" :model="form" label-width="120px" ref="form">
|
||||
<el-form-item
|
||||
prop="mallId"
|
||||
@@ -91,7 +96,9 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
||||
isDlgShow: false,
|
||||
detailsVo: {},
|
||||
pageNo: 1,
|
||||
pageSize: 120
|
||||
pageSize: 120,
|
||||
|
||||
isLoading: false
|
||||
}
|
||||
},
|
||||
|
||||
@@ -182,6 +189,8 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
||||
this.detailsVo.details = []
|
||||
this.pageNo = 1
|
||||
|
||||
this.isLoading = true
|
||||
|
||||
this.beginCollect(row)
|
||||
},
|
||||
beginCollect(row) {
|
||||
@@ -196,14 +205,17 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
||||
}}).then((res) => {
|
||||
if (res.errorCode == 1000000) {
|
||||
res.result.data.goods_list.map(item => {
|
||||
let total = item.sales_tip_text[0]
|
||||
total = total.replace('+', '')
|
||||
if (total.indexOf('K') != -1) {
|
||||
total = total.replace('K', '')
|
||||
total = total * 1000
|
||||
} else if (total.indexOf('M') != -1) {
|
||||
total = total.replace('M', '')
|
||||
total = total * 1000000
|
||||
let total = 0
|
||||
if (item.sales_tip_text[0]) {
|
||||
total = item.sales_tip_text[0]
|
||||
total = total.replace('+', '')
|
||||
if (total.indexOf('K') != -1) {
|
||||
total = total.replace('K', '')
|
||||
total = total * 1000
|
||||
} else if (total.indexOf('M') != -1) {
|
||||
total = total.replace('M', '')
|
||||
total = total * 1000000
|
||||
}
|
||||
}
|
||||
this.detailsVo.details.push({
|
||||
url: item.link_url,
|
||||
@@ -219,6 +231,7 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
||||
this.pageNo = this.pageNo + 1
|
||||
this.beginCollect(row)
|
||||
} else {
|
||||
this.isLoading = false
|
||||
this.$http.post('/api/monitorDetail/addDetails',this.detailsVo
|
||||
).then(res => {
|
||||
if (res.code == 0) {
|
||||
@@ -227,6 +240,9 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.isLoading = false
|
||||
this.$message.error("采集失败,请检查网络情况")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user