|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<view>
|
|
<view>
|
|
- <picker :class="disabled?'pickerClass':''" ref='picker' @change="bindPickerChange" :value="multiIndex" :range="multiArray" range-key='label'
|
|
|
|
- mode="multiSelector" @columnchange='columnchange'>
|
|
|
|
|
|
+ <picker :class="disabled?'pickerClass':''" ref='picker' @change="bindPickerChange" :value="multiIndex"
|
|
|
|
+ :range="multiArray" range-key='label' mode="multiSelector" @columnchange='columnchange'>
|
|
<view class="text" :style="textStyleEmpty" v-if="place=='选择地区'">
|
|
<view class="text" :style="textStyleEmpty" v-if="place=='选择地区'">
|
|
{{place}}
|
|
{{place}}
|
|
</view>
|
|
</view>
|
|
@@ -37,13 +37,13 @@
|
|
textStyle: {
|
|
textStyle: {
|
|
type: Object,
|
|
type: Object,
|
|
},
|
|
},
|
|
- disabled:{
|
|
|
|
|
|
+ disabled: {
|
|
value: Boolean,
|
|
value: Boolean,
|
|
default: false
|
|
default: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
-
|
|
|
|
|
|
+
|
|
// searchPlace(oldValue, newValue) {
|
|
// searchPlace(oldValue, newValue) {
|
|
// console.log(123)
|
|
// console.log(123)
|
|
// console.log(oldValue, newValue)
|
|
// console.log(oldValue, newValue)
|
|
@@ -61,6 +61,7 @@
|
|
"font-size": '32rpx'
|
|
"font-size": '32rpx'
|
|
},
|
|
},
|
|
multiIndex: [0, 0, 0],
|
|
multiIndex: [0, 0, 0],
|
|
|
|
+ addressCopy: null,
|
|
multiArray: [
|
|
multiArray: [
|
|
[],
|
|
[],
|
|
[],
|
|
[],
|
|
@@ -72,20 +73,28 @@
|
|
console.log(this.disabled)
|
|
console.log(this.disabled)
|
|
this.place = this.searchPlace
|
|
this.place = this.searchPlace
|
|
console.log("this.series", this.series)
|
|
console.log("this.series", this.series)
|
|
- for (let i = 0; i < address.length; i++) {
|
|
|
|
- this.multiArray[0].push(address[i])
|
|
|
|
|
|
+ if (this.series == 3) {
|
|
|
|
+ this.addressCopy = JSON.parse(JSON.stringify(address))
|
|
|
|
+ this.addressCopy.shift()
|
|
|
|
+ } else {
|
|
|
|
+ this.addressCopy = JSON.parse(JSON.stringify(address))
|
|
|
|
+ }
|
|
|
|
+ console.log("this.addressCopy", this.addressCopy)
|
|
|
|
+ for (let i = 0; i < this.addressCopy.length; i++) {
|
|
|
|
+ this.multiArray[0].push(this.addressCopy[i])
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ this.multiArray[1] = this.addressCopy[0].child
|
|
// this.$emit('selectAddress', '')
|
|
// this.$emit('selectAddress', '')
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
columnchange(e) {
|
|
columnchange(e) {
|
|
console.log('picker发送选择改变', e.detail)
|
|
console.log('picker发送选择改变', e.detail)
|
|
- this.multiIndex[e.detail.column] =e.detail.value
|
|
|
|
|
|
+ this.multiIndex[e.detail.column] = e.detail.value
|
|
console.log("this.multiIndex", this.multiIndex)
|
|
console.log("this.multiIndex", this.multiIndex)
|
|
switch (e.detail.column) {
|
|
switch (e.detail.column) {
|
|
case 0: //拖动第1列
|
|
case 0: //拖动第1列
|
|
- this.multiArray[1] = address[e.detail.value].child
|
|
|
|
|
|
+ this.multiArray[1] = this.addressCopy[e.detail.value].child
|
|
this.multiArray[2] = this.multiArray[1][0].child
|
|
this.multiArray[2] = this.multiArray[1][0].child
|
|
console.log(this.multiArray[1])
|
|
console.log(this.multiArray[1])
|
|
this.multiIndex.splice(1, 1, 0)
|
|
this.multiIndex.splice(1, 1, 0)
|
|
@@ -149,7 +158,7 @@
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
- .text{
|
|
|
|
- display:inline-block;
|
|
|
|
|
|
+ .text {
|
|
|
|
+ display: inline-block;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|