history.vue 3.4 KB

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