synthesis.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view class="index content">
  3. <nav-header :rightIcon="false" :rightText="'合成记录'" :showright="true" @rightClick="href('/pages/collection/compound_history/compound_history')">合成藏品</nav-header>
  4. <view style="height: 100rpx;"></view>
  5. <view class="card">
  6. <view class="item" v-for="item,i in collection_list" :key="i" @click="href('/pages/collection/compound/compound?id=' + item.id)">
  7. <image :src="item.img"></image>
  8. <view class="">
  9. <view class="text_hide" style="max-width: 500rpx;">{{item.title}}</view>
  10. <view class="">
  11. <!-- <text>限量</text> -->
  12. <!-- <text>{{item.num1}}</text> -->
  13. </view>
  14. <view style="margin-top: 60rpx;">合成时间:{{item.time1}} </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="nothing" v-if="collection_list.length <= 0" style="width: 304rpx;margin: 156rpx auto 0;">
  19. <view class="">
  20. <image src="/static/shoping/8.png" mode="widthFix" style="width: 304rpx;"></image>
  21. </view>
  22. <view class="" style="text-align: center;
  23. color: #999999;
  24. font-size: 28rpx;">
  25. 暂无数据
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import navHeader from "@/components/my/nav_header.vue"
  32. export default {
  33. components:{navHeader},
  34. data() {
  35. return {
  36. collection_list:[],
  37. page:0
  38. };
  39. },
  40. onLoad() {
  41. this.getcompound();
  42. },
  43. methods:{
  44. rightClick(){
  45. },
  46. //获取合成数据
  47. getcompound() {
  48. // uni.showToast({
  49. // title: "加载中",
  50. // icon: "loading"
  51. // })
  52. this.api.compound_list(30, ++this.page).then(res => {
  53. uni.hideToast()
  54. res.data.data.forEach(ele => {
  55. this.collection_list.push({
  56. title: ele.name,
  57. id: ele.id,
  58. img: ele.cover,
  59. no: "",
  60. type: 3,
  61. time1: ele.sell_at,
  62. time2: ele.collect_time,
  63. num1: ele.num, //限量数量
  64. num2: ele.sell_num //剩余数量
  65. })
  66. })
  67. console.log(this.collection_list);
  68. })
  69. },
  70. }
  71. }
  72. </script>
  73. <style lang="less">
  74. .card{
  75. .item{
  76. margin: 20rpx auto;
  77. width: 622rpx;
  78. background: #1D1F1E;
  79. border-radius: 20rpx;
  80. display: flex;
  81. color: #fff;
  82. padding:24rpx 32rpx;
  83. image{
  84. width: 153rpx;
  85. height: 153rpx;
  86. border-radius: 20rpx;
  87. }
  88. >view:last-child {
  89. margin-left: 24rpx;
  90. >view:nth-child(2),
  91. >view:nth-child(3) {
  92. margin-top: 20rpx;
  93. }
  94. >view:nth-child(1) {
  95. font-size: 34rpx;
  96. font-weight: bold;
  97. }
  98. >view:nth-child(2) {
  99. font-size: 24rpx;
  100. >text:last-child {
  101. background: rgba(110, 77, 255, 0.0980);
  102. color: #6E4DFF;
  103. padding: 5rpx 10rpx;
  104. border-radius: 6rpx;
  105. margin-left:10rpx;
  106. }
  107. >text:first-child {
  108. background: #6E4DFF;
  109. color: #fff;
  110. padding: 5rpx 10rpx;
  111. border-radius: 6rpx;
  112. }
  113. }
  114. }
  115. view:last-child>view:nth-child(3){
  116. display: flex;
  117. // align-items: center;
  118. font-weight: 400;
  119. color: #fff;
  120. font-size: 24rpx;
  121. // padding: 10rpx 0 0 20rpx;
  122. image{
  123. width: 28rpx;
  124. height: 28rpx;
  125. // margin-right: 10rpx;
  126. }
  127. }
  128. }
  129. }
  130. </style>