passonhistory.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <template>
  2. <view class="container index">
  3. <nav-header>转赠记录</nav-header>
  4. <view class="">
  5. <u-tabs :activeStyle="{color:'#fff'}" :lineColor="'#fff'" :inactiveStyle="{color:'#999'}"
  6. :list="list1" @click="click" :scrollable="false"></u-tabs>
  7. <!-- 列表内容 -->
  8. <view class="content">
  9. <scroll-view scroll-y="true" @scrolltolower="lower" style="height: 100vh;">
  10. <view class="item" v-for="(item,index) in list" :key="index">
  11. <view class="">
  12. {{item.uuid== uuid?'转出':'转入'}}"{{item.goods_name}}"
  13. </view>
  14. <view class="">
  15. <view class="">
  16. {{item.uuid== uuid?'接受':'转出'}}者
  17. </view>
  18. <view class="">
  19. {{item.user_name}}
  20. </view>
  21. </view>
  22. <view class="">
  23. <view class="">
  24. 交易时间
  25. </view>
  26. <view class="">
  27. {{item.time}}
  28. </view>
  29. </view>
  30. <view class="">
  31. <view class="">
  32. 交易HASH
  33. </view>
  34. <view class="text_hide" style="width: 300rpx;">
  35. {{item.hash || "暂无"}}
  36. </view>
  37. <view class="">
  38. <image src="/static/index/10.png" mode="widthFix" style="width: 28rpx;"
  39. @click="$api.setclip(item.hash)"></image>
  40. </view>
  41. </view>
  42. <view class="">
  43. <view class="">
  44. 藏品编号
  45. </view>
  46. <view class="">
  47. {{item.no || "暂无"}}
  48. </view>
  49. <view class="">
  50. <image src="/static/index/10.png" mode="widthFix" style="width: 28rpx;"
  51. @click="$api.setclip(item.no)"></image>
  52. </view>
  53. </view>
  54. <image :src="item.img" mode=""
  55. style="width: 140rpx;height:140rpx;position: absolute;right: 0;z-index: 99;"></image>
  56. </view>
  57. </scroll-view>
  58. </view>
  59. <!-- 列表内容 结束-->
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. import navHeader from "@/components/my/nav_header.vue"
  65. export default {
  66. components: {
  67. navHeader
  68. },
  69. data() {
  70. return {
  71. list1: [{
  72. name: '全部',
  73. }, {
  74. name: '转出',
  75. }, {
  76. name: '转入'
  77. }],
  78. uuid: '',
  79. list: [], //数据列表
  80. page: 0,
  81. j: 0
  82. }
  83. },
  84. onLoad() {
  85. //获取个人id 判断转出还是转入
  86. this.uuid = uni.getStorageSync("user_info").id;
  87. this.init()
  88. this.get_increase_all()
  89. },
  90. // onReachBottom() {
  91. // if (this.j == 0) {
  92. // this.get_increase_all()
  93. // } else if (this.j == 1) {
  94. // this.get_out()
  95. // } else if (this.j == 2) {
  96. // this.get_receive()
  97. // }
  98. // },
  99. methods: {
  100. lower() {
  101. if (this.j == 0) {
  102. this.get_increase_all()
  103. } else if (this.j == 1) {
  104. this.get_out()
  105. } else if (this.j == 2) {
  106. this.get_receive()
  107. }
  108. },
  109. click(e) {
  110. this.j = e.index
  111. this.init()
  112. if (e.index == 0) {
  113. this.get_increase_all()
  114. } else if (e.index == 1) {
  115. this.get_out()
  116. } else if (e.index == 2) {
  117. this.get_receive()
  118. }
  119. },
  120. init() {
  121. this.list = []
  122. this.page = 0
  123. },
  124. get_increase_all() {
  125. uni.showToast({
  126. title: "加载中",
  127. icon: "loading"
  128. })
  129. //type1 转入 type2转出
  130. this.api.get_increase_all(30, ++this.page).then(res => {
  131. uni.hideToast()
  132. res.data.data.forEach(ele => {
  133. this.list.push({
  134. goods_name: ele.name,
  135. user_name: ele.nickname,
  136. time: ele.create_at,
  137. hash: ele.hash,
  138. type: ele.status,
  139. uuid: ele.uuid,
  140. img: ele.img,
  141. no: ele.order_no
  142. })
  143. })
  144. console.log(this.list)
  145. })
  146. },
  147. get_out() { //转出
  148. uni.showToast({
  149. title: "加载中",
  150. icon: "loading"
  151. })
  152. //type1 转入 type2转出
  153. this.api.get_increase_all(30, ++this.page, 2).then(res => {
  154. uni.hideToast()
  155. res.data.data.forEach(ele => {
  156. this.list.push({
  157. goods_name: ele.name,
  158. user_name: ele.nickname,
  159. time: ele.create_at,
  160. hash: ele.hash,
  161. type: ele.status,
  162. uuid: ele.uuid,
  163. img: ele.img,
  164. no: ele.order_no
  165. })
  166. })
  167. console.log(this.list)
  168. })
  169. },
  170. get_receive() { //转入
  171. uni.showToast({
  172. title: "加载中",
  173. icon: "loading"
  174. })
  175. //type1 转入 type2转出
  176. this.api.get_increase_all(30, ++this.page, 1).then(res => {
  177. uni.hideToast()
  178. res.data.data.forEach(ele => {
  179. this.list.push({
  180. goods_name: ele.name,
  181. user_name: ele.nickname,
  182. time: ele.create_at,
  183. hash: ele.hash,
  184. type: ele.status,
  185. uuid: ele.uuid,
  186. img: ele.img,
  187. no: ele.order_no
  188. })
  189. })
  190. console.log(this.list)
  191. })
  192. },
  193. }
  194. }
  195. </script>
  196. <style scoped>
  197. .index {
  198. box-sizing: border-box;
  199. padding-top: 100rpx;
  200. }
  201. .content {
  202. margin: 0 auto;
  203. }
  204. .item {
  205. width: 710rpx;
  206. height: 310rpx;
  207. margin: 24rpx auto;
  208. background: #fff;
  209. display: flex;
  210. flex-direction: column;
  211. justify-content: space-between;
  212. box-sizing: border-box;
  213. padding-top: 24rpx;
  214. /* padding-bottom: 32rpx; */
  215. padding-left: 30rpx;
  216. padding-right: 20rpx;
  217. font-size: 28rpx;
  218. color: #999;
  219. position: relative;
  220. padding-bottom: 30rpx;
  221. }
  222. .item view {
  223. display: flex;
  224. }
  225. .item>view>view:first-child {
  226. width: 170rpx;
  227. }
  228. .item>view>view:nth-child(3) {
  229. margin-left: auto;
  230. }
  231. .item>view:first-child {
  232. font-size: 36rpx;
  233. color: #000;
  234. }
  235. /deep/ .u-sticky__content {
  236. background-color: #F5F5F5 !important;
  237. }
  238. </style>