<route lang="yaml">
style:
  navigationBarTitleText: 商家设置
  navigationBarBackgroundColor: '#fff'
</route>
<script lang="ts" setup>
import { useUserStore } from '../../../store'
import { storeToRefs } from 'pinia'

import { rightArrowIcon } from '@designer-hub/assets/src/svgs'
import { getVendorAppInfo } from '../../../core/libs/requests'
import SectionHeading from '@designer-hub/app/src/components/section-heading.vue'
const userStore = useUserStore()
const { isLogined, userInfo } = storeToRefs(userStore)
const { data, run: setData } = useRequest(() => getVendorAppInfo())
const logout = () => {
  userStore.clearUserInfo()
  uni.reLaunch({ url: '/pages/login/index' })
}
onMounted(async () => {
  await setData()
})
</script>

<template>
  <view class="bg-white p-[16px] flex-grow flex flex-col">
    <div class="flex-1">
      <div class="flex justify-between items-center mb-[30px]">
        <div class="text-black/40 text-sm font-normal font-['PingFang_SC'] leading-none">头像</div>
        <wd-img width="28" height="28" class="w-7 h-7 rounded-full" :src="data?.avatar" />
      </div>
      <div class="flex justify-between items-center mb-[30px]">
        <div class="text-black/40 text-sm font-normal font-['PingFang_SC'] leading-none">名称</div>
        <div
          class="text-right text-[#999999] text-sm font-normal font-['PingFang_SC'] leading-none"
        >
          {{ data?.vendorName }}
        </div>
      </div>
      <div class="flex justify-between items-center mb-[30px]">
        <div class="text-black/40 text-sm font-normal font-['PingFang_SC'] leading-none">ID</div>
        <div
          class="text-right text-[#999999] text-sm font-normal font-['PingFang_SC'] leading-none"
        >
          {{ data?.id }}
        </div>
      </div>
      <div class="flex justify-between items-center mb-[30px]">
        <div class="text-black/40 text-sm font-normal font-['PingFang_SC'] leading-none">
          登录用户
        </div>
        <div
          class="text-right text-[#999999] text-sm font-normal font-['PingFang_SC'] leading-none"
        >
          <!-- 李晓东 -->
          {{ data?.contactName }}
        </div>
      </div>
      <div class="flex justify-between items-center mb-[30px]">
        <div class="text-black/40 text-sm font-normal font-['PingFang_SC'] leading-none">
          登录用户手机
        </div>
        <div
          class="text-right text-[#999999] text-sm font-normal font-['PingFang_SC'] leading-none"
        >
          <!-- 132****1452 -->
          {{ data?.mobile }}
        </div>
      </div>
      <!-- <div class="flex justify-between items-center">
        <div class="text-black/40 text-sm font-normal font-['PingFang_SC'] leading-none">
          修改密码
        </div>
        <wd-img width="15px" height="15px" :src="rightArrowIcon"></wd-img>
      </div> -->
      <SectionHeading title="修改密码" size="sm" end-arrow></SectionHeading>
    </div>
    <div class="w-full mt-[50px]">
      <wd-button block :round="false" @click="logout">
        <div
          class="text-center text-white text-base font-normal font-['PingFang_SC'] leading-normal"
        >
          退出登录
        </div>
      </wd-button>
    </div>
  </view>
</template>

<style lang="scss" scoped></style>
