indexContent.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <view class="list-content-wrap">
  3. <view class="top-box">
  4. <text style="margin-right:20rpx">{{num}}品种</text>
  5. <text>{{time}}</text>
  6. </view>
  7. <view class="list-wrap">
  8. <view class="flex item" v-for="item in list" :key="item.classify_name">
  9. <view class="label">{{item.classify_name}}</view>
  10. <view style="flex:1">
  11. <view
  12. class="opt"
  13. v-for="_item in item.items"
  14. :key="_item.classify_type"
  15. @click="goDetail(_item,item)"
  16. >{{_item.classify_type}}</view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="empty-box" v-if="!list||list.length===0">
  21. <image
  22. :src="globalImgUrls.chartEmpty"
  23. mode="widthFix"
  24. />
  25. <view>无数据~</view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. const dayjs=require('@/utils/dayjs.min')
  31. export default {
  32. name:'IndexContent',
  33. props:{
  34. time:{
  35. default:''
  36. },
  37. num:{
  38. default:''
  39. },
  40. list:{
  41. default:null
  42. },
  43. exchange:{
  44. default:''
  45. }
  46. },
  47. methods: {
  48. goDetail(_item,item){
  49. const queryObj={
  50. classify_name:item.classify_name,
  51. classify_type:_item.classify_type,
  52. exchange:this.exchange
  53. }
  54. let queryObjStr=''
  55. for (const key in queryObj) {
  56. if(!queryObjStr){
  57. queryObjStr=`${key}=${queryObj[key]}`
  58. }else{
  59. queryObjStr=`${queryObjStr}&${key}=${queryObj[key]}`
  60. }
  61. }
  62. uni.navigateTo({
  63. url: `/pages/positionAnalysis/detail?${queryObjStr}`,
  64. success: (result) => {},
  65. fail: () => {},
  66. complete: () => {}
  67. });
  68. }
  69. },
  70. }
  71. </script>
  72. <style lang="scss" scoped>
  73. .list-content-wrap{
  74. .top-box{
  75. background: rgba(207, 192, 159, 0.1);
  76. padding: 15rpx 45rpx;
  77. }
  78. .list-wrap{
  79. padding: 34rpx 0 34rpx 34rpx;
  80. .item{
  81. margin-bottom: 40rpx;
  82. .label{
  83. color: #666;
  84. width: 150rpx;
  85. padding-top: 15rpx;
  86. }
  87. .opt{
  88. padding: 15rpx 10rpx;
  89. width: 28%;
  90. text-align: center;
  91. display: inline-block;
  92. margin-right: 20rpx;
  93. margin-bottom: 20rpx;
  94. background: #F5EFE2;
  95. font-size: 24rpx;
  96. }
  97. }
  98. }
  99. }
  100. .empty-box{
  101. text-align: center;
  102. font-size: 32rpx;
  103. color: #999;
  104. padding-top: 150rpx;
  105. image{
  106. width: 346rpx;
  107. margin-bottom: 57rpx;
  108. }
  109. }
  110. </style>