提交小程序
This commit is contained in:
parent
93136c7295
commit
c230692bda
Binary file not shown.
Before Width: | Height: | Size: 500 KiB |
|
@ -55,8 +55,9 @@
|
|||
v-model:visible="visible"
|
||||
v-model="TreeValue"
|
||||
title="选择地址"
|
||||
:options="TreeData"
|
||||
@change="change"
|
||||
lazy
|
||||
:lazy-load="lazyLoad"
|
||||
text-key="label"
|
||||
></nut-cascader>
|
||||
<nut-popup v-model:visible="show" position="bottom">
|
||||
|
@ -95,18 +96,28 @@ const formData = ref<RegisterParams>({
|
|||
});
|
||||
const show = ref(false)
|
||||
const visible = ref(false)
|
||||
|
||||
const TreeValue = ref<Record<string, any>[]>([])
|
||||
const TreeData = ref(['']);
|
||||
// const TreeData = ref([]);
|
||||
|
||||
const streetCommunitySmallCommunityLabel = ref<string>("");
|
||||
const getAdministrativeDivisionTree = async () => {
|
||||
const resp = await api.get<TreeNodeVo<string>[]>('/common/administrativeDivisionTree')
|
||||
TreeData.value = resp.data as any
|
||||
console.log(resp.data)
|
||||
const getAdministrativeDivisionTree = async (value:string) => {
|
||||
const resp = await api.get<TreeNodeVo<string>[]>('/common/administrativeDivisionByParentCode',{parentCode:value})
|
||||
return resp.data as any
|
||||
}
|
||||
const change = (value: string, pathNodes: Record<string, any>[]) => {
|
||||
|
||||
|
||||
const change = async (value: string, pathNodes: Record<string, any>[]) => {
|
||||
streetCommunitySmallCommunityLabel.value = pathNodes.map((e) => e.text).join(",");
|
||||
TreeValue.value = value as any
|
||||
}
|
||||
const lazyLoad = async (node:any, resolve:any)=>{
|
||||
if (node.root) {
|
||||
await resolve(getAdministrativeDivisionTree ('0'))
|
||||
} else {
|
||||
await resolve(getAdministrativeDivisionTree (node.value))
|
||||
}
|
||||
}
|
||||
const columns = ref([])
|
||||
const unitsList = async () => {
|
||||
if (streetCommunitySmallCommunityLabel.value !== '') {
|
||||
|
@ -126,7 +137,7 @@ const unitsList = async () => {
|
|||
|
||||
|
||||
const selectedLabel = ref('')
|
||||
const confirm = ({selectedOptions, selectedValue}) => {
|
||||
const confirm = ({selectedOptions}) => {
|
||||
Object.keys(selectedOptions).forEach((e) => {
|
||||
selectedLabel.value = selectedOptions[e].label
|
||||
formData.value.unitId = selectedOptions[e].value
|
||||
|
@ -136,7 +147,7 @@ const confirm = ({selectedOptions, selectedValue}) => {
|
|||
}
|
||||
|
||||
// 身份
|
||||
watch(() => formData.value.identity, (value) => {
|
||||
watch(() => formData.value.identity, () => {
|
||||
formData.value.unitId = ''
|
||||
selectedLabel.value = ''
|
||||
})
|
||||
|
@ -165,7 +176,7 @@ const register = async () => {
|
|||
await Taro.setStorage({
|
||||
key: "token",
|
||||
data: resp.data,
|
||||
success(res) {
|
||||
success() {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
|
@ -209,10 +220,10 @@ const onChooseAvatar = (e) => {
|
|||
formData.value.avatar = avatarUrl
|
||||
}
|
||||
// 获取昵称
|
||||
const getNickname = (e) => {
|
||||
formData.value.name = e.detail.value
|
||||
console.log(formData.value.name)
|
||||
}
|
||||
// const getNickname = (e) => {
|
||||
// formData.value.name = e.detail.value
|
||||
// console.log(formData.value.name)
|
||||
// }
|
||||
|
||||
onMounted(async () => {
|
||||
await getAdministrativeDivisionTree()
|
||||
|
|
Loading…
Reference in New Issue