From 2acf054b868589e470db7785089ea414dabdffa4 Mon Sep 17 00:00:00 2001 From: duan <1004387497@qq.com> Date: Thu, 1 Aug 2024 15:48:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B4=A0=E6=9D=90=E5=BA=93=E6=B7=BB=E5=8A=A0-?= =?UTF-8?q?=E6=9C=AA=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/api/shop.js | 9 ++- src/main.js | 5 ++ src/views/product/add_shop.vue | 13 +++- src/views/product/components/addImages.vue | 69 ++++++++++++++++++++++ 5 files changed, 94 insertions(+), 3 deletions(-) create mode 100644 src/views/product/components/addImages.vue diff --git a/package.json b/package.json index 7bb17a2..bc4f7bd 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "vue-image-crop-upload": "^3.0.3", "vue-material": "^1.0.0-beta-15", "vue-router": "3.0.2", + "vue-select-image": "^1.9.0", "vue-splitpane": "1.0.4", "vue2-editor": "^2.10.3", "vuedraggable": "2.20.0", diff --git a/src/api/shop.js b/src/api/shop.js index 8e6c02f..2b16028 100644 --- a/src/api/shop.js +++ b/src/api/shop.js @@ -70,7 +70,14 @@ export function tbShopUnitPost(data) { data }); } - +// 查询图库 +export function getcommonCategor(data) { + return request({ + url: `/channel/file/getcommon-category`, + method: "post", + data + }); +} /** * 更改单位 * @returns diff --git a/src/main.js b/src/main.js index 7cf3beb..bca79f0 100644 --- a/src/main.js +++ b/src/main.js @@ -6,6 +6,11 @@ import "normalize.css/normalize.css"; import Element from "element-ui"; +// 图片选择器 +import VueSelectImage from 'vue-select-image' +import "vue-select-image/dist/vue-select-image.css"; +Vue.use(VueSelectImage) + // 数据字典 import dict from "./components/Dict"; import Editor from "@/components/Editor"; diff --git a/src/views/product/add_shop.vue b/src/views/product/add_shop.vue index 978f4d1..2539e4e 100644 --- a/src/views/product/add_shop.vue +++ b/src/views/product/add_shop.vue @@ -44,6 +44,7 @@
注:第一张图为商品封面图,图片尺寸为750×750
+ 从图库中选取
@@ -334,6 +335,8 @@ + + @@ -348,6 +351,7 @@ import { tbProductPut } from "@/api/shop"; import addUnit from "./components/addUnit"; +import addImg from './components/addImages.vue' import addClassify from "./components/addClassify"; import shopList from "@/components/shopList"; import groupTypeList from "@/components/groupTypeList"; @@ -364,7 +368,7 @@ export default { uploadImg, shopList, groupTypeList, - Editor + Editor,addImg }, data() { const validatordateUsed = (rule, value, callback) => { @@ -517,7 +521,12 @@ export default { } }, methods: { - + successEvent(d){ + console.log(d,'拿到数据') + // this.$refs.uploadImg.fileList.push(d) + console.log(this.$refs.uploadImg.fileList,'调试111111') + console.log(this.$refs.uploadImg.files,'调试111111') + }, priceFormat(item,key){ const messageheight=48; const offset=window.innerHeight/2-(messageheight/2) -100 diff --git a/src/views/product/components/addImages.vue b/src/views/product/components/addImages.vue new file mode 100644 index 0000000..cafdd04 --- /dev/null +++ b/src/views/product/components/addImages.vue @@ -0,0 +1,69 @@ + + + \ No newline at end of file