<template>
<view class="flex-col page">
  <view class="flex-col">
    <view class="flex-col">
      <view class="flex-col section">
        <view class="flex-row justify-between self-stretch group">
          <text class="font text">商品</text>
          <text class="font">详情</text>
          <text class="font text_2">推荐</text>
        </view>
        <view class="self-start section_2"></view>
      </view>
      <image
        class="image"
        :src="productObject.goodImg"
      />
    </view>
    <view class="flex-row items-center group_2">
      <view class="flex-col items-center">
        <text class="font_2">图片</text>
        <text class="mt-4 font_2">展示</text>
      </view>
      <view class="ml-2 flex-row justify-between equal-division">
        <image
          class="equal-division-item"
          :src="show1"
        />
        <image
          class="equal-division-item"
          :src="show2"
        />
        <image
          class="equal-division-item"
          :src="show3"
        />
        <image
          class="equal-division-item"
          :src="show4"
        />
        <image
          class="equal-division-item"
          :src="show3"
        />
      </view>
    </view>
    <view class="flex-col group_3">
      <view class="flex-col section_3">
        <view class="self-start group_4">
          <text class="text_3 text_5">￥</text>
          <text class="text_3 text_4">{{ productObject.price }}</text>
        </view>
        <view class="flex-row justify-between items-center self-stretch group_5">
          <text class="text_3 text_7">{{ productObject.name }}</text>
          <view class="flex-row items-center group_6">
            <image
              class="shrink-0 image_2"
              :src="denglong"
            />
            <text class="ml-4 font_3 text_3 text_6">中秋节限定</text>
          </view>
        </view>
        <view class="self-stretch divider view"></view>
        <view class="flex-col self-start group_7">
          <text class="self-stretch font_4 text_3">
            商品简介：{{ productObject.introDetail }}
            <!-- <br /> -->
          </text>
          <!-- <text class="mt-2 self-stretch font_4 text_3">发簪不仅美观大方，还有 着深厚的文化底蕴。购买体验包，</text>
          <text class="mt-2 self-start font_4 text_3">即可体验古代文化。</text> -->
        </view>
        <view class="self-stretch divider view_2"></view>
        <view class="flex-row items-center self-stretch group_8">
          <text class="font_3 text_3 text_8">商品标签:</text>
          <view class="flex-col justify-start items-center text-wrapper ml-7" v-for="(item , index) in labelList" :key="index">
            <text class="font_5 text_9">#{{ labelList[index] }}</text>
          </view>
        </view>
      </view>
      <view class="mt-12 flex-col section_4">
        <text class="self-start font text_12">用户须知</text>
        <text class="self-start font_3 text_13">1.发货后不接受退货、不接受7天无理由退货</text>
        <text class="self-start font_3 text_14">2.商品购买后无法自主退款，需联系客服进行退款处理</text>
        <text class="self-stretch font_4 text_15">
          3.定制款商品购买后不接受退货退款，包售后需要录制开箱视频，并且开箱视频需要从拆包装开始
        </text>
        <text class="self-start font_3 text_16">4.商品售罄后的款式也可以重新预定，需等待并联系客服</text>
        <text class="self-start font_3 text_17">5.定制商品的具体发货日期根据制作团队制作情况而定</text>
        <text class="self-start font_3 text_18">6.只售后邮寄破损</text>
      </view>
    </view>
  </view>
  <view class="mt-38 flex-col">
    <text class="self-start font text_19">商品详情</text>
    <view class="flex-col justify-start self-stretch section_5 mt-15">
      <view class="flex-row items-center section_6">
        <view class="flex-col items-center shrink-0">
          <image
            class="image_3"
            :src="kefu"
          />
          <text class="font_5 mt-3">客服</text>
        </view>
        <view class="ml-34 flex-row flex-1">
          <view class="flex-col justify-start items-center text-wrapper_4">
            <text class="font_6 text_20">加入购物车</text>
          </view>
          <view class="flex-col justify-start items-center text-wrapper_5 ml-9" @click="jump_buy">
            <text class="font_6">立即购买</text>
          </view>
        </view>
      </view>
    </view>
  </view>
</view>

</template>

