resources.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <view class="content">
  3. <view class="hflex acenter jbetween">
  4. <view class="top_bg">
  5. <view class="top" @click="toRule(1)">规则</view>
  6. </view>
  7. <view class="top_bg">
  8. <view class="top" @click="toRule(2)">公约</view>
  9. </view>
  10. <view class="top_bg">
  11. <view class="top" @click="toRule(3)">供方认可机构清单</view>
  12. </view>
  13. </view>
  14. <view class="">
  15. <block v-for="(item,index) in pageList" :key="index">
  16. <view class="box">
  17. <view class="box_name">{{item.title}}</view>
  18. <view class="text_style1 text_hide">规则:{{item.c_rule}}</view>
  19. <view class="text_style1 text_hide">公约:{{item.c_conv}}</view>
  20. <view class="bottom hflex jend">
  21. <view class="btn" @click="toDetail(item.id)">查看详情</view>
  22. </view>
  23. </view>
  24. </block>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import $api from '@/static/js/api.js'
  30. var that = ''
  31. export default {
  32. data() {
  33. return {
  34. pageList: [
  35. ],
  36. page: 1,
  37. limit: 10,
  38. total: 10
  39. }
  40. },
  41. onLoad() {
  42. that = this
  43. that.getList()
  44. },
  45. onShow() {
  46. var token = uni.getStorageSync('token')
  47. if(!token) {
  48. $api.info('请先登录')
  49. setTimeout(() =>{
  50. $api.jump('/pages/login/code_login')
  51. }, 1000)
  52. }
  53. },
  54. methods: {
  55. getList() {
  56. $api.req({
  57. url: '/data/api.ResCenter/index',
  58. data: {
  59. page: that.page,
  60. limit: that.limit
  61. }
  62. }, function(res) {
  63. if(res.code == 1) {
  64. if(that.page == 1) {
  65. that.pageList = res.data.data
  66. } else {
  67. that.pageList = that.pageList.concat(res.data.data)
  68. }
  69. that.total = res.data.total
  70. }
  71. })
  72. },
  73. // 查看详情
  74. toDetail(id) {
  75. $api.jump('/page_index/pages/resources/resourDetail?id=' + id)
  76. },
  77. // 规则
  78. toRule(index) {
  79. $api.jump('/page_index/pages/resources/rule?index=' + index)
  80. },
  81. onReachBottom() {
  82. if (Number(that.page) * Number(that.limit) >= Number(that.total)) {
  83. $api.info("没有更多了")
  84. } else {
  85. that.page++
  86. that.getList()
  87. }
  88. }
  89. },
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. .content {
  94. padding: 20rpx 30rpx;
  95. background: #F4F4F4;
  96. .top_bg {
  97. height: 64rpx;
  98. box-sizing: border-box;
  99. padding: 0 60rpx;
  100. background: #506DFF;
  101. border-radius: 12rpx;
  102. .top {
  103. font-size: 26rpx;
  104. font-weight: 400;
  105. color: #FFFFFF;
  106. line-height: 64rpx;
  107. position: relative;
  108. }
  109. .top::before {
  110. position: absolute;
  111. content: "";
  112. width: 8rpx;
  113. height: 8rpx;
  114. background: #FFB33A;
  115. border-radius: 50%;
  116. top: 32rpx;
  117. left: -16rpx;
  118. }
  119. }
  120. .box {
  121. width: 100%;
  122. margin-top: 20rpx;
  123. background: #FFFFFF;
  124. border-radius: 24rpx;
  125. box-sizing: border-box;
  126. padding: 24rpx 20rpx;
  127. .box_name {
  128. font-size: 30rpx;
  129. font-weight: 500;
  130. color: #222222;
  131. line-height: 42rpx;
  132. padding-bottom: 20rpx;
  133. }
  134. .text_style1 {
  135. font-size: 20rpx;
  136. font-weight: 400;
  137. color: #999999;
  138. line-height: 28rpx;
  139. padding-bottom: 20rpx;
  140. }
  141. .bottom {
  142. width: 100%;
  143. padding: 20rpx 0 0;
  144. border-top: 1rpx solid #F4F4F4;
  145. .btn {
  146. width: 148rpx;
  147. height: 52rpx;
  148. border-radius: 28rpx;
  149. border: 1px solid #506DFF;
  150. text-align: center;
  151. line-height: 52rpx;
  152. font-size: 26rpx;
  153. font-weight: 400;
  154. color: #506DFF;
  155. }
  156. }
  157. }
  158. }
  159. </style>