Commit 03696a96 authored by chenqikuai's avatar chenqikuai

fix

parent 10310604
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
name="icon-kefu" name="icon-kefu"
class="absolute left-11" class="absolute left-11"
size="18" size="18"
@click="$router.push({name:'Chat'})" @click="$emit('clickSecondIcon')"
:color="iconColor" :color="iconColor"
/> />
<icon <icon
...@@ -41,6 +41,7 @@ import { defineComponent } from "vue"; ...@@ -41,6 +41,7 @@ import { defineComponent } from "vue";
import Icon from "../common/Icon.vue"; import Icon from "../common/Icon.vue";
export default defineComponent({ export default defineComponent({
inheritAttrs: false, inheritAttrs: false,
emits: ['clickSecondIcon'],
components: { Icon }, components: { Icon },
props: { props: {
title: { title: {
......
...@@ -14,6 +14,8 @@ import { filterGuaranteeType } from "@/utils/guarantee-type" ...@@ -14,6 +14,8 @@ import { filterGuaranteeType } from "@/utils/guarantee-type"
import { Skeleton } from "vant" import { Skeleton } from "vant"
import { iNearbyOutLet } from "@/service/AddressService/types" import { iNearbyOutLet } from "@/service/AddressService/types"
import AddressService from "@/service/AddressService" import AddressService from "@/service/AddressService"
import router from "@/router";
import UserService from "@/service/UserService";
function isInViewPort(element: HTMLElement, barHeight: number) { function isInViewPort(element: HTMLElement, barHeight: number) {
const viewWidth = window.innerWidth || document.documentElement.clientWidth; const viewWidth = window.innerWidth || document.documentElement.clientWidth;
...@@ -109,6 +111,34 @@ export default defineComponent({ ...@@ -109,6 +111,34 @@ export default defineComponent({
window.onscroll = null; window.onscroll = null;
}); });
const handleClickApply = async () => {
getOutletAndNavigateToChat();
}
const clickChatIcon = async () => {
getOutletAndNavigateToChat()
}
const getOutletAndNavigateToChat = async () => {
const ret = await AddressService.getInstance().getNearby({
bank_code: Number(process.env.VUE_APP_BANK_CODE),
number: 1,
})
if (ret.code === 200) {
const ret2 = await UserService.getInstance().contact_custom_service({
outLetID: ret.data[0].outlet_id as number
})
if (ret2.code == 200) {
router.push({
name: 'Chat',
query: {
target: ret2.data.addr
}
})
}
}
}
return () => ( return () => (
<> <>
<div class="page flex-col"> <div class="page flex-col">
...@@ -118,6 +148,7 @@ export default defineComponent({ ...@@ -118,6 +148,7 @@ export default defineComponent({
iconColor={canSeeApplyBtn.value ? "white" : 'black'} iconColor={canSeeApplyBtn.value ? "white" : 'black'}
style={{ 'background': canSeeApplyBtn.value ? '#2C3C92 !important' : 'white !important', 'color': canSeeApplyBtn.value ? 'white' : 'black' }} style={{ 'background': canSeeApplyBtn.value ? '#2C3C92 !important' : 'white !important', 'color': canSeeApplyBtn.value ? 'white' : 'black' }}
showSecondIcon={true} showSecondIcon={true}
onClickSecondIcon={clickChatIcon}
occupyPosition={false} occupyPosition={false}
/> />
<div class="block1 flex-col"> <div class="block1 flex-col">
...@@ -251,6 +282,7 @@ export default defineComponent({ ...@@ -251,6 +282,7 @@ export default defineComponent({
<div <div
class=" fixed left-0 right-0 bottom-0 h-12 bg-app-blue apply-btn flex items-center justify-center" class=" fixed left-0 right-0 bottom-0 h-12 bg-app-blue apply-btn flex items-center justify-center"
style={{ zIndex: 300 }} style={{ zIndex: 300 }}
onClick={handleClickApply}
> >
立即申请 立即申请
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment