|
@@ -1,12 +1,10 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <view class="me-page app-content" :class="{ 'me-page--app': isAppRuntime }">
|
|
|
|
|
|
|
+ <view class="me-page app-content">
|
|
|
<block v-if="isLoggedIn">
|
|
<block v-if="isLoggedIn">
|
|
|
<view class="page-hero">
|
|
<view class="page-hero">
|
|
|
- <view class="status-space" :style="statusSpaceStyle"></view>
|
|
|
|
|
-
|
|
|
|
|
<view class="hero-panel">
|
|
<view class="hero-panel">
|
|
|
<view class="profile-card">
|
|
<view class="profile-card">
|
|
|
- <view class="profile-header-row" :style="profileHeaderStyle">
|
|
|
|
|
|
|
+ <view class="profile-header-row">
|
|
|
<view class="profile-main" @click="pageTo({ url: '/admin/staff/admin' })">
|
|
<view class="profile-main" @click="pageTo({ url: '/admin/staff/admin' })">
|
|
|
<image v-if="myInfo.shopImg" class="shop-avatar" :src="myInfo.shopImg" mode="aspectFill"></image>
|
|
<image v-if="myInfo.shopImg" class="shop-avatar" :src="myInfo.shopImg" mode="aspectFill"></image>
|
|
|
<view v-else class="shop-avatar avatar-placeholder">
|
|
<view v-else class="shop-avatar avatar-placeholder">
|
|
@@ -97,7 +95,6 @@
|
|
|
<block v-else>
|
|
<block v-else>
|
|
|
<view class="guest-page">
|
|
<view class="guest-page">
|
|
|
<view class="guest-hero">
|
|
<view class="guest-hero">
|
|
|
- <view class="status-space" :style="statusSpaceStyle"></view>
|
|
|
|
|
<view class="guest-hero-inner">
|
|
<view class="guest-hero-inner">
|
|
|
<text class="guest-hero-title">我的</text>
|
|
<text class="guest-hero-title">我的</text>
|
|
|
<text class="guest-hero-desc">登录后管理门店</text>
|
|
<text class="guest-hero-desc">登录后管理门店</text>
|
|
@@ -253,56 +250,10 @@ export default {
|
|
|
const id = shopInfo.id || this.myInfo.shopId || "";
|
|
const id = shopInfo.id || this.myInfo.shopId || "";
|
|
|
return `/admin/shop/add?id=${id}`;
|
|
return `/admin/shop/add?id=${id}`;
|
|
|
},
|
|
},
|
|
|
- safeTopHeight () {
|
|
|
|
|
- if (this.isAppRuntime) {
|
|
|
|
|
- const gap = this.appTopExtraPx > 0 ? this.appTopExtraPx : uni.upx2px(23);
|
|
|
|
|
- return (this.statusBarHeight || 0) + gap;
|
|
|
|
|
- }
|
|
|
|
|
- return this.heroTopOffset > 0 ? this.heroTopOffset : this.statusBarHeight;
|
|
|
|
|
- },
|
|
|
|
|
- statusSpaceStyle () {
|
|
|
|
|
- const h = this.safeTopHeight;
|
|
|
|
|
- return {
|
|
|
|
|
- height: h + "px",
|
|
|
|
|
- minHeight: h + "px",
|
|
|
|
|
- width: "100%",
|
|
|
|
|
- flexShrink: 0
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- /** 运行到 App / 正式包均为 true;微信小程序为 false */
|
|
|
|
|
- isAppRuntime () {
|
|
|
|
|
- try {
|
|
|
|
|
- const info = uni.getSystemInfoSync();
|
|
|
|
|
- const p = String(info.uniPlatform || "").toLowerCase();
|
|
|
|
|
- if (p === "app" || p === "app-plus" || p === "app_android" || p === "app_ios") {
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
- } catch (e) { /* ignore */ }
|
|
|
|
|
- // #ifdef APP-PLUS
|
|
|
|
|
- return true;
|
|
|
|
|
- // #endif
|
|
|
|
|
- try {
|
|
|
|
|
- return typeof plus !== "undefined" && !!plus.runtime;
|
|
|
|
|
- } catch (e2) {
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- profileHeaderStyle () {
|
|
|
|
|
- const style = {};
|
|
|
|
|
- if (this.capsuleSafeRight > 0) {
|
|
|
|
|
- style.paddingRight = this.capsuleSafeRight + "px";
|
|
|
|
|
- }
|
|
|
|
|
- return style;
|
|
|
|
|
- }
|
|
|
|
|
},
|
|
},
|
|
|
data () {
|
|
data () {
|
|
|
return {
|
|
return {
|
|
|
constant: this.$constant,
|
|
constant: this.$constant,
|
|
|
- statusBarHeight: 0,
|
|
|
|
|
- heroTopOffset: 0,
|
|
|
|
|
- capsuleSafeRight: 0,
|
|
|
|
|
- /** App:状态栏下额外下移(px),onShow 里 uni.upx2px 写入 */
|
|
|
|
|
- appTopExtraPx: 0,
|
|
|
|
|
myInfo: {},
|
|
myInfo: {},
|
|
|
version: "1.0.0",
|
|
version: "1.0.0",
|
|
|
lookMoney: 0,
|
|
lookMoney: 0,
|
|
@@ -328,7 +279,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onShow () {
|
|
onShow () {
|
|
|
- this.setStatusBarHeight();
|
|
|
|
|
if (isValidLoginSession(this.getLoginInfo)) {
|
|
if (isValidLoginSession(this.getLoginInfo)) {
|
|
|
uni.removeStorageSync("manualLogout");
|
|
uni.removeStorageSync("manualLogout");
|
|
|
this.getMyInfo();
|
|
this.getMyInfo();
|
|
@@ -350,7 +300,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad () {
|
|
onLoad () {
|
|
|
- this.setStatusBarHeight();
|
|
|
|
|
// #ifdef APP-PLUS
|
|
// #ifdef APP-PLUS
|
|
|
if (plus.runtime.version) {
|
|
if (plus.runtime.version) {
|
|
|
this.version = plus.runtime.version;
|
|
this.version = plus.runtime.version;
|
|
@@ -369,35 +318,6 @@ export default {
|
|
|
goRegister () {
|
|
goRegister () {
|
|
|
this.$util.pageTo({ url: "/pagesClient/official/apply" });
|
|
this.$util.pageTo({ url: "/pagesClient/official/apply" });
|
|
|
},
|
|
},
|
|
|
- setStatusBarHeight () {
|
|
|
|
|
- try {
|
|
|
|
|
- const systemInfo = uni.getSystemInfoSync();
|
|
|
|
|
- this.statusBarHeight = systemInfo.statusBarHeight || 0;
|
|
|
|
|
- this.heroTopOffset = 0;
|
|
|
|
|
- this.capsuleSafeRight = 0;
|
|
|
|
|
- // #ifdef MP-WEIXIN
|
|
|
|
|
- const menuButton = uni.getMenuButtonBoundingClientRect();
|
|
|
|
|
- if (menuButton && menuButton.bottom) {
|
|
|
|
|
- this.heroTopOffset = menuButton.bottom + 12;
|
|
|
|
|
- }
|
|
|
|
|
- if (menuButton && menuButton.left) {
|
|
|
|
|
- this.capsuleSafeRight = systemInfo.windowWidth - menuButton.left + 8;
|
|
|
|
|
- }
|
|
|
|
|
- // #endif
|
|
|
|
|
- if (this.isAppRuntime) {
|
|
|
|
|
- // App 自定义导航:仅占状态栏 + 可调下移量(8+15=23upx,用 px 写入 data 保证运行到 App 可见)
|
|
|
|
|
- this.heroTopOffset = 0;
|
|
|
|
|
- this.appTopExtraPx = uni.upx2px(23);
|
|
|
|
|
- } else {
|
|
|
|
|
- this.appTopExtraPx = 0;
|
|
|
|
|
- }
|
|
|
|
|
- } catch (e) {
|
|
|
|
|
- this.statusBarHeight = 0;
|
|
|
|
|
- this.heroTopOffset = 0;
|
|
|
|
|
- this.capsuleSafeRight = 0;
|
|
|
|
|
- this.appTopExtraPx = 0;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
resetGuestState () {
|
|
resetGuestState () {
|
|
|
this.myInfo = {};
|
|
this.myInfo = {};
|
|
|
this.lookMoney = 0;
|
|
this.lookMoney = 0;
|
|
@@ -617,18 +537,10 @@ export default {
|
|
|
background: transparent;
|
|
background: transparent;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.status-space {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
.profile-card {
|
|
.profile-card {
|
|
|
padding: 20upx 0 0;
|
|
padding: 20upx 0 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.me-page--app .profile-card {
|
|
|
|
|
- padding-top: 8upx;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
.profile-header-row {
|
|
.profile-header-row {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
flex-direction: row;
|
|
@@ -645,10 +557,6 @@ export default {
|
|
|
margin-right: 16upx;
|
|
margin-right: 16upx;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.me-page--app .guest-hero-inner {
|
|
|
|
|
- padding-top: 16upx;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
.shop-avatar,
|
|
.shop-avatar,
|
|
|
.avatar-placeholder {
|
|
.avatar-placeholder {
|
|
|
width: 120upx;
|
|
width: 120upx;
|
|
@@ -1037,14 +945,8 @@ export default {
|
|
|
.guest-hero-inner {
|
|
.guest-hero-inner {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
z-index: 2;
|
|
z-index: 2;
|
|
|
- padding: 56upx 8upx 0;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-/* #ifdef MP-WEIXIN */
|
|
|
|
|
-.guest-hero-inner {
|
|
|
|
|
- padding-top: 16upx;
|
|
|
|
|
|
|
+ padding: 16upx 8upx 0;
|
|
|
}
|
|
}
|
|
|
-/* #endif */
|
|
|
|
|
|
|
|
|
|
.guest-hero-title {
|
|
.guest-hero-title {
|
|
|
display: block;
|
|
display: block;
|