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