🐞 fix(ID1001396切换应用后,原先添加的剪样信息不见了):
This commit is contained in:
parent
0cc1c7f79b
commit
672181da64
@ -1,5 +1,5 @@
|
|||||||
import { Text, View } from '@tarojs/components'
|
import { Text, View } from '@tarojs/components'
|
||||||
import Taro, { getCurrentPages, useDidShow } from '@tarojs/taro'
|
import Taro, { getCurrentPages, useDidShow, useUnload } from '@tarojs/taro'
|
||||||
import { useCallback, useMemo, useRef, useState } from 'react'
|
import { useCallback, useMemo, useRef, useState } from 'react'
|
||||||
import styles from './index.module.scss'
|
import styles from './index.module.scss'
|
||||||
import type { AddressItem } from './components/address'
|
import type { AddressItem } from './components/address'
|
||||||
@ -76,7 +76,9 @@ export default () => {
|
|||||||
getAddressDefault()
|
getAddressDefault()
|
||||||
}
|
}
|
||||||
setRemarkData(info.remark)
|
setRemarkData(info.remark)
|
||||||
|
})
|
||||||
|
|
||||||
|
useUnload(() => {
|
||||||
Taro.removeStorageSync('cutSample')
|
Taro.removeStorageSync('cutSample')
|
||||||
Taro.removeStorageSync('cutSampleOther')
|
Taro.removeStorageSync('cutSampleOther')
|
||||||
})
|
})
|
||||||
@ -188,12 +190,14 @@ export default () => {
|
|||||||
const res = await addressListFetchData()
|
const res = await addressListFetchData()
|
||||||
let defaultInfo: AddressItem|null = null
|
let defaultInfo: AddressItem|null = null
|
||||||
res?.data.list?.map((item) => {
|
res?.data.list?.map((item) => {
|
||||||
|
if (item.is_default) {
|
||||||
defaultInfo = {
|
defaultInfo = {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
address_title: item.province_name + item.city_name + item.district_name + item.address_detail,
|
address_title: item.province_name + item.city_name + item.district_name + item.address_detail,
|
||||||
address_name: item.name,
|
address_name: item.name,
|
||||||
address_phone: item.phone,
|
address_phone: item.phone,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
submitData.current.address_id = defaultInfo!.id || 0
|
submitData.current.address_id = defaultInfo!.id || 0
|
||||||
setAddressInfo(defaultInfo!)
|
setAddressInfo(defaultInfo!)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user