From 0f162f5ca1915b06c3fc4e1fdb60cf1c191b1bed Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 14 Sep 2024 17:47:51 +0800 Subject: [PATCH] 1 --- .env.development | 8 ++--- src/views/saleHome/component/pupop.vue | 45 +++++++++++++++++--------- src/views/saleHome/component/shop.vue | 2 +- src/views/saleHome/index.vue | 15 ++++++--- 4 files changed, 44 insertions(+), 26 deletions(-) diff --git a/.env.development b/.env.development index e060f13..fa6873c 100644 --- a/.env.development +++ b/.env.development @@ -4,11 +4,11 @@ VITE_NOW_TYPE = 'dist' # VITE_PUSH_URL = 'wss://ceshi-multi-store.lihaink.cn/pull' # VITE_BASE_URL = 'https://ceshi-multi-store.lihaink.cn' -# VITE_PUSH_URL = 'ws://192.168.1.22:8787' -# VITE_BASE_URL = 'http://192.168.1.22:8545' +VITE_PUSH_URL = 'ws://192.168.1.22:8787' +VITE_BASE_URL = 'http://192.168.1.22:8545' - VITE_PUSH_URL ='wss://test-multi-store.lihaink.cn/pull' - VITE_BASE_URL = 'https://test-multi-store.lihaink.cn' +# VITE_PUSH_URL ='wss://test-multi-store.lihaink.cn/pull' +# VITE_BASE_URL = 'https://test-multi-store.lihaink.cn' # VITE_PUSH_URL ='wss://multi-store.lihaink.cn/pull' # VITE_BASE_URL = 'https://multi-store.lihaink.cn' \ No newline at end of file diff --git a/src/views/saleHome/component/pupop.vue b/src/views/saleHome/component/pupop.vue index e1e8f81..14b8d23 100644 --- a/src/views/saleHome/component/pupop.vue +++ b/src/views/saleHome/component/pupop.vue @@ -3,6 +3,7 @@ import { ref, onMounted, onUnmounted, nextTick } from "vue"; import { ElMessage } from "element-plus"; import { getAttrValue } from "@/api/shop.js"; import mitt from "@/utils/mitt.js"; +import { forEach } from "lodash"; const dialogVisible = ref(false); const inputRef = ref(null); @@ -20,10 +21,14 @@ const show = (e) => { const form = ref({}); const loading = ref(false); +const checked = ref([]); const mode = ref("add"); const setForm = (data, type = "add") => { mode.value = type; form.value = JSON.parse(JSON.stringify(data)); + form.value.attr_value.map((item) => { + checked.value[item.id]=false; + }) }; const emit = defineEmits(["changeItem"]); @@ -33,6 +38,16 @@ const changeItem = () => { emit("changeItem", form.value); dialogVisible.value = false; }; +const onChange=(e)=>{ + checked.value.forEach((item,index)=>{ + if(index!=e.id){ + checked.value[index]=false + }else{ + checked.value[e.id]=true + } + }) + console.log(e) +} defineExpose({ show, @@ -63,27 +78,26 @@ const close = () => {