master
王文杰 7 months ago
parent f27697a1ca
commit c75e31ddc9

@ -108,7 +108,7 @@ const getMemberAddressData = async () => {
const index = res.data.findIndex((e) => e.isDefault)
const defaultAddress = res.data[index]
recycleAddress.value = defaultAddress.receiveStreet
clientAddressId.value = defaultAddress.clientId
clientAddressId.value = defaultAddress.id
location = Object.assign(location, {
longitude: defaultAddress.location.longitude,
latitude: defaultAddress.location.latitude,
@ -193,7 +193,7 @@ const handlePopClose = (item) => {
if (popupName.value == 'address') {
console.log(item)
recycleAddress.value = item?.receiveStreet
clientAddressId.value = item?.clientId
clientAddressId.value = item?.id
location = Object.assign(location, {
longitude: item.location.longitude,
latitude: item.location.latitude,

@ -57,7 +57,9 @@ onShow(async () => {
})
const init = async () => {
isLoading.value = true
await Promise.all([getHomeCategory(), getHomeSite()])
await getHomeCategory()
await getHomeSite()
// await Promise.all([getHomeCategory(), getHomeSite()])
isLoading.value = false
}
@ -66,8 +68,9 @@ const getHomeCategory = async () => {
const res = await getHomeCategoryAPI(params)
if (res.code == 200) {
res.data.forEach((e) => {
const arr = JSON.parse(e.photo)
const imgUrl = fileDomain + arr[0].url
const arr = e.photo && JSON.parse(e.photo) || []
const obj2 = arr[0]
const imgUrl = fileDomain + obj2?.url
e.imgUrl = imgUrl
})
categoryList.value = res.data
@ -80,12 +83,15 @@ const getHomeSite = async () => {
...location,
}
const res = await getNearbySiteAPI(params)
if (res.code == 200) {
if (res.data) {
const obj = res.data
const arr = JSON.parse(obj.stationImg)
const imgUrl = fileDomain + arr[0].url
const obj2 = arr[0]
const imgUrl = fileDomain + obj2?.url
obj.imgUrl = imgUrl
siteList = [obj]
} else {
uni.showToast({ icon: 'none', title: '当前位置附近没有回收站点...' })
}
}
// -
@ -236,5 +242,4 @@ page {
}
}
}
</style>import type { debug } from 'console'
</style>

@ -50,8 +50,7 @@ const getMemberOrderData = async () => {
const start = e.appointmentTimeStart.slice(11, 16)
const end = e.appointmentTimeEnd.slice(11, 16)
e.appointmentTime = str + ' ' + start + '-' + end
e.orderDetails.forEach((q) => {
e.orderDetails && e.orderDetails.forEach((q) => {
const arr = JSON.parse(q.product.photo)
const imgUrl = fileDomain + arr[0].url
q.imgUrl = imgUrl

@ -40,6 +40,12 @@ const getDataList = async () => {
const res = await postListSiteAPI(queryParams)
//
isLoading.value = false
if (!res.data.list.length && queryParams.pageNo == 1) {
uni.showToast({
icon: 'none',
title: '附近没有站点',
})
}
res.data.list.forEach((e) => {
// e.distance = e.distance / 1000 + 'Km'
const arr = JSON.parse(e.stationImg)

Loading…
Cancel
Save