123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <template>
- <view class="body2">
- <u-navbar :autoBack="true" title="建筑文化" bgColor="rgba(255,255,255,0)" :placeholder="true" titleStyle="font-weight:bold;color:#121212"></u-navbar>
- <view class="jz_swiper">
- <u-swiper
- :list="list1"
- height="335rpx"
- :indicator="true"
- :autoplay="true"
- indicatorMode="dot"
- indicatorActiveColor="#fff"
- indicatorInactiveColor="rgba(255, 255, 255, 0.35)"
- :circular="true"
- indicatorStyle="bottom: 10px"
- ></u-swiper>
- </view>
- <view class="" style="margin: 30rpx 0 0 0">
- <u-tabs
- :duration="200"
- :list="listTab"
- :lineWidth="25"
- :lineHeight="12"
- lineColor="#4E7198"
- :lineColor="`url(${tabImg}) 100% 100%`"
- :activeStyle="{
- color: '#4E7198',
- fontSize: '34rpx'
- }"
- ></u-tabs>
- </view>
- <view class="banxin">
- <view style="margin-bottom: 30rpx" v-for="(item, index) in jianZhuList" :key="item">
- <view @click="buildBtn(index)" class="jz_item">
- <image style="width: 100%; height: 100%" :src="item.thumbnail"></image>
- </view>
- <view class="" style="width: 650rpx; display: flex; justify-content: space-between">
- <view>{{ item.title }}</view>
- <view class="" style="display: flex; align-items: center; justify-content: space-evenly">
- <uni-icons type="heart-filled" color="#ca5642" size="20"></uni-icons>
- <text style="font-size: 28rpx">{{ item.likes }}</text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- let that;
- export default {
- data() {
- return {
- isLoading: false, // 节流阀 默认为关闭状态
- main_body_id: '',
- page: '1',
- model_id: '',
- tabImg: 'https://huli-app.wenlvti.net/app_static/minnanhun/image/tab.png',
- list1: [
- 'https://img1.baidu.com/it/u=3551075903,1493549593&fm=253&fmt=auto&app=138&f=JPEG?w=667&h=500',
- 'https://img0.baidu.com/it/u=1667631211,245764236&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=357',
- 'https://img1.baidu.com/it/u=2554021422,1871009309&fm=253&fmt=auto&app=138&f=JPEG?w=700&h=500'
- ],
- listTab: [
- {
- name: '全部',
- tabid: 1
- },
- {
- name: '民居大厝',
- tabid: 2
- },
- {
- name: '宫殿建筑',
- tabid: 3
- },
- {
- name: '礼制性祭祀建筑',
- tabid: 4
- },
- {
- name: '百家争鸣',
- tabid: 5
- }
- ],
- jianZhuList: []
- };
- },
- onLoad(o) {
- console.log(o, 'ooooooooo');
- that = this;
- this.model_id = o.id;
- this.main_body_id = this.$db.get('main_body_id');
- this.getColumnList(o.id);
- this.getContentList(o.id);
- },
- onReachBottom() {
- if (this.isLoading) {
- return;
- } else {
- // 每次触发上拉触底 请求的页码 自加一
- this.page++;
- // 重新请求数据
- this.getContentList();
- }
- },
- methods: {
- // 栏目列表
- getColumnList(id) {
- this.$api.getColumnList(
- {
- model_id: 1,
- main_body_id: this.main_body_id
- },
- function (res) {
- let a = {
- diyname: 'crzx',
- id: '',
- image: '',
- name: '全部'
- };
- that.listTab = res.data;
- that.listTab.unshift(a);
- // console.log(that.listTab, '全部');
- }
- );
- },
- // 栏目内容列表
- getContentList(id) {
- this.isLoading = true;
- this.$api.getContentList(
- {
- model_id: 1,
- main_body_id: this.main_body_id,
- page: this.page,
- pageSize: '10'
- },
- function (res) {
- // 关闭节流阀
- that.isLoading = false;
- // console.log(res, '内容列表');
- that.jianZhuList = [...that.jianZhuList, ...res.data];
- }
- );
- },
- // 建筑详情
- buildBtn(i) {
- uni.navigateTo({
- url: this.jianZhuList[i].page
- });
- }
- }
- };
- </script>
- <style>
- .body2 {
- background-size: 100% 100%;
- background-attachment: fixed;
- background-repeat: repeat-y;
- background-color: #efefef;
- padding-bottom: 50rpx;
- }
- /deep/.u-swiper-indicator__wrapper__dot--active {
- width: 5px !important;
- }
- /deep/.u-tabs__wrapper__nav__item.data-v-48634e29 {
- padding: 0 40rpx !important;
- }
- /deep/.u-tabs__wrapper__nav__line.data-v-48634e29 {
- bottom: 16rpx !important;
- }
- /deep/.u-tabs__wrapper__nav__item.data-v-48634e29 {
- align-items: end !important;
- }
- .banxin {
- margin: 0 32rpx 0 32rpx;
- }
- .jz_swiper {
- }
- .jz_item {
- width: 686rpx;
- height: 345rpx;
- border-radius: 26rpx 26rpx 0rpx 0rpx;
- }
- </style>
|