feat: 接口适配更新
parent
04ffde376c
commit
6bb40b32d9
|
|
@ -43,7 +43,7 @@ const starSchool = () => {
|
|||
<view class="flex items-center mx-[30rpx] flex-wrap">
|
||||
<view class="flex flex-col">
|
||||
<text class="font-600 text-[40rpx] text-[#000]">{{ schoolDetail.schoolName }}</text>
|
||||
<view class="flex items-center gap-[10rpx] my-[14rpx]" v-if="schoolDetail.tags">
|
||||
<view class="flex items-center gap-[10rpx] my-[14rpx] flex-wrap" v-if="schoolDetail.tags">
|
||||
<view class="rounded-[8rpx] bg-[#F8F8F8] px-[10rpx] py-[4rpx] text-[24rpx] text-[#666]"
|
||||
v-for="feature in schoolDetail.tags.split('、')" :key="feature">{{ feature }}</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -19,8 +19,9 @@ const props = defineProps({
|
|||
const contacts = computed(() => [
|
||||
{
|
||||
title: '招办电话', msg: props.schoolDetail.admissionOfficePhone, type: 'phone', typeLabel: '拨打', eventClick: () => {
|
||||
visible.value = true;
|
||||
renderType.value = 'phone'
|
||||
// visible.value = true;
|
||||
// renderType.value = 'phone'
|
||||
makePhoneCall(props.schoolDetail.admissionOfficePhone)
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -33,10 +34,11 @@ const contacts = computed(() => [
|
|||
{
|
||||
title: '就读地址', msg: props.schoolDetail.address, type: 'navigation', typeLabel: '导航', eventClick: () => {
|
||||
uni.openLocation({
|
||||
longitude: 121.50342663420965,
|
||||
latitude: 31.294363285983216,
|
||||
longitude: Number.parseFloat(props.schoolDetail.lng),
|
||||
latitude: Number.parseFloat(props.schoolDetail.lat),
|
||||
address: props.schoolDetail.address,
|
||||
name: props.schoolDetail.address
|
||||
name: props.schoolDetail.address,
|
||||
scale: 5
|
||||
})
|
||||
}
|
||||
},
|
||||
|
|
@ -57,7 +59,7 @@ const onOverlayClick = () => {
|
|||
const renderType = ref("phone")
|
||||
|
||||
const makePhoneCall = (val: string) => {
|
||||
uni.makePhoneCall({ phoneNumber: '4000616985' })
|
||||
uni.makePhoneCall({ phoneNumber: val })
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { DomHandler, Parser } from 'htmlparser2'
|
|||
type RichTextNode =
|
||||
| { type: 'text'; text: string }
|
||||
| { type: 'element'; name: string; attrs: Record<string, any>; children: RichTextNode[] }
|
||||
const newsDetail = ref({ title: '', publishTime: "", remark: "" })
|
||||
const newsDetail = ref({ title: '', publishTime: "", remark: "",content:"" })
|
||||
|
||||
const nodes = ref<any[]>([])
|
||||
|
||||
|
|
@ -53,8 +53,8 @@ onLoad(options => {
|
|||
getNewsDetail({ query: { id: options.id } }).then(resp => {
|
||||
if (resp.code == 200) {
|
||||
newsDetail.value = resp.result
|
||||
const _nodes = parseHTMLToObject(resp.result.remark)
|
||||
nodes.value = traverseNodes(_nodes)
|
||||
// const _nodes = parseHTMLToObject(resp.result.remark)
|
||||
// nodes.value = traverseNodes(_nodes)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
|
@ -74,7 +74,7 @@ const navigateToCustom = () => {
|
|||
<view class="border-b-[2rpx] border-b-dashed border-b-[#D8D8D8] mt-[20rpx] mb-[30rpx]"></view>
|
||||
<view class="pt-[30rpx]">
|
||||
<!-- <rich-text :nodes="nodes"></rich-text> -->
|
||||
<view v-html="newsDetail.remark"></view>
|
||||
<view v-html="newsDetail.content"></view>
|
||||
</view>
|
||||
|
||||
<view class="fixed right-[20rpx] bottom-[120rpx] w-[160rpx] h-[160rpx]" @click="navigateToCustom">
|
||||
|
|
|
|||
Loading…
Reference in New Issue