需求变更

This commit is contained in:
yanran200730
2022-11-11 08:36:42 +08:00
parent e08d795e53
commit 8b1197fe54
7 changed files with 140 additions and 67 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div class="merchants">
<div class="top">
<image :src="user.merchantInfo.photoUrl || 'https://cdn.cunwuyun.cn/wxmp/tianfuxing/avatar.png'" />
<image :src="user.merchantInfo.logoFiles && user.merchantInfo.logoFiles[0].url" />
<div class="right">
<h2>{{ user.merchantInfo.merchantName }}</h2>
<p>{{ user.merchantInfo.address }}</p>

View File

@@ -22,20 +22,11 @@
<input placeholder="请输入手机号" type="number" maxlength="11" v-model="userInfo.phone" />
</div>
</div>
<div class="form-item">
<h2>所在社区</h2>
<picker :range="sqList" range-key="dictName" @change="e => (userInfo.sssq = sqList[e.detail.value].dictName)">
<div class="form-item__right">
<span :style="{color: userInfo.sssq ? '#333' : '#999'}">{{ userInfo.sssq ? userInfo.sssq : '请输入所在社区' }}</span>
<image class="right" src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/ContentRightArrow@2x.png" />
</div>
</picker>
</div>
<div class="form-item">
<h2>所在小区</h2>
<picker :range="xqList" range-key="dictName" @change="e => (userInfo.szxq = xqList[e.detail.value].dictName)">
<picker :range="list" mode="multiSelector" @columnchange="columnchange" @change="onChange">
<div class="form-item__right">
<span :style="{color: userInfo.szxq ? '#333' : '#999'}">{{ userInfo.szxq ? userInfo.szxq : '请输入所在小区' }}</span>
<span :style="{color: userInfo.sssq ? '#333' : '#999'}">{{ userInfo.sssq ? userInfo.sssq + '-' + userInfo.szxq : '请输入所在小区' }}</span>
<image class="right" src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/ContentRightArrow@2x.png" />
</div>
</picker>
@@ -57,7 +48,12 @@
return {
sqList: [],
xqList: [],
userInfo: {}
userInfo: {},
list: [
[], []
],
communityList: [],
currIndex: 0
}
},
@@ -73,9 +69,38 @@
this.sqList = this.$dict.getDict('tfx_sssq')
this.xqList = this.$dict.getDict('tfx_szxq')
})
this.getInfo()
},
methods: {
getInfo () {
this.$instance.post('/api/publicDictionaryClassification/tree?type=0', null, {
withoutToken: true
}).then(res => {
if (res.code === 0) {
const villageList = res.data.map(v => v.name)
this.communityList = res.data.map(v => {
return v.children.map(v => v.name)
})
this.list[0] = villageList
this.list[1] = this.communityList[0]
}
})
},
onChange (e) {
this.$set(this.userInfo, 'sssq', this.list[0][e.detail.value[0]])
this.$set(this.userInfo, 'szxq', this.list[1][e.detail.value[1]])
},
columnchange (e) {
if (e.detail.column === 0) {
this.$set(this.list, '1', this.communityList[e.detail.value])
}
},
save () {
if (!this.userInfo.avatarUrl) {
return this.$toast('请上传头像')
@@ -237,12 +262,16 @@
input {
width: 500rpx;
text-align: right;
font-size: 30rpx;
font-size: 30px;
}
span {
max-width: 400px;
color: #4e4e4e;
font-size: 30rpx;
font-size: 30px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap
}
.right {