<template>
  <view class="production-traceability-page">
    <!-- 顶部导航栏 -->
    <uni-nav-bar
      fixed="true"
      statusBar="true"
      left-icon="back"
      title="质检溯源"
      background-color="#fff"
      color="#000"
      @clickLeft="handleBack"
    ></uni-nav-bar>
    
    <!-- 主内容区 -->
    <view class="content-wrapper">
      <!-- 编辑中标签 -->
      <view class="edit-tag">编辑中</view>
      
      <!-- 产品图片区域 -->
      <view class="product-image-section">
		  <view class="product-title">
			质检溯源
		  </view>
			<image class="product-image" :src="productImageSrc" mode="aspectFit"></image>
      </view>
      
      <!-- 质检信息列表 -->
      <view class="info-list">
		  <!-- 质检详情标题 -->
		  <view class="info-title">
		    <text>质检详情</text>
		  </view>
        <view class="info-item">
          <text class="info-label">检测依据:</text>
          <text class="info-value">《中国药典》2020年版</text>
        </view>
        <view class="images-section">
          <text class="section-subtitle">报告单:</text>
          <view class="images-grid">
            <image class="detail-image" :src="detailImageSrc" mode="aspectFill"></image>
          </view>
        </view>
      </view>
      
      <!-- 底部装饰 -->
   <!--   <view class="bottom-decoration">
        <image :src="waveIconSrc" mode="aspectFill"></image>
      </view> -->
      
      <!-- 返回首页按钮 -->
  <!--    <view class="home-button" @click="goToHome">
        <image class="home-icon" :src="homeIconSrc" mode="aspectFit"></image>
      </view> -->
    </view>
  </view>
</template>
 
<script>
export default {
  data() {
    return {
      // 使用项目中已有的图标路径
      waveIconSrc: '/static/svg-icons/wave.svg',
	  detailImageSrc: '/static/product/1.svg',
      homeIconSrc: '/static/tab/home.png',
	   productImageSrc: '/static/product/1.svg',
    };
  },
  methods: {
    handleBack() {
      // 返回上一页
      uni.navigateBack();
    },
    goToHome() {
      // 返回首页
      uni.switchTab({
        url: '/pages/home/home'
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.production-traceability-page {
  background-color: #fff;
  min-height: 100vh;
  background-image: url('/static/svg-icons/bg-pattern.svg');
  background-size: cover;
  background-position: center;
}

.content-wrapper {
  padding: 60rpx 40rpx 60rpx;
  position: relative;
}

.edit-tag {
  position: absolute;
  top: 80rpx;
  left: 0;
  width: 160rpx;
  height: 60rpx;
  background: linear-gradient(135deg, #ff6b6b, #ff8e53);
  color: #fff;
  text-align: center;
  line-height: 60rpx;
  font-size: 26rpx;
  border-radius: 0 30rpx 30rpx 0;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.product-image-section {
  display: flex;
  justify-content: center;
  margin-bottom: 40rpx;
  background-color: #fff;
  padding: 40rpx;
  border-radius: 20rpx;
  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  border: 2rpx solid #ffe6e6;
  position: relative;
}

.product-title {
	position: absolute;
	font-size: 32rpx;
	font-weight: bold;
	color: #fff;
	text-align: center;
	margin-bottom: 20rpx;
	padding: 10rpx 40rpx;
	background: #bd0402;
	border-radius: 10rpx;
	box-shadow: 0 2rpx 8rpx rgba(255, 107, 107, 0.3);
	top: -20rpx;
}

.info-title {
  position: absolute;
  top: -20rpx;
  left: 35%;
  background-color: #bd0402;
  color: #fff;
  text-align: center;
  padding: 10rpx 40rpx;
  margin-bottom: 30rpx;
  border-radius: 10rpx;
  font-size: 32rpx;
  font-weight: bold;
}

.info-list {
  background-color: #fff;
  border-radius: 20rpx;
  padding: 30rpx;
  margin-bottom: 30rpx;
  box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  border: 2rpx solid #ffe6e6;
  position: relative;
  padding-top: 56rpx;
}

.info-item {
  display: flex;
  align-items: flex-start;
  padding: 20rpx 0;
  border-bottom: 1rpx solid #f0f0f0;
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 28rpx;
  color: #bd0402;
  margin-right: 10rpx;
  flex: 1;
  font-weight: 500;
}

.info-value {
  font-size: 28rpx;
  color: #333;
  flex: 2;
}

.bottom-decoration {
  width: 100%;
  height: 100rpx;
  overflow: hidden;
  margin-top: 40rpx;
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: -1;
}

.bottom-decoration image {
  width: 100%;
  height: 100%;
}

.images-section {
  // background-color: #fff;
  // border-radius: 20rpx;
  padding: 20rpx 0;
  // margin-bottom: 60rpx;
  // box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
}

.section-subtitle {
  font-size: 28rpx;
  color: #bd0402;
  margin-bottom: 20rpx;
  display: block;
}

.images-grid {
  display: flex;
  flex-direction: column;
  gap: 20rpx;
}

.detail-image {
  width: 100%;
  height: 400rpx;
  border-radius: 10rpx;
}

.home-button {
  position: fixed;
  bottom: 60rpx;
  right: 60rpx;
  width: 100rpx;
  height: 100rpx;
  background-color: #bd0402;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4rpx 20rpx rgba(189, 4, 2, 0.4);
  z-index: 20;
}

.home-icon {
  width: 60rpx;
  height: 60rpx;
}
</style>
