完善内容(home)

This commit is contained in:
张文涛 2025-04-15 22:41:03 +08:00
parent 148ca25b00
commit dfb3f27f39
20 changed files with 1944 additions and 987 deletions

View File

@ -14,4 +14,11 @@ export const userInfo = (data : any) => get('v1/info', 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);

View File

@ -83,7 +83,7 @@
immediate: true,
deep: true,
handler(newVal) {
console.log('SharePoster posterInfo changed:', newVal)
// console.log('SharePoster posterInfo changed:', newVal)
},
},
},

View File

@ -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>

View File

@ -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.jspermissionMap
type: {
type: String,
required: true
}
})
// 使
const userPermissions = inject('userPermissions', [])
//
const showButton = computed(() => {
return hasPermission(props.type, userPermissions)
})
</script>
<style>
</style>

View File

@ -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>

View File

@ -10,16 +10,16 @@
<!-- #ifdef MP-WEIXIN -->
<template #title>
<view class="li-flex-center li-ml-200">
<text class="ri-brush-3-line li-text-46 li-mr-30"></text>
<text class="ri-search-eye-line li-text-46 li-pt-2"></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" @click="search"></text>
</view>
</template>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<template #right>
<view class="li-flex-center li-mr-25">
<text class="ri-brush-3-line li-text-46 li-mr-30"></text>
<text class="ri-search-eye-line li-text-46 li-pt-2"></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" @click="search"></text>
</view>
</template>
<!-- #endif -->
@ -69,6 +69,8 @@
<view v-if="messageList.length==0" class="!li-mt-300">
<wd-status-tip image="message" tip="暂无待处理会话" />
</view>
<!-- 顶部提示条成功/失败消息提示 -->
<wd-toast />
</view>
</template>
@ -76,6 +78,8 @@
import { ref } from 'vue'
const messageList = ref([])
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import { useToast } from '@/uni_modules/wot-design-uni'
const Toast = useToast()
onPullDownRefresh(() => {
uni.stopPullDownRefresh()
@ -85,6 +89,13 @@
})
const clearMsg = () => {
Toast.info('暂无消息')
}
const search = () => {
Toast.info('暂无消息')
}
const handleAction = (action : string) => {
console.log(action);
}

View File

