完善内容(home)
This commit is contained in:
parent
148ca25b00
commit
dfb3f27f39
|
|
@ -14,4 +14,11 @@ export const userInfo = (data : any) => get('v1/info', data);
|
||||||
|
|
||||||
export const captcha = (data : any) => get('v1/captcha', data);
|
export const captcha = (data : any) => get('v1/captcha', data);
|
||||||
|
|
||||||
export const login = (data : any) => post('v1/login', data);
|
export const login = (data : any) => post('v1/login', data);
|
||||||
|
|
||||||
|
|
||||||
|
export const logout = (data : any) => get('v1/logout', data);
|
||||||
|
|
||||||
|
// 获取权限
|
||||||
|
export const menu = (data : any) => get('v1/menu', data);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@
|
||||||
immediate: true,
|
immediate: true,
|
||||||
deep: true,
|
deep: true,
|
||||||
handler(newVal) {
|
handler(newVal) {
|
||||||
console.log('SharePoster posterInfo changed:', newVal)
|
// console.log('SharePoster posterInfo changed:', newVal)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,220 @@
|
||||||
|
<template>
|
||||||
|
<view class="community-selector">
|
||||||
|
<!-- 弹出层 -->
|
||||||
|
<wd-popup v-model="popupVisible" position="bottom" :safe-area-inset-bottom="true" @close="onCancel" custom-class="community-popup">
|
||||||
|
<view class="picker-container">
|
||||||
|
<!-- 头部操作区 -->
|
||||||
|
<view class="picker-header">
|
||||||
|
<text class="cancel-btn" @click="onCancel">取消</text>
|
||||||
|
<text class="title">选择小区</text>
|
||||||
|
<text class="confirm-btn" @click="onConfirm">确定</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 小区列表 -->
|
||||||
|
<scroll-view scroll-y class="community-list">
|
||||||
|
<view class="community-item"
|
||||||
|
v-for="(item, index) in communities"
|
||||||
|
:key="index"
|
||||||
|
:class="{'active': pickerIndex[0] === index}"
|
||||||
|
@click="selectCommunity(index)">
|
||||||
|
<text class="community-item-name">{{ item.label }}</text>
|
||||||
|
<text v-if="pickerIndex[0] === index" class="ri-check-line check-icon"></text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 底部安全区域 -->
|
||||||
|
<view class="safe-area-padding"></view>
|
||||||
|
</scroll-view>
|
||||||
|
</view>
|
||||||
|
</wd-popup>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, computed, watch } from 'vue'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
// 小区列表数据
|
||||||
|
communities: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
// 当前选中的小区ID
|
||||||
|
modelValue: {
|
||||||
|
type: [String, Number],
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
// 是否显示弹出层
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
communityList: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
defaultId: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(['update:modelValue', 'update:visible', 'change', 'confirm', 'cancel'])
|
||||||
|
|
||||||
|
// 内部状态
|
||||||
|
const currentIndex = ref([0])
|
||||||
|
const pickerIndex = ref([0])
|
||||||
|
|
||||||
|
// 弹出层可见状态
|
||||||
|
const popupVisible = computed({
|
||||||
|
get() {
|
||||||
|
return props.visible
|
||||||
|
},
|
||||||
|
set(value) {
|
||||||
|
emit('update:visible', value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// 设置默认选中的社区
|
||||||
|
const selectedCommunity = ref(null)
|
||||||
|
|
||||||
|
// 监听外部传入的值变化
|
||||||
|
watch(() => props.modelValue, (newVal) => {
|
||||||
|
if (newVal) {
|
||||||
|
const index = props.communities.findIndex(item => item.value === newVal)
|
||||||
|
if (index !== -1) {
|
||||||
|
currentIndex.value = [index]
|
||||||
|
pickerIndex.value = [index]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, { immediate: true })
|
||||||
|
|
||||||
|
// 监听弹出层显示状态变化
|
||||||
|
watch(() => props.visible, (newVal) => {
|
||||||
|
if (newVal) {
|
||||||
|
// 弹出层显示时,重置选择器的值为当前选中值
|
||||||
|
const index = props.communities.findIndex(item => item.value === props.modelValue)
|
||||||
|
if (index !== -1) {
|
||||||
|
pickerIndex.value = [index]
|
||||||
|
} else if (props.communities.length > 0) {
|
||||||
|
pickerIndex.value = [0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// 当社区列表变更时,自动选择第一个社区或默认社区
|
||||||
|
watch(() => props.communityList, (list) => {
|
||||||
|
if (list && list.length > 0) {
|
||||||
|
if (props.defaultId) {
|
||||||
|
selectedCommunity.value = list.find(item => item.id === props.defaultId) || list[0]
|
||||||
|
} else {
|
||||||
|
selectedCommunity.value = list[0]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, { immediate: true })
|
||||||
|
|
||||||
|
// 选择小区
|
||||||
|
const selectCommunity = (index) => {
|
||||||
|
pickerIndex.value = [index]
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消选择
|
||||||
|
const onCancel = () => {
|
||||||
|
popupVisible.value = false
|
||||||
|
// 把选择器的值重置为当前已选的值
|
||||||
|
pickerIndex.value = currentIndex.value
|
||||||
|
emit('cancel')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确认选择
|
||||||
|
const onConfirm = () => {
|
||||||
|
const selectedIndex = pickerIndex.value[0]
|
||||||
|
if (selectedIndex >= 0 && selectedIndex < props.communities.length) {
|
||||||
|
const selectedItem = props.communities[selectedIndex]
|
||||||
|
currentIndex.value = pickerIndex.value
|
||||||
|
emit('update:modelValue', selectedItem.value)
|
||||||
|
emit('change', selectedItem)
|
||||||
|
emit('confirm', selectedItem)
|
||||||
|
}
|
||||||
|
popupVisible.value = false
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.community-selector {
|
||||||
|
display: inline-flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.community-popup {
|
||||||
|
border-radius: 24rpx 24rpx 0 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-container {
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 24rpx 24rpx 0 0;
|
||||||
|
overflow: hidden;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
max-height: 70vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.picker-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
height: 110rpx;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
border-bottom: 1px solid #f2f2f2;
|
||||||
|
box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.02);
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 34rpx;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cancel-btn {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #999;
|
||||||
|
padding: 15rpx 10rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.confirm-btn {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #3e9bff;
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 15rpx 10rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.community-list {
|
||||||
|
flex: 1;
|
||||||
|
height: calc(70vh - 110rpx);
|
||||||
|
}
|
||||||
|
|
||||||
|
.community-item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 30rpx 40rpx;
|
||||||
|
border-bottom: 1px solid #f6f6f6;
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
background-color: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.community-item-name {
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.check-icon {
|
||||||
|
font-size: 40rpx;
|
||||||
|
color: #3e9bff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.safe-area-padding {
|
||||||
|
height: 80rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
<template>
|
||||||
|
<view v-if="showButton">
|
||||||
|
<slot></slot>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { computed, inject } from 'vue'
|
||||||
|
import { hasPermission } from '@/utils/permission'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
// 功能类型,与permission.js中的permissionMap对应
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// 尝试从父级组件注入权限数组,如果没有则使用空数组
|
||||||
|
const userPermissions = inject('userPermissions', [])
|
||||||
|
|
||||||
|
// 计算是否显示按钮
|
||||||
|
const showButton = computed(() => {
|
||||||
|
return hasPermission(props.type, userPermissions)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,124 @@
|
||||||
|
<template>
|
||||||
|
<view class="permission-example">
|
||||||
|
<wd-navbar title="权限控制示例" left-text="返回" @clickLeft="onBack" />
|
||||||
|
|
||||||
|
<view class="section li-p-30">
|
||||||
|
<view class="section-title li-mb-20 li-text-32 li-font-bold">1. 按钮权限控制</view>
|
||||||
|
|
||||||
|
<!-- 使用权限按钮组件 -->
|
||||||
|
<permission-button type="verification" class="li-mb-20">
|
||||||
|
<wd-button>核销按钮(F1权限)</wd-button>
|
||||||
|
</permission-button>
|
||||||
|
|
||||||
|
<permission-button type="delivery" class="li-mb-20">
|
||||||
|
<wd-button>配送按钮(F2权限)</wd-button>
|
||||||
|
</permission-button>
|
||||||
|
|
||||||
|
<permission-button type="promotion" class="li-mb-20">
|
||||||
|
<wd-button>推广按钮(F3权限)</wd-button>
|
||||||
|
</permission-button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="section li-p-30">
|
||||||
|
<view class="section-title li-mb-20 li-text-32 li-font-bold">2. 菜单列表权限控制</view>
|
||||||
|
|
||||||
|
<!-- 菜单列表筛选示例 -->
|
||||||
|
<wd-cell-group>
|
||||||
|
<wd-cell v-for="item in filteredMenuList" :key="item.type" :title="item.title" is-link @click="handleClick(item)" />
|
||||||
|
</wd-cell-group>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="section li-p-30">
|
||||||
|
<view class="section-title li-mb-20 li-text-32 li-font-bold">3. 内联权限控制</view>
|
||||||
|
|
||||||
|
<!-- 直接使用hasPermission函数 -->
|
||||||
|
<view v-if="hasPermission('measure', userPermissions)" class="li-mb-20">
|
||||||
|
<view class="li-bg-#f2f2f2 li-p-20 li-rd-10">
|
||||||
|
<text class="li-text-28">这段内容只有拥有量房权限(F4)的用户才能看到</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view v-if="hasPermission('repair', userPermissions)" class="li-mb-20">
|
||||||
|
<view class="li-bg-#f2f2f2 li-p-20 li-rd-10">
|
||||||
|
<text class="li-text-28">这段内容只有拥有维修权限(F6)的用户才能看到</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="section li-p-30">
|
||||||
|
<view class="section-title li-mb-20 li-text-32 li-font-bold">4. 当前权限状态</view>
|
||||||
|
<view class="li-bg-#f2f2f2 li-p-20 li-rd-10">
|
||||||
|
<text class="li-text-26">权限列表: {{userPermissions.join(', ') || '无权限'}}</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 模拟切换权限 -->
|
||||||
|
<view class="li-mt-20">
|
||||||
|
<wd-button @click="togglePermission('F1')">切换F1权限</wd-button>
|
||||||
|
<wd-button @click="togglePermission('F2')" class="li-mt-10">切换F2权限</wd-button>
|
||||||
|
<wd-button @click="togglePermission('F3')" class="li-mt-10">切换F3权限</wd-button>
|
||||||
|
<wd-button @click="togglePermission('F4')" class="li-mt-10">切换F4权限</wd-button>
|
||||||
|
<wd-button @click="togglePermission('F6')" class="li-mt-10">切换F6权限</wd-button>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref, computed, provide } from 'vue'
|
||||||
|
import { hasPermission, filterByPermission } from '@/utils/permission'
|
||||||
|
import PermissionButton from '@/components/permission-button.vue'
|
||||||
|
|
||||||
|
// 模拟用户权限数据
|
||||||
|
const userPermissions = ref(['F1', 'F3'])
|
||||||
|
|
||||||
|
// 提供权限数据给子组件
|
||||||
|
provide('userPermissions', userPermissions)
|
||||||
|
|
||||||
|
// 菜单列表
|
||||||
|
const menuList = [
|
||||||
|
{ title: '商品核销', type: 'verification' },
|
||||||
|
{ title: '商品配送', type: 'delivery' },
|
||||||
|
{ title: '推广管理', type: 'promotion' },
|
||||||
|
{ title: '量房管理', type: 'measure' },
|
||||||
|
{ title: '维修管理', type: 'repair' },
|
||||||
|
{ title: '系统设置', type: 'settings' } // 这个没有权限控制,始终显示
|
||||||
|
]
|
||||||
|
|
||||||
|
// 过滤菜单列表
|
||||||
|
const filteredMenuList = computed(() => {
|
||||||
|
return filterByPermission(menuList, userPermissions.value)
|
||||||
|
})
|
||||||
|
|
||||||
|
// 切换权限
|
||||||
|
const togglePermission = (permissionCode) => {
|
||||||
|
const index = userPermissions.value.indexOf(permissionCode)
|
||||||
|
if (index >= 0) {
|
||||||
|
userPermissions.value.splice(index, 1)
|
||||||
|
} else {
|
||||||
|
userPermissions.value.push(permissionCode)
|
||||||
|
}
|
||||||
|
// 强制更新数组引用以触发响应式更新
|
||||||
|
userPermissions.value = [...userPermissions.value]
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理菜单点击
|
||||||
|
const handleClick = (item) => {
|
||||||
|
uni.showToast({
|
||||||
|
title: `点击了${item.title}`,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回上一页
|
||||||
|
const onBack = () => {
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.section {
|
||||||
|
margin-bottom: 30rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -10,16 +10,16 @@
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<template #title>
|
<template #title>
|
||||||
<view class="li-flex-center li-ml-200">
|
<view class="li-flex-center li-ml-200">
|
||||||
<text class="ri-brush-3-line li-text-46 li-mr-30"></text>
|
<text class="ri-brush-3-line li-text-46 li-mr-30" @click="clearMsg"></text>
|
||||||
<text class="ri-search-eye-line li-text-46 li-pt-2"></text>
|
<text class="ri-search-eye-line li-text-46 li-pt-2" @click="search"></text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifndef MP-WEIXIN -->
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
<template #right>
|
<template #right>
|
||||||
<view class="li-flex-center li-mr-25">
|
<view class="li-flex-center li-mr-25">
|
||||||
<text class="ri-brush-3-line li-text-46 li-mr-30"></text>
|
<text class="ri-brush-3-line li-text-46 li-mr-30" @click="clearMsg"></text>
|
||||||
<text class="ri-search-eye-line li-text-46 li-pt-2"></text>
|
<text class="ri-search-eye-line li-text-46 li-pt-2" @click="search"></text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
@ -69,6 +69,8 @@
|
||||||
<view v-if="messageList.length==0" class="!li-mt-300">
|
<view v-if="messageList.length==0" class="!li-mt-300">
|
||||||
<wd-status-tip image="message" tip="暂无待处理会话" />
|
<wd-status-tip image="message" tip="暂无待处理会话" />
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 顶部提示条(成功/失败消息提示) -->
|
||||||
|
<wd-toast />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -76,6 +78,8 @@
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
const messageList = ref([])
|
const messageList = ref([])
|
||||||
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
|
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
|
||||||
|
import { useToast } from '@/uni_modules/wot-design-uni'
|
||||||
|
const Toast = useToast()
|
||||||
|
|
||||||
onPullDownRefresh(() => {
|
onPullDownRefresh(() => {
|
||||||
uni.stopPullDownRefresh()
|
uni.stopPullDownRefresh()
|
||||||
|
|
@ -85,6 +89,13 @@
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const clearMsg = () => {
|
||||||
|
Toast.info('暂无消息')
|
||||||
|
}
|
||||||
|
const search = () => {
|
||||||
|
Toast.info('暂无消息')
|
||||||
|
}
|
||||||
|
|
||||||
const handleAction = (action : string) => {
|
const handleAction = (action : string) => {
|
||||||
console.log(action);
|
console.log(action);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
<!-- grid -->
|
<!-- grid -->
|
||||||
<view class="li-mt-15 ">
|
<view class="li-mt-15 ">
|
||||||
<wd-grid class="li-px-30" bg-color="transparent" :column="4" :clickable="true">
|
<wd-grid class="li-px-30" bg-color="transparent" :column="4" :clickable="true">
|
||||||
<wd-grid-item use-icon-slot use-text-slot v-for="(item,index) in gridList" :key="index"
|
<wd-grid-item use-icon-slot use-text-slot v-for="(item,index) in filteredGridList" :key="index"
|
||||||
@itemclick="toPages({type:item.type})">
|
@itemclick="toPages({type:item.type})">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<image class="li-w-58 li-h-58" :src="item.image" />
|
<image class="li-w-58 li-h-58" :src="item.image" />
|
||||||
|
|
@ -52,7 +52,7 @@
|
||||||
</wd-grid>
|
</wd-grid>
|
||||||
</view>
|
</view>
|
||||||
<!-- card -->
|
<!-- card -->
|
||||||
<view
|
<!-- <view
|
||||||
:style="{backgroundImage:`url(${card_back})`,backgroundSize:'cover',backgroundPosition:'center',borderRadius:'15rpx'}"
|
:style="{backgroundImage:`url(${card_back})`,backgroundSize:'cover',backgroundPosition:'center',borderRadius:'15rpx'}"
|
||||||
class="li-w-88% li-h-220 li-mx-auto li-mt-20 li-pt-15">
|
class="li-w-88% li-h-220 li-mx-auto li-mt-20 li-pt-15">
|
||||||
<text class="li-ml-35 li-text-30 li-text-#010B3E">代处理事项</text>
|
<text class="li-ml-35 li-text-30 li-text-#010B3E">代处理事项</text>
|
||||||
|
|
@ -64,7 +64,7 @@
|
||||||
<text class="li-text-24 li-text-#AFB2B8">{{item.desc}}</text>
|
<text class="li-text-24 li-text-#AFB2B8">{{item.desc}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<!-- list -->
|
<!-- list -->
|
||||||
<view class="li-w-88% li-mx-auto li-mt-30">
|
<view class="li-w-88% li-mx-auto li-mt-30">
|
||||||
<text class="li-ml-35 li-text-30">常见问题解答</text>
|
<text class="li-ml-35 li-text-30">常见问题解答</text>
|
||||||
|
|
@ -104,27 +104,39 @@
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup>
|
||||||
import {
|
import {
|
||||||
userInfo
|
userInfo,
|
||||||
|
menu
|
||||||
} from '@/api/login';
|
} from '@/api/login';
|
||||||
import {
|
import {
|
||||||
newMessage, bannerList
|
newMessage, bannerList
|
||||||
} from '@/api/message';
|
} from '@/api/message';
|
||||||
import {
|
import {
|
||||||
ref
|
ref, computed, provide
|
||||||
} from 'vue'
|
} from 'vue'
|
||||||
import { onLoad, onReachBottom, Uni, onPullDownRefresh } from "@dcloudio/uni-app"
|
import { onLoad, onReachBottom, onPullDownRefresh } from "@dcloudio/uni-app"
|
||||||
// import SafeAreaTop from '@/components/SafeAreaTop/index.vue'
|
import { hasPermission, filterByPermission } from '@/utils/permission'
|
||||||
// import SafeAreaBottom from '@/components/SafeAreaBottom/index.vue'
|
|
||||||
declare const uni : Uni
|
|
||||||
const card_back = uni.$globalData?.RESOURCE_URL + 'home/card-back.png'
|
const card_back = uni.$globalData?.RESOURCE_URL + 'home/card-back.png'
|
||||||
const keyword = ref<string>('')
|
const keyword = ref('')
|
||||||
const messageCount = ref<number>(0)
|
const messageCount = ref(0)
|
||||||
const current = ref<number>(0)
|
const current = ref(0)
|
||||||
const state = ref<string>('loading')
|
const state = ref('loading')
|
||||||
|
const menuInfo = ref({})
|
||||||
|
|
||||||
|
// 提供权限数据给子组件使用
|
||||||
|
provide('userPermissions', computed(() => menuInfo.value?.auth || []))
|
||||||
|
|
||||||
|
// 获取过滤后的菜单列表
|
||||||
|
const filteredGridList = computed(() => {
|
||||||
|
return menuInfo.value?.auth ? filterByPermission(gridList.value, menuInfo.value.auth) : [];
|
||||||
|
});
|
||||||
|
|
||||||
|
// 添加权限检查方法,便于模板中直接使用
|
||||||
|
const checkPermission = (type) => {
|
||||||
|
return hasPermission(type, menuInfo.value?.auth || []);
|
||||||
|
}
|
||||||
|
|
||||||
// 根据环境使用不同的图片路径
|
// 根据环境使用不同的图片路径
|
||||||
const swiperList = ref([
|
const swiperList = ref([
|
||||||
|
|
@ -155,11 +167,11 @@
|
||||||
title: '邀请业主',
|
title: '邀请业主',
|
||||||
type: 'invite'
|
type: 'invite'
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
image: uni.$globalData?.RESOURCE_URL + 'home/grid/cuijiao.png',
|
// image: uni.$globalData?.RESOURCE_URL + 'home/grid/cuijiao.png',
|
||||||
title: '物业催缴',
|
// title: '物业催缴',
|
||||||
type: 'call'
|
// type: 'call'
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
image: uni.$globalData?.RESOURCE_URL + 'home/grid/tousu.png',
|
image: uni.$globalData?.RESOURCE_URL + 'home/grid/tousu.png',
|
||||||
title: '投诉管理',
|
title: '投诉管理',
|
||||||
|
|
@ -170,11 +182,11 @@
|
||||||
// title: '访客邀请',
|
// title: '访客邀请',
|
||||||
// type: ''
|
// type: ''
|
||||||
// },
|
// },
|
||||||
// {
|
{
|
||||||
// image: uni.$globalData?.RESOURCE_URL + 'home/grid/wenjuan.png',
|
image: uni.$globalData?.RESOURCE_URL + 'home/grid/wenjuan.png',
|
||||||
// title: '问卷管理',
|
title: '问卷管理',
|
||||||
// type: 'questionnaire'
|
type: 'questionnaire'
|
||||||
// },
|
},
|
||||||
// {
|
// {
|
||||||
// image: uni.$globalData?.RESOURCE_URL + 'home/grid/fangyuan.png',
|
// image: uni.$globalData?.RESOURCE_URL + 'home/grid/fangyuan.png',
|
||||||
// title: '房源管理',
|
// title: '房源管理',
|
||||||
|
|
@ -201,7 +213,7 @@
|
||||||
const toDoList = ref([
|
const toDoList = ref([
|
||||||
{
|
{
|
||||||
num: '30',
|
num: '30',
|
||||||
desc: '今日任务'
|
desc: '今日任务',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
num: '12',
|
num: '12',
|
||||||
|
|
@ -241,7 +253,7 @@
|
||||||
const onChange = (e) => {
|
const onChange = (e) => {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
const toPages = (item : any) => {
|
const toPages = (item) => {
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
case 'task_hall':
|
case 'task_hall':
|
||||||
// 工单大厅
|
// 工单大厅
|
||||||
|
|
@ -340,12 +352,22 @@
|
||||||
const mess = await newMessage()
|
const mess = await newMessage()
|
||||||
messageCount.value = mess.data.count
|
messageCount.value = mess.data.count
|
||||||
// 轮播加载
|
// 轮播加载
|
||||||
const banner = await bannerList({ position: 5 })
|
const banner = await bannerList({ position: 1 })
|
||||||
swiperList.value = banner.data.map((item : { image : String; }) => item.image)
|
// swiperList.value = banner.data.map((item) => item.image)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 获取用户权限
|
||||||
|
const getMenu = async () => {
|
||||||
|
const resMenu = await menu()
|
||||||
|
if (resMenu.code == 200) {
|
||||||
|
menuInfo.value = resMenu.data
|
||||||
|
console.log('用户权限:', menuInfo.value.auth)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
loadData()
|
loadData()
|
||||||
|
getMenu()
|
||||||
})
|
})
|
||||||
|
|
||||||
onPullDownRefresh(() => {
|
onPullDownRefresh(() => {
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@
|
||||||
<!-- 验证码 -->
|
<!-- 验证码 -->
|
||||||
<view class="li-flex li-items-center li-justify-between li-mt-28">
|
<view class="li-flex li-items-center li-justify-between li-mt-28">
|
||||||
<view class="li-w-420">
|
<view class="li-w-420">
|
||||||
<wd-input :maxlength="11" placeholder="请输入验证码" type='text' v-model="form.code"
|
<wd-input :maxlength="11" placeholder="请输入验证码" type='text' v-model="form.code" prefix-icon="secured"
|
||||||
prefix-icon="secured" placeholderStyle="font-size:30rpx" :focus-when-clear="false"
|
placeholderStyle="font-size:30rpx" :focus-when-clear="false" clear-trigger="focus" clearable
|
||||||
clear-trigger="focus" clearable no-border />
|
no-border />
|
||||||
</view>
|
</view>
|
||||||
<view class="li-bg-white li-w-150 li-h-68" @click="getCode()">
|
<view class="li-bg-white li-w-150 li-h-68" @click="getCode()">
|
||||||
<image class="li-w-150 li-h-68" :src="captchaData.image" mode=""></image>
|
<image class="li-w-150 li-h-68" :src="captchaData.image" mode=""></image>
|
||||||
|
|
@ -35,15 +35,16 @@
|
||||||
<view class="li-flex li-items-center li-justify-center li-w-90% li-mx-auto li-text-#a5a5a5 li-text-24 li-mt-32">
|
<view class="li-flex li-items-center li-justify-center li-w-90% li-mx-auto li-text-#a5a5a5 li-text-24 li-mt-32">
|
||||||
<wd-checkbox checked-color="#2EA1EA" v-model="check" />
|
<wd-checkbox checked-color="#2EA1EA" v-model="check" />
|
||||||
阅读并同意
|
阅读并同意
|
||||||
<text class="li-text-#2EA1EA li-mx-10">
|
<text @click="handleUserAgreement" class="li-text-#2EA1EA li-mx-10">
|
||||||
《用户协议》
|
《用户协议》
|
||||||
</text>
|
</text>
|
||||||
和
|
和
|
||||||
<text class="li-text-#2EA1EA li-mx-10">
|
<text @click="handlePrivacyPolicy" class="li-text-#2EA1EA li-mx-10">
|
||||||
《隐私政策》
|
《隐私政策》
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<zero-loading type="wobble" v-if="loading"></zero-loading>
|
<zero-loading type="wobble" v-if="loading"></zero-loading>
|
||||||
|
<wd-toast />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -52,6 +53,8 @@
|
||||||
import { captcha, login } from '@/api/login';
|
import { captcha, login } from '@/api/login';
|
||||||
import { onLoad, onShow, Uni } from '@dcloudio/uni-app';
|
import { onLoad, onShow, Uni } from '@dcloudio/uni-app';
|
||||||
import { md5 } from '@/utils/common';
|
import { md5 } from '@/utils/common';
|
||||||
|
import { useToast } from '@/uni_modules/wot-design-uni';
|
||||||
|
const Toast = useToast();
|
||||||
declare const uni : Uni
|
declare const uni : Uni
|
||||||
|
|
||||||
interface formItem {
|
interface formItem {
|
||||||
|
|
@ -83,65 +86,93 @@
|
||||||
|
|
||||||
const loginHandle = async () => {
|
const loginHandle = async () => {
|
||||||
if (!check.value) {
|
if (!check.value) {
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
icon: 'none',
|
// icon: 'none',
|
||||||
title: '请阅读并同意《用户协议》和《隐私政策》',
|
// title: '请阅读并同意《用户协议》和《隐私政策》',
|
||||||
duration: 2000
|
// duration: 2000
|
||||||
})
|
// })
|
||||||
|
Toast.info('请阅读并同意《用户协议》和《隐私政策》')
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!form.value.username) {
|
if (!form.value.username) {
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
icon: 'none',
|
// icon: 'none',
|
||||||
title: '登录账号不能为空',
|
// title: '登录账号不能为空',
|
||||||
duration: 2000
|
// duration: 2000
|
||||||
})
|
// })
|
||||||
|
Toast.info('登录账号不能为空')
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!form.value.password) {
|
if (!form.value.password) {
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
icon: 'none',
|
// icon: 'none',
|
||||||
title: '登录密码不能为空',
|
// title: '登录密码不能为空',
|
||||||
duration: 2000
|
// duration: 2000
|
||||||
})
|
// })
|
||||||
|
Toast.info('登录密码不能为空')
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!form.value.code) {
|
if (!form.value.code) {
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
icon: 'none',
|
// icon: 'none',
|
||||||
title: '验证码不能为空',
|
// title: '验证码不能为空',
|
||||||
duration: 2000
|
// duration: 2000
|
||||||
})
|
// })
|
||||||
|
Toast.info('验证码不能为空')
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 请求数据处理
|
// 请求数据处理
|
||||||
loading.value = true
|
// loading.value = true
|
||||||
|
uni.showLoading({
|
||||||
|
title: '登录中...'
|
||||||
|
})
|
||||||
form.value.uuid = captchaData.value.uuid
|
form.value.uuid = captchaData.value.uuid
|
||||||
form.value.password = md5(form.value.password)
|
form.value.password = md5(form.value.password)
|
||||||
const res = await login(form.value)
|
const res = await login(form.value)
|
||||||
if (res.code != 200) {
|
if (res.code != 200) {
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
icon: 'none',
|
// icon: 'none',
|
||||||
title: res.msg,
|
// title: res.msg,
|
||||||
duration: 3000
|
// duration: 3000
|
||||||
})
|
// })
|
||||||
|
Toast.error(res.msg)
|
||||||
form.value.password = ""
|
form.value.password = ""
|
||||||
form.value.code = ""
|
form.value.code = ""
|
||||||
loading.value = false
|
// loading.value = false
|
||||||
|
uni.hideLoading()
|
||||||
getCode()
|
getCode()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 登录成功,保存token,跳转首页
|
// 登录成功,保存token,跳转首页
|
||||||
uni.$store.commit("setToken", res.data.token)
|
uni.$store.commit("setToken", res.data.token)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
loading.value = false
|
// loading.value = false
|
||||||
|
uni.hideLoading()
|
||||||
// 跳转至首页
|
// 跳转至首页
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/index/index'
|
url: '/pages/index/index'
|
||||||
})
|
})
|
||||||
}, 300)
|
}, 300)
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看隐私政策
|
||||||
|
*/
|
||||||
|
const handlePrivacyPolicy = () => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesB/agreement/index?type=2'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看用户协议
|
||||||
|
*/
|
||||||
|
const handleUserAgreement = () => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesB/agreement/index?type=1'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
getCode()
|
getCode()
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,14 @@
|
||||||
<view class="li-mine-page">
|
<view class="li-mine-page">
|
||||||
<SafeAreaTop />
|
<SafeAreaTop />
|
||||||
<view class="li-flex li-justify-between li-items-center li-w-94% li-mx-auto li-mt-60">
|
<view class="li-flex li-justify-between li-items-center li-w-94% li-mx-auto li-mt-60">
|
||||||
<view class="li-flex li-items-center">
|
<view @click="toPages({type:'userInfo'})" class="li-flex li-items-center">
|
||||||
<view class="li-flex li-items-end li-mr-20">
|
<view class="li-flex li-items-end li-mr-20">
|
||||||
<image class="li-w-100 li-h-100 li-rd-50% border-4-white" :src="user_info.avatar" mode="">
|
<image class="li-w-100 li-h-100 li-rd-50% border-4-white" :src="user_info.avatar" mode="">
|
||||||
</image>
|
</image>
|
||||||
</view>
|
</view>
|
||||||
<view class="li-flex li-flex-col">
|
<view class="li-flex li-flex-col">
|
||||||
<text class="li-text-38 li-text-#000000 li-mb-2">{{user_info.realname}}</text>
|
<text class="li-text-38 li-text-#000000 li-mb-2">{{user_info?.realname}}</text>
|
||||||
<text class="li-text-24 li-text-#b1bbc7">{{user_info.owner.name}}</text>
|
<text class="li-text-24 li-text-#b1bbc7">{{user_info?.owner?.name}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<image class="li-w-240 li-h-240" :src="mine_back" mode="aspectFill"></image>
|
<image class="li-w-240 li-h-240" :src="mine_back" mode="aspectFill"></image>
|
||||||
|
|
@ -28,20 +28,20 @@
|
||||||
<view class="li-text-#FFFFFF li-flex li-flex-col li-justify-start li-ml-50">
|
<view class="li-text-#FFFFFF li-flex li-flex-col li-justify-start li-ml-50">
|
||||||
<text class="li-text-#F8C883 li-text-24">账户余额</text>
|
<text class="li-text-#F8C883 li-text-24">账户余额</text>
|
||||||
<view class="li-flex li-items-center li-pb-14">
|
<view class="li-flex li-items-center li-pb-14">
|
||||||
<text class="li-text-#F2F7FD li-font-bold li-text-32">1120.00</text>
|
<text class="li-text-#F2F7FD li-font-bold li-text-32">0.00</text>
|
||||||
<text class="li-text-#BBBDDA li-text-20 li-ml-4 li-pt-8">元</text>
|
<text class="li-text-#BBBDDA li-text-20 li-ml-4 li-pt-8">元</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="li-mr-50">
|
<view class="li-mr-50">
|
||||||
<wd-button custom-class="custom-shadow" size="small"> 提现 </wd-button>
|
<wd-button @click="withdrawal" custom-class="custom-shadow" size="small"> 提现 </wd-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 宫格 -->
|
<!-- 宫格 -->
|
||||||
<view class="li-w-94% li-mx-auto li-grid-bg li-h-250 li-rd-20 li-mt-26">
|
<view class="li-w-94% li-mx-auto li-grid-bg li-h-250 li-rd-20 li-mt-26">
|
||||||
<view class="li-flex li-justify-between li-items-center li-pt-20 li-mx-20">
|
<view class="li-flex li-justify-between li-items-center li-pt-20 li-mx-20">
|
||||||
<text class="li-text-#19171B li-text-32">待处理工单</text>
|
<text class="li-text-#19171B li-text-32">待处理工单</text>
|
||||||
<view class="li-text-#B2B2B2 li-flex li-items-center li-text-24">查看更多<text
|
<view @click="toPages({type:'all'})" class="li-text-#B2B2B2 li-flex li-items-center li-text-24">
|
||||||
class="ri-arrow-right-s-line"></text></view>
|
查看更多<text class="ri-arrow-right-s-line"></text></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="li-flex li-justify-between li-items-center li-mx-40 li-mt-30">
|
<view class="li-flex li-justify-between li-items-center li-mx-40 li-mt-30">
|
||||||
<view class="li-flex li-flex-col li-justify-center li-items-center" v-for="(item,index) in workList"
|
<view class="li-flex li-flex-col li-justify-center li-items-center" v-for="(item,index) in workList"
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
</view>
|
</view>
|
||||||
<wd-grid class="" :column="4" :clickable="true">
|
<wd-grid class="" :column="4" :clickable="true">
|
||||||
<wd-grid-item use-icon-slot use-text-slot v-for="(item,index) in frequentlyList" :key="index"
|
<wd-grid-item use-icon-slot use-text-slot v-for="(item,index) in frequentlyList" :key="index"
|
||||||
@click="toPages({type:item.type})">
|
@itemclick="toPages({type:item.type})">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<wd-badge :hidden="item.number > 0 ? false:true" :modelValue="item.number" top='5' right="-2"
|
<wd-badge :hidden="item.number > 0 ? false:true" :modelValue="item.number" top='5' right="-2"
|
||||||
:max='99'>
|
:max='99'>
|
||||||
|
|
@ -74,6 +74,8 @@
|
||||||
</wd-grid-item>
|
</wd-grid-item>
|
||||||
</wd-grid>
|
</wd-grid>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 顶部提示条(成功/失败消息提示) -->
|
||||||
|
<wd-toast />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -81,6 +83,8 @@
|
||||||
import SafeAreaTop from '@/components/SafeAreaTop/index.vue'
|
import SafeAreaTop from '@/components/SafeAreaTop/index.vue'
|
||||||
import { onShow, onReachBottom, Uni } from "@dcloudio/uni-app"
|
import { onShow, onReachBottom, Uni } from "@dcloudio/uni-app"
|
||||||
import { ref } from "vue"
|
import { ref } from "vue"
|
||||||
|
import { useToast } from '@/uni_modules/wot-design-uni'
|
||||||
|
const Toast = useToast()
|
||||||
declare const uni : Uni
|
declare const uni : Uni
|
||||||
|
|
||||||
const user_info = ref({
|
const user_info = ref({
|
||||||
|
|
@ -109,12 +113,12 @@
|
||||||
const workList = ref([
|
const workList = ref([
|
||||||
{
|
{
|
||||||
title: '待入库',
|
title: '待入库',
|
||||||
number: 12,
|
number: 0,
|
||||||
icon: uni.$globalData?.RESOURCE_URL + 'mine/icon/chuku.png',
|
icon: uni.$globalData?.RESOURCE_URL + 'mine/icon/chuku.png',
|
||||||
type: 'warehousing',
|
type: 'warehousing',
|
||||||
}, {
|
}, {
|
||||||
title: '待配送',
|
title: '待配送',
|
||||||
number: 11,
|
number: 0,
|
||||||
icon: uni.$globalData?.RESOURCE_URL + 'mine/icon/peisong.png',
|
icon: uni.$globalData?.RESOURCE_URL + 'mine/icon/peisong.png',
|
||||||
type: 'my_order_F2',
|
type: 'my_order_F2',
|
||||||
}, {
|
}, {
|
||||||
|
|
@ -167,10 +171,21 @@
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
|
const withdrawal = () => {
|
||||||
|
Toast.info('暂无余额')
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const toPages = (item) => {
|
const toPages = (item) => {
|
||||||
console.log('111111111111');
|
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
|
case 'all':
|
||||||
|
// 查看更多工单
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesA/my_order/list'
|
||||||
|
});
|
||||||
|
break;
|
||||||
case 'warehousing':
|
case 'warehousing':
|
||||||
// 入库
|
// 入库
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
@ -191,9 +206,10 @@
|
||||||
break;
|
break;
|
||||||
case 'call':
|
case 'call':
|
||||||
// 入库
|
// 入库
|
||||||
uni.navigateTo({
|
// uni.navigateTo({
|
||||||
url: '/pagesB/call/index'
|
// url: '/pagesB/call/index'
|
||||||
});
|
// });
|
||||||
|
Toast.info('暂无缴费记录')
|
||||||
break;
|
break;
|
||||||
case 'protocol':
|
case 'protocol':
|
||||||
// 用户协议
|
// 用户协议
|
||||||
|
|
@ -213,6 +229,12 @@
|
||||||
url: '/pagesB/setting/index'
|
url: '/pagesB/setting/index'
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case 'userInfo':
|
||||||
|
// 隐私政策
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pagesB/setting/editInfo'
|
||||||
|
});
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,14 +101,14 @@
|
||||||
class="record-item li-bg-white li-rd-20 li-p-30 li-mb-20 li-shadow-sm">
|
class="record-item li-bg-white li-rd-20 li-p-30 li-mb-20 li-shadow-sm">
|
||||||
<view class="li-flex li-justify-between li-items-center">
|
<view class="li-flex li-justify-between li-items-center">
|
||||||
<view class="li-flex li-items-center">
|
<view class="li-flex li-items-center">
|
||||||
<image :src="item.avatar" class="avatar"></image>
|
<image :src="item.avatar?item.avatar:'/static/logo.png'" class="avatar"></image>
|
||||||
<view class="li-ml-20">
|
<view class="li-ml-20">
|
||||||
<view class="li-text-32 li-text-#333">{{item.name}}</view>
|
<view class="li-text-32 li-text-#333">{{item.user_name}}</view>
|
||||||
<view class="li-text-26 li-text-#999 li-mt-10">{{item.time}}</view>
|
<view class="li-text-26 li-text-#999 li-mt-10">{{item.create_time}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="status-tag" :class="item.status === 1 ? 'success' : 'pending'">
|
<view class="status-tag success">
|
||||||
{{item.status === 1 ? '已绑定' : '待认证'}}
|
已绑定
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -224,6 +224,9 @@
|
||||||
limit: limit.value,
|
limit: limit.value,
|
||||||
})
|
})
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
|
if (res.data.length < 10) {
|
||||||
|
state.value = 'finished'
|
||||||
|
}
|
||||||
inviteListData.value = [...inviteListData.value, ...res.data]
|
inviteListData.value = [...inviteListData.value, ...res.data]
|
||||||
count.value = res.count
|
count.value = res.count
|
||||||
}
|
}
|
||||||
|
|
@ -444,4 +447,11 @@
|
||||||
.rules-popup .rules-content .rule-item:last-child {
|
.rules-popup .rules-content .rule-item:last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::v-deep .wd-divider,
|
||||||
|
.wd-divider::after,
|
||||||
|
.wd-divider::before {
|
||||||
|
border: none !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -16,14 +16,14 @@
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<template #title>
|
<template #title>
|
||||||
<view class="li-flex-center li-ml-200">
|
<view class="li-flex-center li-ml-200">
|
||||||
<text class="ri-brush-3-line li-text-47"></text>
|
<text class="ri-brush-3-line li-text-47" @click="clearMsg"></text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifndef MP-WEIXIN -->
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
<template #right>
|
<template #right>
|
||||||
<view class="li-flex-center li-mr-25">
|
<view class="li-flex-center li-mr-25">
|
||||||
<text class="ri-brush-3-line li-text-52 li-pt-2"></text>
|
<text class="ri-brush-3-line li-text-52 li-pt-2" @click="clearMsg"></text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
@ -73,6 +73,8 @@
|
||||||
<view v-if="messageList.length==0" class="!li-mt-300">
|
<view v-if="messageList.length==0" class="!li-mt-300">
|
||||||
<wd-status-tip image="message" tip="暂无待处理会话" />
|
<wd-status-tip image="message" tip="暂无待处理会话" />
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 顶部提示条(成功/失败消息提示) -->
|
||||||
|
<wd-toast />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -80,6 +82,8 @@
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
|
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
|
||||||
import { useNavigation } from '@/hooks/useNavigation'
|
import { useNavigation } from '@/hooks/useNavigation'
|
||||||
|
import { useToast } from '@/uni_modules/wot-design-uni'
|
||||||
|
const Toast = useToast()
|
||||||
// 使用导航 composable
|
// 使用导航 composable
|
||||||
const {
|
const {
|
||||||
hasMultiplePages, // 是否有多个页面在路由栈中
|
hasMultiplePages, // 是否有多个页面在路由栈中
|
||||||
|
|
@ -87,17 +91,17 @@
|
||||||
checkRouteStack // 检查当前路由栈状态的方法
|
checkRouteStack // 检查当前路由栈状态的方法
|
||||||
} = useNavigation()
|
} = useNavigation()
|
||||||
const messageList = ref([
|
const messageList = ref([
|
||||||
{
|
// {
|
||||||
image: '/static/message/icon.png',
|
// image: '/static/message/icon.png',
|
||||||
title: '订单提醒',
|
// title: '订单提醒',
|
||||||
time: '2025/12/12',
|
// time: '2025/12/12',
|
||||||
content: "1.15新版出炉,足迹'随笔功能'上线,记录线,记录线,记录1.15新版出炉,足迹"
|
// content: "1.15新版出炉,足迹'随笔功能'上线,记录线,记录线,记录1.15新版出炉,足迹"
|
||||||
}, {
|
// }, {
|
||||||
image: '/static/message/icon1.png',
|
// image: '/static/message/icon1.png',
|
||||||
title: '订单提醒',
|
// title: '订单提醒',
|
||||||
time: '2025/12/12',
|
// time: '2025/12/12',
|
||||||
content: "1.15新版出炉,足迹'随笔功能'上线,记录线,记录线,记录1.15新版出炉,足迹"
|
// content: "1.15新版出炉,足迹'随笔功能'上线,记录线,记录线,记录1.15新版出炉,足迹"
|
||||||
}
|
// }
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -115,6 +119,11 @@
|
||||||
const handleAction = (action : string) => {
|
const handleAction = (action : string) => {
|
||||||
console.log(action);
|
console.log(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const clearMsg = () => {
|
||||||
|
Toast.info('暂无消息')
|
||||||
|
}
|
||||||
|
|
||||||
const toPages = (item : any) => {
|
const toPages = (item : any) => {
|
||||||
console.log(item);
|
console.log(item);
|
||||||
switch (item.type) {
|
switch (item.type) {
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,8 @@
|
||||||
<wd-loadmore loading-text="努力加载中" finished-text="没有更多了" :state="state" />
|
<wd-loadmore loading-text="努力加载中" finished-text="没有更多了" :state="state" />
|
||||||
</view>
|
</view>
|
||||||
<zero-loading type="wobble" v-if="loading"></zero-loading>
|
<zero-loading type="wobble" v-if="loading"></zero-loading>
|
||||||
|
<!-- 顶部提示条(成功/失败消息提示) -->
|
||||||
|
<wd-toast />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
<text class="status-text">{{historyType=='1'?'入库成功':'核销成功'}}</text>
|
<text class="status-text">{{historyType=='1'?'入库成功':'核销成功'}}</text>
|
||||||
</view>
|
</view>
|
||||||
<text
|
<text
|
||||||
class="status-time">{{codeInfo?.status == 2? '正常入库': '正常核销'}}</text>
|
class="status-time">{{historyType == '1'? '正常入库': '正常核销'}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="li-divider li-my-20"></view>
|
<view class="li-divider li-my-20"></view>
|
||||||
<view class="order-info li-px-30">
|
<view class="order-info li-px-30">
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="li-flex li-justify-between li-text-30 li-text-#666 li-mb-10">
|
<view class="li-flex li-justify-between li-text-30 li-text-#666 li-mb-10">
|
||||||
<text>操作人员:{{userInfo.realname}}</text>
|
<text>操作人员:{{userInfo.realname}}</text>
|
||||||
<text v-if="codeInfo.status == 9">负责仓库:{{codeInfo.distribute_name}}</text>
|
<!-- <text v-if="codeInfo.status == 9">负责仓库:{{codeInfo.distribute_name}}</text> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,21 @@
|
||||||
<text class="li-text-42 ">商品核销</text>
|
<text class="li-text-42 ">商品核销</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<template #right>
|
<template #right>
|
||||||
<view class="li-flex-center li-mr-25" @click="toVerificationHistory">
|
<view class="li-flex-center li-mr-200" @click="toVerificationHistory">
|
||||||
<text class="ri-history-line li-text-48 "></text>
|
<text class="ri-history-line li-text-48"></text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<!-- #endif -->
|
||||||
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
|
<template #right>
|
||||||
|
<view class="li-flex-center li-mr-25" @click="toVerificationHistory">
|
||||||
|
<text class="ri-history-line li-text-48"></text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<!-- #endif -->
|
||||||
</wd-navbar>
|
</wd-navbar>
|
||||||
|
|
||||||
<!-- 功能模式切换卡片 -->
|
<!-- 功能模式切换卡片 -->
|
||||||
|
|
@ -180,7 +190,8 @@
|
||||||
<text class="detail-icon ri-price-tag-3-line"></text>
|
<text class="detail-icon ri-price-tag-3-line"></text>
|
||||||
<text class="detail-label">订单类型</text>
|
<text class="detail-label">订单类型</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="detail-value">{{orderInfo.type==1?'普通订单':(orderInfo.type==2?'秒杀订单':'拼团订单')}}</text>
|
<text
|
||||||
|
class="detail-value">{{orderInfo.type==1?'普通订单':(orderInfo.type==2?'秒杀订单':'拼团订单')}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -153,53 +153,53 @@
|
||||||
|
|
||||||
// 模拟数据 - 实际项目中应该是通过API获取
|
// 模拟数据 - 实际项目中应该是通过API获取
|
||||||
const complaintList = ref([
|
const complaintList = ref([
|
||||||
{
|
// {
|
||||||
complaint_id: 1,
|
// complaint_id: 1,
|
||||||
complaint_no: 'TS20240607001',
|
// complaint_no: 'TS20240607001',
|
||||||
content: '楼道灯已经坏了三天,晚上上下楼很不方便,希望物业尽快解决!',
|
// content: '楼道灯已经坏了三天,晚上上下楼很不方便,希望物业尽快解决!',
|
||||||
village_name: '阳光花园小区',
|
// village_name: '阳光花园小区',
|
||||||
user_name: '张三',
|
// user_name: '张三',
|
||||||
user_mobile: '13800138000',
|
// user_mobile: '13800138000',
|
||||||
create_time: '2024-06-07 10:23',
|
// create_time: '2024-06-07 10:23',
|
||||||
status: 0,
|
// status: 0,
|
||||||
urgency: 2,
|
// urgency: 2,
|
||||||
tags: ['公共设施', '照明'],
|
// tags: ['公共设施', '照明'],
|
||||||
images: [
|
// images: [
|
||||||
'https://img.yzcdn.cn/vant/cat.jpeg',
|
// 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||||
'https://img.yzcdn.cn/vant/tree.jpeg'
|
// 'https://img.yzcdn.cn/vant/tree.jpeg'
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
complaint_id: 2,
|
// complaint_id: 2,
|
||||||
complaint_no: 'TS20240606001',
|
// complaint_no: 'TS20240606001',
|
||||||
content: '小区北门停车场有人乱停车,导致通道被堵,请物业及时处理。',
|
// content: '小区北门停车场有人乱停车,导致通道被堵,请物业及时处理。',
|
||||||
village_name: '阳光花园小区',
|
// village_name: '阳光花园小区',
|
||||||
user_name: '李四',
|
// user_name: '李四',
|
||||||
user_mobile: '13900139000',
|
// user_mobile: '13900139000',
|
||||||
create_time: '2024-06-06 16:45',
|
// create_time: '2024-06-06 16:45',
|
||||||
status: 1,
|
// status: 1,
|
||||||
urgency: 1,
|
// urgency: 1,
|
||||||
tags: ['停车管理', '安全隐患'],
|
// tags: ['停车管理', '安全隐患'],
|
||||||
images: [
|
// images: [
|
||||||
'https://img.yzcdn.cn/vant/cat.jpeg',
|
// 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||||
'https://img.yzcdn.cn/vant/cat.jpeg',
|
// 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||||
'https://img.yzcdn.cn/vant/cat.jpeg',
|
// 'https://img.yzcdn.cn/vant/cat.jpeg',
|
||||||
'https://img.yzcdn.cn/vant/tree.jpeg'
|
// 'https://img.yzcdn.cn/vant/tree.jpeg'
|
||||||
]
|
// ]
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
complaint_id: 3,
|
// complaint_id: 3,
|
||||||
complaint_no: 'TS20240605001',
|
// complaint_no: 'TS20240605001',
|
||||||
content: '小区垃圾分类做得不到位,希望加强宣传和管理。',
|
// content: '小区垃圾分类做得不到位,希望加强宣传和管理。',
|
||||||
village_name: '阳光花园小区',
|
// village_name: '阳光花园小区',
|
||||||
user_name: '王五',
|
// user_name: '王五',
|
||||||
user_mobile: '13700137000',
|
// user_mobile: '13700137000',
|
||||||
create_time: '2024-06-05 09:12',
|
// create_time: '2024-06-05 09:12',
|
||||||
status: 2,
|
// status: 2,
|
||||||
urgency: 1,
|
// urgency: 1,
|
||||||
tags: ['环境卫生', '垃圾分类'],
|
// tags: ['环境卫生', '垃圾分类'],
|
||||||
images: []
|
// images: []
|
||||||
}
|
// }
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// 状态颜色配置
|
// 状态颜色配置
|
||||||
|
|
@ -260,7 +260,7 @@
|
||||||
if (loading.value || finished.value) return;
|
if (loading.value || finished.value) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
loading.value = true;
|
// loading.value = true;
|
||||||
|
|
||||||
// 这里应该调用实际的API接口获取数据
|
// 这里应该调用实际的API接口获取数据
|
||||||
// const params = {
|
// const params = {
|
||||||
|
|
@ -276,7 +276,7 @@
|
||||||
|
|
||||||
// 模拟数据加载完成的情况
|
// 模拟数据加载完成的情况
|
||||||
if (page.value > 1) {
|
if (page.value > 1) {
|
||||||
finished.value = true;
|
// finished.value = true;
|
||||||
} else {
|
} else {
|
||||||
page.value++;
|
page.value++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,7 @@
|
||||||
<view class="page-bg"></view>
|
<view class="page-bg"></view>
|
||||||
|
|
||||||
<!-- 筛选区域 -->
|
<!-- 筛选区域 -->
|
||||||
<view class="filter-section li-w-92% li-mx-auto li-mt-30">
|
<!-- <view class="filter-section li-w-92% li-mx-auto li-mt-30">
|
||||||
<!-- 问卷状态筛选 -->
|
|
||||||
<view class="li-flex li-items-center li-flex-wrap">
|
<view class="li-flex li-items-center li-flex-wrap">
|
||||||
<text v-for="(item, index) in statusList" :key="index"
|
<text v-for="(item, index) in statusList" :key="index"
|
||||||
:class="activeStatus === item.value ? 'status-tag active' : 'status-tag'"
|
:class="activeStatus === item.value ? 'status-tag active' : 'status-tag'"
|
||||||
|
|
@ -45,13 +44,13 @@
|
||||||
{{item.label}}
|
{{item.label}}
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
<!-- 小区选择器 -->
|
<!-- 小区选择器 -->
|
||||||
<view class="li-px-15">
|
<!-- <view class="li-px-15">
|
||||||
<wd-picker size="large" v-model="showVillagePicker" :columns="pickerVillageList" title="选择小区"
|
<wd-picker size="large" v-model="showVillagePicker" :columns="pickerVillageList" title="选择小区"
|
||||||
v-model:value="selectedVillage" @confirm="handleVillageConfirm" label-key="label" value-key="value" />
|
v-model:value="selectedVillage" @confirm="handleVillageConfirm" label-key="label" value-key="value" />
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
<!-- 问卷列表 -->
|
<!-- 问卷列表 -->
|
||||||
<view class="li-w-92% li-mx-auto li-mt-30 li-pb-30">
|
<view class="li-w-92% li-mx-auto li-mt-30 li-pb-30">
|
||||||
|
|
@ -113,10 +112,8 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 空状态 -->
|
<!-- 空状态 -->
|
||||||
<view v-else class="empty-state li-mt-100">
|
<view v-else class="li-mt-200">
|
||||||
<image src="https://img.yzcdn.cn/vant/empty-image-default.png" mode="aspectFit" class="empty-image">
|
<wd-status-tip image="search" tip="暂无问卷记录" />
|
||||||
</image>
|
|
||||||
<text class="li-text-28 li-text-#999 li-mt-20">暂无问卷记录</text>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 加载状态 -->
|
<!-- 加载状态 -->
|
||||||
|
|
@ -256,61 +253,61 @@
|
||||||
|
|
||||||
// 模拟问卷列表数据
|
// 模拟问卷列表数据
|
||||||
const questionnaireList = ref([
|
const questionnaireList = ref([
|
||||||
{
|
// {
|
||||||
id: 1,
|
// id: 1,
|
||||||
title: '2024年度物业服务满意度调查',
|
// title: '2024年度物业服务满意度调查',
|
||||||
village_name: '阳光花园小区',
|
// village_name: '阳光花园小区',
|
||||||
type: '满意度调查',
|
// type: '满意度调查',
|
||||||
user_name: '张三',
|
// user_name: '张三',
|
||||||
is_anonymous: false,
|
// is_anonymous: false,
|
||||||
submit_time: '2024-06-15 14:23',
|
// submit_time: '2024-06-15 14:23',
|
||||||
question_count: 15,
|
// question_count: 15,
|
||||||
status: 1 // 已查看
|
// status: 1 // 已查看
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
id: 2,
|
// id: 2,
|
||||||
title: '小区环境改造意见征集',
|
// title: '小区环境改造意见征集',
|
||||||
village_name: '翠湖庭院',
|
// village_name: '翠湖庭院',
|
||||||
type: '意见征集',
|
// type: '意见征集',
|
||||||
user_name: '李四',
|
// user_name: '李四',
|
||||||
is_anonymous: true,
|
// is_anonymous: true,
|
||||||
submit_time: '2024-06-12 09:45',
|
// submit_time: '2024-06-12 09:45',
|
||||||
question_count: 8,
|
// question_count: 8,
|
||||||
status: 0 // 未查看
|
// status: 0 // 未查看
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
id: 3,
|
// id: 3,
|
||||||
title: '业主委员会换届选举投票',
|
// title: '业主委员会换届选举投票',
|
||||||
village_name: '金色家园',
|
// village_name: '金色家园',
|
||||||
type: '投票选举',
|
// type: '投票选举',
|
||||||
user_name: '王五',
|
// user_name: '王五',
|
||||||
is_anonymous: false,
|
// is_anonymous: false,
|
||||||
submit_time: '2024-06-10 18:30',
|
// submit_time: '2024-06-10 18:30',
|
||||||
question_count: 12,
|
// question_count: 12,
|
||||||
status: 1 // 已查看
|
// status: 1 // 已查看
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
id: 4,
|
// id: 4,
|
||||||
title: '小区健身设施需求调研',
|
// title: '小区健身设施需求调研',
|
||||||
village_name: '阳光花园小区',
|
// village_name: '阳光花园小区',
|
||||||
type: '需求调研',
|
// type: '需求调研',
|
||||||
user_name: '赵六',
|
// user_name: '赵六',
|
||||||
is_anonymous: false,
|
// is_anonymous: false,
|
||||||
submit_time: '2024-06-08 11:20',
|
// submit_time: '2024-06-08 11:20',
|
||||||
question_count: 10,
|
// question_count: 10,
|
||||||
status: 1 // 已查看
|
// status: 1 // 已查看
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
id: 5,
|
// id: 5,
|
||||||
title: '端午节活动满意度调查',
|
// title: '端午节活动满意度调查',
|
||||||
village_name: '翠湖庭院',
|
// village_name: '翠湖庭院',
|
||||||
type: '满意度调查',
|
// type: '满意度调查',
|
||||||
user_name: '匿名用户',
|
// user_name: '匿名用户',
|
||||||
is_anonymous: true,
|
// is_anonymous: true,
|
||||||
submit_time: '2024-06-05 16:40',
|
// submit_time: '2024-06-05 16:40',
|
||||||
question_count: 6,
|
// question_count: 6,
|
||||||
status: 0 // 未查看
|
// status: 0 // 未查看
|
||||||
}
|
// }
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// 状态颜色配置
|
// 状态颜色配置
|
||||||
|
|
@ -406,7 +403,7 @@
|
||||||
// 生命周期钩子
|
// 生命周期钩子
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
checkRouteStack();
|
checkRouteStack();
|
||||||
loadQuestionnaireList();
|
// loadQuestionnaireList();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 下拉刷新
|
// 下拉刷新
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<!-- 自定义导航栏 -->
|
<!-- 自定义导航栏 -->
|
||||||
<wd-navbar :bordered="false"
|
<wd-navbar :bordered="false" custom-style="background: #ffffff;" safeAreaInsetTop fixed placeholder>
|
||||||
custom-style="background: transparent !important; backdrop-filter: blur(10px) !important; -webkit-backdrop-filter: blur(20px) !important;"
|
|
||||||
safeAreaInsetTop fixed placeholder>
|
|
||||||
<template #left>
|
<template #left>
|
||||||
<view class="li-ml-15 li-mt-10 li-flex li-items-center">
|
<view class="li-ml-15 li-mt-10 li-flex li-items-center">
|
||||||
<text v-if="hasMultiplePages" class="ri-arrow-left-s-line li-text-70"
|
<text v-if="hasMultiplePages" class="ri-arrow-left-s-line li-text-70"
|
||||||
|
|
@ -14,88 +12,79 @@
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</wd-navbar>
|
</wd-navbar>
|
||||||
<!-- 导航栏背景 -->
|
|
||||||
<view class="nav-bg-layer"></view>
|
|
||||||
|
|
||||||
<!-- 页面背景 -->
|
|
||||||
<view class="page-bg"></view>
|
|
||||||
|
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<!-- 用户信息预览 -->
|
<!-- 设置选项列表 -->
|
||||||
<view class="user-preview" @click="handleEditInfo">
|
<view class="section">
|
||||||
<view class="user-avatar">
|
<view class="setting-item" @click="handleEditInfo">
|
||||||
<image v-if="userInfo.avatar" :src="userInfo.avatar" mode="aspectFill"></image>
|
<view class="left">
|
||||||
<view v-else class="default-avatar">{{userInfo.nickname.substring(0,1)}}</view>
|
<text class="ri-user-3-line icon"></text>
|
||||||
|
<text class="title">个人信息</text>
|
||||||
|
</view>
|
||||||
|
<text class="ri-arrow-right-s-line arrow"></text>
|
||||||
</view>
|
</view>
|
||||||
<view class="user-detail">
|
|
||||||
<view class="user-name">{{userInfo.nickname || '未设置昵称'}}</view>
|
<view class="setting-item" @click="clearCache">
|
||||||
<view class="user-phone">{{formatPhone(userInfo.phone)}}</view>
|
<view class="left">
|
||||||
|
<text class="ri-delete-bin-6-line icon"></text>
|
||||||
|
<text class="title">清除缓存</text>
|
||||||
|
</view>
|
||||||
|
<text class="value">{{cacheSize}}</text>
|
||||||
</view>
|
</view>
|
||||||
<text class="ri-arrow-right-s-line arrow-icon"></text>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="setting-section">
|
<view class="section">
|
||||||
<view class="setting-list">
|
<view class="setting-item" @click="handlePrivacyPolicy">
|
||||||
<view class="setting-item" @click="clearCache">
|
<view class="left">
|
||||||
<view class="item-left">
|
<text class="ri-lock-line icon"></text>
|
||||||
<text class="ri-delete-bin-5-line item-icon cache-color"></text>
|
<text class="title">隐私政策</text>
|
||||||
<text class="item-title">清除缓存</text>
|
|
||||||
</view>
|
|
||||||
<view class="item-right">
|
|
||||||
<text class="cache-size">{{cacheSize}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="setting-item" @click="handlePrivacyPolicy">
|
<text class="ri-arrow-right-s-line arrow"></text>
|
||||||
<view class="item-left">
|
</view>
|
||||||
<text class="ri-file-text-line item-icon privacy-color"></text>
|
|
||||||
<text class="item-title">隐私政策</text>
|
<view class="setting-item" @click="handleUserAgreement">
|
||||||
</view>
|
<view class="left">
|
||||||
<view class="item-right">
|
<text class="ri-file-list-3-line icon"></text>
|
||||||
<text class="ri-arrow-right-s-line arrow-icon"></text>
|
<text class="title">用户协议</text>
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="setting-item" @click="handleUserAgreement">
|
<text class="ri-arrow-right-s-line arrow"></text>
|
||||||
<view class="item-left">
|
</view>
|
||||||
<text class="ri-file-list-3-line item-icon agreement-color"></text>
|
|
||||||
<text class="item-title">用户协议</text>
|
<view class="setting-item" @click="checkUpdate">
|
||||||
</view>
|
<view class="left">
|
||||||
<view class="item-right">
|
<text class="ri-information-line icon"></text>
|
||||||
<text class="ri-arrow-right-s-line arrow-icon"></text>
|
<text class="title">关于我们</text>
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="setting-item" @click="checkUpdate">
|
<view class="right">
|
||||||
<view class="item-left">
|
<text class="version">{{appVersion}}</text>
|
||||||
<text class="ri-information-line item-icon about-color"></text>
|
<text class="ri-arrow-right-s-line arrow"></text>
|
||||||
<text class="item-title">关于我们</text>
|
|
||||||
</view>
|
|
||||||
<view class="item-right">
|
|
||||||
<text class="version-text">v{{appVersion}}</text>
|
|
||||||
<text class="ri-arrow-right-s-line arrow-icon"></text>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 退出登录按钮 -->
|
<!-- 退出登录按钮 -->
|
||||||
<view class="logout-container">
|
<view class="logout-wrap">
|
||||||
<button class="logout-btn" @click="handleLogout">退出登录</button>
|
<button class="logout-btn" @click="handleLogout">退出登录</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 确认弹窗 -->
|
|
||||||
<wd-dialog v-model="showLogoutDialog" title="退出登录" :show-cancel-button="true" @confirm="confirmLogout">
|
<wd-message-box />
|
||||||
<view class="dialog-content">
|
<wd-toast />
|
||||||
确定要退出登录吗?
|
|
||||||
</view>
|
|
||||||
</wd-dialog>
|
|
||||||
</view>
|
</view>
|
||||||
|
<zero-loading type="wobble" v-if="loading"></zero-loading>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { logout } from '@/api/login'
|
||||||
import { ref, reactive, onMounted } from 'vue';
|
import { ref, reactive, onMounted } from 'vue';
|
||||||
import { useNavigation } from '@/hooks/useNavigation';
|
import { useNavigation } from '@/hooks/useNavigation';
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
|
import { useMessage } from '@/uni_modules/wot-design-uni'
|
||||||
|
import { useToast } from '@/uni_modules/wot-design-uni';
|
||||||
|
|
||||||
|
const Toast = useToast();
|
||||||
|
const message = useMessage()
|
||||||
|
|
||||||
// 使用导航 composable
|
// 使用导航 composable
|
||||||
const {
|
const {
|
||||||
|
|
@ -103,25 +92,15 @@
|
||||||
isTabBarPage, // 当前页面是否为 tabBar 页面
|
isTabBarPage, // 当前页面是否为 tabBar 页面
|
||||||
checkRouteStack // 检查当前路由栈状态的方法
|
checkRouteStack // 检查当前路由栈状态的方法
|
||||||
} = useNavigation()
|
} = useNavigation()
|
||||||
|
const loading = ref<boolean>(false)
|
||||||
|
|
||||||
// 用户信息
|
|
||||||
const userInfo = reactive({
|
|
||||||
nickname: '里派用户',
|
|
||||||
phone: '13800138000',
|
|
||||||
avatar: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
// 缓存大小
|
// 缓存大小
|
||||||
const cacheSize = ref('4.8MB');
|
const cacheSize = ref('获取中...');
|
||||||
|
|
||||||
// 应用版本
|
// 应用版本
|
||||||
const appVersion = ref('1.0.0');
|
const appVersion = ref('v1.0.0');
|
||||||
|
|
||||||
// 深色模式
|
|
||||||
const isDarkMode = ref(false);
|
|
||||||
|
|
||||||
// 登出对话框
|
|
||||||
const showLogoutDialog = ref(false);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 格式化手机号码为带星号格式
|
* 格式化手机号码为带星号格式
|
||||||
|
|
@ -130,13 +109,12 @@
|
||||||
if (!phone) return '';
|
if (!phone) return '';
|
||||||
return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
|
return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
|
||||||
};
|
};
|
||||||
|
|
||||||
// 页面跳转
|
// 页面跳转
|
||||||
const toPages = (item : any) => {
|
const toPages = ({ type }) => {
|
||||||
if (item.type === 'nav') {
|
if (type === 'nav') {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
} else if (item.type === 'home') {
|
} else if (type === 'home') {
|
||||||
// 这里是项目内部的跳转逻辑
|
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/index/index'
|
url: '/pages/index/index'
|
||||||
})
|
})
|
||||||
|
|
@ -152,34 +130,154 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取缓存大小
|
||||||
|
*/
|
||||||
|
const getCacheSize = () => {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
try {
|
||||||
|
plus.cache.calculate(size => {
|
||||||
|
const sizeInMB = (size / (1024 * 1024)).toFixed(1);
|
||||||
|
cacheSize.value = size > 0 ? sizeInMB + 'MB' : '0KB';
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
// 如果获取缓存失败,显示默认值
|
||||||
|
console.error('获取APP缓存大小失败:', e);
|
||||||
|
cacheSize.value = '0KB';
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef MP
|
||||||
|
try {
|
||||||
|
uni.getStorageInfo({
|
||||||
|
success: (res) => {
|
||||||
|
const size = res.currentSize;
|
||||||
|
if (size <= 0) {
|
||||||
|
cacheSize.value = '0KB';
|
||||||
|
} else if (size < 1024) {
|
||||||
|
cacheSize.value = size + 'KB';
|
||||||
|
} else {
|
||||||
|
cacheSize.value = (size / 1024).toFixed(1) + 'MB';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.error('获取小程序缓存大小失败:', err);
|
||||||
|
cacheSize.value = '0KB';
|
||||||
|
},
|
||||||
|
complete: () => {
|
||||||
|
// 如果30秒后还是"获取中..."状态,则置为0KB
|
||||||
|
setTimeout(() => {
|
||||||
|
if (cacheSize.value === '获取中...') {
|
||||||
|
cacheSize.value = '0KB';
|
||||||
|
}
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.error('获取缓存异常:', e);
|
||||||
|
cacheSize.value = '0KB';
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef H5
|
||||||
|
try {
|
||||||
|
// 计算localStorage大小(粗略估计)
|
||||||
|
let size = 0;
|
||||||
|
for (let key in localStorage) {
|
||||||
|
if (localStorage.hasOwnProperty(key)) {
|
||||||
|
size += localStorage[key].length * 2; // UTF-16 字符占用2字节
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (size <= 0) {
|
||||||
|
cacheSize.value = '0KB';
|
||||||
|
} else if (size < 1024) {
|
||||||
|
cacheSize.value = size + 'B';
|
||||||
|
} else if (size < 1048576) { // 1024 * 1024
|
||||||
|
cacheSize.value = (size / 1024).toFixed(1) + 'KB';
|
||||||
|
} else {
|
||||||
|
cacheSize.value = (size / 1048576).toFixed(1) + 'MB';
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error('获取H5缓存大小失败:', e);
|
||||||
|
cacheSize.value = '0KB';
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清除缓存
|
* 清除缓存
|
||||||
*/
|
*/
|
||||||
const clearCache = () => {
|
const clearCache = () => {
|
||||||
|
message.alert({
|
||||||
|
msg: '清除缓存需重新登录,请谨慎操作!',
|
||||||
|
title: '提示',
|
||||||
|
type: 'confirm',
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
clearAll()
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
const clearAll = () => {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '清理中...'
|
title: '清理中...'
|
||||||
});
|
});
|
||||||
|
// #ifdef APP-PLUS
|
||||||
// 模拟清理过程
|
try {
|
||||||
setTimeout(() => {
|
plus.cache.clear(() => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
cacheSize.value = '0KB';
|
cacheSize.value = '0KB';
|
||||||
uni.showToast({
|
Toast.success('缓存已清理')
|
||||||
title: '缓存已清理',
|
}, err => {
|
||||||
icon: 'success'
|
console.error('清理APP缓存失败:', err);
|
||||||
|
uni.hideLoading();
|
||||||
|
Toast.error('清理失败')
|
||||||
});
|
});
|
||||||
}, 1000);
|
} catch (e) {
|
||||||
};
|
console.error('清理缓存异常:', e);
|
||||||
|
uni.hideLoading();
|
||||||
|
Toast.error('清理失败')
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef MP
|
||||||
|
try {
|
||||||
|
uni.clearStorageSync();
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
cacheSize.value = '0KB';
|
||||||
|
Toast.success('缓存已清理')
|
||||||
|
}, 500);
|
||||||
|
} catch (e) {
|
||||||
|
console.error('清理小程序缓存失败:', e);
|
||||||
|
uni.hideLoading();
|
||||||
|
Toast.error('清理失败')
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #ifdef H5
|
||||||
|
try {
|
||||||
|
localStorage.clear();
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.hideLoading();
|
||||||
|
cacheSize.value = '0KB';
|
||||||
|
Toast.success('缓存已清理')
|
||||||
|
}, 500);
|
||||||
|
} catch (e) {
|
||||||
|
uni.hideLoading();
|
||||||
|
Toast.error('清理失败')
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
confirmLogout()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查看隐私政策
|
* 查看隐私政策
|
||||||
*/
|
*/
|
||||||
const handlePrivacyPolicy = () => {
|
const handlePrivacyPolicy = () => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesA/other/privacy'
|
url: '/pagesB/agreement/index?type=2'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -188,7 +286,7 @@
|
||||||
*/
|
*/
|
||||||
const handleUserAgreement = () => {
|
const handleUserAgreement = () => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pagesA/other/agreement'
|
url: '/pagesB/agreement/index?type=1'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -196,294 +294,171 @@
|
||||||
* 检查更新
|
* 检查更新
|
||||||
*/
|
*/
|
||||||
const checkUpdate = () => {
|
const checkUpdate = () => {
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
title: '当前已是最新版本',
|
// title: '当前已是最新版本',
|
||||||
icon: 'none'
|
// icon: 'none'
|
||||||
});
|
// });
|
||||||
|
Toast.success('当前已是最新版本')
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示退出登录确认框
|
* 显示退出登录确认框
|
||||||
*/
|
*/
|
||||||
const handleLogout = () => {
|
const handleLogout = () => {
|
||||||
showLogoutDialog.value = true;
|
message.alert({
|
||||||
|
msg: '确定退出吗?',
|
||||||
|
title: '退出登录',
|
||||||
|
type: 'confirm',
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
confirmLogout()
|
||||||
|
uni.showLoading({
|
||||||
|
title: '退出中...'
|
||||||
|
})
|
||||||
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 确认退出登录
|
* 确认退出登录
|
||||||
*/
|
*/
|
||||||
const confirmLogout = () => {
|
const confirmLogout = async () => {
|
||||||
uni.showLoading({
|
// loading.value = true
|
||||||
title: '退出中...'
|
|
||||||
});
|
|
||||||
|
|
||||||
// 模拟退出过程
|
const res = await logout()
|
||||||
setTimeout(() => {
|
if (res.code == 200) {
|
||||||
uni.hideLoading();
|
uni.hideLoading()
|
||||||
|
|
||||||
// 清除登录状态及相关缓存
|
|
||||||
uni.removeStorageSync('token');
|
uni.removeStorageSync('token');
|
||||||
uni.removeStorageSync('userInfo');
|
uni.removeStorageSync('userInfo');
|
||||||
|
|
||||||
// 跳转到登录页
|
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/login/index'
|
url: '/pages/login/index'
|
||||||
});
|
});
|
||||||
}, 1000);
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
checkRouteStack()
|
checkRouteStack();
|
||||||
// 获取用户信息
|
|
||||||
const userInfoStorage = uni.getStorageSync('userInfo');
|
|
||||||
if (userInfoStorage) {
|
|
||||||
Object.assign(userInfo, JSON.parse(userInfoStorage));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取缓存大小
|
// 获取缓存大小
|
||||||
uni.getStorageInfo({
|
getCacheSize();
|
||||||
success: (res) => {
|
|
||||||
const size = res.currentSize;
|
|
||||||
if (size < 1024) {
|
|
||||||
cacheSize.value = size + 'KB';
|
|
||||||
} else {
|
|
||||||
cacheSize.value = (size / 1024).toFixed(1) + 'MB';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 获取应用版本
|
// 获取应用版本
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
plus.runtime.getProperty(plus.runtime.appid, (res) => {
|
plus.runtime.getProperty(plus.runtime.appid, (res) => {
|
||||||
appVersion.value = res.version;
|
appVersion.value = 'v' + res.version;
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss">
|
||||||
/* 主容器 */
|
page {
|
||||||
.container {
|
background-color: #f5f7fa;
|
||||||
min-height: 100vh;
|
|
||||||
background-color: transparent;
|
|
||||||
position: relative;
|
|
||||||
font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, Helvetica, Segoe UI, Arial, Roboto, PingFang SC, sans-serif;
|
|
||||||
padding-bottom: env(safe-area-inset-bottom);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 导航栏背景 */
|
|
||||||
.nav-bg-layer {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: calc(var(--status-bar-height) + 88rpx);
|
|
||||||
background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
|
|
||||||
z-index: -1;
|
|
||||||
backdrop-filter: blur(10px);
|
|
||||||
-webkit-backdrop-filter: blur(10px);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 页面背景 */
|
|
||||||
.page-bg {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background: linear-gradient(135deg, #f8fafd 0%, #eef2f9 100%);
|
|
||||||
z-index: -2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 内容区域 */
|
|
||||||
.content {
|
.content {
|
||||||
position: relative;
|
padding: 28rpx 32rpx 120rpx;
|
||||||
z-index: 2;
|
|
||||||
padding: 30rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 用户信息预览 */
|
.section {
|
||||||
.user-preview {
|
background-color: #ffffff;
|
||||||
background-color: #fff;
|
border-radius: 18rpx;
|
||||||
border-radius: 16rpx;
|
margin-bottom: 28rpx;
|
||||||
padding: 30rpx;
|
overflow: hidden;
|
||||||
|
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
.setting-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 30rpx;
|
justify-content: space-between;
|
||||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
|
padding: 34rpx 32rpx;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
.user-avatar {
|
&:not(:last-child)::after {
|
||||||
width: 120rpx;
|
content: '';
|
||||||
height: 120rpx;
|
position: absolute;
|
||||||
border-radius: 60rpx;
|
left: 32rpx;
|
||||||
overflow: hidden;
|
right: 32rpx;
|
||||||
margin-right: 24rpx;
|
bottom: 0;
|
||||||
|
height: 1px;
|
||||||
image {
|
background-color: #f0f2f5;
|
||||||
width: 100%;
|
transform: scaleY(0.5);
|
||||||
height: 100%;
|
|
||||||
border-radius: 60rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.default-avatar {
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
background: linear-gradient(135deg, #4080FF, #5E96FF);
|
|
||||||
color: #fff;
|
|
||||||
font-size: 60rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-detail {
|
&:active {
|
||||||
flex: 1;
|
background-color: #f8f9fa;
|
||||||
|
|
||||||
.user-name {
|
|
||||||
font-size: 36rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #333;
|
|
||||||
margin-bottom: 8rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.user-phone {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.arrow-icon {
|
.left {
|
||||||
font-size: 44rpx;
|
|
||||||
color: #ccc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 设置项区域 */
|
|
||||||
.setting-section {
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
|
|
||||||
.section-title {
|
|
||||||
font-size: 30rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #333;
|
|
||||||
margin-bottom: 16rpx;
|
|
||||||
padding-left: 16rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.setting-list {
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 16rpx;
|
|
||||||
overflow: hidden;
|
|
||||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
|
|
||||||
}
|
|
||||||
|
|
||||||
.setting-item {
|
|
||||||
padding: 28rpx 30rpx;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
|
||||||
border-bottom: 1px solid #f5f5f5;
|
|
||||||
|
|
||||||
&:last-child {
|
.icon {
|
||||||
border-bottom: none;
|
font-size: 42rpx;
|
||||||
|
margin-right: 24rpx;
|
||||||
|
color: #3370ff;
|
||||||
|
opacity: 0.85;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-left {
|
.title {
|
||||||
display: flex;
|
font-size: 30rpx;
|
||||||
align-items: center;
|
color: #333333;
|
||||||
|
font-weight: 450;
|
||||||
.item-icon {
|
letter-spacing: 0.5rpx;
|
||||||
font-size: 44rpx;
|
|
||||||
margin-right: 20rpx;
|
|
||||||
|
|
||||||
&.account-color {
|
|
||||||
color: #4080FF;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.security-color {
|
|
||||||
color: #5AC8FA;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.notice-color {
|
|
||||||
color: #FF9500;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.theme-color {
|
|
||||||
color: #5E6687;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.cache-color {
|
|
||||||
color: #FF3B30;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.privacy-color {
|
|
||||||
color: #34C759;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.agreement-color {
|
|
||||||
color: #9013FE;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.about-color {
|
|
||||||
color: #4080FF;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.item-title {
|
|
||||||
font-size: 30rpx;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.item-right {
|
.arrow {
|
||||||
display: flex;
|
color: #c0c0c0;
|
||||||
align-items: center;
|
font-size: 34rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.arrow-icon {
|
.value {
|
||||||
font-size: 44rpx;
|
font-size: 28rpx;
|
||||||
color: #ccc;
|
color: #999999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cache-size,
|
.right {
|
||||||
.version-text {
|
display: flex;
|
||||||
font-size: 28rpx;
|
align-items: center;
|
||||||
color: #999;
|
|
||||||
margin-right: 10rpx;
|
.version {
|
||||||
}
|
font-size: 28rpx;
|
||||||
|
color: #999999;
|
||||||
|
margin-right: 12rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 退出登录按钮 */
|
.logout-wrap {
|
||||||
.logout-container {
|
padding: 60rpx 40rpx;
|
||||||
margin-top: 60rpx;
|
|
||||||
padding: 0 20rpx;
|
|
||||||
margin-bottom: 50rpx;
|
|
||||||
|
|
||||||
.logout-btn {
|
.logout-btn {
|
||||||
background-color: #fff;
|
width: 100%;
|
||||||
color: #FF3B30;
|
height: 90rpx;
|
||||||
border: none;
|
line-height: 90rpx;
|
||||||
height: 96rpx;
|
background: linear-gradient(135deg, #398CFF 0%, #2170E8 100%);
|
||||||
line-height: 96rpx;
|
color: #ffffff;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
border-radius: 16rpx;
|
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
|
border-radius: 45rpx;
|
||||||
|
border: none;
|
||||||
|
box-shadow: 0 4rpx 12rpx rgba(57, 140, 255, 0.3);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
background-color: #f8f8f8;
|
transform: scale(0.98);
|
||||||
|
box-shadow: 0 2rpx 8rpx rgba(57, 140, 255, 0.2);
|
||||||
|
opacity: 0.9;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 弹窗内容样式 */
|
|
||||||
.dialog-content {
|
.dialog-content {
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 30rpx;
|
font-size: 28rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -1,32 +1,234 @@
|
||||||
|
|
||||||
.li-mt-25{margin-top:25rpx}
|
.li-bg-white{background-color:rgb(255,255,255)}
|
||||||
|
.li-flex{display:flex}
|
||||||
.li-pt-6{padding-top:6rpx}
|
.li-flex-col{flex-direction:column}
|
||||||
.li-px-15{padding-left:15rpx;padding-right:15rpx}
|
.li-font-550{font-weight:550}
|
||||||
|
.li-h-130{height:130rpx}
|
||||||
|
.li-h-68{height:68rpx}
|
||||||
|
.li-items-center{align-items:center}
|
||||||
|
.li-justify-between{justify-content:space-between}
|
||||||
|
.li-justify-center{justify-content:center}
|
||||||
|
.li-mt-100{margin-top:100rpx}
|
||||||
|
.li-mt-28{margin-top:28rpx}
|
||||||
|
.li-mt-32{margin-top:32rpx}
|
||||||
|
.li-mt-90{margin-top:90rpx}
|
||||||
|
.li-mx-10{margin-left:10rpx;margin-right:10rpx}
|
||||||
|
.li-mx-auto{margin-left:auto;margin-right:auto}
|
||||||
|
.li-pt-270{padding-top:270rpx}
|
||||||
|
.li-rd-40{border-radius:40rpx}
|
||||||
|
.li-text-000000-color{color:rgb(0,0,0)}
|
||||||
|
.li-text-24{font-size:24rpx}
|
||||||
|
.li-text-2EA1EA-color{color:rgb(46,161,234)}
|
||||||
|
.li-text-38{font-size:38rpx}
|
||||||
|
.li-text-a5a5a5-color{color:rgb(165,165,165)}
|
||||||
|
.li-w-130{width:130rpx}
|
||||||
|
.li-w-150{width:150rpx}
|
||||||
|
.li-w-420{width:420rpx}
|
||||||
|
.li-w-full-80{width:80%}
|
||||||
|
.li-w-full-85{width:85%}
|
||||||
|
.li-w-full-90{width:90%}
|
||||||
|
.items-center{align-items:center}
|
||||||
|
.justify-end{justify-content:end}
|
||||||
|
.justify-center{justify-content:center}
|
||||||
|
.justify-between{justify-content:space-between}
|
||||||
|
.li-flex-center{display:flex;align-items:center;justify-content:center}
|
||||||
|
.li-h-160{height:160rpx}
|
||||||
|
.li-h-58{height:58rpx}
|
||||||
|
.li-justify-around{justify-content:space-around}
|
||||||
|
.li-ml-22{margin-left:22rpx}
|
||||||
|
.li-ml-25{margin-left:25rpx}
|
||||||
|
.li-ml-35{margin-left:35rpx}
|
||||||
|
.li-mr-5{margin-right:5rpx}
|
||||||
|
.li-mt-10{margin-top:10rpx}
|
||||||
|
.li-mt-12{margin-top:12rpx}
|
||||||
|
.li-mt-14{margin-top:14rpx}
|
||||||
|
.li-mt-15{margin-top:15rpx}
|
||||||
|
.li-mt-20{margin-top:20rpx}
|
||||||
|
.li-mt-30{margin-top:30rpx}
|
||||||
|
.li-px-25{padding-left:25rpx;padding-right:25rpx}
|
||||||
|
.li-px-30{padding-left:30rpx;padding-right:30rpx}
|
||||||
|
.li-px-40{padding-left:40rpx;padding-right:40rpx}
|
||||||
|
.li-py-25{padding-top:25rpx;padding-bottom:25rpx}
|
||||||
|
.li-rd-10{border-radius:10rpx}
|
||||||
|
.li-rd-15{border-radius:15rpx}
|
||||||
|
.li-text-010B3E-color{color:rgb(1,11,62)}
|
||||||
|
.li-text-22{font-size:22rpx}
|
||||||
|
.li-text-26{font-size:26rpx}
|
||||||
|
.li-text-28{font-size:28rpx}
|
||||||
|
.li-text-30{font-size:30rpx}
|
||||||
|
.li-text-343333-color{color:rgb(52,51,51)}
|
||||||
|
.li-text-AFB2B8-color{color:rgb(175,178,184)}
|
||||||
|
.li-text-B1B0B0-color{color:rgb(177,176,176)}
|
||||||
|
.li-w-310{width:310rpx}
|
||||||
|
.li-w-58{width:58rpx}
|
||||||
|
.li-w-full-70{width:70%}
|
||||||
|
.li-w-full-88{width:88%}
|
||||||
|
.li-h-100{height:100rpx}
|
||||||
|
.li-ml-20{margin-left:20rpx}
|
||||||
|
.li-ml-200{margin-left:200rpx}
|
||||||
|
.li-ml-30{margin-left:30rpx}
|
||||||
|
.li-mr-10{margin-right:10rpx}
|
||||||
|
.li-mr-30{margin-right:30rpx}
|
||||||
|
.li-mt-300-important{margin-top:300rpx !important}
|
||||||
|
.li-pt-2{padding-top:2rpx}
|
||||||
|
.li-py-20{padding-top:20rpx;padding-bottom:20rpx}
|
||||||
|
.li-rd-full-50{border-radius:50%}
|
||||||
|
.li-text-25{font-size:25rpx}
|
||||||
|
.li-text-35{font-size:35rpx}
|
||||||
|
.li-text-42{font-size:42rpx}
|
||||||
|
.li-text-46{font-size:46rpx}
|
||||||
|
.li-w-100{width:100rpx}
|
||||||
.bg-0070F0{background-color:rgb(0,112,240)}
|
.bg-0070F0{background-color:rgb(0,112,240)}
|
||||||
.li-my-10{margin-top:10rpx;margin-bottom:10rpx}
|
.bg-f9f9f9{background-color:rgb(249,249,249)}
|
||||||
.li-p-20{padding:20rpx}
|
.bg-FFFFFF{background-color:rgb(255,255,255)}
|
||||||
.li-px-20{padding-left:20rpx;padding-right:20rpx}
|
.border-4-white{border-style:solid;border-color:rgb(255,255,255);border-width:4rpx}
|
||||||
.li-py-10{padding-top:10rpx;padding-bottom:10rpx}
|
.li-font-bold{font-weight:bold}
|
||||||
.li-py-60{padding-top:60rpx;padding-bottom:60rpx}
|
.li-h-240{height:240rpx}
|
||||||
.li-rd-8{border-radius:8rpx}
|
.li-h-250{height:250rpx}
|
||||||
.li-text-dddddd-color{color:rgb(221,221,221)}
|
.li-h-50{height:50rpx}
|
||||||
.li-text-ff9900-color{color:rgb(255,153,0)}
|
.li-h-60{height:60rpx}
|
||||||
|
.li-items-end{align-items:end}
|
||||||
|
.li-justify-start{justify-content:start}
|
||||||
|
.li-mb-2{margin-bottom:2rpx}
|
||||||
|
.li-ml-4{margin-left:4rpx}
|
||||||
|
.li-ml-50{margin-left:50rpx}
|
||||||
|
.li-mr-20{margin-right:20rpx}
|
||||||
|
.li-mr-50{margin-right:50rpx}
|
||||||
|
.li-mt-26{margin-top:26rpx}
|
||||||
|
.li-mt-60{margin-top:60rpx}
|
||||||
|
.li-mx-20{margin-left:20rpx;margin-right:20rpx}
|
||||||
|
.li-mx-40{margin-left:40rpx;margin-right:40rpx}
|
||||||
|
.li-pb-10{padding-bottom:10rpx}
|
||||||
|
.li-pb-14{padding-bottom:14rpx}
|
||||||
|
.li-pb-20{padding-bottom:20rpx}
|
||||||
|
.li-pt-20{padding-top:20rpx}
|
||||||
|
.li-pt-8{padding-top:8rpx}
|
||||||
|
.li-rd-20{border-radius:20rpx}
|
||||||
|
.li-rd-tl-30-important{border-top-left-radius:30rpx !important}
|
||||||
|
.li-rd-tr-30-important{border-top-right-radius:30rpx !important}
|
||||||
|
.li-text-19171B-color{color:rgb(25,23,27)}
|
||||||
|
.li-text-20{font-size:20rpx}
|
||||||
|
.li-text-32{font-size:32rpx}
|
||||||
|
.li-text-706e70-color{color:rgb(112,110,112)}
|
||||||
|
.li-text-B2B2B2-color{color:rgb(178,178,178)}
|
||||||
|
.li-text-BBBDDA-color{color:rgb(187,189,218)}
|
||||||
|
.li-text-F2F7FD-color{color:rgb(242,247,253)}
|
||||||
|
.li-text-F8C883-color{color:rgb(248,200,131)}
|
||||||
|
.li-text-FFFFFF-color{color:rgb(255,255,255)}
|
||||||
|
.li-text-b1bbc7-color{color:rgb(177,187,199)}
|
||||||
|
.li-w-240{width:240rpx}
|
||||||
|
.li-w-50{width:50rpx}
|
||||||
|
.li-w-60{width:60rpx}
|
||||||
|
.li-w-full-94{width:94%}
|
||||||
|
.li-h-110{height:110rpx}
|
||||||
|
.li-items-start{align-items:start}
|
||||||
|
.li-mb-12{margin-bottom:12rpx}
|
||||||
|
.li-mb-20{margin-bottom:20rpx}
|
||||||
|
.li-mb-8{margin-bottom:8rpx}
|
||||||
|
.li-ml-15{margin-left:15rpx}
|
||||||
|
.li-mr-12{margin-right:12rpx}
|
||||||
|
.li-mr-3{margin-right:3rpx}
|
||||||
|
.li-mr-6{margin-right:6rpx}
|
||||||
|
.li-mt-40{margin-top:40rpx}
|
||||||
|
.li-pb-25{padding-bottom:25rpx}
|
||||||
|
.li-pb-30{padding-bottom:30rpx}
|
||||||
|
.li-pl-20{padding-left:20rpx}
|
||||||
|
.li-pl-30{padding-left:30rpx}
|
||||||
|
.li-pr-30{padding-right:30rpx}
|
||||||
|
.li-pt-30{padding-top:30rpx}
|
||||||
|
.li-py-6{padding-top:6rpx;padding-bottom:6rpx}
|
||||||
|
.li-text-009aff-color{color:rgb(0,154,255)}
|
||||||
|
.li-text-40{font-size:40rpx}
|
||||||
|
.li-text-55{font-size:55rpx}
|
||||||
|
.li-text-5f5f5f-color{color:rgb(95,95,95)}
|
||||||
|
.li-text-666-color{color:rgb(102,102,102)}
|
||||||
|
.li-text-70{font-size:70rpx}
|
||||||
|
.li-text-9a9a9a-color{color:rgb(154,154,154)}
|
||||||
|
.li-text-right{text-align:right}
|
||||||
|
.li-w-110{width:110rpx}
|
||||||
|
.li-w-400{width:400rpx}
|
||||||
|
.li-w-full-92{width:92%}
|
||||||
|
.overflow-hidden{overflow:hidden}
|
||||||
|
.li-ml-6{margin-left:6rpx}
|
||||||
|
.li-p-15{padding:15rpx}
|
||||||
|
.li-pb-15{padding-bottom:15rpx}
|
||||||
|
.li-pt-25{padding-top:25rpx}
|
||||||
|
.li-pt-4{padding-top:4rpx}
|
||||||
|
.li-text-333333-color{color:rgb(51,51,51)}
|
||||||
|
.li-text-36{font-size:36rpx}
|
||||||
|
.li-text-ff0000-color{color:rgb(255,0,0)}
|
||||||
|
.li-w-full-100{width:100%}
|
||||||
|
.li-font-400{font-weight:400}
|
||||||
|
.li-m-30{margin:30rpx}
|
||||||
|
.li-text-595959-color{color:rgb(89,89,89)}
|
||||||
|
.li-mb-25{margin-bottom:25rpx}
|
||||||
|
.li-mb-30{margin-bottom:30rpx}
|
||||||
|
.li-ml-10{margin-left:10rpx}
|
||||||
|
.li-mr-200{margin-right:200rpx}
|
||||||
|
.li-mr-4{margin-right:4rpx}
|
||||||
|
.li-mt-100-important{margin-top:100rpx !important}
|
||||||
|
.li-mt-4{margin-top:4rpx}
|
||||||
|
.li-mt-50{margin-top:50rpx}
|
||||||
|
.li-mt-8{margin-top:8rpx}
|
||||||
|
.li-py-40{padding-top:40rpx;padding-bottom:40rpx}
|
||||||
|
.li-text-0070F0-color{color:rgb(0,112,240)}
|
||||||
|
.li-text-333-color{color:rgb(51,51,51)}
|
||||||
|
.li-text-34{font-size:34rpx}
|
||||||
|
.li-text-44{font-size:44rpx}
|
||||||
|
.li-text-48{font-size:48rpx}
|
||||||
|
.li-text-90{font-size:90rpx}
|
||||||
|
.li-text-999-color{color:rgb(153,153,153)}
|
||||||
|
.li-text-center{text-align:center}
|
||||||
|
.li-text-white{color:rgb(255,255,255)}
|
||||||
|
.li-w-500{width:500rpx}
|
||||||
|
.li-mr-25{margin-right:25rpx}
|
||||||
|
.li-h-90{height:90rpx}
|
||||||
|
.li-text-47{font-size:47rpx}
|
||||||
|
.li-w-90{width:90rpx}
|
||||||
|
.li-border-b{border-style:solid;border-color:b;border-width:1rpx}
|
||||||
|
.li-mb-10{margin-bottom:10rpx}
|
||||||
|
.li-mb-15{margin-bottom:15rpx}
|
||||||
|
.li-my-20{margin-top:20rpx;margin-bottom:20rpx}
|
||||||
|
.li-p-30{padding:30rpx}
|
||||||
|
.li-py-30{padding-top:30rpx;padding-bottom:30rpx}
|
||||||
|
.li-text-ff6b35-color{color:rgb(255,107,53)}
|
||||||
|
.li-block{display:block}
|
||||||
|
.li-items-baseline{align-items:baseline}
|
||||||
|
.li-mr-15{margin-right:15rpx}
|
||||||
|
.li-mt-5{margin-top:5rpx}
|
||||||
|
.li-opacity-100{undefined:1}
|
||||||
|
.li-rd-12{border-radius:12rpx}
|
||||||
|
.li-rd-16{border-radius:16rpx}
|
||||||
|
.li-text-0a4696-color{color:rgb(10,70,150)}
|
||||||
|
.li-flex-1{flex:1}
|
||||||
|
.li-flex-wrap{flex-wrap:wrap}
|
||||||
|
.li-line-clamp-2{overflow:hidden;display:-webkit-box;line-clamp:2;-webkit-box-orient:vertical;-webkit-line-clamp:2}
|
||||||
|
.li-text-999999-color{color:rgb(153,153,153)}
|
||||||
|
.li-w-160{width:160rpx}
|
||||||
|
.li-w-full-96{width:96%}
|
||||||
|
.li-mt-25{margin-top:25rpx}
|
||||||
|
.li-mt-200{margin-top:200rpx}
|
||||||
|
.li-pt-6{padding-top:6rpx}
|
||||||
|
.li-mr-180{margin-right:180rpx}
|
||||||
.li-opacity-80{undefined:0.8}
|
.li-opacity-80{undefined:0.8}
|
||||||
.li-pb-40{padding-bottom:40rpx}
|
.li-pb-40{padding-bottom:40rpx}
|
||||||
|
.li-px-20{padding-left:20rpx;padding-right:20rpx}
|
||||||
|
.li-py-10{padding-top:10rpx;padding-bottom:10rpx}
|
||||||
.li-py-100{padding-top:100rpx;padding-bottom:100rpx}
|
.li-py-100{padding-top:100rpx;padding-bottom:100rpx}
|
||||||
.li-py-15{padding-top:15rpx;padding-bottom:15rpx}
|
.li-py-60{padding-top:60rpx;padding-bottom:60rpx}
|
||||||
.li-rd-30{border-radius:30rpx}
|
.li-rd-30{border-radius:30rpx}
|
||||||
.li-text-100{font-size:100rpx}
|
.li-text-100{font-size:100rpx}
|
||||||
.li-text-3e9bff-color{color:rgb(62,155,255)}
|
.li-text-3e9bff-color{color:rgb(62,155,255)}
|
||||||
.li-text-50{font-size:50rpx}
|
.li-text-50{font-size:50rpx}
|
||||||
.li-text-52c41a-color{color:rgb(82,196,26)}
|
.li-text-52c41a-color{color:rgb(82,196,26)}
|
||||||
.li-text-60{font-size:60rpx}
|
|
||||||
.li-text-ccc-color{color:rgb(204,204,204)}
|
.li-text-ccc-color{color:rgb(204,204,204)}
|
||||||
.li-text-ff4d4f-color{color:rgb(255,77,79)}
|
.li-text-ff4d4f-color{color:rgb(255,77,79)}
|
||||||
|
|
||||||
|
.li-my-10{margin-top:10rpx;margin-bottom:10rpx}
|
||||||
|
.li-p-20{padding:20rpx}
|
||||||
|
.li-rd-8{border-radius:8rpx}
|
||||||
|
.li-text-dddddd-color{color:rgb(221,221,221)}
|
||||||
|
.li-text-ff9900-color{color:rgb(255,153,0)}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -39,3 +241,51 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.li-ml-20{margin-left:20rpx}
|
||||||
|
.li-ml-30{margin-left:30rpx}
|
||||||
|
.li-mr-30{margin-right:30rpx}
|
||||||
|
.li-mt-300-important{margin-top:300rpx !important}
|
||||||
|
.li-pt-2{padding-top:2rpx}
|
||||||
|
.li-text-25{font-size:25rpx}
|
||||||
|
.li-text-35{font-size:35rpx}
|
||||||
|
.li-text-46{font-size:46rpx}
|
||||||
|
|
||||||
|
.li-h-90{height:90rpx}
|
||||||
|
.li-mr-6{margin-right:6rpx}
|
||||||
|
.li-text-52{font-size:52rpx}
|
||||||
|
.li-w-90{width:90rpx}
|
||||||
|
|
||||||
|
.li-flex-1{flex:1}
|
||||||
|
.li-flex-wrap{flex-wrap:wrap}
|
||||||
|
.li-items-start{align-items:start}
|
||||||
|
.li-line-clamp-2{overflow:hidden;display:-webkit-box;line-clamp:2;-webkit-box-orient:vertical;-webkit-line-clamp:2}
|
||||||
|
.li-mb-10{margin-bottom:10rpx}
|
||||||
|
.li-mb-15{margin-bottom:15rpx}
|
||||||
|
.li-mb-20{margin-bottom:20rpx}
|
||||||
|
.li-pb-15{padding-bottom:15rpx}
|
||||||
|
.li-pb-30{padding-bottom:30rpx}
|
||||||
|
.li-pl-30{padding-left:30rpx}
|
||||||
|
.li-text-0070F0-color{color:rgb(0,112,240)}
|
||||||
|
.li-text-333-color{color:rgb(51,51,51)}
|
||||||
|
.li-text-34{font-size:34rpx}
|
||||||
|
.li-text-999-color{color:rgb(153,153,153)}
|
||||||
|
.li-text-999999-color{color:rgb(153,153,153)}
|
||||||
|
.li-text-9a9a9a-color{color:rgb(154,154,154)}
|
||||||
|
.li-text-center{text-align:center}
|
||||||
|
.li-w-160{width:160rpx}
|
||||||
|
.li-w-full-92{width:92%}
|
||||||
|
.li-w-full-96{width:96%}
|
||||||
|
|
||||||
|
.li-mb-30{margin-bottom:30rpx}
|
||||||
|
.li-mr-15{margin-right:15rpx}
|
||||||
|
.li-mt-200{margin-top:200rpx}
|
||||||
|
.li-p-30{padding:30rpx}
|
||||||
|
.li-pt-6{padding-top:6rpx}
|
||||||
|
.li-text-36{font-size:36rpx}
|
||||||
|
.li-text-40{font-size:40rpx}
|
||||||
|
|
||||||
|
.li-mr-4{margin-right:4rpx}
|
||||||
|
.li-text-666-color{color:rgb(102,102,102)}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
/**
|
||||||
|
* 权限管理工具
|
||||||
|
* 用于处理应用中的权限控制逻辑
|
||||||
|
*/
|
||||||
|
// 权限信息 F1.核销 F2.配送 F3.推广 F4.量房 F5.家政 F6.维修
|
||||||
|
// 权限映射对象:将前端菜单/功能类型映射到权限代码
|
||||||
|
export const permissionMap = {
|
||||||
|
// 功能权限映射
|
||||||
|
'verification': 'F1', // 商品核销 - F1.核销
|
||||||
|
'delivery': 'F2', // 配送 - F2.配送
|
||||||
|
'invite': 'F3', // 推广 - F3.推广
|
||||||
|
'measure': 'F4', // 量房 - F4.量房
|
||||||
|
'repair': 'F6', // 维修 - F6.维修
|
||||||
|
|
||||||
|
// 可以根据需要添加更多菜单与权限的映射关系
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断当前用户是否拥有指定功能的权限
|
||||||
|
* @param {String} featureType - 功能/菜单类型
|
||||||
|
* @param {Array} userPermissions - 用户拥有的权限数组
|
||||||
|
* @returns {Boolean} - 是否拥有权限
|
||||||
|
*/
|
||||||
|
export function hasPermission(featureType, userPermissions) {
|
||||||
|
// 如果功能类型不在权限映射中,表示不需要权限控制,直接显示
|
||||||
|
if (!permissionMap[featureType]) return true;
|
||||||
|
|
||||||
|
// 如果没有权限数组或权限数组为空,则没有权限
|
||||||
|
if (!userPermissions || userPermissions.length === 0) return false;
|
||||||
|
|
||||||
|
// 检查权限数组中是否包含该功能所需的权限
|
||||||
|
return userPermissions.includes(permissionMap[featureType]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过滤菜单或功能列表,只返回用户有权限访问的项
|
||||||
|
* @param {Array} menuList - 菜单或功能列表
|
||||||
|
* @param {Array} userPermissions - 用户拥有的权限数组
|
||||||
|
* @param {String} typeKey - 菜单项中表示功能类型的键名,默认为'type'
|
||||||
|
* @returns {Array} - 过滤后的菜单列表
|
||||||
|
*/
|
||||||
|
export function filterByPermission(menuList, userPermissions, typeKey = 'type') {
|
||||||
|
if (!menuList || !Array.isArray(menuList)) return [];
|
||||||
|
|
||||||
|
return menuList.filter(item => {
|
||||||
|
const featureType = item[typeKey];
|
||||||
|
return hasPermission(featureType, userPermissions);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据权限代码获取对应的功能类型列表
|
||||||
|
* @param {String} permissionCode - 权限代码
|
||||||
|
* @returns {Array} - 拥有该权限的功能类型列表
|
||||||
|
*/
|
||||||
|
export function getFeaturesByPermission(permissionCode) {
|
||||||
|
return Object.entries(permissionMap)
|
||||||
|
.filter(([_, code]) => code === permissionCode)
|
||||||
|
.map(([featureType]) => featureType);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue