Commit 8cca5b82 by linjinhong

fix:修改物流方式Tik Tok模式

parent fe99190c
...@@ -82,12 +82,14 @@ export default defineComponent({ ...@@ -82,12 +82,14 @@ export default defineComponent({
const selectedList = ref<(string | number)[]>([]) const selectedList = ref<(string | number)[]>([])
const selectedRadioList = ref<string | number>() const selectedRadioList = ref<string | number>()
const waysName = ref('') const waysName = ref('')
const selectedRadioName = ref('')
watch( watch(
() => props.modelValue, () => props.modelValue,
(newVal) => { (newVal) => {
if (props.isRadio) { if (props.isRadio) {
selectedRadioList.value = newVal as string | number selectedRadioList.value = newVal as string | number
console.log('waysName', waysName.value)
} else { } else {
selectedList.value = newVal as (string | number)[] selectedList.value = newVal as (string | number)[]
} }
...@@ -109,7 +111,12 @@ export default defineComponent({ ...@@ -109,7 +111,12 @@ export default defineComponent({
if (props.isRadio) { if (props.isRadio) {
emit('update:modelValue', newVal[2]) emit('update:modelValue', newVal[2])
companyList.value = newVal[1] as ICompanyList[] companyList.value = newVal[1] as ICompanyList[]
waysName.value = selectedRadioName.value const allWayLists: IwayList[] = props.companyList.flatMap(
(company) => company.wayList,
) as IwayList[]
waysName.value =
allWayLists.find((el: IwayList) => newVal[2] === el.id)?.name || ''
} else { } else {
emit('update:modelValue', newVal[0]) emit('update:modelValue', newVal[0])
allList.value = newVal[1] as IAllList[] allList.value = newVal[1] as IAllList[]
...@@ -221,9 +228,6 @@ export default defineComponent({ ...@@ -221,9 +228,6 @@ export default defineComponent({
onUpdate:modelValue={(value) => { onUpdate:modelValue={(value) => {
console.log('company', value) console.log('company', value)
selectedRadioList.value = value as string | number selectedRadioList.value = value as string | number
selectedRadioName.value = company.wayList.find(
(el) => el.id === value,
)?.name as string
}} }}
style={styles.checkboxGroup} style={styles.checkboxGroup}
> >
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment