fix: ai隐藏样式

master
xjs 2025-04-27 15:19:46 +08:00
parent b37c3dc1b4
commit 9a79f7cc88
3 changed files with 23 additions and 7 deletions

View File

@ -1,5 +1,7 @@
<template> <template>
<view class="mx-5 rounded-lg bg-white px-[32rpx] py-[56rpx]"> <view
:class="`mx-5 rounded-lg bg-white px-[32rpx] ${userStore.userInfo.openid ? 'py-[56rpx]' : 'py-[26rpx]'}`"
>
<view <view
class="flex items-center justify-between mx-[34rpx] py-[26rpx]" class="flex items-center justify-between mx-[34rpx] py-[26rpx]"
style="border-bottom: 2rpx solid #ededed" style="border-bottom: 2rpx solid #ededed"
@ -22,7 +24,7 @@
<image <image
class="w-[74%] h-[50rpx]" class="w-[74%] h-[50rpx]"
mode="widthFix" mode="widthFix"
src="https://api.static.ycymedu.com/images/homepageheadtmp.png" src="https://api.static.ycymedu.com/pagefirstloginbg.png"
/> />
</view> </view>
<view class="mt-[56rpx] flex items-center justify-between" v-if="userStore.userInfo.openid"> <view class="mt-[56rpx] flex items-center justify-between" v-if="userStore.userInfo.openid">
@ -42,7 +44,7 @@
</view> </view>
<view class="flex items-center justify-between mt-[26rpx]" v-else> <view class="flex items-center justify-between mt-[26rpx]" v-else>
<button <button
class="h-[88rpx]! w-full! text-[#fff]! text-[30rpx]! bg-[#1580FF]! font-normal flex! items-center! justify-center! rounded-[8rpx]!" class="h-[78rpx]! w-full! text-[#fff]! text-[30rpx]! bg-[#1580FF]! font-normal flex! items-center! justify-center! rounded-[8rpx]!"
@click="navigatorToLogin" @click="navigatorToLogin"
> >
登录/注册 登录/注册

View File

@ -3,7 +3,7 @@
<view <view
class="pt-[16rpx] px-[32rpx] mt-[20rpx] flex items-center justify-center bg-[#fff] pb-safe sticky bottom-0 z-999" class="pt-[16rpx] px-[32rpx] mt-[20rpx] flex items-center justify-center bg-[#fff] pb-safe sticky bottom-0 z-999"
@click="toAiAssistant" @click="toAiAssistant"
v-if="userStore.userInfo.isShowAi" v-if="aiShow"
> >
<view <view
class="rounded-[8rpx] border-[#1580FF] border-[2rpx] border-solid w-full py-[14rpx] flex items-center justify-center" class="rounded-[8rpx] border-[#1580FF] border-[2rpx] border-solid w-full py-[14rpx] flex items-center justify-center"
@ -19,8 +19,22 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { useUserStore } from '@/store' import { sysDictType } from '@/service/index/api'
const userStore = useUserStore()
const aiShow = ref(true)
sysDictType({ id: 619330547859525 }).then((res) => {
const { code, result } = res
const { status } = result as { status: number }
if (code === 200) {
if (status === 1) {
aiShow.value = false
} else {
aiShow.value = true
}
}
})
const props = defineProps({ const props = defineProps({
pageId: { pageId: {
type: Number, type: Number,

View File

@ -57,7 +57,7 @@ const initState = {
batchDataUrl: '', batchDataUrl: '',
batchName: '', batchName: '',
wishList: [], wishList: [],
isShowAi: false, isShowAi: true,
} }
export const useUserStore = defineStore( export const useUserStore = defineStore(