Commit 953e29f0 authored by chenqikuai's avatar chenqikuai

perf: 修改代码,消除一些warning

parent 889d78bb
......@@ -6,30 +6,27 @@
<div
v-if="iconName === 'icon-gengduo'"
class="flex items-center"
@click="$emit('seeMore')">
@click="$emit('seeMore')"
>
<span class="word9">更多</span>
<icon
name="icon-gengduo"
color="#979BB6"
size="10"
/>
<IconVue name="icon-gengduo" color="#979BB6" size="10" />
</div>
<icon
<IconVue
v-else-if="iconName === 'icon-shaixuan'"
:name="iconName"
color="#979BB6"
size="16"
@click="clickFilter"
/>
<icon v-else-if="iconName" :name="iconName" color="#979BB6" size="16" />
<IconVue v-else-if="iconName" :name="iconName" color="#979BB6" size="16" />
</div>
</template>
<script lang="ts">
import { defineComponent } from "vue";
import Icon from "../common/Icon.vue";
import IconVue from "../common/Icon.vue";
export default defineComponent({
emits: ["filter", "seeMore"],
components: { Icon },
components: { IconVue },
props: {
title: {
type: String,
......@@ -82,4 +79,4 @@ export default defineComponent({
text-align: center;
margin: 0 0 0 14px;
}
</style>
\ No newline at end of file
</style>
......@@ -21,14 +21,12 @@
</template>
<script lang="ts">
import { defineComponent } from "vue";
import Icon from "../common/Icon.vue";
import Bridge from "@/utils/jsBridge2";
import { Toast } from "vant";
import { enableLive } from "@/service/StaffService";
import { getCurrentUserAvatarUrl } from "@/utils/userMsg";
export default defineComponent({
components: { Icon },
props: {
title: String,
},
......
<template>
<div class="wrap15 flex mx-5 items-center" @click="$emit('click')">
<div class="bd5 ml-4">
<p class="word14">{{max_amount}}<span class="unit"></span></p>
<p class="word14">{{ max_amount }}<span class="unit"></span></p>
<p class="txt8">最高可借</p>
</div>
<div
class="bd6 flex flex-col flex-shrink overflow-hidden overflow-ellipsis"
>
<span class="word15 w-full overflow-hidden overflow-ellipsis">{{product_name}}</span>
<span class="txt10 w-full overflow-hidden overflow-ellipsis">{{features}}</span>
<span class="word15 w-full overflow-hidden overflow-ellipsis">{{
product_name
}}</span>
<span class="txt10 w-full overflow-hidden overflow-ellipsis">{{
features
}}</span>
<!-- <span class="word16">{{features}}</span> -->
</div>
<div class="flex-grow"></div>
<icon name="icon-gengduo" color="#979BB6" size="15" class="mr-6" />
<IconVue name="icon-gengduo" color="#979BB6" size="15" class="mr-6" />
</div>
</template>
<script lang="ts" setup>
import Icon from "@/components/common/Icon.vue";
import IconVue from "@/components/common/Icon.vue";
import { eLoanMode } from "@/views/withMenu/Loan/types";
import { PropType } from "vue"
import { PropType } from "vue";
defineEmits(['click'])
defineEmits(["click"]);
const props = defineProps({
max_amount:{
type:Number,
required:true
max_amount: {
type: Number,
required: true,
},
product_name:{
type:String,
required:true
product_name: {
type: String,
required: true,
},
features:{
type:String,
required:true
features: {
type: String,
required: true,
},
inst_name:{
type:String,
required:true
inst_name: {
type: String,
required: true,
},
loanMode: {
type: Number as PropType<eLoanMode>,
requried: true,
},
})
type: Number as PropType<eLoanMode>,
requried: true,
},
});
</script>
<style scoped>
.wrap15 {
......@@ -161,4 +165,4 @@ const props = defineProps({
height: 14px;
margin: 27px 0 0 69px;
}
</style>
\ No newline at end of file
</style>
<template>
<Skeleton :row="3" :loading="skeLoading">
<van-swipe class="my-swipe" indicator-color="#3E4FAF" style="margin-top: 20px">
<van-swipe
class="my-swipe"
indicator-color="#3E4FAF"
style="margin-top: 20px"
>
<van-swipe-item
class="flex justify-center swpiItem"
v-for="item in state.hotProductList"
......@@ -72,7 +76,7 @@ const fetchList = () => {
inst_name,
product_name,
product_status,
} = ret.data;
} = ret.data || {};
return {
rate,
......@@ -87,11 +91,11 @@ const fetchList = () => {
promiseList.push(promise);
});
state.hotProductList = [];
Promise.all(promiseList).then(list => {
list.forEach(i => {
Promise.all(promiseList).then((list) => {
list.forEach((i) => {
state.hotProductList.push(i);
})
})
});
});
}
});
};
......@@ -105,4 +109,4 @@ const fetchList = () => {
.swpiItem {
height: 230px;
}
</style>
\ No newline at end of file
</style>
<template>
<div class="inner_box border border-card-shadow rounded-2xl px-7 pt-8 pb-6 bg-white mt-5">
<div class=" bg-app-blue rounded-full w-6 h-6 inline-block mr-2 align-middle relative">
<img :src="path" class=" w-3 h-3 absolute inset-0 m-auto">
<div
class="
inner_box
border border-card-shadow
rounded-2xl
px-7
pt-8
pb-6
bg-white
mt-5
"
>
<div
class="
bg-app-blue
rounded-full
w-6
h-6
inline-block
mr-2
align-middle
relative
"
>
<img :src="path" class="w-3 h-3 absolute inset-0 m-auto" />
</div>
<span :title="title" class=" text-app-blue font-semibold text-base align-middle">{{title}}</span>
<p class=" text-gray-700 text-sm text-justify pt-3">
<span
:title="title"
class="text-app-blue font-semibold text-base align-middle"
>{{ title }}</span
>
<p class="text-gray-700 text-sm text-justify pt-3">
<slot></slot>
</p>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import Icon from "@/components/common/Icon.vue"
import { defineComponent } from "vue";
export default defineComponent({
components:{ Icon },
props:{
path:{
type:String,
default:''
props: {
path: {
type: String,
default: "",
},
title: {
type: String,
default: "",
},
title:{
type:String,
default:''
}
},
setup () {
return {}
}
})
setup() {
return {};
},
});
</script>
<style scoped>
.inner_box{
box-shadow: 4px 9px #D6DBF8 ;
.inner_box {
box-shadow: 4px 9px #d6dbf8;
}
</style>
\ No newline at end of file
</style>
......@@ -46,7 +46,10 @@
网点
</p>
</div>
<div class="flex items-start w-full justify-between" v-if="!disableChat">
<div
class="flex items-start w-full justify-between"
v-if="!disableChat"
>
<div class="text-gray-400 text-xs">{{ location }}</div>
<div class="text-gray-400 text-xs float-right ml-2">
{{ filter.filterDistance(distance) }}
......@@ -58,7 +61,7 @@
<div class="mt-2 pb-3 flex justify-between items-center">
<div class="overflow-hidden mr-6">
<div v-if="is_normal_work" class="mb-2">
<icon
<IconVue
name="icon-yingye"
color="#1B1F37"
size="14"
......@@ -90,7 +93,7 @@
>
</div>
<div v-if="is_normal_work">
<icon
<IconVue
name="icon-a-shijian"
color="#1B1F37"
size="14"
......@@ -107,7 +110,7 @@
</div>
<div class="text-right h-3" v-if="!disableChat">
<icon
<IconVue
name="icon-ditu"
color="#3E4FAF"
size="14"
......@@ -120,7 +123,7 @@
<!-- 底部操作 -->
<div
class="flex text-center py-3 text-gray-800 bg-branch-tab-bg rounded-b-2xl"
v-if="(!isNotChatUser && is_normal_work && !disableChat)"
v-if="!isNotChatUser && is_normal_work && !disableChat"
>
<p
class="w-1/2 border-r border-gray-200 mb-0"
......@@ -141,16 +144,8 @@
</template>
<script lang="ts" setup>
import {
computed,
defineComponent,
onMounted,
onUnmounted,
PropType,
reactive,
ref,
} from "vue";
import Icon from "@/components/common/Icon.vue";
import { computed, defineComponent, PropType, ref } from "vue";
import IconVue from "@/components/common/Icon.vue";
import { transfterStrToDate } from "@/utils/transfer";
import AddressService from "@/service/AddressService";
import dayjs from "dayjs";
......@@ -296,8 +291,8 @@ const handleClickNagigate = () => {
};
const handleClickChatWithClientManager = async () => {
console.log(props.outlet_id, 'show outlet id');
console.log(props.outlet_id, "show outlet id");
authCheck(async () => {
goToChatWithOutletRoboot({
outletId: props.outlet_id as number,
......@@ -306,7 +301,7 @@ const handleClickChatWithClientManager = async () => {
};
const isNotChatUser = getUserMsg()?.role2 === eRole.manager;
console.log(isNotChatUser, 'show isNotChatUser');
console.log(isNotChatUser, "show isNotChatUser");
</script>
<style lang="less" scoped>
......@@ -316,4 +311,4 @@ console.log(isNotChatUser, 'show isNotChatUser');
width: 0.8rem;
}
}
</style>
\ No newline at end of file
</style>
<template>
<div class=" h-12 bg-white flex justify-between items-center px-3 rounded-lg">
<div class=" flex items-center">
<icon
:name="iconName"
color="#4E61C9"
size="14"
/>
<span class=" text-sm text-gray-800 ml-3">{{label}}</span>
<div class="h-12 bg-white flex justify-between items-center px-3 rounded-lg">
<div class="flex items-center">
<IconVue :name="iconName" color="#4E61C9" size="14" />
<span class="text-sm text-gray-800 ml-3">{{ label }}</span>
</div>
<icon
name="icon-gengduo"
color="#8E92A3"
size="14"
/>
<IconVue name="icon-gengduo" color="#8E92A3" size="14" />
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import Icon from "@/components/common/Icon.vue"
import { defineComponent } from "vue";
import IconVue from "@/components/common/Icon.vue";
export default defineComponent({
components:{
Icon
components: {
IconVue,
},
props: {
iconName: {
type: String,
default: ''
default: "",
},
label: {
type: String,
default: "",
},
label:{
type:String,
default:''
}
},
setup () {
return {}
}
})
setup() {
return {};
},
});
</script>
<style scoped>
</style>
\ No newline at end of file
<style scoped></style>
......@@ -2,12 +2,12 @@
<div class="navbar w-full" style="z-index: 300" v-if="!bangsBlock">
<div
class="h-full theBar flex items-end px-5 justify-center relative h46"
style="background:#F7F7FA; padding-bottom: 8px;"
style="background: #f7f7fa; padding-bottom: 8px"
:style="[isBangs ? 'height:' + `${46 + heightOfNotch}px` : '']"
v-bind="$attrs"
>
<div class="relative w-full flex items-center justify-center">
<icon
<IconVue
v-if="showBackIcon"
@click="$router.go(-1)"
name="icon-fanhui"
......@@ -15,7 +15,7 @@
size="18"
:color="iconColor"
/>
<icon
<IconVue
v-if="showSecondIcon && isRole"
name="icon-kefu"
class="absolute left-11"
......@@ -23,7 +23,7 @@
@click="$emit('clickSecondIcon')"
:color="iconColor"
/>
<icon
<IconVue
v-if="showSearchIcon"
name="icon-sousuo"
class="absolute left-11"
......@@ -31,7 +31,11 @@
@click="$router.push(path)"
:color="iconColor"
/>
<div class="title whitespace-nowrap overflow-hidden overflow-ellipsis px-5">{{ title }}</div>
<div
class="title whitespace-nowrap overflow-hidden overflow-ellipsis px-5"
>
{{ title }}
</div>
</div>
</div>
<div
......@@ -43,26 +47,29 @@
<div v-else class="navbar w-full">
<div
class="h-full theBar flex items-end px-5 justify-center relative"
style="background:rgb(237,237,237); "
style="background: rgb(237, 237, 237)"
v-bind="$attrs"
:style="{
'height': heightOfNotch + 'px',
height: heightOfNotch + 'px',
}"
v-if="isBangs"
></div>
<div
:style="{
height: heightOfNotch + 'px',
}"
v-if="isBangs"
></div>
<div :style="{
'height': heightOfNotch + 'px'
}" v-if="isBangs"></div>
</div>
</template>
<script lang="ts">
import { notchHeight } from "@/store/AppStore";
import { defineComponent } from "vue";
import Icon from "../common/Icon.vue";
import IconVue from "../common/Icon.vue";
export default defineComponent({
inheritAttrs: false,
emits: ['clickSecondIcon'],
components: { Icon },
emits: ["clickSecondIcon"],
components: { IconVue },
props: {
title: {
type: String,
......@@ -94,27 +101,32 @@ export default defineComponent({
path: {
type: Object,
default: () => {
return { path: '/Search' }
}
return { path: "/Search" };
},
},
bangsBlock: {
type: Boolean,
default: false
}
default: false,
},
},
mounted() {
console.log(document.documentElement.clientWidth, window.screen.width, 'show width');
console.log(window.devicePixelRatio, 'show window.devicePixelRatio');
console.log(
document.documentElement.clientWidth,
window.screen.width,
"show width"
);
console.log(window.devicePixelRatio, "show window.devicePixelRatio");
},
computed: {
isBangs() {
return true
return true;
},
heightOfNotch() { // 刘海屏的刘海高度 单位px
heightOfNotch() {
// 刘海屏的刘海高度 单位px
return notchHeight.value / window.devicePixelRatio;
return 103;
}
}
},
},
});
</script>
<style lang="less" scoped>
......@@ -136,4 +148,4 @@ export default defineComponent({
font-weight: 400;
}
}
</style>
\ No newline at end of file
</style>
......@@ -2,17 +2,17 @@
<Popup
v-model:show="visible"
position="right"
style="height: 100vh; width: 86%;"
style="height: 100vh; width: 86%"
>
<div class="flex flex-col h-full">
<div class="mx-5 flex items-center justify-center relative mt-2.5">
<icon
<IconVue
color="#000000"
name="icon-a-shanchu1"
class="absolute left-0"
@click="clickClose"
/>
<div class="title">{{ title || '此处是标题' }}</div>
<div class="title">{{ title || "此处是标题" }}</div>
</div>
<div class="flex-grow overflow-hidden">
<div class="h-full overflow-auto px-5">
......@@ -44,18 +44,18 @@
</Popup>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import { Popup } from 'vant'
import Icon from '@/components/common/Icon.vue'
import { defineComponent } from "vue";
import { Popup } from "vant";
import IconVue from "@/components/common/Icon.vue";
export default defineComponent({
emits: ['clickLeft', 'clickRight'],
emits: ["clickLeft", "clickRight"],
components: {
Popup,
Icon,
IconVue,
},
props: {
leftBtnName: { type: String, default: '重置' },
rightBtnName: { type: String, default: '完成' },
leftBtnName: { type: String, default: "重置" },
rightBtnName: { type: String, default: "完成" },
leftBtnActive: {
type: Boolean,
default: true,
......@@ -73,20 +73,20 @@ export default defineComponent({
},
methods: {
clickClose(): void {
this.setShow(false)
this.setShow(false);
},
},
computed: {
visible: {
get(): boolean | undefined {
return this.show
return this.show;
},
set(v: boolean): void {
this.setShow(false)
this.setShow(false);
},
},
},
})
});
</script>
<style lang="less" scoped>
.btn {
......
<template>
<div class="mb-5">
<div class="rating mx-auto flow-root">
<div class="flex items-center justify-center mt-5">
<div class="line"></div>
<div class="title mx-2.5">评价服务</div>
<div class="line"></div>
</div>
<div class="flex items-center justify-center mt-5">
<div
v-for="item in props.list"
:key="item.icon"
class="flex flex-col items-center w-20"
@click="!selected && setSelectedRate && setSelectedRate(item.name)"
>
<icon
size="22"
:name="item.icon"
:color="item.name === selected ? selectedColor : unselectedColor"
/>
<div class="mt-3 name">{{ item.name }}</div>
</div>
</div>
<div class="mb-5">
<div class="rating mx-auto flow-root">
<div class="flex items-center justify-center mt-5">
<div class="line"></div>
<div class="title mx-2.5">评价服务</div>
<div class="line"></div>
</div>
<div class="flex items-center justify-center mt-5">
<div
v-for="item in props.list"
:key="item.icon"
class="flex flex-col items-center w-20"
@click="!selected && setSelectedRate && setSelectedRate(item.name)"
>
<IconVue
size="22"
:name="item.icon"
:color="item.name === selected ? selectedColor : unselectedColor"
/>
<div class="mt-3 name">{{ item.name }}</div>
</div>
<div class="title mt-5 text-center" v-if="selected">感谢您的评价</div>
</div>
</div>
<div class="title mt-5 text-center" v-if="selected">感谢您的评价</div>
</div>
</template>
<script lang="ts" setup>
import Icon from "@/components/common/Icon.vue"
import { defineProps, PropType } from "vue"
import IconVue from "@/components/common/Icon.vue";
import { defineProps, PropType } from "vue";
const props = defineProps({
selected: String,
setSelectedRate: Function,
selectedColor: {
type: String,
default: '#3E4FAF',
selected: String,
setSelectedRate: Function,
selectedColor: {
type: String,
default: "#3E4FAF",
},
unselectedColor: {
type: String,
default: "#8D92AF",
},
list: {
type: Array as PropType<{ icon: string; name: string }[]>,
default() {
return [
{
icon: "icon-manyi",
name: "满意",
},
{
icon: "icon-bumanyi",
name: "不满意",
},
];
},
unselectedColor: {
type: String,
default: '#8D92AF'
},
list: {
type: Array as PropType<{ icon: string, name: string }[]>,
default() {
return [
{
icon: 'icon-manyi',
name: '满意',
},
{
icon: 'icon-bumanyi',
name: '不满意',
}
]
}
}
})
},
});
</script>
<style lang="less" scoped>
.title {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
}
.rating {
width: 335px;
height: 140px;
background: #ffffff;
.line {
width: 105px;
height: 1px;
border: 1px solid #f5f6f9;
}
.name {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
}
}
.rating {
width: 335px;
height: 140px;
background: #ffffff;
.line {
width: 105px;
height: 1px;
border: 1px solid #f5f6f9;
}
.name {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #333333;
}
}
</style>
\ No newline at end of file
</style>
......@@ -8,13 +8,15 @@
@click-overlay="hide"
>
<div class="text-center py-4" @click="handleClickCall">
<icon
<Icon
name="icon-a-dianhua"
color="#3E4FAF"
size="17"
class="inline-block pr-3 align-text-bottom"
/>
<span class="text-app-blue text-sm align-middle font-semibold">呼叫{{ phone }}</span>
<span class="text-app-blue text-sm align-middle font-semibold"
>呼叫{{ phone }}</span
>
</div>
</van-popup>
<van-popup
......@@ -26,20 +28,27 @@
@click-overlay="hide"
>
<div
class="text-app-blue text-sm font-semibold border-t border-gray-200 text-center py-4"
class="
text-app-blue text-sm
font-semibold
border-t border-gray-200
text-center
py-4
"
@click="hide"
>取消</div>
>
取消
</div>
</van-popup>
</div>
</template>
<script lang="ts" setup>
import Vue, { getCurrentInstance } from 'vue'
import jsBridge from "@/utils/jsBridge2"
// const { ctx } = getCurrentInstance() as any
import Vue from "vue";
import jsBridge from "@/utils/jsBridge2";
import Icon from "../common/Icon.vue";
const emit = defineEmits(['hidden'])
const emit = defineEmits(["hidden"]);
const props = defineProps({
show: {
......@@ -48,18 +57,17 @@ const props = defineProps({
},
phone: {
type: String,
}
})
},
});
const hide = () => {
emit('hidden', false)
}
emit("hidden", false);
};
const handleClickCall = async () => {
console.log(props.phone)
console.log(props.phone);
new jsBridge().bridge_call(props.phone, () => {
emit('hidden', false)
})
}
</script>
\ No newline at end of file
emit("hidden", false);
});
};
</script>
......@@ -4,8 +4,8 @@
:style="{ background: '#0081F7 !important', color: 'white' }"
iconColor="white"
/>
<div class=" -mt-5">
<img src="../../assets/img/activity_bg.png" class=" w-full"/>
<div class="-mt-5">
<img src="../../assets/img/activity_bg.png" class="w-full" />
</div>
<!-- 活动列表 -->
<van-list
......@@ -16,7 +16,8 @@
@load="onLoad"
>
<div class="px-5">
<Skeleton :loading="skeLoading" :row="3" class="mt-2">
<div class="mt-2" v-if="skeLoading"></div>
<Skeleton :loading="skeLoading" :row="3">
<card
v-for="activity in activityList"
:update_at="activity.update_at"
......@@ -47,7 +48,7 @@ onMounted(() => {
fetchList();
});
const current = ref(1)
const current = ref(1);
const LIST_SIZE: number = 4;
const offset = ref(0);
const loading = ref(false);
......@@ -57,7 +58,7 @@ const activityList: Ref<ActivityItem[]> = ref([]);
const skeLoading = ref(false);
const onLoad = () => {
current.value ++
current.value++;
offset.value = (current.value - 1) * LIST_SIZE;
if (offset.value >= total.value) {
finished.value = true;
......@@ -69,10 +70,10 @@ const onLoad = () => {
};
const fetchList = () => {
skeLoading.value = true
skeLoading.value = true;
queryActivityList({ limit: 4, offset: offset.value }).then((ret) => {
if (ret.code === 200) {
skeLoading.value = false
skeLoading.value = false;
total.value = ret.data.total;
activityList.value = activityList.value.concat(ret.data.items);
loading.value = false;
......@@ -85,4 +86,4 @@ const fetchList = () => {
.title {
font-size: 18px;
}
</style>
\ No newline at end of file
</style>
<template>
<nav-bar :bangsBlock="true" />
<div class="register pt-5">
<Icon
<IconVue
name="icon-a-shanchu1"
color="black"
size="20"
......@@ -144,7 +144,7 @@ import LoginButton from "./components/LoginButton/index.vue";
import Check from "@/components/common/Check/index.vue";
import PhoneInput from "./components/PhoneInput/index.vue";
import SlideValidator from "@/components/common/SlideValidator/index.vue";
import Icon from "@/components/common/Icon.vue";
import IconVue from "@/components/common/Icon.vue";
import notCheckedIcon from "@/assets/icons/not_checked.png";
import checkedIcon from "@/assets/icons/checked.png";
......@@ -193,7 +193,7 @@ export default defineComponent({
Check,
PhoneInput,
SlideValidator,
Icon,
IconVue,
},
data() {
return {
......
......@@ -7,9 +7,16 @@
>
<q-spinner color="primary" size="3rem" :thickness="5" />
</div>
<div class="flex flex-col flex-grow overflow-hidden" style="flex-basis: 0px">
<ChatContentVue :isRobootOffLine="isRobootOffLine"/>
<ServiceRating :setSelectedRate="handleSelect" :selected="selected" v-if="showServiceRating" />
<div
class="flex flex-col flex-grow overflow-hidden"
style="flex-basis: 0px"
>
<ChatContentVue :isRobootOffLine="isRobootOffLine" />
<ServiceRating
:setSelectedRate="handleSelect"
:selected="selected"
v-if="showServiceRating"
/>
<ChatOption>
<ChatOptionItemVue
v-if="isUser && isChatWithRoboot && !isRobootOffLine"
......@@ -23,7 +30,11 @@
:value="serviceShowValue"
@click="handleClickService"
/>
<ChatOptionItemVue :selected="false" value="电话联系" @click="handleClickCall" />
<ChatOptionItemVue
:selected="false"
value="电话联系"
@click="handleClickCall"
/>
</ChatOption>
<ChatInputVue :serviceShowValue="serviceShowValue" />
<CommonUseSentence
......@@ -41,14 +52,21 @@
<script lang="ts">
/* eslint-disable */
import NavBar from "@/components/NavBar/index.vue";
import { defineComponent, onMounted, ref, watch, defineAsyncComponent, computed } from "vue";
import {
defineComponent,
onMounted,
ref,
watch,
defineAsyncComponent,
computed,
} from "vue";
import { connectionState } from "@/store/connectionStore";
import { getFromId } from "@/store/appCallerStore";
import { messageStore } from "@/store/messagesStore";
import ChatMessageDB from "@/db/ChatMessageDB";
import { chatCardTimeStamp } from "@/store/chatCardStore";
import ChatListCardDB from "@/db/ChatListCardDB";
import { v4 as uuidv4 } from 'uuid'
import { v4 as uuidv4 } from "uuid";
import { ChatMessageTypes } from "@/types/chatMessageTypes";
import { useRoute } from "vue-router";
import { queryFaqAnswer, queryFaqList } from "@/service/FaqService";
......@@ -56,66 +74,87 @@ import { getDisplayNames, getMsgFromAddress } from "@/utils/displayName";
import { MessageContent } from "@/types/chat-message";
import { CONST_END_CHAT, CONST_START_CHAT } from "@/config/chat";
import ChatOptionItemVue from "@/components/ChatOptions/ChatOptionItem.vue";
import ShowCall from "@/components/showCall/index.vue"
import ShowCall from "@/components/showCall/index.vue";
import { getUserMsg } from "@/utils/userMsg";
import { eRole } from "@/types/roleType";
import ChatDBService from "@/db/ChatDBService";
import UserService from "@/service/UserService";
import { gotoChatWithStaff } from "@/router/navigate";
export default defineComponent({
components: {
ChatContentVue: defineAsyncComponent(() => import(/* webpackChunkName: 'ChatContentVue' */"./ChatContent.vue")),
ChatInputVue: defineAsyncComponent(() => import(/* webpackChunkName: 'ChatInputVue' */"./ChatInput.vue")),
ChatContentVue: defineAsyncComponent(
() => import(/* webpackChunkName: 'ChatContentVue' */ "./ChatContent.vue")
),
ChatInputVue: defineAsyncComponent(
() => import(/* webpackChunkName: 'ChatInputVue' */ "./ChatInput.vue")
),
NavBar,
ServiceRating: defineAsyncComponent(() => import(/* webpackChunkName: 'serviceRating' */ "@/components/ServiceRating/index.vue")),
ChatOption: defineAsyncComponent(() => import(/* webpackChunkName: 'ChatOption' */"@/components/ChatOptions/index.vue")),
CommonUseSentence: defineAsyncComponent(() => import(/* webpackChunkName: 'CommonUseSentence' */"@/components/CommonUseSentence/index.vue")),
ServiceRating: defineAsyncComponent(
() =>
import(
/* webpackChunkName: 'serviceRating' */ "@/components/ServiceRating/index.vue"
)
),
ChatOption: defineAsyncComponent(
() =>
import(
/* webpackChunkName: 'ChatOption' */ "@/components/ChatOptions/index.vue"
)
),
CommonUseSentence: defineAsyncComponent(
() =>
import(
/* webpackChunkName: 'CommonUseSentence' */ "@/components/CommonUseSentence/index.vue"
)
),
ChatOptionItemVue,
ShowCall
ShowCall,
},
setup() {
const questionSelected = ref(false)
const questionSelected = ref(false);
const handleClickQuestionOption = () => {
questionSelected.value = !questionSelected.value
}
questionSelected.value = !questionSelected.value;
};
watch(questionSelected, () => {
setShowSentences(questionSelected.value)
setShowSentences(questionSelected.value);
sentensesLoading.value = true;
questionSelected.value && queryFaqList().then(ret => {
if (ret.code === 200) {
sentenceList.value = ret.data.question;
}
sentensesLoading.value = false;
})
})
questionSelected.value &&
queryFaqList().then((ret) => {
if (ret.code === 200) {
sentenceList.value = ret.data.question;
}
sentensesLoading.value = false;
});
});
const serviceSelected = ref(false);
const serviceShowValue = ref('人工服务')
const serviceShowValue = ref("人工服务");
const sendChatMessage = (payload: {
type: ChatMessageTypes;
content: MessageContent;
target?: string;
}) => {
return messageStore.sendMessage({ type: payload.type, content: payload.content, target: payload.target || route.query.targetId as string });
return messageStore.sendMessage({
type: payload.type,
content: payload.content,
target: payload.target || (route.query.targetId as string),
});
};
const handleClickService = async () => {
if (serviceShowValue.value === '人工服务') {
if (serviceShowValue.value === "人工服务") {
questionSelected.value = false;
const ret = await UserService.getInstance().contact_custom_service({
outLetID: Number(route.query.targetId) as number
})
outLetID: Number(route.query.targetId) as number,
});
if (ret.code === 200) {
gotoChatWithStaff({
address: ret.data.addr,
beginChat: true
beginChat: true,
});
} else {
// await sendChatMessage({
......@@ -129,56 +168,50 @@ export default defineComponent({
// })
return;
}
} else if (serviceShowValue.value === '结束服务') {
serviceShowValue.value = '人工服务'
} else if (serviceShowValue.value === "结束服务") {
serviceShowValue.value = "人工服务";
sendChatMessage({
type: ChatMessageTypes.Card,
content: {
bank: CONST_END_CHAT.user.id,
name: CONST_END_CHAT.staff.id,
account: '',
} as MessageContent
})
account: "",
} as MessageContent,
});
}
}
};
const initError = ref(false);
const showServiceRating = ref(false);
const selected = ref("");
const showShortSentences = ref(false);
const route = useRoute()
const route = useRoute();
const target = route.query.targetId as string;
const sentenceList = ref<any[]>([])
const sentensesLoading = ref(false)
const sentenceList = ref<any[]>([]);
const sentensesLoading = ref(false);
const setShowSentences = (show: boolean) =>
(showShortSentences.value = show);
const handleSelect = (select: string) => (selected.value = select);
const handleClickCall = async () => {
if (isChatWithRoboot.value) {
const ret = await UserService.getInstance().contact_custom_service({
outLetID: Number(target) as number
})
outLetID: Number(target) as number,
});
if (ret.code === 200) {
callPhone.value = ret.data.phone;
} else {
return;
}
} else {
const ret = await getMsgFromAddress([route.query.targetId as string])
const ret = await getMsgFromAddress([route.query.targetId as string]);
callPhone.value = ret[0].phone;
}
showCall.value = true;
}
};
const useSentence = async (content: string) => {
/* 问 */
......@@ -189,32 +222,31 @@ export default defineComponent({
from: getFromId() as string,
target: target,
uuid: uuidv4(),
state: 'success',
state: "success",
datetime: new Date().getTime(),
type: ChatMessageTypes.robot,
})
});
await ChatDBService.getInstance().handleEveryReceive({
msg: {
content: {
content: content
content: content,
},
from: getFromId() as string,
target: target,
uuid: uuidv4(),
state: 'success',
state: "success",
datetime: new Date().getTime(),
type: ChatMessageTypes.robot,
},
masterId: getFromId() as string,
isChattingWithTargetId: true,
isRoboot: true,
})
});
queryFaqAnswer({
question: content
question: content,
}).then((ret) => {
if (ret.code === 200) {
/* 答 */
messageStore.displayNewMessage({
......@@ -227,12 +259,12 @@ export default defineComponent({
state: null,
datetime: new Date().getTime(),
type: ChatMessageTypes.robot,
})
});
ChatDBService.getInstance().handleEveryReceive({
msg: {
content: {
content: ret.data
content: ret.data,
},
from: target as string,
target: getFromId(),
......@@ -244,50 +276,61 @@ export default defineComponent({
masterId: getFromId() as string,
isChattingWithTargetId: true,
isRoboot: true,
})
});
}
})
}
});
};
watch(chatCardTimeStamp, async () => {
const messageList = await ChatMessageDB.getInstance().getMessage(getFromId() as string, route.query.targetId as string);
const messageList = await ChatMessageDB.getInstance().getMessage(
getFromId() as string,
route.query.targetId as string
);
messageStore.messages.splice(0, messageStore.messages.length);
messageStore.messages.push(...messageList);
})
});
const title = ref('')
const title = ref("");
const isChatWithRoboot = computed(() => {
return route.query.outlet !== undefined
})
return route.query.outlet !== undefined;
});
const isRobootOffLine = computed(() => {
if (isChatWithRoboot.value) {
return !!title.value.match(/\(已停止营业\)$/)
return !!title?.value?.match(/\(已停止营业\)$/);
} else {
return undefined;
}
})
});
const initTitle = async () => {
console.log(isChatWithRoboot.value, "show isChatWithRoboot")
console.log(isChatWithRoboot.value, "show isChatWithRoboot");
if (isChatWithRoboot.value) {
const list = await getDisplayNames([{ outletId: Number(route.query.targetId) }])
const list = await getDisplayNames([
{ outletId: Number(route.query.targetId) },
]);
title.value = list[0] as string;
} else {
const list = await getDisplayNames([{ address: route.query.targetId as string }])
const list = await getDisplayNames([
{ address: route.query.targetId as string },
]);
title.value = list[0] as string;
}
}
};
const initMessageList = async () => {
messageStore.messages.splice(0, messageStore.messages.length);
const messageList = await ChatMessageDB.getInstance().getMessage(getFromId() as string, route.query.targetId as string);
console.log(messageList, 'show messageList')
const messageList = await ChatMessageDB.getInstance().getMessage(
getFromId() as string,
route.query.targetId as string
);
console.log(messageList, "show messageList");
messageStore.messages.push(...messageList);
ChatListCardDB.getInstance().readMsg(getFromId() as string, route.query.targetId as string)
}
ChatListCardDB.getInstance().readMsg(
getFromId() as string,
route.query.targetId as string
);
};
const notifyUserAndStaffTheChatBegin = async () => {
await sendChatMessage({
......@@ -295,40 +338,39 @@ export default defineComponent({
content: {
bank: CONST_START_CHAT.user.id,
name: CONST_START_CHAT.staff.id,
account: '',
account: "",
} as MessageContent,
target: route.query.targetId as string
})
}
target: route.query.targetId as string,
});
};
watch(() => route.query.targetId, async () => {
await initMessageList();
await initTitle();
if (!isChatWithRoboot.value && route.query.beginChat !== undefined) {
setTimeout(() => {
if (!isChatWithRoboot.value) {
notifyUserAndStaffTheChatBegin()
}
}, 1000)
watch(
() => route.query.targetId,
async () => {
await initMessageList();
await initTitle();
if (!isChatWithRoboot.value && route.query.beginChat !== undefined) {
setTimeout(() => {
if (!isChatWithRoboot.value) {
notifyUserAndStaffTheChatBegin();
}
}, 1000);
}
}
})
);
onMounted(async () => {
initMessageList();
initTitle();
serviceShowValue.value = '人工服务'
})
serviceShowValue.value = "人工服务";
});
const showCall = ref(false)
const callPhone = ref('')
const showCall = ref(false);
const callPhone = ref("");
const isUser = computed(() => {
return getUserMsg()?.role === eRole.user
})
return getUserMsg()?.role === eRole.user;
});
return {
connectionState,
......@@ -350,7 +392,7 @@ export default defineComponent({
callPhone,
isChatWithRoboot,
isUser,
isRobootOffLine
isRobootOffLine,
};
},
});
......
......@@ -6,7 +6,9 @@
@click="inputType === 1 ? (inputType = 2) : (inputType = 1)"
class="w-7 h-7 mx-2.5 text-center select-none focus:outline-none"
>
<i v-if="inputType === 1" class="iconfont text-primary text-xl">&#xe604;</i>
<i v-if="inputType === 1" class="iconfont text-primary text-xl"
>&#xe604;</i
>
<i v-else class="iconfont text-primary text-xl">&#xe60d;</i>
</button>
......@@ -30,13 +32,29 @@
<button
v-else
@click="inputText.trim().length !== 0 && handleSend()"
class="mx-2.5 px-4 py-1.5 flex items-center rounded-md text-center select-none focus:outline-none text-app-white"
class="
mx-2.5
px-4
py-1.5
flex
items-center
rounded-md
text-center
select-none
focus:outline-none
text-app-white
"
style="background: rgb(7, 193, 99)"
>发送</button>
>
发送
</button>
</div>
<!-- input menu -->
<div v-show="showMenu" class="min-h-input-menu flex items-center px-8 text-sm text-subtle">
<div
v-show="showMenu"
class="min-h-input-menu flex items-center px-8 text-sm text-subtle"
>
<ChatInputAlbumVue />
<!-- <ChatInputCameraVue /> -->
</div>
......@@ -53,8 +71,7 @@ import ChatInputAlbumVue from "./ChatInputAlbum.vue";
import ChatInputCameraVue from "./ChatInputCamera.vue";
import { getFromId } from "@/store/appCallerStore";
import { textInputStore } from "@/store/textInputStore";
import { v4 as uuidv4 } from 'uuid'
import Icon from "@/components/common/Icon.vue";
import { v4 as uuidv4 } from "uuid";
import { useRoute } from "vue-router";
import { getUserMsg } from "@/utils/userMsg";
import { eRole } from "@/types/roleType";
......@@ -68,7 +85,6 @@ export default defineComponent({
ChatInputTextVue,
ChatInputAlbumVue,
ChatInputCameraVue,
Icon,
},
setup(props) {
......@@ -78,7 +94,7 @@ export default defineComponent({
voice,
}
const target = route.query.targetId as string
const target = route.query.targetId as string;
/** 输入框类型,文本 or 语音 */
const inputType = ref(InputType.text);
......@@ -94,7 +110,11 @@ export default defineComponent({
type: ChatMessageTypes;
content: MessageContent;
}) => {
messageStore.sendMessage({ type: payload.type, content: payload.content, target: route.query.targetId as string });
messageStore.sendMessage({
type: payload.type,
content: payload.content,
target: route.query.targetId as string,
});
textInputStore.clearTextMessage();
};
......@@ -117,7 +137,7 @@ export default defineComponent({
// })
const handleSend = () => {
console.log('handle send');
console.log("handle send");
const isStaff = getUserMsg()?.role === eRole.staff;
const isUser = getUserMsg()?.role === eRole.user;
......@@ -127,43 +147,43 @@ export default defineComponent({
*/
messageStore.displayNewMessage({
content: {
content: inputText.value
content: inputText.value,
},
from: getFromId() as string,
target: target,
uuid: uuidv4(),
state: 'success',
state: "success",
datetime: new Date().getTime(),
type: ChatMessageTypes.robot,
})
});
ChatDBService.getInstance().handleEveryReceive({
msg: {
content: {
content: inputText.value
content: inputText.value,
},
from: getFromId() as string,
target: target,
uuid: uuidv4(),
state: 'success',
state: "success",
datetime: new Date().getTime(),
type: ChatMessageTypes.robot,
},
masterId: getFromId() as string,
isChattingWithTargetId: true,
isRoboot: true,
})
});
textInputStore.clearTextMessage();
} else {
sendChatMessage({ type: 1, content: { content: inputText.value } })
sendChatMessage({ type: 1, content: { content: inputText.value } });
}
}
};
return {
inputType,
inputText,
showMenu,
sendChatMessage,
handleSend
handleSend,
// showReceiptInput,
};
},
......@@ -173,4 +193,4 @@ export default defineComponent({
.min-h-input-bar {
min-height: 60px;
}
</style>
\ No newline at end of file
</style>
<template>
<div class="describe mx-auto">
<div class="box flex p-5">
<Icon name="icon-chanpinjieshao" size="30" color="RGBA(62, 79, 175, 1)" />
<IconVue
name="icon-chanpinjieshao"
size="30"
color="RGBA(62, 79, 175, 1)"
/>
<div class="ml-3">
<div class="title">产品介绍</div>
<div class="content whitespace-pre-wrap mt-2.5">
{{products}}
{{ products }}
</div>
</div>
</div>
<div class="box flex p-5">
<Icon name="icon-chanpintedian" size="30" color="RGBA(62, 79, 175, 1)" />
<IconVue
name="icon-chanpintedian"
size="30"
color="RGBA(62, 79, 175, 1)"
/>
<div class="ml-3">
<div class="title">产品特点</div>
<div class="content whitespace-pre-wrap mt-2.5">
{{features}}
{{ features }}
</div>
</div>
</div>
<div class="box flex p-5">
<Icon name="icon-shiyongkehu" size="30" color="RGBA(62, 79, 175, 1)" />
<IconVue name="icon-shiyongkehu" size="30" color="RGBA(62, 79, 175, 1)" />
<div class="ml-3">
<div class="title">适用客户</div>
<div class="content whitespace-pre-wrap mt-2.5">
{{apply_to}}
{{ apply_to }}
</div>
</div>
</div>
<div class="box flex p-5">
<Icon name="icon-shenqingtiaojian" size="30" color="RGBA(62, 79, 175, 1)" />
<IconVue
name="icon-shenqingtiaojian"
size="30"
color="RGBA(62, 79, 175, 1)"
/>
<div class="ml-3">
<div class="title">申请条件</div>
<div class="content whitespace-pre-wrap mt-2.5">
{{apply_cond}}
{{ apply_cond }}
</div>
</div>
</div>
<div class="box flex p-5">
<Icon name="icon-tijiaotiaojian" size="30" color="RGBA(62, 79, 175, 1)" />
<IconVue
name="icon-tijiaotiaojian"
size="30"
color="RGBA(62, 79, 175, 1)"
/>
<div class="ml-3">
<div class="title">提交条件</div>
<div class="content whitespace-pre-wrap mt-2.5">
{{submit_cond}}
{{ submit_cond }}
</div>
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import Icon from "@/components/common/Icon.vue";
import IconVue from "@/components/common/Icon.vue";
import { onMounted } from "@vue/runtime-core";
const props = defineProps({
products:{
products: {
type: String,
required:true,
required: true,
},
features:{
features: {
type: String,
required:true,
required: true,
},
apply_to:{
apply_to: {
type: String,
required:true,
required: true,
},
apply_cond:{
apply_cond: {
type: String,
required:true,
required: true,
},
submit_cond:{
submit_cond: {
type: String,
required:true,
required: true,
},
})
});
</script>
<style lang="less" scoped>
.describe {
......@@ -100,4 +115,4 @@ const props = defineProps({
line-height: 24px;
}
}
</style>
\ No newline at end of file
</style>
<script lang="tsx">
import { defineComponent, onMounted, onUnmounted, reactive, ref, Transition } from "vue";
import {
defineComponent,
onMounted,
onUnmounted,
reactive,
ref,
Transition,
} from "vue";
import NavBar from "@/components/NavBar/index.vue";
import LoanCard2 from "@/components/Loan/LoanCard2/index.vue";
import Icon from "@/components/common/Icon.vue";
import LoanDetailDescribe from "./components/LoanDetailDescribe/index.vue";
import Branch from "@/components/Mine/Branch/branch.vue";
import leftBg from "@/assets/img/left_bg.png";
import crown from "@/assets/img/crown.png";
import { useRoute } from "vue-router";
import { queryLoanProductInfo } from "@/service/LoanProductService/index"
import { iLoanProdcutItem, eGuaranteeType } from "@/service/LoanProductService/type"
import { filterGuaranteeType } from "@/utils/guarantee-type"
import { Skeleton } from "vant"
import { iNearbyOutLet } from "@/service/AddressService/types"
import AddressService from "@/service/AddressService"
import { queryLoanProductInfo } from "@/service/LoanProductService/index";
import {
iLoanProdcutItem,
eGuaranteeType,
} from "@/service/LoanProductService/type";
import { filterGuaranteeType } from "@/utils/guarantee-type";
import { Skeleton } from "vant";
import { iNearbyOutLet } from "@/service/AddressService/types";
import AddressService from "@/service/AddressService";
import router from "@/router";
import UserService from "@/service/UserService";
import { goToChatWithOutletRoboot } from "@/router/navigate";
import { chatAuthCheck } from "@/utils/authCheck";
import { eRole } from '@/types/roleType'
import { getUserMsg } from '@/utils/userMsg'
import { eRole } from "@/types/roleType";
import { getUserMsg } from "@/utils/userMsg";
function isInViewPort(element: HTMLElement, barHeight: number) {
const viewWidth = window.innerWidth || document.documentElement.clientWidth;
......@@ -32,80 +41,78 @@ function isInViewPort(element: HTMLElement, barHeight: number) {
}
function showChat() {
const user = getUserMsg()
if (!user) return true
return user && (user?.role2 === eRole.user)
const user = getUserMsg();
if (!user) return true;
return user && user?.role2 === eRole.user;
}
export default defineComponent({
components: {
NavBar,
LoanCard2,
Icon,
LoanDetailDescribe,
Branch,
Transition,
Skeleton
Skeleton,
},
setup() {
const applyEl = ref();
const barHeight = ref();
const canSeeApplyBtn = ref(true);
const uuid = ref('')
const min_amount = ref(0)
const max_amount = ref(0)
const rate = ref(0)
const rate_lower = ref(0)
const rate_upper = ref(0)
const inst_name = ref('')
const product_name = ref('')
const date = ref(0)
const guarantee_type = ref(eGuaranteeType.credit)
const products = ref('')
const features = ref('')
const apply_to = ref('')
const apply_cond = ref('')
const submit_cond = ref('')
const uuid = ref("");
const min_amount = ref(0);
const max_amount = ref(0);
const rate = ref(0);
const rate_lower = ref(0);
const rate_upper = ref(0);
const inst_name = ref("");
const product_name = ref("");
const date = ref(0);
const guarantee_type = ref(eGuaranteeType.credit);
const products = ref("");
const features = ref("");
const apply_to = ref("");
const apply_cond = ref("");
const submit_cond = ref("");
const state = reactive({
outletList: [] as iNearbyOutLet[],
loading: false,
})
});
const fetchBranch = async () => {
state.loading = true;
const ret = await AddressService.getInstance().getNearby({
bank_code: Number(process.env.VUE_APP_BANK_CODE),
number: 1,
})
});
if (ret.code === 200) {
state.outletList = ret.data;
console.log(state.outletList[0]);
}
state.loading = false;
}
};
onMounted(() => {
uuid.value = useRoute().params.uuid as string
uuid.value = useRoute().params.uuid as string;
queryLoanProductInfo({ uuid: uuid.value }).then((ret) => {
if (ret.code === 200) {
console.log(ret);
const productItem = ret.data
min_amount.value = productItem.min_amount
max_amount.value = productItem.max_amount
rate.value = productItem.rate
inst_name.value = productItem.inst_name
product_name.value = productItem.product_name
date.value = productItem.date
guarantee_type.value = productItem.guarantee_type
products.value = productItem.products
features.value = productItem.features
apply_to.value = productItem.apply_to
apply_cond.value = productItem.apply_cond
submit_cond.value = productItem.submit_cond
const productItem = ret.data;
min_amount.value = productItem.min_amount;
max_amount.value = productItem.max_amount;
rate.value = productItem.rate;
inst_name.value = productItem.inst_name;
product_name.value = productItem.product_name;
date.value = productItem.date;
guarantee_type.value = productItem.guarantee_type;
products.value = productItem.products;
features.value = productItem.features;
apply_to.value = productItem.apply_to;
apply_cond.value = productItem.apply_cond;
submit_cond.value = productItem.submit_cond;
}
fetchBranch()
})
fetchBranch();
});
const barEle = document.querySelector(".theBar");
barHeight.value = barEle?.clientHeight;
......@@ -120,34 +127,34 @@ export default defineComponent({
});
const handleClickApply = async () => {
if (!showChat()) return
console.log(11111111)
if (!showChat()) return;
console.log(11111111);
chatAuthCheck(getOutletAndNavigateToChat, () => {
router.push({
name: 'Login'
})
})
}
name: "Login",
});
});
};
const clickChatIcon = async () => {
chatAuthCheck(getOutletAndNavigateToChat, () => {
router.push({
name: 'Login'
})
})
}
name: "Login",
});
});
};
const getOutletAndNavigateToChat = async () => {
const ret = await AddressService.getInstance().getNearby({
bank_code: Number(process.env.VUE_APP_BANK_CODE),
number: 1,
})
});
if (ret.code === 200) {
goToChatWithOutletRoboot({
outletId: ret.data[0].outlet_id
})
outletId: ret.data[0].outlet_id,
});
}
}
};
return () => (
<>
......@@ -155,8 +162,13 @@ export default defineComponent({
<div class="group1 flex-col">
<NavBar
title={"产品详情"}
iconColor={canSeeApplyBtn.value ? "white" : 'black'}
style={{ 'background': canSeeApplyBtn.value ? '#2C3C92 !important' : 'white !important', 'color': canSeeApplyBtn.value ? 'white' : 'black' }}
iconColor={canSeeApplyBtn.value ? "white" : "black"}
style={{
background: canSeeApplyBtn.value
? "#2C3C92 !important"
: "white !important",
color: canSeeApplyBtn.value ? "white" : "black",
}}
showSecondIcon={true}
isRole={showChat()}
onClickSecondIcon={clickChatIcon}
......@@ -164,7 +176,9 @@ export default defineComponent({
<div class="block1 relative">
<div class="bd1 flex-col">
<div class="section1 flex-col relative">
<span class="word2 w-full break-all mt-16">{product_name.value}</span>
<span class="word2 w-full break-all mt-16">
{product_name.value}
</span>
<LoanCard2
class=" absolute mt-28 right-0 left-0 mx-auto"
min_amount={min_amount.value}
......@@ -219,33 +233,65 @@ export default defineComponent({
</div>
<div class=" bg-white mx-5 rounded-2xl overflow-hidden mt-5">
<div class="flex justify-between text-sm text-gray-800 border-b border-product-detail-bg">
<span class=" w-100 align-center bg-product-detail-bg py-4 inline-block text-center">产品机构</span>
<span class=" w-235 py-4 pr-5 inline-block break-words text-right">{inst_name.value}</span>
<span class=" w-100 align-center bg-product-detail-bg py-4 inline-block text-center">
产品机构
</span>
<span class=" w-235 py-4 pr-5 inline-block break-words text-right">
{inst_name.value}
</span>
</div>
<div class="flex justify-between text-sm text-gray-800 border-b border-product-detail-bg">
<span class=" w-100 align-center bg-product-detail-bg py-4 inline-block text-center">产品名称</span>
<span class=" w-235 py-4 pr-5 inline-block break-words text-right">{product_name.value}</span>
<span class=" w-100 align-center bg-product-detail-bg py-4 inline-block text-center">
产品名称
</span>
<span class=" w-235 py-4 pr-5 inline-block break-words text-right">
{product_name.value}
</span>
</div>
<div class="flex text-sm text-gray-800 border-b border-product-detail-bg justify-between">
<span class=" w-100 align-center bg-product-detail-bg py-4 inline-block text-center">贷款利率</span>
<span class=" w-235 py-4 pr-5 inline-block break-words text-right">{rate.value}%</span>
<span class=" w-100 align-center bg-product-detail-bg py-4 inline-block text-center">
贷款利率
</span>
<span class=" w-235 py-4 pr-5 inline-block break-words text-right">
{rate.value}%
</span>
</div>
<div class="flex text-sm text-gray-800 border-b border-product-detail-bg justify-between">
<span class=" w-100 align-center bg-product-detail-bg py-4 inline-block text-center">产品额度</span>
<span class=" w-235 py-4 pr-5 inline-block break-words text-right">{min_amount.value}~{max_amount.value}</span>
<span class=" w-100 align-center bg-product-detail-bg py-4 inline-block text-center">
产品额度
</span>
<span class=" w-235 py-4 pr-5 inline-block break-words text-right">
{min_amount.value}~{max_amount.value}
</span>
</div>
<div class="flex text-sm text-gray-800 border-b border-product-detail-bg justify-between">
<span class=" w-100 align-center bg-product-detail-bg py-4 inline-block text-center">贷款期限</span>
<span class=" w-235 py-4 pr-5 inline-block break-words text-right">{date.value}</span>
<span class=" w-100 align-center bg-product-detail-bg py-4 inline-block text-center">
贷款期限
</span>
<span class=" w-235 py-4 pr-5 inline-block break-words text-right">
{date.value}
</span>
</div>
<div class="flex text-sm text-gray-800 border-b border-product-detail-bg justify-between">
<span class=" w-100 align-center bg-product-detail-bg py-4 inline-block text-center">担保方式</span>
<span class=" w-235 py-4 pr-5 inline-block break-words text-right">{filterGuaranteeType(guarantee_type.value)}</span>
<span class=" w-100 align-center bg-product-detail-bg py-4 inline-block text-center">
担保方式
</span>
<span class=" w-235 py-4 pr-5 inline-block break-words text-right">
{filterGuaranteeType(guarantee_type.value)}
</span>
</div>
</div>
<LoanDetailDescribe class=" mt-5" products={products.value} features={features.value} apply_to={apply_to.value} apply_cond={apply_cond.value} submit_cond={submit_cond.value} />
<div class="title mx-5 mt-5" >营业网点</div>
<Skeleton loading={state.loading} row={4} class="mt-2">
<LoanDetailDescribe
class=" mt-5"
products={products.value}
features={features.value}
apply_to={apply_to.value}
apply_cond={apply_cond.value}
submit_cond={submit_cond.value}
/>
<div class="title mx-5 mt-5">营业网点</div>
{state.loading && <div class="mt-2"></div>}
<Skeleton loading={state.loading} row={4}>
{state.outletList[0] && (
<branch
class="my-3 mx-5"
......@@ -259,8 +305,7 @@ export default defineComponent({
weekend_status={state.outletList[0].weekend_status}
outlet_id={state.outletList[0].outlet_id}
/>
)
}
)}
</Skeleton>
</div>
<div class="h-12"></div>
......@@ -268,7 +313,10 @@ export default defineComponent({
{!canSeeApplyBtn.value && (
<div
class=" fixed left-0 right-0 bottom-0 h-12 bg-app-blue apply-btn flex items-center justify-center"
style={{ zIndex: 300, background: showChat() ? '#3E4FAF' : 'gray' }}
style={{
zIndex: 300,
background: showChat() ? "#3E4FAF" : "gray",
}}
onClick={handleClickApply}
>
立即申请
......@@ -304,4 +352,4 @@ export default defineComponent({
.w-235 {
width: 235px;
}
</style>
\ No newline at end of file
</style>
<template>
<div
class=" h-14 flex bg-tab-bar-bg items-center mx-2.5 overflow-hidden py-3"
class="h-14 flex bg-tab-bar-bg items-center mx-2.5 overflow-hidden py-3"
style="border-radius: 19px"
>
<div class="flex-row flex justify-around w-full h-full">
......@@ -15,7 +15,9 @@
>
<TabItem
:tabName="item.name"
:iconName="activeTabRouteName === item.routeName ? item.icon : item.icon1"
:iconName="
activeTabRouteName === item.routeName ? item.icon : item.icon1
"
:active="activeTabRouteName === item.routeName"
/>
</div>
......@@ -24,14 +26,12 @@
</template>
<script lang="ts">
import Icon from "@/components/common/Icon.vue";
import TabItem from "./TabItem.vue";
import tabList from "../../tabList";
import { defineComponent } from "vue";
export default defineComponent({
components: {
Icon,
TabItem,
},
props: ["list", "activeTabRouteName"],
......@@ -115,4 +115,4 @@ export default defineComponent({
height: 22px;
margin: 6px 0 0 58px;
}
</style>
\ No newline at end of file
</style>
......@@ -10,7 +10,7 @@
<div class="outer1 flex-col">
<div class="box2 flex-row justify-between">
<div class="flex items-center">
<icon
<IconVue
class="icon2"
name="icon-gouxuanyangshi"
color="#A7B2E3"
......@@ -19,7 +19,7 @@
<span class="word2">中低风险</span>
</div>
<div class="flex items-center">
<icon
<IconVue
class="icon2"
name="icon-gouxuanyangshi"
color="#A7B2E3"
......@@ -28,7 +28,7 @@
<span class="word3">风格稳健</span>
</div>
<div class="flex items-center">
<icon
<IconVue
class="icon2"
name="icon-gouxuanyangshi"
color="#A7B2E3"
......@@ -51,7 +51,7 @@
<script lang="ts">
import { defineComponent } from "vue";
import Icon from "@/components/common/Icon.vue";
import IconVue from "@/components/common/Icon.vue";
import FnsCard3 from "@/components/FnsCard3/index.vue";
import GroupTitle from "@/components/GroupTitle/index.vue";
import MainFnsSwip from "./Components/MainFnsSwip/index.vue";
......@@ -60,7 +60,7 @@ import NavBar from "@/components/NavBar/index.vue";
export default defineComponent({
components: {
Icon,
IconVue,
FnsCard3,
MainFnsSwip,
GroupTitle,
......@@ -86,4 +86,4 @@ export default defineComponent({
.mainfnsswip {
margin-top: -130px;
}
</style>
\ No newline at end of file
</style>
......@@ -4,20 +4,31 @@
v-for="app in appList"
:key="app.name"
class="w-1/4 mb-5 text-center"
@click="app.cb && app.cb() || $router.push({ name: app.routerName })"
@click="(app.cb && app.cb()) || $router.push({ name: app.routerName })"
>
<div class="w-16 h-16 bg-white app-container mx-auto flex items-center justify-center">
<Icon :name="app.icon" :color="app.color" size="25" />
<div
class="
w-16
h-16
bg-white
app-container
mx-auto
flex
items-center
justify-center
"
>
<IconVue :name="app.icon" :color="app.color" size="25" />
</div>
<div class="mt-2.5 app-name">{{ app.name }}</div>
</div>
</div>
</template>
<script lang="ts">
import Icon from "@/components/common/Icon.vue";
import IconVue from "@/components/common/Icon.vue";
import { defineComponent } from "vue";
export default defineComponent({
components: { Icon },
components: { IconVue },
props: ["appList"],
});
</script>
......@@ -32,4 +43,4 @@ export default defineComponent({
font-weight: 400;
color: #1b1f37;
}
</style>
\ No newline at end of file
</style>
......@@ -9,42 +9,54 @@
class="mx-3.5 wrap11"
>
<template #left-icon>
<Icon name="icon-tongzhi" color="#1B1F37" class="mr-2" />
<IconVue name="icon-tongzhi" color="#1B1F37" class="mr-2" />
</template>
<van-swipe vertical class="notice-swipe" :autoplay="3000" :show-indicators="false">
<van-swipe
vertical
class="notice-swipe"
:autoplay="3000"
:show-indicators="false"
>
<van-swipe-item
class="overflow-ellipsis overflow-hidden"
v-for="item in list"
:key="item.uuid"
>
<div @click="$router.push({path: '/msgDetail', query: {info: JSON.stringify(item)}})">
{{ item.content }}
</div>
<div
@click="
$router.push({
path: '/msgDetail',
query: { info: JSON.stringify(item) },
})
"
>
{{ item.content }}
</div>
</van-swipe-item>
</van-swipe>
</van-notice-bar>
</template>
<script lang="ts">
import Icon from "@/components/common/Icon.vue";
import IconVue from "@/components/common/Icon.vue";
import Vue, { defineComponent } from "vue";
import { NoticeBar, Swipe, SwipeItem } from "vant";
export default defineComponent({
components: {
Icon,
IconVue,
"van-swipe": Swipe,
"van-swipe-item": SwipeItem,
},
props: ['list'],
props: ["list"],
setup() {
const goPage = () => {
console.log(1111)
}
console.log(1111);
};
return {
goPage
}
}
goPage,
};
},
});
</script>
<style>
......@@ -86,4 +98,4 @@ export default defineComponent({
white-space: nowrap;
line-height: 17px;
}
</style>
\ No newline at end of file
</style>
......@@ -15,18 +15,25 @@
title="热门产品"
@click="$router.push({ name: 'Loan' })"
/>
<Skeleton :loading="skeLoading" :row="3" class="mt-2">
<LoanCard
v-if="!isReviewMode && product_name"
:max_amount="max_amount"
:product_name="product_name"
:features="features"
:inst_name="inst_name"
class="mt-5"
@click="
$router.push({ name: 'LoanDetail', params: { uuid: hotLoanUuid } })
"
/>
<div class="mt-2" v-if="skeLoading"></div>
<Skeleton :loading="skeLoading" :row="3">
<div>
<LoanCard
v-if="!isReviewMode && product_name"
:max_amount="max_amount"
:product_name="product_name"
:features="features"
:inst_name="inst_name"
class="mt-5"
@click="
$router.push({
name: 'LoanDetail',
params: { uuid: hotLoanUuid },
})
"
/>
</div>
</Skeleton>
<group-title
class="mt-7"
......@@ -41,7 +48,7 @@
title="精彩活动"
@click="$router.push({ name: 'ActivityList' })"
/>
<Skeleton :loading="skeLoading" :row="3" class="mt-2">
<Skeleton :loading="skeLoading" :row="3">
<div class="mx-5 mt-5 text-center">
<img
class="w-83 h-22 object-cover object-center rounded-lg inline-block"
......@@ -73,7 +80,6 @@ import Banner from "./Banner/Banner.vue";
import Navbar from "@/components/NavBar/index.vue";
import AppList from "./AppList/index.vue";
import appList from "./appList";
import Icon from "@/components/common/Icon.vue";
import Notify from "./Notify/index.vue";
import GroupTitle from "@/components/GroupTitle/index.vue";
import FnsCard from "./FnsCard/index.vue";
......@@ -115,7 +121,6 @@ export default defineComponent({
components: {
Banner,
AppList,
Icon,
Notify,
GroupTitle,
Navbar,
......
......@@ -63,7 +63,7 @@
<span class="word35">灵活快捷</span>
</div>
</div> -->
<LoanHotSwipe :loanMode="mode" class=" absolute top-0 bottom-0" />
<LoanHotSwipe :loanMode="mode" class="absolute top-0 bottom-0" />
</div>
<!-- 热门产品 -->
<!-- <GroupTitle title="热门产品" class="mt-2.5" v-if="count" iconName="" /> -->
......@@ -71,7 +71,7 @@
<GroupTitle
title="产品精选"
v-if="state.allProductList"
class=" mt-24"
class="mt-24"
@seeMore="$router.push({ name: 'LoanList', params: { mode: mode } })"
/>
<Skeleton
......@@ -102,7 +102,8 @@
v-if="src"
@click="$router.push({ name: 'ActivityList' })"
/>
<Skeleton :loading="skeLoading" :row="3" class="mt-2">
<div class="mt-2" v-if="skeLoading"></div>
<Skeleton :loading="skeLoading" :row="3">
<img
class="mx-5 w-83 h-22 mt-5 rounded-lg mx-auto"
:src="src"
......@@ -213,20 +214,15 @@ const fetchList = () => {
limit: 4,
loan_type: mode.value,
offset: 0,
product_status:eProductStatus.normal
product_status: eProductStatus.normal,
}).then((ret) => {
if (ret.code === 200) {
skeLoading.value = false;
const promiseList = [] as Promise<any>[]
const promiseList = [] as Promise<any>[];
ret.data.uuid.map((uuid) => {
const promise = queryLoanProductInfo({ uuid }).then((ret) => {
const {
max_amount,
inst_name,
uuid,
features,
product_name,
} = ret.data;
const { max_amount, inst_name, uuid, features, product_name } =
ret.data || {};
count.value = count.value + 1;
return {
max_amount,
......@@ -234,15 +230,15 @@ const fetchList = () => {
features,
inst_name,
uuid,
}
};
});
promiseList.push(promise);
});
Promise.all(promiseList).then((list) => {
list.forEach((i) => {
state.allProductList.push(i);
});
promiseList.push(promise)
});
Promise.all(promiseList).then(list=>{
list.forEach(i=>{
state.allProductList.push(i)
})
})
}
});
count.value = 0;
......@@ -273,4 +269,4 @@ onMounted(() => {
</script>
<style lang="less" scoped>
@import "./index.less";
</style>
\ No newline at end of file
</style>
......@@ -2,13 +2,25 @@
<div class="pb-5 min-h-screen overflow-scroll mb-8">
<nav-bar
title="网点服务"
:style="{ 'background-color': '#2C3C92 !important', 'color': 'white' }"
:style="{ 'background-color': '#2C3C92 !important', color: 'white' }"
iconColor="#FFFFFF"
/>
<!-- 当前网点 -->
<div class="px-4 bg-branch-deep-blue h-40 mb-28 bg-app-branch-deep-blue flow-root">
<Skeleton :row="3" :loading="result.loading" class="mt-5">
<div class="detail text-white text-sm pl-1 pt-8">提前预约网点 可享优先办理</div>
<div
class="
px-4
bg-branch-deep-blue
h-40
mb-28
bg-app-branch-deep-blue
flow-root
"
>
<div class="mt-5" v-if="result.loading"></div>
<Skeleton :row="3" :loading="result.loading">
<div class="detail text-white text-sm pl-1 pt-8">
提前预约网点 可享优先办理
</div>
<branch
:changeable="false"
:name="result.topItem.name"
......@@ -23,9 +35,12 @@
class="mt-3 shadow-sm z-20 relative"
/>
</Skeleton>
<Skeleton :row="3" :loading="result.loading" class="mt-12">
<div class="mt-12" v-if="result.loading"></div>
<Skeleton :row="3" :loading="result.loading">
<div class="overflow-scroll -mt-8 pb-5 z-10 relative">
<p class="mt-12 mb-3 text-base font-semibold text-gray-800">附近的网点</p>
<p class="mt-12 mb-3 text-base font-semibold text-gray-800">
附近的网点
</p>
<branch
v-for="(item, index) in result.lists"
:key="index"
......@@ -44,23 +59,27 @@
</div>
</Skeleton>
<!-- 附近网点 -->
<Skeleton :row="3" :loading="result.loading" class="mt-5 mb-10"></Skeleton>
<Skeleton :row="3" :loading="result.loading" class="mt-10"></Skeleton>
<Skeleton :row="3" :loading="result.loading" class="mt-10"></Skeleton>
<div class="mt-5" v-if="result.loading"></div>
<Skeleton :row="3" :loading="result.loading"></Skeleton>
<div class="mb-10" v-if="result.loading"></div>
<div class="mt-10" v-if="result.loading"></div>
<Skeleton :row="3" :loading="result.loading"></Skeleton>
<div class="mt-10" v-if="result.loading"></div>
<Skeleton :row="3" :loading="result.loading"></Skeleton>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent, reactive } from 'vue'
import NavBar from "@/components/NavBar/index.vue"
import Branch from '@/components/Mine/Branch/branch.vue'
import AddressService from '@/service/AddressService/index'
import { iNearbyOutLet } from "@/service/AddressService/types"
import { Skeleton } from 'vant'
import { defineComponent, reactive } from "vue";
import NavBar from "@/components/NavBar/index.vue";
import Branch from "@/components/Mine/Branch/branch.vue";
import AddressService from "@/service/AddressService/index";
import { iNearbyOutLet } from "@/service/AddressService/types";
import { Skeleton } from "vant";
const addressService = new AddressService()
const addressService = new AddressService();
export default defineComponent({
components: { NavBar, Branch, Skeleton },
......@@ -69,26 +88,27 @@ export default defineComponent({
topItem: {} as iNearbyOutLet,
lists: [] as iNearbyOutLet[],
loading: false,
})
});
const getAddressList = () => {
result.loading = true;
addressService.getNearby({
bank_code: Number(process.env.VUE_APP_BANK_CODE),
number: 4,
}).then(res => {
result.loading = false;
result.topItem = res.data[0]
result.lists = res.data.slice(1)
})
}
getAddressList()
addressService
.getNearby({
bank_code: Number(process.env.VUE_APP_BANK_CODE),
number: 4,
})
.then((res) => {
result.loading = false;
result.topItem = res.data[0];
result.lists = res.data.slice(1);
});
};
getAddressList();
return {
result,
}
}
})
};
},
});
</script>
<style scoped>
</style>
\ No newline at end of file
<style scoped></style>
<template>
<div class="min-h-screen" style="background:#F8F8FA">
<div class="min-h-screen" style="background: #f8f8fa">
<!-- top -->
<div class="top bg-center bg-no-repeat bg-cover">
<div class="w-full text-center text-white text-base pt-14">我的</div>
......@@ -7,7 +7,9 @@
<div class="mt-8 ml-5">
<img :src="avatarUrl" class="w-12 h-12 inline-block object-contain" />
<div class="text-white ml-3 inline-block">
<span v-if="isLogin">{{ filter.filterPhone(userMsg?.userInfo.phone) }}</span>
<span v-if="isLogin">{{
filter.filterPhone(userMsg?.userInfo.phone)
}}</span>
<span v-else>未登录</span>
</div>
</div>
......@@ -16,7 +18,12 @@
@click="$router.push('setting')"
>
<span class="text-sm leading-8 pr-2 pl-4 text-white">个人中心</span>
<icon name="icon-gengduo" color="#FFFFFF" size="14" class="my-auto pr-3" />
<IconVue
name="icon-gengduo"
color="#FFFFFF"
size="14"
class="my-auto pr-3"
/>
</div>
</div>
</div>
......@@ -41,9 +48,10 @@
title="我的网点"
@seeMore="$router.push('branch')"
class="mt-5"
:iconName="(isUser || !isLogin) ? 'icon-gengduo' : ''"
:iconName="isUser || !isLogin ? 'icon-gengduo' : ''"
/>
<Skeleton :loading="state.loading" :row="4" class="mt-2">
<div class="mt-2" v-if="state.loading"></div>
<Skeleton :loading="state.loading" :row="4">
<branch
class="mt-3 mx-5"
v-if="state.branchinfo || !isUser"
......@@ -62,49 +70,49 @@
</template>
<script lang="ts">
import { computed, defineComponent, onMounted, reactive, ref } from "vue"
import Icon from "@/components/common/Icon.vue"
import Service from '@/components/Mine/Service/index.vue'
import Branch from '@/components/Mine/Branch/branch.vue'
import GroupTitle from "@/components/GroupTitle/index.vue"
import { getCurrentUserAvatarUrl, getUserMsg } from "@/utils/userMsg"
import filter from "@/filter"
import AddressService from "@/service/AddressService"
import { iNearbyOutLet } from "@/service/AddressService/types"
import { Skeleton } from "vant"
import { eRole } from "@/types/roleType"
import { computed, defineComponent, onMounted, reactive, ref } from "vue";
import IconVue from "@/components/common/Icon.vue";
import Service from "@/components/Mine/Service/index.vue";
import Branch from "@/components/Mine/Branch/branch.vue";
import GroupTitle from "@/components/GroupTitle/index.vue";
import { getCurrentUserAvatarUrl, getUserMsg } from "@/utils/userMsg";
import filter from "@/filter";
import AddressService from "@/service/AddressService";
import { iNearbyOutLet } from "@/service/AddressService/types";
import { Skeleton } from "vant";
import { eRole } from "@/types/roleType";
export default defineComponent({
name: "Mine",
components: {
Icon,
IconVue,
Service,
Branch,
GroupTitle,
Skeleton
Skeleton,
},
props: {
iconName: {
type: String,
default: ''
default: "",
},
},
setup(props, context) {
const avatarUrl = getCurrentUserAvatarUrl()
const avatarUrl = getCurrentUserAvatarUrl();
const state = reactive({
branchinfo: {} as iNearbyOutLet,
loading: false,
})
});
const userMsg = computed(() => {
return getUserMsg()
})
return getUserMsg();
});
const isUser = computed(() => {
console.log('isuser', userMsg?.value?.role == eRole.user);
console.log("isuser", userMsg?.value?.role == eRole.user);
return userMsg?.value?.role == eRole.user
})
let branchinfo = reactive({} as iNearbyOutLet)
return userMsg?.value?.role == eRole.user;
});
let branchinfo = reactive({} as iNearbyOutLet);
onMounted(async () => {
state.loading = true;
......@@ -113,38 +121,40 @@ export default defineComponent({
const ret = await AddressService.getInstance().getNearby({
bank_code: Number(process.env.VUE_APP_BANK_CODE),
number: 1,
})
});
if (ret.code === 200) {
state.branchinfo = ret.data[0];
}
} else {
const ret = await AddressService.getInstance().getStaffOutlet()
const ret = await AddressService.getInstance().getStaffOutlet();
if (ret.code == 200) {
const ssid = ret.data.ss_id
AddressService.getInstance().getOutlets({
id: ssid,
level: 4
}).then((res) => {
if (res.code == 200) {
state.branchinfo = res.data
}
})
const ssid = ret.data.ss_id;
AddressService.getInstance()
.getOutlets({
id: ssid,
level: 4,
})
.then((res) => {
if (res.code == 200) {
state.branchinfo = res.data;
}
});
}
}
console.log('info', branchinfo);
console.log("info", branchinfo);
state.loading = false;
})
});
return {
filter,
state,
isUser,
userMsg,
avatarUrl
}
avatarUrl,
};
},
computed: {
isLogin() {
return !!getUserMsg()
return !!getUserMsg();
},
},
});
......@@ -154,4 +164,4 @@ export default defineComponent({
.top {
background-image: url(../../../assets/img/mine_bg.png);
}
</style>
\ No newline at end of file
</style>
......@@ -2,12 +2,30 @@
<div>
<nav-bar title="个人中心" :style="{ 'background-color': '#F7F7FA' }" />
<!-- 头像 -->
<div class="px-5 py-3 flex justify-between items-center border-b border-gray-200">
<div
class="
px-5
py-3
flex
justify-between
items-center
border-b border-gray-200
"
>
<span class="text-sm font-semibold">头像</span>
<img :src="avatarUrl" class="w-12 h-12 rounded-full object-contain" />
</div>
<!-- 手机号码 -->
<div class="px-5 py-5 flex justify-between items-center border-b border-gray-200">
<div
class="
px-5
py-5
flex
justify-between
items-center
border-b border-gray-200
"
>
<span class="text-sm font-semibold">手机号码</span>
<span class="text-sm">{{ getPhone }}</span>
</div>
......@@ -18,9 +36,12 @@
<div class="text-sm font-semibold">设置密码</div>
<div class="text-xs text-gray-400 pt-1">保障账户登录安全</div>
</div>
<div class="flex items-center text-xs h-1 text-right" @click="pushRouter">
<div
class="flex items-center text-xs h-1 text-right"
@click="pushRouter"
>
<span>设置</span>
<icon
<IconVue
name="icon-gengduo"
color="#8E92A3"
size="12"
......@@ -30,62 +51,71 @@
</div>
</div>
</div>
<div @click="clickLogout" class="logout-btn flex items-center justify-center fixed">退出登录</div>
<div
@click="clickLogout"
class="logout-btn flex items-center justify-center fixed"
>
退出登录
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import NavBar from "@/components/NavBar/index.vue"
import Icon from "@/components/common/Icon.vue"
import { eAccountType } from "@/views/Auth/Login/types"
import { deleteUserMsg, getCurrentUserAvatarUrl, getUserMsg } from '@/utils/userMsg'
import filter from "@/filter"
import router from '@/router'
import { userLogout } from '@/service/UserManagementService'
import { defineComponent } from "vue";
import NavBar from "@/components/NavBar/index.vue";
import IconVue from "@/components/common/Icon.vue";
import { eAccountType } from "@/views/Auth/Login/types";
import {
deleteUserMsg,
getCurrentUserAvatarUrl,
getUserMsg,
} from "@/utils/userMsg";
import filter from "@/filter";
import router from "@/router";
import { userLogout } from "@/service/UserManagementService";
export default defineComponent({
components: { NavBar, Icon },
components: { NavBar, IconVue },
data() {
return {
role: ''
}
role: "",
};
},
computed: {
hasPassword(): eAccountType {
return eAccountType.REG_NOPD
return eAccountType.REG_NOPD;
},
getPhone() {
const phone = getUserMsg()?.userInfo.phone + ''
var newphone = phone.replace(phone.substr(3, 5), "*****")
return newphone
}
const phone = getUserMsg()?.userInfo.phone + "";
var newphone = phone.replace(phone.substr(3, 5), "*****");
return newphone;
},
},
setup() {
const avatarUrl = getCurrentUserAvatarUrl()
const avatarUrl = getCurrentUserAvatarUrl();
const clickLogout = () => {
userLogout();
deleteUserMsg();
router.push({
name: 'Home'
})
}
name: "Home",
});
};
return {
userMsg: getUserMsg(),
filter,
clickLogout,
avatarUrl
}
avatarUrl,
};
},
methods: {
pushRouter() {
this.$router.push({
name: 'PwdSetting',
name: "PwdSetting",
query: {
phone: this.userMsg?.userInfo.phone
}
})
phone: this.userMsg?.userInfo.phone,
},
});
},
}
})
},
});
</script>
<style scoped>
......@@ -102,4 +132,4 @@ export default defineComponent({
margin-left: 40px;
bottom: 50px;
}
</style>
\ No newline at end of file
</style>
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