代码优化
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="pages-mine" v-if="mineInfo.id">
|
||||
<view class="pages-mine">
|
||||
<uni-nav-bar :fixed="true" :shadow="false" :statusBar="true" title="我的" :color="color"
|
||||
:backgroundColor="color == '#ffffff' ?``:`#ffffff`">
|
||||
</uni-nav-bar>
|
||||
@@ -16,12 +16,12 @@
|
||||
</view>
|
||||
</auth>
|
||||
<view class="rel pt-md pl-lg pr-lg pb-lg flex-center" v-else>
|
||||
<image mode="aspectFill" lazy-load class="mt-md avatar radius" :src="userInfo.avatarUrl"></image>
|
||||
<image mode="aspectFill" lazy-load class="mt-md avatar radius" :src="userInfo && userInfo.avatarUrl ? userInfo.avatarUrl : '/static/image/mine/default-user.png'"></image>
|
||||
<view class="flex-1 ml-md">
|
||||
<view class="flex-center mb-lg">
|
||||
<view class="flex-1 flex-center f-lg-title c-base text-bold">
|
||||
<view class="mr-sm max-400 ellipsis">
|
||||
{{ userInfo.nickName || `用户${userInfo.id}` }}
|
||||
{{ (userInfo && userInfo.nickName) || (userInfo && userInfo.id ? `用户${userInfo.id}` : '游客') }}
|
||||
</view>
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<view class="flex-1"></view>
|
||||
@@ -56,14 +56,14 @@
|
||||
</block>
|
||||
|
||||
<view class="pt-md pl-lg pr-lg pb-lg flex-center" v-if="user_type == 2">
|
||||
<image mode="aspectFill" lazy-load class="avatar radius" :src="farmer_info.cover">
|
||||
<image mode="aspectFill" lazy-load class="avatar radius" :src="farmer_info && farmer_info.cover ? farmer_info.cover : '/static/image/mine/default-user.png'">
|
||||
</image>
|
||||
<view class="flex-1 ml-md">
|
||||
<view class="f-lg-title c-base text-bold ellipsis" style="max-width: 520rpx;">{{farmer_info.title}}
|
||||
<view class="f-lg-title c-base text-bold ellipsis" style="max-width: 520rpx;">{{(farmer_info && farmer_info.title) || '未填写店铺名称'}}
|
||||
</view>
|
||||
<view class="flex-warp f-paragraph c-base">
|
||||
<i class="iconfont icon-dingwei mr-sm" style="font-size: 28rpx;margin-top: 6rpx;"></i>
|
||||
<view class="ellipsis-2" style="max-width: 490rpx;">{{farmer_info.address}}</view>
|
||||
<view class="ellipsis-2" style="max-width: 490rpx;">{{(farmer_info && farmer_info.address) || '未填写地址'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -84,26 +84,26 @@
|
||||
|
||||
<!-- 地主/农场主 -->
|
||||
<!-- balance 总金额,包含冻结资金 -->
|
||||
<view class="stored-list flex-center pd-lg mt-sm ml-md mr-md fill-base box-shadow radius-20"
|
||||
v-if="!mineInfo.is_user && user_type == 1">
|
||||
<view class="stored-list flex-center pd-lg mt-sm ml-md mr-md fill-base box-shadow radius-20"
|
||||
v-if="user_type == 1 && (mineInfo && mineInfo.balance !== undefined)">
|
||||
<auth :needAuth="userInfo && !userInfo.nickName" :must="true"
|
||||
@go="$util.toCheckLogin({url:`/mine/pages/balance/index`})" class="stored-item">
|
||||
<view class="flex-center flex-column c-title">
|
||||
<view class="f-lg-title text-bold">{{mineInfo.balance}}</view>
|
||||
<view class="f-lg-title text-bold">{{mineInfo.balance || 0}}</view>
|
||||
<view class="f-caption c-caption">我的余额</view>
|
||||
</view>
|
||||
</auth>
|
||||
<auth :needAuth="userInfo && !userInfo.nickName" :must="true"
|
||||
@go="$util.toCheckLogin({url:`/mine/pages/balance/index`})" class="stored-item">
|
||||
<view class="flex-center flex-column c-title">
|
||||
<view class="f-lg-title text-bold">{{mineInfo.frozen_cash}}</view>
|
||||
<view class="f-lg-title text-bold">{{mineInfo.frozen_cash || 0}}</view>
|
||||
<view class="f-caption c-caption">冻结资金</view>
|
||||
</view>
|
||||
</auth>
|
||||
<auth :needAuth="userInfo && !userInfo.nickName" :must="true"
|
||||
@go="$util.toCheckLogin({url:`/shop/pages/integral/record`})" class="stored-item">
|
||||
<view class="flex-center flex-column c-title">
|
||||
<view class="f-lg-title text-bold">{{mineInfo.integral}}</view>
|
||||
<view class="f-lg-title text-bold">{{mineInfo.integral || 0}}</view>
|
||||
<view class="f-caption c-caption">我的积分</view>
|
||||
</view>
|
||||
</auth>
|
||||
@@ -160,8 +160,8 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="mine-menu-list mt-md ml-md mr-md fill-base box-shadow radius-20"
|
||||
v-if="mineInfo.is_landlord && businessList.length > 0">
|
||||
<view class="mine-menu-list mt-md ml-md mr-md fill-base box-shadow radius-20"
|
||||
v-if="(mineInfo && mineInfo.is_landlord) && businessList.length > 0">
|
||||
<view class="common-nav-title flex-center c-title pl-lg mb-lg b-1px-b">
|
||||
<view class="f-title text-bold flex-1">商家专属</view>
|
||||
</view>
|
||||
@@ -178,7 +178,7 @@
|
||||
</block>
|
||||
|
||||
<block v-if="user_type == 2">
|
||||
<view class="mine-menu-list rel ml-md mr-md fill-base box-shadow radius-20">
|
||||
<view class="mine-menu-list rel ml-md mr-md fill-base box-shadow radius-20" v-if="orderList && orderList.length">
|
||||
<view class="cancel-auth iconfont icon-biaoqian c-warning flex-center abs"
|
||||
v-if="mineInfo.farmer_status == 3">
|
||||
<view class="text-bold f-icontext abs">取消授权</view>
|
||||
@@ -380,8 +380,7 @@
|
||||
])
|
||||
this.farmer_info = farmer_info
|
||||
let {
|
||||
farmer_status,
|
||||
fx_status
|
||||
farmer_status
|
||||
} = this.mineInfo
|
||||
this.user_type = farmer_status == 2 || farmer_status == 3 ? this.user_type : 1
|
||||
let arr = ['farmer_status', 'fx_status']
|
||||
|
||||
Reference in New Issue
Block a user