<template>
  <view class="product-detail-page">
    <view class="headers">
      <headersVue headerTitle="商品详情" @headerJump="headerJump"></headersVue>
    </view>
    <view class="product-image-container">
      <image
        :src="product.imageUrl"
        mode="widthFix"
        class="product-image"
      ></image>
    </view>
    <ProductInfo :product="product" />
    <ProductSpec :product="product" />
    <DeliveryInfo :delivery="delivery" />
    <view class="merchant-code-container">
      <view class="label">商户编码</view>
      <view class="value">{{ product.merchantCode }}</view>
    </view>
    <RichTextDetail :productDetail="productDetail" />
  </view>
</template>

<script>
import ProductInfo from "./components/detail/ProductInfo.vue";
import ProductSpec from "./components/detail/ProductSpec.vue";
import DeliveryInfo from "./components/detail/DeliveryInfo.vue";
import RichTextDetail from "./components/detail/RichTextDetail.vue";
import headersVue from "../../shop/components/headers/headers.vue";
export default {
  components: {
    ProductInfo,
    ProductSpec,
    DeliveryInfo,
    RichTextDetail,
    headersVue,
  },
  data() {
    return {
      product: {
        imageUrl: "商品图片地址", // 替换为实际图片地址
        salePrice: 43.06,
        creatorProfit: 7.17,
        pension: 0,
        brand: "心相印",
        spec: "20包 (100抽/包)",
        merchantCode: "GBF1814F213",
      },
      delivery: {
        to: "全国各地",
        freeShipping: "包邮",
        minPurchase: "1",
      },
      productDetail: [], // 这里需要根据实际富文本数据格式填充，例如从接口获取
      dataList: {
        id: 6034,
        spu_id: "GBF1814F213",
        skuId_info: [
          {
            yanglaojin: 0,
            source_type: 5,
            sku_sn: "5-682-IB86BR000",
            is_overseas: 1,
            title: "DT15100心相印茶语丝享100抽*20包三层塑装纸面巾",
            lowest_num: 1,
            detail_img_list: [
              "http://image.douhuomall.com/storage/goods/0847eec46951b20badaffbc253c3304b6f763615.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/a066c4df71b5e3d64d6749019e15ae70236063f3.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/3a4c21c69f6c6497d98d43512829d6e35ca10e47.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/003d2908b9f11909872a608e5da3d97943e31a26.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/166228b1b2ef9e8c4ec17bdd9430dcfdd4018f8a.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
            ],
            retail_price: 51.48,
            factory_id: 7,
            update_time: "2025-01-18 09:46:54",
            img_url:
              "http://image.douhuomall.com/storage/goods/0847eec46951b20badaffbc253c3304b6f763615.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
            attribute_json: "20包（100抽/包）",
            market_price: 43.06,
            id: 3143121,
            detail: [
              "http://image.douhuomall.com/storage/goods/ee4f85676490bf3987b425476ddc028b5eda0dcf.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/8847192345356ff44eb653538d031be1497ae568.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/baf4a1e7758bde92bd3da5aca2c126cb6a487cb1.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/af7bbc3c1e425abe1c37a142dddf1777f8e98edf.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/909522a0048d75f0baa2419b4c8581f271d9a07a.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/6fdf404aaa829a2705016972a04809e65c99a9ed.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/8f93d917a8c582ce812fec037c85cacb2bbbc992.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/86d19192ac8740380d76d5750b16509ef5b16bf7.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/ea7e5ee6169abc6398fdfb7f955c6a7bdecc75aa.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/7bc0a59be71491d2b41d23afdd888c7bb5c763e1.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/a015b168173f1309e2942fec8d388ed327dacbec.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/8b7f165140fca81fbc116e8266c8d0bf7e998c80.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/72478e0d44a292c2c9acd7efc67615c9f6ca23c6.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/676189d67ed5d59c99049bc0fc5b05476a6f17fa.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/0807029caf4689a93a28dda0753c515c8edaa81f.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/38c59fb9ca59130eefd677a9c4ab3a8dc8ecda63.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/287a70580059c20a9d7a473a5b0af894cb7da62b.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/1ced861dbab394b007e3cb85231b4709e1958440.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/989bd3946b3559c5807c5b5583e1d95551ae3060.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/e2ee79e7291bdbbbc0418e6991838248ae9a0092.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/77c08e97b7976bb882a5067a7b44c6482326fe88.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/0bf82043625bb4b27d1d621537005c1db3d7e7ec.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/9d35b6ff8d0e0ef75762adf0ce8d3194f59d1dc6.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/e9d560d3d4b36c9c22c6ae6b41137f6503abcef7.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
              "http://image.douhuomall.com/storage/goods/afdb32dc485eb7fc334ba8df7f8605ab470c393d.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
            ],
            floor_price: 0,
            profit: 7.17,
            status: 1,
            cost_price: 35.89,
          },
        ],
        sys_id: "112",
        goods_id: "798996",
        spuId_info: {
          tag_ids: "",
          cover_url:
            "http://image.douhuomall.com/storage/goods/0847eec46951b20badaffbc253c3304b6f763615.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ",
          tag_name: "",
          limit_area: "",
          source_type: 5,
          title: "DT15100心相印茶语丝享100抽*20包三层塑装纸面巾",
          lowest_num: 1,
          detail_img_list: "",
          retail_price: 42.9,
          band_name: "心相印",
          cate_ids: "405",
          cate_name: "-家庭清洁-清洁纸品-",
          market_price: 42.9,
          is_limit_area: 0,
          limit_area_type: "",
          id: 798996,
          detail:
            "<img src='http://image.douhuomall.com/storage/goods/ee4f85676490bf3987b425476ddc028b5eda0dcf.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/8847192345356ff44eb653538d031be1497ae568.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/baf4a1e7758bde92bd3da5aca2c126cb6a487cb1.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/af7bbc3c1e425abe1c37a142dddf1777f8e98edf.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/909522a0048d75f0baa2419b4c8581f271d9a07a.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/6fdf404aaa829a2705016972a04809e65c99a9ed.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/8f93d917a8c582ce812fec037c85cacb2bbbc992.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/86d19192ac8740380d76d5750b16509ef5b16bf7.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/ea7e5ee6169abc6398fdfb7f955c6a7bdecc75aa.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/7bc0a59be71491d2b41d23afdd888c7bb5c763e1.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/a015b168173f1309e2942fec8d388ed327dacbec.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/8b7f165140fca81fbc116e8266c8d0bf7e998c80.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/72478e0d44a292c2c9acd7efc67615c9f6ca23c6.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/676189d67ed5d59c99049bc0fc5b05476a6f17fa.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/0807029caf4689a93a28dda0753c515c8edaa81f.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/38c59fb9ca59130eefd677a9c4ab3a8dc8ecda63.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/287a70580059c20a9d7a473a5b0af894cb7da62b.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/1ced861dbab394b007e3cb85231b4709e1958440.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/989bd3946b3559c5807c5b5583e1d95551ae3060.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/e2ee79e7291bdbbbc0418e6991838248ae9a0092.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/77c08e97b7976bb882a5067a7b44c6482326fe88.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/0bf82043625bb4b27d1d621537005c1db3d7e7ec.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/9d35b6ff8d0e0ef75762adf0ce8d3194f59d1dc6.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/e9d560d3d4b36c9c22c6ae6b41137f6503abcef7.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'><img src='http://image.douhuomall.com/storage/goods/afdb32dc485eb7fc334ba8df7f8605ab470c393d.jpg?XJDdKxXNTZsL8UIsYtPqSA&zZrCmUNYAk9HuhRFaxxACQ'>",
          spu_id: "GBF1814F213",
          limit_num: 0,
          is_freight: 0,
          cost_price: 34,
        },
        update_time: "2025-02-15 22:34:10",
        create_time: "2025-02-15 22:34:10",
        sku_id: "3143121",
        status: 1,
        cate_ids: "405",
        title: "DT15100心相印茶语丝享100抽*20包三层塑装纸面巾",
        cost_price: "35.89",
        market_price: "43.06",
        ot_price: "51.48",
        profit: "0.83",
        mer_profit: "7.17",
        pension: "0.00",
        cxb_cate_id: 0,
      },
    };
  },
  methods: {
    headerJump() {
      uni.redirectTo({ url: "./onlineproductselection" });
    },
  },
};
</script>
<style>
page {
  background-color: #f7f8fc;
}
</style>
<style lang="scss" scoped>
.product-detail-page {
  height: 100%;
  padding: 0 26rpx 40rpx;
  .headers {
    position: fixed;
    top: 0;
    width: 100%;
    height: 100rpx;
    box-sizing: border-box;
    z-index: 666;
  }
}
.product-image-container {
  width: 100%;
  margin-bottom: 30rpx;
  border-radius: 10rpx;
  border: 2rpx solid red;
  overflow: hidden;
  margin-top: 120rpx;
  background: #fff;
}
.product-image {
  width: 100%;
}
.merchant-code-container {
  background-color: #ffffff;
  border-radius: 10rpx;
  box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
  padding: 30rpx;
  margin-bottom: 30rpx;
}
.label {
  font-size: 28rpx;
  color: #666666;
  margin-bottom: 10rpx;
}
.value {
  font-size: 30rpx;
  color: #333333;
}
</style>