<template>
  <view class="rent-container">
    <view class="scan-area">
      <view class="tips">请扫描风扇上的二维码</view>
    </view>
  </view>
</template>

<script>
export default {
  onLoad() {
    // 直接启动扫码
    this.scanCode()
  },
  methods: {
    scanCode() {
      uni.scanCode({
        success: (res) => {
          console.log('扫码结果：', res.result)
          // TODO: 处理扫码结果，调用租借API
        },
        fail: (err) => {
          uni.showToast({
            title: '扫码失败',
            icon: 'none'
          })
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.rent-container {
  min-height: 100vh;
  background: #f5f5f5;
  
  .scan-area {
    padding: 40rpx;
    text-align: center;
    
    .tips {
      font-size: 32rpx;
      color: #333;
      margin-top: 30rpx;
    }
  }
}
</style> 