暂存c端账号管理和商户信息
This commit is contained in:
@@ -36,7 +36,7 @@ Component({
|
||||
*/
|
||||
methods: {
|
||||
async onSubmit() {
|
||||
const { data = {}, tenement, park, editType } = this.data;
|
||||
const { data = {}, tenement, park, type } = this.data;
|
||||
if (!data.phone) {
|
||||
alertInfo("请输入手机号")
|
||||
return
|
||||
@@ -45,17 +45,16 @@ Component({
|
||||
alertInfo("请输入昵称")
|
||||
return
|
||||
}
|
||||
if (editType === 'add') {
|
||||
const { code, message } = await createTenementWxUser({ ...data, tenement, park })
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
this.triggerEvent("cancel")
|
||||
return;
|
||||
}
|
||||
alertSuccess("操作成功")
|
||||
this.triggerEvent("ok")
|
||||
const { code, message } = await createTenementWxUser({ ...data, tenement, park })
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
this.triggerEvent("cancel")
|
||||
return;
|
||||
}
|
||||
alertSuccess("操作成功")
|
||||
this.triggerEvent("ok")
|
||||
return;
|
||||
|
||||
|
||||
},
|
||||
onChange(e) {
|
||||
|
@@ -0,0 +1,62 @@
|
||||
// pages/workBench/components/account/components/updatePhoneModa/index.js
|
||||
import { alertInfo, alertSuccess } from "../../../../../../utils/index";
|
||||
import { updateAdminPhone } from "../../../../../../service/tenement";
|
||||
import request from "../../../../../../utils/request"
|
||||
const { OK } = request
|
||||
Component({
|
||||
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
type: String,
|
||||
title: String,
|
||||
visible: Boolean,
|
||||
onCancel: Function,
|
||||
park: String,
|
||||
tenement: String,
|
||||
parentPhone:String,
|
||||
parentName:String,
|
||||
parentId:String,
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
phone: "",
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
async onSubmit() {
|
||||
const { phone, tenement, park, type } = this.data;
|
||||
if (!phone) {
|
||||
alertInfo("请输入手机号")
|
||||
return
|
||||
}
|
||||
const { code, message } = await updateAdminPhone({tenement, phone: phone })
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
this.triggerEvent("cancel")
|
||||
return;
|
||||
}
|
||||
alertSuccess("操作成功")
|
||||
this.triggerEvent("ok")
|
||||
return;
|
||||
|
||||
|
||||
},
|
||||
onChange(e) {
|
||||
|
||||
this.setData({
|
||||
phone: e.detail,
|
||||
})
|
||||
},
|
||||
onCancel() {
|
||||
this.triggerEvent("cancel")
|
||||
}
|
||||
}
|
||||
})
|
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-dialog": "@vant/weapp/dialog/index",
|
||||
"search-select": "/components/searchSelect/index",
|
||||
"van-field": "@vant/weapp/field/index"
|
||||
}
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
<!--pages/workBench/components/account/components/updatePhoneModa/index.wxml-->
|
||||
<van-dialog
|
||||
use-slot
|
||||
title="编辑管理员手机号"
|
||||
show="{{ visible }}"
|
||||
show-cancel-button
|
||||
bind:confirm="onSubmit"
|
||||
bind:cancel="onCancel"
|
||||
>
|
||||
<view class="modalContentWrapper">
|
||||
<van-field
|
||||
value="{{ phone }}"
|
||||
placeholder="请输入新管理员手机号"
|
||||
label="手机号"
|
||||
border="{{ false }}"
|
||||
title-width="120rpx"
|
||||
data-name="phone"
|
||||
bind:change="onChange"
|
||||
>
|
||||
</van-field>
|
||||
</view>
|
||||
|
||||
</van-dialog>
|
@@ -0,0 +1 @@
|
||||
/* pages/workBench/components/account/components/updatePhoneModa/index.wxss */
|
@@ -102,6 +102,9 @@ Component({
|
||||
this.initUserList()
|
||||
this.handleCancel();
|
||||
},
|
||||
onUpdatePhoneConfirm() {
|
||||
that.getTenementInfo();
|
||||
},
|
||||
async getTenementInfo() {
|
||||
const { tenement, park } = this.data;
|
||||
const { code, message, tenement: data } = await getTenementBackInfo(park, tenement)
|
||||
@@ -132,20 +135,29 @@ Component({
|
||||
})
|
||||
},
|
||||
handleChangeMain() {
|
||||
const { list = [] } = this.data;
|
||||
const main = list?.find(item => item.Permissions)
|
||||
if (!main) {
|
||||
alertInfo("没有主账号")
|
||||
return
|
||||
}
|
||||
console.log("main", main)
|
||||
// const { list = [] } = this.data;
|
||||
// const main = list?.find(item => item.Permissions)
|
||||
// if (!main) {
|
||||
// alertInfo("没有主账号")
|
||||
// return
|
||||
// }
|
||||
// console.log("main", main)
|
||||
this.setData({
|
||||
visible: true,
|
||||
updatePhoneVisible: true,
|
||||
type: "update",
|
||||
title: "编辑管理员",
|
||||
phone: main.WechatPhone,
|
||||
name: main.WechatUserName,
|
||||
id: main.WechatUserID,
|
||||
// phone: main.WechatPhone,
|
||||
// name: main.WechatUserName,
|
||||
// id: main.WechatUserID,
|
||||
})
|
||||
},
|
||||
handleUpdatePhoneCancel() {
|
||||
this.setData({
|
||||
updatePhoneVisible: false,
|
||||
type: "",
|
||||
phone: "",
|
||||
name: "",
|
||||
id: "",
|
||||
})
|
||||
},
|
||||
handleCancel() {
|
||||
|
@@ -11,6 +11,7 @@
|
||||
"van-radio": "@vant/weapp/radio/index",
|
||||
"van-radio-group": "@vant/weapp/radio-group/index",
|
||||
"van-tag": "@vant/weapp/tag/index",
|
||||
"edit-modal": "./components/editModal/index"
|
||||
"edit-modal": "./components/editModal/index",
|
||||
"updatePhoneModal": "./components/updatePhoneModal/index"
|
||||
}
|
||||
}
|
@@ -83,7 +83,6 @@
|
||||
|
||||
</view>
|
||||
<empty wx:else bind:refresh="initUserList" />
|
||||
{{phone}} {{name}}
|
||||
</view>
|
||||
<search-select
|
||||
show="{{show}}"
|
||||
@@ -105,4 +104,12 @@
|
||||
parentId="{{id}}"
|
||||
bind:ok="onEditConfirm"
|
||||
bind:cancel="handleCancel"
|
||||
/>
|
||||
/>
|
||||
<updatePhoneModal
|
||||
visible="{{updatePhoneVisible}}"
|
||||
tenement="{{tenement}}"
|
||||
park="{{park}}"
|
||||
bind:ok="onUpdatePhoneConfirm"
|
||||
bind:cancel="handleUpdatePhoneCancel"
|
||||
/>
|
||||
{{updatePhoneVisible}}
|
Reference in New Issue
Block a user