diff --git a/src/entry/background.js b/src/entry/background.js index 3938a6c..b41b85d 100644 --- a/src/entry/background.js +++ b/src/entry/background.js @@ -55,7 +55,6 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => { headers['Content-Type'] = 'application/json'; data = JSON.stringify(request.data) } else { - console.log(request.data) const formData = new FormData(); Object.keys(request.data).forEach(key => { const value = request.data[key] diff --git a/src/manifest.development.json b/src/manifest.development.json index 0d9ed90..98c2b57 100644 --- a/src/manifest.development.json +++ b/src/manifest.development.json @@ -34,7 +34,8 @@ "declarativeNetRequest", "declarativeNetRequestWithHostAccess", "declarativeNetRequestFeedback", - "activeTab" + "activeTab", + "fileSystemProvider" ], "declarative_net_request": { "rule_resources": [{ diff --git a/src/manifest.production.json b/src/manifest.production.json index 61ad9a9..8149555 100644 --- a/src/manifest.production.json +++ b/src/manifest.production.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "TEMU助手", "description": "TEMU助手 - 自动化提高生产效率", - "version": "3.3.0", + "version": "3.3.1", "background": { "service_worker": "/background.js" }, @@ -33,7 +33,8 @@ "declarativeNetRequest", "declarativeNetRequestWithHostAccess", "declarativeNetRequestFeedback", - "activeTab" + "activeTab", + "fileSystemProvider" ], "declarative_net_request": { "rule_resources": [{ diff --git a/src/router/index.js b/src/router/index.js index 6ffd597..b2ab0b9 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -110,6 +110,11 @@ const router = new VueRouter({ name: 'copyProductAliExpress', component: () => import('../view/product/CopyProductAliExpress.vue') }, + { + path: 'batchUpload', + name: 'batchUpload', + component: () => import('../view/product/BatchUpload.vue') + }, { path: 'niubiCopy', name: 'niubiCopy', @@ -222,6 +227,11 @@ const router = new VueRouter({ name: 'logisticFee', component: () => import('../view/sale/LogisticFee.vue') }, + { + path: 'billStat', + name: 'billStat', + component: () => import('../view/sale/ExportBillStatTemu.vue') + }, { path: 'costManageShein', name: 'costManageShein', @@ -272,6 +282,11 @@ const router = new VueRouter({ name: 'purchaseOrderListShein', component: () => import('../view/shein/PurchaseOrderListShein.vue') }, + { + path: 'syncDataTemu', + name: 'syncDataTemu', + component: () => import('../view/data/SyncDataTemu.vue') + }, // { // path: 'statistics', @@ -313,6 +328,14 @@ const router = new VueRouter({ title: '注册' }, component: () => import('../view/login/Register.vue') + }, + { + path: '/forget', + name: 'forget', + meta: { + title: '注册' + }, + component: () => import('../view/login/Forget.vue') } ], scrollBehavior (to, from, savedPosition) { diff --git a/src/utils/image.js b/src/utils/image.js index d7d2d50..ae4a5d0 100644 --- a/src/utils/image.js +++ b/src/utils/image.js @@ -19,8 +19,29 @@ export function getImageMd5(imageUrl) { }); } -export async function uploadImage(folderId, imageUrl, mallId) { - let res1 = await getImageMd5(imageUrl) +export function getImageMd5Local(file) { + return new Promise((resolve) => { + var reader = new FileReader() + // 读取Blob对象的内容 + reader.onloadend = function () { + /*const spark = new SparkMd5.ArrayBuffer() + console.log(reader.result) + spark.append(reader.result);*/ + const md5 = SparkMd5.hash(reader.result) + resolve({md5, fileName: file.name}); + }; + reader.readAsDataURL(file); + }) +} + +export async function uploadImage(folderId, imageUrl, mallId, local = false) { + let res1 + if (local) { + res1 = await getImageMd5Local(imageUrl) + imageUrl = URL.createObjectURL(imageUrl) + } else { + res1 = await getImageMd5(imageUrl) + } let detailList = [] detailList.push({ materialMd5: res1.md5, @@ -35,6 +56,7 @@ export async function uploadImage(folderId, imageUrl, mallId) { createDetailList: detailList, folderId: folderId }}) + await sleepSync(200) if (res2.success) { if (res2.result.responseDetailList[0].alreadyExists) { @@ -48,6 +70,7 @@ export async function uploadImage(folderId, imageUrl, mallId) { bucket_tag: "product-material-tag" } }) + await sleepSync(200) let res4 = await sendChromeAPIMessage({ url: 'https://file.kuajingmaihuo.com/api/galerie/v3/store_image?sdk_version=js-0.0.16-alpha.0&tag_name=product-material-tag', @@ -58,6 +81,7 @@ export async function uploadImage(folderId, imageUrl, mallId) { upload_sign: res3.result.signature } }) + await sleepSync(200) let res5 = await sendChromeAPIMessage({ url: 'marvel-mms/cn/api/kiana/gmp/bg/phoenix/api/material/edit', @@ -76,3 +100,7 @@ export async function uploadImage(folderId, imageUrl, mallId) { } } + +function sleepSync(milliseconds) { + return new Promise(resolve => setTimeout(resolve, milliseconds)); +} \ No newline at end of file diff --git a/src/utils/product.js b/src/utils/product.js index 30bddbd..99a5bc9 100644 --- a/src/utils/product.js +++ b/src/utils/product.js @@ -26,7 +26,8 @@ export function transform(leftData) { propName: leftData.productPropertyList[i].propName, refPid: leftData.productPropertyList[i].refPid, vid: leftData.productPropertyList[i].vid, - controlType: 1, + controlType: leftData.productPropertyList[i].controlType || 1, + numberInputValue: leftData.productPropertyList[i].numberInputValue || "", pid: leftData.productPropertyList[i].pid, templatePid: leftData.productPropertyList[i].templatePid, valueExtendInfo: leftData.productPropertyList[i].valueExtendInfo @@ -65,7 +66,7 @@ export function transform(leftData) { rightSkcItem.previewImgUrls = leftSkc[i].previewImgUrls; rightSkcItem.productSkcCarouselImageI18nReqs = leftSkc[i].productSkcCarouselImageI18nVOList; rightSkcItem.extCode = leftSkc[i].extCode; - rightSkcItem.mainProductSkuSpecReqs = [ + rightSkcItem.mainProductSkuSpecReqs = leftSkc[i].mainProductSkuSpec || [ { "parentSpecId": 0, "parentSpecName": "", @@ -83,6 +84,12 @@ export function transform(leftData) { rightSkuItem.extCode = leftSkuItem.extCode; rightSkuItem.supplierPrice = leftSkuItem.supplierPrice; rightSkuItem.currencyType = leftSkuItem.currencyType; + rightSkuItem.productSkuSuggestedPriceReq = leftSkuItem.productSkuSuggestedPrice; + rightSkuItem.productSkuMultiPackReq = leftSkuItem.productSkuMultiPack; + if (rightSkuItem.productSkuMultiPackReq) { + delete rightSkuItem.productSkuMultiPackReq.productSkuNetContent + } + rightSkuItem.productSkuMultiPackReq.productSkuNetContentReq = {} rightSkuItem.productSkuSpecReqs = leftSkuItem.productSkuSpecList; productSpecPropertyReqs.push({ "parentSpecId": leftSkuItem.productSkuSpecList[0].parentSpecId, @@ -127,6 +134,7 @@ export function transform(leftData) { rightData.materialImgUrl = leftData.materialImgUrl; rightData.goodsLayerDecorationReqs = leftData.goodsLayerDecorationVOList; rightData.sizeTemplateIds = !leftData.sizeTemplateIds ? []: leftData.sizeTemplateIds; + rightData.sizeTemplateId = leftData.sizeTemplateId || 0; rightData.showSizeTemplateIds = !leftData.showSizeTemplateIds ? []: leftData.showSizeTemplateIds; rightData.goodsModelReqs = !leftData.goodsModelList ? []: leftData.goodsModelList; rightData.productWhExtAttrReq = { @@ -139,6 +147,9 @@ export function transform(leftData) { rightData.productCarouseVideoReqList = leftData.carouseVideoVOList; rightData.goodsAdvantageLabelTypes = leftData.goodsAdvantageLabelVOList; rightData.productDetailVideoReqList = leftData.detailVideoVOList; + if (leftData.productSpecPropertyVOS) { + rightData.productSpecPropertyReqs = leftData.productSpecPropertyVOS + } rightData.productOuterPackageImageReqs = []; for (let i = 0;i < leftData.outerPackageImages.length; i++) { rightData.productOuterPackageImageReqs.push({ diff --git a/src/view/Home.vue b/src/view/Home.vue index 2756a8c..a451ad8 100644 --- a/src/view/Home.vue +++ b/src/view/Home.vue @@ -13,6 +13,7 @@ 签到 +
会员信息: @@ -72,6 +73,7 @@ 商品列表 商品复制 查找买手 + 草稿箱管理 @@ -138,6 +140,7 @@ 售后赔付统计 调价管理 物流统计 + 账务明细统计 @@ -139,6 +146,9 @@ onChange (e) { this.$emit('change', e) + }, + gotoKefu() { + window.open('https://work.weixin.qq.com/kfid/kfcaa4208f661131eba', '_blank') } } } @@ -348,4 +358,30 @@ } } } + +#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'); +} diff --git a/src/view/product/BatchUpload.vue b/src/view/product/BatchUpload.vue new file mode 100644 index 0000000..41b4f5e --- /dev/null +++ b/src/view/product/BatchUpload.vue @@ -0,0 +1,305 @@ + + + + + \ No newline at end of file diff --git a/src/view/sale/CostManageTemu.vue b/src/view/sale/CostManageTemu.vue index 6ef70e2..77e4884 100644 --- a/src/view/sale/CostManageTemu.vue +++ b/src/view/sale/CostManageTemu.vue @@ -295,14 +295,18 @@ import { saveAs } from 'file-saver' this.costDlgShow = true }, importConfirm() { + this.isLoading = true this.$refs.costForm.validate((valid) => { const data = new FormData() data.append('file', this.costForm.file[0].raw); this.$http.post(`/api/skuCost/importStock`, data).then(res => { if (res.code === 0) { this.costDlgShow = false + this.isLoading = false this.$message.success('导入成功') this.getList() + } else { + this.isLoading = false } }) }) diff --git a/src/view/sale/ExportBillStatTemu.vue b/src/view/sale/ExportBillStatTemu.vue new file mode 100644 index 0000000..5a904fa --- /dev/null +++ b/src/view/sale/ExportBillStatTemu.vue @@ -0,0 +1,428 @@ + + + + + diff --git a/src/view/sale/ExportSaleStatTemu.vue b/src/view/sale/ExportSaleStatTemu.vue index e3b7b27..72c7cf2 100644 --- a/src/view/sale/ExportSaleStatTemu.vue +++ b/src/view/sale/ExportSaleStatTemu.vue @@ -376,7 +376,7 @@ import { DualAxes } from '@antv/g2plot' computed: { topSaleAmountSkcList() { const list = Object.assign([], this.skcList) - list.sort((a, b) => b.amount - a.amount) + list.sort((a, b) => b.saleAmount - a.saleAmount) return list.slice(0, 10) }, topSaleProfitSkcList() { @@ -805,7 +805,7 @@ import { DualAxes } from '@antv/g2plot' const a = document.createElement('a'); a.style.display = 'none' a.href = img.src; - a.download = '近60天销售统计.png'; + a.download = '销售统计.png'; a.click(); document.body.removeChild(img); } catch (error) { diff --git a/src/view/sale/LogisticFee.vue b/src/view/sale/LogisticFee.vue index df122d8..b6b625e 100644 --- a/src/view/sale/LogisticFee.vue +++ b/src/view/sale/LogisticFee.vue @@ -3,7 +3,7 @@