|
@@ -14,16 +14,13 @@ import Banner from '../home/components/banner.vue'
|
|
import materialDealers from '@designer-hub/assets/src/libs/assets/materialDealers'
|
|
import materialDealers from '@designer-hub/assets/src/libs/assets/materialDealers'
|
|
import { useRouter } from '../../core/utils/router'
|
|
import { useRouter } from '../../core/utils/router'
|
|
import PageHelperEvo from '@/components/page-helper-evo.vue'
|
|
import PageHelperEvo from '@/components/page-helper-evo.vue'
|
|
|
|
+import { handleCall, openLocation } from '../../core/utils/common'
|
|
|
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
const { data: materialDealerData, run: setMaterialDealerData } = useRequest(
|
|
const { data: materialDealerData, run: setMaterialDealerData } = useRequest(
|
|
() => getAppMaterials(),
|
|
() => getAppMaterials(),
|
|
{ initialData: [] },
|
|
{ initialData: [] },
|
|
)
|
|
)
|
|
-const { data: materials, run: setMaterials } = useRequest(() => getMaterials(), {
|
|
|
|
- initialData: { list: [] },
|
|
|
|
-})
|
|
|
|
-const { data, run } = useRequest(() => getByDictType(DictType.memberMaterialsBrandLevel))
|
|
|
|
const { data: materialOperationTypes, run: setMaterialOperationTypes } = useRequest(
|
|
const { data: materialOperationTypes, run: setMaterialOperationTypes } = useRequest(
|
|
() => getByDictType(DictType.memberMaterialsOperationType),
|
|
() => getByDictType(DictType.memberMaterialsOperationType),
|
|
{ initialData: [] },
|
|
{ initialData: [] },
|
|
@@ -37,7 +34,7 @@ const { data: banners, run: setBanners } = useRequest(
|
|
{ initialData: [] },
|
|
{ initialData: [] },
|
|
)
|
|
)
|
|
const dealerPanelState = ref(false)
|
|
const dealerPanelState = ref(false)
|
|
-const currentDeraler = ref<MaterialsList>()
|
|
|
|
|
|
+const currentDeraler = ref<MaterialDealer>()
|
|
const pieces = ref([
|
|
const pieces = ref([
|
|
{
|
|
{
|
|
title: '材料小课堂',
|
|
title: '材料小课堂',
|
|
@@ -81,33 +78,16 @@ const toDetail = (id: number) => {
|
|
url: `/pages/material/detail/index?id=${id}`,
|
|
url: `/pages/material/detail/index?id=${id}`,
|
|
})
|
|
})
|
|
}
|
|
}
|
|
-const handleCall = (phone: string) => {
|
|
|
|
- uni.makePhoneCall({ phoneNumber: phone })
|
|
|
|
-}
|
|
|
|
function handleClick(e) {
|
|
function handleClick(e) {
|
|
console.log(e)
|
|
console.log(e)
|
|
}
|
|
}
|
|
function onChange(e) {
|
|
function onChange(e) {
|
|
console.log(e)
|
|
console.log(e)
|
|
}
|
|
}
|
|
-const handleGo = ({ name, address }) => {
|
|
|
|
- uni.openLocation({
|
|
|
|
- latitude: 34.2593042818515,
|
|
|
|
- longitude: 109.01031190070307,
|
|
|
|
- address,
|
|
|
|
- name,
|
|
|
|
- success: function () {
|
|
|
|
- console.log('success')
|
|
|
|
- },
|
|
|
|
- fail: (fail) => {
|
|
|
|
- console.log(fail)
|
|
|
|
- },
|
|
|
|
- })
|
|
|
|
-}
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
- await run()
|
|
|
|
- // await setMaterialDealerData()
|
|
|
|
- await setMaterials()
|
|
|
|
|
|
+ await setMaterialDealerData()
|
|
|
|
+ console.log(materialDealerData.value)
|
|
|
|
+
|
|
await Promise.all([setMaterialBrandTypes(), setMaterialOperationTypes(), setBanners()])
|
|
await Promise.all([setMaterialBrandTypes(), setMaterialOperationTypes(), setBanners()])
|
|
// const reqs = data.value.map((it) =>
|
|
// const reqs = data.value.map((it) =>
|
|
// getMaterials({ brandLevel: it.value }).then(({ data }) => data),
|
|
// getMaterials({ brandLevel: it.value }).then(({ data }) => data),
|
|
@@ -250,7 +230,9 @@ onMounted(async () => {
|
|
<div class="bg-neutral-100 rounded-tl-2xl rounded-tr-2xl p-3.5" @click.stop="">
|
|
<div class="bg-neutral-100 rounded-tl-2xl rounded-tr-2xl p-3.5" @click.stop="">
|
|
<div class="flex flex-col">
|
|
<div class="flex flex-col">
|
|
<template
|
|
<template
|
|
- v-for="({ shopAddr, shopName, shopContactPhone }, i) in currentDeraler?.shopList"
|
|
|
|
|
|
+ v-for="(
|
|
|
|
+ { shopAddr, shopName, shopContactPhone, ...shop }, i
|
|
|
|
+ ) in currentDeraler?.shopList"
|
|
:key="i"
|
|
:key="i"
|
|
>
|
|
>
|
|
<div class="bg-white rounded-2.5 p-3.5 flex items-center">
|
|
<div class="bg-white rounded-2.5 p-3.5 flex items-center">
|
|
@@ -281,7 +263,14 @@ onMounted(async () => {
|
|
type="text"
|
|
type="text"
|
|
size="small"
|
|
size="small"
|
|
custom-class=" bg-[#f2f2f2]! p-0! ml-4"
|
|
custom-class=" bg-[#f2f2f2]! p-0! ml-4"
|
|
- @click="handleGo({ name: shopName, address: shopAddr })"
|
|
|
|
|
|
+ @click="
|
|
|
|
+ openLocation({
|
|
|
|
+ latitude: shop.latitude,
|
|
|
|
+ longitude: shop.longitude,
|
|
|
|
+ name: shopName,
|
|
|
|
+ address: shopAddr,
|
|
|
|
+ })
|
|
|
|
+ "
|
|
>
|
|
>
|
|
<wd-img width="28" height="28" :src="routerIcon"></wd-img>
|
|
<wd-img width="28" height="28" :src="routerIcon"></wd-img>
|
|
</wd-button>
|
|
</wd-button>
|