From efe30f87cc433f97b574f018bdbea3b6def13605 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Fri, 26 Apr 2024 14:49:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E6=88=91=E7=9A=84?= =?UTF-8?q?=E9=82=80=E8=AF=B7=20-=20=E6=94=AF=E6=8C=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=97=A8=E5=BA=97=E7=BB=91=E5=AE=9A=E7=9A=84=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E8=82=A1=E4=B8=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/agent.js | 4 + pages/agent/invite/my_invite.vue | 346 ++++++++++++++++++++++++++----- 2 files changed, 294 insertions(+), 56 deletions(-) diff --git a/api/agent.js b/api/agent.js index 2cd8c33..4afc6b4 100644 --- a/api/agent.js +++ b/api/agent.js @@ -12,6 +12,10 @@ export function inviteSupplierJoinQrCode(data) { export function getMyInvite(data) { return request.get(`agent/my_invite`, data); } +// 代理中心 - 修改资源股东 +export function updateShareholders(data) { + return request.post(`agent/update_shareholders`, data); +} // 代理加入 - 提交申请信息 export function submitAgentApplyInfo(data) { return request.post('agent/agent_apply',data); diff --git a/pages/agent/invite/my_invite.vue b/pages/agent/invite/my_invite.vue index cedc413..d0a4bd8 100644 --- a/pages/agent/invite/my_invite.vue +++ b/pages/agent/invite/my_invite.vue @@ -18,17 +18,25 @@ @@ -36,6 +44,45 @@ + + + + 编辑资源股东 + + + 当前绑定资源股东: + + 暂无资源股东 + + + 新资源股东: + + + + + + 取消编辑 + 提交修改 + + + + @@ -44,7 +91,8 @@ import {mapGetters} from "vuex"; import authorize from '@/components/Authorize'; import { HTTP_REQUEST_URL } from '@/config/app.js'; import emptyPage from '@/components/emptyPage.vue' -import {getMyInvite} from "@/api/agent"; +import { getMyInvite, updateShareholders } from "@/api/agent"; +import { searchUser } from "@/api/user"; export default { name: 'business', @@ -67,8 +115,28 @@ export default { agent_id: 0, list: [], page: 1, + // 资源股东相关 + mer_info: {}, + old_shareholders: {}, + new_shareholders: {}, + shareholders_search: '', } }, + watch: { + 'shareholders_search':{ + handler(val) { + let _this = this; + if(Number(val) > 0){ + searchUser({ id_and_phone: _this.shareholders_search }).then(res => { + _this.new_shareholders = Object.assign({}, res.data); + }).catch(err => {}); + }else{ + _this.new_shareholders = {}; + } + }, + deep: false + }, + }, onLoad(options) { let _this = this; _this.agent_id = options.agent_id || 0; @@ -127,8 +195,56 @@ export default { this.page = 1; this.list = []; this.getList(); - } - + }, + // 资源股东 - 显示修改弹框 + shareholdersShow(item){ + this.shareholders_search = ''; + this.mer_info = Object.assign({}, item); + this.old_shareholders = Object.assign({}, item.shareholders || {}); + this.new_shareholders = {}; + this.$refs.shareholdersEditPopup.open('center'); + }, + // 资源股东 - 隐藏修改弹框 + shareholdersHide(){ + this.$refs.shareholdersEditPopup.close(); + }, + // 资源股东 - 提交编辑 + shareholdersUpdate(){ + let _this = this; + let oldShareholders = Object.assign({}, _this.old_shareholders); + let oldUid = oldShareholders.uid || 0; + let newShareholders = Object.assign({}, _this.new_shareholders); + let newUid = newShareholders.uid || 0; + // 判断:提示语句 无旧股东,无新股东-请选择股东;有旧股东,无新股东-是否清除股东;有旧股东,有新股东-是否修改股东 + let tips = '确认设置当前用户为资源股东?'; + if(Number(oldUid) <= 0 && Number(newUid) <= 0) { + this.$util.Tips({title: '请查询选择一个用户!'}); + return false; + } + else if(Number(oldUid) > 0 && Number(newUid) <= 0) { + tips = '确认清除当前门店的资源股东吗?'; + } + else if(Number(oldUid) > 0 && Number(newUid) > 0) { + tips = '确认修改当前门店的资源股东吗?'; + } + // 询问 + uni.showModal({ + title: '提示', + content: tips, + confirmText: '提交', + cancelText: '取消', + success(res) { + if (res.confirm) { + updateShareholders({ resource_shareholders_uid: newUid, mer_id: _this.mer_info.mer_id }).then(res => { + _this.page = 1; + _this.list = []; + _this.getList(); + _this.shareholdersHide(); + }).catch(err => {}); + } + } + }); + }, }, @@ -205,59 +321,177 @@ export default { ._list{ .item-box{ width: 100%; - padding: 20rpx; background: #ffffff; border-radius: 20rpx; margin-bottom: 25rpx; - display: inline-flex; - flex-direction: row; - flex-wrap: nowrap; - align-items: center; - justify-content: space-between; - .left{ - width: calc(100% - 60rpx); - .name{ - font-weight: bold; - font-size: 30rpx; - width: 100%; - height: 50rpx; - line-height: 50rpx; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - .left-info{ - display: inline-flex; - flex-direction: row; - flex-wrap: nowrap; - align-items: center; - justify-content: flex-start; - margin-top: 10rpx; - .mer-logo{ - height: calc(45rpx * 2) !important; - width: calc(45rpx * 2) !important; - border-radius: 10rpx!important; - } - .contacts{ - width: calc(100% - calc(45rpx * 2)); - padding-left: 15rpx; - .contacts-line{ - height: 45rpx; - line-height: 45rpx; - font-size: 28rpx; - color: #949494; - } - } - } - } - .right-icon{ - width: 60rpx; + .item-content{ + width: 100%; + padding: 20rpx; display: inline-flex; flex-direction: row; flex-wrap: nowrap; align-items: center; - justify-content: flex-end; + justify-content: space-between; + .left{ + width: calc(100% - 60rpx); + .name{ + font-weight: bold; + font-size: 30rpx; + width: 100%; + height: 50rpx; + line-height: 50rpx; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + .left-info{ + display: inline-flex; + flex-direction: row; + flex-wrap: nowrap; + align-items: center; + justify-content: flex-start; + margin-top: 10rpx; + .mer-logo{ + height: calc(45rpx * 2) !important; + width: calc(45rpx * 2) !important; + border-radius: 10rpx!important; + } + .contacts{ + width: calc(100% - calc(45rpx * 2)); + padding-left: 15rpx; + .contacts-line{ + height: 45rpx; + line-height: 45rpx; + font-size: 28rpx; + color: #949494; + } + } + } + } + .right-icon{ + width: 60rpx; + display: inline-flex; + flex-direction: row; + flex-wrap: nowrap; + align-items: center; + justify-content: flex-end; + } } + .group-btn{ + width: 100%; + padding: 20rpx; + display: inline-flex; + flex-wrap: nowrap; + justify-content: flex-end; + align-items: center; + flex-direction: row; + border-top: 2rpx solid #f6f6f6; + .update-btn{ + height: 50rpx; + line-height: 50rpx; + width: 150rpx; + text-align: center; + font-size: 30rpx; + color: #fff; + background-color: #409eff; + border-color: #409eff; + border-radius: 50rpx; + } + } + } + } + } + // 资源股东编辑弹框 + .shareholders-content{ + background-color: #ffffff; + border-radius: 20rpx; + width: 85vw; + padding: 30rpx; + + .title{ + width: 100%; + text-align: center; + font-size: 28rpx; + height: 50rpx; + line-height: 35rpx; + } + .list{ + + .item{ + border-bottom: 2rpx solid #f6f6f6; + padding-bottom: 30rpx; + + .item-title{ + width: 100%; + height: 50rpx; + line-height: 50rpx; + font-size: 28rpx; + } + .shareholders_search{} + .user-info { + width: 100%; + margin-top: 20rpx; + display: inline-flex; + flex-direction: row; + flex-wrap: nowrap; + align-items: center; + justify-content: flex-start; + .left { + width: 100rpx; + text-align: left; + + .left-image { + width: 90rpx; + height: 90rpx; + border-radius: 50%; + } + } + .right { + width: calc(100% - 100rpx); + + .nickname { + width: 100%; + font-size: 30rpx; + font-weight: bold; + } + + .uid { + width: 100%; + } + } + } + .empty{ + height: 100rpx; + line-height: 100rpx; + text-align: center; + } + } + } + .group-btn{ + width: 100%; + display: inline-flex; + flex-direction: row; + flex-wrap: nowrap; + align-items: center; + justify-content: space-around; + padding-top: 30rpx; + .popup-btn{ + width: 180rpx; + height: 60rpx; + line-height: 55rpx; + text-align: center; + border-radius: 100rpx; + font-size: 28rpx; + } + .submit-btn{ + color: #fff; + background-color: #409eff; + border: 2rpx solid #409eff; + } + .close-btn{ + color: #606266; + background: #fff; + border: 2rpx solid #606266; } } }