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>