Commit eb958bae authored by xhx's avatar xhx

Loan按钮

parent db3cbcdd
......@@ -6,7 +6,7 @@ import { chatAuthCheck } from "@/utils/authCheck";
import { defineComponent, ref } from "vue";
export default defineComponent({
props: ["setRef", "min_amount", "max_amount", "rate_lower", "rate_upper"],
props: ["setRef", "min_amount", "max_amount", "rate_lower", "rate_upper", "isValid"],
setup(props) {
const handleClick = async () => {
chatAuthCheck(async () => {
......@@ -41,9 +41,12 @@ export default defineComponent({
</div>
</div>
<button
class="bd12 flex-col"
// class=""
class={props.isValid ? ' bd12 flex-col' : ' bd12 bggray flex-col'}
onClick={() => {
console.log(1123123)
if (!props.isValid) return
console.log('--------',11111111)
handleClick();
}}
ref={(el) => {
......@@ -90,6 +93,22 @@ export default defineComponent({
line-height: 20px;
text-align: center;
}
.txt10 {
z-index: 13;
width: 56px;
display: block;
overflow-wrap: break-word;
color: rgba(255, 255, 255, 1);
background: gray;
font-size: 14px;
font-family: PingFangSC-Semibold;
white-space: nowrap;
line-height: 20px;
text-align: center;
}
}
.bggray {
background-color: gray;
}
.bd13 {
z-index: 14;
......@@ -148,4 +167,5 @@ export default defineComponent({
}
}
}
</style>
\ No newline at end of file
......@@ -16,7 +16,7 @@
:color="iconColor"
/>
<icon
v-if="showSecondIcon"
v-if="showSecondIcon && isRole"
name="icon-kefu"
class="absolute left-11"
size="18"
......@@ -59,6 +59,7 @@
import { notchHeight } from "@/store/AppStore";
import { defineComponent } from "vue";
import Icon from "../common/Icon.vue";
import { default } from '../../service/index';
export default defineComponent({
inheritAttrs: false,
emits: ['clickSecondIcon'],
......@@ -83,6 +84,10 @@ export default defineComponent({
type: Boolean,
default: false,
},
isRole: {
type: Boolean,
default: false,
},
showSearchIcon: {
type: Boolean,
default: false,
......
......@@ -18,6 +18,8 @@ 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'
function isInViewPort(element: HTMLElement, barHeight: number) {
const viewWidth = window.innerWidth || document.documentElement.clientWidth;
......@@ -29,6 +31,12 @@ function isInViewPort(element: HTMLElement, barHeight: number) {
);
}
function showChat() {
const user = getUserMsg()
if (!user) return true
return user && (user?.role2 === eRole.user)
}
export default defineComponent({
components: {
NavBar,
......@@ -112,6 +120,8 @@ export default defineComponent({
});
const handleClickApply = async () => {
if (!showChat()) return
console.log(11111111)
chatAuthCheck(getOutletAndNavigateToChat, () => {
router.push({
name: 'Login'
......@@ -148,6 +158,7 @@ export default defineComponent({
iconColor={canSeeApplyBtn.value ? "white" : 'black'}
style={{ 'background': canSeeApplyBtn.value ? '#2C3C92 !important' : 'white !important', 'color': canSeeApplyBtn.value ? 'white' : 'black' }}
showSecondIcon={true}
isRole={showChat()}
onClickSecondIcon={clickChatIcon}
occupyPosition={false}
/>
......@@ -160,6 +171,7 @@ export default defineComponent({
min_amount={min_amount.value}
max_amount={max_amount.value}
rate_lower={rate.value}
isValid={showChat()}
setRef={(el: HTMLElement) => {
applyEl.value = el;
}}
......@@ -257,7 +269,7 @@ 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 }}
style={{ zIndex: 300, background: showChat() ? '#3E4FAF' : 'gray' }}
onClick={handleClickApply}
>
立即申请
......
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