Commit eb958bae authored by xhx's avatar xhx

Loan按钮

parent db3cbcdd
...@@ -6,7 +6,7 @@ import { chatAuthCheck } from "@/utils/authCheck"; ...@@ -6,7 +6,7 @@ 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", "isValid"],
setup(props) { setup(props) {
const handleClick = async () => { const handleClick = async () => {
chatAuthCheck(async () => { chatAuthCheck(async () => {
...@@ -41,9 +41,12 @@ export default defineComponent({ ...@@ -41,9 +41,12 @@ export default defineComponent({
</div> </div>
</div> </div>
<button <button
class="bd12 flex-col" // class=""
class={props.isValid ? ' bd12 flex-col' : ' bd12 bggray flex-col'}
onClick={() => { onClick={() => {
console.log(1123123) console.log(1123123)
if (!props.isValid) return
console.log('--------',11111111)
handleClick(); handleClick();
}} }}
ref={(el) => { ref={(el) => {
...@@ -90,6 +93,22 @@ export default defineComponent({ ...@@ -90,6 +93,22 @@ export default defineComponent({
line-height: 20px; line-height: 20px;
text-align: center; 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 { .bd13 {
z-index: 14; z-index: 14;
...@@ -148,4 +167,5 @@ export default defineComponent({ ...@@ -148,4 +167,5 @@ export default defineComponent({
} }
} }
} }
</style> </style>
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
:color="iconColor" :color="iconColor"
/> />
<icon <icon
v-if="showSecondIcon" v-if="showSecondIcon && isRole"
name="icon-kefu" name="icon-kefu"
class="absolute left-11" class="absolute left-11"
size="18" size="18"
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
import { notchHeight } from "@/store/AppStore"; import { notchHeight } from "@/store/AppStore";
import { defineComponent } from "vue"; import { defineComponent } from "vue";
import Icon from "../common/Icon.vue"; import Icon from "../common/Icon.vue";
import { default } from '../../service/index';
export default defineComponent({ export default defineComponent({
inheritAttrs: false, inheritAttrs: false,
emits: ['clickSecondIcon'], emits: ['clickSecondIcon'],
...@@ -83,6 +84,10 @@ export default defineComponent({ ...@@ -83,6 +84,10 @@ export default defineComponent({
type: Boolean, type: Boolean,
default: false, default: false,
}, },
isRole: {
type: Boolean,
default: false,
},
showSearchIcon: { showSearchIcon: {
type: Boolean, type: Boolean,
default: false, default: false,
......
...@@ -18,6 +18,8 @@ import router from "@/router"; ...@@ -18,6 +18,8 @@ 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"; import { chatAuthCheck } from "@/utils/authCheck";
import { eRole } from '@/types/roleType'
import { getUserMsg } from '@/utils/userMsg'
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;
...@@ -29,6 +31,12 @@ function isInViewPort(element: HTMLElement, barHeight: number) { ...@@ -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({ export default defineComponent({
components: { components: {
NavBar, NavBar,
...@@ -112,6 +120,8 @@ export default defineComponent({ ...@@ -112,6 +120,8 @@ export default defineComponent({
}); });
const handleClickApply = async () => { const handleClickApply = async () => {
if (!showChat()) return
console.log(11111111)
chatAuthCheck(getOutletAndNavigateToChat, () => { chatAuthCheck(getOutletAndNavigateToChat, () => {
router.push({ router.push({
name: 'Login' name: 'Login'
...@@ -148,6 +158,7 @@ export default defineComponent({ ...@@ -148,6 +158,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}
isRole={showChat()}
onClickSecondIcon={clickChatIcon} onClickSecondIcon={clickChatIcon}
occupyPosition={false} occupyPosition={false}
/> />
...@@ -160,6 +171,7 @@ export default defineComponent({ ...@@ -160,6 +171,7 @@ export default defineComponent({
min_amount={min_amount.value} min_amount={min_amount.value}
max_amount={max_amount.value} max_amount={max_amount.value}
rate_lower={rate.value} rate_lower={rate.value}
isValid={showChat()}
setRef={(el: HTMLElement) => { setRef={(el: HTMLElement) => {
applyEl.value = el; applyEl.value = el;
}} }}
...@@ -257,7 +269,7 @@ export default defineComponent({ ...@@ -257,7 +269,7 @@ export default defineComponent({
{!canSeeApplyBtn.value && ( {!canSeeApplyBtn.value && (
<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, background: showChat() ? '#3E4FAF' : 'gray' }}
onClick={handleClickApply} 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