- 在 http.js 中添加了对 401 状态码的处理,重定向到登录页面 - 更新了 LiveRoom 组件,暂时注释掉了 initializePlayer 方法 - 在 goods store 中添加了 currentItem 和 artWorkDetail 两个状态 - 更新了 message 组件,添加了对错误信息的处理 -调整了首页布局,移除了多余的 transition 标签 - 更新了登录页面的默认验证码
58 lines
1.1 KiB
Vue
58 lines
1.1 KiB
Vue
<script setup>
|
|
|
|
import error from '../images/error.png'
|
|
import success from '../images/success.png'
|
|
import warning from '../images/warning.png'
|
|
|
|
const props = defineProps({
|
|
type: {
|
|
type: String,
|
|
default: 'success',
|
|
validator: value => ['success', 'error', 'warning'].includes(value),
|
|
},
|
|
text: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
})
|
|
|
|
const typeConfig = {
|
|
success: {
|
|
imgSrc: success,
|
|
borderColor: '#C5E7D5',
|
|
bgColor: '#EDF7F2',
|
|
},
|
|
error: {
|
|
imgSrc: error,
|
|
borderColor: '#F3CBD3',
|
|
bgColor: '#FBEEF1',
|
|
},
|
|
warning: {
|
|
imgSrc: warning,
|
|
borderColor: '#FAE0B5',
|
|
bgColor: '#FEF7ED',
|
|
},
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<div
|
|
class="box-border min-h-[46px] w-[343px] flex items-center border rounded-[4px] px-[15px] shadow-sm"
|
|
:style="{
|
|
borderColor: typeConfig[type].borderColor,
|
|
backgroundColor: typeConfig[type].bgColor,
|
|
}"
|
|
>
|
|
<div class="mr-[9px] h-[20px] w-[20px]">
|
|
<img
|
|
:src="typeConfig[type].imgSrc"
|
|
class="h-full w-full"
|
|
alt=""
|
|
>
|
|
</div>
|
|
<div class="text-[14px] text-black leading-normal">
|
|
{{ text }}
|
|
</div>
|
|
</div>
|
|
</template>
|