ykt-wxapp/App.vue

392 lines
5.1 KiB
Vue
Raw Permalink Normal View History

2026-01-19 18:52:18 +08:00
<script>
2026-01-21 13:37:54 +08:00
import useAccountStore from "@/store/account.js";
2026-01-22 15:13:26 +08:00
import { globalTimChatManager } from "@/utils/tim-chat.js";
2026-01-19 18:52:18 +08:00
export default {
2026-01-21 13:37:54 +08:00
onLaunch: function () {
// 需在 pinia 安装后再获取 store避免 getActivePinia 报错
const { login } = useAccountStore();
login();
console.log("App Launch: ");
},
onShow: function () {
console.log("App Show");
},
onHide: function () {
console.log("App Hide");
2026-01-22 15:13:26 +08:00
// 小程序退出时退出腾讯IM登录
2026-01-22 16:35:05 +08:00
// try {
// if (globalTimChatManager && globalTimChatManager.tim) {
// console.log('小程序退出开始退出腾讯IM');
// globalTimChatManager.destroy();
// console.log('腾讯IM退出成功');
// }
// } catch (error) {
// console.error('退出腾讯IM失败:', error);
// }
2026-01-21 13:37:54 +08:00
},
};
2026-01-19 18:52:18 +08:00
</script>
<style lang="scss">
2026-01-27 13:42:59 +08:00
$primary-color: #0877F1;
2026-01-19 18:52:18 +08:00
page {
2026-01-21 13:37:54 +08:00
height: 100%;
background: #f5f5f5;
2026-01-19 18:52:18 +08:00
}
2026-01-27 13:42:59 +08:00
/* 全局按钮样式 - 使用项目主题色 */
button[type="primary"],
.button-primary,
uni-button[type="primary"] {
background-color: $primary-color !important;
border-color: $primary-color !important;
color: #fff !important;
}
button[type="primary"]:not([disabled]):active,
.button-primary:active,
uni-button[type="primary"]:not([disabled]):active {
background-color: darken($primary-color, 10%) !important;
border-color: darken($primary-color, 10%) !important;
}
/* 微信小程序按钮样式覆盖 */
.wx-button[type="primary"] {
background-color: $primary-color !important;
border-color: $primary-color !important;
color: #fff !important;
}
2026-01-19 18:52:18 +08:00
.shadow-up {
2026-01-21 13:37:54 +08:00
box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px,
rgba(0, 0, 0, 0.1) 0px -10px 15px -3px, rgba(0, 0, 0, 0.1) 0px -4px 6px -4px;
2026-01-19 18:52:18 +08:00
}
.shadow-lg {
2026-01-21 13:37:54 +08:00
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
2026-01-19 18:52:18 +08:00
}
.relative {
2026-01-21 13:37:54 +08:00
position: relative;
2026-01-19 18:52:18 +08:00
}
2026-01-23 14:36:28 +08:00
.absolute{
position: absolute;
}
2026-01-19 18:52:18 +08:00
.inline-block {
2026-01-21 13:37:54 +08:00
display: inline-block;
2026-01-19 18:52:18 +08:00
}
.flex {
2026-01-21 13:37:54 +08:00
display: flex;
2026-01-19 18:52:18 +08:00
}
.flex-col {
2026-01-21 13:37:54 +08:00
flex-direction: column;
2026-01-19 18:52:18 +08:00
}
.flex-wrap {
2026-01-21 13:37:54 +08:00
flex-wrap: wrap;
2026-01-19 18:52:18 +08:00
}
.flex-grow {
2026-01-21 13:37:54 +08:00
flex-grow: 1;
2026-01-19 18:52:18 +08:00
}
.flex-shrink-0 {
2026-01-21 13:37:54 +08:00
flex-shrink: 0;
2026-01-19 18:52:18 +08:00
}
.items-center {
2026-01-21 13:37:54 +08:00
align-items: center;
2026-01-19 18:52:18 +08:00
}
.justify-center {
2026-01-21 13:37:54 +08:00
justify-content: center;
2026-01-19 18:52:18 +08:00
}
.justify-between {
2026-01-21 13:37:54 +08:00
justify-content: space-between;
2026-01-19 18:52:18 +08:00
}
.justify-around {
2026-01-21 13:37:54 +08:00
justify-content: space-around;
2026-01-19 18:52:18 +08:00
}
.justify-end {
2026-01-21 13:37:54 +08:00
justify-content: flex-end;
2026-01-19 18:52:18 +08:00
}
.bg-gray {
2026-01-21 13:37:54 +08:00
background: #f5f5f5;
2026-01-19 18:52:18 +08:00
}
.bg-primary {
2026-01-21 13:37:54 +08:00
background: $primary-color;
2026-01-19 18:52:18 +08:00
}
.bg-success {
2026-01-21 13:37:54 +08:00
background: green;
2026-01-19 18:52:18 +08:00
}
.bg-white {
2026-01-21 13:37:54 +08:00
background: #fff;
2026-01-19 18:52:18 +08:00
}
.bg-warning {
2026-01-21 13:37:54 +08:00
background: orange;
2026-01-19 18:52:18 +08:00
}
.bg-danger {
2026-01-21 13:37:54 +08:00
background: rgb(248 113 113);
2026-01-19 18:52:18 +08:00
}
.py-5 {
2026-01-21 13:37:54 +08:00
padding-top: 10rpx;
padding-bottom: 10rpx;
2026-01-19 18:52:18 +08:00
}
.p-15 {
2026-01-21 13:37:54 +08:00
padding: 30rpx;
2026-01-19 18:52:18 +08:00
}
.p-10 {
2026-01-21 13:37:54 +08:00
padding: 20rpx;
2026-01-19 18:52:18 +08:00
}
.px-5 {
2026-01-21 13:37:54 +08:00
padding-left: 10rpx;
padding-right: 10rpx;
2026-01-19 18:52:18 +08:00
}
.px-10 {
2026-01-21 13:37:54 +08:00
padding-left: 20rpx;
padding-right: 20rpx;
2026-01-19 18:52:18 +08:00
}
.px-12 {
2026-01-21 13:37:54 +08:00
padding-left: 24rpx;
padding-right: 24rpx;
2026-01-19 18:52:18 +08:00
}
.px-15 {
2026-01-21 13:37:54 +08:00
padding-left: 30rpx;
padding-right: 30rpx;
2026-01-19 18:52:18 +08:00
}
.pt-5 {
2026-01-21 13:37:54 +08:00
padding-top: 10rpx;
2026-01-19 18:52:18 +08:00
}
.pt-15 {
2026-01-21 13:37:54 +08:00
padding-top: 30rpx;
2026-01-19 18:52:18 +08:00
}
.break-all {
2026-01-21 13:37:54 +08:00
word-break: break-all;
2026-01-19 18:52:18 +08:00
}
.pb-5 {
2026-01-21 13:37:54 +08:00
padding-bottom: 10rpx;
2026-01-19 18:52:18 +08:00
}
.pb-10 {
2026-01-21 13:37:54 +08:00
padding-bottom: 20rpx;
2026-01-19 18:52:18 +08:00
}
.py-10 {
2026-01-21 13:37:54 +08:00
padding-top: 20rpx;
padding-bottom: 20rpx;
2026-01-19 18:52:18 +08:00
}
.py-12 {
2026-01-21 13:37:54 +08:00
padding-top: 24rpx;
padding-bottom: 24rpx;
2026-01-19 18:52:18 +08:00
}
.py-15 {
2026-01-21 13:37:54 +08:00
padding-top: 30rpx;
padding-bottom: 30rpx;
2026-01-19 18:52:18 +08:00
}
.mr-5 {
2026-01-21 13:37:54 +08:00
margin-right: 10rpx;
2026-01-19 18:52:18 +08:00
}
.mr-10 {
2026-01-21 13:37:54 +08:00
margin-right: 20rpx;
2026-01-19 18:52:18 +08:00
}
.ml-15 {
2026-01-21 13:37:54 +08:00
margin-left: 30rpx;
2026-01-19 18:52:18 +08:00
}
.mb-5 {
2026-01-21 13:37:54 +08:00
margin-bottom: 10rpx;
2026-01-19 18:52:18 +08:00
}
.mb-10 {
2026-01-21 13:37:54 +08:00
margin-bottom: 20rpx;
2026-01-19 18:52:18 +08:00
}
.mt-10 {
2026-01-21 13:37:54 +08:00
margin-top: 20rpx;
2026-01-19 18:52:18 +08:00
}
.mt-15 {
2026-01-21 13:37:54 +08:00
margin-top: 30rpx;
2026-01-19 18:52:18 +08:00
}
.mt-12 {
2026-01-21 13:37:54 +08:00
margin-top: 24rpx;
2026-01-19 18:52:18 +08:00
}
.mx-10 {
2026-01-21 13:37:54 +08:00
margin-left: 20rpx;
margin-right: 20rpx;
2026-01-19 18:52:18 +08:00
}
.mx-auto {
2026-01-21 13:37:54 +08:00
margin-left: auto;
margin-right: auto;
2026-01-19 18:52:18 +08:00
}
.rounded {
2026-01-21 13:37:54 +08:00
border-radius: 16rpx;
2026-01-19 18:52:18 +08:00
}
.rounded-sm {
2026-01-21 13:37:54 +08:00
border-radius: 8rpx;
2026-01-19 18:52:18 +08:00
}
.rounded-full {
2026-01-21 13:37:54 +08:00
border-radius: 999px;
2026-01-19 18:52:18 +08:00
}
.text-center {
2026-01-21 13:37:54 +08:00
text-align: center;
2026-01-19 18:52:18 +08:00
}
.text-right {
2026-01-21 13:37:54 +08:00
text-align: right;
2026-01-19 18:52:18 +08:00
}
.text-gray {
2026-01-21 13:37:54 +08:00
color: #999;
2026-01-19 18:52:18 +08:00
}
.text-black {
2026-01-21 13:37:54 +08:00
color: #000;
2026-01-19 18:52:18 +08:00
}
.text-dark {
2026-01-21 13:37:54 +08:00
color: #333;
2026-01-19 18:52:18 +08:00
}
.text-danger {
2026-01-21 13:37:54 +08:00
color: #f56c6c;
2026-01-19 18:52:18 +08:00
}
.text-primary {
2026-01-21 13:37:54 +08:00
color: $primary-color;
2026-01-19 18:52:18 +08:00
}
.text-success {
2026-01-21 13:37:54 +08:00
color: #67c23a;
2026-01-19 18:52:18 +08:00
}
.text-white {
2026-01-21 13:37:54 +08:00
color: #fff;
2026-01-19 18:52:18 +08:00
}
.text-warning {
2026-01-21 13:37:54 +08:00
color: #f56c6c;
2026-01-19 18:52:18 +08:00
}
.text-sm {
2026-01-21 13:37:54 +08:00
font-size: 24rpx;
2026-01-19 18:52:18 +08:00
}
.text-base {
2026-01-21 13:37:54 +08:00
font-size: 28rpx;
2026-01-19 18:52:18 +08:00
}
.text-lg {
2026-01-21 13:37:54 +08:00
font-size: 32rpx;
2026-01-19 18:52:18 +08:00
}
.text-xl {
2026-01-21 13:37:54 +08:00
font-size: 36rpx;
2026-01-19 18:52:18 +08:00
}
.leading-normal {
2026-01-21 13:37:54 +08:00
line-height: 1.5;
2026-01-19 18:52:18 +08:00
}
.border {
2026-01-21 13:37:54 +08:00
border: 1px solid #eee;
2026-01-19 18:52:18 +08:00
}
.border-dashed {
2026-01-21 13:37:54 +08:00
border: 1px dashed #eee;
2026-01-19 18:52:18 +08:00
}
.border-b {
2026-01-21 13:37:54 +08:00
border-bottom: 1px solid #eee;
2026-01-19 18:52:18 +08:00
}
.border-auto {
2026-01-21 13:37:54 +08:00
border: 1px solid;
2026-01-19 18:52:18 +08:00
}
.border-dashed-auto {
2026-01-21 13:37:54 +08:00
border: 1px dashed;
2026-01-19 18:52:18 +08:00
}
.border-primary {
2026-01-21 13:37:54 +08:00
border: 1px solid $primary-color;
2026-01-19 18:52:18 +08:00
}
.font-semibold {
2026-01-21 13:37:54 +08:00
font-weight: bold;
2026-01-19 18:52:18 +08:00
}
.truncate {
2026-01-21 13:37:54 +08:00
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
2026-01-19 18:52:18 +08:00
}
.w-0 {
2026-01-21 13:37:54 +08:00
width: 0;
2026-01-19 18:52:18 +08:00
}
.w-full {
2026-01-21 13:37:54 +08:00
width: 100%;
2026-01-19 18:52:18 +08:00
}
.overflow-hidden {
2026-01-21 13:37:54 +08:00
overflow: hidden;
2026-01-19 18:52:18 +08:00
}
.border-box {
2026-01-21 13:37:54 +08:00
box-sizing: border-box;
2026-01-19 18:52:18 +08:00
}
.line-clamp-2 {
2026-01-21 13:37:54 +08:00
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
2026-01-19 18:52:18 +08:00
}
.h-full {
2026-01-21 13:37:54 +08:00
height: 100%;
2026-01-19 18:52:18 +08:00
}
.safe-bottom-padding {
2026-01-21 13:37:54 +08:00
height: env(safe-area-inset-bottom);
2026-01-19 18:52:18 +08:00
}
</style>