<template>
  <view class="page-shell payment-success-page">
    <view class="page-blur"></view>
    <view class="page-blur-secondary"></view>
    <view class="page-blur-tertiary"></view>

    <view class="page-content subpage-content">
      <view class="subpage-nav">
        <view class="subpage-back" @tap="goMall">‹</view>
        <view class="subpage-title-wrap">
          <text class="subpage-title">下单成功</text>
          <text class="subpage-subtitle">订单已经妥帖收下，后续进度会继续提醒你</text>
        </view>
      </view>

      <view class="subpage-hero glass-card success-hero">
        <text class="hero-kicker">ORDER CREATED</text>
        <text class="hero-title">你的护理好物已进入订单清单</text>
        <text class="hero-desc">订单编号 {{ order.orderNo }} · {{ order.status }}</text>
      </view>

      <view class="subpage-card">
        <view class="info-list">
          <view class="info-row">
            <text class="info-label">商品名称</text>
            <text class="info-value">{{ order.title }}</text>
          </view>
          <view class="info-row">
            <text class="info-label">订单金额</text>
            <text class="info-value">¥{{ order.amount }}</text>
          </view>
          <view class="info-row">
            <text class="info-label">当前状态</text>
            <text class="info-value">{{ order.status }}</text>
          </view>
        </view>
      </view>

      <view class="cta-row">
        <view class="secondary-button" @tap="viewOrders">查看订单</view>
        <view class="primary-button" @tap="goMall">继续逛逛</view>
      </view>
    </view>
  </view>
</template>

<script>
import { findOrderById } from '@/data/mock'

export default {
  data() {
    return {
      order: findOrderById(5001)
    }
  },
  onLoad(options) {
    this.order = findOrderById(options.orderId)
  },
  methods: {
    viewOrders() {
      uni.navigateTo({ url: `/packageProfile/order-detail/order-detail?id=${this.order.id}` })
    },
    goMall() {
      uni.reLaunch({ url: '/packageMall/main/main' })
    }
  }
}
</script>

<style lang="scss" scoped>
@import '@/styles/mixins.scss';
@import '@/styles/subpage.scss';

.success-hero {
  min-height: 260rpx;
}
</style>
