index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view class="content">
  3. <view class="self-title-box">
  4. <!-- <image src="/static/rect-icon.png" mode="aspectFill"></image> -->
  5. <view class="history-font" @tap="linkToChart()">历史面试记录</view>
  6. </view>
  7. <view class="list-box">
  8. <view v-for="(item, index) in postList" :key="index" class="flex-between" @click="goDetail(item)">
  9. <view>
  10. <image src="/static/require-icon.png" mode="aspectFill"></image>
  11. <text style="font-size: 28rpx;">{{item.postType}}</text>
  12. </view>
  13. <text>{{item.time}}</text>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. industryArray: [{
  23. name: "软件开发",
  24. value: 1
  25. }, {
  26. name: "广告",
  27. value: 2
  28. }, {
  29. name: "金融",
  30. value: 3
  31. }], //三个测试岗位 1-技术,2-测试,3-设计师
  32. positionArray: [{
  33. name: "技术",
  34. value: 1
  35. }, {
  36. name: "测试",
  37. value: 2
  38. }, {
  39. name: "设计师",
  40. value: 3
  41. }], //三个测试岗位 1-技术,2-测试,3-设计师
  42. postList: [
  43. ]
  44. };
  45. },
  46. mounted() {
  47. let that = this;
  48. uni.request({
  49. url: getApp().globalData.services.getInterviewHistory, //需要设置为全局
  50. method: 'POST',
  51. header: {
  52. 'content-type': 'application/x-www-form-urlencoded'
  53. },
  54. data: {
  55. accesstoken: that.$store.state._token,
  56. jwtcode: that.$store.state._jwtcode,
  57. },
  58. success: ({
  59. data: {
  60. errmsg,
  61. data
  62. }
  63. }) => {
  64. if (errmsg === "OK") {
  65. that.postList = data.map(item => ({
  66. interviewid:item.id,
  67. postType: `${that.positionArray[item.position].name} ---- ${that.industryArray[item.industry].name}`,
  68. time: that.createrTime(item.addtime)
  69. }))
  70. }
  71. }
  72. });
  73. },
  74. onLoad() {},
  75. onShow() {},
  76. methods: {
  77. goDetail(item) {
  78. uni.navigateTo({
  79. url: `../historyDetail/index?interviewid=${item.interviewid}`
  80. })
  81. },
  82. createrTime(timestamp) {
  83. if (!timestamp) return "";
  84. // 时间戳
  85. // 此处时间戳以毫秒为单位
  86. let date = new Date(parseInt(timestamp) * 1000);
  87. let Year = date.getFullYear();
  88. let Moth = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
  89. let Day = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate());
  90. let Hour = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours());
  91. let Minute = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
  92. let Sechond = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
  93. let GMT = Year + '-' + Moth + '-' + Day + ' ' + Hour + ':' + Minute + ':' + Sechond;
  94. return GMT;
  95. },
  96. linkToChart(){
  97. uni.navigateBack()
  98. }
  99. }
  100. };
  101. </script>
  102. <style lang="scss" scoped>
  103. .content {
  104. overflow: hidden;
  105. .self-title-box {
  106. margin: 10% 0 5% 3%;
  107. image {
  108. width: 6rpx;
  109. height: 32rpx;
  110. margin-right: 2%;
  111. }
  112. }
  113. .flex-between {
  114. display: flex;
  115. align-items: center;
  116. justify-content: space-between;
  117. border-bottom: 1px solid #d3d3d3;
  118. padding: 5% 3% 5% 3%;
  119. image {
  120. width: 15rpx;
  121. height: 15rpx;
  122. margin-right: 2%;
  123. }
  124. ;
  125. view {
  126. width: 60%;
  127. }
  128. ;
  129. text {
  130. font-size: 26rpx;
  131. color: #555;
  132. }
  133. }
  134. }
  135. </style>