case.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view class="center">
  3. <view class="img">
  4. <image src="../../static/img/logo.png" mode=""></image>
  5. </view>
  6. <view class="test_title">
  7. 案例展示
  8. </view>
  9. <view class="box">
  10. <view class="caseBox" v-for="(item,index) in list">
  11. <view class="caseBox-img">
  12. <image :src="item.src" mode=""></image>
  13. </view>
  14. <view class="caseBox-right">
  15. <view class="title">
  16. {{item.title}}
  17. </view>
  18. <view class="date">
  19. {{item.date}}
  20. </view>
  21. <view class="content">
  22. {{item.content}}
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="pagInation">
  28. <!-- prevText String 上一页 左侧按钮文字
  29. nextText String 下一页 右侧按钮文字
  30. current Number 1 当前页
  31. total Number 0 数据总量
  32. pageSize Number 10 每页数据量
  33. showIcon Boolean false 是否以 icon 形式展示按钮
  34. @change 点击页码按钮时触发 e={type,current} current为当前页,
  35. type值为:next/prev,表示点击的是上一页还是下一个-->
  36. <!-- <uni-pagination title="标题文字" prevText="" nextText="" pageSize="10" total="20" @change="" ></uni-pagination> -->
  37. <!-- <uni-pagination title="标题文字" show-icon="true" total="50" current="2"></uni-pagination> -->
  38. <uni-pagination @change="handlePage" show-icon="true" :total="postCount" :current="pageNum"
  39. :pageSize="pageSize"></uni-pagination>
  40. </view>
  41. <aboutUs class="aboutUs"></aboutUs>
  42. </view>
  43. </template>
  44. <script>
  45. import {
  46. changeTaber
  47. } from '@/utils/tarberChange.js'
  48. import aboutUs from '@/components/introduce/introduce.vue'
  49. export default {
  50. components: {
  51. aboutUs
  52. },
  53. data() {
  54. return {
  55. // title: '',
  56. // src: '',
  57. // date: '',
  58. // content: '',
  59. postCount: 0,
  60. pageSize: 1,
  61. pageNum: 1,
  62. list: [{
  63. title: '1大家谁都',
  64. src: "../../static/img/introduce.png",
  65. date: '2021-06-08 16:26',
  66. content: 'qwenanckajnckjsanjknscjkanskjcnaskjncakjsncjka1111111111111111111111111111111111111'
  67. }, {
  68. title: '1大家谁都',
  69. src: "../../static/img/introduce.png",
  70. date: '2021-06-08 16:26',
  71. content: 'qwenanckajnckjsanjknscjkanskjcnaskjncakjsncjka'
  72. }],
  73. }
  74. },
  75. onLoad() {
  76. // this.loadData();
  77. changeTaber(2)
  78. },
  79. methods: {
  80. async loadData() {
  81. // uni.request({
  82. // url: '',
  83. // method: 'GET',
  84. // data: {},
  85. // success: res => {},
  86. // fail: () => {},
  87. // complete: () => {}
  88. // });
  89. const obj = this;
  90. },
  91. getPostListInfo(pageIndex) {
  92. console.log('pageIndex:' + pageIndex);
  93. uni.request({
  94. url: common.website_url + '/cnblogs/getPersonalBlogPostList/' + pageIndex,
  95. method: 'POST',
  96. success: res => {
  97. console.log('isSuccess');
  98. console.log('getPostListInfo:' + JSON.stringify(res.data));
  99. this.list = res.data;
  100. },
  101. fail: function(e) {
  102. console.log('接口调用失败:' + JSON.stringify(e));
  103. }
  104. });
  105. },
  106. getPersonalBlogInfo() {
  107. uni.request({
  108. url: common.website_url + '/cnblogs/getPersonalBlogInfo',
  109. method: 'POST',
  110. success: res => {
  111. //console.log('getPersonalBlogInfo:' + JSON.stringify(res.data));
  112. this.postCount = res.data.postCount;
  113. this.pageSize = res.data.pageSize;
  114. },
  115. fail: function(e) {
  116. console.log('接口调用失败:' + JSON.stringify(e));
  117. }
  118. });
  119. },
  120. getDetail(Title, Id, Url) {
  121. console.log('Title:' + Title + ' Id:' + Id);
  122. uni.navigateTo({
  123. url: '../post/post/post?Title=' + Title + '&Id=' + Id
  124. });
  125. },
  126. handlePage(params) {
  127. var pageIndex = params.current;
  128. console.log('this.pageNum:' + pageIndex);
  129. this.getPostListInfo(pageIndex);
  130. }
  131. }
  132. }
  133. </script>
  134. <style lang="scss">
  135. .center {
  136. height: 100%;
  137. }
  138. .img {
  139. margin: 17rpx 0 17rpx 41rpx;
  140. width: 208rpx;
  141. height: 52rpx;
  142. image {
  143. width: 100%;
  144. height: 100%;
  145. }
  146. }
  147. .aboutUs {
  148. width: 100%;
  149. position: fixed;
  150. }
  151. .test_title {
  152. display: flex;
  153. justify-content: center;
  154. align-items: center;
  155. width: 100%;
  156. height: 60rpx;
  157. font-size: 22rpx;
  158. font-family: Adobe Heiti Std;
  159. font-weight: normal;
  160. color: #FFFFFF;
  161. background-color: #0165B5;
  162. }
  163. .box{
  164. display: flex;
  165. flex-direction: column;
  166. align-items: center;
  167. .caseBox {
  168. margin-top: 20rpx;
  169. display: flex;
  170. align-items: center;
  171. width: 90%;
  172. height: 100%;
  173. .caseBox-img {
  174. width: 240rpx;
  175. height: 160rpx;
  176. image {
  177. width: 100%;
  178. height: 100%;
  179. }
  180. }
  181. .caseBox-right {
  182. margin-left: 40rpx;
  183. .title {
  184. margin-top: -40rpx;
  185. font-size: 18rpx;
  186. font-family: Adobe Heiti Std;
  187. font-weight: normal;
  188. color: #535962;
  189. }
  190. .date {
  191. font-size: 11rpx;
  192. font-family: Adobe Heiti Std;
  193. font-weight: normal;
  194. color: #A1A1A1;
  195. line-height: 20rpx;
  196. }
  197. .content {
  198. font-size: 15rpx;
  199. font-family: Adobe Heiti Std;
  200. font-weight: normal;
  201. color: #A1A1A1;
  202. line-height: 46rpx;
  203. max-width: 400rpx;
  204. overflow: hidden;
  205. text-overflow: ellipsis;
  206. white-space: nowrap;
  207. }
  208. }
  209. }
  210. }
  211. // .uni-pagination__child-btn{
  212. // }
  213. // .pagInation > .uni-pagination>.uni-pagination__btn > .uni-pagination__child-btn > span{
  214. // }
  215. </style>