feat: 1.首页顶部信息、轮播图、待办事项、团队公告UI 2. 添加新设备登录验证 3. 首页tabs组件补充数据
This commit is contained in:
parent
50040db7c9
commit
1b2acfd370
@ -1,23 +1,23 @@
|
||||
type ResultCode = 0 | -1 | -2 | 10003
|
||||
enum ResultCode {
|
||||
Success = 0,
|
||||
Fail = -1,
|
||||
NotMore = -2,
|
||||
PaySuccessful = 10003,
|
||||
NewDevice = 441
|
||||
}
|
||||
|
||||
interface ResultData {
|
||||
message: string
|
||||
code: ResultCode
|
||||
data: Record<string, any>
|
||||
message: string
|
||||
}
|
||||
|
||||
export class Result {
|
||||
static codes = {
|
||||
Success: 0 as const,
|
||||
Fail: -1 as const,
|
||||
NotMore: -2 as const,
|
||||
PaySuccessful: 10003 as const
|
||||
}
|
||||
|
||||
static resultsMap = new Map<ResultCode, ResultData>([
|
||||
[Result.codes.Success, { message: '成功', data: {} }],
|
||||
[Result.codes.Fail, { message: '网络加载失败', data: {} }],
|
||||
[Result.codes.NotMore, { message: '没有更多', data: {} }],
|
||||
[Result.codes.PaySuccessful, { message: '支付成功', data: {} }]
|
||||
static resultsMap = new Map<ResultCode, Omit<ResultData, 'code'>>([
|
||||
[ResultCode.Success, { message: '成功', data: {} }],
|
||||
[ResultCode.Fail, { message: '网络加载失败', data: {} }],
|
||||
[ResultCode.NotMore, { message: '没有更多', data: {} }],
|
||||
[ResultCode.PaySuccessful, { message: '支付成功', data: {} }]
|
||||
])
|
||||
|
||||
code: ResultCode
|
||||
@ -39,21 +39,26 @@ export class Result {
|
||||
|
||||
// 成功
|
||||
static get Success(): Result {
|
||||
return new Result(Result.codes.Success)
|
||||
return new Result(ResultCode.Success)
|
||||
}
|
||||
|
||||
// 失败(默认错误)
|
||||
static get Fail(): Result {
|
||||
return new Result(Result.codes.Fail)
|
||||
return new Result(ResultCode.Fail)
|
||||
}
|
||||
|
||||
// 没有更多
|
||||
static get NotMore(): Result {
|
||||
return new Result(Result.codes.NotMore)
|
||||
return new Result(ResultCode.NotMore)
|
||||
}
|
||||
|
||||
// 支付成功
|
||||
static get PaySuccessful(): Result {
|
||||
return new Result(Result.codes.PaySuccessful)
|
||||
return new Result(ResultCode.PaySuccessful)
|
||||
}
|
||||
|
||||
// 新设备
|
||||
static get NewDevice(): Result {
|
||||
return new Result(ResultCode.NewDevice)
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,7 +55,8 @@
|
||||
"type": "home",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "首页"
|
||||
"navigationBarTitleText": "首页",
|
||||
"disableScroll": true
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@ -10,6 +10,10 @@
|
||||
<template>
|
||||
<view>
|
||||
<TopNavigation></TopNavigation>
|
||||
<view v-if="tip" class="flex flex-items-center bg-[#fce4e2] color-[#e63b3b] py-2 px-4">
|
||||
<wd-icon name="warning" size="20px" color="#e63b3b" class="mr-3"></wd-icon>
|
||||
<view>您正在一台新设备登录,为了您的账号安全,请进行安全验证</view>
|
||||
</view>
|
||||
<view class="text-6 ml-4 pt-7 custom-color-black font-bold">请输入验证码</view>
|
||||
<view class="text-3.5 ml-4 mt-2 mb-4 custom-color-grey">
|
||||
<view>已发送验证码至{{ maskedPhone }}</view>
|
||||
@ -60,6 +64,8 @@
|
||||
|
||||
const systemInfo = ref<GetSystemInfoResult>(null)
|
||||
|
||||
const tip = ref<boolean>(false)
|
||||
|
||||
onMounted(async () => {
|
||||
systemInfo.value = await $basic.getSystemInfo()
|
||||
})
|
||||
@ -67,6 +73,7 @@
|
||||
onLoad(async options => {
|
||||
phone.value = options.phone
|
||||
type.value = options.type
|
||||
tip.value = options.tip === 'true'
|
||||
|
||||
countDownStart()
|
||||
})
|
||||
|
||||
14
src/pages/home/HomeBulletin.vue
Normal file
14
src/pages/home/HomeBulletin.vue
Normal file
@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<view class="mx-4 bg-white px-2 py-3 flex flex-items-center text-3.5 rounded-2 shadow-sm">
|
||||
<view>
|
||||
<text class="font-bold custom-color-black">团队</text>
|
||||
<text class="font-bold color-red">公告</text>
|
||||
</view>
|
||||
<view class="ml-2 w-1 h-1 bg-black rounded-50%"></view>
|
||||
<view class="ml-2">1</view>
|
||||
<view class="ml-a">全部</view>
|
||||
<wd-icon name="arrow-right" size="14px" class="ml-2" color="#bfbfbf"></wd-icon>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts"></script>
|
||||
37
src/pages/home/HomeSwiper.vue
Normal file
37
src/pages/home/HomeSwiper.vue
Normal file
@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<view class="mx-4">
|
||||
<wd-swiper
|
||||
:list="swiperList"
|
||||
autoplay
|
||||
height="100"
|
||||
indicatorPosition="bottom-left"
|
||||
v-model:current="current"
|
||||
:indicator="{ type: 'dots-bar' }"
|
||||
@click="handleClick"
|
||||
@change="onChange"
|
||||
></wd-swiper>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const current = ref<number>(0)
|
||||
|
||||
const swiperList = ref<Array<string>>([
|
||||
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/capybara.jpg',
|
||||
'https://registry.npmmirror.com/wot-design-uni-assets/*/files/panda.jpg'
|
||||
])
|
||||
|
||||
const emits = defineEmits(['colorChange'])
|
||||
|
||||
function handleClick(e) {
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
function onChange(e) {
|
||||
if (e.current === 0) {
|
||||
emits('colorChange', '#bfcbef')
|
||||
} else {
|
||||
emits('colorChange', '#f0d6ad')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<view class="m-2 p-2 bg-white rounded-2 pos-relative">
|
||||
<image
|
||||
@click="clickMenu"
|
||||
src="/static/images/icon_table_menu.png"
|
||||
class="w-6 h-6 pos-absolute right-1 top-3 p-1 z-10"
|
||||
></image>
|
||||
<view class="mx-4 py-1 bg-white rounded-2 pos-relative shadow-sm">
|
||||
<view
|
||||
class="h-42px z-10 pos-absolute right-1 bg-white flex flex-items-center justify-center px-2"
|
||||
>
|
||||
<image @click="clickMenu" src="/static/images/icon_table_menu.png" class="w-5 h-5"></image>
|
||||
</view>
|
||||
<wd-tabs
|
||||
v-model="tab"
|
||||
auto-line-width
|
||||
@ -13,16 +13,16 @@
|
||||
color="#0d100e"
|
||||
inactiveColor="#838383"
|
||||
>
|
||||
<wd-tab v-for="(item, index) in list" :key="index" :title="item.title" :name="index">
|
||||
<view class="flex flex-wrap">
|
||||
<wd-tab v-for="(item, index) in list" :key="index" :title="item.name" :name="index">
|
||||
<view class="flex flex-wrap ml-1.5">
|
||||
<view
|
||||
v-for="subItem in item.list"
|
||||
:key="subItem.id"
|
||||
class="text-center my-2 w-21.4375"
|
||||
class="text-center my-2 w-20.4375"
|
||||
@click="clickItem(subItem)"
|
||||
>
|
||||
<image :src="subItem.icon" class="w-7 h-7 m-a"></image>
|
||||
<view class="text-3 mt-2">{{ subItem.title }}</view>
|
||||
<view class="text-3 mt-2">{{ subItem.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</wd-tab>
|
||||
34
src/pages/home/HomeTodo.vue
Normal file
34
src/pages/home/HomeTodo.vue
Normal file
@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<view class="bg-white shadow-sm rounded-2 mx-4 p-2">
|
||||
<view class="flex flex-items-center">
|
||||
<view>待办事项</view>
|
||||
<wd-icon name="arrow-right" size="14px" class="ml-a" color="#bfbfbf"></wd-icon>
|
||||
</view>
|
||||
<view class="mt-2">
|
||||
<view
|
||||
class="flex flex-items-center text-3.5 py-1.5"
|
||||
v-for="(item, index) in list"
|
||||
:key="index"
|
||||
>
|
||||
<image src="/static/images/icon_audit.png" mode="aspectFill" class="w-4.5 h-4.5"></image>
|
||||
<view class="ml-3 font-bold">{{ item.name }}</view>
|
||||
<view class="ml-2 w-1 h-1 bg-black rounded-50%"></view>
|
||||
<view class="ml-2">{{ item.content }}</view>
|
||||
<view class="color-[#2954ee] bg-[#f5f4fa] px-2 px-1 ml-a rounded">去处理</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const list = [
|
||||
{
|
||||
title: '审批',
|
||||
content: '您有新的补卡待你处理'
|
||||
},
|
||||
{
|
||||
title: '审批',
|
||||
content: '您有新的请假待你处理'
|
||||
}
|
||||
]
|
||||
</script>
|
||||
@ -2,35 +2,62 @@
|
||||
{
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '首页'
|
||||
navigationBarTitleText: '首页',
|
||||
disableScroll: true
|
||||
}
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<view
|
||||
:style="{ background: `linear-gradient(to bottom, ${color}, #f3f5fa)` }"
|
||||
class="h-50 pos-absolute w-full z-0 top-0"
|
||||
></view>
|
||||
<view v-if="systemInfo" :style="{ marginTop: systemInfo.safeAreaInsets?.top + 'px' }">
|
||||
<view v-if="$user.loginStatus">
|
||||
<view class="h-12 pt-1 flex flex-items-center flex-justify-between mx-4">
|
||||
<view>
|
||||
<view>19104656的互联</view>
|
||||
</view>
|
||||
<view class="pos-relative h-12 pt-1 flex flex-items-center mx-4 custom-color-black">
|
||||
<view>19104656的互联</view>
|
||||
<image class="w-2 h-2 ml-1.5" src="/static/images/icon_triangle.png"></image>
|
||||
<wd-icon class="ml-a" name="add-circle1" size="22px"></wd-icon>
|
||||
</view>
|
||||
<CustomTab class="mt-10" :list="featuresList" @clickItem="clickItem"></CustomTab>
|
||||
<button class="mt-12" @click="logout">退出登录</button>
|
||||
<view
|
||||
class="pos-relative h-8 mt-3 flex flex-items-center text-3.5 bg-[#fdefdf] mx-4 px-2 rounded-2 color-[#ea8720] shadow-sm"
|
||||
>
|
||||
<view>系统通知未开启,报警消息无法通知</view>
|
||||
<view class="bg-white px-1 text-3 py-0.5 ml-a rounded-1 mr-3">去开启</view>
|
||||
<wd-icon name="close" size="14px" color="#ea8720" class="pr-2 py-1"></wd-icon>
|
||||
</view>
|
||||
<scroll-view
|
||||
class="mt-2"
|
||||
:style="{
|
||||
height: systemInfo.safeArea?.height - 104 + 'px'
|
||||
}"
|
||||
>
|
||||
<HomeSwiper @colorChange="colorChange"></HomeSwiper>
|
||||
<HomeBulletin class="my-2"></HomeBulletin>
|
||||
<HomeTodo class="my-2"></HomeTodo>
|
||||
<CustomTab :list="featuresList" @clickItem="clickItem"></CustomTab>
|
||||
<button class="mt-12" @click="$user.logout()">退出登录</button>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import CustomTab from '@/pages/home/CustomTab.vue'
|
||||
import CustomTab from '@/pages/home/HomeTab.vue'
|
||||
import { useBasicStore, useUserStore } from '@/store'
|
||||
import { Result } from '@/constants/result'
|
||||
import { HomeTab, TabBarItem } from '@/typings'
|
||||
import HomeSwiper from '@/pages/home/HomeSwiper.vue'
|
||||
import HomeBulletin from '@/pages/home/HomeBulletin.vue'
|
||||
import HomeTodo from '@/pages/home/HomeTodo.vue'
|
||||
|
||||
const $user = useUserStore()
|
||||
const $basic = useBasicStore()
|
||||
|
||||
const systemInfo = ref(null)
|
||||
|
||||
const color = ref<string>('#bfcbef')
|
||||
|
||||
const list = ref<Array<TabBarItem>>([
|
||||
{
|
||||
title: '首页',
|
||||
@ -56,172 +83,202 @@
|
||||
|
||||
const featuresList = ref<Array<HomeTab>>([
|
||||
{
|
||||
title: '视频',
|
||||
name: '视频',
|
||||
list: [
|
||||
{
|
||||
id: 0,
|
||||
title: '视频中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 221,
|
||||
icon: 'https://file.hikmall.com/prod/image/e75144eac8984ee198ef533c2f9d3558.png',
|
||||
name: '视频中心'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: '视频中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 396,
|
||||
icon: 'https://file.hikmall.com/prod/image/cf46656ec73b404891e2b46b57ff5fc2.png',
|
||||
name: '智能巡检'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '视频中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 6405,
|
||||
icon: 'https://file.hikmall.com/prod/image/0526d084da4a49579f832dd4588dcb16.png',
|
||||
name: '录像智搜'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: '视频中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 403,
|
||||
icon: 'https://file.hikmall.com/prod/image/7ea5f88d404442eeb958fbe0904777d1.png',
|
||||
name: '智能分析'
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: '视频中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 354,
|
||||
icon: 'https://file.hikmall.com/prod/image/2887bb1c453244a2a872ec98c0360478.png',
|
||||
name: '人员抓拍'
|
||||
},
|
||||
{
|
||||
id: 357,
|
||||
icon: 'https://file.hikmall.com/prod/image/e6860e8e5cc64369accadae5347fb0c1.png',
|
||||
name: '车辆管理'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '音频',
|
||||
name: '人员通行',
|
||||
list: [
|
||||
{
|
||||
id: 0,
|
||||
title: '音频中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 106,
|
||||
icon: 'https://file.hikmall.com/prod/image/635392a7f5e04e75bb657b6cc6e2abc8.png',
|
||||
name: '通行权限'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: '音频中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 230,
|
||||
icon: 'https://file.hikmall.com/prod/image/d1d07b3125f841848c3c3eb94509b2ae.png',
|
||||
name: '门禁控制'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '音频中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 302,
|
||||
icon: 'https://file.hikmall.com/prod/image/885eb6ac104e4a76941e67eb738142ec.png',
|
||||
name: '一键开门'
|
||||
},
|
||||
{
|
||||
id: 400,
|
||||
icon: 'https://file.hikmall.com/prod/image/701d5a7031fa4b4290838c4562f99a0b.png',
|
||||
name: '密码开门'
|
||||
},
|
||||
{
|
||||
id: 299,
|
||||
icon: 'https://file.hikmall.com/prod/image/771a717eb8d74f5bba71db68c9605a0f.png',
|
||||
name: '通行记录'
|
||||
},
|
||||
{
|
||||
id: 387,
|
||||
icon: 'https://file.hikmall.com/prod/image/9752516f054342d3ac310a0fdb32b654.png',
|
||||
name: '访客管理'
|
||||
},
|
||||
{
|
||||
id: 399,
|
||||
icon: 'https://file.hikmall.com/prod/image/4dbe971d6fac465cb4fed956defd678c.png',
|
||||
name: '我的访客'
|
||||
},
|
||||
{
|
||||
id: 388,
|
||||
icon: 'https://file.hikmall.com/prod/image/624a69276df1480088661e20cbc0e189.png',
|
||||
name: '访客邀约'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '图文',
|
||||
name: '考勤',
|
||||
list: [
|
||||
{
|
||||
id: 0,
|
||||
title: '图文中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 382,
|
||||
icon: 'https://file.hikmall.com/prod/image/9e2b6e95c2904540a9a3dc675d25cc13.png',
|
||||
name: '考勤设置'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: '图文中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 383,
|
||||
icon: 'https://file.hikmall.com/prod/image/6cea7ba6b3b34464998bb501a609f3a9.png',
|
||||
name: '考勤统计'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '图文中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 381,
|
||||
icon: 'https://file.hikmall.com/prod/image/60c64c6c80a9429fa8d084506cd2f021.png',
|
||||
name: '我的考勤'
|
||||
},
|
||||
{
|
||||
id: 384,
|
||||
icon: 'https://file.hikmall.com/prod/image/116e1ea563474601ac075ac5bb312963.png',
|
||||
name: '手机打卡'
|
||||
},
|
||||
{
|
||||
id: -249155,
|
||||
icon: 'https://file.hikmall.com/prod/image/3e56cfb5cfae4bd285d6f55e51e1ce23.png',
|
||||
name: '请假'
|
||||
},
|
||||
{
|
||||
id: -249156,
|
||||
icon: 'https://file.hikmall.com/prod/image/7d2d7c5e1e7241eba1bc7848116a75cb.png',
|
||||
name: '补卡'
|
||||
},
|
||||
{
|
||||
id: -249157,
|
||||
icon: 'https://file.hikmall.com/prod/image/e007c441df1c4ab19ca6bb31ccad24e8.png',
|
||||
name: '出差'
|
||||
},
|
||||
{
|
||||
id: -249158,
|
||||
icon: 'https://file.hikmall.com/prod/image/90faf8728c6846da9d09f3db0739558d.png',
|
||||
name: '外出'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '直播',
|
||||
name: '审批',
|
||||
list: [
|
||||
{
|
||||
id: 0,
|
||||
title: '直播中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 386,
|
||||
icon: 'https://file.hikmall.com/prod/image/c5a56acf8efe47d78fc0107552c98bf8.png',
|
||||
name: '发起审批'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: '直播中心',
|
||||
icon: '/static/logo.png'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '直播中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 385,
|
||||
icon: 'https://file.hikmall.com/prod/image/6b946ba258234cdc8d447631b07939c3.png',
|
||||
name: '审批记录'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '其他',
|
||||
name: '可视对讲',
|
||||
list: [
|
||||
{
|
||||
id: 0,
|
||||
title: '其他中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 391,
|
||||
icon: 'https://file.hikmall.com/prod/image/4373b28a83a84c828b0150794ac2e402.png',
|
||||
name: '对讲设备'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: '其他中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 390,
|
||||
icon: 'https://file.hikmall.com/prod/image/8efa2ddbc0e94a75b761b0d23097e1d1.png',
|
||||
name: '呼叫关系'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '其他中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 389,
|
||||
icon: 'https://file.hikmall.com/prod/image/fa2073388a54462ba7badb9904b58396.png',
|
||||
name: '呼叫提醒'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '其他',
|
||||
name: '信息发布',
|
||||
list: [
|
||||
{
|
||||
id: 0,
|
||||
title: '其他中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 374,
|
||||
icon: 'https://file.hikmall.com/prod/image/e5fa04e5ccdc498dbc4d912074f38e35.png',
|
||||
name: '广播'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: '其他中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 309,
|
||||
icon: 'https://file.hikmall.com/prod/image/0706b7ff1e044928872839c61be74d54.png',
|
||||
name: '公告'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '其他中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 6093,
|
||||
icon: 'https://file.hikmall.com/prod/image/8ed90fc35e3840e782d73676efcc9a30.png',
|
||||
name: '信息发布'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '其他',
|
||||
name: '基础应用',
|
||||
list: [
|
||||
{
|
||||
id: 0,
|
||||
title: '其他中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 90,
|
||||
icon: 'https://file.hikmall.com/prod/image/d43b79c5f41543fca44cd21ba84d9c02.png',
|
||||
name: '人员管理'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: '其他中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 310,
|
||||
icon: 'https://file.hikmall.com/prod/image/597b0cb3ddf849788b6c5e7727001690.png',
|
||||
name: '团队二维码'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '其他中心',
|
||||
icon: '/static/logo.png'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '其他',
|
||||
list: [
|
||||
{
|
||||
id: 0,
|
||||
title: '其他中心',
|
||||
icon: '/static/logo.png'
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
title: '其他中心',
|
||||
icon: '/static/logo.png'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: '其他中心',
|
||||
icon: '/static/logo.png'
|
||||
id: 293,
|
||||
icon: 'https://file.hikmall.com/prod/image/6ecf9e7c946945a5a1efd07c5e8db320.png',
|
||||
name: '设备管理'
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -247,14 +304,11 @@
|
||||
}
|
||||
})
|
||||
|
||||
const colorChange = data => {
|
||||
color.value = data
|
||||
}
|
||||
|
||||
const clickItem = item => {
|
||||
console.log(item)
|
||||
}
|
||||
|
||||
const logout = async () => {
|
||||
await $user.logout()
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -9,7 +9,10 @@
|
||||
</route>
|
||||
<template>
|
||||
<view class="bg-white">
|
||||
<TopNavigation v-if="systemInfo && systemInfo?.uniPlatform === 'app'"></TopNavigation>
|
||||
<TopNavigation
|
||||
:have-back="false"
|
||||
v-if="systemInfo && systemInfo?.uniPlatform === 'app'"
|
||||
></TopNavigation>
|
||||
<swiper
|
||||
v-if="systemInfo"
|
||||
circular="true"
|
||||
@ -222,6 +225,8 @@
|
||||
title: '登录成功',
|
||||
icon: 'none'
|
||||
})
|
||||
} else if (result.errorCode === Result.NewDevice.code) {
|
||||
await codeLogin(true)
|
||||
} else {
|
||||
await uni.showToast({
|
||||
title: result.errorMsg,
|
||||
@ -238,7 +243,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
const codeLogin = async () => {
|
||||
const codeLogin = async (tip: boolean = false) => {
|
||||
if (!phonePass.value) {
|
||||
return
|
||||
}
|
||||
@ -259,8 +264,12 @@
|
||||
})
|
||||
uni.hideLoading()
|
||||
if (result.errorCode === Result.Success.code) {
|
||||
let url = `/pages/code/code?phone=${phone.value}&type=login`
|
||||
if (tip) {
|
||||
url = url + `&tip=true`
|
||||
}
|
||||
await uni.navigateTo({
|
||||
url: `/pages/code/code?phone=${phone.value}&type=login`
|
||||
url
|
||||
})
|
||||
} else {
|
||||
await uni.showToast({
|
||||
|
||||
BIN
src/static/images/icon_add.png
Normal file
BIN
src/static/images/icon_add.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
BIN
src/static/images/icon_audit.png
Normal file
BIN
src/static/images/icon_audit.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/static/images/icon_triangle.png
Normal file
BIN
src/static/images/icon_triangle.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@ -38,6 +38,9 @@ export const useUserStore = defineStore(
|
||||
loginStatus.value = false
|
||||
uni.removeStorageSync('userInfo')
|
||||
uni.removeStorageSync('token')
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@ -15,12 +15,12 @@ export type TabBarItem = {
|
||||
|
||||
export type HomeTabItem = {
|
||||
icon: string
|
||||
title: string
|
||||
name: string
|
||||
id: number
|
||||
}
|
||||
|
||||
export type HomeTab = {
|
||||
title: string
|
||||
name: string
|
||||
list: HomeTabItem[]
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user