123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- <template>
- <view class="center">
- <view class="img">
- <image src="../../static/img/logo.png" mode=""></image>
- </view>
- <view class="test_title">
- 案例展示
- </view>
- <view class="box">
- <view class="caseBox" v-for="(item,index) in list">
- <view class="caseBox-img">
- <image :src="item.src" mode=""></image>
- </view>
- <view class="caseBox-right">
- <view class="title">
- {{item.title}}
- </view>
- <view class="date">
- {{item.date}}
- </view>
- <view class="content">
- {{item.content}}
- </view>
- </view>
- </view>
- </view>
- <view class="pagInation">
- <!-- prevText String 上一页 左侧按钮文字
- nextText String 下一页 右侧按钮文字
- current Number 1 当前页
- total Number 0 数据总量
- pageSize Number 10 每页数据量
- showIcon Boolean false 是否以 icon 形式展示按钮
- @change 点击页码按钮时触发 e={type,current} current为当前页,
- type值为:next/prev,表示点击的是上一页还是下一个-->
- <!-- <uni-pagination title="标题文字" prevText="" nextText="" pageSize="10" total="20" @change="" ></uni-pagination> -->
- <!-- <uni-pagination title="标题文字" show-icon="true" total="50" current="2"></uni-pagination> -->
- <uni-pagination @change="handlePage" show-icon="true" :total="postCount" :current="pageNum"
- :pageSize="pageSize"></uni-pagination>
- </view>
- <aboutUs class="aboutUs"></aboutUs>
- </view>
- </template>
- <script>
- import {
- changeTaber
- } from '@/utils/tarberChange.js'
- import aboutUs from '@/components/introduce/introduce.vue'
- export default {
- components: {
- aboutUs
- },
- data() {
- return {
- // title: '',
- // src: '',
- // date: '',
- // content: '',
- postCount: 0,
- pageSize: 1,
- pageNum: 1,
- list: [{
- title: '1大家谁都',
- src: "../../static/img/introduce.png",
- date: '2021-06-08 16:26',
- content: 'qwenanckajnckjsanjknscjkanskjcnaskjncakjsncjka1111111111111111111111111111111111111'
- }, {
- title: '1大家谁都',
- src: "../../static/img/introduce.png",
- date: '2021-06-08 16:26',
- content: 'qwenanckajnckjsanjknscjkanskjcnaskjncakjsncjka'
- }],
- }
- },
- onLoad() {
- // this.loadData();
- changeTaber(2)
- },
- methods: {
- async loadData() {
- // uni.request({
- // url: '',
- // method: 'GET',
- // data: {},
- // success: res => {},
- // fail: () => {},
- // complete: () => {}
- // });
- const obj = this;
- },
- getPostListInfo(pageIndex) {
- console.log('pageIndex:' + pageIndex);
- uni.request({
- url: common.website_url + '/cnblogs/getPersonalBlogPostList/' + pageIndex,
- method: 'POST',
- success: res => {
- console.log('isSuccess');
- console.log('getPostListInfo:' + JSON.stringify(res.data));
- this.list = res.data;
- },
- fail: function(e) {
- console.log('接口调用失败:' + JSON.stringify(e));
- }
- });
- },
- getPersonalBlogInfo() {
- uni.request({
- url: common.website_url + '/cnblogs/getPersonalBlogInfo',
- method: 'POST',
- success: res => {
- //console.log('getPersonalBlogInfo:' + JSON.stringify(res.data));
- this.postCount = res.data.postCount;
- this.pageSize = res.data.pageSize;
- },
- fail: function(e) {
- console.log('接口调用失败:' + JSON.stringify(e));
- }
- });
- },
- getDetail(Title, Id, Url) {
- console.log('Title:' + Title + ' Id:' + Id);
- uni.navigateTo({
- url: '../post/post/post?Title=' + Title + '&Id=' + Id
- });
- },
- handlePage(params) {
- var pageIndex = params.current;
- console.log('this.pageNum:' + pageIndex);
- this.getPostListInfo(pageIndex);
- }
- }
- }
- </script>
- <style lang="scss">
- .center {
- height: 100%;
-
- }
- .img {
- margin: 17rpx 0 17rpx 41rpx;
- width: 208rpx;
- height: 52rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .aboutUs {
- width: 100%;
- position: fixed;
- }
- .test_title {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 100%;
- height: 60rpx;
- font-size: 22rpx;
- font-family: Adobe Heiti Std;
- font-weight: normal;
- color: #FFFFFF;
- background-color: #0165B5;
- }
- .box{
- display: flex;
- flex-direction: column;
-
- align-items: center;
- .caseBox {
- margin-top: 20rpx;
- display: flex;
-
- align-items: center;
- width: 90%;
- height: 100%;
- .caseBox-img {
- width: 240rpx;
- height: 160rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .caseBox-right {
- margin-left: 40rpx;
- .title {
- margin-top: -40rpx;
- font-size: 18rpx;
- font-family: Adobe Heiti Std;
- font-weight: normal;
- color: #535962;
-
- }
- .date {
- font-size: 11rpx;
- font-family: Adobe Heiti Std;
- font-weight: normal;
- color: #A1A1A1;
- line-height: 20rpx;
- }
- .content {
- font-size: 15rpx;
- font-family: Adobe Heiti Std;
- font-weight: normal;
- color: #A1A1A1;
- line-height: 46rpx;
- max-width: 400rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
- }
- }
- // .uni-pagination__child-btn{
- // }
- // .pagInation > .uni-pagination>.uni-pagination__btn > .uni-pagination__child-btn > span{
- // }
- </style>
|