Page({
  /**
   * 页面的初始数据
   */
  data: {
    projectList:[
      {title:'测算完成'},
      {title:'勘测完成'},
      {title:'方案生成'},
      {title:'采购完成'},
      {title:'项目进行中'},
  ],
    // 储能车项目详情数据（模拟真实场景）
    projectInfo: {
      id: 1,
      name: "上海市浦东新区储能车运营及充电服务项目",
      status: "进行中",
      statusType: "ongoing",
      address: "上海市浦东新区张江高科技园区科苑路88号",
      time: "2026-01-01 至 2028-12-31",
      // 项目分成
      splitList: [
        { id: 1, role: "主导方", rate: "40%" },
        { id: 4, role: "合伙人", rate: "10%" },
        { id: 2, role: "供电方A", rate: "25%" },
        { id: 3, role: "供电方B", rate: "20%" },
        { id: 5, role: "用电方", rate: "5%" }
      ],
      // 项目主导方
      leader: {
        name: "上海电速新能源科技有限公司",
        contact: "张经理",
        phone: "13800138000",
        scope: "项目整体运营、储能车调度、客户对接"
      },
      // 供电方信息

      partners: [
        {
          id: 1,
          name: "国家电网上海电力公司",
          type: "工商业用电（峰谷平电价）",
          capacity: "500kW/h（储能容量）",
          term: "2026-01-01 至 2028-12-31"
        },
        {
          id: 2,
          name: "国家电网北京电力公司",
          type: "工商业用电（峰谷平电价）",
          capacity: "500kW/h（储能容量）",
          term: "2026-01-01 至 2028-12-31"
        }
      ],
      // 合伙人信息

      powerSupplier: {
        name: "合伙人（上海能联科技）",
        phone: "13700137000",
        investRate: "25%",
        responsibility: "储能车运输、场地租赁、后勤保障"
      },
      // 用电方信息
      powerConsumer: {
        name: "上海张江园区多家科技企业",
        scale: "日均用电约8000度",
        timePeriod: "高峰时段（9:00-18:00）为主",
        settlement: "月结，按峰谷电价结算"
      }
    }
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    // 实际项目中，从列表页传递projectId，这里根据ID请求接口获取详情
    // const projectId = options.id;
    // this.getProjectDetail(projectId);
  },

  /**
   * 模拟请求项目详情接口
   */
  getProjectDetail(projectId) {
    // 实际开发中替换为wx.request请求后端接口
    // wx.request({
    //   url: 'https://你的接口地址/project/detail',
    //   data: { id: projectId },
    //   success: (res) => {
    //     this.setData({ projectInfo: res.data });
    //   }
    // });
  }
});