| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397 |
- <template>
- <view class="detail-page-container">
- <!-- 1. 顶部自定义导航栏:白色背景 + 黑色文字 -->
- <view class="white-nav-section" :style="{ paddingTop: statusBarHeight + 'px' }">
- <view class="custom-nav-bar">
- <view class="back-icon" @click="goBack">
- <view class="arrow-left"></view>
- </view>
- <text class="nav-title">订单详情</text>
- <view class="placeholder-right"></view>
- </view>
- </view>
- <!-- 2. 状态横幅区域:不再包含状态栏边距 -->
- <view class="status-banner-container" :class="order.statusType" id="nav-header">
- <view class="status-banner-content">
- <view class="header-main">
- <text class="status-title">{{ order.statusName }}</text>
- <text class="status-sub">{{ statusSubText }}</text>
- </view>
- <view class="header-icon-wrap">
- <view class="status-visual-icon"></view>
- </view>
- </view>
- </view>
- <!-- 2. 主内容滚动区:计算锁定高度以支持 100% 滚动 -->
- <scroll-view scroll-y class="main-content-scroll" :style="{ height: scrollHeight }" :show-scrollbar="false">
- <view class="detail-inner-box">
- <!-- 卡片:规格清单 (支持多个型号展现) -->
- <view class="model-item-card-inner" v-for="(model, mIdx) in (order.models || [order])" :key="mIdx">
- <view class="data-group-card" :class="{ 'first-card': mIdx === 0 }">
- <view class="card-head">规格清单 #{{ mIdx + 1 }}</view>
- <view class="data-item"><text class="l">产品型号</text><text class="v bold">{{ model.type }}</text>
- </view>
- <view class="data-item"><text class="l">型号名称</text><text class="v">{{ model.typeName ||
- '铝型材主料'}}</text></view>
- <view class="data-item"><text class="l">型材材质</text><text class="v">{{ model.material ||
- '6063-T5'}}</text></view>
- <view class="line-split"></view>
- <view class="data-item"><text class="l">表面处理</text><text class="v">{{ model.surface }}</text>
- </view>
- <view class="data-item"><text class="l">包装方式</text><text class="v">{{ model.package ||
- '普通包装'}}</text></view>
- <view class="line-split"></view>
- <view class="data-item"><text class="l">订单长度</text><text class="v">{{ model.length }} mm</text>
- </view>
- <view class="data-item"><text class="l">型材壁厚</text><text class="v">{{ model.wallThickness ||
- '1.2'}} mm</text></view>
- <view class="data-item"><text class="l">需求支数</text><text class="v highlight">{{ model.count }}
- 支</text></view>
- </view>
- </view>
- <!-- 卡片:订单详情 -->
- <view class="data-group-card shadow-less">
- <view class="card-head">订单详情</view>
- <view class="data-item"><text class="l">订单单号</text><text
- class="v selectable">{{ order.orderNo }}</text></view>
- <!-- 新增:ERP单号 (特定状态下显示) -->
- <view class="data-item" v-if="[2, 3, 4].includes(order.status)">
- <text class="l">ERP 单号</text>
- <text class="v selectable erp-no">{{ order.erpNo || 'ERP' + order.orderNo.slice(-8) }}</text>
- </view>
- <view class="data-item"><text class="l">下单日期</text><text class="v">{{ order.time }}</text></view>
- <view class="data-item"><text class="l">支付方式</text><text class="v">月结扣款</text></view>
- </view>
- <!-- 底部占位 -->
- <view class="list-bottom-placeholder"></view>
- </view>
- </scroll-view>
- <!-- 3. 底部固定操作栏 -->
- <view class="detail-action-bar-fixed" id="footer-bar">
- <view class="action-btn-wrap" v-if="order.status === 1">
- <button class="action-btn cancel" @click="doCancel">撤销该订单</button>
- <button class="action-btn primary" @click="callSales">呼叫业务员</button>
- </view>
- <view class="action-btn-wrap single" v-else>
- <button class="action-btn primary" @click="goHome">再下一单</button>
- </view>
- <view class="safe-area-bottom-support"></view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- statusBarHeight: 20,
- footerHeight: 80, // px
- headerHeight: 120, // px
- order: {
- orderNo: '-',
- status: 1,
- statusName: '加载中',
- statusType: 'pending',
- models: [],
- erpNo: '',
- time: '-'
- }
- }
- },
- computed: {
- statusSubText() {
- const map = {
- pending: '您的订单已提交,正在排队等待审核...',
- process: '审核已完成,正在由相关主管签批...',
- making: '订单已入库排产,工厂正在全力生产中...',
- finish: '该订单生产已完成并正式入库。',
- expired: '该订单已由客户主动撤销。'
- };
- return map[this.order.statusType] || '订单状态更新中';
- },
- scrollHeight() {
- // 获取系统安全区域
- const info = uni.getSystemInfoSync();
- const safeBottom = info.safeAreaInsets ? info.safeAreaInsets.bottom : 0;
- // 动态计算滚动区高度:屏幕总高 - 顶部高(状态栏+导航栏+横幅) - 底部固定栏(内含安全区)
- // 顶部高度估算:statusBarHeight + 44(nav) + 120(banner)
- return `calc(100vh - ${this.statusBarHeight + 164}px - ${80 + safeBottom}px)`;
- }
- },
- onLoad(options) {
- const info = uni.getSystemInfoSync();
- this.statusBarHeight = info.statusBarHeight;
- if (options.data) {
- try {
- this.order = JSON.parse(decodeURIComponent(options.data));
- } catch (e) { console.error('Data Error'); }
- }
- },
- methods: {
- goBack() { uni.navigateBack(); },
- doCancel() {
- uni.showModal({
- title: '确认撤销',
- content: '订单撤销后将流转至已撤销状态,确定吗?',
- confirmColor: '#ff3b30',
- success: (res) => {
- if (res.confirm) {
- this.order.status = 0;
- this.order.statusName = '已撤销';
- this.order.statusType = 'expired';
- uni.showToast({ title: '撤销成功' });
- }
- }
- });
- },
- callSales() { uni.makePhoneCall({ phoneNumber: '13888888888' }); },
- goHome() { uni.reLaunch({ url: '/pages/order/index' }); }
- }
- }
- </script>
- <style scoped>
- /deep/ ::-webkit-scrollbar {
- display: none !important;
- width: 0 !important;
- height: 0 !important;
- -webkit-appearance: none;
- background: transparent;
- }
- .detail-page-container {
- width: 100vw;
- height: 100vh;
- background: #f8fbfd;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- position: relative;
- }
- .white-nav-section {
- background: #fff;
- width: 100%;
- flex-shrink: 0;
- }
- .custom-nav-bar {
- height: 44px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 30rpx;
- }
- .back-icon {
- width: 60rpx;
- height: 44px;
- display: flex;
- align-items: center;
- }
- .arrow-left {
- width: 20rpx;
- height: 20rpx;
- border-left: 4rpx solid #333;
- border-bottom: 4rpx solid #333;
- transform: rotate(45deg);
- margin-left: 10rpx;
- }
- .nav-title {
- font-size: 34rpx;
- font-weight: bold;
- color: #1a1a1a;
- }
- .placeholder-right {
- width: 60rpx;
- }
- .status-banner-container {
- color: #fff;
- flex-shrink: 0;
- }
- .status-banner-container.pending {
- background: linear-gradient(135deg, #C1001C 0%, #FF4D4F 100%);
- }
- .status-banner-container.process {
- background: linear-gradient(135deg, #FF6A00 0%, #EE0979 100%);
- }
- .status-banner-container.making {
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
- }
- .status-banner-container.finish {
- background: linear-gradient(135deg, #2af598 0%, #009efd 100%);
- }
- .status-banner-container.expired {
- background: linear-gradient(135deg, #868f96 0%, #596164 100%);
- }
- /* 状态横幅内容 */
- .status-banner-content {
- padding: 40rpx;
- padding-bottom: 60rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .header-main {
- flex: 1;
- }
- .status-title {
- font-size: 48rpx;
- font-weight: bold;
- display: block;
- margin-bottom: 12rpx;
- }
- .status-sub {
- font-size: 26rpx;
- opacity: 0.9;
- }
- .status-visual-icon {
- width: 60rpx;
- height: 60rpx;
- border: 4rpx solid rgba(255, 255, 255, 0.3);
- border-radius: 50%;
- opacity: 0.6;
- }
- /* 修正:移除负边距,并明确滚动方向 */
- .main-content-scroll {
- width: 100%;
- flex: 1;
- }
- .detail-inner-box {
- padding: 30rpx;
- padding-top: 10rpx;
- }
- .data-group-card {
- background: #fff;
- border-radius: 30rpx;
- padding: 40rpx;
- margin-bottom: 30rpx;
- box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.02);
- }
- /* 第一张卡片增加顶部间隔(红框1优化点) */
- .first-card {
- margin-top: 20rpx;
- }
- .card-head {
- font-size: 30rpx;
- font-weight: bold;
- color: #333;
- margin-bottom: 30rpx;
- border-left: 8rpx solid #C1001C;
- padding-left: 20rpx;
- }
- .line-split {
- height: 1rpx;
- background: #f5f5f5;
- margin: 24rpx 0;
- }
- .data-item {
- display: flex;
- justify-content: space-between;
- margin-bottom: 24rpx;
- font-size: 28rpx;
- align-items: center;
- }
- .l {
- color: #999;
- }
- .v {
- color: #333;
- font-weight: 500;
- }
- .v.bold {
- font-weight: bold;
- font-size: 30rpx;
- }
- .v.erp-no {
- color: #C1001C;
- font-weight: bold;
- }
- .v.highlight {
- color: #ff3b30;
- font-weight: bold;
- font-size: 34rpx;
- }
- .list-bottom-placeholder {
- height: 260rpx;
- }
- .detail-action-bar-fixed {
- position: fixed;
- bottom: 0;
- left: 0;
- right: 0;
- background: #fff;
- padding: 30rpx 40rpx;
- box-shadow: 0 -10rpx 40rpx rgba(0, 0, 0, 0.04);
- z-index: 999;
- flex-shrink: 0;
- }
- .action-btn-wrap {
- display: flex;
- gap: 24rpx;
- }
- .action-btn {
- flex: 1;
- height: 96rpx;
- border-radius: 48rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 32rpx;
- font-weight: bold;
- }
- .action-btn.primary {
- background: #C1001C;
- color: #fff;
- border: none;
- }
- .action-btn.cancel {
- background: #fff1f0;
- color: #ff3b30;
- border: 1rpx solid #ffccc7;
- font-weight: normal;
- }
- .safe-area-bottom-support {
- height: constant(safe-area-inset-bottom);
- height: env(safe-area-inset-bottom);
- }
- </style>
|