index.js 422 B

1234567891011121314151617
  1. var timeFormat = require("../../utils/timeFormat");
  2. Component({
  3. properties: {
  4. item: {
  5. type: Object,
  6. observer: function (val) {
  7. var obj = val;
  8. var cTime = obj.createTime;
  9. null === cTime ? cTime = (0, timeFormat.formatYMD)(new Date()) : cTime = (0,
  10. timeFormat.formatYMD)(new Date(parseInt(cTime))), this.setData({
  11. item: obj
  12. });
  13. }
  14. }
  15. }
  16. });