地址bug修复

This commit is contained in:
@fawn-nine
2023-11-14 14:21:11 +08:00
parent 3b57f0aeb0
commit 1172043635

View File

@@ -19,7 +19,7 @@
<u-form-item label="所在地区 :" prop="">
<view class="add_arrow" @click="addreShow=true">{{addressForm.areaidpathtext}}</view>
<u-picker @cancel="addcancel" :show="addreShow" ref="uPicker" :columns="columns" keyName="UName" -->
<u-picker @cancel="addcancel" :show="addreShow" ref="uPicker" :columns="columns" keyName="UName"
@confirm="addconfirm" @change="changeHandler" ></u-picker>
</u-form-item>
<u-form-item label="详细地址 :" prop="useraddress">
@@ -50,6 +50,7 @@
</template>
<script>
import musicPlay from '@/components/music.vue'
import $http from '@/config/requestConfig.js';
import addressList1 from "@/static/json/address.json"
@@ -90,51 +91,6 @@
isShowDel: false,
editIndex: 0,
deleteShow: false,
list: [{
value: 1,
label: '中国',
children: [{
value: 2,
label: '广东',
children: [{
value: 3,
label: '深圳'
},
{
value: 4,
label: '广州'
}
]
},
{
value: 5,
label: '广西',
children: [{
value: 6,
label: '南宁'
},
{
value: 7,
label: '桂林'
}
]
}
]
},
{
value: 8,
label: '美国',
children: [{
value: 9,
label: '纽约',
children: [{
value: 10,
label: '皇后街区'
}]
}]
}
],
rules: {
username: [{
required: true,
@@ -297,7 +253,7 @@
},
changeHandler(e) { //城市选择时触发
console.log(e, '变化了', this.columnData, this.columnDatas)
// console.log(e,'变化了',this.columnData, this.columnDatas)
this.addressChanged = true
const {
columnIndex, //当前选择的列,省 / 市 / 区
@@ -322,7 +278,7 @@
},
addconfirm(e) { //点击确定按钮
console.log(e, '选中的值')
// console.log(e,'选中的值')
this.addressChanged = true
this.addreShow = false;
this.addressForm.areaidpathtext = e.value[0].UName + '-' + e.value[1].UName + '-' + e.value[2].UName
@@ -424,9 +380,8 @@
'username':res.list[this.editIndex].consigneeName,
'isdefault':res.list[this.editIndex].isDefault,
'isDafault':res.list[this.editIndex].isDefault == 1 ? true : false,
'areaidpathtext': res.list[this.editIndex].province + '-' + res.list[this
.editIndex].city + '-' + res.list[this.editIndex].county,
'addressid': res.list[this.editIndex].id
'areaidpathtext':res.list[this.editIndex].province +'-'+ res.list[this.editIndex].city +'-'+ res.list[this.editIndex].county
,'addressid':res.list[this.editIndex].id
}
this.countyId = res.list[this.editIndex].regionCode
// this.addressForm = res.list[this.editIndex]
@@ -461,19 +416,10 @@
</script>
<style lang="scss" scoped>
.flexbox {
display: flex;
.flexbox{display: flex;}
.selectAdd{ justify-content: space-between;
.addItem{ display: block;width: 30%}
}
.selectAdd {
justify-content: space-between;
.addItem {
display: block;
width: 30%
}
}
.add_arrow {
height: 28px;
line-height: 28px;