<script setup >
import {onMounted, ref} from 'vue'
import { onLoad } from "@dcloudio/uni-app";
import denglong from '@/pages/store-home/ProductDetails/img/denglong.png';
import haibao from '@/pages/store-home/ProductDetails/img/haibao.png';
import kefu from '@/pages/store-home/ProductDetails/img/kefu.png';
import show1 from '@/pages/store-home/ProductDetails/img/show1.png';
import show2 from '@/pages/store-home/ProductDetails/img/show2.png';
import show3 from '@/pages/store-home/ProductDetails/img/show3.png';
import show4 from '@/pages/store-home/ProductDetails/img/show4.png';
import  emitter from '../../../utils/emitter'
const productObject = ref({})  //商品对象
const labelList = ref([])
//转换上一页面传来的商品
onLoad((options) => {
	 productObject.value = JSON.parse(options.info);  //将string转为objec赋值给商品对象
	 labelList.value = productObject.value.label.split(";")  //分割字符串，生成标签数组
	 labelList.value = labelList.value.filter((s)=>{  //使用filter将最后一个空值去掉
		 return s 
	 })
})
//将商品对象发送到下一个页面
const jump_buy =()=> {
	uni.navigateTo({
		url: '../../../pages/order/product-waitpay/product-waitpay?product=' + JSON.stringify(productObject.value)
	})
}
</script>

