|
|
|
@ -2,8 +2,10 @@ |
|
|
|
import { onLoad } from "@dcloudio/uni-app"; |
|
|
|
import { ref } from "vue"; |
|
|
|
import customTabBar from "@/components/custom-tab-bar/my-tab-bar.vue"; |
|
|
|
import navigation from "@/components/navigation/navigation.vue"; |
|
|
|
import navv from "@/components/nav/nav.vue"; |
|
|
|
// import navigation from "@/components/navigation/navigation.vue"; |
|
|
|
import { getUserInfoApi, yesterdayOrderApi } from "@/libs/api"; |
|
|
|
import { increaseFontScale } from "@/libs/utils"; |
|
|
|
|
|
|
|
/** |
|
|
|
* 判断登录状态 |
|
|
|
@ -352,195 +354,211 @@ onLoad(() => { |
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
|
<view class="w-full main"> |
|
|
|
<!-- 登录 和 头像 --> |
|
|
|
<view class="header-box"> |
|
|
|
<image class="back-img" src="/static/personalInformation/juxing.png" mode="widthFix" /> |
|
|
|
<navigation |
|
|
|
title="个人中心" |
|
|
|
background="#05b259" |
|
|
|
:title-style="{ color: 'white' }" |
|
|
|
:icon-style="{ display: 'none' }" |
|
|
|
/> |
|
|
|
<!-- <uv-navbar title="个人中心" /> --> |
|
|
|
<view class="userinfo"> |
|
|
|
<view class="left"> |
|
|
|
<image |
|
|
|
class="avatar" |
|
|
|
:src="userInfo.image ? userInfo.image : '/static/personalInformation/touxiang1.png'" |
|
|
|
mode="aspectFill" |
|
|
|
/> |
|
|
|
<navv> |
|
|
|
<template #default="{ status, menu }"> |
|
|
|
<!-- 登录 和 头像 --> |
|
|
|
<view class="header-box"> |
|
|
|
<image class="back-img" src="/static/personalInformation/juxing.png" mode="widthFix" /> |
|
|
|
<view |
|
|
|
class="title" |
|
|
|
:style="{ |
|
|
|
paddingTop: `${status}px`, |
|
|
|
height: menu ? `${menu}px` : 'auto', |
|
|
|
}" |
|
|
|
> |
|
|
|
个人中心 |
|
|
|
</view> |
|
|
|
<!-- <navigation |
|
|
|
title="个人中心" |
|
|
|
background="#05b259" |
|
|
|
:title-style="{ color: 'white' }" |
|
|
|
:icon-style="{ display: 'none' }" |
|
|
|
/> --> |
|
|
|
<!-- <uv-navbar title="个人中心" /> --> |
|
|
|
<view class="userinfo"> |
|
|
|
<view class="left"> |
|
|
|
<image |
|
|
|
class="avatar" |
|
|
|
:src="userInfo.image ? userInfo.image : '/static/personalInformation/touxiang1.png'" |
|
|
|
mode="aspectFill" |
|
|
|
/> |
|
|
|
|
|
|
|
<!-- telephone true --> |
|
|
|
<view v-if="userInfo.telephone" class="information"> |
|
|
|
<view class="name"> |
|
|
|
{{ userInfo.username }} |
|
|
|
</view> |
|
|
|
<view v-if="company" class="company"> |
|
|
|
{{ company.name }} |
|
|
|
<!-- telephone true --> |
|
|
|
<view v-if="userInfo.telephone" class="information"> |
|
|
|
<view class="name"> |
|
|
|
{{ userInfo.username }} |
|
|
|
</view> |
|
|
|
<view v-if="company" class="company"> |
|
|
|
{{ company.name }} |
|
|
|
</view> |
|
|
|
<view v-else class="add-company" @click="onJoinEnterprise"> |
|
|
|
<text>加入企业</text> |
|
|
|
<uv-icon color="white" name="arrow-right" size="28rpx" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-else class="add-company" @click="onJoinEnterprise"> |
|
|
|
<text>加入企业</text> |
|
|
|
<uv-icon color="white" name="arrow-right" size="28rpx" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- telephone false --> |
|
|
|
<view v-else class="btns"> |
|
|
|
<view v-if="isLogin" class="add-company" @click="onJoinEnterprise"> |
|
|
|
<text>加入企业</text> |
|
|
|
<uv-icon color="white" name="arrow-right" size="28rpx" /> |
|
|
|
</view> |
|
|
|
<view v-else class="login-btn" @click="onGotoLogin"> |
|
|
|
<text> 登录 </text> |
|
|
|
<uv-icon color="white" name="arrow-right" size="28rpx" /> |
|
|
|
<!-- telephone false --> |
|
|
|
<view v-else class="btns"> |
|
|
|
<view v-if="isLogin" class="add-company" @click="onJoinEnterprise"> |
|
|
|
<text>加入企业</text> |
|
|
|
<uv-icon color="white" name="arrow-right" size="28rpx" /> |
|
|
|
</view> |
|
|
|
<view v-else class="login-btn" @click="onGotoLogin"> |
|
|
|
<text> 登录 </text> |
|
|
|
<uv-icon color="white" name="arrow-right" size="28rpx" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view v-if="userInfo.telephone" class="right"> |
|
|
|
<image |
|
|
|
class="icon-one" |
|
|
|
src="/static/personalInformation/fujingqiy.png" |
|
|
|
mode="widthFix" |
|
|
|
@click="onOpenFriends" |
|
|
|
/> |
|
|
|
<image |
|
|
|
class="icon-two" |
|
|
|
src="/static/personalInformation/shezhi.png" |
|
|
|
mode="widthFix" |
|
|
|
@click="onOpenMyInfo" |
|
|
|
/> |
|
|
|
<view v-if="userInfo.telephone" class="right"> |
|
|
|
<image |
|
|
|
class="icon-one" |
|
|
|
src="/static/personalInformation/fujingqiy.png" |
|
|
|
mode="widthFix" |
|
|
|
@click="onOpenFriends" |
|
|
|
/> |
|
|
|
<image |
|
|
|
class="icon-two" |
|
|
|
src="/static/personalInformation/shezhi.png" |
|
|
|
mode="widthFix" |
|
|
|
@click="onOpenMyInfo" |
|
|
|
/> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="order-cart-box"> |
|
|
|
<text class="title"> |
|
|
|
常用订单 |
|
|
|
</text> |
|
|
|
<view class="order-list-box"> |
|
|
|
<view |
|
|
|
v-for="item in commonOrders" |
|
|
|
:key="item.title" |
|
|
|
class="order-list" |
|
|
|
@click="onGotoOrder" |
|
|
|
> |
|
|
|
<view v-if="item.title === 'dfk'" class="order-tag"> |
|
|
|
{{ dfkDataLength }} |
|
|
|
<view class="order-cart-box"> |
|
|
|
<text class="title"> |
|
|
|
常用订单 |
|
|
|
</text> |
|
|
|
<view class="order-list-box"> |
|
|
|
<view |
|
|
|
v-for="item in commonOrders" |
|
|
|
:key="item.title" |
|
|
|
class="order-list" |
|
|
|
@click="onGotoOrder" |
|
|
|
> |
|
|
|
<view v-if="item.title === 'dfk'" class="order-tag"> |
|
|
|
{{ dfkDataLength }} |
|
|
|
</view> |
|
|
|
<image class="icon" :src="item.url" mode="aspectFit" /> |
|
|
|
<text class="name"> |
|
|
|
{{ item.text }} |
|
|
|
</text> |
|
|
|
</view> |
|
|
|
<image class="icon" :src="item.url" mode="aspectFit" /> |
|
|
|
<text class="name"> |
|
|
|
{{ item.text }} |
|
|
|
</view> |
|
|
|
<view v-if="position" class="order-list-box-position" @click="onGetPosition"> |
|
|
|
<text class="text"> |
|
|
|
你有订单正在配送,点击查看位置 |
|
|
|
</text> |
|
|
|
<image class="icon" src="/static/personalInformation/arrow-two.png" mode="" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-if="position" class="order-list-box-position" @click="onGetPosition"> |
|
|
|
<text class="text"> |
|
|
|
你有订单正在配送,点击查看位置 |
|
|
|
</text> |
|
|
|
<image class="icon" src="/static/personalInformation/arrow-two.png" mode="" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="tool-box"> |
|
|
|
<block |
|
|
|
v-for="(parent, parentIndex) in commonTools" |
|
|
|
:key="parentIndex" |
|
|
|
> |
|
|
|
<text v-if="parentIndex === 0" class="title"> |
|
|
|
账号管理 |
|
|
|
</text> |
|
|
|
<text v-if="parentIndex === 1" class="title"> |
|
|
|
充值管理 |
|
|
|
</text> |
|
|
|
<text v-if="parentIndex === 2" class="title"> |
|
|
|
财务管理 |
|
|
|
</text> |
|
|
|
<text v-if="parentIndex === 3" class="title"> |
|
|
|
常用工具 |
|
|
|
</text> |
|
|
|
<view class="tool-list-box"> |
|
|
|
<template v-for="(item) in parent" :key="item.title"> |
|
|
|
<block |
|
|
|
v-if="(item.auth && userInfo.comBoss) || !item.auth" |
|
|
|
> |
|
|
|
<button |
|
|
|
v-if="item.type === 'tap'" |
|
|
|
class="tool-list" |
|
|
|
@click="exportDeliveryNote" |
|
|
|
> |
|
|
|
<image class="icon" :src="item.url" mode="aspectFit" /> |
|
|
|
<text class="name"> |
|
|
|
{{ item.text }} |
|
|
|
</text> |
|
|
|
</button> |
|
|
|
<button |
|
|
|
v-if="item.type === 'other'" |
|
|
|
class="tool-list" |
|
|
|
data-item="{{item}}" |
|
|
|
@click="handleOther" |
|
|
|
> |
|
|
|
<image class="icon" :src="item.url" mode="aspectFit" /> |
|
|
|
<text class="name"> |
|
|
|
{{ item.text }} |
|
|
|
</text> |
|
|
|
</button> |
|
|
|
<navigator |
|
|
|
v-if=" |
|
|
|
item.type !== 'tap' |
|
|
|
&& item.type !== 'share' |
|
|
|
&& item.type !== 'switchTab' |
|
|
|
&& item.type !== 'other' |
|
|
|
" |
|
|
|
style="display: flex;flex-direction: column;width: 25%;margin-bottom: 48rpx;" |
|
|
|
url="{{item.path}}" |
|
|
|
:open-type="item.type" |
|
|
|
hover-class="other-navigator-hover" |
|
|
|
<view class="tool-box"> |
|
|
|
<view> |
|
|
|
<uv-button @click="() => increaseFontScale(0.1)"> |
|
|
|
加大字体 |
|
|
|
</uv-button> |
|
|
|
<uv-button @click="() => increaseFontScale(-0.1)"> |
|
|
|
减小字体 |
|
|
|
</uv-button> |
|
|
|
</view> |
|
|
|
|
|
|
|
<block |
|
|
|
v-for="(parent, parentIndex) in commonTools" |
|
|
|
:key="parentIndex" |
|
|
|
> |
|
|
|
<text v-if="parentIndex === 0" class="title"> |
|
|
|
账号管理 |
|
|
|
</text> |
|
|
|
<text v-if="parentIndex === 1" class="title"> |
|
|
|
充值管理 |
|
|
|
</text> |
|
|
|
<text v-if="parentIndex === 2" class="title"> |
|
|
|
财务管理 |
|
|
|
</text> |
|
|
|
<text v-if="parentIndex === 3" class="title"> |
|
|
|
常用工具 |
|
|
|
</text> |
|
|
|
<view class="tool-list-box"> |
|
|
|
<template v-for="(item) in parent" :key="item.title"> |
|
|
|
<block |
|
|
|
v-if="(item.auth && userInfo.comBoss) || !item.auth" |
|
|
|
> |
|
|
|
<button class="tool-list" style="width: 100%;margin-bottom: 0;"> |
|
|
|
<button |
|
|
|
v-if="item.type === 'tap'" |
|
|
|
class="tool-list" |
|
|
|
@click="exportDeliveryNote" |
|
|
|
> |
|
|
|
<image class="icon" :src="item.url" mode="aspectFit" /> |
|
|
|
<text class="name"> |
|
|
|
{{ item.text }} |
|
|
|
</text> |
|
|
|
</button> |
|
|
|
</navigator> |
|
|
|
<button |
|
|
|
v-if="item.type === 'switchTab'" |
|
|
|
class="tool-list" |
|
|
|
@click="openSwitchTab" |
|
|
|
> |
|
|
|
<image class="icon" :src="item.url" mode="aspectFit" /> |
|
|
|
<text class="name"> |
|
|
|
{{ item.text }} |
|
|
|
</text> |
|
|
|
</button> |
|
|
|
<button |
|
|
|
v-if="item.type === 'share'" |
|
|
|
class="tool-list" |
|
|
|
data-name="shareBtn" |
|
|
|
open-type="share" |
|
|
|
> |
|
|
|
<image class="icon" :src="item.url" mode="aspectFit" /> |
|
|
|
<text class="name"> |
|
|
|
{{ item.text }} |
|
|
|
</text> |
|
|
|
</button> |
|
|
|
</block> |
|
|
|
</template> |
|
|
|
</view> |
|
|
|
</block> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view> |
|
|
|
<uv-button>加大字体</uv-button> |
|
|
|
<uv-button>减小字体</uv-button> |
|
|
|
</view> |
|
|
|
<button |
|
|
|
v-if="item.type === 'other'" |
|
|
|
class="tool-list" |
|
|
|
data-item="{{item}}" |
|
|
|
@click="handleOther" |
|
|
|
> |
|
|
|
<image class="icon" :src="item.url" mode="aspectFit" /> |
|
|
|
<text class="name"> |
|
|
|
{{ item.text }} |
|
|
|
</text> |
|
|
|
</button> |
|
|
|
<navigator |
|
|
|
v-if=" |
|
|
|
item.type !== 'tap' |
|
|
|
&& item.type !== 'share' |
|
|
|
&& item.type !== 'switchTab' |
|
|
|
&& item.type !== 'other' |
|
|
|
" |
|
|
|
style="display: flex;flex-direction: column;width: 25%;margin-bottom: 48rpx;" |
|
|
|
url="{{item.path}}" |
|
|
|
:open-type="item.type" |
|
|
|
hover-class="other-navigator-hover" |
|
|
|
> |
|
|
|
<button class="tool-list" style="width: 100%;margin-bottom: 0;"> |
|
|
|
<image class="icon" :src="item.url" mode="aspectFit" /> |
|
|
|
<text class="name"> |
|
|
|
{{ item.text }} |
|
|
|
</text> |
|
|
|
</button> |
|
|
|
</navigator> |
|
|
|
<button |
|
|
|
v-if="item.type === 'switchTab'" |
|
|
|
class="tool-list" |
|
|
|
@click="openSwitchTab" |
|
|
|
> |
|
|
|
<image class="icon" :src="item.url" mode="aspectFit" /> |
|
|
|
<text class="name"> |
|
|
|
{{ item.text }} |
|
|
|
</text> |
|
|
|
</button> |
|
|
|
<button |
|
|
|
v-if="item.type === 'share'" |
|
|
|
class="tool-list" |
|
|
|
data-name="shareBtn" |
|
|
|
open-type="share" |
|
|
|
> |
|
|
|
<image class="icon" :src="item.url" mode="aspectFit" /> |
|
|
|
<text class="name"> |
|
|
|
{{ item.text }} |
|
|
|
</text> |
|
|
|
</button> |
|
|
|
</block> |
|
|
|
</template> |
|
|
|
</view> |
|
|
|
</block> |
|
|
|
</view> |
|
|
|
|
|
|
|
<customTabBar tab-index="4" /> |
|
|
|
</view> |
|
|
|
<customTabBar tab-index="4" /> |
|
|
|
</template> |
|
|
|
</navv> |
|
|
|
</template> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
@import './personallInformation.scss' |
|
|
|
@import '../../uni.scss'; |
|
|
|
@import './personallInformation.scss'; |
|
|
|
</style> |