list.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <view class="list">
  3. <view class="top flex">
  4. <image src="../../static/img/002.png" mode="aspectFill"></image>
  5. <view class="font">
  6. <view class="china-font">温岭市红十字会</view>
  7. <!-- <view class="english-font">Red Cross Society of China Wen Ling Branch</view> -->
  8. </view>
  9. </view>
  10. <image src="../../static/images/listtop.jpg" mode="" class="list-top"></image>
  11. <template v-if="cid == 11">
  12. <view class="order-item" @click="ToDetail(1)">
  13. <view class="list-cell">
  14. <image class="image" src="../../static/img/personal.jpg"></image>
  15. <view class="list-tpl">个人会员报名</view>
  16. </view>
  17. </view>
  18. <view class="order-item" @click="ToDetail(2)">
  19. <view class="list-cell">
  20. <image class="image" src="../../static/img/group.jpg"></image>
  21. <view class="list-tpl">团队会员报名</view>
  22. </view>
  23. </view>
  24. </template>
  25. <template v-if="cid == 12">
  26. <view class="order-item" @click="ToDetail(3)">
  27. <view class="list-cell">
  28. <image class="image" src="../../static/img/zffw.jpg"></image>
  29. <view class="list-tpl">志愿服务报名</view>
  30. </view>
  31. </view>
  32. </template>
  33. <template v-if="cid != 11 && cid != 12">
  34. <empty v-if="loaded && list.length==0"></empty>
  35. </template>
  36. <view class="pagetit" v-if="list.length != 0">
  37. {{name}}
  38. </view>
  39. <view class="list-item" v-for="item in list" @click="navTo('/pages/article/detail?id=' + item.id)">
  40. <view class="article-tit">{{item.title}}</view>
  41. <view class="article-time">({{item.release_time}})</view>
  42. </view>
  43. <uni-load-more :status="loadingType"></uni-load-more>
  44. </view>
  45. </template>
  46. <script>
  47. import empty from '../../components/empty.vue'
  48. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  49. import { getArticleList } from '../../api/index.js'
  50. export default {
  51. components: {
  52. uniLoadMore,
  53. empty
  54. },
  55. data() {
  56. return {
  57. name: '',
  58. cid: '',
  59. list: [],
  60. page: 1,
  61. limit: 10,
  62. loadingType: 'more',
  63. loaded: false
  64. }
  65. },
  66. onReachBottom() {
  67. this.getList()
  68. },
  69. onLoad(opt) {
  70. if(opt.cid) {
  71. this.cid = opt.cid
  72. }
  73. if(opt.name) {
  74. this.name = decodeURI(opt.name)
  75. }
  76. this.getList()
  77. },
  78. methods: {
  79. navTo(url) {
  80. uni.navigateTo({
  81. url: url
  82. })
  83. },
  84. getList() {
  85. let obj =this
  86. if(obj.loadingType == 'loading' || obj.loadingType == 'noMore') {
  87. return
  88. }
  89. obj.loadingType = 'loading'
  90. getArticleList({
  91. page: obj.page,
  92. limit: obj.limit
  93. },obj.cid).then( ({data}) => {
  94. console.log(data)
  95. obj.list = obj.list.concat(data.list)
  96. obj.page++
  97. if(data.list.length == obj.limit) {
  98. obj.loadingType = 'more'
  99. }else {
  100. obj.loadingType = 'noMore'
  101. }
  102. obj.$set(obj,'loaded',true)
  103. })
  104. },
  105. //跳转到详情
  106. ToDetail(index) {
  107. if(index == 1) {
  108. uni.navigateTo({
  109. url: '/pages/cart/personal'
  110. })
  111. }
  112. if(index == 2) {
  113. uni.navigateTo({
  114. url: '/pages/cart/group'
  115. })
  116. }
  117. if(index == 3) {
  118. uni.navigateTo({
  119. url: '/pages/form/tovolApply'
  120. })
  121. }
  122. }
  123. }
  124. }
  125. </script>
  126. <style lang="scss" scoped>
  127. page {
  128. background-color: #fff;
  129. height: 100%;
  130. }
  131. .list-item {
  132. border-bottom: 1px solid #ccc;
  133. border-top: 1px solid #ccc;
  134. padding:20rpx 35rpx;
  135. line-height: 1.5;
  136. .article-tit {
  137. font-size: 34rpx;
  138. color: #000000;
  139. font-weight: 500;
  140. letter-spacing: 3rpx;
  141. font-weight:700;
  142. }
  143. .article-time {
  144. font-size: 28rpx;
  145. color: #888;
  146. font-weight: 500;
  147. }
  148. }
  149. .order-item {
  150. width: 100%;
  151. padding: 0rpx 25rpx;
  152. padding-top: 25rpx !important;
  153. .list-cell {
  154. background-color: #ffffff;
  155. border-radius: 20rpx;
  156. width: 100%;
  157. box-shadow: 0px 0px 40px 0px rgba(0, 0, 0, 0.06);
  158. .image {
  159. width: 100%;
  160. height: 300rpx;
  161. border-top-left-radius: 25rpx;
  162. border-top-right-radius: 25rpx;
  163. }
  164. .list-tpl {
  165. padding: 25rpx 25rpx;
  166. padding-bottom: 35rpx !important;
  167. font-size: 34rpx;
  168. color: #222222;
  169. font-weight:500;
  170. }
  171. }
  172. }
  173. .pagetit {
  174. padding: 70rpx 0 70rpx 30rpx;
  175. color: #000;
  176. font-size: 40rpx;
  177. }
  178. .list-top {
  179. width: 750rpx;
  180. height: 366rpx;
  181. }
  182. .top {
  183. align-items: center;
  184. width: 100%;
  185. padding: 10rpx 0 10rpx 20rpx;
  186. image {
  187. width: 64rpx;
  188. height: 64rpx;
  189. border-radius: 50%;
  190. }
  191. .font {
  192. margin-left: 20rpx;
  193. .china-font {
  194. font-size: 36rpx;
  195. font-family: PingFang SC;
  196. font-weight: bold;
  197. color: #101010;
  198. letter-spacing:20rpx;
  199. }
  200. .english-font {
  201. margin-top: 6rpx;
  202. font-size: 12rpx;
  203. font-family: PingFang SC;
  204. // font-weight: bold;
  205. color: #101010;
  206. // letter-spacing:1rpx;
  207. }
  208. }
  209. }
  210. </style>