update
This commit is contained in:
@@ -10,9 +10,12 @@ import PLUSICON from "../../static/icons/plus.png";
|
||||
import XNav from "../../components/XNav.vue";
|
||||
import XNoticeBar from "../../components/XNoticeBar.vue";
|
||||
import {showToast, toPage} from "../../utils/uils.js";
|
||||
import {onMounted, reactive} from "vue";
|
||||
import {reactive} from "vue";
|
||||
import Api from "../../api/index.js";
|
||||
import {onShow} from "@dcloudio/uni-app";
|
||||
import {useSystemStore} from "../../pinia/SystemStore/index.js";
|
||||
|
||||
const SystemStore = useSystemStore();
|
||||
const BASE = [
|
||||
{
|
||||
id: 1,
|
||||
@@ -42,22 +45,19 @@ const BASE = [
|
||||
];
|
||||
const list = reactive([]);
|
||||
const dataList = reactive([]);
|
||||
const po = reactive({
|
||||
pid: null,
|
||||
});
|
||||
|
||||
const getData = async () => {
|
||||
const {data} = await Api.system.myAccount(po);
|
||||
const {data} = await Api.system.myAccount(SystemStore.accountManagementPo);
|
||||
dataList.length = 0;
|
||||
dataList.push(...data);
|
||||
}
|
||||
|
||||
const changeTab = (pid) => {
|
||||
po.pid = pid;
|
||||
SystemStore.accountManagementPo.pid = pid;
|
||||
getData();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
onShow(() => {
|
||||
Api.system.getPlatform().then(({data}) => {
|
||||
data = data.filter(v => v.id !== 0);
|
||||
list.length = 0;
|
||||
@@ -73,7 +73,7 @@ onMounted(() => {
|
||||
})
|
||||
})
|
||||
|
||||
po.pid = list[0].id;
|
||||
if (!SystemStore.accountManagementPo) SystemStore.accountManagementPo.pid = list[0].id;
|
||||
getData();
|
||||
})
|
||||
})
|
||||
@@ -94,7 +94,7 @@ const deleteItem = async (id) => {
|
||||
<template v-for="(item, index) in list" :key="item.id">
|
||||
<view class="!flex flex-col items-center" @click="changeTab(item.id)">
|
||||
<image class="!size-[64rpx]" :src="item.icon"></image>
|
||||
<view :class="['test-24r !mt-[10rpx]', po.pid === item.id ? 'cur' : '']">
|
||||
<view :class="['test-24r !mt-[10rpx]', SystemStore.accountManagementPo.pid === item.id ? 'cur' : '']">
|
||||
{{
|
||||
item.name
|
||||
}}
|
||||
@@ -106,7 +106,7 @@ const deleteItem = async (id) => {
|
||||
|
||||
<view class="p-[20rpx] !flex flex-col gap-[20rpx]">
|
||||
<view
|
||||
@click="toPage('/pages/addAccount/index')"
|
||||
@click="toPage(`/pages/addAccount/index`)"
|
||||
class="py-[15rpx] bg-[#E8F3FF] text-[var(--primary-color)] !flex justify-center items-center gap-[10rpx] border border-[var(--primary-color)] rounded-[4rpx]">
|
||||
<image :src="PLUSICON" class="!size-[26rpx] !mt-[2rpx]"></image>
|
||||
新增帐号
|
||||
|
||||
Reference in New Issue
Block a user