yiming
2024-02-29 620e4040d9e849d31abc9092b95c2e7bb14e75c5
书目
1个文件已修改
6个文件已添加
280 ■■■■■ 已修改文件
app.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bibliographyList/index.js 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bibliographyList/index.json 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bibliographyList/index.wxml 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bibliographyList/index.wxss 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bibliographyList/download.png 补丁 | 查看 | 原始文档 | blame | 历史
static/images/bibliographyList/downloadshiftin.png 补丁 | 查看 | 原始文档 | blame | 历史
app.json
@@ -4,6 +4,7 @@
    "pages/bookServices/index",
    "pages/bookExhibitionList/index",
    "pages/bookExhibitionDetails/index",
    "pages/bibliographyList/index",
    "pages/usercenter/index",
    "pages/usercenter/person-info/index",
    "pages/usercenter/address/list/index",
pages/bibliographyList/index.js
New file
@@ -0,0 +1,174 @@
// pages/bibliographyList/index.js
const app = getApp()
Page({
  /**
   * 页面的初始数据
   */
  data: {
    higherList: [],
    vocationalList: [],
    teacherList: [],
    higherTotal: null,
    vocationalTotal: null,
    teacherTotal: null
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.higherGet()
    this.vocationalGet()
    this.teacherGet()
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {
  },
  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {
  },
  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {
  },
  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {
  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {
  },
  onTabsChange(event) {
    console.log(`Change tab, tab-panel value is ${event.detail.value}.`);
  },
  onTabsClick(event) {
    console.log(`Click tab, tab-panel value is ${event.detail.value}.`);
  },
  //高等教育
  higherGet() {
    app.MG.resource.getItem({
      path: 'jsek_biblioClassification\\jsek_bCHigherEducation',
      queryType: '*',
      paging: {
        start: '0',
        size: '999'
      },
      coverSize: {
        width: 260
      },
      fields: {
        jsek_link: [],
        content: [],
        subtitle: [],
        fileType: [],
        jsek_resource: [],
        freeFile: []
      },
      SysType: 'CmsItem'
    }).then(res => {
      console.log(res.total);
      this.setData({
        higherList: res.datas,
        higherTotal: res.total
      })
      console.log(this.data.higherList, '5555');
    })
  },
  //教师教育
  vocationalGet() {
    app.MG.resource.getItem({
      path: 'jsek_biblioClassification\\jsek_bCVocationalEducation',
      queryType: '*',
      paging: {
        start: '0',
        size: '999'
      },
      coverSize: {
        width: 260
      },
      fields: {
        jsek_link: [],
        content: [],
        subtitle: [],
        fileType: [],
        jsek_resource: [],
        freeFile: []
      },
      SysType: 'CmsItem'
    }).then(res => {
      this.setData({
        vocationalList: res.datas,
        vocationalTotal: res.total
      })
    })
  },
  // 职业教育
  teacherGet() {
    app.MG.resource.getItem({
      path: 'jsek_biblioClassification\\jsek_bCTeacherEducation',
      queryType: '*',
      paging: {
        start: '0',
        size: '999'
      },
      coverSize: {
        width: 260
      },
      fields: {
        jsek_link: [],
        content: [],
        subtitle: [],
        fileType: [],
        jsek_resource: [],
        freeFile: []
      },
      SysType: 'CmsItem'
    }).then(res => {
      this.setData({
        teacherList: res.datas,
        teacherTotal: res.total
      })
    })
  }
})
pages/bibliographyList/index.json
New file
@@ -0,0 +1,7 @@
{
  "component": true,
  "usingComponents": {
    "t-tabs": "tdesign-miniprogram/tabs/tabs",
    "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel"
  }
}
pages/bibliographyList/index.wxml
New file
@@ -0,0 +1,51 @@
<!--pages/bibliographyList/index.wxml-->
<t-tabs defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" t-class-content="custom-panel">
  <t-tab-panel label="高等教育({{higherTotal}})" value="0">
    <view class="outsideHigherBox">
      <view class="higherBox" wx:for="{{higherList}}" wx:key="index" wx:for-item="item" wx:for-index="index">
        <view class="outsideHigherImageBox">
          <image class="higherImageBox" src="{{item.icon}}" mode="" />
        </view>
        <view class="higherTextBox">{{item.name}}</view>
      </view>
    </view>
  </t-tab-panel>
  <t-tab-panel label="职业教育({{vocationalTotal}})" value="1">
    <view class="outsideHigherBox">
      <view class="higherBox" wx:for="{{vocationalList}}" wx:key="index" wx:for-item="item" wx:for-index="index">
        <view class="outsideHigherImageBox">
          <image class="higherImageBox" src="{{item.icon}}" mode="" />
          <view class="downloadIcon">
            <image class="download" src="/static/images/bibliographyList/download.png" mode="" />
            <image class="downloadshiftin" src="/static/images/bibliographyList/downloadshiftin.png" mode="" />
          </view>
        </view>
        <view class="higherTextBox">{{item.name}}</view>
      </view>
    </view>
  </t-tab-panel>
  <t-tab-panel label="教师教育({{teacherTotal}})" value="2">
    <view class="outsideHigherBox">
      <view class="higherBox" wx:for="{{teacherList}}" wx:key="index" wx:for-item="item" wx:for-index="index">
        <view class="outsideHigherImageBox">
          <image class="higherImageBox" src="{{item.icon}}" mode="" />
        </view>
        <view class="higherTextBox">{{item.name}}</view>
      </view>
    </view>
  </t-tab-panel>
</t-tabs>
pages/bibliographyList/index.wxss
New file
@@ -0,0 +1,47 @@
/* pages/bibliographyList/index.wxss */
/* .custom-tabs {
  margin-bottom: 32rpx;
}
.custom-panel {
  height: 120px;
} */
.higherBox {
  width: 220rpx;
  /* height: 390rpx; */
  box-shadow: 10rpx 10rpx 10rpx 10rpx rgba(0, 0, 0, 0.08);
  margin: 30rpx 15rpx;
}
.outsideHigherBox {
  display: flex;
  flex-wrap: wrap;
}
.higherImageBox {
  width: 190rpx;
  height: 255rpx;
  margin: 15rpx;
}
.higherTextBox {
  font-weight: bold;
  font-size: 25rpx;
  color: #333333;
  padding: 15rpx;
  margin-bottom: 10rpx;
}
/* .downloadIcon {
  width: 430rpx;
  height: 430rpx;
  background-color: #000;
  position: relative;
  top: 0;
  left: 0;
} */
/* .download {
  background-color: #8bc34a;
} */
static/images/bibliographyList/download.png
static/images/bibliographyList/downloadshiftin.png