shish hai 2 meses
pai
achega
763eb7a679

+ 54 - 1
hdApp/src/admin/home/components/purchase-ghs-panel.vue

@@ -5,6 +5,14 @@
           <view class="profile-section">
             <image class="workbench-header-bg" :src="constant.hostUrl + '/image//workbench-header-bg.webp'" mode="aspectFill"></image>
             <view class="status-safe-area" :style="{ height: statusBarHeight + 'px' }"></view>
+            <view
+              v-if="showNavBack"
+              class="nav-back-btn"
+              :style="navBackStyle"
+              @click.stop="goBack"
+            >
+              <text class="nav-back-label">返回</text>
+            </view>
             <view class="custom-nav" @click="pageTo({ url: '/admin/home/edit' })">
               <text class="custom-nav-title">{{ workbenchTitle }}</text>
             </view>
@@ -232,7 +240,8 @@ import { iconSrc } from "@/utils/iconSrc";
 export default {
   name: "PurchaseGhsPanel",
   props: {
-    statusBarHeight: { type: Number, default: 0 }
+    statusBarHeight: { type: Number, default: 0 },
+    showNavBack: { type: Boolean, default: false }
   },
   data() {
     return {
@@ -269,6 +278,18 @@ export default {
       if (!this.supplierSearchTime) return false;
       const twoDays = 2 * 24 * 60 * 60 * 1000;
       return (Date.now() - this.supplierSearchTime) < twoDays;
+    },
+    navBackStyle() {
+      if (!this.showNavBack) {
+        return {};
+      }
+      const safeH = this.statusBarHeight || 0;
+      const titleCenterPx = safeH + uni.upx2px(145 / 2);
+      const backHeightPx = uni.upx2px(56);
+      const topPx = titleCenterPx - uni.upx2px(10) - backHeightPx / 2;
+      return {
+        top: topPx + "px"
+      };
     }
   },
   beforeDestroy() {
@@ -276,6 +297,9 @@ export default {
   },
   methods: {
     iconSrc,
+    goBack() {
+      uni.navigateBack({ delta: 1 });
+    },
     handlePageLoad() {},
     handlePageUnload() {},
     handlePageShow() {
@@ -763,6 +787,35 @@ export default {
   z-index: 2;
 }
 
+.nav-back-btn {
+  position: absolute;
+  left: 16upx;
+  z-index: 12;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  height: 56upx;
+  padding: 0 18upx 0 12upx;
+  border-radius: 999upx;
+  background: rgba(255, 255, 255, 0.88);
+  box-shadow: 0 4upx 14upx rgba(24, 37, 30, 0.1);
+}
+
+.nav-back-arrow {
+  font-size: 44upx;
+  line-height: 1;
+  color: #161819;
+  font-weight: 700;
+  margin-right: 2upx;
+}
+
+.nav-back-label {
+  font-size: 28upx;
+  line-height: 1;
+  color: #161819;
+  font-weight: 600;
+}
+
 .custom-nav {
   position: relative;
   height: 145upx;

+ 1 - 1
hdApp/src/pagesPurchase/order.vue

@@ -1,6 +1,6 @@
 <template>
   <view>
-    <purchase-ghs-panel ref="ghsPanel" :statusBarHeight="statusBarHeight" />
+    <purchase-ghs-panel ref="ghsPanel" :statusBarHeight="statusBarHeight" :showNavBack="true" />
   </view>
 </template>