<style lang="scss" scoped>
.ml-7 {
  margin-left: 13.13rpx;
}
.mt-15 {
  margin-top: 28.13rpx;
}
.mt-3 {
  margin-top: 5.63rpx;
}
.ml-9 {
  margin-left: 16.88rpx;
}
.page {
  padding-bottom: 331.88rpx;
  background-color: #fffef8;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
}
.section {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 0 82.5rpx 15rpx;
  background-color: #a0522d;
}
.group {
  padding: 30rpx 0 11.25rpx 3.75rpx;
}
.font {
  font-size: 30rpx;
  font-family: Open Sans;
  line-height: 27.66rpx;
  color: #fffef8;
}
.text {
  line-height: 27.6rpx;
}
.text_2 {
  line-height: 27.64rpx;
}
.section_2 {
  background-color: #ffa700;
  width: 69.38rpx;
  height: 5.63rpx;
}
.image {
  margin-top: 85rpx;
  width: 100vw;
  height: 48vw;
}
.group_2 {
  margin-top: 11.25rpx;
  padding: 0 22.5rpx;
}
.font_2 {
  font-size: 30rpx;
  font-family: Open Sans;
  line-height: 35.63rpx;
  color: #000000;
}
.equal-division {
  flex: 1 1 0;
  margin-right: 11.25rpx;
}
.equal-division-item {
  border-radius: 18.75rpx;
  width: 105rpx;
  height: 91.88rpx;
}
.group_3 {
  margin-top: 22.5rpx;
}
.section_3 {
  padding-left: 18.75rpx;
  padding-top: 22.5rpx;
  background-color: #fffaf0;
  border-radius: 18.75rpx;
  border-left: solid 1.88rpx #00000033;
  border-right: solid 1.88rpx #00000033;
  border-top: solid 1.88rpx #00000033;
  border-bottom: solid 1.88rpx #00000033;
}
.group_4 {
  margin-left: 11.25rpx;
  line-height: 30.77rpx;
}
.group_5 {
  margin-top: 18.75rpx;
}
.group_6 {
  margin-right: 22.5rpx;
}
.image_2 {
  width: 33.75rpx;
  height: 33.75rpx;
}
.font_3 {
  font-size: 26.25rpx;
  font-family: Open Sans;
  line-height: 24.88rpx;
  color: #323232;
}
.divider {
  background-color: #00000033;
  height: 1.88rpx;
}
.view {
  margin-right: 37.5rpx;
  margin-top: 18.75rpx;
}
.group_7 {
  padding: 15rpx 0 11.25rpx;
  width: 734.01rpx;
}
.font_4 {
  font-size: 26.25rpx;
  font-family: Open Sans;
  line-height: 31.88rpx;
  color: #323232;
}
.text_3 {
  text-shadow: 0 1.88rpx #fffaf0, 0 -1.88rpx #fffaf0, 1.88rpx 0 #fffaf0, -1.88rpx 0 #fffaf0;
}
.text_6 {
  font-size: 28.13rpx;
  line-height: 26.03rpx;
}
.text_7 {
  color: #323232;
  font-size: 33.75rpx;
  font-family: Open Sans;
  line-height: 31.46rpx;
}
.text_4 {
  color: #ff0000;
  font-size: 45rpx;
  font-family: FangSong;
  line-height: 30.77rpx;
}
.text_5 {
  color: #ff0000;
  font-size: 26.25rpx;
  font-family: FangSong;
  line-height: 18.36rpx;
}
.view_2 {
  margin-right: 37.5rpx;
}
.group_8 {
  padding: 16.88rpx 0 22.5rpx;
}
.text_8 {
  color: #000000;
  line-height: 24.28rpx;
}
.text-wrapper {
  padding: 7.5rpx 0;
  background-color: #ffb35a;
  border-radius: 9.38rpx;
  width: 90rpx;
  height: 39.38rpx;
  border-left: solid 1.88rpx #00000033;
  border-right: solid 1.88rpx #00000033;
  border-top: solid 1.88rpx #00000033;
  border-bottom: solid 1.88rpx #00000033;
}
.font_5 {
  font-size: 22.5rpx;
  font-family: Open Sans;
  line-height: 20.72rpx;
  color: #323232;
}
.text_9 {
  line-height: 20.85rpx;
}
.text-wrapper_2 {
  padding: 7.5rpx 0;
  background-color: #ffb35a;
  border-radius: 9.38rpx;
  height: 39.38rpx;
  border-left: solid 1.88rpx #00000033;
  border-right: solid 1.88rpx #00000033;
  border-top: solid 1.88rpx #00000033;
  border-bottom: solid 1.88rpx #00000033;
}
.text_10 {
  margin: 0 7.5rpx;
}
.text_11 {
  line-height: 20.83rpx;
}
.text-wrapper_3 {
  padding: 7.5rpx 0;
  background-color: #ffb35a;
  border-radius: 9.38rpx;
  width: 105rpx;
  height: 39.38rpx;
  border-left: solid 1.88rpx #00000033;
  border-right: solid 1.88rpx #00000033;
  border-top: solid 1.88rpx #00000033;
  border-bottom: solid 1.88rpx #00000033;
}
.section_4 {
  padding: 22.5rpx 11.25rpx 37.5rpx;
  background-color: #fffaf0;
  border-radius: 18.75rpx;
  border-left: solid 1.88rpx #818181;
  border-right: solid 1.88rpx #818181;
  border-top: solid 1.88rpx #818181;
  border-bottom: solid 1.88rpx #818181;
}
.text_12 {
  color: #000000;
  line-height: 27.94rpx;
  text-decoration: underline;
}
.text_13 {
  margin-left: 11.25rpx;
  margin-top: 22.5rpx;
  line-height: 24.34rpx;
}
.text_14 {
  margin-left: 11.25rpx;
  margin-top: 22.5rpx;
}
.text_15 {
  margin: 18.75rpx 7.5rpx 0;
}
.text_16 {
  margin-left: 7.5rpx;
  margin-top: 15rpx;
  line-height: 24.96rpx;
}
.text_17 {
  margin-left: 11.25rpx;
  margin-top: 26.25rpx;
  line-height: 24.39rpx;
}
.text_18 {
  margin-left: 11.25rpx;
  margin-top: 26.25rpx;
  line-height: 24.3rpx;
}
.text_19 {
  margin-left: 15rpx;
  color: #323232;
  line-height: 27.69rpx;
}
.section_5 {
  padding: 45rpx 0 3838.13rpx;
  background-image: url('https://ide.code.fun/api/image?token=6711ccc71511d900114adddf&name=d47bc18dff7946c7b9090b5677af68d6.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
.section_6 {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15rpx 26.25rpx;
  background-color: #f8e8c1;
}
.image_3 {
  width: 46.88rpx;
  height: 46.88rpx;
}
.text-wrapper_4 {
  padding: 22.5rpx 0;
  flex: 1 1 283.13rpx;
  background-color: #ffcd46;
  border-radius: 93.75rpx;
  height: 71.25rpx;
}
.font_6 {
  font-size: 30rpx;
  font-family: Open Sans;
  line-height: 27.66rpx;
  color: #ffffff;
}
.text_20 {
  line-height: 27.79rpx;
}
.text-wrapper_5 {
  padding: 22.5rpx 0;
  flex: 1 1 283.13rpx;
  background-color: #ff2d3d;
  border-radius: 93.75rpx;
  height: 71.25rpx;
}
	@import url(../../../common/css/global.css);
</style>