|
|
@@ -84,24 +84,27 @@
|
|
|
<button class="btn-logistics" @click="viewLogistics">查看物流</button>
|
|
|
</view>
|
|
|
|
|
|
- <view class="bottom-actions" v-if="order.status">
|
|
|
- <button v-if="order.status === 'pending'" class="btn-cancel" @click="onCancel">取消订单</button>
|
|
|
- <button v-if="order.status === 'pending'" class="btn-pay" @click="onPay">立即支付</button>
|
|
|
- <button v-if="order.status === 'shipped'" class="btn-confirm-receive" @click="onConfirmReceive">确认收货</button>
|
|
|
- <button v-if="order.status === 'paid' || order.status === 'shipped' || order.status === 'pending_receipt'" class="btn-after-sales" @click="onApplyAfterSales">申请售后</button>
|
|
|
- <button v-if="order.status === 'completed'" class="btn-buy-again" @click="onBuyAgain">再次购买</button>
|
|
|
- <button v-if="order.status === 'completed' || order.status === 'refunding' || order.status === 'refunded'" class="btn-after-sales" @click="onAfterSales">售后记录</button>
|
|
|
- </view>
|
|
|
</scroll-view>
|
|
|
<view v-else class="empty-wrap">
|
|
|
<text class="empty-text">订单不存在</text>
|
|
|
</view>
|
|
|
+
|
|
|
+ <!-- 底部操作栏:必须与 scroll-view 平级,否则 iOS 上 position: fixed 在 scroll-view 内不生效(按钮不显示) -->
|
|
|
+ <view class="bottom-actions" v-if="!loading && order.id && order.status">
|
|
|
+ <button v-if="order.status === 'pending'" class="btn-cancel" @click="onCancel">取消订单</button>
|
|
|
+ <button v-if="order.status === 'pending'" class="btn-pay" @click="onPay">立即支付</button>
|
|
|
+ <button v-if="order.status === 'shipped'" class="btn-confirm-receive" @click="onConfirmReceive">确认收货</button>
|
|
|
+ <button v-if="order.status === 'paid' || order.status === 'shipped' || order.status === 'pending_receipt'" class="btn-after-sales" @click="onApplyAfterSales">申请售后</button>
|
|
|
+ <button v-if="order.status === 'completed'" class="btn-buy-again" @click="onBuyAgain">再次购买</button>
|
|
|
+ <button v-if="order.status === 'completed' || order.status === 'refunding' || order.status === 'refunded'" class="btn-after-sales" @click="onAfterSales">售后记录</button>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { productOrderDetail, productOrderConfirm, productOrderCancel } from '@/utils/api.js'
|
|
|
import config from '@/config.js'
|
|
|
+import { parseDate } from '@/utils/format.js'
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -240,7 +243,8 @@ export default {
|
|
|
},
|
|
|
formatTime(time) {
|
|
|
if (!time) return ''
|
|
|
- const d = new Date(time)
|
|
|
+ const d = parseDate(time)
|
|
|
+ if (!d) return ''
|
|
|
return d.getFullYear() + '-' + String(d.getMonth() + 1).padStart(2, '0') + '-' + String(d.getDate()).padStart(2, '0') + ' ' + String(d.getHours()).padStart(2, '0') + ':' + String(d.getMinutes()).padStart(2, '0')
|
|
|
},
|
|
|
formatPriceWithSymbol(price) {
|
|
|
@@ -272,6 +276,7 @@ export default {
|
|
|
}
|
|
|
.content {
|
|
|
height: calc(100vh - 120rpx);
|
|
|
+ padding-bottom: 120rpx;
|
|
|
}
|
|
|
.order-status-section {
|
|
|
padding: 40rpx 30rpx;
|