history.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <view class="center">
  3. <view class="product">
  4. <image class="product-image" :src="info.image" mode=""></image>
  5. <view class="product-font font1">{{info.name}}</view>
  6. <view class="product-font font2" v-if="info.user_nickname">艺术家:{{info.user_nickname}}</view>
  7. <view class="product-font font2">{{info.create_time | time}}</view>
  8. </view>
  9. <view class="main" v-if="list.length != 0">
  10. <view class="main-item">
  11. <view class="main-left">日期</view>
  12. <view class="main-right">归属人</view>
  13. </view>
  14. <view class="main-item" v-for="(item,index) in list" :key="index">
  15. <view class="main-left">{{item.create_time | time}}</view>
  16. <view class="main-right">{{item.nickname}}</view>
  17. </view>
  18. </view>
  19. <!-- <view class="ma">
  20. <view class="ma-main">
  21. </view>
  22. <view class="ma-font">
  23. 溯源二维码
  24. </view>
  25. </view> -->
  26. </view>
  27. </template>
  28. <script>
  29. import { belong,details } from '@/api/hall.js'
  30. export default {
  31. data() {
  32. return {
  33. id:'',
  34. info:'',
  35. list:[],
  36. }
  37. },
  38. filters:{
  39. time(e){
  40. if(e){
  41. let times = e.split(" ")
  42. let years = times[0].split("-")
  43. return years[0]+'年'+years[1]+'月'+years[2]+'日'
  44. }
  45. }
  46. },
  47. onLoad(option) {
  48. this.id = option.id;
  49. this.loadData();
  50. },
  51. methods: {
  52. loadData() {
  53. belong({product_id: this.id}).then(({data}) =>{
  54. this.list = data
  55. console.log(data);
  56. details({product_id: this.id}).then(({data}) =>{
  57. this.info = data
  58. console.log(info);
  59. }).catch(e =>{
  60. })
  61. }).catch(e =>{
  62. console.log(e);
  63. })
  64. }
  65. },
  66. }
  67. </script>
  68. <style lang="scss">
  69. .center {
  70. background: #f8f8f8;
  71. height: auto;
  72. min-height: 100%;
  73. }
  74. .product {
  75. width: 670rpx;
  76. padding: 44rpx 0 40rpx 0;
  77. background: #ffffff;
  78. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  79. border-radius: 20rpx;
  80. margin: 34rpx auto 0;
  81. display: flex;
  82. flex-direction: column;
  83. align-items: center;
  84. .product-image {
  85. width: 300rpx;
  86. height: 300rpx;
  87. border-radius: 20rpx;
  88. }
  89. .product-font {
  90. font-size: 30rpx;
  91. font-family: PingFang SC;
  92. font-weight: bold;
  93. color: #1d2023;
  94. }
  95. .font1 {
  96. margin-top: 34rpx;
  97. }
  98. .font2 {
  99. margin-top: 44rpx;
  100. }
  101. }
  102. .main {
  103. width: 670rpx;
  104. background: #ffffff;
  105. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  106. border-radius: 20rpx;
  107. margin: 30rpx auto 0;
  108. .main-item:first-child {
  109. border-top: none;
  110. }
  111. .main-item {
  112. padding: 2rpx 20rpx;
  113. display: flex;
  114. align-items: center;
  115. height: 104rpx;
  116. border-top: 1px solid #dddddd;
  117. .main-left {
  118. width: 50%;
  119. text-align: center;
  120. font-size: 32rpx;
  121. font-family: PingFang SC;
  122. font-weight: bold;
  123. color: #1d2023;
  124. }
  125. .main-right {
  126. width: 50%;
  127. text-align: center;
  128. font-size: 32rpx;
  129. font-family: PingFang SC;
  130. font-weight: bold;
  131. color: #1d2023;
  132. }
  133. }
  134. }
  135. .ma {
  136. width: 670rpx;
  137. padding: 46rpx 0;
  138. background: #FFFFFF;
  139. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  140. border-radius: 20rpx;
  141. margin: 30rpx auto 0;
  142. .ma-main {
  143. width: 300rpx;
  144. height: 300rpx;
  145. margin: 0 auto;
  146. background: #000;
  147. }
  148. .ma-font {
  149. font-size: 30rpx;
  150. font-family: PingFang SC;
  151. font-weight: bold;
  152. color: #1D2023;
  153. margin-top: 34rpx;
  154. text-align: center;
  155. }
  156. }
  157. </style>