main
wwl 2024-03-28 16:56:23 +08:00
parent 82ca8b7b3d
commit 99cdc25e80
1 changed files with 86 additions and 66 deletions

View File

@ -1,74 +1,84 @@
<template> <template>
<view class="px-44rpx"> <view class="px-44rpx">
<view class="flex items-center pt-80rpx pl-16rpx" @click="handleLogin"> <view>
<view class="overflow-hidden rounded-full w-20 h-20"> <view
<image class="flex items-center pt-80rpx pl-16rpx min-h-240rpx"
:src="userInfo.avatar ? userInfo.avatar : defaultAvatar" @click="handleLogin"
alt="" >
class="w-full h-full" <view class="overflow-hidden rounded-full w-20 h-20">
/> <image
</view> :class="loading ? 'overflow-hidden' : ' '"
:src="userInfo.avatar ? userInfo.avatar : defaultAvatar"
alt=""
class="w-full h-full"
/>
</view>
<view class="ml-4"> <view class="ml-4">
<block v-if="isLogin"> <block v-if="isLogin">
<view class="text-34rpx"> {{ userInfo.nickName }}</view> <view class="text-34rpx"> {{ userInfo.nickName }}</view>
<view class="text-24rpx text-primary-500 mt-20rpx flex items-center"> <view
<image class="text-24rpx text-primary-500 mt-20rpx flex items-center h-30rpx overflow-hidden"
class="w-28rpx mr-4rpx" >
:src="$assets('/personal/edit.jpg')" <image
mode="widthFix" class="w-28rpx mr-4rpx"
></image> :src="$assets('/personal/edit.jpg')"
<text>编辑资料</text></view mode="widthFix"
> ></image>
</block> <text>编辑资料</text></view
<view v-else claas="text-34rpx text-primary">登录</view> >
</view> </block>
</view> <view v-else claas="text-34rpx text-primary">登录</view>
<view
class="flex items-center pl-16rpx my-40rpx"
v-if="userInfo.roleName === 'common'"
>
<view class="flex flex-1 flex-col">
<text class="text-34rpx">{{ orderTodayIncome.count || 0 }}</text>
<text class="text-28rpx text-#999">累计接单</text>
</view>
<view class="flex flex-1 flex-col">
<text class="text-34rpx">{{ orderTodayIncome.doctorPrice || 0 }}</text>
<text class="text-28rpx text-#999">累计收入</text>
</view>
<view class="flex flex-1 flex-col">
<text class="text-34rpx">{{ orderTodayIncome.cashPrice || 0 }}</text>
<text class="text-28rpx text-#999">可提现</text>
</view>
<view
@click="showWithdraw = true"
class="w-120rpx text-primary-500 text-30rpx"
>
立即提现
</view>
</view>
<view class="relative mt-40rpx">
<view
v-for="(item, index) of menuList"
:key="index"
class="flex items-center py-4"
@click="handleInfo(item)"
>
<!-- <view class="w-10 flex-none truncate text-primary-500 text-2xl">
<via-icon :name="item.icon"></via-icon>
</view> -->
<view class="flex-1 flex items-center">
<image :src="$assets(item.icon)" alt="" class="w-42rpx h-42rpx" />
<text class="ml-40rpx">{{ item.text }}</text>
</view>
<view class="flex-none w-10 text-right text-gray-500">
<via-icon name="arrow-right-bold"></via-icon>
</view> </view>
</view> </view>
<button <view
class="absolute bottom-224rpx bg-transparent border-transparent z-2 w-660rpx h-90rpx" class="flex items-center pl-16rpx my-40rpx"
open-type="contact" v-if="userInfo.roleName === 'common'"
></button> >
<view class="flex flex-1 flex-col">
<text class="text-34rpx">{{ orderTodayIncome.count || 0 }}</text>
<text class="text-28rpx text-#999">累计接单</text>
</view>
<view class="flex flex-1 flex-col">
<text class="text-34rpx">{{
orderTodayIncome.doctorPrice || 0
}}</text>
<text class="text-28rpx text-#999">累计收入</text>
</view>
<view class="flex flex-1 flex-col">
<text class="text-34rpx">{{ orderTodayIncome.cashPrice || 0 }}</text>
<text class="text-28rpx text-#999">可提现</text>
</view>
<view
@click="showWithdraw = true"
class="w-120rpx text-primary-500 text-30rpx"
>
立即提现
</view>
</view>
<view class="relative mt-40rpx min-h-[50vh]">
<view
v-for="(item, index) of menuList"
:key="index"
class="flex items-center py-4"
@click="handleInfo(item)"
>
<!-- <view class="w-10 flex-none truncate text-primary-500 text-2xl">
<via-icon :name="item.icon"></via-icon>
</view> -->
<view class="flex-1 flex items-center">
<image :src="$assets(item.icon)" alt="" class="w-42rpx h-42rpx" />
<text class="ml-40rpx">{{ item.text }}</text>
</view>
<view class="flex-none w-10 text-right text-gray-500">
<via-icon name="arrow-right-bold"></via-icon>
</view>
</view>
<button
class="absolute bottom-224rpx bg-transparent border-transparent z-2 w-660rpx h-90rpx"
open-type="contact"
></button>
</view>
</view> </view>
<u-modal <u-modal
@ -309,7 +319,11 @@ const handleLogin = async () => {
}) })
} }
const loading = ref(true)
const getUserInfo = async () => { const getUserInfo = async () => {
setTimeout(() => {
loading.value = false
}, 250)
if (isLogin.value) { if (isLogin.value) {
const res = await $api.getUser() const res = await $api.getUser()
if (res?.success) { if (res?.success) {
@ -324,6 +338,12 @@ const getUserInfo = async () => {
onShow(() => { onShow(() => {
getUserInfo() getUserInfo()
}) })
// const loading = ref(true)
onMounted(() => {
setTimeout(() => {
loading.value = false
}, 250)
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>