resources.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <view class="content">
  3. <view class="hflex acenter jbetween fixed">
  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="" style="margin-top: 64rpx;">
  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/password_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. var token = uni.getStorageSync('token')
  76. if(!token) {
  77. $api.info('请先登录')
  78. setTimeout(() =>{
  79. $api.jump('/pages/login/password_login')
  80. }, 1000)
  81. } else {
  82. $api.jump('/page_index/pages/resources/resourDetail?id=' + id)
  83. }
  84. },
  85. // 规则
  86. toRule(index) {
  87. var token = uni.getStorageSync('token')
  88. if(!token) {
  89. $api.info('请先登录')
  90. setTimeout(() =>{
  91. $api.jump('/pages/login/password_login')
  92. }, 1000)
  93. } else {
  94. $api.jump('/page_index/pages/resources/rule?index=' + index)
  95. }
  96. },
  97. onReachBottom() {
  98. if (Number(that.page) * Number(that.limit) >= Number(that.total)) {
  99. $api.info("没有更多了")
  100. } else {
  101. that.page++
  102. that.getList()
  103. }
  104. }
  105. },
  106. }
  107. </script>
  108. <style lang="scss" scoped>
  109. .content {
  110. padding: 20rpx 30rpx;
  111. background: #F4F4F4;
  112. .fixed {
  113. position: fixed;
  114. }
  115. .top_bg {
  116. margin: 0 10rpx 0 0;
  117. height: 64rpx;
  118. box-sizing: border-box;
  119. padding: 0 60rpx;
  120. background: #506DFF;
  121. border-radius: 12rpx;
  122. .top {
  123. font-size: 26rpx;
  124. font-weight: 400;
  125. color: #FFFFFF;
  126. line-height: 64rpx;
  127. position: relative;
  128. }
  129. .top::before {
  130. position: absolute;
  131. content: "";
  132. width: 8rpx;
  133. height: 8rpx;
  134. background: #FFB33A;
  135. border-radius: 50%;
  136. top: 32rpx;
  137. left: -16rpx;
  138. }
  139. }
  140. .box {
  141. width: 100%;
  142. margin-top: 20rpx;
  143. background: #FFFFFF;
  144. border-radius: 24rpx;
  145. box-sizing: border-box;
  146. padding: 24rpx 20rpx;
  147. .box_name {
  148. font-size: 30rpx;
  149. font-weight: 500;
  150. color: #222222;
  151. line-height: 42rpx;
  152. padding-bottom: 20rpx;
  153. }
  154. .text_style1 {
  155. font-size: 20rpx;
  156. font-weight: 400;
  157. color: #999999;
  158. line-height: 28rpx;
  159. padding-bottom: 20rpx;
  160. }
  161. .bottom {
  162. width: 100%;
  163. padding: 20rpx 0 0;
  164. border-top: 1rpx solid #F4F4F4;
  165. .btn {
  166. width: 148rpx;
  167. height: 52rpx;
  168. border-radius: 28rpx;
  169. border: 1px solid #506DFF;
  170. text-align: center;
  171. line-height: 52rpx;
  172. font-size: 26rpx;
  173. font-weight: 400;
  174. color: #506DFF;
  175. }
  176. }
  177. }
  178. }
  179. </style>