product-detail-header.js 979 Bytes
// page/subPackage/pages/zeroSell/components/product-detail-header.js

import { formatTimeByDefined } from '../../../../utils/util';
Component({
  properties: {
    product: {
      type: Object,
      observer(product) {
        const { end_time: endTime, start_time: startTime, status } = product;
        let nextActivityTime = '';
        if (status === 1 || status >=3 ) {
          nextActivityTime = `${formatTimeByDefined(
            startTime,
            'Y.M.D h:m',
          )}-${formatTimeByDefined(endTime, 'h:m')}`;
        }
        this.setData({
          nextActivityTime,
        });
      },
    },
    avatars: {
      type: Array,
    },
    shareFlag: {
      type: Boolean,
      value: false,
      observer(value) {
        this.setData({ show: value });
      },
    },
    formatTimeList: {
      type: Array,
      value: [],
    },
  },
  data: {
    show: false,
    isEnd: false,
    nextActivityTime: '',
  },
  ready() {},
  methods: {},
});