🐞 fix(ID1001368领取色卡页面没自动显示默认的地址):
This commit is contained in:
parent
2917f201ec
commit
2b57dd145f
@ -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'
|
||||||
@ -48,7 +48,9 @@ export default () => {
|
|||||||
getAddressDefault()
|
getAddressDefault()
|
||||||
}
|
}
|
||||||
setRemarkData(info.remark)
|
setRemarkData(info.remark)
|
||||||
|
})
|
||||||
|
|
||||||
|
useUnload(() => {
|
||||||
Taro.removeStorageSync('colorCard')
|
Taro.removeStorageSync('colorCard')
|
||||||
Taro.removeStorageSync('colorCardOther')
|
Taro.removeStorageSync('colorCardOther')
|
||||||
})
|
})
|
||||||
@ -127,11 +129,13 @@ 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) => {
|
||||||
defaultInfo = {
|
if (item.is_default) {
|
||||||
id: item.id,
|
defaultInfo = {
|
||||||
address_title: item.province_name + item.city_name + item.district_name + item.address_detail,
|
id: item.id,
|
||||||
address_name: item.name,
|
address_title: item.province_name + item.city_name + item.district_name + item.address_detail,
|
||||||
address_phone: item.phone,
|
address_name: item.name,
|
||||||
|
address_phone: item.phone,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
submitData.current.address_id = defaultInfo!.id
|
submitData.current.address_id = defaultInfo!.id
|
||||||
|
|||||||
@ -39,10 +39,11 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
.card_info_label {
|
.card_info_label {
|
||||||
display: grid;
|
display: flex;
|
||||||
grid-template-columns: repeat(3, 100px);
|
flex-wrap: wrap;
|
||||||
grid-gap: 10px 10px;
|
grid-gap: 10px 10px;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
|
width: 330px;
|
||||||
text {
|
text {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
color: #4581ff;
|
color: #4581ff;
|
||||||
@ -51,12 +52,13 @@
|
|||||||
line-height: 34px;
|
line-height: 34px;
|
||||||
background-color: rgba(69, 129, 255, 0.15);
|
background-color: rgba(69, 129, 255, 0.15);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
padding: 5px 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
text {
|
text {
|
||||||
&:nth-child(1) {
|
&:nth-child(1) {
|
||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
flex: 1;
|
// flex: 1;
|
||||||
@include common_ellipsis(2);
|
@include common_ellipsis(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user