完善下单逻辑及其ui展示,修复支付倒计时显示错误bug
This commit is contained in:
@@ -48,6 +48,9 @@ type Address = {
|
||||
detail: string
|
||||
isDefault: boolean
|
||||
label?: string
|
||||
latitude?: number
|
||||
longitude?: number
|
||||
coordinateType?: string
|
||||
}
|
||||
|
||||
const addresses = ref<Address[]>([])
|
||||
@@ -71,7 +74,10 @@ const loadAddresses = async () => {
|
||||
district: item.district,
|
||||
detail: item.detail_address,
|
||||
isDefault: item.is_default,
|
||||
label: ''
|
||||
label: '',
|
||||
latitude: item.latitude ?? 0,
|
||||
longitude: item.longitude ?? 0,
|
||||
coordinateType: item.coordinate_type ?? 'gcj02'
|
||||
} as Address
|
||||
transformedAddresses.push(addr)
|
||||
}
|
||||
@@ -99,8 +105,8 @@ const loadAddresses = async () => {
|
||||
|
||||
onLoad((options) => {
|
||||
if (options == null) return
|
||||
const optionsObj = options as UTSJSONObject
|
||||
if ((optionsObj.getString('selectMode') ?? '') == 'true') {
|
||||
const selectMode = options['selectMode']
|
||||
if (selectMode != null && String(selectMode) == 'true') {
|
||||
selectionMode.value = true
|
||||
}
|
||||
})
|
||||
@@ -166,12 +172,23 @@ const selectAddress = (item: Address) => {
|
||||
if (selectionMode.value) {
|
||||
uni.$emit('addressSelected', {
|
||||
id: item.id,
|
||||
addressId: item.id,
|
||||
userId: '',
|
||||
recipient_name: item.name,
|
||||
contactName: item.name,
|
||||
phone: item.phone,
|
||||
contactPhone: item.phone,
|
||||
province: item.province,
|
||||
city: item.city,
|
||||
district: item.district,
|
||||
detail: item.detail,
|
||||
addressDetail: item.detail,
|
||||
houseNumber: item.detail,
|
||||
fullAddress: getFullAddress(item),
|
||||
remark: item.label ?? '',
|
||||
latitude: item.latitude ?? 0,
|
||||
longitude: item.longitude ?? 0,
|
||||
coordinateType: item.coordinateType ?? 'gcj02',
|
||||
is_default: item.isDefault
|
||||
})
|
||||
uni.navigateBack()
|
||||
|
||||
Reference in New Issue
Block a user