feat: add new features, update theme and build config

- Add 40+ new UI components including chat modules, discovery cards, photo galleries, FAQ and booking tools
- Standardize brand color across all styles by replacing $theme-color-500 SCSS variables with #0ccd58
- Add sass 1.58.3 dependency and update vite config for modern scss compiler support
- Refactor existing components (AddCarCrad, login page) and remove unused /quick/list router route
- Add utility functions for URL parameter handling
- Add static assets including custom znicons font, component images and icons
- Fix scss syntax issues and deprecation warnings
This commit is contained in:
duanshuwen
2026-05-26 22:49:52 +08:00
parent 548df7020c
commit ac8f5b5f64
159 changed files with 12439 additions and 629 deletions

View File

@@ -0,0 +1,113 @@
<template>
<div class="page">
<!-- 顶部用户信息 -->
<div class="user-card">
<div class="row avatar-row">
<span class="label">头像 </span>
<!-- <image class="avatar" :src="userInfo.avatar" mode="aspectFill" /> -->
<uni-icons type="contact" size="40" color="#ccc"></uni-icons>
</div>
<div class="row">
<span class="label">昵称</span>
<span class="value">{{ userInfo.nickname }}</span>
</div>
<div class="row">
<span class="label">手机号</span>
<span class="value">{{ userInfo.phone }}</span>
</div>
</div>
<!-- 中间功能入口循环渲染 -->
<div class="menu-card">
<div class="menu-item" v-for="(item, index) in menuList" :key="index" @click="handleMenuClick(item)">
<span class="label">{{ item.label }}</span>
<uni-icons type="right" size="14" color="#ccc"></uni-icons>
</div>
</div>
<!-- 底部退出按钮 -->
<span class="logout-btn" @click="handleLogout">退出登录</span>
</div>
</template>
<script setup>
import { ref, defineEmits, defineExpose } from "vue";
import { getLoginUserPhone } from "@/request/api/LoginApi";
import { NOTICE_EVENT_LOGOUT } from "@/constant/constant";
import { useAppStore } from "@/store";
const appStore = useAppStore();
const emits = defineEmits(["close"]);
// 假数据
const userInfo = ref({
avatar: "/static/default-avatar.png",
nickname: "微信用户",
phone: "",
});
// 功能菜单列表(带 type 区分操作类型)
const menuList = ref([
// { label: '修改手机号', type: 'navigate', url: '/pages/change-phone/change-phone' },
{
label: "账号注销",
type: "action",
url: "cancelAccount",
},
// { label: '营业资质&协议', type: 'navigate', url: '/pages/agreement/agreement' },
// { label: "联系客服", type: "action", action: "contactService" },
// { label: "订阅消息", type: "action", action: "subscribeMessage" },
]);
const getLoginUserPhoneInfo = async () => {
const res = await getLoginUserPhone();
if (res.code === 0) {
userInfo.value.phone = res.data;
}
};
// 处理菜单点击
const handleMenuClick = (item) => {
if (item.type === "navigate" && item.url) {
uni.navigateTo({ url: item.url });
} else if (item.type === "action") {
if (item.action === "contactService") {
uni.showToast({ title: "联系客服功能待实现", icon: "none" });
} else if (item.action === "cancelAccount") {
handleLogout();
} else if (item.action === "subscribeMessage") {
uni.requestSubscribeMessage({
tmplIds: ["fMIt1q9GgM3Ep0DJSNgVPm4C3lCpQdz2TediETcv3iM"],
success(res) {
console.log(res);
},
});
}
}
};
// 退出登录
const handleLogout = () => {
uni.showModal({
title: "温馨提示",
content: "确定要退出登录吗?",
success: (res) => {
if (res.confirm) {
uni.clearStorageSync();
emits("close");
uni.$emit(NOTICE_EVENT_LOGOUT);
uni.showToast({
title: "退出登录成功",
});
}
},
});
};
defineExpose({ getLoginUserPhoneInfo });
</script>
<style scoped lang="scss">
@import "./styles/index.scss";
</style>

View File

@@ -0,0 +1,65 @@
.page {
padding: 24rpx;
background-color: #f6f6f6;
min-height: 100vh;
}
.user-card,
.menu-card {
background-color: #fff;
border-radius: 12rpx;
padding-left: 24rpx;
margin-bottom: 20rpx;
}
.row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 28rpx 24rpx 28rpx 0;
border-bottom: 1px solid #f0f0f0;
}
.row:last-child {
border-bottom: none;
}
.avatar-row .avatar {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
}
.label {
font-size: 28rpx;
color: $uni-text-color;
}
.value {
font-size: 28rpx;
color: #666;
}
.menu-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 28rpx 24rpx 28rpx 0;
border-bottom: 1px solid #f0f0f0;
}
.menu-item:last-child {
border-bottom: none;
}
.logout-btn {
display: flex;
align-items: center;
justify-content: center;
height: 42px;
margin-top: 40px;
background-color: #fff;
color: $uni-text-color;
border-radius: 8rpx;
border: none;
}

View File

@@ -0,0 +1,46 @@
<template>
<uni-drawer ref="drawerRef" mode="left" :width="320">
<div class="drawer-home">
<div class="drawer-home-nav">
<uni-icons type="closeempty" size="22" color="#333333" class="close-icon" @click="close" />
<span class="title">我的</span>
</div>
<MineSetting ref="mineSettingRef" @close="close" />
</div>
</uni-drawer>
</template>
<script setup>
import { ref, defineExpose } from "vue";
import { checkToken } from "@/hooks/useGoLogin";
import MineSetting from "./components/MineSetting/index.vue";
const drawerRef = ref(null);
// 监听抽屉显示事件
const mineSettingRef = ref(null);
const open = async () => {
await checkToken();
drawerRef.value?.open?.();
try {
await mineSettingRef.value?.getLoginUserPhoneInfo?.();
} catch (error) {
console.warn("获取登录用户手机号失败:", error);
}
};
// 监听抽屉隐藏事件
const close = () => drawerRef.value?.close?.();
defineExpose({
open,
close,
});
</script>
<style lang="scss" scoped>
@import "./styles/index.scss";
</style>

View File

@@ -0,0 +1,25 @@
.drawer-home {
width: 100%;
height: 100vh;
background-color: #fff;
padding-top: 44px;
}
.drawer-home-nav {
position: relative;
padding: 12px;
display: flex;
justify-content: center; /* 文字水平居中 */
align-items: center; /* 垂直居中 */
.title {
font-size: 18px;
text-align: center;
color: $uni-text-color;
}
.close-icon {
position: absolute;
left: 12px; /* 距离左边12px */
}
}