<template>
  <view class="developing-page">
    <!-- <view class="back-btn" @click="goBack">
      <text class="back-icon">←</text>
      <text class="back-text">返回</text>
    </view> -->
    <view class="content-wrapper" v-if="!webUrl">
      <view class="icon-wrapper">
        <text class="icon">🚧</text>
      </view>
      <text class="title">正在开发中</text>
      <text class="subtitle">功能即将上线，敬请期待</text>
      <view class="progress-bar">
        <view class="progress-inner"></view>
      </view>
      <text class="tip">我们正在努力为您打造更好的体验</text>
    </view>
	<web-view :src="webUrl" :update-title="false" v-else></web-view>
  </view>
</template>

<script>
export default {
  data() {
    return {
		webUrl:''
	};
  },
  onLoad() {
	  const session_key = uni.getStorageSync('session_key');
	  if(session_key){	
	   this.webUrl = `https://ai.hnyfwlw.com/?token=${session_key}`
	  }
  },
  methods: {
    goBack() {
      uni.navigateBack({
        delta: 1,
        fail: () => {
          uni.switchTab({
            url: '/pages/index/index'
          });
        }
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.developing-page {
  width: 100%;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;

  .back-btn {
    position: absolute;
    top: 100rpx;
    left: 40rpx;
    display: flex;
    align-items: center;
    padding: 16rpx 32rpx;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 40rpx;
    backdrop-filter: blur(10rpx);
	  z-index: 10;

    .back-icon {
      font-size: 36rpx;
      color: #333;
      margin-right: 8rpx;
      font-weight: bold;
    }

    .back-text {
      font-size: 28rpx;
      color: #333;
    }

    &:active {
      background: rgba(255, 255, 255, 0.35);
    }
  }

  .content-wrapper {
    background: #ffffff;
    border-radius: 32rpx;
    padding: 80rpx 60rpx;
    text-align: center;
    box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.15);

    .icon-wrapper {
      width: 200rpx;
      height: 200rpx;
      margin: 0 auto 48rpx;
      background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      animation: floatAnimation 3s ease-in-out infinite;

      .icon {
        font-size: 100rpx;
        line-height: 1;
      }
    }

    .title {
      display: block;
      font-size: 44rpx;
      font-weight: bold;
      color: #333333;
      margin-bottom: 24rpx;
      letter-spacing: 4rpx;
    }

    .subtitle {
      display: block;
      font-size: 28rpx;
      color: #666666;
      margin-bottom: 56rpx;
    }

    .progress-bar {
      width: 100%;
      height: 12rpx;
      background: #f0f0f0;
      border-radius: 6rpx;
      overflow: hidden;
      margin-bottom: 36rpx;

      .progress-inner {
        width: 65%;
        height: 100%;
        background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
        border-radius: 6rpx;
        animation: progressAnimation 2s ease-in-out infinite alternate;
      }
    }

    .tip {
      display: block;
      font-size: 24rpx;
      color: #999999;
      line-height: 1.6;
    }
  }
}

@keyframes progressAnimation {
  from {
    width: 45%;
  }
  to {
    width: 85%;
  }
}

@keyframes floatAnimation {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20rpx);
  }
}
</style>