This commit is contained in:
liushiwei
2023-10-28 12:28:12 +08:00
parent eb518c412f
commit 9909a938ca
13 changed files with 680 additions and 31 deletions

View File

@@ -35,7 +35,7 @@
</el-form>
<div class="bottom flex-center">
<el-button @click="$emit('onClose')"> </el-button>
<el-button type="primary" @click="addToDraft">确定</el-button>
<el-button type="primary" @click="addToDraft" :loading="isCopying">确定</el-button>
</div>
</div>
</template>
@@ -108,7 +108,8 @@ export default {
},
goods: {},
sku: {},
productDetail: {}
productDetail: {},
isCopying: false
}
},
created () {
@@ -120,6 +121,7 @@ export default {
async addToDraft() {
this.$refs.form.validate((valid) => {
if (valid) {
this.isCopying = true
this.$http.post('/api/copyProduct/check',null, {params: {type: 0}}).then(res => {
if (res.code == 0) {
let source
@@ -134,8 +136,9 @@ export default {
}).then((res) => {
if (this.form.type == '1') {
if (res.indexOf("rawData") == -1) {
Message.error("请检查地址是否正确或者“TEMU”网站是否出现图形验证码")
return
this.isCopying = falses
Message.error("请检查地址是否正确或者“TEMU”网站是否出现图形验证码")
return
}
let str = res.substring(res.indexOf("rawData"))
str = str.substring(0, str.indexOf("<\/script>"))
@@ -206,6 +209,8 @@ export default {
})*/
}
})
} else {
this.isCopying = false
}
})
}
@@ -219,6 +224,7 @@ export default {
data: {
catId: this.form.targetCatId[this.form.targetCatId.length - 1]
}}).then((res) => {
this.isCopying = false
if (res.errorCode == 1000000) {
let draftId = res.result.productDraftId
let content = data

View File

@@ -46,12 +46,20 @@ export default {
if (e.type == 'detail') {
this.$emit('onGoDetail')
} else if (e.type == 'copy') {
this.temuParams = {url: 'https://www.temu.com/' + e.url}
if (e.url.startsWith('http')) {
this.temuParams = {url: e.url}
} else {
this.temuParams = {url: 'https://www.temu.com/' + e.url}
}
this.copyFromDlgShow = true
} else if (e.type == 'goMall') {
window.open('https://www.temu.com/mall.html?mall_id=' + e.mallId, '_blank');
} else if (e.type == 'goWeb') {
window.open('https://www.temu.com/' + e.url, '_blank');
if (e.url.startsWith('http')) {
window.open(e.url, '_blank');
} else {
window.open('https://www.temu.com/' + e.url, '_blank');
}
}
},
beforeGoDetail(goodsId) {

View File

@@ -0,0 +1,81 @@
<template>
<ai-detail class="audit">
<template slot="content">
<ai-card title="基本信息">
<ai-product-drop-down v-if="info" :params="info" slot="right"></ai-product-drop-down>
<template #content>
<div class="flex">
<ai-avatar v-model="info.imgUrl" :editable="false" :preview="true"/>
<ai-wrapper
label-width="120px" class="fill">
<ai-info-item label="价格:" :value="'$' + info.price"></ai-info-item>
<ai-info-item label="销量:" :value="info.saleTotal"></ai-info-item>
</ai-wrapper>
</div>
</template>
</ai-card>
<ai-card title="趋势信息">
<template #content>
<div id="dataChart"></div>
</template>
</ai-card>
</template>
</ai-detail>
</template>
<script>
import AiProductDropDown from './AiProductDropDown.vue'
import { DualAxes } from '@antv/g2plot'
export default {
name: "AiProductDetail",
props: ['params'],
components: {
AiProductDropDown
},
data() {
return {
info: {}
}
},
computed: {
},
mounted() {
// this.info = this.params
this.$nextTick(() => {
this.init()
})
},
methods: {
init() {
this.$http.post('/api/specialDetail/queryProductDetail',null,{
params: {
goodsId: this.params.goodsId,
categoryId: this.params.categoryId
}
}).then(res => {
this.info = res.data
const dualAxes = new DualAxes('dataChart', {
data: [this.info.priceAndSale, this.info.priceAndSale],
xField: '日期',
yField: ['价格', '销量'],
geometryOptions: [
{
geometry: 'line',
color: '#5B8FF9',
},
{
geometry: 'line',
color: '#5AD8A6',
}
],
});
dualAxes.render();
})
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "TEMU助手",
"description": "TEMU助手 - 自动化提高生产效率",
"version": "3.0.4",
"version": "3.0.5",
"background": {
"service_worker": "/background.js"
},

View File

@@ -77,6 +77,11 @@ const router = new VueRouter({
name: 'keywordTrack',
component: () => import('../view/selection/keywordtrack/Index.vue')
},
{
path: 'indexTrack',
name: 'indexTrack',
component: () => import('../view/selection/indextrack/Index.vue')
},
{
path: 'message',

View File

@@ -75,6 +75,7 @@
<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-menu-item index="/indexTrack">首页商品跟踪</el-menu-item>
</el-submenu>
<el-menu-item index="/saleData">

View File

@@ -0,0 +1,57 @@
<template>
<div style="height: 100%;">
<transition name="fade-transform" mode="out-in">
<keep-alive :include="['List']">
<component ref="component" :is="component" @change="onChange" :params="params"></component>
</keep-alive>
</transition>
</div>
</template>
<script>
import List from './components/List.vue'
import Detail from './components/Detail.vue'
export default {
name: 'IndexTrack',
label: '首页跟踪',
components: {
List,
Detail
},
data () {
return {
component: 'List',
params: {}
}
},
methods: {
onChange (data) {
if (data.type === 'Detail') {
this.component = 'Detail'
this.params = data.params
}
if (data.type === 'List') {
this.component = 'List'
this.params = data.params
this.$nextTick(() => {
if (data.isRefresh) {
setTimeout(() => {
this.$refs.component.getList()
}, 600)
}
})
}
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,212 @@
<template>
<div>
<ai-list class="list">
<ai-title
slot="title"
title="商品列表"
isShowBottomBorder isShowBack @onBackClick="cancel(false)">
</ai-title>
<template slot="content">
<ai-search-bar>
<template #left>
<label style="width:80px">排序方式</label>
<el-select v-model="search.orderBy" :clearable="true" @change="search.current =1, getList()" placeholder="请选择排序方式" size="small">
<el-option
v-for="item in orderBys"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<label style="width:80px">价格区间</label>
<el-input :clearable="true" size="small" style="width: 80px" v-model="search.priceBegin" ></el-input>
~
<el-input :clearable="true" size="small" style="width: 80px" v-model="search.priceEnd" ></el-input>
<label style="width:80px">销量区间</label>
<el-input :clearable="true" size="small" style="width: 80px" v-model="search.saleBegin" ></el-input>
~
<el-input :clearable="true" size="small" style="width: 80px" v-model="search.saleEnd" ></el-input>
</template>
<template #right>
<el-button type="primary" @click="search.current =1, getList()">查询</el-button>
</template>
</ai-search-bar>
<div style="margin-right: 0px; margin-bottom: 10px;">
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; gap: 16px;">
<el-card v-for="item in tableData" :key="item.id" :body-style="{ padding: '0px', margin: '5px' }">
<img :src="item.imgUrl" class="image">
<div style="padding: 14px;">
<div class="bottom clearfix">
<div style="margin-bottom: 5px;">
<div style="display: inline; margin-left: 5px;">${{ item.price }}<sub style="margin-left: 2px;" v-html="getPricePercent(item.priceChange)"></sub></div>
<div style="display: inline; margin-right: 5px; float: right;">{{ item.saleTotal }}<sub style="margin-left: 2px;" v-html="getSalePercent(item.saleChange)"></sub></div>
</div>
<ai-product-drop-down :params="item" :isShowDetail="true" @onGoDetail="goDetail(item.goodsId, item.categoryId)" style="float: right;"></ai-product-drop-down>
</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>
<div class="productDetail">
<el-dialog
title="商品详情"
:visible="isShowDetailDlg"
:close-on-click-modal="false"
width="80%"
:before-close="handleClose">
<ai-special-product-detail v-if="isShowDetailDlg" :params="detailParams"/>
</el-dialog>
</div>
</div>
</template>
<script>
import AiSpecialProductDetail from "@/components/AiSpecialProductDetail.vue";
import AiProductDropDown from '@/components/AiProductDropDown.vue';
export default {
name: 'DetailPage',
props: ['params'],
components: {AiSpecialProductDetail, AiProductDropDown},
data () {
return {
categoryId: '',
search: {
current: 1,
type: '1',
size: 120,
orderBy: '',
priceBegin: '',
priceEnd: '',
saleBegin: '',
saleEnd: ''
},
orderBys: [{
value: '0',
label: '按销量涨辐排序'
},{
value: '1',
label: '按价格涨辐排序'
},{
value: '2',
label: '按销量排序'
},{
value: '3',
label: '按价格排序'
}],
tableData: [],
total: 0,
isShowDetailDlg: false,
detailParams: {}
}
},
created () {
this.categoryId = this.params.id
this.getList()
},
methods: {
getList () {
this.$http.post('/api/specialDetail/myPageNew',null,{
params: {
categoryId: this.categoryId,
...this.search
}
}).then(res => {
this.tableData = res.data.records
this.total = res.data.total
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'List',
isRefresh: !!isRefresh
})
},
getPricePercent(data) {
if (data < 0) {
return '<div style="display: inline; color: green">↓' + data + '%</div>'
} else if (data > 0) {
return '<div style="display: inline; color: red">↑' + data + '%</div>'
}
return ''
},
getSalePercent(data) {
if (data < 0) {
return '<div style="display: inline; color: green">↓' + data + '%</div>'
} else if (data > 0) {
return '<div style="display: inline; color: red">↑' + data + '%</div>'
}
return ''
},
handleClose() {
this.isShowDetailDlg = false
},
goDetail (goodsId, categoryId) {
this.detailParams = {goodsId: goodsId, categoryId: categoryId}
this.isShowDetailDlg = true
}
}
}
</script>
<style scoped lang="scss">
.productDetail {
:deep(.el-dialog) {
height: 78vh;
overflow: auto;
}
}
.time {
font-size: 13px;
color: #999;
}
.bottom {
margin-top: 13px;
line-height: 12px;
}
.button {
padding: 0;
float: right;
}
.image {
width: 100%;
display: block;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both
}
.el-dropdown-link {
cursor: pointer;
color: #409EFF;
}
.el-icon-arrow-down {
font-size: 12px;
}
</style>

View File

@@ -0,0 +1,237 @@
<template>
<div>
<ai-list class="list">
<ai-title
slot="title"
title="分类首页商品跟踪"
isShowBottomBorder>
</ai-title>
<template slot="content">
<div class="content">
<ai-search-bar>
<template #left>
<el-button type="button" :class="'el-button el-button--primary'" @click="addStore()">添加分类</el-button>
</template>
<template #right>
<el-button size="small" circle icon="el-icon-refresh-right" @click="getList()"></el-button>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
style="margin-top: 8px;"
@selection-change="onChooseChange"
:current.sync="search.current" :size.sync="search.size"
@getList="getList">
<el-table-column slot="options" label="操作" width="240px" show-overflow-tooltip align="center" fixed="right">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="deleteMonitor(row.id)">删除</el-button>
<el-button type="text" @click="renew(row.id)">续费</el-button>
<el-button type="text" @click="toDetail(row.categoryId)">详情</el-button>
</div>
</template>
</el-table-column>
<el-table-column slot="categoryId" label="分类" show-overflow-tooltip align="center">
<template slot-scope="{ row }">
<div><a class="el-link el-link--primary" :href="'https://www.temu.com' + row.categoryUrl" target="_blank">{{ row.categoryName }}</a></div>
</template>
</el-table-column>
</ai-table>
</div>
</template>
</ai-list>
<ai-dialog
title="添加分类"
:visible.sync="isDlgShow"
:close-on-click-modal="false"
width="790px"
customFooter
@close="isDlgShow = false">
<el-alert
title="添加一个分类将消耗300金币"
type="success"
:closable="false">
</el-alert>
<el-form class="ai-form" style="margin-top: 20px" :model="form" label-width="120px" ref="form">
<el-form-item
prop="categoryId"
label="分类"
:rules="[{ required: true, message: '请选择分类', trigger: 'blur' }]">
<el-cascader style="width: 380px" v-model="form.categoryId" :props="props"></el-cascader>
</el-form-item>
</el-form>
<div class="dialog-footer" slot="footer">
<el-button @click="isDlgShow = false"> </el-button>
<el-button type="primary" @click="saveStore">确定</el-button>
</div>
</ai-dialog>
</div>
</template>
<script>
export default {
name: 'List',
data () {
let _this = this
return {
search: {
current: 1,
type: '1',
size: 10
},
colConfigs: [
{ type: "selection", width: '70px', align: 'left' },
{ slot: 'categoryId', label: '分类', align: 'left' },
{ prop: 'status', label: '状态', align: 'left', format: v => this.$dict.getLabel('monitor_status', v), },
{ prop: 'expireTime', label: '失效时间', align: 'left' },
{ prop: 'createTime', label: '添加时间', width: '180px', fixed: 'right'}
],
tableData: [],
total: 0,
form: {
categoryId: ''
},
props: {
value: 'optId',
label: 'name',
lazy: true,
lazyLoad (node, resolve) {
_this.$http.post('/api/category/listAllByParentId', null, {
params: {parentId: node.value || 0}
}).then(res => {
let parentId = node.value || 0
if (res.code === 0) {
resolve(res.data.map(v => {
return {
...v,
leaf: parentId == 0 ? false: true
}
}))
}
})
}
},
isDlgShow: false,
selectRows: []
}
},
created () {
this.$dict.load('monitor_status');
this.getList()
},
methods: {
getList () {
this.$http.post('/api/specialMonitor/myPage',null,{
params: {
...this.search
}
}).then(res => {
this.tableData = res.data.records
this.total = res.data.total
})
},
onChooseChange (val) {
this.selectRows = val;
},
saveStore () {
this.$refs.form.validate((valid) => {
if (valid) {
this.$http.post('/api/specialMonitor/check',null, {params: {type: 1}}).then(res => {
if (res.code == 0) {
this.$http.post(`/api/specialMonitor/add`, {categoryId: this.form.categoryId[this.form.categoryId.length - 1]}).then(res => {
if (res.code == 0) {
this.$message.success('添加成功!')
this.$store.dispatch('getUserInfo')
this.getList()
this.isDlgShow = false
}
})
}
})
}
})
},
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/specialMonitor/delByIds', ids
).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
})
},
renew(id) {
this.$confirm('确定要续费?', '温馨提示', {
type: 'warning'
}).then(() => {
this.$http.post('/api/specialMonitor/renew',null, {
params: {
id: id
}
}
).then(res => {
if (res.code == 0) {
this.$message.success('续费成功!')
this.$store.dispatch('getUserInfo')
this.getList()
}
})
})
},
deleteMonitor(id) {
this.$confirm('确定要删除?', '温馨提示', {
type: 'warning'
}).then(() => {
this.$http.post('/api/specialMonitor/del',null, {
params: {
id: id
}
}
).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
})
},
toDetail (id) {
this.$emit('change', {
type: 'Detail',
params: {
id: id || ''
}
})
},
addStore() {
this.form.mallId = ''
this.isDlgShow = true
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@@ -7,16 +7,31 @@
isShowBottomBorder isShowBack @onBackClick="cancel(false)">
</ai-title>
<template slot="content">
<div style="margin-right: 0px; margin-bottom: 10px;">
<el-select v-model="search.orderBy" :clearable="true" @change="search.current =1, getList()" placeholder="请选择排序方式" size="small">
<el-option
v-for="item in orderBys"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
<ai-search-bar>
<template #left>
<label style="width:80px">排序方式</label>
<el-select v-model="search.orderBy" :clearable="true" @change="search.current =1, getList()" placeholder="请选择排序方式" size="small">
<el-option
v-for="item in orderBys"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<label style="width:80px">价格区间</label>
<el-input :clearable="true" size="small" style="width: 80px" v-model="search.priceBegin" ></el-input>
~
<el-input :clearable="true" size="small" style="width: 80px" v-model="search.priceEnd" ></el-input>
<label style="width:80px">销量区间</label>
<el-input :clearable="true" size="small" style="width: 80px" v-model="search.saleBegin" ></el-input>
~
<el-input :clearable="true" size="small" style="width: 80px" v-model="search.saleEnd" ></el-input>
</template>
<template #right>
<el-button type="primary" @click="search.current =1, getList()">查询</el-button>
</template>
</ai-search-bar>
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; gap: 16px;">
<el-card v-for="item in tableData" :key="item.id" :body-style="{ padding: '0px', margin: '5px' }">
<img :src="item.imgUrl" class="image">
@@ -72,7 +87,11 @@ import AiProductDropDown from '@/components/AiProductDropDown.vue';
current: 1,
type: '1',
size: 120,
orderBy: ''
orderBy: '',
priceBegin: '',
priceEnd: '',
saleBegin: '',
saleEnd: ''
},
orderBys: [{
value: '0',

View File

@@ -59,7 +59,7 @@
type="success"
:closable="false">
</el-alert>
<el-form class="ai-form" :model="form" label-width="120px" ref="form">
<el-form class="ai-form" style="margin-top: 20px" :model="form" label-width="120px" ref="form">
<el-form-item
prop="content"
label="关键字"
@@ -358,7 +358,7 @@ import { Message } from 'element-ui'
}
}
reqData.details.push({
url: item.linkUrl,
url: 'https://www.temu.com/goods.html?goods_id=' + item.goodsId,
price: item.priceInfo.priceSchema,
saleTotal: total,
goodsId: item.goodsId,

View File

@@ -7,15 +7,34 @@
isShowBottomBorder isShowBack @onBackClick="cancel(false)">
</ai-title>
<template slot="content">
<ai-search-bar>
<template #left>
<label style="width:80px">排序方式</label>
<el-select v-model="search.orderBy" :clearable="true" @change="search.current =1, getList()" placeholder="请选择排序方式" size="small">
<el-option
v-for="item in orderBys"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<label style="width:80px">价格区间</label>
<el-input :clearable="true" size="small" style="width: 80px" v-model="search.priceBegin" ></el-input>
~
<el-input :clearable="true" size="small" style="width: 80px" v-model="search.priceEnd" ></el-input>
<label style="width:80px">销量区间</label>
<el-input :clearable="true" size="small" style="width: 80px" v-model="search.saleBegin" ></el-input>
~
<el-input :clearable="true" size="small" style="width: 80px" v-model="search.saleEnd" ></el-input>
</template>
<template #right>
<el-button type="primary" @click="search.current =1, getList()">查询</el-button>
</template>
</ai-search-bar>
<div style="margin-right: 0px; margin-bottom: 10px;">
<el-select v-model="search.orderBy" :clearable="true" @change="search.current =1, getList()" placeholder="请选择排序方式" size="small">
<el-option
v-for="item in orderBys"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; gap: 16px;">
<el-card v-for="item in tableData" :key="item.id" :body-style="{ padding: '0px', margin: '5px' }">
@@ -70,7 +89,11 @@ import AiProductDropDown from '@/components/AiProductDropDown.vue';
current: 1,
type: '1',
size: 120,
orderBy: ''
orderBy: '',
priceBegin: '',
priceEnd: '',
saleBegin: '',
saleEnd: ''
},
orderBys: [{
value: '0',

View File

@@ -59,7 +59,7 @@
type="success"
:closable="false">
</el-alert>
<el-form class="ai-form" :model="form" label-width="120px" ref="form">
<el-form class="ai-form" style="margin-top: 20px" :model="form" label-width="120px" ref="form">
<el-form-item
prop="mallId"
label="店铺ID"
@@ -343,7 +343,7 @@ import {sendTemuAPIMessage} from '@/api/chromeApi'
}
}
reqData.details.push({
url: item.link_url,
url: 'https://www.temu.com/goods.html?goods_id=' + item.goods_id,
price: item.price_info.price_schema,
saleTotal: total,
goodsId: item.goods_id,