Commit 4f5f1b64 authored by gengshaojing's avatar gengshaojing

fix: 合并hotfix

parents 354158d0 c9861793
...@@ -2167,17 +2167,6 @@ ...@@ -2167,17 +2167,6 @@
"color-convert": "^2.0.1" "color-convert": "^2.0.1"
} }
}, },
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.nlark.com/chalk/download/chalk-4.1.2.tgz?cache=0&sync_timestamp=1627646734234&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fchalk%2Fdownload%2Fchalk-4.1.2.tgz",
"integrity": "sha1-qsTit3NKdAhnrrFr8CqtVWoeegE=",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"cliui": { "cliui": {
"version": "6.0.0", "version": "6.0.0",
"resolved": "https://registry.npm.taobao.org/cliui/download/cliui-6.0.0.tgz", "resolved": "https://registry.npm.taobao.org/cliui/download/cliui-6.0.0.tgz",
...@@ -2213,25 +2202,6 @@ ...@@ -2213,25 +2202,6 @@
"ms": "2.1.2" "ms": "2.1.2"
} }
}, },
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.nlark.com/has-flag/download/has-flag-4.0.0.tgz?cache=0&sync_timestamp=1626715907927&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fhas-flag%2Fdownload%2Fhas-flag-4.0.0.tgz",
"integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.nlark.com/loader-utils/download/loader-utils-2.0.0.tgz",
"integrity": "sha1-5MrOW4FtQloWa18JfhDNErNgZLA=",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"ms": { "ms": {
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&sync_timestamp=1607433988749&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz", "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&sync_timestamp=1607433988749&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz",
...@@ -2247,28 +2217,6 @@ ...@@ -2247,28 +2217,6 @@
"minipass": "^3.1.1" "minipass": "^3.1.1"
} }
}, },
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.nlark.com/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1626703400240&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz",
"integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.5.0",
"resolved": "https://registry.nlark.com/vue-loader/download/vue-loader-16.5.0.tgz?cache=0&sync_timestamp=1628666727543&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fvue-loader%2Fdownload%2Fvue-loader-16.5.0.tgz",
"integrity": "sha1-CcTgcSRmiZ40uZpoZSTxkWX7KJI=",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
},
"wrap-ansi": { "wrap-ansi": {
"version": "6.2.0", "version": "6.2.0",
"resolved": "https://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-6.2.0.tgz", "resolved": "https://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-6.2.0.tgz",
...@@ -2796,7 +2744,7 @@ ...@@ -2796,7 +2744,7 @@
}, },
"aggregate-error": { "aggregate-error": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npm.taobao.org/aggregate-error/download/aggregate-error-3.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Faggregate-error%2Fdownload%2Faggregate-error-3.1.0.tgz", "resolved": "https://registry.npm.taobao.org/aggregate-error/download/aggregate-error-3.1.0.tgz?cache=0&sync_timestamp=1618681544430&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Faggregate-error%2Fdownload%2Faggregate-error-3.1.0.tgz",
"integrity": "sha1-kmcP9Q9TWb23o+DUDQ7DDFc3aHo=", "integrity": "sha1-kmcP9Q9TWb23o+DUDQ7DDFc3aHo=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -4339,7 +4287,7 @@ ...@@ -4339,7 +4287,7 @@
}, },
"cli-truncate": { "cli-truncate": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.nlark.com/cli-truncate/download/cli-truncate-2.1.0.tgz?cache=0&sync_timestamp=1628634500202&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcli-truncate%2Fdownload%2Fcli-truncate-2.1.0.tgz", "resolved": "https://registry.nlark.com/cli-truncate/download/cli-truncate-2.1.0.tgz",
"integrity": "sha1-w54ovwXtzeW+O5iZKiLe7Vork8c=", "integrity": "sha1-w54ovwXtzeW+O5iZKiLe7Vork8c=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -4364,7 +4312,7 @@ ...@@ -4364,7 +4312,7 @@
}, },
"color-convert": { "color-convert": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", "resolved": "https://registry.nlark.com/color-convert/download/color-convert-2.0.1.tgz",
"integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -4373,13 +4321,13 @@ ...@@ -4373,13 +4321,13 @@
}, },
"color-name": { "color-name": {
"version": "1.1.4", "version": "1.1.4",
"resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", "resolved": "https://registry.nlark.com/color-name/download/color-name-1.1.4.tgz",
"integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=",
"dev": true "dev": true
}, },
"slice-ansi": { "slice-ansi": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npm.taobao.org/slice-ansi/download/slice-ansi-3.0.0.tgz?cache=0&sync_timestamp=1618554945131&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fslice-ansi%2Fdownload%2Fslice-ansi-3.0.0.tgz", "resolved": "https://registry.nlark.com/slice-ansi/download/slice-ansi-3.0.0.tgz",
"integrity": "sha1-Md3BCTCht+C2ewjJbC9Jt3p4l4c=", "integrity": "sha1-Md3BCTCht+C2ewjJbC9Jt3p4l4c=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -7975,7 +7923,7 @@ ...@@ -7975,7 +7923,7 @@
}, },
"indent-string": { "indent-string": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npm.taobao.org/indent-string/download/indent-string-4.0.0.tgz?cache=0&sync_timestamp=1618679442183&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Findent-string%2Fdownload%2Findent-string-4.0.0.tgz", "resolved": "https://registry.nlark.com/indent-string/download/indent-string-4.0.0.tgz",
"integrity": "sha1-Yk+PRJfWGbLZdoUx1Y9BIoVNclE=", "integrity": "sha1-Yk+PRJfWGbLZdoUx1Y9BIoVNclE=",
"dev": true "dev": true
}, },
...@@ -8434,7 +8382,7 @@ ...@@ -8434,7 +8382,7 @@
}, },
"is-regexp": { "is-regexp": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/is-regexp/download/is-regexp-1.0.0.tgz?cache=0&sync_timestamp=1617816642607&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-regexp%2Fdownload%2Fis-regexp-1.0.0.tgz", "resolved": "https://registry.nlark.com/is-regexp/download/is-regexp-1.0.0.tgz",
"integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=",
"dev": true "dev": true
}, },
...@@ -9037,7 +8985,7 @@ ...@@ -9037,7 +8985,7 @@
}, },
"braces": { "braces": {
"version": "3.0.2", "version": "3.0.2",
"resolved": "https://registry.npm.taobao.org/braces/download/braces-3.0.2.tgz", "resolved": "https://registry.nlark.com/braces/download/braces-3.0.2.tgz",
"integrity": "sha1-NFThpGLujVmeI23zNs2epPiv4Qc=", "integrity": "sha1-NFThpGLujVmeI23zNs2epPiv4Qc=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -9046,7 +8994,7 @@ ...@@ -9046,7 +8994,7 @@
}, },
"chalk": { "chalk": {
"version": "4.1.2", "version": "4.1.2",
"resolved": "https://registry.nlark.com/chalk/download/chalk-4.1.2.tgz?cache=0&sync_timestamp=1627646655305&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fchalk%2Fdownload%2Fchalk-4.1.2.tgz", "resolved": "https://registry.nlark.com/chalk/download/chalk-4.1.2.tgz?cache=0&sync_timestamp=1627646734234&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fchalk%2Fdownload%2Fchalk-4.1.2.tgz",
"integrity": "sha1-qsTit3NKdAhnrrFr8CqtVWoeegE=", "integrity": "sha1-qsTit3NKdAhnrrFr8CqtVWoeegE=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -9056,7 +9004,7 @@ ...@@ -9056,7 +9004,7 @@
}, },
"color-convert": { "color-convert": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", "resolved": "https://registry.nlark.com/color-convert/download/color-convert-2.0.1.tgz",
"integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -9065,19 +9013,19 @@ ...@@ -9065,19 +9013,19 @@
}, },
"color-name": { "color-name": {
"version": "1.1.4", "version": "1.1.4",
"resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", "resolved": "https://registry.nlark.com/color-name/download/color-name-1.1.4.tgz",
"integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=",
"dev": true "dev": true
}, },
"commander": { "commander": {
"version": "7.2.0", "version": "7.2.0",
"resolved": "https://registry.nlark.com/commander/download/commander-7.2.0.tgz?cache=0&sync_timestamp=1627358314526&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcommander%2Fdownload%2Fcommander-7.2.0.tgz", "resolved": "https://registry.nlark.com/commander/download/commander-7.2.0.tgz?cache=0&sync_timestamp=1627359190297&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcommander%2Fdownload%2Fcommander-7.2.0.tgz",
"integrity": "sha1-o2y1fQtQHOEI5NIFWaFQo5HZerc=", "integrity": "sha1-o2y1fQtQHOEI5NIFWaFQo5HZerc=",
"dev": true "dev": true
}, },
"cosmiconfig": { "cosmiconfig": {
"version": "7.0.1", "version": "7.0.1",
"resolved": "https://registry.nlark.com/cosmiconfig/download/cosmiconfig-7.0.1.tgz", "resolved": "https://registry.nlark.com/cosmiconfig/download/cosmiconfig-7.0.1.tgz?cache=0&sync_timestamp=1629602330801&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcosmiconfig%2Fdownload%2Fcosmiconfig-7.0.1.tgz",
"integrity": "sha1-cU11ZSLKzoZ4Z8y0R0xdAbuuXW0=", "integrity": "sha1-cU11ZSLKzoZ4Z8y0R0xdAbuuXW0=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -9127,7 +9075,7 @@ ...@@ -9127,7 +9075,7 @@
}, },
"fill-range": { "fill-range": {
"version": "7.0.1", "version": "7.0.1",
"resolved": "https://registry.npm.taobao.org/fill-range/download/fill-range-7.0.1.tgz", "resolved": "https://registry.nlark.com/fill-range/download/fill-range-7.0.1.tgz",
"integrity": "sha1-GRmmp8df44ssfHflGYU12prN2kA=", "integrity": "sha1-GRmmp8df44ssfHflGYU12prN2kA=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -9136,7 +9084,7 @@ ...@@ -9136,7 +9084,7 @@
}, },
"get-stream": { "get-stream": {
"version": "6.0.1", "version": "6.0.1",
"resolved": "https://registry.npm.taobao.org/get-stream/download/get-stream-6.0.1.tgz", "resolved": "https://registry.nlark.com/get-stream/download/get-stream-6.0.1.tgz",
"integrity": "sha1-omLY7vZ6ztV8KFKtYWdSakPL97c=", "integrity": "sha1-omLY7vZ6ztV8KFKtYWdSakPL97c=",
"dev": true "dev": true
}, },
...@@ -9154,7 +9102,7 @@ ...@@ -9154,7 +9102,7 @@
}, },
"import-fresh": { "import-fresh": {
"version": "3.3.0", "version": "3.3.0",
"resolved": "https://registry.npm.taobao.org/import-fresh/download/import-fresh-3.3.0.tgz?cache=0&sync_timestamp=1608469532269&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fimport-fresh%2Fdownload%2Fimport-fresh-3.3.0.tgz", "resolved": "https://registry.npm.taobao.org/import-fresh/download/import-fresh-3.3.0.tgz?cache=0&sync_timestamp=1608469520474&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fimport-fresh%2Fdownload%2Fimport-fresh-3.3.0.tgz",
"integrity": "sha1-NxYsJfy566oublPVtNiM4X2eDCs=", "integrity": "sha1-NxYsJfy566oublPVtNiM4X2eDCs=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -9164,7 +9112,7 @@ ...@@ -9164,7 +9112,7 @@
}, },
"is-number": { "is-number": {
"version": "7.0.0", "version": "7.0.0",
"resolved": "https://registry.npm.taobao.org/is-number/download/is-number-7.0.0.tgz", "resolved": "https://registry.nlark.com/is-number/download/is-number-7.0.0.tgz",
"integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=", "integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=",
"dev": true "dev": true
}, },
...@@ -9196,7 +9144,7 @@ ...@@ -9196,7 +9144,7 @@
}, },
"mimic-fn": { "mimic-fn": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/mimic-fn/download/mimic-fn-2.1.0.tgz?cache=0&sync_timestamp=1617823583529&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmimic-fn%2Fdownload%2Fmimic-fn-2.1.0.tgz", "resolved": "https://registry.nlark.com/mimic-fn/download/mimic-fn-2.1.0.tgz",
"integrity": "sha1-ftLCzMyvhNP/y3pptXcR/CCDQBs=", "integrity": "sha1-ftLCzMyvhNP/y3pptXcR/CCDQBs=",
"dev": true "dev": true
}, },
...@@ -9217,7 +9165,7 @@ ...@@ -9217,7 +9165,7 @@
}, },
"onetime": { "onetime": {
"version": "5.1.2", "version": "5.1.2",
"resolved": "https://registry.npm.taobao.org/onetime/download/onetime-5.1.2.tgz", "resolved": "https://registry.nlark.com/onetime/download/onetime-5.1.2.tgz",
"integrity": "sha1-0Oluu1awdHbfHdnEgG5SN5hcpF4=", "integrity": "sha1-0Oluu1awdHbfHdnEgG5SN5hcpF4=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -9232,13 +9180,13 @@ ...@@ -9232,13 +9180,13 @@
}, },
"path-type": { "path-type": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npm.taobao.org/path-type/download/path-type-4.0.0.tgz", "resolved": "https://registry.npm.taobao.org/path-type/download/path-type-4.0.0.tgz?cache=0&sync_timestamp=1611752074264&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpath-type%2Fdownload%2Fpath-type-4.0.0.tgz",
"integrity": "sha1-hO0BwKe6OAr+CdkKjBgNzZ0DBDs=", "integrity": "sha1-hO0BwKe6OAr+CdkKjBgNzZ0DBDs=",
"dev": true "dev": true
}, },
"resolve-from": { "resolve-from": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npm.taobao.org/resolve-from/download/resolve-from-4.0.0.tgz", "resolved": "https://registry.nlark.com/resolve-from/download/resolve-from-4.0.0.tgz",
"integrity": "sha1-SrzYUq0y3Xuqv+m0DgCjbbXzkuY=", "integrity": "sha1-SrzYUq0y3Xuqv+m0DgCjbbXzkuY=",
"dev": true "dev": true
}, },
...@@ -9288,7 +9236,7 @@ ...@@ -9288,7 +9236,7 @@
}, },
"listr2": { "listr2": {
"version": "3.11.0", "version": "3.11.0",
"resolved": "https://registry.nlark.com/listr2/download/listr2-3.11.0.tgz?cache=0&sync_timestamp=1626978156161&other_urls=https%3A%2F%2Fregistry.nlark.com%2Flistr2%2Fdownload%2Flistr2-3.11.0.tgz", "resolved": "https://registry.nlark.com/listr2/download/listr2-3.11.0.tgz",
"integrity": "sha1-l3GwJAeHWqeOc9bg/2VBu+wKruk=", "integrity": "sha1-l3GwJAeHWqeOc9bg/2VBu+wKruk=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -9312,7 +9260,7 @@ ...@@ -9312,7 +9260,7 @@
}, },
"color-convert": { "color-convert": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", "resolved": "https://registry.nlark.com/color-convert/download/color-convert-2.0.1.tgz",
"integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -9321,13 +9269,13 @@ ...@@ -9321,13 +9269,13 @@
}, },
"color-name": { "color-name": {
"version": "1.1.4", "version": "1.1.4",
"resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", "resolved": "https://registry.nlark.com/color-name/download/color-name-1.1.4.tgz",
"integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=",
"dev": true "dev": true
}, },
"p-map": { "p-map": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.nlark.com/p-map/download/p-map-4.0.0.tgz?cache=0&sync_timestamp=1627082385032&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fp-map%2Fdownload%2Fp-map-4.0.0.tgz", "resolved": "https://registry.nlark.com/p-map/download/p-map-4.0.0.tgz?cache=0&sync_timestamp=1627082563421&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fp-map%2Fdownload%2Fp-map-4.0.0.tgz",
"integrity": "sha1-uy+Vpe2i7BaOySdOBqdHw+KQTSs=", "integrity": "sha1-uy+Vpe2i7BaOySdOBqdHw+KQTSs=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -9336,7 +9284,7 @@ ...@@ -9336,7 +9284,7 @@
}, },
"wrap-ansi": { "wrap-ansi": {
"version": "7.0.0", "version": "7.0.0",
"resolved": "https://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-7.0.0.tgz", "resolved": "https://registry.nlark.com/wrap-ansi/download/wrap-ansi-7.0.0.tgz",
"integrity": "sha1-Z+FFz/UQpqaYS98RUpEdadLrnkM=", "integrity": "sha1-Z+FFz/UQpqaYS98RUpEdadLrnkM=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -9538,7 +9486,7 @@ ...@@ -9538,7 +9486,7 @@
}, },
"log-update": { "log-update": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npm.taobao.org/log-update/download/log-update-4.0.0.tgz", "resolved": "https://registry.nlark.com/log-update/download/log-update-4.0.0.tgz",
"integrity": "sha1-WJ7NNSRx8qHAxXAodUOmTf0g4KE=", "integrity": "sha1-WJ7NNSRx8qHAxXAodUOmTf0g4KE=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -9574,7 +9522,7 @@ ...@@ -9574,7 +9522,7 @@
}, },
"color-convert": { "color-convert": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", "resolved": "https://registry.nlark.com/color-convert/download/color-convert-2.0.1.tgz",
"integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -9583,19 +9531,19 @@ ...@@ -9583,19 +9531,19 @@
}, },
"color-name": { "color-name": {
"version": "1.1.4", "version": "1.1.4",
"resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", "resolved": "https://registry.nlark.com/color-name/download/color-name-1.1.4.tgz",
"integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=",
"dev": true "dev": true
}, },
"mimic-fn": { "mimic-fn": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/mimic-fn/download/mimic-fn-2.1.0.tgz?cache=0&sync_timestamp=1617823583529&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmimic-fn%2Fdownload%2Fmimic-fn-2.1.0.tgz", "resolved": "https://registry.nlark.com/mimic-fn/download/mimic-fn-2.1.0.tgz",
"integrity": "sha1-ftLCzMyvhNP/y3pptXcR/CCDQBs=", "integrity": "sha1-ftLCzMyvhNP/y3pptXcR/CCDQBs=",
"dev": true "dev": true
}, },
"onetime": { "onetime": {
"version": "5.1.2", "version": "5.1.2",
"resolved": "https://registry.npm.taobao.org/onetime/download/onetime-5.1.2.tgz", "resolved": "https://registry.nlark.com/onetime/download/onetime-5.1.2.tgz",
"integrity": "sha1-0Oluu1awdHbfHdnEgG5SN5hcpF4=", "integrity": "sha1-0Oluu1awdHbfHdnEgG5SN5hcpF4=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -9614,7 +9562,7 @@ ...@@ -9614,7 +9562,7 @@
}, },
"slice-ansi": { "slice-ansi": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npm.taobao.org/slice-ansi/download/slice-ansi-4.0.0.tgz?cache=0&sync_timestamp=1618554945131&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fslice-ansi%2Fdownload%2Fslice-ansi-4.0.0.tgz", "resolved": "https://registry.nlark.com/slice-ansi/download/slice-ansi-4.0.0.tgz",
"integrity": "sha1-UA6N0P1VsFgVCGJVsxla3ypF/ms=", "integrity": "sha1-UA6N0P1VsFgVCGJVsxla3ypF/ms=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -9625,7 +9573,7 @@ ...@@ -9625,7 +9573,7 @@
}, },
"wrap-ansi": { "wrap-ansi": {
"version": "6.2.0", "version": "6.2.0",
"resolved": "https://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-6.2.0.tgz", "resolved": "https://registry.nlark.com/wrap-ansi/download/wrap-ansi-6.2.0.tgz",
"integrity": "sha1-6Tk7oHEC5skaOyIUePAlfNKFblM=", "integrity": "sha1-6Tk7oHEC5skaOyIUePAlfNKFblM=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -10955,7 +10903,7 @@ ...@@ -10955,7 +10903,7 @@
}, },
"please-upgrade-node": { "please-upgrade-node": {
"version": "3.2.0", "version": "3.2.0",
"resolved": "https://registry.npm.taobao.org/please-upgrade-node/download/please-upgrade-node-3.2.0.tgz", "resolved": "https://registry.nlark.com/please-upgrade-node/download/please-upgrade-node-3.2.0.tgz",
"integrity": "sha1-rt3T+ZTJM+StmLmdmlVu+g4v6UI=", "integrity": "sha1-rt3T+ZTJM+StmLmdmlVu+g4v6UI=",
"dev": true, "dev": true,
"requires": { "requires": {
...@@ -11869,7 +11817,7 @@ ...@@ -11869,7 +11817,7 @@
}, },
"prettier": { "prettier": {
"version": "2.3.2", "version": "2.3.2",
"resolved": "https://registry.nlark.com/prettier/download/prettier-2.3.2.tgz?cache=0&sync_timestamp=1624696193562&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fprettier%2Fdownload%2Fprettier-2.3.2.tgz", "resolved": "https://registry.nlark.com/prettier/download/prettier-2.3.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fprettier%2Fdownload%2Fprettier-2.3.2.tgz",
"integrity": "sha1-7ygKBewlNxLkhiM9tcbyNEHnNC0=", "integrity": "sha1-7ygKBewlNxLkhiM9tcbyNEHnNC0=",
"dev": true "dev": true
}, },
...@@ -12792,7 +12740,7 @@ ...@@ -12792,7 +12740,7 @@
}, },
"semver-compare": { "semver-compare": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/semver-compare/download/semver-compare-1.0.0.tgz", "resolved": "https://registry.nlark.com/semver-compare/download/semver-compare-1.0.0.tgz",
"integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=",
"dev": true "dev": true
}, },
...@@ -13615,7 +13563,7 @@ ...@@ -13615,7 +13563,7 @@
}, },
"string-argv": { "string-argv": {
"version": "0.3.1", "version": "0.3.1",
"resolved": "https://registry.npm.taobao.org/string-argv/download/string-argv-0.3.1.tgz", "resolved": "https://registry.nlark.com/string-argv/download/string-argv-0.3.1.tgz",
"integrity": "sha1-leL77AQnrhkYSTX4FtdKqkxcGdo=", "integrity": "sha1-leL77AQnrhkYSTX4FtdKqkxcGdo=",
"dev": true "dev": true
}, },
...@@ -13678,7 +13626,7 @@ ...@@ -13678,7 +13626,7 @@
"dependencies": { "dependencies": {
"is-obj": { "is-obj": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/is-obj/download/is-obj-1.0.1.tgz", "resolved": "https://registry.npm.taobao.org/is-obj/download/is-obj-1.0.1.tgz?cache=0&sync_timestamp=1618600242427&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-obj%2Fdownload%2Fis-obj-1.0.1.tgz",
"integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=",
"dev": true "dev": true
} }
...@@ -14814,6 +14762,87 @@ ...@@ -14814,6 +14762,87 @@
} }
} }
}, },
"vue-loader-v16": {
"version": "npm:vue-loader@16.5.0",
"resolved": "https://registry.nlark.com/vue-loader/download/vue-loader-16.5.0.tgz?cache=0&sync_timestamp=1628666727543&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fvue-loader%2Fdownload%2Fvue-loader-16.5.0.tgz",
"integrity": "sha1-CcTgcSRmiZ40uZpoZSTxkWX7KJI=",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.nlark.com/ansi-styles/download/ansi-styles-4.3.0.tgz",
"integrity": "sha1-7dgDYornHATIWuegkG7a00tkiTc=",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.nlark.com/chalk/download/chalk-4.1.2.tgz?cache=0&sync_timestamp=1627646734234&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fchalk%2Fdownload%2Fchalk-4.1.2.tgz",
"integrity": "sha1-qsTit3NKdAhnrrFr8CqtVWoeegE=",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.nlark.com/color-convert/download/color-convert-2.0.1.tgz",
"integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.nlark.com/color-name/download/color-name-1.1.4.tgz",
"integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.nlark.com/has-flag/download/has-flag-4.0.0.tgz?cache=0&sync_timestamp=1626715907927&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fhas-flag%2Fdownload%2Fhas-flag-4.0.0.tgz",
"integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.0",
"resolved": "https://registry.nlark.com/loader-utils/download/loader-utils-2.0.0.tgz",
"integrity": "sha1-5MrOW4FtQloWa18JfhDNErNgZLA=",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.nlark.com/supports-color/download/supports-color-7.2.0.tgz?cache=0&sync_timestamp=1626703400240&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsupports-color%2Fdownload%2Fsupports-color-7.2.0.tgz",
"integrity": "sha1-G33NyzK4E4gBs+R4umpRyqiWSNo=",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-router": { "vue-router": {
"version": "4.0.8", "version": "4.0.8",
"resolved": "https://registry.nlark.com/vue-router/download/vue-router-4.0.8.tgz", "resolved": "https://registry.nlark.com/vue-router/download/vue-router-4.0.8.tgz",
...@@ -15592,7 +15621,7 @@ ...@@ -15592,7 +15621,7 @@
}, },
"yaml": { "yaml": {
"version": "1.10.2", "version": "1.10.2",
"resolved": "https://registry.nlark.com/yaml/download/yaml-1.10.2.tgz", "resolved": "https://registry.nlark.com/yaml/download/yaml-1.10.2.tgz?cache=0&sync_timestamp=1626517461854&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fyaml%2Fdownload%2Fyaml-1.10.2.tgz",
"integrity": "sha1-IwHF/78StGfejaIzOkWeKeeSDks=", "integrity": "sha1-IwHF/78StGfejaIzOkWeKeeSDks=",
"dev": true "dev": true
}, },
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
<% for (let i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %> <% for (let i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
<script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script> <script src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
<% } %> <% } %>
<script src="//webapi.amap.com/maps?v=1.3&key=bb057625545d8cf77df1379e7aaae0b5"></script>
<script src="//webapi.amap.com/ui/1.0/main.js"></script>
<title><%= htmlWebpackPlugin.options.title %></title> <title><%= htmlWebpackPlugin.options.title %></title>
</head> </head>
......
const fs = require("fs");
const API_INTERNAL_URI = require("../config.js").API_INTERNAL_URI;
const reqOther = require("../utils/request").httpReqOther;
const FormData = require("form-data");
const http = require("http");
const GROUPMEAL_URI = require("../config.js").GROUPMEAL_URI;
exports.uploadPic = async (ctx, next) => {
const url = `${API_INTERNAL_URI}/ksy/ks3apiunencrypt/ks3api_upload`;
const {
body: { type },
files,
} = ctx.request;
console.log("type", type);
const filePath = files.file.path;
const file = fs.createReadStream(filePath);
const form = new FormData();
form.append("file", file);
form.append("type", type);
const opts = {
method: "post",
url: url,
body: form,
headers: form.getHeaders(),
};
ctx.body = await reqOther(opts);
};
exports.oldOrderExport = async (ctx) => {
const { marketing_id, type } = ctx.query;
// `${ENV}order/oldbackground/order_export?marketing_id=${eventId}&type=${type}`;
const url = `${GROUPMEAL_URI}/order/oldbackground/order_export?marketing_id=${marketing_id}&type=${type}`;
console.log("url", url);
const options = new URL(url);
let { buffer, res } = await requestPromise(options);
const fileName = res.headers["content-disposition"].split("=")[1];
ctx.set("Content-Type", "application/octet-stream");
ctx.set("Content-Disposition", `attachment; filename=${fileName}`);
ctx.body = buffer;
};
exports.orderExport = async (ctx) => {
const { marketing_id, type } = ctx.query;
const url = `${GROUPMEAL_URI}/order/background/order_export?marketing_id=${marketing_id}&type=${type}`;
console.log("url", url);
const options = new URL(url);
let { buffer, res } = await requestPromise(options);
const fileName = res.headers["content-disposition"].split("=")[1];
ctx.set("Content-Type", "application/octet-stream");
ctx.set("Content-Disposition", `attachment; filename=${fileName}`);
ctx.body = buffer;
};
function requestPromise(options) {
return new Promise(function (resolve, reject) {
const req = http.request(options, function (res) {
let { statusCode } = res;
//返回不是200
if (statusCode !== 200) {
return reject(new Error("error"));
}
let arr = [];
let len = 0;
res.on("data", (chunk) => {
len += chunk.length;
arr.push(Buffer.from(chunk));
});
res.on("end", () => {
//正确 success
return resolve({
buffer: Buffer.concat(arr, len),
res,
});
});
});
//请求出错
req.on("error", (err) => {
return reject(err);
});
req.end();
});
}
...@@ -10,6 +10,7 @@ const activity = require("./controllers/activity"); ...@@ -10,6 +10,7 @@ const activity = require("./controllers/activity");
const withdrawal = require("./controllers/withdrawal"); const withdrawal = require("./controllers/withdrawal");
const groupmeal = require("./controllers/groupmeal"); const groupmeal = require("./controllers/groupmeal");
const qr_code = require("./controllers/qr-code"); const qr_code = require("./controllers/qr-code");
const relay = require("./controllers/relay");
const router = Router(); const router = Router();
const API_VERSION = "/api/v1"; const API_VERSION = "/api/v1";
...@@ -130,4 +131,9 @@ router.post(`${API_VERSION}/get_reblack_list`, withdrawal.getReblackList); ...@@ -130,4 +131,9 @@ router.post(`${API_VERSION}/get_reblack_list`, withdrawal.getReblackList);
router.get(`${API_VERSION}/get_wallet_account_status`, withdrawal.getWalletAccountStatus); router.get(`${API_VERSION}/get_wallet_account_status`, withdrawal.getWalletAccountStatus);
router.post(`${API_VERSION}/reset_wallet_account_status`, withdrawal.resetAccountStatus); router.post(`${API_VERSION}/reset_wallet_account_status`, withdrawal.resetAccountStatus);
// 图片上传
router.post(`${API_VERSION}/relay/ks3api_upload`, relay.uploadPic);
router.get(`${API_VERSION}/relay/order_export`, relay.orderExport);
router.get(`${API_VERSION}/relay/old_order_export`, relay.oldOrderExport);
module.exports = router; module.exports = router;
...@@ -11,17 +11,13 @@ exports.httpReq = (ctx, opts) => { ...@@ -11,17 +11,13 @@ exports.httpReq = (ctx, opts) => {
version: "999999", version: "999999",
distribution: "op", distribution: "op",
net: "wifi", net: "wifi",
platform: "2" platform: "2",
}; };
opts.qs = { ...defaultQs, ...ctx.request.query, ...opts.qs }; opts.qs = { ...defaultQs, ...ctx.request.query, ...opts.qs };
request(opts, (err, res, body) => { request(opts, (err, res, body) => {
console.info( console.info(`[Api] httpReq (${opts.url}, user:[${opts.qs.op_cur_user}]) spent: ${+new Date() - time_start}ms`);
`[Api] httpReq (${opts.url}, user:[${
opts.qs.op_cur_user
}]) spent: ${+new Date() - time_start}ms`
);
if (!err) { if (!err) {
resolve(body); resolve(body);
...@@ -32,3 +28,17 @@ exports.httpReq = (ctx, opts) => { ...@@ -32,3 +28,17 @@ exports.httpReq = (ctx, opts) => {
}); });
}); });
}; };
exports.httpReqOther = (opts) => {
opts.timeout = opts.timeout || 10000;
return new Promise((resolve, reject) => {
request(opts, (err, res, body) => {
if (!err) {
resolve(body);
} else {
reject(err);
console.error(opts.url, err);
}
});
});
};
...@@ -44,9 +44,9 @@ ...@@ -44,9 +44,9 @@
<h3>{{ marketingInfo.marketing_name }}</h3> <h3>{{ marketingInfo.marketing_name }}</h3>
<!-- 查看参与字段待确认 --> <!-- 查看参与字段待确认 -->
<p> <p>
<span>{{ detailInfo.lookUserCount }}人查看</span><span <span>{{ detailInfo.lookUserCount }}人查看</span>
>{{ detailInfo.haveBuyGoodsUserCount }}人参与</span
> <span>{{ detailInfo.haveBuyGoodsUserCount }}人参与</span>
</p> </p>
<p class="endTime">{{ showTimer }}</p> <p class="endTime">{{ showTimer }}</p>
</div> </div>
...@@ -82,11 +82,7 @@ ...@@ -82,11 +82,7 @@
></el-image> ></el-image>
</el-card> </el-card>
<el-card class="activities box-card"> <el-card class="activities box-card">
<div <div v-for="goodsItem in goodsList" :key="goodsItem.goods_sku_id" class="activityItem">
v-for="goodsItem in goodsList"
:key="goodsItem.goods_sku_id"
class="activityItem"
>
<el-image <el-image
class="activityImage" class="activityImage"
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
...@@ -97,15 +93,8 @@ ...@@ -97,15 +93,8 @@
<p>{{ goodsItem.goods_name }}</p> <p>{{ goodsItem.goods_name }}</p>
<p class="price"> <p class="price">
<span class="nowPrice">{{ `¥${goodsItem.price}` }}</span> <span class="nowPrice">{{ `¥${goodsItem.price}` }}</span>
<span class="originPrice">{{ <span class="originPrice">{{ `¥${goodsItem.original_price} ` }}</span>
`¥${goodsItem.original_price} ` <span class="sold">已售{{ goodsItem.all_have_buy_goods_count }}</span>
}}</span>
<span class="sold" v-if="goodsItem.inventory_rest == 0"
>抢光了</span
>
<span class="sold" v-else
>已售{{ goodsItem.all_have_buy_goods_count }}</span
>
</p> </p>
</div> </div>
</div> </div>
...@@ -113,23 +102,17 @@ ...@@ -113,23 +102,17 @@
</section> </section>
</div> </div>
<div class="button-close"> <div class="button-close">
<el-button <el-button class="button-block" size="medium" type="primary" @click="closePage"> </el-button>
class="button-block"
size="medium"
type="primary"
@click="closePage"
> </el-button
>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import ActivityService from "@/service/Activity/index"; import ActivityService from "@/service/Activity/index";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
import dayJs from "dayjs"; import dayJs from "dayjs";
export default { export default {
props: {}, props: {},
data() { data() {
return { return {
...@@ -138,7 +121,7 @@ export default { ...@@ -138,7 +121,7 @@ export default {
marketingInfo: {}, marketingInfo: {},
endTime: "", endTime: "",
showTimer: "", showTimer: "",
detailInfo: {} detailInfo: {},
}; };
}, },
watch: {}, watch: {},
...@@ -150,11 +133,11 @@ export default { ...@@ -150,11 +133,11 @@ export default {
let dataArr = await Promise.all([ let dataArr = await Promise.all([
ActivityService.checkActivityDetail({ ActivityService.checkActivityDetail({
marketing_id: this.$route.query.marketing_id, marketing_id: this.$route.query.marketing_id,
marketing_type: this.$route.query.marketing_type marketing_type: this.$route.query.marketing_type,
}), }),
ActivityService.checkActivityDetailInfo({ ActivityService.checkActivityDetailInfo({
marketing_id: this.$route.query.marketing_id marketing_id: this.$route.query.marketing_id,
}) }),
]); ]);
this.pageLoading = false; this.pageLoading = false;
this.goodsList = dataArr[0].result.goods_list; this.goodsList = dataArr[0].result.goods_list;
...@@ -171,21 +154,10 @@ export default { ...@@ -171,21 +154,10 @@ export default {
getTimeout(timeCount) { getTimeout(timeCount) {
if (timeCount > 0) { if (timeCount > 0) {
var days = parseInt(timeCount / (1000 * 60 * 60 * 24)); var days = parseInt(timeCount / (1000 * 60 * 60 * 24));
var hours = parseInt( var hours = parseInt((timeCount % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
(timeCount % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)
);
var minutes = parseInt((timeCount % (1000 * 60 * 60)) / (1000 * 60)); var minutes = parseInt((timeCount % (1000 * 60 * 60)) / (1000 * 60));
var seconds = parseInt((timeCount % (1000 * 60)) / 1000); var seconds = parseInt((timeCount % (1000 * 60)) / 1000);
this.showTimer = this.showTimer = "距结束:" + days + " 天 " + hours + " 小时 " + minutes + " 分钟 " + seconds + " 秒 ";
"距结束:" +
days +
" 天 " +
hours +
" 小时 " +
minutes +
" 分钟 " +
seconds +
" 秒 ";
} else { } else {
this.showTimer = "已结束"; this.showTimer = "已结束";
} }
...@@ -206,7 +178,7 @@ export default { ...@@ -206,7 +178,7 @@ export default {
closePage() { closePage() {
this.$router.go(-1); this.$router.go(-1);
} },
}, },
async created() { async created() {
await this.checkActivityDetail(); await this.checkActivityDetail();
...@@ -214,11 +186,11 @@ export default { ...@@ -214,11 +186,11 @@ export default {
}, },
beforeUnmount() { beforeUnmount() {
clearInterval(this.timer); clearInterval(this.timer);
} },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.wrapper { .wrapper {
height: 100%; height: 100%;
display: flex; display: flex;
overflow-y: scroll; overflow-y: scroll;
...@@ -324,5 +296,5 @@ export default { ...@@ -324,5 +296,5 @@ export default {
width: 200px; width: 200px;
} }
} }
} }
</style> </style>
...@@ -2,85 +2,44 @@ ...@@ -2,85 +2,44 @@
<div class="addProduc"> <div class="addProduc">
<!-- 按钮组 --> <!-- 按钮组 -->
<div class="btnGroup"> <div class="btnGroup">
<el-button class="addCommodityBtn" @click="commodity('add', '')" <el-button class="addCommodityBtn" @click="commodity('add', '')">添加商品</el-button>
>添加商品</el-button
>
<!-- <el-button class="commodLibraryAdd" @click="commodLibraryAdd" <!-- <el-button class="commodLibraryAdd" @click="commodLibraryAdd"
>从商品库添加</el-button >从商品库添加</el-button
> --> > -->
</div> </div>
<!-- Tab --> <!-- Tab -->
<el-table <el-table :data="comTableData" border style="width: 100%; margin-bottom: 80px" :header-cell-style="cellClass">
:data="comTableData"
border
style="width: 100%;margin-bottom:80px;"
:header-cell-style="cellClass"
>
<el-table-column label="显示顺序" align="center" width="50px"> <el-table-column label="显示顺序" align="center" width="50px">
<el-table-column label="" align="center" width="50px"> <el-table-column label="" align="center" width="50px">
<template #default="scope"> <template #default="scope">
<i <i class="el-icon-top" @click="upMove(scope.$index, scope.row)" style="margin-right: 15px"></i>
class="el-icon-top"
@click="upMove(scope.$index, scope.row)"
style="margin-right:15px;"
></i>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="" align="center" width="50px"> <el-table-column label="" align="center" width="50px">
<template #default="scope"> <template #default="scope">
<i <i class="el-icon-bottom" @click="upDown(scope.$index, scope.row)"></i>
class="el-icon-bottom"
@click="upDown(scope.$index, scope.row)"
></i>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="goods_sku_id" label="商品ID" width="180"></el-table-column>
prop="goods_sku_id" <el-table-column prop="goods_name" label="商品标题" width="180"></el-table-column>
label="商品ID" <el-table-column prop="price" label="售价"></el-table-column>
width="180" <el-table-column prop="ota_name" label="商家"></el-table-column>
></el-table-column> <el-table-column prop="inventory_total" label="库存"></el-table-column>
<el-table-column <el-table-column prop="total_amount_sold" label="已售数量"></el-table-column>
prop="goods_name"
label="商品标题"
width="180"
></el-table-column>
<el-table-column prop="price" label="售价"> </el-table-column>
<el-table-column prop="ota_name" label="商家"> </el-table-column>
<el-table-column prop="inventory_total" label="库存"> </el-table-column>
<el-table-column prop="total_amount_sold" label="已售数量">
</el-table-column>
<el-table-column prop="inventory_rest" label="剩余库存"></el-table-column> <el-table-column prop="inventory_rest" label="剩余库存"></el-table-column>
<el-table-column label="操作" width="120" fixed="right"> <el-table-column label="操作" width="120" fixed="right">
<template #default="scope"> <template #default="scope">
<div class="buttons_actions"> <div class="buttons_actions">
<el-button <el-button type="text" size="small" @click="commodity('update', scope.row)">修改</el-button>
type="text" <el-button type="text" size="small" @click="removeCom(scope.row)">移除</el-button>
size="small"
@click="commodity('update', scope.row)"
>修改</el-button
>
<el-button type="text" size="small" @click="removeCom(scope.row)"
>移除</el-button
>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 添加商品 --> <!-- 添加商品 -->
<el-dialog <el-dialog :title="addCommodityTitle" v-model="addCommodityPopup" width="50%" custom-class="add_goods_dialog">
:title="addCommodityTitle" <el-form :inline="true" :model="commodityForm" ref="infoForm" class="demo-form-inline infoForm" label-width="100px">
v-model="addCommodityPopup"
width="50%"
custom-class="add_goods_dialog"
>
<el-form
:inline="true"
:model="commodityForm"
ref="infoForm"
class="demo-form-inline infoForm"
label-width="100px"
>
<el-form-item label="图片:"> <el-form-item label="图片:">
<el-upload <el-upload
:class="{ hide: hideUpload }" :class="{ hide: hideUpload }"
...@@ -102,22 +61,10 @@ ...@@ -102,22 +61,10 @@
</template> </template>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="商品标题:" prop="goods_name" style="width: 90%" :rules="[{ required: true, message: '请输入商品标题' }]">
label="商品标题:" <el-input v-model="commodityForm.goods_name" maxlength="30"></el-input>
prop="goods_name"
style="width:90%;"
:rules="[{ required: true, message: '请输入商品标题' }]"
>
<el-input
v-model="commodityForm.goods_name"
maxlength="30"
></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="售价:" prop="price" :rules="[{ required: true, message: '请输入售价' }]">
label="售价:"
prop="price"
:rules="[{ required: true, message: '请输入售价' }]"
>
<el-input-number <el-input-number
class="price" class="price"
v-model="commodityForm.price" v-model="commodityForm.price"
...@@ -138,11 +85,7 @@ ...@@ -138,11 +85,7 @@
></el-input-number> ></el-input-number>
</el-form-item> </el-form-item>
<br /> <br />
<el-form-item <el-form-item label="库存:" prop="inventory_total" :rules="[{ required: true, message: '请输入库存' }]">
label="库存:"
prop="inventory_total"
:rules="[{ required: true, message: '请输入库存' }]"
>
<el-input <el-input
v-model="commodityForm.inventory_total" v-model="commodityForm.inventory_total"
placeholder="" placeholder=""
...@@ -151,9 +94,8 @@ ...@@ -151,9 +94,8 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<div style="display: inline-block; height: 42px; margin-left: 33px"> <div style="display: inline-block; height: 42px; margin-left: 33px">
已售:<span style="margin-right: 10px">{{ 已售:
commodityForm.total_amount_sold <span style="margin-right: 10px">{{ commodityForm.total_amount_sold }}</span>
}}</span>
<!-- 剩余库存:<span>{{ commodityForm.inventory_total }}</span> --> <!-- 剩余库存:<span>{{ commodityForm.inventory_total }}</span> -->
</div> </div>
<el-form-item <el-form-item
...@@ -162,8 +104,8 @@ ...@@ -162,8 +104,8 @@
{ {
required: true, required: true,
message: '请选择购买限制', message: '请选择购买限制',
trigger: 'change' trigger: 'change',
} },
]" ]"
class="limit_radio" class="limit_radio"
label="购买限制" label="购买限制"
...@@ -175,25 +117,18 @@ ...@@ -175,25 +117,18 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
prop="num_limit" prop="num_limit"
:show-message=" :show-message="commodityForm.checkedRadio === '每人最多买' ? true : false"
commodityForm.checkedRadio === '每人最多买' ? true : false
"
:rules="[ :rules="[
{ {
validator: validator: commodityForm.checkedRadio === '每人最多买' ? checkPurseLimit : checkPurseLimitNull,
commodityForm.checkedRadio === '每人最多买' trigger: 'blur',
? checkPurseLimit },
: checkPurseLimitNull,
trigger: 'blur'
}
]" ]"
> >
<el-input <el-input
v-model="commodityForm.num_limit" v-model="commodityForm.num_limit"
:disabled=" :disabled="
commodityForm.checkedRadio === '' || commodityForm.checkedRadio === '' || commodityForm.checkedRadio === '不限制' || commodityForm.checkedRadio === undefined
commodityForm.checkedRadio === '不限制' ||
commodityForm.checkedRadio === undefined
? true ? true
: false : false
" "
...@@ -201,27 +136,16 @@ ...@@ -201,27 +136,16 @@
:controls="false" :controls="false"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="商家:" prop="business1" :rules="[{ required: true, message: '请选择商家' }]">
label="商家:"
prop="business1"
:rules="[{ required: true, message: '请选择商家' }]"
>
<el-select v-model="commodityForm.business1" placeholder="请选择"> <el-select v-model="commodityForm.business1" placeholder="请选择">
<el-option <el-option v-for="item in businessOpt" :key="item.ota_id" :label="item.ota_name" :value="item.ota_id"></el-option>
v-for="item in businessOpt"
:key="item.ota_id"
:label="item.ota_name"
:value="item.ota_id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="commodityCancel">取 消</el-button> <el-button @click="commodityCancel">取 消</el-button>
<el-button type="primary" @click="commoditySave('infoForm')" <el-button type="primary" @click="commoditySave('infoForm')">保存</el-button>
>保存</el-button
>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
...@@ -230,63 +154,26 @@ ...@@ -230,63 +154,26 @@
<el-image :src="popoverImage" fit="fill" style="width: 100%"></el-image> <el-image :src="popoverImage" fit="fill" style="width: 100%"></el-image>
</el-dialog> </el-dialog>
<!-- 从商品库添加 --> <!-- 从商品库添加 -->
<el-dialog <el-dialog title="选择商品" v-model="selCommodityPopup" width="80%" top="2%">
title="选择商品"
v-model="selCommodityPopup"
width="80%"
top="2%"
>
<div> <div>
<span>商家:</span> <span>商家:</span>
<el-select <el-select v-model="business2" placeholder="请选择" @change="business2Sel">
v-model="business2" <el-option v-for="item in businessOpt" :key="item.ota_id" :label="item.ota_name" :value="item.ota_id"></el-option>
placeholder="请选择"
@change="business2Sel"
>
<el-option
v-for="item in businessOpt"
:key="item.ota_id"
:label="item.ota_name"
:value="item.ota_id"
></el-option>
</el-select> </el-select>
</div> </div>
<span class="dioFor">已选:{{ multipleSelection.length }}件</span> <span class="dioFor">已选:{{ multipleSelection.length }}件</span>
<el-table <el-table :data="comLibTableData" class="comLibTableData" @selection-change="selectGoodsChange">
:data="comLibTableData" <el-table-column type="selection" width="55"></el-table-column>
class="comLibTableData" <el-table-column prop="goods_sku_id" label="商品ID" width="150"></el-table-column>
@selection-change="selectGoodsChange" <el-table-column prop="goods_name" label="名称" width="200"></el-table-column>
>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column
prop="goods_sku_id"
label="商品ID"
width="150"
></el-table-column>
<el-table-column
prop="goods_name"
label="名称"
width="200"
></el-table-column>
<el-table-column prop="price" label="售价"></el-table-column> <el-table-column prop="price" label="售价"></el-table-column>
<el-table-column prop="ota_name" label="商家"></el-table-column> <el-table-column prop="ota_name" label="商家"></el-table-column>
<el-table-column prop="inventory_total" label="库存"></el-table-column> <el-table-column prop="inventory_total" label="库存"></el-table-column>
<el-table-column <el-table-column prop="total_amount_sold" label="已售数量"></el-table-column>
prop="total_amount_sold" <el-table-column prop="inventory_rest" label="剩余库存"></el-table-column>
label="已售数量"
></el-table-column>
<el-table-column
prop="inventory_rest"
label="剩余库存"
></el-table-column>
<el-table-column label="操作" fixed="right"> <el-table-column label="操作" fixed="right">
<template #default="scope"> <template #default="scope">
<el-button <el-button @click="commodity('update', scope.row)" type="text" size="small">修改</el-button>
@click="commodity('update', scope.row)"
type="text"
size="small"
>修改</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -301,19 +188,12 @@ ...@@ -301,19 +188,12 @@
</template> </template>
<script> <script>
import { GOODS_URI } from "../../../../../server/config"; import { ElMessage } from "element-plus";
import { ElMessage } from "element-plus"; import { getCookie, UploadPicUrl } from "@/utils/util";
import { getCookie } from "@/utils/util";
import { addGoods, getBusinessList, pindanGoods, markGoodsInfo, editGoods } from "../../../../service/Activity/index";
import { // 当选择(每人最多买时 添加验证(非空))
addGoods, let checkPurseLimit = (rule, value, callback) => {
getBusinessList,
pindanGoods,
markGoodsInfo,
editGoods
} from "../../../../service/Activity/index";
// 当选择(每人最多买时 添加验证(非空))
let checkPurseLimit = (rule, value, callback) => {
let str = /^[1-9]\d*$/; let str = /^[1-9]\d*$/;
if (value === "" || value === undefined || value === 0) { if (value === "" || value === undefined || value === 0) {
return callback(new Error("请添加限制购买数量")); return callback(new Error("请添加限制购买数量"));
...@@ -322,25 +202,25 @@ let checkPurseLimit = (rule, value, callback) => { ...@@ -322,25 +202,25 @@ let checkPurseLimit = (rule, value, callback) => {
} else { } else {
callback(); callback();
} }
}; };
let checkPurseLimitNull = (rule, value, callback) => { let checkPurseLimitNull = (rule, value, callback) => {
callback(); callback();
}; };
var addProduct = { var addProduct = {
props: { props: {
editInfo: { editInfo: {
type: Object, type: Object,
required: () => {} required: () => {},
}, },
addProduc: { addProduc: {
type: Array, type: Array,
required: () => {} required: () => {},
}, },
stepTwoTitle: { stepTwoTitle: {
type: String, type: String,
default: "" default: "",
} },
}, },
data() { data() {
return { return {
...@@ -362,13 +242,13 @@ var addProduct = { ...@@ -362,13 +242,13 @@ var addProduct = {
total_amount_order: "", total_amount_order: "",
business1: "", business1: "",
num_limit: "", // 购买限制数量 num_limit: "", // 购买限制数量
checkedRadio: "" // 购买限制radio checkedRadio: "", // 购买限制radio
}, },
picStr: "", picStr: "",
picUrlList: [], picUrlList: [],
picUploadList: [], // 上传详情图片列表 picUploadList: [], // 上传详情图片列表
isShowPopver: false, // 是否展示图片框 isShowPopver: false, // 是否展示图片框
uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload`, // 金山云上传地址 uploadUrl: UploadPicUrl, // 金山云上传地址
hideUpload: false, hideUpload: false,
limitCount: 1, limitCount: 1,
...@@ -415,17 +295,13 @@ var addProduct = { ...@@ -415,17 +295,13 @@ var addProduct = {
// 库存计算 // 库存计算
inventoryIpt(val) { inventoryIpt(val) {
if(val < 0) return this.commodityForm.inventory_total = 0; if (val < 0) return (this.commodityForm.inventory_total = 0);
var pattern = /^-?[1-9]\d*$|^0$/g; var pattern = /^-?[1-9]\d*$|^0$/g;
if (!pattern.test(this.commodityForm.inventory_total)) { if (!pattern.test(this.commodityForm.inventory_total)) {
this.commodityForm.inventory_total = ""; this.commodityForm.inventory_total = "";
this.inventoryRest = this.inventoryRest = this.inventoryTotal - this.commodityForm.total_amount_order;
this.inventoryTotal - this.commodityForm.total_amount_order;
} else { } else {
this.inventoryRest = this.inventoryRest = Number(val) + this.inventoryTotal - this.commodityForm.total_amount_order;
Number(val) +
this.inventoryTotal -
this.commodityForm.total_amount_order;
} }
}, },
...@@ -458,10 +334,7 @@ var addProduct = { ...@@ -458,10 +334,7 @@ var addProduct = {
let params = { ota_name: "", offset: "", limit: "" }; let params = { ota_name: "", offset: "", limit: "" };
try { try {
const res = await getBusinessList(params); const res = await getBusinessList(params);
this.businessOpt = [ this.businessOpt = [{ ota_id: "", ota_name: "全部" }, ...res.result.list];
{ ota_id: "", ota_name: "全部" },
...res.result.list
];
} catch (error) { } catch (error) {
this.$message.error("发生未知错误,请稍后再试一下吧~~~"); this.$message.error("发生未知错误,请稍后再试一下吧~~~");
console.error(error); console.error(error);
...@@ -476,26 +349,17 @@ var addProduct = { ...@@ -476,26 +349,17 @@ var addProduct = {
this.inventoryTotal = res.result.goods_info.inventory_total; this.inventoryTotal = res.result.goods_info.inventory_total;
this.inventory = res.result.goods_info.inventory_total; this.inventory = res.result.goods_info.inventory_total;
this.commodityForm = res.result.goods_info; this.commodityForm = res.result.goods_info;
this.commodityForm.num_limit = this.commodityForm.num_limit = res.result.goods_info.rule_limit === 0 ? "" : res.result.goods_info.rule_limit; // 购买限制的数量
res.result.goods_info.rule_limit === 0
? ""
: res.result.goods_info.rule_limit; // 购买限制的数量
this.commodityForm.checkedRadio = this.commodityForm.checkedRadio =
res.result.goods_info.rule_limit === 0 || res.result.goods_info.rule_limit === 0 || res.result.goods_info.rule_limit === undefined ? "不限制" : "每人最多买"; // 购买限制按钮选择
res.result.goods_info.rule_limit === undefined
? "不限制"
: "每人最多买"; // 购买限制按钮选择
this.commodityForm.business1 = res.result.goods_info.ota_id; this.commodityForm.business1 = res.result.goods_info.ota_id;
this.picUrlList = []; this.picUrlList = [];
for (var i in res.result.goods_info.desc_pic_url_list) { for (var i in res.result.goods_info.desc_pic_url_list) {
this.picUrlList.push({ this.picUrlList.push({
url: res.result.goods_info.desc_pic_url_list[i] url: res.result.goods_info.desc_pic_url_list[i],
}); });
} }
this.picStr = this.getUrlParms( this.picStr = this.getUrlParms(res.result.goods_info.desc_pic_url_list[0], "url");
res.result.goods_info.desc_pic_url_list[0],
"url"
);
}, },
getUrlParms(path, name) { getUrlParms(path, name) {
...@@ -524,12 +388,12 @@ var addProduct = { ...@@ -524,12 +388,12 @@ var addProduct = {
this.commodityForm.checkedRadio === "" || this.commodityForm.checkedRadio === "" ||
this.commodityForm.checkedRadio === undefined this.commodityForm.checkedRadio === undefined
? 0 ? 0
: this.commodityForm.num_limit : this.commodityForm.num_limit,
}); });
if (res.code == 0) { if (res.code == 0) {
ElMessage.success({ ElMessage.success({
message: "修改成功", message: "修改成功",
type: "success" type: "success",
}); });
await this.pindanGoodsMet(); await this.pindanGoodsMet();
let result = null; let result = null;
...@@ -560,9 +424,7 @@ var addProduct = { ...@@ -560,9 +424,7 @@ var addProduct = {
// 添加+修改商品 // 添加+修改商品
commodity(type, val) { commodity(type, val) {
// 清楚图片 // 清楚图片
this.$refs.picUpload && this.$refs.picUpload && this.$refs.picUpload.clearFiles && this.$refs.picUpload.clearFiles();
this.$refs.picUpload.clearFiles &&
this.$refs.picUpload.clearFiles();
this.picUrlList = []; this.picUrlList = [];
this.picStr = ""; this.picStr = "";
...@@ -603,12 +465,12 @@ var addProduct = { ...@@ -603,12 +465,12 @@ var addProduct = {
this.commodityForm.checkedRadio === "" || this.commodityForm.checkedRadio === "" ||
this.commodityForm.checkedRadio === undefined this.commodityForm.checkedRadio === undefined
? 0 ? 0
: this.commodityForm.num_limit : this.commodityForm.num_limit,
}); });
if (res.code == 0) { if (res.code == 0) {
ElMessage.success({ ElMessage.success({
message: "添加商品成功", message: "添加商品成功",
type: "success" type: "success",
}); });
this.comTableData.push(res.result.goods_info); this.comTableData.push(res.result.goods_info);
this.addCommodityPopup = false; this.addCommodityPopup = false;
...@@ -625,7 +487,7 @@ var addProduct = { ...@@ -625,7 +487,7 @@ var addProduct = {
// 添加商品保存(操作) // 添加商品保存(操作)
commoditySave(infoForm) { commoditySave(infoForm) {
this.$refs[infoForm].validate(valid => { this.$refs[infoForm].validate((valid) => {
if (valid) { if (valid) {
if (this.addCommodityTitle == "商品添加") { if (this.addCommodityTitle == "商品添加") {
this.addGoodsMet(); this.addGoodsMet();
...@@ -683,9 +545,9 @@ var addProduct = { ...@@ -683,9 +545,9 @@ var addProduct = {
if (this.comTableData.length == 0) { if (this.comTableData.length == 0) {
this.comTableData.push(...this.multipleSelection); this.comTableData.push(...this.multipleSelection);
} else { } else {
this.multipleSelection.forEach(item => { this.multipleSelection.forEach((item) => {
let num = 0; let num = 0;
this.comTableData.some(val => { this.comTableData.some((val) => {
num++; num++;
if (val.goods_sku_id === item.goods_sku_id) { if (val.goods_sku_id === item.goods_sku_id) {
val.goods_sku_id = item.goods_sku_id; val.goods_sku_id = item.goods_sku_id;
...@@ -708,18 +570,18 @@ var addProduct = { ...@@ -708,18 +570,18 @@ var addProduct = {
this.comTableData.splice(i, 1); this.comTableData.splice(i, 1);
} }
} }
} },
}, },
watch: { watch: {
addProduc: function(newVal) { addProduc: function (newVal) {
let marketingId = this.$route.query.marketing_id; let marketingId = this.$route.query.marketing_id;
if (marketingId == undefined) { if (marketingId == undefined) {
return; return;
} }
this.comTableData = newVal; this.comTableData = newVal;
}, },
picUrlList: function() { picUrlList: function () {
if (this.picUrlList.length >= this.limitCount) { if (this.picUrlList.length >= this.limitCount) {
this.hideUpload = true; this.hideUpload = true;
} else { } else {
...@@ -729,53 +591,53 @@ var addProduct = { ...@@ -729,53 +591,53 @@ var addProduct = {
}, },
created() { created() {
this.getBusinessListMet(); this.getBusinessListMet();
} },
}; };
export default addProduct; export default addProduct;
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.addProduc { .addProduc {
width: 90%; width: 90%;
margin: 0 auto; margin: 0 auto;
} }
.buttons_actions { .buttons_actions {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
} }
.btnGroup { .btnGroup {
margin-bottom: 15px; margin-bottom: 15px;
} }
.addCommodityBtn { .addCommodityBtn {
margin: 0 20px 0 0; margin: 0 20px 0 0;
} }
.infoForm /deep/.el-form-item:nth-child(1), .infoForm /deep/.el-form-item:nth-child(1),
.infoForm /deep/.el-form-item:nth-child(2) { .infoForm /deep/.el-form-item:nth-child(2) {
width: 100%; width: 100%;
} }
.dioFor { .dioFor {
display: block; display: block;
margin: 10px 0; margin: 10px 0;
} }
.comLibTableData /deep/ .el-table__body-wrapper { .comLibTableData /deep/ .el-table__body-wrapper {
height: 550px; height: 550px;
overflow: scroll; overflow: scroll;
} }
.price /deep/ .el-input__inner { .price /deep/ .el-input__inner {
text-align: left; text-align: left;
} }
.hide /deep/ .el-upload--picture-card { .hide /deep/ .el-upload--picture-card {
display: none; display: none;
} }
// 商品添加修改dialog-form表单 // 商品添加修改dialog-form表单
/deep/ .add_goods_dialog { /deep/ .add_goods_dialog {
min-width: 370px; min-width: 370px;
} }
</style> </style>
<template> <template>
<div class="infoEditing"> <div class="infoEditing">
<el-form <el-form ref="infoEditForm" :model="infoEditForm" label-width="80px" @submit.prevent>
ref="infoEditForm"
:model="infoEditForm"
label-width="80px"
@submit.prevent
>
<el-form-item label="标题:"> <el-form-item label="标题:">
<el-input v-model="infoEditForm.title" maxlength="30"></el-input> <el-input v-model="infoEditForm.title" maxlength="30"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="介绍:"> <el-form-item label="介绍:">
<el-input <el-input type="textarea" v-model="infoEditForm.desc" maxlength="1000" rows="4"></el-input>
type="textarea"
v-model="infoEditForm.desc"
maxlength="1000"
rows="4"
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="图片:"> <el-form-item label="图片:">
<el-upload <el-upload
...@@ -47,18 +37,19 @@ ...@@ -47,18 +37,19 @@
</template> </template>
<script> <script>
import { GOODS_URI } from "../../../../../server/config"; import { UploadPicUrl } from "@/utils/util";
export default {
export default {
props: { props: {
infoEditArr: { infoEditArr: {
type: Object, type: Object,
default: () => { default: () => {
return { return {
pindan_pic_url: [] pindan_pic_url: [],
}; };
}, },
require: true require: true,
} },
}, },
data() { data() {
return { return {
...@@ -66,38 +57,38 @@ export default { ...@@ -66,38 +57,38 @@ export default {
title: "", // 标题 title: "", // 标题
desc: "", // 介绍 desc: "", // 介绍
picUploadList: [], // 上传详情图片列表 picUploadList: [], // 上传详情图片列表
picUrlList: [] // 图片回显列表 picUrlList: [], // 图片回显列表
}, },
picSubmitList: [], // 发布功能需要的图片列表 picSubmitList: [], // 发布功能需要的图片列表
propData: {}, propData: {},
isShowPopver: false, // 是否展示图片框 isShowPopver: false, // 是否展示图片框
uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload`, // 金山云上传地址 uploadUrl: UploadPicUrl, // 金山云上传地址
hideUpload: false, hideUpload: false,
limitCount: 9 limitCount: 9,
}; };
}, },
watch: { watch: {
infoEditArr: { infoEditArr: {
// 监听props属性 展示自提点列表 // 监听props属性 展示自提点列表
handler: function(newVal) { handler: function (newVal) {
if (this.$route.query.marketing_id) { if (this.$route.query.marketing_id) {
this.propData = newVal; this.propData = newVal;
this.infoEditForm.title = this.propData.marketing_name; this.infoEditForm.title = this.propData.marketing_name;
this.infoEditForm.desc = this.propData.pindan_desc; this.infoEditForm.desc = this.propData.pindan_desc;
for (var i in this.propData.pindan_pic_url) { for (var i in this.propData.pindan_pic_url) {
this.infoEditForm.picUrlList.push({ this.infoEditForm.picUrlList.push({
url: this.propData.pindan_pic_url[i] url: this.propData.pindan_pic_url[i],
}); });
this.picSubmitList.push({ this.picSubmitList.push({
url: this.propData.pindan_pic_url[i] url: this.propData.pindan_pic_url[i],
}); });
} }
this.hideUpload = this.picSubmitList.length >= this.limitCount; // 大于9 隐藏 this.hideUpload = this.picSubmitList.length >= this.limitCount; // 大于9 隐藏
} }
}, },
deep: true, deep: true,
immediate: true immediate: true,
} },
}, },
methods: { methods: {
// 展示商品大图 // 展示商品大图
...@@ -115,7 +106,7 @@ export default { ...@@ -115,7 +106,7 @@ export default {
this.infoEditForm.picUploadList.push(res.result.image_id); // 上传成功图片的id this.infoEditForm.picUploadList.push(res.result.image_id); // 上传成功图片的id
this.picSubmitList.push({ this.picSubmitList.push({
// 发布功能需要的图片列表 // 发布功能需要的图片列表
url: res.result.url url: res.result.url,
}); });
this.hideUpload = this.picSubmitList.length >= this.limitCount; this.hideUpload = this.picSubmitList.length >= this.limitCount;
}, },
...@@ -141,23 +132,23 @@ export default { ...@@ -141,23 +132,23 @@ export default {
this.infoEditForm.desc = this.propData.pindan_desc; this.infoEditForm.desc = this.propData.pindan_desc;
for (var i in this.propData.pindan_pic_url) { for (var i in this.propData.pindan_pic_url) {
this.infoEditForm.picUrlList.push({ this.infoEditForm.picUrlList.push({
url: this.propData.pindan_pic_url[i] url: this.propData.pindan_pic_url[i],
}); });
} }
} },
}, },
created() { created() {
// this.marketingInfoMet(); // this.marketingInfoMet();
} },
}; };
</script> </script>
<style scoped> <style scoped>
.infoEditing { .infoEditing {
width: 64%; width: 64%;
margin: 0 auto; margin: 0 auto;
} }
.hide /deep/ .el-upload--picture-card { .hide /deep/ .el-upload--picture-card {
display: none; display: none;
} }
</style> </style>
...@@ -5,42 +5,39 @@ ...@@ -5,42 +5,39 @@
<el-form ref="form" @submit.prevent> <el-form ref="form" @submit.prevent>
<el-form-item label-position="left"> <el-form-item label-position="left">
<el-button @click="handleSearch">搜索</el-button> <el-button @click="handleSearch">搜索</el-button>
<el-input <el-input class="dialog-input" v-model="searchKey" placeholder="请输入关键字" autocomplete="on">
class="dialog-input"
v-model="searchKey"
placeholder="请输入关键字"
autocomplete="on"
>
<template #suffix> <template #suffix>
<i <i @click="searchKey = ''" class="el-input__icon el-icon-close"></i>
@click="searchKey = ''"
class="el-input__icon el-icon-close"
></i>
</template> </template>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div id="js-result" v-show="searchKey" class="result"></div> <div id="js-result" v-show="searchKey" class="result"></div>
</div> </div>
<div id="js-container" class="myMap"> <div id="js-container" class="myMap">正在加载数据 ...</div>
正在加载数据 ...
</div>
</div> </div>
<div class="mapInfo"> <div class="mapInfo">
<div class="infoAll"> <div class="infoAll">
<h3 class="title">拖拽选址</h3> <h3 class="title">拖拽选址</h3>
<ul class="info"> <ul class="info">
<li><span>经度:</span>{{ dragData.lng }}</li> <li>
<li><span>纬度:</span>{{ dragData.lat }}</li> <span>经度:</span>
<li><span>地址:</span>{{ dragData.address }}</li> {{ dragData.lng }}
</li>
<li>
<span>纬度:</span>
{{ dragData.lat }}
</li>
<li>
<span>地址:</span>
{{ dragData.address }}
</li>
</ul> </ul>
</div> </div>
<div class="confirmButton"> <div class="confirmButton">
<el-button class="button_pre" @click="cancel">取 消</el-button> <el-button class="button_pre" @click="cancel">取 消</el-button>
<el-button class="button_next" type="primary" @click="confirm" <el-button class="button_next" type="primary" @click="confirm">确 定</el-button>
>确 定</el-button
>
</div> </div>
</div> </div>
<!-- <div class="confirmButton"> <!-- <div class="confirmButton">
...@@ -51,8 +48,8 @@ ...@@ -51,8 +48,8 @@
</template> </template>
<script> <script>
import remoteLoad from "@/utils/remoteLoad.js"; import remoteLoad from "@/utils/remoteLoad.js";
export default { export default {
name: "app", name: "app",
data() { data() {
return { return {
...@@ -65,8 +62,8 @@ export default { ...@@ -65,8 +62,8 @@ export default {
address: null, address: null,
nearestJunction: null, nearestJunction: null,
nearestRoad: null, nearestRoad: null,
nearestPOI: null nearestPOI: null,
} },
}; };
}, },
methods: { methods: {
...@@ -92,7 +89,7 @@ export default { ...@@ -92,7 +89,7 @@ export default {
address: data.address, address: data.address,
province: data.regeocode.addressComponent.province, province: data.regeocode.addressComponent.province,
city: data.regeocode.addressComponent.city, city: data.regeocode.addressComponent.city,
area: data.regeocode.addressComponent.district area: data.regeocode.addressComponent.district,
}; };
}, },
...@@ -102,15 +99,16 @@ export default { ...@@ -102,15 +99,16 @@ export default {
let AMapUI = (this.AMapUI = window.AMapUI); let AMapUI = (this.AMapUI = window.AMapUI);
let AMap = (this.AMap = window.AMap); let AMap = (this.AMap = window.AMap);
AMapUI.loadUI(["misc/PositionPicker"], PositionPicker => { AMapUI.loadUI(["misc/PositionPicker"], (PositionPicker) => {
let mapConfig = { let mapConfig = {
zoom: 16 zoom: 16,
// cityName: this.MapCityName // cityName: this.MapCityName
}; };
if (this.lat && this.lng) { if (this.lat && this.lng) {
mapConfig.center = [this.lng, this.lat]; mapConfig.center = [this.lng, this.lat];
} }
let map = new AMap.Map("js-container", mapConfig); let map = new AMap.Map("js-container", mapConfig);
let _this = this;
// 加载地图搜索插件 // 加载地图搜索插件
AMap.service("AMap.PlaceSearch", () => { AMap.service("AMap.PlaceSearch", () => {
...@@ -120,21 +118,37 @@ export default { ...@@ -120,21 +118,37 @@ export default {
citylimit: true, citylimit: true,
// city: this.MapCityName, // city: this.MapCityName,
map: map, map: map,
panel: "js-result" panel: "js-result",
});
this.placeSearch.on("selectChanged", function ({ selected }) {
console.log(selected);
const { address, location, pname, cityname, adname } = selected.data;
_this.dragData = {
lng: location.lng,
lat: location.lat,
address: address,
province: pname,
city: cityname,
area: adname,
};
_this.searchKey = "";
}); });
}); });
// 启用工具条 // 启用工具条
AMap.plugin(["AMap.ToolBar"], function() { AMap.plugin(["AMap.ToolBar"], function () {
map.addControl( map.addControl(
new AMap.ToolBar({ new AMap.ToolBar({
position: "RB" position: "RB",
}) }),
); );
}); });
// 地图地图定位 // 地图地图定位
AMap.plugin("AMap.Geolocation", function() { AMap.plugin("AMap.Geolocation", function () {
var geolocation = new AMap.Geolocation({ var geolocation = new AMap.Geolocation({
// 是否使用高精度定位,默认:true // 是否使用高精度定位,默认:true
enableHighAccuracy: true, enableHighAccuracy: true,
...@@ -145,7 +159,7 @@ export default { ...@@ -145,7 +159,7 @@ export default {
// 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false // 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
zoomToAccuracy: true, zoomToAccuracy: true,
// 定位按钮的排放位置, RB表示右下 // 定位按钮的排放位置, RB表示右下
buttonPosition: "RB" buttonPosition: "RB",
}); });
map.addControl(geolocation); map.addControl(geolocation);
geolocation.getCurrentPosition(); geolocation.getCurrentPosition();
...@@ -171,18 +185,18 @@ export default { ...@@ -171,18 +185,18 @@ export default {
//自定义外观 //自定义外观
url: "//webapi.amap.com/ui/1.0/assets/position-picker2.png", //图片地址 url: "//webapi.amap.com/ui/1.0/assets/position-picker2.png", //图片地址
size: [50, 50], //要显示的点大小,将缩放图片 size: [50, 50], //要显示的点大小,将缩放图片
ancher: [24, 40] //锚点的位置,即被size缩放之后,图片的什么位置作为选中的位置 ancher: [24, 40], //锚点的位置,即被size缩放之后,图片的什么位置作为选中的位置
} },
}); });
// 拖拽完成发送自定义 drag 事件 // 拖拽完成发送自定义 drag 事件
positionPicker.on("success", positionResult => { positionPicker.on("success", (positionResult) => {
this.dragMap(positionResult); this.dragMap(positionResult);
}); });
// 启动拖放 // 启动拖放
positionPicker.start(); positionPicker.start();
}); });
} },
}, },
async mounted() { async mounted() {
// 已载入高德地图API,则直接初始化地图 // 已载入高德地图API,则直接初始化地图
...@@ -190,18 +204,16 @@ export default { ...@@ -190,18 +204,16 @@ export default {
this.initMap(); this.initMap();
// 未载入高德地图API,则先载入API再初始化 // 未载入高德地图API,则先载入API再初始化
} else { } else {
await remoteLoad( await remoteLoad(`http://webapi.amap.com/maps?v=1.3&key=bb057625545d8cf77df1379e7aaae0b5`);
`http://webapi.amap.com/maps?v=1.3&key=bb057625545d8cf77df1379e7aaae0b5`
);
await remoteLoad("http://webapi.amap.com/ui/1.0/main.js"); await remoteLoad("http://webapi.amap.com/ui/1.0/main.js");
this.initMap(); this.initMap();
} }
} },
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.mapContainer { .mapContainer {
height: 100%; height: 100%;
width: 100%; width: 100%;
// display: flex; // display: flex;
...@@ -250,19 +262,19 @@ export default { ...@@ -250,19 +262,19 @@ export default {
} }
} }
} }
} }
.m-map .search { .m-map .search {
position: absolute; position: absolute;
top: 10px; top: 10px;
left: 10px; left: 10px;
width: 285px; width: 285px;
z-index: 1; z-index: 1;
} }
.m-map .search input { .m-map .search input {
width: 180px; width: 180px;
border: 1px solid #ccc; border: 1px solid #ccc;
line-height: 20px; line-height: 20px;
padding: 5px; padding: 5px;
outline: none; outline: none;
} }
</style> </style>
...@@ -3,10 +3,7 @@ ...@@ -3,10 +3,7 @@
<!-- 状态区域 --> <!-- 状态区域 -->
<el-card class="state"> <el-card class="state">
<h2 class="some_state">{{ status }}</h2> <h2 class="some_state">{{ status }}</h2>
<h2 <h2 class="some_state" style="margin-left: 20px">{{ onlineStatus }}</h2>
class="some_state"
style="margin-left:20px"
>{{ onlineStatus }}</h2>
<span class="update_time">上次更新时间:{{ goodsObj.update_time }}</span> <span class="update_time">上次更新时间:{{ goodsObj.update_time }}</span>
<span>创建时间:{{ goodsObj.create_time }}</span> <span>创建时间:{{ goodsObj.create_time }}</span>
</el-card> </el-card>
...@@ -15,10 +12,7 @@ ...@@ -15,10 +12,7 @@
<section class="message"> <section class="message">
<!-- 商品列表修改区 --> <!-- 商品列表修改区 -->
<section class="width50p"> <section class="width50p">
<el-form <el-form label-position="left" label-width="140px">
label-position="left"
label-width="140px"
>
<h3>基本信息</h3> <h3>基本信息</h3>
<el-form-item label="生活号名称:"> <el-form-item label="生活号名称:">
<!-- <el-input <!-- <el-input
...@@ -94,7 +88,7 @@ ...@@ -94,7 +88,7 @@
</section> </section>
<!-- 商品详情图 --> <!-- 商品详情图 -->
<section class="width50p"> <section class="width50p">
<h4 style="margin-bottom:20px">商品详情图</h4> <h4 style="margin-bottom: 20px">商品详情图</h4>
<el-upload <el-upload
:data="{ type: 1 }" :data="{ type: 1 }"
:action="uploadUrl" :action="uploadUrl"
...@@ -142,7 +136,7 @@ ...@@ -142,7 +136,7 @@
</el-table> </el-table>
</section> --> </section> -->
<section class="width50p"> <section class="width50p">
<h4 style="margin-bottom:20px">商品介绍图</h4> <h4 style="margin-bottom: 20px">商品介绍图</h4>
<el-upload <el-upload
:data="{ type: 1 }" :data="{ type: 1 }"
:disabled="$route.params.operation !== 'EDIT'" :disabled="$route.params.operation !== 'EDIT'"
...@@ -180,43 +174,19 @@ ...@@ -180,43 +174,19 @@
<section class="width50p"> <section class="width50p">
<h3>可用门店</h3> <h3>可用门店</h3>
<el-table :data="goodsObj.sub_shop"> <el-table :data="goodsObj.sub_shop">
<el-table-column <el-table-column label="门店名称" align="center" prop="shop_name"></el-table-column>
label="门店名称" <el-table-column label="联系电话" align="center" prop="phone"></el-table-column>
align="center" <el-table-column label="地址" align="center" prop="address"></el-table-column>
prop="shop_name" <el-table-column label="地理定位" align="center">
></el-table-column>
<el-table-column
label="联系电话"
align="center"
prop="phone"
></el-table-column>
<el-table-column
label="地址"
align="center"
prop="address"
></el-table-column>
<el-table-column
label="地理定位"
align="center"
>
<template #default="scope"> <template #default="scope">
<span>经度:{{ scope.row.longitude }}</span> <span>经度:{{ scope.row.longitude }}</span>
<br /> <br />
<span>纬度:{{ scope.row.latitude }}</span> <span>纬度:{{ scope.row.latitude }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column v-if="$route.params.operation === 'EDIT'" label="操作" align="center" fixed="right">
v-if="$route.params.operation === 'EDIT'"
label="操作"
align="center"
fixed="right"
>
<template #default="scope"> <template #default="scope">
<el-button <el-button type="text" @click="deleteShops(scope.row.sub_shop_id)">删除</el-button>
type="text"
@click="deleteShops(scope.row.sub_shop_id)"
>删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -231,44 +201,19 @@ ...@@ -231,44 +201,19 @@
<el-button <el-button
@click="getShops" @click="getShops"
type="primary" type="primary"
style="border-radius:20px;margin:20px 0 0 50%;transform: translate(-50%,0);" style="border-radius: 20px; margin: 20px 0 0 50%; transform: translate(-50%, 0)"
>门店列表 >
门店列表
</el-button> </el-button>
</template> </template>
<!-- 门店列表 --> <!-- 门店列表 -->
<el-table <el-table ref="shopListRef" :data="shopsList" @selection-change="handleShopsChange" row-key="sub_shop_id">
ref="shopListRef"
:data="shopsList"
@selection-change="handleShopsChange"
row-key="sub_shop_id"
>
<!-- :selectable="canChooseShop"↓ --> <!-- :selectable="canChooseShop"↓ -->
<el-table-column <el-table-column type="selection" width="55" aria-checked="true" :reserve-selection="true"></el-table-column>
type="selection" <el-table-column align="center" prop="shop_name" label="门店名称"></el-table-column>
width="55" <el-table-column align="center" prop="phone" label="联系电话"></el-table-column>
aria-checked="true" <el-table-column align="center" prop="address" label="地址"></el-table-column>
:reserve-selection="true" <el-table-column align="center" label="地理定位">
>
</el-table-column>
<el-table-column
align="center"
prop="shop_name"
label="门店名称"
></el-table-column>
<el-table-column
align="center"
prop="phone"
label="联系电话"
></el-table-column>
<el-table-column
align="center"
prop="address"
label="地址"
></el-table-column>
<el-table-column
align="center"
label="地理定位"
>
<template #default="scope"> <template #default="scope">
<span>经度:{{ scope.row.longitude }}</span> <span>经度:{{ scope.row.longitude }}</span>
<br /> <br />
...@@ -279,76 +224,39 @@ ...@@ -279,76 +224,39 @@
<!-- 分页 --> <!-- 分页 -->
<el-pagination <el-pagination
style="margin-top:20px;" style="margin-top: 20px"
background background
@current-change="changeShopListPage" @current-change="changeShopListPage"
v-model:currentPage="shopCurrentPage" v-model:currentPage="shopCurrentPage"
:page-size="5" :page-size="5"
layout="total, prev, pager, next" layout="total, prev, pager, next"
:total="shopsCount" :total="shopsCount"
> ></el-pagination>
</el-pagination> <section style="display: flex; justify-content: center">
<section style="display:flex;justify-content:center;"> <el-button type="primary" style="border-radius: 20px" @click="handleChooseShops">确定</el-button>
<el-button
type="primary"
style="border-radius:20px;"
@click="handleChooseShops"
>确定</el-button>
<!-- 添加门店弹窗 --> <!-- 添加门店弹窗 -->
<el-popover <el-popover placement="bottom" :width="600" trigger="click" :visible="addShopShow">
placement="bottom"
:width="600"
trigger="click"
:visible="addShopShow"
>
<template #reference> <template #reference>
<el-button <el-button @click="addShopShow = true" type="primary" style="border-radius: 20px">添加门店</el-button>
@click="addShopShow = true"
type="primary"
style="border-radius:20px;"
>添加门店
</el-button>
</template> </template>
<!-- 添加门店表单 --> <!-- 添加门店表单 -->
<el-form <el-form label-position="right" label-width="100px" :model="shopForm">
label-position="right"
label-width="100px"
:model="shopForm"
>
<el-form-item label="门店名称:"> <el-form-item label="门店名称:">
<el-input <el-input v-model="shopForm.shop_name" maxlength="20" show-word-limit></el-input>
v-model="shopForm.shop_name"
maxlength="20"
show-word-limit
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="联系电话:"> <el-form-item label="联系电话:">
<el-input <el-input v-model="shopForm.connect_phone" maxlength="11" show-word-limit></el-input>
v-model="shopForm.connect_phone"
maxlength="11"
show-word-limit
></el-input>
</el-form-item> </el-form-item>
<el-form-item label="地址:"> <el-form-item label="地址:">
<el-input v-model="shopForm.address"></el-input> <el-input v-model="shopForm.address"></el-input>
</el-form-item> </el-form-item>
<el-form-item <el-form-item label="地理定位:" class="deep_place">
label="地理定位:"
class="deep_place"
>
<el-input v-model="shopForm.deep_place"></el-input> <el-input v-model="shopForm.deep_place"></el-input>
<a <a style="" target="_blank" href="https://lbs.amap.com/tools/picker">高德获取定位</a>
style=""
target="_blank"
href="https://lbs.amap.com/tools/picker"
>高德获取定位</a>
</el-form-item> </el-form-item>
</el-form> </el-form>
<section style="display:flex;justify-content:center;"> <section style="display: flex; justify-content: center">
<el-button <el-button type="primary" @click="addShop">保存</el-button>
type="primary"
@click="addShop"
>保存</el-button>
<el-button @click="closeAddShops">取消</el-button> <el-button @click="closeAddShops">取消</el-button>
</section> </section>
</el-popover> </el-popover>
...@@ -356,7 +264,7 @@ ...@@ -356,7 +264,7 @@
</el-popover> </el-popover>
</section> </section>
<section class="width50p"> <section class="width50p">
<h4 style="margin-bottom:20px">价格信息</h4> <h4 style="margin-bottom: 20px">价格信息</h4>
<el-form label-width="100px"> <el-form label-width="100px">
<!-- <el-form-item label="秒杀价"> <!-- <el-form-item label="秒杀价">
<el-input <el-input
...@@ -366,19 +274,11 @@ ...@@ -366,19 +274,11 @@
</el-form-item> --> </el-form-item> -->
<el-form-item label="售价"> <el-form-item label="售价">
<el-input <el-input v-if="$route.params.operation === 'EDIT'" v-model="goodsObj.price" @change="salePrice"></el-input>
v-if="$route.params.operation === 'EDIT'"
v-model="goodsObj.price"
@change="salePrice"
></el-input>
<span v-else>{{ goodsObj.price }}</span> <span v-else>{{ goodsObj.price }}</span>
</el-form-item> </el-form-item>
<el-form-item label="原价"> <el-form-item label="原价">
<el-input <el-input v-if="$route.params.operation === 'EDIT'" v-model="goodsObj.original_price" @change="perPrice"></el-input>
v-if="$route.params.operation === 'EDIT'"
v-model="goodsObj.original_price"
@change="perPrice"
></el-input>
<span v-else>{{ goodsObj.original_price }}</span> <span v-else>{{ goodsObj.original_price }}</span>
</el-form-item> </el-form-item>
<el-form-item label="结算价"> <el-form-item label="结算价">
...@@ -393,7 +293,7 @@ ...@@ -393,7 +293,7 @@
></el-input> ></el-input>
<span v-else>{{ goodsObj.clear_price }}</span> <span v-else>{{ goodsObj.clear_price }}</span>
</el-form-item> </el-form-item>
<h4 style="margin:20px 0">库存信息</h4> <h4 style="margin: 20px 0">库存信息</h4>
<el-form-item label="剩余库存量:"> <el-form-item label="剩余库存量:">
<span>{{ goodsObj.inventory_rest }}</span> <span>{{ goodsObj.inventory_rest }}</span>
</el-form-item> </el-form-item>
...@@ -421,13 +321,8 @@ ...@@ -421,13 +321,8 @@
</el-card> </el-card>
<!-- 使用规则 --> <!-- 使用规则 -->
<el-card class="message_border"> <el-card class="message_border">
<h3 style="margin-bottom:30px;">使用规则</h3> <h3 style="margin-bottom: 30px">使用规则</h3>
<el-form <el-form style="width: 480px" :model="rulesForm" label-position="left" label-width="120px">
style="width:480px"
:model="rulesForm"
label-position="left"
label-width="120px"
>
<el-form-item label="单人可买上限:"> <el-form-item label="单人可买上限:">
<el-input-number <el-input-number
v-if="$route.params.operation === 'EDIT'" v-if="$route.params.operation === 'EDIT'"
...@@ -444,42 +339,21 @@ ...@@ -444,42 +339,21 @@
v-if="$route.params.operation === 'EDIT'" v-if="$route.params.operation === 'EDIT'"
v-model="goodsObj.rule_refund" v-model="goodsObj.rule_refund"
placeholder="请选择" placeholder="请选择"
:disabled="goodsObj.audit_status===1" :disabled="goodsObj.audit_status === 1"
> >
<el-option <el-option v-for="item in rulesForm.rulesOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
v-for="item in rulesForm.rulesOptions"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select> </el-select>
<span v-else-if=" <span v-else-if="$route.params.operation !== 'EDIT' && goodsObj.rule_refund === 1">到期后自动退款</span>
$route.params.operation !== 'EDIT' && goodsObj.rule_refund === 1 <span v-else-if="$route.params.operation !== 'EDIT' && goodsObj.rule_refund === 2">购买后不允许退款</span>
">到期后自动退款</span> <span v-else-if="$route.params.operation !== 'EDIT' && goodsObj.rule_refund === 3">到期后不退款</span>
<span v-else-if="
$route.params.operation !== 'EDIT' && goodsObj.rule_refund === 2
">购买后不允许退款</span>
<span v-else-if="
$route.params.operation !== 'EDIT' && goodsObj.rule_refund === 3
">到期后不退款</span>
</el-form-item> </el-form-item>
<el-form-item label="使用日期:"> <el-form-item label="使用日期:">
<el-radio-group <el-radio-group v-model="goodsObj.rule_date_type" v-if="$route.params.operation === 'EDIT'">
v-model="goodsObj.rule_date_type"
v-if="$route.params.operation === 'EDIT'"
>
<el-radio :label="1">周末、节假日通用</el-radio> <el-radio :label="1">周末、节假日通用</el-radio>
<el-radio :label="2">仅工作日可用</el-radio> <el-radio :label="2">仅工作日可用</el-radio>
</el-radio-group> </el-radio-group>
<span v-else-if=" <span v-else-if="$route.params.operation !== 'EDIT' && goodsObj.rule_date_type === 1">周末、节假日通用</span>
$route.params.operation !== 'EDIT' && <span v-else-if="$route.params.operation !== 'EDIT' && goodsObj.rule_date_type === 2">仅工作日可用</span>
goodsObj.rule_date_type === 1
">周末、节假日通用</span>
<span v-else-if="
$route.params.operation !== 'EDIT' &&
goodsObj.rule_date_type === 2
">仅工作日可用</span>
</el-form-item> </el-form-item>
<el-form-item label="使用开始时间:"> <el-form-item label="使用开始时间:">
<el-time-picker <el-time-picker
...@@ -487,8 +361,7 @@ ...@@ -487,8 +361,7 @@
v-if="$route.params.operation === 'EDIT'" v-if="$route.params.operation === 'EDIT'"
v-model="rulesForm.useStartTime" v-model="rulesForm.useStartTime"
@change="pickerStartTime" @change="pickerStartTime"
> ></el-time-picker>
</el-time-picker>
<span v-else>{{ goodsObj.rule_start_time }}</span> <span v-else>{{ goodsObj.rule_start_time }}</span>
</el-form-item> </el-form-item>
<el-form-item label="使用结束时间:"> <el-form-item label="使用结束时间:">
...@@ -497,8 +370,7 @@ ...@@ -497,8 +370,7 @@
v-if="$route.params.operation === 'EDIT'" v-if="$route.params.operation === 'EDIT'"
v-model="rulesForm.useEndTime" v-model="rulesForm.useEndTime"
@change="pickerEndTime" @change="pickerEndTime"
> ></el-time-picker>
</el-time-picker>
<span v-else>{{ goodsObj.rule_end_time }}</span> <span v-else>{{ goodsObj.rule_end_time }}</span>
</el-form-item> </el-form-item>
<el-form-item label="过期时间"> <el-form-item label="过期时间">
...@@ -509,8 +381,7 @@ ...@@ -509,8 +381,7 @@
type="datetime" type="datetime"
@change="expirDateChange" @change="expirDateChange"
placeholder="选择日期时间" placeholder="选择日期时间"
> ></el-date-picker>
</el-date-picker>
<span v-else>{{ expirationTime }}</span> <span v-else>{{ expirationTime }}</span>
</el-form-item> </el-form-item>
<el-form-item label="使用规则:"> <el-form-item label="使用规则:">
...@@ -528,17 +399,9 @@ ...@@ -528,17 +399,9 @@
</el-card> </el-card>
<!-- 操作记录 --> <!-- 操作记录 -->
<el-card class="message_border"> <el-card class="message_border">
<h3 style="margin-bottom:30px;">操作记录</h3> <h3 style="margin-bottom: 30px">操作记录</h3>
<el-table <el-table border stripe :data="recordLits">
border <el-table-column label="状态" prop="state" align="center">
stripe
:data="recordLits"
>
<el-table-column
label="状态"
prop="state"
align="center"
>
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.status === 0">待审核</span> <span v-if="scope.row.status === 0">待审核</span>
<span v-else-if="scope.row.status === 1">审核通过</span> <span v-else-if="scope.row.status === 1">审核通过</span>
...@@ -549,90 +412,42 @@ ...@@ -549,90 +412,42 @@
<span v-else>已下架</span> <span v-else>已下架</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="操作者" prop="operator_name" align="center"></el-table-column>
label="操作者" <el-table-column label="更新时间" prop="create_time" align="center"></el-table-column>
prop="operator_name" <el-table-column label="更新描述" prop="note" align="center"></el-table-column>
align="center"
></el-table-column>
<el-table-column
label="更新时间"
prop="create_time"
align="center"
></el-table-column>
<el-table-column
label="更新描述"
prop="note"
align="center"
></el-table-column>
</el-table> </el-table>
</el-card> </el-card>
<!-- 审核保存返回 --> <!-- 审核保存返回 -->
<section class="operationButton"> <section class="operationButton">
<el-button <el-button type="primary" v-if="$route.params.operation === 'AUDIT'" @click="onSuccess">通过</el-button>
type="primary" <el-popover v-if="$route.params.operation === 'AUDIT'" placement="top" :width="600" trigger="click" v-model:visible="rejectVisible">
v-if="$route.params.operation === 'AUDIT'"
@click="onSuccess"
>通过
</el-button>
<el-popover
v-if="$route.params.operation === 'AUDIT'"
placement="top"
:width="600"
trigger="click"
v-model:visible="rejectVisible"
>
<template #reference> <template #reference>
<el-button type="danger">驳回</el-button> <el-button type="danger">驳回</el-button>
</template> </template>
<el-form :model="rejectReason"> <el-form :model="rejectReason">
<el-form-item label="驳回原因:"> <el-form-item label="驳回原因:">
<el-input <el-input show-word-limit :maxlength="200" type="textarea" style="width: 100%" v-model.trim="rejectReason.reason"></el-input>
show-word-limit
:maxlength="200"
type="textarea"
style="width:100%"
v-model.trim="rejectReason.reason"
></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<section style="display:flex;justify-content:center;"> <section style="display: flex; justify-content: center">
<el-button <el-button type="danger" @click="onDefault">驳回</el-button>
type="danger" <el-button type="primary" @click="rejectVisible = false">取消</el-button>
@click="onDefault"
>驳回</el-button>
<el-button
type="primary"
@click="rejectVisible = false"
>取消
</el-button>
</section> </section>
</el-popover> </el-popover>
<el-button <el-button v-if="$route.params.operation === 'EDIT'" type="primary" @click="saveDetailMessage">保存</el-button>
v-if="$route.params.operation === 'EDIT'"
type="primary"
@click="saveDetailMessage"
>保存
</el-button>
<el-button @click="backToDetail">返回</el-button> <el-button @click="backToDetail">返回</el-button>
</section> </section>
</el-card> </el-card>
<!-- 展示缩略图 --> <!-- 展示缩略图 -->
<el-dialog <el-dialog width="40%" v-model="isShowPopver">
width="40%" <el-image :src="popoverImage" fit="fill" style="width: 100%"></el-image>
v-model="isShowPopver"
>
<el-image
:src="popoverImage"
fit="fill"
style="width:100%"
></el-image>
</el-dialog> </el-dialog>
</template> </template>
<style lang="less" src="./index.less" scope></style> <style lang="less" src="./index.less" scope></style>
<script> <script>
import { import {
getGoodsInfo, getGoodsInfo,
getGoodsList, getGoodsList,
postSuccess, postSuccess,
...@@ -640,17 +455,17 @@ import { ...@@ -640,17 +455,17 @@ import {
checkGoodsName, checkGoodsName,
getShopsList, getShopsList,
postAddShop, postAddShop,
editGoods editGoods,
} from "@/service/Goods/goods"; } from "@/service/Goods/goods";
import { GOODS_URI } from "../../../../server/config.js"; import { UploadPicUrl } from "@/utils/util";
import filterInput from "../utils/filterInput"; import filterInput from "../utils/filterInput";
export default { export default {
name: "GoodsDetail", name: "GoodsDetail",
beforeRouteEnter (to, from, next) { beforeRouteEnter(to, from, next) {
if (!to.params.operation) { if (!to.params.operation) {
next({ name: "GoodsList" }); next({ name: "GoodsList" });
} else if (!to.params.spuId) { } else if (!to.params.spuId) {
...@@ -660,14 +475,14 @@ export default { ...@@ -660,14 +475,14 @@ export default {
} }
}, },
created () { created() {
this.getOptions(); this.getOptions();
this.getGoodsDetailList(this.$route.params.spuId); this.getGoodsDetailList(this.$route.params.spuId);
}, },
computed: { computed: {
// 审核状态 // 审核状态
status () { status() {
if (this.goodsObj.audit_status === 0) { if (this.goodsObj.audit_status === 0) {
return "待审核"; return "待审核";
} else if (this.goodsObj.audit_status === 1) { } else if (this.goodsObj.audit_status === 1) {
...@@ -678,7 +493,7 @@ export default { ...@@ -678,7 +493,7 @@ export default {
}, },
// 上下架状态 // 上下架状态
onlineStatus () { onlineStatus() {
if (this.goodsObj.online_status === 0) { if (this.goodsObj.online_status === 0) {
return "未上架"; return "未上架";
} else if (this.goodsObj.online_status === 1) { } else if (this.goodsObj.online_status === 1) {
...@@ -686,48 +501,48 @@ export default { ...@@ -686,48 +501,48 @@ export default {
} else { } else {
return "已下架"; return "已下架";
} }
} },
}, },
watch: { watch: {
goodsObj (val) { goodsObj(val) {
this.optionsValue = [val.category_1_id, val.category_2_id]; this.optionsValue = [val.category_1_id, val.category_2_id];
this.rulesForm.useStartTime = this.formatDate(val.rule_start_time); this.rulesForm.useStartTime = this.formatDate(val.rule_start_time);
this.rulesForm.useEndTime = this.formatDate(val.rule_end_time); this.rulesForm.useEndTime = this.formatDate(val.rule_end_time);
console.log(val.original_price); console.log(val.original_price);
this.goodsObj.original_price = Number(val.original_price) this.goodsObj.original_price = Number(val.original_price);
if (!val.original_price) { if (!val.original_price) {
this.$nextTick(() => { this.$nextTick(() => {
this.goodsObj.original_price = ""; this.goodsObj.original_price = "";
}) });
} }
}, },
rejectVisible (val) { rejectVisible(val) {
if (!val) { if (!val) {
this.rejectReason.reason = ""; this.rejectReason.reason = "";
} }
}, },
}, },
data () { data() {
return { return {
// 商品分类选项 // 商品分类选项
optionsProps: { optionsProps: {
value: "category_id", value: "category_id",
label: "name", label: "name",
children: "sub_list" children: "sub_list",
}, },
lifeList: [ lifeList: [
{ value: 1, options: "个人生活号" }, { value: 1, options: "个人生活号" },
{ value: 2, options: "企业生活号" } { value: 2, options: "企业生活号" },
], ],
optionList: [], // 商品分类选项 optionList: [], // 商品分类选项
optionsValue: [], // 商品分类的值 optionsValue: [], // 商品分类的值
// 商品回显信息 // 商品回显信息
goodsObj: { goodsObj: {
introduce: "" // 商品介绍 introduce: "", // 商品介绍
}, },
inventoryAdd: 0, // 库存增减 inventoryAdd: 0, // 库存增减
...@@ -751,11 +566,11 @@ export default { ...@@ -751,11 +566,11 @@ export default {
rulesOptions: [ rulesOptions: [
{ value: 1, label: "到期自动退款" }, { value: 1, label: "到期自动退款" },
{ value: 2, label: "购买后不允许退款" }, { value: 2, label: "购买后不允许退款" },
{ value: 3, label: "到期后不退款" } { value: 3, label: "到期后不退款" },
], ],
useStartTime: "", // 使用开始时间 useStartTime: "", // 使用开始时间
useEndTime: "", // 使用结束时间 useEndTime: "", // 使用结束时间
rule_desc: "" // 使用描述 rule_desc: "", // 使用描述
}, },
// 操作记录列表 // 操作记录列表
...@@ -763,7 +578,7 @@ export default { ...@@ -763,7 +578,7 @@ export default {
// 驳回原因表单 // 驳回原因表单
rejectReason: { rejectReason: {
reason: "" reason: "",
}, },
shopsList: [], // 门店列表 shopsList: [], // 门店列表
...@@ -778,7 +593,7 @@ export default { ...@@ -778,7 +593,7 @@ export default {
shop_name: "", shop_name: "",
connect_phone: "", connect_phone: "",
address: "", address: "",
deep_place: "" deep_place: "",
}, },
shopList: [], // 门店列表 shopList: [], // 门店列表
...@@ -793,12 +608,12 @@ export default { ...@@ -793,12 +608,12 @@ export default {
activeStartTime: "", // 活动开始时间 activeStartTime: "", // 活动开始时间
activeEndTime: "", // 活动结束时间 activeEndTime: "", // 活动结束时间
uploadUrl: `${GOODS_URI}/ksy/ks3apiunencrypt/ks3api_upload`, // 金山云上传地址 uploadUrl: UploadPicUrl, // 金山云上传地址
addShopShow: false, // 添加门店弹框显示 addShopShow: false, // 添加门店弹框显示
expirationTime: "", // 过期时间 expirationTime: "", // 过期时间
shopIds: "" // 已选商店id shopIds: "", // 已选商店id
}; };
}, },
...@@ -811,7 +626,7 @@ export default { ...@@ -811,7 +626,7 @@ export default {
// else this.goodsObj[level] = ""; // else this.goodsObj[level] = "";
// }, // },
// 获取级联选择商品列表 // 获取级联选择商品列表
async getOptions () { async getOptions() {
try { try {
const res = await getGoodsList(); const res = await getGoodsList();
if (res.code !== 0) return this.$message.error(res.reason); if (res.code !== 0) return this.$message.error(res.reason);
...@@ -822,7 +637,7 @@ export default { ...@@ -822,7 +637,7 @@ export default {
}, },
// 获取详情列表 // 获取详情列表
async getGoodsDetailList (params) { async getGoodsDetailList(params) {
try { try {
const res = await getGoodsInfo({ goods_spu_id: params }); const res = await getGoodsInfo({ goods_spu_id: params });
if (res.code !== 0) { if (res.code !== 0) {
...@@ -837,7 +652,7 @@ export default { ...@@ -837,7 +652,7 @@ export default {
// 渲染过期时间 // 渲染过期时间
this.expirationTime = goods_info.expiration_time; this.expirationTime = goods_info.expiration_time;
// 初始化门店id // 初始化门店id
this.shopId = goods_info.sub_shop.map(item => { this.shopId = goods_info.sub_shop.map((item) => {
return item.sub_shop_id; return item.sub_shop_id;
}); });
this.shopIds = this.shopId.join(","); this.shopIds = this.shopId.join(",");
...@@ -847,14 +662,8 @@ export default { ...@@ -847,14 +662,8 @@ export default {
this.activeEndTime = goods_info.rule_end_time; this.activeEndTime = goods_info.rule_end_time;
// 回显图片 // 回显图片
this.formatInitPicture( this.formatInitPicture(goods_info.desc_pic_url_list, this.descPicUrlList);
goods_info.desc_pic_url_list, this.formatInitPicture(goods_info.introduce_pic_url_list, this.introducePicUrlList);
this.descPicUrlList
);
this.formatInitPicture(
goods_info.introduce_pic_url_list,
this.introducePicUrlList
);
this.detailUploadList = this.formatUploadPictureList(goods_info.desc_pic_url); this.detailUploadList = this.formatUploadPictureList(goods_info.desc_pic_url);
this.introduceUploadList = this.formatUploadPictureList(goods_info.introduce_pic_url); this.introduceUploadList = this.formatUploadPictureList(goods_info.introduce_pic_url);
} catch (error) { } catch (error) {
...@@ -863,8 +672,8 @@ export default { ...@@ -863,8 +672,8 @@ export default {
}, },
// 初始化照片 // 初始化照片
formatInitPicture (pictureList, storeList) { formatInitPicture(pictureList, storeList) {
pictureList.forEach(element => { pictureList.forEach((element) => {
let obj = new Object(); let obj = new Object();
obj.url = element; obj.url = element;
storeList.push(obj); storeList.push(obj);
...@@ -872,7 +681,7 @@ export default { ...@@ -872,7 +681,7 @@ export default {
}, },
// 初始化上传照片列表 // 初始化上传照片列表
formatUploadPictureList (fileStr) { formatUploadPictureList(fileStr) {
if (!fileStr) { if (!fileStr) {
return []; return [];
} else { } else {
...@@ -881,12 +690,12 @@ export default { ...@@ -881,12 +690,12 @@ export default {
}, },
// 上传图片的公共方法 // 上传图片的公共方法
uploadPicture (response, storageList) { uploadPicture(response, storageList) {
const responseURL = response.result.image_id; const responseURL = response.result.image_id;
storageList.push(responseURL); storageList.push(responseURL);
}, },
// 删除图片的公共方法 // 删除图片的公共方法
deletePicture (file, fileList, storageList) { deletePicture(file, fileList, storageList) {
for (let i = 0; i < fileList.length; i++) { for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid == file.uid) { if (fileList[i].uid == file.uid) {
storageList.splice(i, 1); storageList.splice(i, 1);
...@@ -895,7 +704,7 @@ export default { ...@@ -895,7 +704,7 @@ export default {
}, },
// 格式化日期 // 格式化日期
formatDate (time) { formatDate(time) {
const nowTime = new Date(); const nowTime = new Date();
const nowYear = nowTime.getFullYear(); const nowYear = nowTime.getFullYear();
const nowMonth = nowTime.getMonth() + 1; const nowMonth = nowTime.getMonth() + 1;
...@@ -908,7 +717,7 @@ export default { ...@@ -908,7 +717,7 @@ export default {
}, },
// 检查输入是否带有表情符号 // 检查输入是否带有表情符号
checkHaveExpression (value) { checkHaveExpression(value) {
if (!filterInput.checkString(value)) { if (!filterInput.checkString(value)) {
this.$nextTick(() => { this.$nextTick(() => {
this.goodsObj.goods_name = ""; this.goodsObj.goods_name = "";
...@@ -918,11 +727,11 @@ export default { ...@@ -918,11 +727,11 @@ export default {
}, },
// 获取门店列表 // 获取门店列表
async getShops () { async getShops() {
const query = { const query = {
life_account_id: this.goodsObj.life_account_id, life_account_id: this.goodsObj.life_account_id,
page: this.shopCurrentPage, page: this.shopCurrentPage,
page_size: 5 page_size: 5,
}; };
const res = await getShopsList(query); const res = await getShopsList(query);
if (res.code !== 0) return this.$message.error(res.reason); if (res.code !== 0) return this.$message.error(res.reason);
...@@ -930,7 +739,7 @@ export default { ...@@ -930,7 +739,7 @@ export default {
this.shopsList = res.result; this.shopsList = res.result;
this.shopsCount = res.count; this.shopsCount = res.count;
this.$nextTick(() => { this.$nextTick(() => {
this.shopsList.forEach(row => { this.shopsList.forEach((row) => {
if (this.shopId.indexOf(row.sub_shop_id) !== -1) { if (this.shopId.indexOf(row.sub_shop_id) !== -1) {
this.$refs.shopListRef.toggleRowSelection(row, true); this.$refs.shopListRef.toggleRowSelection(row, true);
} else { } else {
...@@ -941,42 +750,42 @@ export default { ...@@ -941,42 +750,42 @@ export default {
}, },
// 删除已选择门店 // 删除已选择门店
deleteShops (subShopId) { deleteShops(subShopId) {
this.goodsObj.sub_shop = this.goodsObj.sub_shop.filter(item => { this.goodsObj.sub_shop = this.goodsObj.sub_shop.filter((item) => {
return item.sub_shop_id !== subShopId; return item.sub_shop_id !== subShopId;
}); });
this.shopId = this.goodsObj.sub_shop.map(item => { this.shopId = this.goodsObj.sub_shop.map((item) => {
return item.sub_shop_id; return item.sub_shop_id;
}); });
this.shopIds = this.shopId.join(","); this.shopIds = this.shopId.join(",");
}, },
// 门店列表更改时操作 // 门店列表更改时操作
handleShopsChange (value) { handleShopsChange(value) {
this.chooseShopsList = []; this.chooseShopsList = [];
this.chooseShopsList = value; this.chooseShopsList = value;
console.log("已选择列表的长度", this.chooseShopsList.length); console.log("已选择列表的长度", this.chooseShopsList.length);
const shopList = value.map(item => { const shopList = value.map((item) => {
return item.sub_shop_id; return item.sub_shop_id;
}); });
this.shopIds = ""; this.shopIds = "";
this.shopIds = shopList.join(","); this.shopIds = shopList.join(",");
}, },
// 商品列表换页 // 商品列表换页
changeShopListPage (page) { changeShopListPage(page) {
this.shopCurrentPage = page; this.shopCurrentPage = page;
this.getShops(); this.getShops();
}, },
// 确认选择的店铺 // 确认选择的店铺
handleChooseShops () { handleChooseShops() {
this.goodsObj.sub_shop = this.chooseShopsList; this.goodsObj.sub_shop = this.chooseShopsList;
this.shopId = this.goodsObj.sub_shop.map(item => { this.shopId = this.goodsObj.sub_shop.map((item) => {
return item.sub_shop_id; return item.sub_shop_id;
}); });
this.shopListShow = false; this.shopListShow = false;
}, },
// 添加新门店 // 添加新门店
async addShop () { async addShop() {
const deepPlace = this.shopForm.deep_place.split(","); const deepPlace = this.shopForm.deep_place.split(",");
const longitude = deepPlace[0]; const longitude = deepPlace[0];
const latitude = deepPlace[1]; const latitude = deepPlace[1];
...@@ -986,7 +795,7 @@ export default { ...@@ -986,7 +795,7 @@ export default {
shop_name: this.shopForm.shop_name, shop_name: this.shopForm.shop_name,
longitude, // 经度 longitude, // 经度
latitude, // 纬度 latitude, // 纬度
address: this.shopForm.address address: this.shopForm.address,
}; };
if (!query.shop_name) { if (!query.shop_name) {
return this.$message.error("请填写门店名称"); return this.$message.error("请填写门店名称");
...@@ -1000,10 +809,7 @@ export default { ...@@ -1000,10 +809,7 @@ export default {
if (!query.longitude || !query.latitude) { if (!query.longitude || !query.latitude) {
return this.$message.error("请填写地理定位"); return this.$message.error("请填写地理定位");
} }
if ( if (!/([0-9]{3,4}-)?[0-9]{7,8}/.test(query.phone) && !/^[1][3,4,5,7,8,9][0-9]{9}$/.test(query.phone)) {
!/([0-9]{3,4}-)?[0-9]{7,8}/.test(query.phone) &&
!/^[1][3,4,5,7,8,9][0-9]{9}$/.test(query.phone)
) {
return this.$message.error("联系电话格式不正确"); return this.$message.error("联系电话格式不正确");
} }
...@@ -1026,7 +832,7 @@ export default { ...@@ -1026,7 +832,7 @@ export default {
// }, // },
// 取消新建门店 // 取消新建门店
closeAddShops () { closeAddShops() {
this.shopForm.shop_name = ""; this.shopForm.shop_name = "";
this.shopForm.address = ""; this.shopForm.address = "";
this.shopForm.connect_phone = ""; this.shopForm.connect_phone = "";
...@@ -1035,16 +841,16 @@ export default { ...@@ -1035,16 +841,16 @@ export default {
}, },
// 商品分类列表变化 // 商品分类列表变化
optionsChange (value) { optionsChange(value) {
this.optionsValue = value; this.optionsValue = value;
}, },
// 检查商品名称是否重复 // 检查商品名称是否重复
async checkSameName () { async checkSameName() {
const res = await checkGoodsName({ const res = await checkGoodsName({
life_account_id: this.goodsObj.life_account_id, life_account_id: this.goodsObj.life_account_id,
goods_name: this.goodsObj.goods_name, goods_name: this.goodsObj.goods_name,
goods_spu_id: this.goodsObj.goods_spu_id goods_spu_id: this.goodsObj.goods_spu_id,
}); });
if (res.code !== 0) return this.$message.error(res.reason); if (res.code !== 0) return this.$message.error(res.reason);
if (res.result.can_use) { if (res.result.can_use) {
...@@ -1057,31 +863,31 @@ export default { ...@@ -1057,31 +863,31 @@ export default {
}, },
// 商品详情图上传成功时 // 商品详情图上传成功时
handleDetailSuccess (res) { handleDetailSuccess(res) {
console.log(res); console.log(res);
this.uploadPicture(res, this.detailUploadList); this.uploadPicture(res, this.detailUploadList);
}, },
// 商品详情图删除完成后的钩子 // 商品详情图删除完成后的钩子
removeDetailFiles (file, fileList) { removeDetailFiles(file, fileList) {
this.deletePicture(file, fileList, this.detailUploadList); this.deletePicture(file, fileList, this.detailUploadList);
}, },
// 商品介绍图上传成功钩子 // 商品介绍图上传成功钩子
introduceSuccess (res) { introduceSuccess(res) {
this.uploadPicture(res, this.introduceUploadList); this.uploadPicture(res, this.introduceUploadList);
}, },
// 商品介绍图删除后的钩子 // 商品介绍图删除后的钩子
intrRemove (file, fileList) { intrRemove(file, fileList) {
this.deletePicture(file, fileList, this.introduceUploadList); this.deletePicture(file, fileList, this.introduceUploadList);
}, },
// 展示商品大图 // 展示商品大图
previewImage (file) { previewImage(file) {
this.popoverImage = file.url; this.popoverImage = file.url;
this.isShowPopver = true; this.isShowPopver = true;
}, },
// 库存增减更改 // 库存增减更改
hasNumberChange () { hasNumberChange() {
if (!this.inventoryAdd) { if (!this.inventoryAdd) {
this.$nextTick(() => { this.$nextTick(() => {
this.inventoryAdd = 0; this.inventoryAdd = 0;
...@@ -1098,7 +904,7 @@ export default { ...@@ -1098,7 +904,7 @@ export default {
}, },
// 单人可购买上限的修改 // 单人可购买上限的修改
handleLimitChange () { handleLimitChange() {
if (!this.goodsObj.rule_limit) { if (!this.goodsObj.rule_limit) {
this.$nextTick(() => { this.$nextTick(() => {
this.goodsObj.rule_limit = 0; this.goodsObj.rule_limit = 0;
...@@ -1107,7 +913,7 @@ export default { ...@@ -1107,7 +913,7 @@ export default {
}, },
// 时间校验器 // 时间校验器
timePicker (time) { timePicker(time) {
let Hours = time.getHours() + ""; let Hours = time.getHours() + "";
let Minutes = time.getMinutes() + ""; let Minutes = time.getMinutes() + "";
let Seconds = time.getSeconds() + ""; let Seconds = time.getSeconds() + "";
...@@ -1123,16 +929,16 @@ export default { ...@@ -1123,16 +929,16 @@ export default {
return `${Hours}:${Minutes}:${Seconds}`; return `${Hours}:${Minutes}:${Seconds}`;
}, },
// 选择规则开始时间 // 选择规则开始时间
pickerStartTime (time) { pickerStartTime(time) {
this.activeStartTime = this.timePicker(time); this.activeStartTime = this.timePicker(time);
}, },
// 选择规则结束时间 // 选择规则结束时间
pickerEndTime (time) { pickerEndTime(time) {
this.activeEndTime = this.timePicker(time); this.activeEndTime = this.timePicker(time);
}, },
// 过期时间更改 // 过期时间更改
expirDateChange (time) { expirDateChange(time) {
let YYYY = time.getFullYear(); let YYYY = time.getFullYear();
let MM = time.getMonth() + 1; let MM = time.getMonth() + 1;
let DD = time.getDate(); let DD = time.getDate();
...@@ -1158,7 +964,7 @@ export default { ...@@ -1158,7 +964,7 @@ export default {
}, },
// 禁用时间 // 禁用时间
disableExpirDate (time) { disableExpirDate(time) {
const timeMs = time.getTime(); const timeMs = time.getTime();
if (timeMs > Date.now() - 86400000) { if (timeMs > Date.now() - 86400000) {
return false; return false;
...@@ -1168,39 +974,34 @@ export default { ...@@ -1168,39 +974,34 @@ export default {
}, },
// 更改售价 // 更改售价
salePrice () { salePrice() {
if (!this.goodsObj.price) { if (!this.goodsObj.price) {
this.$nextTick(() => { this.$nextTick(() => {
this.goodsObj.price = ""; this.goodsObj.price = "";
}) });
} }
const parseFloatValue = Number(this.goodsObj.price).toFixed(2); const parseFloatValue = Number(this.goodsObj.price).toFixed(2);
this.goodsObj.price = Number(parseFloatValue); this.goodsObj.price = Number(parseFloatValue);
if ( if (typeof this.goodsObj.price === "number" && isNaN(this.goodsObj.price)) {
typeof this.goodsObj.price === "number" &&
isNaN(this.goodsObj.price)
) {
this.goodsObj.price = ""; this.goodsObj.price = "";
return this.$message.error("售价价格必须为数字"); return this.$message.error("售价价格必须为数字");
} }
}, },
// 更改原价 // 更改原价
perPrice (val) { perPrice(val) {
let reg = /^\d+(\.\d{1,2})?$/; let reg = /^\d+(\.\d{1,2})?$/;
if(!reg.test(val)) { if (!reg.test(val)) {
return this.$message.error("请输入两位小数"); return this.$message.error("请输入两位小数");
} }
if (val.length === 0) val = 0; if (val.length === 0) val = 0;
// const parseOriginalPrice = Number(val).toFixed(2); // const parseOriginalPrice = Number(val).toFixed(2);
// val = Number(parseOriginalPrice); // val = Number(parseOriginalPrice);
if (typeof val === "number" &&isNaN(val)) { if (typeof val === "number" && isNaN(val)) {
val = 0; val = 0;
return this.$message.error("原价价格必为数字"); return this.$message.error("原价价格必为数字");
} }
const parseOriginalPrice = Number(this.goodsObj.original_price).toFixed( const parseOriginalPrice = Number(this.goodsObj.original_price).toFixed(2);
2
);
this.goodsObj.original_price = Number(parseOriginalPrice); this.goodsObj.original_price = Number(parseOriginalPrice);
// if ( // if (
// typeof this.goodsObj.original_price === "number" && // typeof this.goodsObj.original_price === "number" &&
...@@ -1212,7 +1013,7 @@ export default { ...@@ -1212,7 +1013,7 @@ export default {
}, },
// 审核通过 // 审核通过
async onSuccess () { async onSuccess() {
const res = await postSuccess(this.$route.params.spuId); const res = await postSuccess(this.$route.params.spuId);
if (res.code !== 0) return this.$message.error(res.reason); if (res.code !== 0) return this.$message.error(res.reason);
this.$message.success("审核通过"); this.$message.success("审核通过");
...@@ -1220,10 +1021,10 @@ export default { ...@@ -1220,10 +1021,10 @@ export default {
}, },
// 审核拒绝 // 审核拒绝
async onDefault () { async onDefault() {
const query = { const query = {
goods_spu_id: this.goodsObj.goods_spu_id, goods_spu_id: this.goodsObj.goods_spu_id,
rejected_reason: this.rejectReason.reason rejected_reason: this.rejectReason.reason,
}; };
console.log(query.rejected_reason); console.log(query.rejected_reason);
if (query.rejected_reason !== "0" && !query.rejected_reason) { if (query.rejected_reason !== "0" && !query.rejected_reason) {
...@@ -1238,12 +1039,12 @@ export default { ...@@ -1238,12 +1039,12 @@ export default {
}, },
// 返回主页面 // 返回主页面
backToDetail () { backToDetail() {
this.$router.replace({ name: "GoodsList" }); this.$router.replace({ name: "GoodsList" });
}, },
// 保存修改信息 // 保存修改信息
async saveDetailMessage () { async saveDetailMessage() {
await this.checkSameName(); // 检验商品名称是否可用 await this.checkSameName(); // 检验商品名称是否可用
if (!this.optionsValue) { if (!this.optionsValue) {
return this.$message.error("请选择商品分类"); return this.$message.error("请选择商品分类");
...@@ -1268,7 +1069,7 @@ export default { ...@@ -1268,7 +1069,7 @@ export default {
clear_price: +this.goodsObj.clear_price, // 结算价 clear_price: +this.goodsObj.clear_price, // 结算价
price: this.goodsObj.price, // 现价 price: this.goodsObj.price, // 现价
sub_shop_ids: this.shopIds, // 门店id sub_shop_ids: this.shopIds, // 门店id
rule_date_type: this.goodsObj.rule_date_type // 使用日期类型(周末/工作日) rule_date_type: this.goodsObj.rule_date_type, // 使用日期类型(周末/工作日)
}; };
console.log(111222333, query.original_price); console.log(111222333, query.original_price);
...@@ -1333,7 +1134,7 @@ export default { ...@@ -1333,7 +1134,7 @@ export default {
} }
this.$message.success("商品编辑成功!"); this.$message.success("商品编辑成功!");
this.$router.replace({ name: "GoodsList" }); this.$router.replace({ name: "GoodsList" });
} },
} },
}; };
</script> </script>
...@@ -112,15 +112,21 @@ export async function orderRefundReject(params) { ...@@ -112,15 +112,21 @@ export async function orderRefundReject(params) {
// 导出订单 // 导出订单
export function getOrderExportURL(eventId, type) { export function getOrderExportURL(eventId, type) {
var ENV; // var ENV;
if (process.env.NODE_ENV == "development") { // if(process.env.NODE_ENV == "development"){
ENV = "http://bp-dev.ini.yidian-inc.com/"; // ENV = "http://bp-dev.ini.yidian-inc.com/"
} else if (process.env.NODE_ENV == "test") { // }else if(process.env.NODE_ENV == "test"){
ENV = "http://bp-test.ini.yidian-inc.com/"; // ENV = "http://bp-test.ini.yidian-inc.com/"
// }else{
// ENV = "http://bp.int.yidian-inc.com/"
// }
// return `${ENV}order/oldbackground/order_export?marketing_id=${eventId}&type=${type}`;
if (process.env.NODE_ENV === "development") {
return `http://127.0.0.1:8055/api/v1/relay/old_order_export?marketing_id=${eventId}&type=${type}`;
} else { } else {
ENV = "http://bp.int.yidian-inc.com/"; return `/api/v1/relay/old_order_export?marketing_id=${eventId}&type=${type}`;
} }
return `${ENV}order/oldbackground/order_export?marketing_id=${eventId}&type=${type}`;
} }
// 新订单管理 // 新订单管理
...@@ -191,13 +197,10 @@ export async function newOrderRefundReject(params) { ...@@ -191,13 +197,10 @@ export async function newOrderRefundReject(params) {
// 导出订单 // 导出订单
export function newGetOrderExportURL(eventId, type) { export function newGetOrderExportURL(eventId, type) {
var ENV; if (process.env.NODE_ENV === "development") {
if (process.env.NODE_ENV == "development") { return `http://127.0.0.1:8055/api/v1/relay/order_export?marketing_id=${eventId}&type=${type}`;
ENV = "http://bp-dev.ini.yidian-inc.com/";
} else if (process.env.NODE_ENV == "test") {
ENV = "http://bp-test.ini.yidian-inc.com/";
} else { } else {
ENV = "http://bp.int.yidian-inc.com/"; return `/api/v1/relay/order_export?marketing_id=${eventId}&type=${type}`;
} }
return `${ENV}order/background/order_export?marketing_id=${eventId}&type=${type}`; // return `/api/v1/relay/order_export?marketing_id=${eventId}&type=${type}`;
} }
...@@ -22,25 +22,25 @@ import router from "@/router"; ...@@ -22,25 +22,25 @@ import router from "@/router";
export function redirectToLogin() { export function redirectToLogin() {
let hasCallback = window.location.href.match(/\?callback/); let hasCallback = window.location.href.match(/\?callback/);
if(hasCallback) return; if (hasCallback) return;
let isLogin = window.location.pathname.match(/op\/login/); let isLogin = window.location.pathname.match(/op\/login/);
router.push(`/op/login${!isLogin ? '?callback=' + window.encodeURIComponent(window.location.pathname) : ''}`) router.push(`/op/login${!isLogin ? "?callback=" + window.encodeURIComponent(window.location.pathname) : ""}`);
} }
export function redirectPage() { export function redirectPage() {
let url = window.location.search.split('?callback=')[1] || window.location.pathname; let url = window.location.search.split("?callback=")[1] || window.location.pathname;
router.push(window.decodeURIComponent(url)) router.push(window.decodeURIComponent(url));
} }
export function isYdUser(email) { export function isYdUser(email) {
return email.match(/yidian-inc/) || false return email.match(/yidian-inc/) || false;
} }
export function setCookie(name, value) { export function setCookie(name, value) {
var hour = 8; var hour = 8;
var exp = new Date(); var exp = new Date();
exp.setTime(exp.getTime() + hour*60*60*1000); exp.setTime(exp.getTime() + hour * 60 * 60 * 1000);
document.cookie = name + "="+ value + ";expires=" + exp.toGMTString()+";path=/"; document.cookie = name + "=" + value + ";expires=" + exp.toGMTString() + ";path=/";
} }
//获取cookie //获取cookie
...@@ -58,12 +58,15 @@ export function getCookie(NameOfCookie) { ...@@ -58,12 +58,15 @@ export function getCookie(NameOfCookie) {
} }
export function delCookie() { export function delCookie() {
var keys = document.cookie.match(/[^ =;]+(?==)/g) var keys = document.cookie.match(/[^ =;]+(?==)/g);
if (keys) { if (keys) {
for (var i = keys.length; i--;) { for (var i = keys.length; i--; ) {
document.cookie = keys[i] + '=0;path=/;expires=' + new Date(0).toUTCString() document.cookie = keys[i] + "=0;path=/;expires=" + new Date(0).toUTCString();
document.cookie = keys[i] + '=0;path=/;domain=' + document.domain + ';expires=' + new Date(0).toUTCString() document.cookie = keys[i] + "=0;path=/;domain=" + document.domain + ";expires=" + new Date(0).toUTCString();
document.cookie = keys[i] + '=0;path=/;domain=yidian-inc.com;expires=' + new Date(0).toUTCString() document.cookie = keys[i] + "=0;path=/;domain=yidian-inc.com;expires=" + new Date(0).toUTCString();
} }
} }
} }
export const UploadPicUrl =
process.env.NODE_ENV === "development" ? `http://127.0.0.1:8055/api/v1/relay/ks3api_upload` : "/api/v1/relay/ks3api_upload";
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment