<script setup>
import { onMounted, ref } from 'vue';
import sHeader from "@/components/SimpleHeader";
import { useRouter } from "vue-router";
import { getLoginUser, styleUrl } from "@/common/js/utils";

const router = useRouter();
const user = getLoginUser();
const isAdmin = ref(false);

const checkIsAdmin = async () => {
  if (user.phone === '13631231970') {
    isAdmin.value = true
  }
  console.log("isAdmin >>>", isAdmin.value);
}
// 初始化页面获取列表
onMounted(async () => {
  styleUrl('taskMessage');
  checkIsAdmin()
});
const pushPageList = (url) => {
  router.push(url);
}

</script>

<template>
  <!-- 任务消息列表 -->
  <div class="taskMessagePage flex-col">
    <s-header :name="$t('taskMessage.taskMessage')" :noback="false"></s-header>
    <div class="taskMessageBox flex-col">
      <!-- 账号申请 -->
      <div v-if="isAdmin" class="taskListRow flex-col" @click="pushPageList('/taskAccountList')">
        <div class="taskIcon registerAccountIcon"></div>
        <div class="taskRight">
          <div class="taskTitle">新人注册</div>
        </div>
      </div>

      <!-- 用户管理 -->
      <div v-if="isAdmin" class="taskListRow flex-col" @click="pushPageList('/userManageList')">
        <div class="taskIcon userManageIcon"></div>
        <div class="taskRight">
          <div class="taskTitle">用户管理</div>
        </div>
      </div>

      <!-- 挂单匹配 -->
      <div class="taskListRow flex-col" @click="pushPageList('/pendingOrderList')">
        <div class="taskIcon orderMatchIcon"></div>
        <div class="taskRight">
          <div class="taskTitle">挂单匹配</div>
        </div>
      </div>

      <!-- 成交列表 -->
      <div class="taskListRow flex-col" @click="pushPageList('/transactionList')">
        <div class="taskIcon closingIcon"></div>
        <div class="taskRight">
          <div class="taskTitle">成交列表</div>
        </div>
      </div>

    </div>
  </div>
</template>


<style lang="less" scoped>
@import "../../common/style/common.less";
</style>
