From be1ef04ec9710ed24e2c6a9c29b90134f8b0445e Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Thu, 19 Sep 2024 10:17:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=97=E9=93=BA=E8=AF=A6=E6=83=85=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 7 +++ pages/shopSetUp/editVal.vue | 59 +++++++++++++++++++++++++ pages/shopSetUp/index.vue | 86 +++++++++---------------------------- 3 files changed, 87 insertions(+), 65 deletions(-) create mode 100644 pages/shopSetUp/editVal.vue diff --git a/pages.json b/pages.json index 71a3777..c2f031f 100644 --- a/pages.json +++ b/pages.json @@ -106,6 +106,13 @@ "navigationBarTitleText": "设置中心" } }, + { + "pageId": "PAGES_SHOP_EDITVAL", + "path": "pages/shopSetUp/editVal", + "style": { + "navigationBarTitleText": "" + } + }, { "pageId": "PAGES_SHOP_QRCODE", "path": "pages/shopSetUp/shopQRcode", diff --git a/pages/shopSetUp/editVal.vue b/pages/shopSetUp/editVal.vue new file mode 100644 index 0000000..928bda5 --- /dev/null +++ b/pages/shopSetUp/editVal.vue @@ -0,0 +1,59 @@ + + + + diff --git a/pages/shopSetUp/index.vue b/pages/shopSetUp/index.vue index 6533cb0..4dee8cc 100644 --- a/pages/shopSetUp/index.vue +++ b/pages/shopSetUp/index.vue @@ -7,11 +7,12 @@ - + + 商户名称 {{ vdata.shopInfo.shopName }} - + 商户电话 {{ vdata.shopInfo.phone }} @@ -41,7 +42,7 @@ - 桌位费{{vdata.shopInfo.tableFee}} + 桌位费{{vdata.shopInfo.tableFee}} @@ -84,19 +85,7 @@ 切换门店 - - - - - - - + @@ -109,8 +98,6 @@ import go from '@/commons/utils/go.js' import infoBox from '@/commons/utils/infoBox.js' import { $uploadFile } from '@/http/yskApi/file.js' -const jeepayPopupInputRef = ref() -const popupRef = ref() const uploadImg = ref() const phone = ref(null) const vdata = reactive({ @@ -135,8 +122,24 @@ onMounted(() => { onShow(() => { shopInfo(); + uni.$on('refreshPreviousPage', (params) => { + // 这里执行刷新数据的操作,例如重新调用API获取数据 + refreshData(params); + }); }) +let refreshData = (e) => { + let params = { + id : vdata.shopInfo.id, + } + for(let item in params){ + params[e.name] = e.value; + } + vdata.type = e.name; + vdata.inputValue = e.value; + updateShopInfo(params,'input') +} + /** * 获取店铺信息 */ @@ -187,7 +190,6 @@ let updateShopInfo = (params,type) => { break; } } - popupRef.value.close() }) } @@ -255,52 +257,6 @@ let extendTabClick = (item,index) => { vdata.extendIndex = index; } - -/** - * 打开修改弹窗 - */ -let updateValue = ( label , type , value) => { - vdata.label = label; - vdata.type = type; - vdata.inputValue = value; - switch ( vdata.type ){ - case "shopName": - vdata.inputType = 'text'; - vdata.maxLength = 999; - break; - case "phone": - vdata.inputType = 'tel'; - vdata.maxLength = 12; - break; - case "tableFee": - vdata.inputType = 'number'; - vdata.maxLength = 12; - break; - } - popupRef.value.open() -} - -/** - * 确认修改 - */ -let confirmFunc = () => { - let params = { - id : vdata.shopInfo.id, - } - switch ( vdata.type ){ - case "shopName": - params.shopName = vdata.inputValue; - break; - case "phone": - params.phone = vdata.inputValue; - break; - case "tableFee": - params.tableFee = vdata.inputValue; - break; - } - updateShopInfo(params,'input'); -} - /** * 是否免桌位费 */