success.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view class="success">
  3. <img src="@/static/img/su2.jpg" v-if="type == 1" ref="img">
  4. <img src="@/static/img/su.jpg" v-else>
  5. <text class="name" :style="{top: -height*1.15+'rpx'}">{{ list.name }}</text>
  6. <text class="id" :style="{top: -height*1.92+'rpx'}">{{ list.id }}</text>
  7. <text class="time" :style="{top: -height*0.55+'rpx'}">{{ getTime(list.valid_time) }}</text>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. mounted() {
  13. this.height = this.$refs.img.height
  14. },
  15. data() {
  16. return {
  17. height: '',
  18. type: 1,
  19. list: {
  20. id: "9",
  21. type: "2",
  22. name: "京",
  23. idcard: "怀疑自己",
  24. phone: "快递积极",
  25. province: "安徽省",
  26. city: "铜陵市",
  27. area: "郊区",
  28. detail_address: "古茗",
  29. job: "李静",
  30. job_year: "1",
  31. uid: "33776",
  32. saver: "刺激感了",
  33. logo: "/Uploads/Picture/2021-11-17/6194a421bb357.jpg",
  34. add_time: "1637131806",
  35. status: "1",
  36. paid: "1",
  37. valid_time: "1668673114",
  38. check_time: "1637137114",
  39. pay_time: "1637131815",
  40. pay_money: "0.01",
  41. order_id: "20211117101575758703",
  42. grade: "1",
  43. grade_info: {
  44. id: "3",
  45. type: "2",
  46. year: "3",
  47. name: "3年企业会员",
  48. grade: "1",
  49. price: "0.01"
  50. }
  51. }
  52. }
  53. },
  54. methods: {
  55. //时间戳转换成时间
  56. getTime(time) {
  57. const num =13 - (time+'').length;
  58. let l = 1;//倍数
  59. for (let i = 0; i < num; i++) {
  60. l+='0';
  61. }
  62. // 重新解析为数字
  63. l = parseInt(l)
  64. const date = new Date(parseInt(time) * l);
  65. const year = date.getFullYear();
  66. const mon = date.getMonth() + 1;
  67. const day = date.getDate();
  68. const hours = date.getHours();
  69. const minu = date.getMinutes();
  70. const sec = date.getSeconds();
  71. return year + '-' + mon + '-' + day
  72. // + ' ' + hours + ':' + minu + ':' + sec;
  73. }
  74. }
  75. }
  76. </script>
  77. <style>
  78. img {
  79. width: 100%;
  80. height: 507px;
  81. }
  82. .name {
  83. position: relative;
  84. left: 35%;
  85. }
  86. .id {
  87. position: relative;
  88. left: 70%;
  89. }
  90. .time {
  91. position: relative;
  92. left: 25%;
  93. }
  94. </style>