@ -40,7 +40,7 @@
<!-- grid -->
<view class="li-mt-15 ">
<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})">
<template #icon>
<image class="li-w-58 li-h-58" :src="item.image" />
@ -52,7 +52,7 @@
</wd-grid>
</view>
<!-- card -->
<view
<!-- <view
: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">
<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>
</view>
</view>
</view>
</view> -->
<!-- list -->
<view class="li-w-88% li-mx-auto li-mt-30">
<text class="li-ml-35 li-text-30">常见问题解答</text>
@ -104,27 +104,39 @@
</view>
</template>
<script setup lang="ts">
<script setup>
import {
userInfo
userInfo,
menu
} from '@/api/login';
import {
newMessage, bannerList
} from '@/api/message';
import {
ref
ref, computed, provide
} from 'vue'
import { onLoad, onReachBottom, Uni, onPullDownRefresh } from "@dcloudio/uni-app"
// import SafeAreaTop from '@/components/SafeAreaTop/index.vue'
// import SafeAreaBottom from '@/components/SafeAreaBottom/index.vue'
declare const uni : Uni
import { onLoad, onReachBottom, onPullDownRefresh } from "@dcloudio/uni-app"
import { hasPermission, filterByPermission } from '@/utils/permission'
const card_back = uni.$globalData?.RESOURCE_URL + 'home/card-back.png'
const keyword = ref<string>('')
const messageCount = ref<number>(0)
const current = ref<number>(0)
const state = ref<string>('loading')
const keyword = ref('')
const messageCount = ref(0)
const current = ref(0)
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([
@ -155,11 +167,11 @@
title: '邀请业主',
type: 'invite'
},
{
image: uni.$globalData?.RESOURCE_URL + 'home/grid/cuijiao.png',
title: '物业催缴',
type: 'call'
},
// {
// image: uni.$globalData?.RESOURCE_URL + 'home/grid/cuijiao.png',
// title: '',
// type: 'call'
// },
{
image: uni.$globalData?.RESOURCE_URL + 'home/grid/tousu.png',
title: '投诉管理',
@ -170,11 +182,11 @@
// title: '访',
// type: ''
// },
// {
// image: uni.$globalData?.RESOURCE_URL + 'home/grid/wenjuan.png',
// title: '',
// type: 'questionnaire'
// },
{
image: uni.$globalData?.RESOURCE_URL + 'home/grid/wenjuan.png',
title: '问卷管理',
type: 'questionnaire'
},
// {
// image: uni.$globalData?.RESOURCE_URL + 'home/grid/fangyuan.png',
// title: '',
@ -201,7 +213,7 @@
const toDoList = ref([
{
num: '30',
desc: '今日任务'
desc: '今日任务',
},
{
num: '12',
@ -241,7 +253,7 @@
const onChange = (e) => {
console.log(e)
}
const toPages = (item : any) => {
const toPages = (item) => {
switch (item.type) {
case 'task_hall':
//
@ -340,12 +352,22 @@
const mess = await newMessage()
messageCount.value = mess.data.count
//
const banner = await bannerList({ position: 5 })
swiperList.value = banner.data.map((item : { image : String; }) => item.image)
const banner = await bannerList({ position: 1 })
// 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(() => {
loadData()
getMenu()
})
onPullDownRefresh(() => {

View File

@ -18,9 +18,9 @@
<!-- 验证码 -->
<view class="li-flex li-items-center li-justify-between li-mt-28">
<view class="li-w-420">
<wd-input :maxlength="11" placeholder="请输入验证码" type='text' v-model="form.code"
prefix-icon="secured" placeholderStyle="font-size:30rpx" :focus-when-clear="false"
clear-trigger="focus" clearable no-border />
<wd-input :maxlength="11" placeholder="请输入验证码" type='text' v-model="form.code" prefix-icon="secured"
placeholderStyle="font-size:30rpx" :focus-when-clear="false" clear-trigger="focus" clearable
no-border />
</view>
<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>
@ -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">
<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 class="li-text-#2EA1EA li-mx-10">
<text @click="handlePrivacyPolicy" class="li-text-#2EA1EA li-mx-10">
隐私政策
</text>
</view>
<zero-loading type="wobble" v-if="loading"></zero-loading>
<wd-toast />
</view>
</template>
@ -52,6 +53,8 @@
import { captcha, login } from '@/api/login';
import { onLoad, onShow, Uni } from '@dcloudio/uni-app';
import { md5 } from '@/utils/common';
import { useToast } from '@/uni_modules/wot-design-uni';
const Toast = useToast();
declare const uni : Uni
interface formItem {
@ -83,65 +86,93 @@
const loginHandle = async () => {
if (!check.value) {
uni.showToast({
icon: 'none',
title: '请阅读并同意《用户协议》和《隐私政策》',
duration: 2000
})
// uni.showToast({
// icon: 'none',
// title: '',
// duration: 2000
// })
Toast.info('请阅读并同意《用户协议》和《隐私政策》')
return;
}
if (!form.value.username) {
uni.showToast({
icon: 'none',
title: '登录账号不能为空',
duration: 2000
})
// uni.showToast({
// icon: 'none',
// title: '',
// duration: 2000
// })
Toast.info('登录账号不能为空')
return;
}
if (!form.value.password) {
uni.showToast({
icon: 'none',
title: '登录密码不能为空',
duration: 2000
})
// uni.showToast({
// icon: 'none',
// title: '',
// duration: 2000
// })
Toast.info('登录密码不能为空')
return;
}
if (!form.value.code) {
uni.showToast({
icon: 'none',
title: '验证码不能为空',
duration: 2000
})
// uni.showToast({
// icon: 'none',
// title: '',
// duration: 2000
// })
Toast.info('验证码不能为空')
return;
}
//
loading.value = true
// loading.value = true
uni.showLoading({
title: '登录中...'
})
form.value.uuid = captchaData.value.uuid
form.value.password = md5(form.value.password)
const res = await login(form.value)
if (res.code != 200) {
uni.showToast({
icon: 'none',
title: res.msg,
duration: 3000
})
// uni.showToast({
// icon: 'none',
// title: res.msg,
// duration: 3000
// })
Toast.error(res.msg)
form.value.password = ""
form.value.code = ""
loading.value = false
// loading.value = false
uni.hideLoading()
getCode()
return;
}
// token
uni.$store.commit("setToken", res.data.token)
setTimeout(() => {
loading.value = false
// loading.value = false
uni.hideLoading()
//
uni.switchTab({
url: '/pages/index/index'
})
}, 300)
}
};
/**
* 查看隐私政策
*/
const handlePrivacyPolicy = () => {
uni.navigateTo({
url: '/pagesB/agreement/index?type=2'
});
};
/**
* 查看用户协议
*/
const handleUserAgreement = () => {
uni.navigateTo({
url: '/pagesB/agreement/index?type=1'
});
};
onShow(() => {
getCode()

View File

@ -2,14 +2,14 @@
<view class="li-mine-page">
<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-items-center">
<view @click="toPages({type:'userInfo'})" class="li-flex li-items-center">
<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>
</view>
<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-24 li-text-#b1bbc7">{{user_info.owner.name}}</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>
</view>
</view>
<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">
<text class="li-text-#F8C883 li-text-24">账户余额</text>
<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>
</view>
</view>
<view class="li-mr-50">
<wd-button custom-class="custom-shadow" size="small">&emsp;提现&emsp;</wd-button>
<wd-button @click="withdrawal" custom-class="custom-shadow" size="small">&emsp;提现&emsp;</wd-button>
</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-flex li-justify-between li-items-center li-pt-20 li-mx-20">
<text class="li-text-#19171B li-text-32">待处理工单</text>
<view class="li-text-#B2B2B2 li-flex li-items-center li-text-24">查看更多<text
class="ri-arrow-right-s-line"></text></view>
<view @click="toPages({type:'all'})" class="li-text-#B2B2B2 li-flex li-items-center li-text-24">
查看更多<text class="ri-arrow-right-s-line"></text></view>
</view>
<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"
@ -61,7 +61,7 @@
</view>
<wd-grid class="" :column="4" :clickable="true">
<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>
<wd-badge :hidden="item.number > 0 ? false:true" :modelValue="item.number" top='5' right="-2"
:max='99'>
@ -74,6 +74,8 @@
</wd-grid-item>
</wd-grid>
</view>
<!-- 顶部提示条成功/失败消息提示 -->
<wd-toast />
</view>
</template>
@ -81,6 +83,8 @@
import SafeAreaTop from '@/components/SafeAreaTop/index.vue'
import { onShow, onReachBottom, Uni } from "@dcloudio/uni-app"
import { ref } from "vue"
import { useToast } from '@/uni_modules/wot-design-uni'
const Toast = useToast()
declare const uni : Uni
const user_info = ref({
@ -109,12 +113,12 @@
const workList = ref([
{
title: '待入库',
number: 12,
number: 0,
icon: uni.$globalData?.RESOURCE_URL + 'mine/icon/chuku.png',
type: 'warehousing',
}, {
title: '待配送',
number: 11,
number: 0,
icon: uni.$globalData?.RESOURCE_URL + 'mine/icon/peisong.png',
type: 'my_order_F2',
}, {
@ -167,10 +171,21 @@
}
])
const withdrawal = () => {
Toast.info('暂无余额')
}
const toPages = (item) => {
console.log('111111111111');
switch (item.type) {
case 'all':
//
uni.navigateTo({
url: '/pagesA/my_order/list'
});
break;
case 'warehousing':
//
uni.navigateTo({
@ -191,9 +206,10 @@
break;
case 'call':
//
uni.navigateTo({
url: '/pagesB/call/index'
});
// uni.navigateTo({
// url: '/pagesB/call/index'
// });
Toast.info('暂无缴费记录')
break;
case 'protocol':
//
@ -213,6 +229,12 @@
url: '/pagesB/setting/index'
});
break;
case 'userInfo':
//
uni.navigateTo({
url: '/pagesB/setting/editInfo'
});
break;
default:
break;
}

View File

@ -101,14 +101,14 @@
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-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-text-32 li-text-#333">{{item.name}}</view>
<view class="li-text-26 li-text-#999 li-mt-10">{{item.time}}</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.create_time}}</view>
</view>
</view>
<view class="status-tag" :class="item.status === 1 ? 'success' : 'pending'">
{{item.status === 1 ? '已绑定' : '待认证'}}
<view class="status-tag success">
已绑定
</view>
</view>
</view>
@ -224,6 +224,9 @@
limit: limit.value,
})
if (res.code == 200) {
if (res.data.length < 10) {
state.value = 'finished'
}
inviteListData.value = [...inviteListData.value, ...res.data]
count.value = res.count
}
@ -444,4 +447,11 @@
.rules-popup .rules-content .rule-item:last-child {
margin-bottom: 0;
}
::v-deep .wd-divider,
.wd-divider::after,
.wd-divider::before {
border: none !important;
margin: 0 !important;
}
</style>

View File

@ -16,14 +16,14 @@
<!-- #ifdef MP-WEIXIN -->
<template #title>
<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>
</template>
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<template #right>
<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>
</template>
<!-- #endif -->
@ -73,6 +73,8 @@
<view v-if="messageList.length==0" class="!li-mt-300">
<wd-status-tip image="message" tip="暂无待处理会话" />
</view>
<!-- 顶部提示条成功/失败消息提示 -->
<wd-toast />
</view>
</template>
@ -80,6 +82,8 @@
import { ref } from 'vue'
import { onLoad, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
import { useNavigation } from '@/hooks/useNavigation'
import { useToast } from '@/uni_modules/wot-design-uni'
const Toast = useToast()
// 使 composable
const {
hasMultiplePages, //
@ -87,17 +91,17 @@
checkRouteStack //
} = useNavigation()
const messageList = ref([
{
image: '/static/message/icon.png',
title: '订单提醒',
time: '2025/12/12',
content: "1.15新版出炉,足迹'随笔功能'上线记录线记录线记录1.15新版出炉,足迹"
}, {
image: '/static/message/icon1.png',
title: '订单提醒',
time: '2025/12/12',
content: "1.15新版出炉,足迹'随笔功能'上线记录线记录线记录1.15新版出炉,足迹"
}
// {
// image: '/static/message/icon.png',
// title: '',
// time: '2025/12/12',
// content: "1.15''线线线1.15"
// }, {
// image: '/static/message/icon1.png',
// title: '',
// time: '2025/12/12',
// content: "1.15''线线线1.15"
// }
])
@ -115,6 +119,11 @@
const handleAction = (action : string) => {
console.log(action);
}
const clearMsg = () => {
Toast.info('暂无消息')
}
const toPages = (item : any) => {
console.log(item);
switch (item.type) {

View File

@ -52,6 +52,8 @@
<wd-loadmore loading-text="努力加载中" finished-text="没有更多了" :state="state" />
</view>
<zero-loading type="wobble" v-if="loading"></zero-loading>
<!-- 顶部提示条成功/失败消息提示 -->
<wd-toast />
</view>
</template>

View File

@ -26,7 +26,7 @@
<text class="status-text">{{historyType=='1'?'入库成功':'核销成功'}}</text>
</view>
<text
class="status-time">{{codeInfo?.status == 2? '正常入库': '正常核销'}}</text>
class="status-time">{{historyType == '1'? '正常入库': '正常核销'}}</text>
</view>
<view class="li-divider li-my-20"></view>
<view class="order-info li-px-30">
@ -36,7 +36,7 @@
</view>
<view class="li-flex li-justify-between li-text-30 li-text-#666 li-mb-10">
<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 File

@ -14,11 +14,21 @@
<text class="li-text-42 ">商品核销</text>
</view>
</template>
<!-- #ifdef MP-WEIXIN -->
<template #right>
<view class="li-flex-center li-mr-25" @click="toVerificationHistory">
<text class="ri-history-line li-text-48 "></text>
<view class="li-flex-center li-mr-200" @click="toVerificationHistory">
<text class="ri-history-line li-text-48"></text>
</view>
</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>
<!-- 功能模式切换卡片 -->
@ -180,7 +190,8 @@
<text class="detail-icon ri-price-tag-3-line"></text>
<text class="detail-label">订单类型</text>
</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>

File diff suppressed because it is too large Load Diff

View File

@ -153,53 +153,53 @@
// - API
const complaintList = ref([
{
complaint_id: 1,
complaint_no: 'TS20240607001',
content: '楼道灯已经坏了三天,晚上上下楼很不方便,希望物业尽快解决!',
village_name: '阳光花园小区',
user_name: '张三',
user_mobile: '13800138000',
create_time: '2024-06-07 10:23',
status: 0,
urgency: 2,
tags: ['公共设施', '照明'],
images: [
'https://img.yzcdn.cn/vant/cat.jpeg',
'https://img.yzcdn.cn/vant/tree.jpeg'
]
},
{
complaint_id: 2,
complaint_no: 'TS20240606001',
content: '小区北门停车场有人乱停车,导致通道被堵,请物业及时处理。',
village_name: '阳光花园小区',
user_name: '李四',
user_mobile: '13900139000',
create_time: '2024-06-06 16:45',
status: 1,
urgency: 1,
tags: ['停车管理', '安全隐患'],
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/tree.jpeg'
]
},
{
complaint_id: 3,
complaint_no: 'TS20240605001',
content: '小区垃圾分类做得不到位,希望加强宣传和管理。',
village_name: '阳光花园小区',
user_name: '王五',
user_mobile: '13700137000',
create_time: '2024-06-05 09:12',
status: 2,
urgency: 1,
tags: ['环境卫生', '垃圾分类'],
images: []
}
// {
// complaint_id: 1,
// complaint_no: 'TS20240607001',
// content: '便',
// village_name: '',
// user_name: '',
// user_mobile: '13800138000',
// create_time: '2024-06-07 10:23',
// status: 0,
// urgency: 2,
// tags: ['', ''],
// images: [
// 'https://img.yzcdn.cn/vant/cat.jpeg',
// 'https://img.yzcdn.cn/vant/tree.jpeg'
// ]
// },
// {
// complaint_id: 2,
// complaint_no: 'TS20240606001',
// content: '',
// village_name: '',
// user_name: '',
// user_mobile: '13900139000',
// create_time: '2024-06-06 16:45',
// status: 1,
// urgency: 1,
// tags: ['', ''],
// 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/tree.jpeg'
// ]
// },
// {
// complaint_id: 3,
// complaint_no: 'TS20240605001',
// content: '',
// village_name: '',
// user_name: '',
// user_mobile: '13700137000',
// create_time: '2024-06-05 09:12',
// status: 2,
// urgency: 1,
// tags: ['', ''],
// images: []
// }
]);
//
@ -260,7 +260,7 @@
if (loading.value || finished.value) return;
try {
loading.value = true;
// loading.value = true;
// API
// const params = {
@ -276,7 +276,7 @@
//
if (page.value > 1) {
finished.value = true;
// finished.value = true;
} else {
page.value++;
}

View File

@ -36,8 +36,7 @@
<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">
<text v-for="(item, index) in statusList" :key="index"
:class="activeStatus === item.value ? 'status-tag active' : 'status-tag'"
@ -45,13 +44,13 @@
{{item.label}}
</text>
</view>
</view>
</view> -->
<!-- 小区选择器 -->
<view class="li-px-15">
<!-- <view class="li-px-15">
<wd-picker size="large" v-model="showVillagePicker" :columns="pickerVillageList" title="选择小区"
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">
@ -113,10 +112,8 @@
</view>
<!-- 空状态 -->
<view v-else class="empty-state li-mt-100">
<image src="https://img.yzcdn.cn/vant/empty-image-default.png" mode="aspectFit" class="empty-image">
</image>
<text class="li-text-28 li-text-#999 li-mt-20">暂无问卷记录</text>
<view v-else class="li-mt-200">
<wd-status-tip image="search" tip="暂无问卷记录" />
</view>
<!-- 加载状态 -->
@ -256,61 +253,61 @@
//
const questionnaireList = ref([
{
id: 1,
title: '2024年度物业服务满意度调查',
village_name: '阳光花园小区',
type: '满意度调查',
user_name: '张三',
is_anonymous: false,
submit_time: '2024-06-15 14:23',
question_count: 15,
status: 1 //
},
{
id: 2,
title: '小区环境改造意见征集',
village_name: '翠湖庭院',
type: '意见征集',
user_name: '李四',
is_anonymous: true,
submit_time: '2024-06-12 09:45',
question_count: 8,
status: 0 //
},
{
id: 3,
title: '业主委员会换届选举投票',
village_name: '金色家园',
type: '投票选举',
user_name: '王五',
is_anonymous: false,
submit_time: '2024-06-10 18:30',
question_count: 12,
status: 1 //
},
{
id: 4,
title: '小区健身设施需求调研',
village_name: '阳光花园小区',
type: '需求调研',
user_name: '赵六',
is_anonymous: false,
submit_time: '2024-06-08 11:20',
question_count: 10,
status: 1 //
},
{
id: 5,
title: '端午节活动满意度调查',
village_name: '翠湖庭院',
type: '满意度调查',
user_name: '匿名用户',
is_anonymous: true,
submit_time: '2024-06-05 16:40',
question_count: 6,
status: 0 //
}
// {
// id: 1,
// title: '2024',
// village_name: '',
// type: '',
// user_name: '',
// is_anonymous: false,
// submit_time: '2024-06-15 14:23',
// question_count: 15,
// status: 1 //
// },
// {
// id: 2,
// title: '',
// village_name: '',
// type: '',
// user_name: '',
// is_anonymous: true,
// submit_time: '2024-06-12 09:45',
// question_count: 8,
// status: 0 //
// },
// {
// id: 3,
// title: '',
// village_name: '',
// type: '',
// user_name: '',
// is_anonymous: false,
// submit_time: '2024-06-10 18:30',
// question_count: 12,
// status: 1 //
// },
// {
// id: 4,
// title: '',
// village_name: '',
// type: '',
// user_name: '',
// is_anonymous: false,
// submit_time: '2024-06-08 11:20',
// question_count: 10,
// status: 1 //
// },
// {
// id: 5,
// title: '',
// village_name: '',
// type: '',
// user_name: '',
// is_anonymous: true,
// submit_time: '2024-06-05 16:40',
// question_count: 6,
// status: 0 //
// }
]);
//
@ -406,7 +403,7 @@
//
onLoad(() => {
checkRouteStack();
loadQuestionnaireList();
// loadQuestionnaireList();
});
//

View File

@ -1,9 +1,7 @@
<template>
<view class="container">
<!-- 自定义导航栏 -->
<wd-navbar :bordered="false"
custom-style="background: transparent !important; backdrop-filter: blur(10px) !important; -webkit-backdrop-filter: blur(20px) !important;"
safeAreaInsetTop fixed placeholder>
<wd-navbar :bordered="false" custom-style="background: #ffffff;" safeAreaInsetTop fixed placeholder>
<template #left>
<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"
@ -14,88 +12,79 @@
</view>
</template>
</wd-navbar>
<!-- 导航栏背景 -->
<view class="nav-bg-layer"></view>
<!-- 页面背景 -->
<view class="page-bg"></view>
<view class="content">
<!-- 用户信息预览 -->
<view class="user-preview" @click="handleEditInfo">
<view class="user-avatar">
<image v-if="userInfo.avatar" :src="userInfo.avatar" mode="aspectFill"></image>
<view v-else class="default-avatar">{{userInfo.nickname.substring(0,1)}}</view>
<!-- 设置选项列表 -->
<view class="section">
<view class="setting-item" @click="handleEditInfo">
<view class="left">
<text class="ri-user-3-line icon"></text>
<text class="title">个人信息</text>
</view>
<text class="ri-arrow-right-s-line arrow"></text>
</view>
<view class="user-detail">
<view class="user-name">{{userInfo.nickname || '未设置昵称'}}</view>
<view class="user-phone">{{formatPhone(userInfo.phone)}}</view>
<view class="setting-item" @click="clearCache">
<view class="left">
<text class="ri-delete-bin-6-line icon"></text>
<text class="title">清除缓存</text>
</view>
<text class="value">{{cacheSize}}</text>
</view>
<text class="ri-arrow-right-s-line arrow-icon"></text>
</view>
<view class="setting-section">
<view class="setting-list">
<view class="setting-item" @click="clearCache">
<view class="item-left">
<text class="ri-delete-bin-5-line item-icon cache-color"></text>
<text class="item-title">清除缓存</text>
</view>
<view class="item-right">
<text class="cache-size">{{cacheSize}}</text>
</view>
<view class="section">
<view class="setting-item" @click="handlePrivacyPolicy">
<view class="left">
<text class="ri-lock-line icon"></text>
<text class="title">隐私政策</text>
</view>
<view class="setting-item" @click="handlePrivacyPolicy">
<view class="item-left">
<text class="ri-file-text-line item-icon privacy-color"></text>
<text class="item-title">隐私政策</text>
</view>
<view class="item-right">
<text class="ri-arrow-right-s-line arrow-icon"></text>
</view>
<text class="ri-arrow-right-s-line arrow"></text>
</view>
<view class="setting-item" @click="handleUserAgreement">
<view class="left">
<text class="ri-file-list-3-line icon"></text>
<text class="title">用户协议</text>
</view>
<view class="setting-item" @click="handleUserAgreement">
<view class="item-left">
<text class="ri-file-list-3-line item-icon agreement-color"></text>
<text class="item-title">用户协议</text>
</view>
<view class="item-right">
<text class="ri-arrow-right-s-line arrow-icon"></text>
</view>
<text class="ri-arrow-right-s-line arrow"></text>
</view>
<view class="setting-item" @click="checkUpdate">
<view class="left">
<text class="ri-information-line icon"></text>
<text class="title">关于我们</text>
</view>
<view class="setting-item" @click="checkUpdate">
<view class="item-left">
<text class="ri-information-line item-icon about-color"></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 class="right">
<text class="version">{{appVersion}}</text>
<text class="ri-arrow-right-s-line arrow"></text>
</view>
</view>
</view>
<!-- 退出登录按钮 -->
<view class="logout-container">
<view class="logout-wrap">
<button class="logout-btn" @click="handleLogout">退出登录</button>
</view>
</view>
<!-- 确认弹窗 -->
<wd-dialog v-model="showLogoutDialog" title="退出登录" :show-cancel-button="true" @confirm="confirmLogout">
<view class="dialog-content">
确定要退出登录吗
</view>
</wd-dialog>
<wd-message-box />
<wd-toast />
</view>
<zero-loading type="wobble" v-if="loading"></zero-loading>
</template>
<script setup lang="ts">
import { logout } from '@/api/login'
import { ref, reactive, onMounted } from 'vue';
import { useNavigation } from '@/hooks/useNavigation';
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
const {
@ -103,25 +92,15 @@
isTabBarPage, // tabBar
checkRouteStack //
} = 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 '';
return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
};
//
const toPages = (item : any) => {
if (item.type === 'nav') {
const toPages = ({ type }) => {
if (type === 'nav') {
uni.navigateBack()
} else if (item.type === 'home') {
//
} else if (type === 'home') {
uni.switchTab({
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 = () => {
message.alert({
msg: '清除缓存需重新登录,请谨慎操作!',
title: '提示',
type: 'confirm',
})
.then(() => {
clearAll()
})
};
const clearAll = () => {
uni.showLoading({
title: '清理中...'
});
//
setTimeout(() => {
uni.hideLoading();
cacheSize.value = '0KB';
uni.showToast({
title: '缓存已清理',
icon: 'success'
// #ifdef APP-PLUS
try {
plus.cache.clear(() => {
uni.hideLoading();
cacheSize.value = '0KB';
Toast.success('缓存已清理')
}, err => {
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 = () => {
uni.navigateTo({
url: '/pagesA/other/privacy'
url: '/pagesB/agreement/index?type=2'
});
};
@ -188,7 +286,7 @@
*/
const handleUserAgreement = () => {
uni.navigateTo({
url: '/pagesA/other/agreement'
url: '/pagesB/agreement/index?type=1'
});
};
@ -196,294 +294,171 @@
* 检查更新
*/
const checkUpdate = () => {
uni.showToast({
title: '当前已是最新版本',
icon: 'none'
});
// uni.showToast({
// title: '',
// icon: 'none'
// });
Toast.success('当前已是最新版本')
};
/**
* 显示退出登录确认框
*/
const handleLogout = () => {
showLogoutDialog.value = true;
message.alert({
msg: '确定退出吗?',
title: '退出登录',
type: 'confirm',
})
.then(() => {
confirmLogout()
uni.showLoading({
title: '退出中...'
})
})
};
/**
* 确认退出登录
*/
const confirmLogout = () => {
uni.showLoading({
title: '退出中...'
});
const confirmLogout = async () => {
// loading.value = true
// 退
setTimeout(() => {
uni.hideLoading();
//
const res = await logout()
if (res.code == 200) {
uni.hideLoading()
uni.removeStorageSync('token');
uni.removeStorageSync('userInfo');
//
uni.reLaunch({
url: '/pages/login/index'
});
}, 1000);
}
};
onMounted(() => {
checkRouteStack()
//
const userInfoStorage = uni.getStorageSync('userInfo');
if (userInfoStorage) {
Object.assign(userInfo, JSON.parse(userInfoStorage));
}
checkRouteStack();
//
uni.getStorageInfo({
success: (res) => {
const size = res.currentSize;
if (size < 1024) {
cacheSize.value = size + 'KB';
} else {
cacheSize.value = (size / 1024).toFixed(1) + 'MB';
}
}
});
getCacheSize();
//
// #ifdef APP-PLUS
plus.runtime.getProperty(plus.runtime.appid, (res) => {
appVersion.value = res.version;
appVersion.value = 'v' + res.version;
});
// #endif
});
</script>
<style lang="scss" scoped>
/* 主容器 */
.container {
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);
<style lang="scss">
page {
background-color: #f5f7fa;
}
/* 导航栏背景 */
.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 {
position: relative;
z-index: 2;
padding: 30rpx;
padding: 28rpx 32rpx 120rpx;
}
/* 用户信息预览 */
.user-preview {
background-color: #fff;
border-radius: 16rpx;
padding: 30rpx;
.section {
background-color: #ffffff;
border-radius: 18rpx;
margin-bottom: 28rpx;
overflow: hidden;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
}
.setting-item {
display: flex;
align-items: center;
margin-bottom: 30rpx;
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05);
justify-content: space-between;
padding: 34rpx 32rpx;
position: relative;
.user-avatar {
width: 120rpx;
height: 120rpx;
border-radius: 60rpx;
overflow: hidden;
margin-right: 24rpx;
image {
width: 100%;
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;
}
&:not(:last-child)::after {
content: '';
position: absolute;
left: 32rpx;
right: 32rpx;
bottom: 0;
height: 1px;
background-color: #f0f2f5;
transform: scaleY(0.5);
}
.user-detail {
flex: 1;
.user-name {
font-size: 36rpx;
font-weight: 600;
color: #333;
margin-bottom: 8rpx;
}
.user-phone {
font-size: 28rpx;
color: #999;
}
&:active {
background-color: #f8f9fa;
}
.arrow-icon {
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;
.left {
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #f5f5f5;
&:last-child {
border-bottom: none;
.icon {
font-size: 42rpx;
margin-right: 24rpx;
color: #3370ff;
opacity: 0.85;
}
.item-left {
display: flex;
align-items: center;
.item-icon {
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;
}
.title {
font-size: 30rpx;
color: #333333;
font-weight: 450;
letter-spacing: 0.5rpx;
}
}
.item-right {
display: flex;
align-items: center;
.arrow {
color: #c0c0c0;
font-size: 34rpx;
}
.arrow-icon {
font-size: 44rpx;
color: #ccc;
}
.value {
font-size: 28rpx;
color: #999999;
}
.cache-size,
.version-text {
font-size: 28rpx;
color: #999;
margin-right: 10rpx;
}
.right {
display: flex;
align-items: center;
.version {
font-size: 28rpx;
color: #999999;
margin-right: 12rpx;
}
}
}
/* 退出登录按钮 */
.logout-container {
margin-top: 60rpx;
padding: 0 20rpx;
margin-bottom: 50rpx;
.logout-wrap {
padding: 60rpx 40rpx;
.logout-btn {
background-color: #fff;
color: #FF3B30;
border: none;
height: 96rpx;
line-height: 96rpx;
width: 100%;
height: 90rpx;
line-height: 90rpx;
background: linear-gradient(135deg, #398CFF 0%, #2170E8 100%);
color: #ffffff;
font-size: 32rpx;
border-radius: 16rpx;
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 {
background-color: #f8f8f8;
transform: scale(0.98);
box-shadow: 0 2rpx 8rpx rgba(57, 140, 255, 0.2);
opacity: 0.9;
}
}
}
/* 弹窗内容样式 */
.dialog-content {
padding: 30rpx;
text-align: center;
font-size: 30rpx;
font-size: 28rpx;
color: #333;
line-height: 1.5;
}
</style>

View File

@ -1,32 +1,234 @@
.li-mt-25{margin-top:25rpx}
.li-pt-6{padding-top:6rpx}
.li-px-15{padding-left:15rpx;padding-right:15rpx}
.li-bg-white{background-color:rgb(255,255,255)}
.li-flex{display:flex}
.li-flex-col{flex-direction:column}
.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)}
.li-my-10{margin-top:10rpx;margin-bottom:10rpx}
.li-p-20{padding:20rpx}
.li-px-20{padding-left:20rpx;padding-right:20rpx}
.li-py-10{padding-top:10rpx;padding-bottom:10rpx}
.li-py-60{padding-top:60rpx;padding-bottom:60rpx}
.li-rd-8{border-radius:8rpx}
.li-text-dddddd-color{color:rgb(221,221,221)}
.li-text-ff9900-color{color:rgb(255,153,0)}
.bg-f9f9f9{background-color:rgb(249,249,249)}
.bg-FFFFFF{background-color:rgb(255,255,255)}
.border-4-white{border-style:solid;border-color:rgb(255,255,255);border-width:4rpx}
.li-font-bold{font-weight:bold}
.li-h-240{height:240rpx}
.li-h-250{height:250rpx}
.li-h-50{height:50rpx}
.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-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-15{padding-top:15rpx;padding-bottom:15rpx}
.li-py-60{padding-top:60rpx;padding-bottom:60rpx}
.li-rd-30{border-radius:30rpx}
.li-text-100{font-size:100rpx}
.li-text-3e9bff-color{color:rgb(62,155,255)}
.li-text-50{font-size:50rpx}
.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-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)}

60
utils/permission.js Normal file
View File

@ -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);
}