调整
This commit is contained in:
@@ -148,7 +148,7 @@ function init() {
|
|||||||
|
|
||||||
var imgObjList = document.querySelectorAll('div.aplus-v2 img')
|
var imgObjList = document.querySelectorAll('div.aplus-v2 img')
|
||||||
for (var i = 0; i < imgObjList.length; i++) {
|
for (var i = 0; i < imgObjList.length; i++) {
|
||||||
baseList.push({type: 0, index: i+1, src: imgObjList[i].getAttribute('data-src'), folder: imgsDetail})
|
baseList.push({type: 0, index: i+1, src: imgObjList[i].getAttribute('data-src') || imgObjList[i].src, folder: imgsDetail})
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var k = 0; k < baseList.length; k++) {
|
for (var k = 0; k < baseList.length; k++) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "TEMU助手",
|
"name": "TEMU助手",
|
||||||
"description": "TEMU助手 - 自动化提高生产效率",
|
"description": "TEMU助手 - 自动化提高生产效率",
|
||||||
"version": "3.0.0",
|
"version": "3.0.2",
|
||||||
"background": {
|
"background": {
|
||||||
"service_worker": "/background.js"
|
"service_worker": "/background.js"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -80,6 +80,7 @@
|
|||||||
</json-excel>
|
</json-excel>
|
||||||
</template>
|
</template>
|
||||||
<ai-table
|
<ai-table
|
||||||
|
ref="table0"
|
||||||
:isShowPagination="false"
|
:isShowPagination="false"
|
||||||
:tableData="list"
|
:tableData="list"
|
||||||
height="500"
|
height="500"
|
||||||
@@ -104,6 +105,7 @@
|
|||||||
</json-excel>
|
</json-excel>
|
||||||
</template>
|
</template>
|
||||||
<ai-table
|
<ai-table
|
||||||
|
ref="table1"
|
||||||
:isShowPagination="false"
|
:isShowPagination="false"
|
||||||
:tableData="last30DaySkuList"
|
:tableData="last30DaySkuList"
|
||||||
height="500"
|
height="500"
|
||||||
@@ -128,6 +130,7 @@
|
|||||||
</json-excel>
|
</json-excel>
|
||||||
</template>
|
</template>
|
||||||
<ai-table
|
<ai-table
|
||||||
|
ref="table2"
|
||||||
:isShowPagination="false"
|
:isShowPagination="false"
|
||||||
:tableData="last30DaySkcList"
|
:tableData="last30DaySkcList"
|
||||||
height="500"
|
height="500"
|
||||||
@@ -176,6 +179,7 @@ import { Message } from 'element-ui'
|
|||||||
"商品名称": "productName",
|
"商品名称": "productName",
|
||||||
"店铺名称": "mallName",
|
"店铺名称": "mallName",
|
||||||
"评分": "mark",
|
"评分": "mark",
|
||||||
|
"是否热销": 'hotTag',
|
||||||
"SPU": "productId",
|
"SPU": "productId",
|
||||||
"SKC": "productSkcId",
|
"SKC": "productSkcId",
|
||||||
"SKU ID": "productSkuId",
|
"SKU ID": "productSkuId",
|
||||||
@@ -234,14 +238,16 @@ import { Message } from 'element-ui'
|
|||||||
label: '商品名称',
|
label: '商品名称',
|
||||||
"show-overflow-tooltip": true,
|
"show-overflow-tooltip": true,
|
||||||
width: '280px',
|
width: '280px',
|
||||||
align: 'left'
|
align: 'left',
|
||||||
|
fixed: 'left'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'mallName',
|
prop: 'mallName',
|
||||||
label: '店铺名称',
|
label: '店铺名称',
|
||||||
"show-overflow-tooltip": true,
|
"show-overflow-tooltip": true,
|
||||||
width: '120px',
|
width: '120px',
|
||||||
align: 'left'
|
align: 'left',
|
||||||
|
fixed: 'left'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'mark',
|
prop: 'mark',
|
||||||
@@ -250,6 +256,13 @@ import { Message } from 'element-ui'
|
|||||||
width: '80px',
|
width: '80px',
|
||||||
align: 'left'
|
align: 'left'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
prop: 'hotTag',
|
||||||
|
label: '是否热销',
|
||||||
|
"show-overflow-tooltip": true,
|
||||||
|
width: '80px',
|
||||||
|
align: 'left'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
prop: 'productId',
|
prop: 'productId',
|
||||||
label: 'SPU',
|
label: 'SPU',
|
||||||
@@ -535,7 +548,9 @@ import { Message } from 'element-ui'
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
changeDataType() {
|
changeDataType() {
|
||||||
|
this.$nextTick(() => { //在数据加载完,重新渲染表格
|
||||||
|
this.$refs['table'+this.type].doLayout();
|
||||||
|
})
|
||||||
},
|
},
|
||||||
beforeGetList() {
|
beforeGetList() {
|
||||||
this.list = []
|
this.list = []
|
||||||
@@ -606,6 +621,7 @@ import { Message } from 'element-ui'
|
|||||||
data.purchaseConfig = item.purchaseConfig;
|
data.purchaseConfig = item.purchaseConfig;
|
||||||
data.productSkcPicture = item.productSkcPicture;
|
data.productSkcPicture = item.productSkcPicture;
|
||||||
data.mark = item.mark.toFixed(1)
|
data.mark = item.mark.toFixed(1)
|
||||||
|
data.hotTag = item.hotTag ? '是': '否'
|
||||||
data.mallName = this.mallName;
|
data.mallName = this.mallName;
|
||||||
|
|
||||||
this.last30DaySkcList.push({
|
this.last30DaySkcList.push({
|
||||||
|
|||||||
@@ -107,6 +107,10 @@
|
|||||||
:before-close="handleClose">
|
:before-close="handleClose">
|
||||||
<ai-payment/>
|
<ai-payment/>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<div id="kefu" @click="gotoKefu">
|
||||||
|
<label slot="reference" class="topBtn" title="联系客服"></label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -226,6 +230,9 @@ import AiPayment from "@/components/AiPayment.vue";
|
|||||||
this.$store.dispatch('getUserInfo')
|
this.$store.dispatch('getUserInfo')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
gotoKefu() {
|
||||||
|
window.open('https://work.weixin.qq.com/kfid/kfcaa4208f661131eba', '_blank')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -407,4 +414,29 @@ import AiPayment from "@/components/AiPayment.vue";
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#kefu {
|
||||||
|
position: fixed;
|
||||||
|
right: 20px;
|
||||||
|
bottom: 40px;
|
||||||
|
z-index: 999;
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
}
|
||||||
|
#kefu .topBtn {
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
background-color: #fff;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
border-radius: 50%;
|
||||||
|
cursor: pointer;
|
||||||
|
background-position: center center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 40px 40px;
|
||||||
|
-webkit-animation: wobble 250ms infinite;
|
||||||
|
animation: wobble 250ms infinite;
|
||||||
|
background-image: url('data:image/svg+xml;%20charset=utf8,%3Csvg%20t%3D%221575450105478%22%20class%3D%22icon%22%20viewBox%3D%220%200%201220%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20p-id%3D%222883%22%20width%3D%2248%22%20height%3D%2248%22%3E%3Cpath%20d%3D%22M609.524%20103.522c-222.89%200-403.712%20178.472-403.712%20398.78%200%20220.31%20180.823%20398.782%20403.712%20398.782%20222.889%200%20403.712-178.473%20403.712-398.781%200-220.309-180.823-398.781-403.712-398.781v48.762c196.1%200%20354.95%20156.785%20354.95%20350.019s-158.85%20350.019-354.95%20350.019-354.95-156.785-354.95-350.02c0-193.233%20158.85-350.018%20354.95-350.018v-48.762z%22%20fill%3D%22%231296db%22%20p-id%3D%222884%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M786.578%20916.34c166.45-69.217%20278.408-231.055%20278.408-414.035%200-248.026-203.847-449.219-455.457-449.219-251.619%200-455.457%20201.188-455.457%20449.22%200%2055.397%2010.152%20109.367%2029.718%20159.975%204.855%2012.56-1.39%2026.677-13.949%2031.533-12.56%204.855-26.677-1.39-31.532-13.949a490.396%20490.396%200%200%201-3.042-8.078c-1.85%200.077-3.711%200.116-5.581%200.116C58.06%20671.903%200%20614.597%200%20543.903c0-65.005%2049.09-118.69%20112.68-126.91C153.65%20182.56%20360.56%204.324%20609.528%204.324c248.962%200%20455.877%20178.24%20496.85%20412.67%2063.583%208.225%20112.669%2061.907%20112.669%20126.909%200%2070.694-58.06%20128-129.686%20128-1.89%200-3.771-0.04-5.642-0.119-47.536%20129.702-148.34%20235.841-279.493%20290.027-1.161%2033.464-29.012%2060.24-63.2%2060.24-34.925%200-63.237-27.944-63.237-62.416%200-34.471%2028.312-62.415%2063.237-62.415%2017.892%200%2034.048%207.333%2045.551%2019.12z%22%20fill%3D%22%231296db%22%20p-id%3D%222885%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M609.528%20611.405c-58.933%200-112.056-10.644-158.472-28.342-16.123-6.147-30.211-12.702-42.138-19.208-6.926-3.777-11.447-6.59-13.437-7.972-19.24-13.373-44.428%205.446-37.059%2027.688%2035.296%20106.527%20136.054%20179.913%20251.106%20179.913%20115.05%200%20215.796-73.384%20251.092-179.913%207.37-22.243-17.82-41.062-37.06-27.687-1.99%201.383-6.51%204.195-13.434%207.972-11.926%206.505-26.012%2013.06-42.133%2019.207-46.413%2017.698-99.533%2028.342-158.465%2028.342z%22%20fill%3D%22%231296db%22%20p-id%3D%222886%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E');
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<ai-search-bar>
|
<ai-search-bar>
|
||||||
<template #left>
|
<template #left>
|
||||||
|
<el-button type="button" :icon="'el-icon-delete'" :class="'el-button el-button--primary'" @click="batchRemove()">删除</el-button>
|
||||||
|
<el-button type="button" :class="'el-button el-button--primary'" @click="batchCollect()">批量采集</el-button>
|
||||||
<el-button type="button" :class="'el-button el-button--primary'" @click="addStore()">添加关键字</el-button>
|
<el-button type="button" :class="'el-button el-button--primary'" @click="addStore()">添加关键字</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
@@ -22,6 +24,7 @@
|
|||||||
:total="total"
|
:total="total"
|
||||||
style="margin-top: 8px;"
|
style="margin-top: 8px;"
|
||||||
:current.sync="search.current" :size.sync="search.size"
|
:current.sync="search.current" :size.sync="search.size"
|
||||||
|
@selection-change="onChooseChange"
|
||||||
@getList="getList">
|
@getList="getList">
|
||||||
<el-table-column slot="options" label="操作" width="200px" show-overflow-tooltip align="center" fixed="right">
|
<el-table-column slot="options" label="操作" width="200px" show-overflow-tooltip align="center" fixed="right">
|
||||||
<template slot-scope="{ row }">
|
<template slot-scope="{ row }">
|
||||||
@@ -87,6 +90,7 @@ import { Message } from 'element-ui'
|
|||||||
size: 10
|
size: 10
|
||||||
},
|
},
|
||||||
colConfigs: [
|
colConfigs: [
|
||||||
|
{ type: "selection", width: '70px', align: 'left' },
|
||||||
{ prop: 'content', label: '关键字', align: 'left' },
|
{ prop: 'content', label: '关键字', align: 'left' },
|
||||||
{ prop: 'orderType', label: '排序方式', align: 'left', format: v => this.$dict.getLabel('monitor_order_type', v) },
|
{ prop: 'orderType', label: '排序方式', align: 'left', format: v => this.$dict.getLabel('monitor_order_type', v) },
|
||||||
{ prop: 'lastUpdateTime', label: '最后一次更新时间', align: 'left' },
|
{ prop: 'lastUpdateTime', label: '最后一次更新时间', align: 'left' },
|
||||||
@@ -107,7 +111,10 @@ import { Message } from 'element-ui'
|
|||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 120,
|
pageSize: 120,
|
||||||
|
|
||||||
isLoading: false
|
isLoading: false,
|
||||||
|
|
||||||
|
selectRows: [],
|
||||||
|
isBatchCollect: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -127,6 +134,9 @@ import { Message } from 'element-ui'
|
|||||||
this.total = res.data.total
|
this.total = res.data.total
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
onChooseChange (val) {
|
||||||
|
this.selectRows = val;
|
||||||
|
},
|
||||||
saveStore () {
|
saveStore () {
|
||||||
this.$refs.form.validate((valid) => {
|
this.$refs.form.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
@@ -163,6 +173,46 @@ import { Message } from 'element-ui'
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
batchRemove() {
|
||||||
|
if (this.selectRows.length <= 0) {
|
||||||
|
this.$message.error('请选择要删除的监测对象');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let ids = this.selectRows.map(item => {
|
||||||
|
return item.id
|
||||||
|
})
|
||||||
|
|
||||||
|
this.$confirm('确定要删除?', '温馨提示', {
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.$http.post('/api/monitor/delByIds', ids
|
||||||
|
).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('删除成功!')
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
batchCollect () {
|
||||||
|
if (this.selectRows.length <= 0) {
|
||||||
|
this.$message.error('请选择要采集的监测对象');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.isBatchCollect = true
|
||||||
|
this.isLoading = true
|
||||||
|
this.selectRows.map((item, index) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.pageNo = 1
|
||||||
|
|
||||||
|
let data = {}
|
||||||
|
data.monitorId = item.id
|
||||||
|
data.details = []
|
||||||
|
|
||||||
|
this.beginCollect(item, data, index)
|
||||||
|
}, 1000*(index+1))
|
||||||
|
})
|
||||||
|
},
|
||||||
deleteMonitor(id) {
|
deleteMonitor(id) {
|
||||||
this.$confirm('确定要删除?', '温馨提示', {
|
this.$confirm('确定要删除?', '温馨提示', {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
@@ -193,25 +243,32 @@ import { Message } from 'element-ui'
|
|||||||
this.isDlgShow = true
|
this.isDlgShow = true
|
||||||
},
|
},
|
||||||
toBegin(row) {
|
toBegin(row) {
|
||||||
this.detailsVo = {}
|
this.isBatchCollect = false
|
||||||
this.detailsVo.monitorId = row.id
|
|
||||||
this.detailsVo.details = []
|
|
||||||
this.pageNo = 1
|
this.pageNo = 1
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
|
|
||||||
this.beginCollect(row)
|
let data = {}
|
||||||
|
data.monitorId = row.id
|
||||||
|
data.details = []
|
||||||
|
|
||||||
|
this.beginCollect(row, data, 0)
|
||||||
},
|
},
|
||||||
beginCollect(row) {
|
beginCollect(row, reqData, index) {
|
||||||
sendChromeWebReqMessage({
|
sendChromeWebReqMessage({
|
||||||
type: 'temu',
|
type: 'temu',
|
||||||
url: 'https://www.temu.com/search_result.html?search_key='+row.content+'&search_method=user&filter_items='+row.orderType
|
url: 'https://www.temu.com/search_result.html?search_key='+row.content+'&search_method=user&filter_items='+row.orderType
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.isLoading = false
|
if (this.isBatchCollect && (index+1) == this.selectRows.length) {
|
||||||
|
this.isLoading = false
|
||||||
|
this.isBatchCollect = false
|
||||||
|
} else {
|
||||||
|
this.isLoading = false
|
||||||
|
}
|
||||||
if (res.indexOf("rawData") == -1) {
|
if (res.indexOf("rawData") == -1) {
|
||||||
Message.error("请检查地址是否正确,或者“TEMU”网站是否出现图形验证码")
|
Message.error("请检查地址是否正确,或者“TEMU”网站是否出现图形验证码")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let str = res.substring(res.indexOf("rawData"))
|
let str = res.substring(res.indexOf("window.rawData"))
|
||||||
str = str.substring(0, str.indexOf("<\/script>"))
|
str = str.substring(0, str.indexOf("<\/script>"))
|
||||||
str = str.substring(str.indexOf("{"))
|
str = str.substring(str.indexOf("{"))
|
||||||
str = str.substring(0, str.lastIndexOf("}"))
|
str = str.substring(0, str.lastIndexOf("}"))
|
||||||
@@ -232,7 +289,7 @@ import { Message } from 'element-ui'
|
|||||||
total = total * 1000000
|
total = total * 1000000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.detailsVo.details.push({
|
reqData.details.push({
|
||||||
url: item.linkUrl,
|
url: item.linkUrl,
|
||||||
price: item.priceInfo.priceSchema,
|
price: item.priceInfo.priceSchema,
|
||||||
saleTotal: total,
|
saleTotal: total,
|
||||||
@@ -242,7 +299,7 @@ import { Message } from 'element-ui'
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
this.$http.post('/api/monitorDetail/addDetails',this.detailsVo).then(res => {
|
this.$http.post('/api/monitorDetail/addDetails', reqData).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.$message.success('关键字【' + row.content + '】数据采集成功!')
|
this.$message.success('关键字【' + row.content + '】数据采集成功!')
|
||||||
this.getList()
|
this.getList()
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<ai-search-bar>
|
<ai-search-bar>
|
||||||
<template #left>
|
<template #left>
|
||||||
|
<el-button type="button" :icon="'el-icon-delete'" :class="'el-button el-button--primary'" @click="batchRemove()">删除</el-button>
|
||||||
|
<el-button type="button" :class="'el-button el-button--primary'" @click="batchCollect()">批量采集</el-button>
|
||||||
<el-button type="button" :class="'el-button el-button--primary'" @click="addStore()">添加店铺</el-button>
|
<el-button type="button" :class="'el-button el-button--primary'" @click="addStore()">添加店铺</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template #right>
|
<template #right>
|
||||||
@@ -21,6 +23,7 @@
|
|||||||
:col-configs="colConfigs"
|
:col-configs="colConfigs"
|
||||||
:total="total"
|
:total="total"
|
||||||
style="margin-top: 8px;"
|
style="margin-top: 8px;"
|
||||||
|
@selection-change="onChooseChange"
|
||||||
:current.sync="search.current" :size.sync="search.size"
|
:current.sync="search.current" :size.sync="search.size"
|
||||||
@getList="getList">
|
@getList="getList">
|
||||||
<el-table-column slot="options" label="操作" width="200px" show-overflow-tooltip align="center" fixed="right">
|
<el-table-column slot="options" label="操作" width="200px" show-overflow-tooltip align="center" fixed="right">
|
||||||
@@ -80,6 +83,7 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
|||||||
size: 10
|
size: 10
|
||||||
},
|
},
|
||||||
colConfigs: [
|
colConfigs: [
|
||||||
|
{ type: "selection", width: '70px', align: 'left' },
|
||||||
{ prop: 'content', label: '店铺ID', align: 'left' },
|
{ prop: 'content', label: '店铺ID', align: 'left' },
|
||||||
{ prop: 'lastUpdateTime', label: '最后一次更新时间', align: 'left' },
|
{ prop: 'lastUpdateTime', label: '最后一次更新时间', align: 'left' },
|
||||||
{ prop: 'status', label: '状态', align: 'left', format: v => this.$dict.getLabel('monitor_status', v), },
|
{ prop: 'status', label: '状态', align: 'left', format: v => this.$dict.getLabel('monitor_status', v), },
|
||||||
@@ -98,7 +102,10 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
|||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 120,
|
pageSize: 120,
|
||||||
|
|
||||||
isLoading: false
|
isLoading: false,
|
||||||
|
|
||||||
|
selectRows: [],
|
||||||
|
isBatchCollect: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -118,6 +125,9 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
|||||||
this.total = res.data.total
|
this.total = res.data.total
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
onChooseChange (val) {
|
||||||
|
this.selectRows = val;
|
||||||
|
},
|
||||||
saveStore () {
|
saveStore () {
|
||||||
this.$refs.form.validate((valid) => {
|
this.$refs.form.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
@@ -136,6 +146,46 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
batchRemove() {
|
||||||
|
if (this.selectRows.length <= 0) {
|
||||||
|
this.$message.error('请选择要删除的监测对象');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let ids = this.selectRows.map(item => {
|
||||||
|
return item.id
|
||||||
|
})
|
||||||
|
|
||||||
|
this.$confirm('确定要删除?', '温馨提示', {
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.$http.post('/api/monitor/delByIds', ids
|
||||||
|
).then(res => {
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.$message.success('删除成功!')
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
batchCollect () {
|
||||||
|
if (this.selectRows.length <= 0) {
|
||||||
|
this.$message.error('请选择要采集的监测对象');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.isBatchCollect = true
|
||||||
|
this.isLoading = true
|
||||||
|
this.selectRows.map((item, index) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.pageNo = 1
|
||||||
|
|
||||||
|
let data = {}
|
||||||
|
data.monitorId = item.id
|
||||||
|
data.details = []
|
||||||
|
|
||||||
|
this.beginCollect(item, data, index)
|
||||||
|
}, 1000*(index+1))
|
||||||
|
})
|
||||||
|
},
|
||||||
renew(id) {
|
renew(id) {
|
||||||
this.$confirm('确定要续费?', '温馨提示', {
|
this.$confirm('确定要续费?', '温馨提示', {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
@@ -184,16 +234,17 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
|||||||
this.isDlgShow = true
|
this.isDlgShow = true
|
||||||
},
|
},
|
||||||
toBegin(row) {
|
toBegin(row) {
|
||||||
this.detailsVo = {}
|
this.isBatchCollect = false
|
||||||
this.detailsVo.monitorId = row.id
|
|
||||||
this.detailsVo.details = []
|
|
||||||
this.pageNo = 1
|
this.pageNo = 1
|
||||||
|
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
|
|
||||||
this.beginCollect(row)
|
let data = {}
|
||||||
|
data.monitorId = row.id
|
||||||
|
data.details = []
|
||||||
|
|
||||||
|
this.beginCollect(row, data, 0)
|
||||||
},
|
},
|
||||||
beginCollect(row) {
|
beginCollect(row, reqData, index) {
|
||||||
sendTemuAPIMessage({
|
sendTemuAPIMessage({
|
||||||
url: 'api/bg/circle/c/mall/newGoodsList',
|
url: 'api/bg/circle/c/mall/newGoodsList',
|
||||||
anti: true,
|
anti: true,
|
||||||
@@ -203,6 +254,12 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
|||||||
"page_number": this.pageNo,
|
"page_number": this.pageNo,
|
||||||
"page_size": this.pageSize
|
"page_size": this.pageSize
|
||||||
}}).then((res) => {
|
}}).then((res) => {
|
||||||
|
if (this.isBatchCollect && (index+1) == this.selectRows.length) {
|
||||||
|
this.isLoading = false
|
||||||
|
this.isBatchCollect = false
|
||||||
|
} else {
|
||||||
|
this.isLoading = false
|
||||||
|
}
|
||||||
if (res.errorCode == 1000000) {
|
if (res.errorCode == 1000000) {
|
||||||
res.result.data.goods_list.map(item => {
|
res.result.data.goods_list.map(item => {
|
||||||
let total = 0
|
let total = 0
|
||||||
@@ -217,7 +274,7 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
|||||||
total = total * 1000000
|
total = total * 1000000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.detailsVo.details.push({
|
reqData.details.push({
|
||||||
url: item.link_url,
|
url: item.link_url,
|
||||||
price: item.price_info.price_schema,
|
price: item.price_info.price_schema,
|
||||||
saleTotal: total,
|
saleTotal: total,
|
||||||
@@ -229,10 +286,10 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
|
|||||||
|
|
||||||
if (res.result.data.goods_list.length == this.pageSize) {
|
if (res.result.data.goods_list.length == this.pageSize) {
|
||||||
this.pageNo = this.pageNo + 1
|
this.pageNo = this.pageNo + 1
|
||||||
this.beginCollect(row)
|
this.beginCollect(row, reqData, index)
|
||||||
} else {
|
} else {
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
this.$http.post('/api/monitorDetail/addDetails',this.detailsVo
|
this.$http.post('/api/monitorDetail/addDetails', reqData
|
||||||
).then(res => {
|
).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.$message.success('店铺ID【' + row.content + '】数据采集成功!')
|
this.$message.success('店铺ID【' + row.content + '】数据采集成功!')
|
||||||
|
|||||||
@@ -343,6 +343,9 @@
|
|||||||
|
|
||||||
created () {
|
created () {
|
||||||
this.$dict.load('rob_frequency');
|
this.$dict.load('rob_frequency');
|
||||||
|
},
|
||||||
|
activated () {
|
||||||
|
this.addressList = []
|
||||||
this.getAddressInfo();
|
this.getAddressInfo();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user