| | |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | isMore: null, |
| | | higherList: [], |
| | | vocationalList: [], |
| | | teacherList: [], |
| | |
| | | value: '', |
| | | BarHeight: '', |
| | | navBarHeight: '', |
| | | |
| | | start: 1, |
| | | tabValue: '' |
| | | }, |
| | | |
| | | /** |
| | |
| | | barHeight: systInfo.statusBarHeight, |
| | | }) |
| | | |
| | | let event = |
| | | { |
| | | detail: { value: "0" } |
| | | } |
| | | |
| | | this.onTabsChange(event) |
| | | |
| | | |
| | | |
| | |
| | | |
| | | }, |
| | | onTabsChange(event) { |
| | | console.log(`Change tab, tab-panel value is ${event.detail.value}.`); |
| | | |
| | | const value = event.detail.value |
| | | |
| | | if (value === '0') { |
| | | console.log(value); |
| | | this.setData({ |
| | | tabValue: value |
| | | }) |
| | | } else if (value === '1') { |
| | | console.log(value); |
| | | this.setData({ |
| | | tabValue: value |
| | | }) |
| | | } else if (value === '2') { |
| | | console.log(value); |
| | | this.setData({ |
| | | tabValue: value |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | onTabsClick(event) { |
| | | console.log(`Click tab, tab-panel value is ${event.detail.value}.`); |
| | | }, |
| | | |
| | | //高等教育 |
| | | higherGet(keyword) { |
| | | let searchObj = { |
| | |
| | | queryType: '*', |
| | | paging: { |
| | | start: '0', |
| | | size: '999' |
| | | size: this.data.start * 9 |
| | | }, |
| | | coverSize: { |
| | | width: 260 |
| | |
| | | }) |
| | | console.log(this.data.higherList, '5555'); |
| | | }) |
| | | |
| | | wx.stopPullDownRefresh() |
| | | |
| | | }, |
| | | |
| | |
| | | queryType: '*', |
| | | paging: { |
| | | start: '0', |
| | | size: '999' |
| | | size: this.data.start * 9 |
| | | }, |
| | | coverSize: { |
| | | width: 260 |
| | |
| | | }) |
| | | |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | | // 职业教育 |
| | | teacherGet(keyword) { |
| | |
| | | queryType: '*', |
| | | paging: { |
| | | start: '0', |
| | | size: '999' |
| | | size: this.data.start * 9 |
| | | }, |
| | | coverSize: { |
| | | width: 260 |
| | |
| | | }) |
| | | |
| | | }) |
| | | |
| | | wx.stopPullDownRefresh() |
| | | |
| | | }, |
| | | downloadData(event) { |
| | |
| | | goBack() { |
| | | wx.navigateBack(); |
| | | }, |
| | | onReachBottom(e) { |
| | | if (this.data.tabValue == 0) { |
| | | console.log(0); |
| | | if (this.data.higherList.length < this.data.higherTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | start: this.data.start + 1 |
| | | }) |
| | | this.higherGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | |
| | | } else if (this.data.tabValue == 1) { |
| | | |
| | | if (this.data.teacherList.length < this.data.teacherTotal) { |
| | | this.setData({ |
| | | isMore: true, |
| | | start: this.data.start + 1 |
| | | }) |
| | | this.teacherGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | console.log(2); |
| | | } else if (this.data.tabValue == 2) { |
| | | |
| | | if (this.data.vocationalList.length < this.data.vocationalTotal && this.data.vocationalList.length > 9) { |
| | | this.setData({ |
| | | isMore: true, |
| | | start: this.data.start + 1 |
| | | }) |
| | | this.vocationalGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | console.log(2); |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | | onPullDownRefresh() { |
| | | |
| | | |
| | | this.setData({ |
| | | start: 1 |
| | | }) |
| | | this.vocationalGet() |
| | | this.higherGet() |
| | | this.teacherGet() |
| | | |
| | | }, |
| | | |
| | | }) |
| | |
| | | "t-tabs": "tdesign-miniprogram/tabs/tabs", |
| | | "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", |
| | | "t-search": "tdesign-miniprogram/search/search", |
| | | "t-icon": "tdesign-miniprogram/icon/icon" |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-image": "tdesign-miniprogram/image/image" |
| | | }, |
| | | "navigationStyle": "custom" |
| | | "navigationStyle": "custom", |
| | | "enablePullDownRefresh": true, |
| | | "onReachBottomDistance": 200, |
| | | "backgroundTextStyle": "dark" |
| | | } |
| | |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | <view class="bottom-box"> |
| | | <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | | </t-tab-panel> |
| | | <t-tab-panel label="职业教育({{vocationalTotal}})" value="1"> |
| | | <view class="outsideHigherBox"> |
| | |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | <view class="bottom-box"> |
| | | <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | | |
| | | </t-tab-panel> |
| | | <t-tab-panel label="教师教育({{teacherTotal}})" value="2"> |
| | |
| | | </view> |
| | | |
| | | </view> |
| | | <view class="bottom-box"> |
| | | <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | | </t-tab-panel> |
| | | |
| | | </t-tabs> |
| | |
| | | |
| | | .t-tabs__track { |
| | | background-color: #FF6C00 !important; |
| | | } |
| | | |
| | | .bottom-box { |
| | | display: flex; |
| | | justify-content: center; |
| | | color: #999; |
| | | height: 80rpx; |
| | | font-size: 28rpx; |
| | | --td-loading-color: #ff6c00 |
| | | } |
| | |
| | | checkedList: [], |
| | | selectedCount: 0, |
| | | totalPrice: 0.00, |
| | | type: '' |
| | | type: '', |
| | | start: 1, |
| | | totalSize: '', |
| | | isMore: null, |
| | | }, |
| | | |
| | | onLoad(options) { |
| | | |
| | | wx.setNavigationBarTitle({ |
| | | title: '购物车' |
| | | }); |
| | |
| | | shoppingCartGet() { |
| | | let query = { |
| | | start: 0, |
| | | size: 999, |
| | | size: this.data.start * 4, |
| | | filterList: [], |
| | | searchList: [] |
| | | }; |
| | | app.MG.store.getShoppingCartProductList(query).then(res => { |
| | | console.log(res, 'res'); |
| | | |
| | | this.setData({ |
| | | totalSize: res.totalSize |
| | | }) |
| | | |
| | | res.datas.forEach(item => { |
| | | item.imgUrl = getPublicImage(item.productMonWithLinkDto.product.icon, '', '160'); |
| | | console.log(item); |
| | | console.log(item.saleMethod.type, 'item.saleMethod.type') |
| | | |
| | | this.setData({ |
| | | type: item.saleMethod.type == 'createProductItemSaleMethod' ? 'item' : 'product' |
| | | }) |
| | |
| | | shoppingCartData: res.datas |
| | | }); |
| | | }); |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | | |
| | | bottomChange(e) { |
| | |
| | | wx.navigateTo({ |
| | | url: '/pages/testLogin/index' |
| | | }); |
| | | } |
| | | }, |
| | | //触底函数 |
| | | onReachBottom() { |
| | | if (this.data.shoppingCartData.length < this.data.totalSize) { |
| | | this.setData({ |
| | | isMore: true, |
| | | start: this.data.start + 1 |
| | | }) |
| | | this.shoppingCartGet() |
| | | } else { |
| | | this.setData({ |
| | | isMore: true, |
| | | }) |
| | | setTimeout(() => { |
| | | this.setData({ |
| | | isMore: false |
| | | }) |
| | | }, 100) |
| | | |
| | | } |
| | | }, |
| | | // 下拉函数 |
| | | onPullDownRefresh() { |
| | | |
| | | this.setData({ |
| | | start: 1 |
| | | }) |
| | | console.log(978); |
| | | this.shoppingCartGet() |
| | | }, |
| | | |
| | | }); |
| | |
| | | "t-cell": "tdesign-miniprogram/cell/cell", |
| | | "t-button": "tdesign-miniprogram/button/button", |
| | | "t-toast": "tdesign-miniprogram/toast/toast", |
| | | "t-empty": "tdesign-miniprogram/empty/empty" |
| | | } |
| | | "t-empty": "tdesign-miniprogram/empty/empty", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-image": "tdesign-miniprogram/image/image" |
| | | }, |
| | | "enablePullDownRefresh": true, |
| | | "onReachBottomDistance": 200, |
| | | "backgroundTextStyle": "dark" |
| | | } |
| | |
| | | </view> |
| | | <view slot="right" class="btn delete-btn" bind:tap="onDelete" data-item="{{item}}">删除</view> |
| | | </t-swipe-cell> |
| | | |
| | | <view class="bottom-box"> |
| | | <t-loading theme="circular" size="40rpx" class="wrapper" wx:if="{{isMore == true}}" /> |
| | | <text wx:if="{{isMore == false}}">没有更多了</text> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="bottomBox"> |
| | |
| | | color: #333333; |
| | | /* margin: 10rpx 0; */ |
| | | margin-bottom: 20rpx; |
| | | } |
| | | |
| | | .bottom-box { |
| | | display: flex; |
| | | justify-content: center; |
| | | color: #999; |
| | | height: 80rpx; |
| | | font-size: 28rpx; |
| | | --td-loading-color: #ff6c00 |
| | | } |
| | |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | | this.setData({ |
| | | |
| | | navBarHeight: navBarHeight, |
| | | barHeight: systInfo.statusBarHeight, |
| | | searchVal: options.searchVal |
| | |
| | | |
| | | |
| | | }) |
| | | |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | | bibliographyGet() { |
| | | let bibliographyObj = {} |
| | |
| | | }) |
| | | |
| | | }) |
| | | wx.stopPullDownRefresh() |
| | | }, |
| | | downloadData(event) { |
| | | console.log(111); |
| | |
| | | url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name // 假设跳转到详情页面,并传递了id参数 |
| | | }); |
| | | }, |
| | | //触底函数 |
| | | onReachBottom() { |
| | | console.log("上拉加载...."); |
| | | }, |
| | | |
| | | //上拉函数 |
| | | onPullDownRefresh() { |
| | | console.log("下拉刷新..."); |
| | |
| | | |
| | | }, |
| | | |
| | | // 下拉函数 |
| | | onPullDownRefresh() { |
| | | |
| | | if (this.data.tabValue == 4) { |
| | | this.setData({ |
| | | "pageCount.page": 1 |
| | | }) |
| | | this.bibliographyGet() |
| | | } else { |
| | | this.setData({ |
| | | "pageCount.page": 1 |
| | | }) |
| | | this.retrievalPageGet() |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | | }) |
| | |
| | | }, |
| | | "navigationStyle": "custom", |
| | | "enablePullDownRefresh": true, |
| | | "onReachBottomDistance": 200 |
| | | "onReachBottomDistance": 200, |
| | | "backgroundTextStyle": "dark" |
| | | } |