Commit ec249fa4 authored by chenqikuai's avatar chenqikuai

fix

parent 50f8bbfb
<script lang="tsx"> <script lang="tsx">
import router from "@/router";
import { goToChatWithOutletRoboot } from "@/router/navigate"; import { goToChatWithOutletRoboot } from "@/router/navigate";
import AddressService from "@/service/AddressService"; import AddressService from "@/service/AddressService";
import { chatAuthCheck } from "@/utils/authCheck";
import { defineComponent, ref } from "vue"; import { defineComponent, ref } from "vue";
export default defineComponent({ export default defineComponent({
props: ["setRef", "min_amount", "max_amount", "rate_lower", "rate_upper"], props: ["setRef", "min_amount", "max_amount", "rate_lower", "rate_upper"],
setup(props) { setup(props) {
const handleClick = async () => { const handleClick = async () => {
console.log(1); chatAuthCheck(async () => {
const ret = await AddressService.getInstance().getNearby({ const ret = await AddressService.getInstance().getNearby({
bank_code: Number(process.env.VUE_APP_BANK_CODE), bank_code: Number(process.env.VUE_APP_BANK_CODE),
number: 1, number: 1,
})
if (ret.code === 200) {
goToChatWithOutletRoboot({
outletId: ret.data[0].outlet_id
}) })
} if (ret.code === 200) {
goToChatWithOutletRoboot({
outletId: ret.data[0].outlet_id
})
}
}, () => {
router.push({
name: 'Login'
})
})
} }
return () => ( return () => (
......
...@@ -17,6 +17,7 @@ import AddressService from "@/service/AddressService" ...@@ -17,6 +17,7 @@ import AddressService from "@/service/AddressService"
import router from "@/router"; import router from "@/router";
import UserService from "@/service/UserService"; import UserService from "@/service/UserService";
import { goToChatWithOutletRoboot } from "@/router/navigate"; import { goToChatWithOutletRoboot } from "@/router/navigate";
import { chatAuthCheck } from "@/utils/authCheck";
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;
...@@ -113,11 +114,19 @@ export default defineComponent({ ...@@ -113,11 +114,19 @@ export default defineComponent({
}); });
const handleClickApply = async () => { const handleClickApply = async () => {
getOutletAndNavigateToChat(); chatAuthCheck(getOutletAndNavigateToChat, () => {
router.push({
name: 'Login'
})
})
} }
const clickChatIcon = async () => { const clickChatIcon = async () => {
getOutletAndNavigateToChat() chatAuthCheck(getOutletAndNavigateToChat, () => {
router.push({
name: 'Login'
})
})
} }
const getOutletAndNavigateToChat = async () => { const getOutletAndNavigateToChat = async () => {
......
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