diff --git a/src/api/app.js b/src/api/app.js index 613d3f5..c361718 100644 --- a/src/api/app.js +++ b/src/api/app.js @@ -479,6 +479,10 @@ export const editShop = (params) => { return putRequest('/app/shop/edit', params) } +export const changeShopOwnerByMobile = (params) => { + return postRequest('/app/shop/changeOwnerByMobile', params) +} + export const bindShopPrinter = (params) => { return postRequest('/app/shop/bindPrinter', params) } diff --git a/src/views/app/shop/mernage.vue b/src/views/app/shop/mernage.vue index 15006c6..c26daef 100644 --- a/src/views/app/shop/mernage.vue +++ b/src/views/app/shop/mernage.vue @@ -6,6 +6,19 @@
+ + + + + + + + + + + + + @@ -103,7 +116,8 @@ import { addShopTakeway, editShopTakeway, - getByShopId + getByShopId, + changeShopOwnerByMobile } from "@/api/app"; export default { name: "mernage", @@ -138,6 +152,8 @@ submitLoading: false, maxHeight: 510, form: {}, + changeOwnerMobile: "", + changeOwnerLoading: false, takeData: {}, isAdd: true, shopType: [], @@ -201,6 +217,7 @@ if (!data || !data.id) { return; } + this.changeOwnerMobile = ""; this.getRoleList(); getByShopId({ "shopId": data.id @@ -310,6 +327,43 @@ } return periods; }, + changeMerchantAccount() { + const mobile = (this.changeOwnerMobile || "").trim(); + const shopId = this.data && this.data.id ? this.data.id : (this.form.shopId || this.form.id); + const shopName = this.data && this.data.shopName ? this.data.shopName : this.form.shopName; + if (!shopId) { + this.$Message.warning("店铺id不能为空"); + return; + } + if (!/^1\d{10}$/.test(mobile)) { + this.$Message.warning("请输入正确的手机号"); + return; + } + this.$Modal.confirm({ + title: "确认换绑", + content: "确认将店铺 " + (shopName || "") + " 换绑到手机号 " + mobile + " 对应的用户吗?", + loading: true, + onOk: () => { + this.changeOwnerLoading = true; + changeShopOwnerByMobile({ + shopId, + mobile + }).then((res) => { + this.changeOwnerLoading = false; + this.$Modal.remove(); + if (res.success) { + this.$Message.success("换绑成功"); + this.changeOwnerMobile = ""; + this.form.contactPhone = mobile; + this.$emit("on-submit", true); + } + }).catch(() => { + this.changeOwnerLoading = false; + this.$Modal.remove(); + }); + }, + }); + }, getRoleList() { getUsersByRoleName("ROLE_OWNER").then((res) => { if (res.success) { diff --git a/src/views/app/shopArea/shopArea.vue b/src/views/app/shopArea/shopArea.vue index 1d9e617..becef5a 100644 --- a/src/views/app/shopArea/shopArea.vue +++ b/src/views/app/shopArea/shopArea.vue @@ -184,6 +184,18 @@
关闭后社会区域首页和底部栏不展示快递/跑腿入口
+ + + 显示 + 隐藏 + +
关闭后用户端首页不展示跑腿星球入口
+
关闭后社会区域首页和底部栏不展示快递/跑腿入口
+ + + 显示 + 隐藏 + +
关闭后用户端首页不展示跑腿星球入口
+