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