| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- <template>
- <view class="list">
- <view class="top flex">
- <image src="../../static/img/002.png" mode="aspectFill"></image>
- <view class="font">
- <view class="china-font">温岭市红十字会</view>
- <!-- <view class="english-font">Red Cross Society of China Wen Ling Branch</view> -->
- </view>
- </view>
- <image src="../../static/images/listtop.jpg" mode="" class="list-top"></image>
- <template v-if="cid == 11">
- <view class="order-item" @click="ToDetail(1)">
- <view class="list-cell">
- <image class="image" src="../../static/img/personal.jpg"></image>
- <view class="list-tpl">个人会员报名</view>
- </view>
- </view>
- <view class="order-item" @click="ToDetail(2)">
- <view class="list-cell">
- <image class="image" src="../../static/img/group.jpg"></image>
- <view class="list-tpl">团队会员报名</view>
- </view>
- </view>
- </template>
- <template v-if="cid == 12">
- <view class="order-item" @click="ToDetail(3)">
- <view class="list-cell">
- <image class="image" src="../../static/img/zffw.jpg"></image>
- <view class="list-tpl">志愿服务报名</view>
- </view>
- </view>
- </template>
- <template v-if="cid != 11 && cid != 12">
- <empty v-if="loaded && list.length==0"></empty>
- </template>
- <view class="pagetit" v-if="list.length != 0">
- {{name}}
- </view>
- <view class="list-item" v-for="item in list" @click="navTo('/pages/article/detail?id=' + item.id)">
- <view class="article-tit">{{item.title}}</view>
- <view class="article-time">({{item.release_time}})</view>
- </view>
- <uni-load-more :status="loadingType"></uni-load-more>
- </view>
-
- </template>
- <script>
- import empty from '../../components/empty.vue'
- import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
- import { getArticleList } from '../../api/index.js'
- export default {
- components: {
- uniLoadMore,
- empty
- },
- data() {
- return {
- name: '',
- cid: '',
- list: [],
- page: 1,
- limit: 10,
- loadingType: 'more',
- loaded: false
- }
- },
- onReachBottom() {
- this.getList()
- },
- onLoad(opt) {
- if(opt.cid) {
- this.cid = opt.cid
- }
- if(opt.name) {
- this.name = decodeURI(opt.name)
- }
- this.getList()
- },
- methods: {
- navTo(url) {
- uni.navigateTo({
- url: url
- })
- },
- getList() {
- let obj =this
- if(obj.loadingType == 'loading' || obj.loadingType == 'noMore') {
- return
- }
- obj.loadingType = 'loading'
- getArticleList({
- page: obj.page,
- limit: obj.limit
- },obj.cid).then( ({data}) => {
- console.log(data)
- obj.list = obj.list.concat(data.list)
- obj.page++
- if(data.list.length == obj.limit) {
- obj.loadingType = 'more'
- }else {
- obj.loadingType = 'noMore'
- }
- obj.$set(obj,'loaded',true)
- })
- },
- //跳转到详情
- ToDetail(index) {
- if(index == 1) {
- uni.navigateTo({
- url: '/pages/cart/personal'
- })
- }
- if(index == 2) {
- uni.navigateTo({
- url: '/pages/cart/group'
- })
- }
- if(index == 3) {
- uni.navigateTo({
- url: '/pages/form/tovolApply'
- })
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- page {
- background-color: #fff;
- height: 100%;
- }
- .list-item {
- border-bottom: 1px solid #ccc;
- border-top: 1px solid #ccc;
- padding:20rpx 35rpx;
- line-height: 1.5;
- .article-tit {
- font-size: 34rpx;
- color: #000000;
- font-weight: 500;
- letter-spacing: 3rpx;
- font-weight:700;
- }
- .article-time {
- font-size: 28rpx;
- color: #888;
- font-weight: 500;
- }
- }
- .order-item {
- width: 100%;
- padding: 0rpx 25rpx;
- padding-top: 25rpx !important;
- .list-cell {
- background-color: #ffffff;
- border-radius: 20rpx;
- width: 100%;
- box-shadow: 0px 0px 40px 0px rgba(0, 0, 0, 0.06);
- .image {
- width: 100%;
- height: 300rpx;
- border-top-left-radius: 25rpx;
- border-top-right-radius: 25rpx;
- }
- .list-tpl {
- padding: 25rpx 25rpx;
- padding-bottom: 35rpx !important;
- font-size: 34rpx;
- color: #222222;
- font-weight:500;
- }
- }
- }
- .pagetit {
- padding: 70rpx 0 70rpx 30rpx;
- color: #000;
- font-size: 40rpx;
- }
- .list-top {
- width: 750rpx;
- height: 366rpx;
- }
- .top {
- align-items: center;
- width: 100%;
- padding: 10rpx 0 10rpx 20rpx;
- image {
- width: 64rpx;
- height: 64rpx;
- border-radius: 50%;
- }
- .font {
- margin-left: 20rpx;
- .china-font {
- font-size: 36rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #101010;
- letter-spacing:20rpx;
- }
- .english-font {
- margin-top: 6rpx;
- font-size: 12rpx;
- font-family: PingFang SC;
- // font-weight: bold;
- color: #101010;
- // letter-spacing:1rpx;
- }
- }
- }
- </style>
|