From aff8d054df4a638f399dc8f15d98c19b9c9aa785 Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期二, 29 四月 2025 10:11:25 +0800 Subject: [PATCH] 扫码视频播放 --- pages/retrievalPage/index.js | 274 +++++++++++++++++------------------------------------- 1 files changed, 89 insertions(+), 185 deletions(-) diff --git a/pages/retrievalPage/index.js b/pages/retrievalPage/index.js index 231881f..fc8fd6c 100644 --- a/pages/retrievalPage/index.js +++ b/pages/retrievalPage/index.js @@ -1,6 +1,8 @@ // pages/retrievalPage/index.js import request from '../../assets/request/index' - +import { + loginInfo +} from '../../assets/js/login'; import { handleQueryResourceListData } from '../../assets/js/middleGround/tool' @@ -72,14 +74,14 @@ }, ], tabsId: 0, //榛樿閫夊瀷涓鸿澶� - + height: '', + inputStyle: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx; padding: 0 0 0 16rpx;height:70rpx', }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 */ onLoad(options) { - console.log(app.config.appId); const systInfo = wx.getSystemInfoSync(); const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅 const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 瀵艰埅鏍忛珮搴� @@ -97,16 +99,25 @@ } this.onTabsChange(e) // 妫�鏌ョ櫥褰曠姸鎬� - const token = wx.getStorageSync(app.config.tokenKey) - if (!token) { - loginInfo(app, (data) => { - if (data) { - this.getUserInfo() - } - }) - } else { - this.getUserInfo() - } + // const token = wx.getStorageSync(app.config.tokenKey) + // if (!token) { + // loginInfo(app, (data) => { + // if (data) { + // this.getUserInfo() + // } + // }) + // } else { + // this.getUserInfo() + // } + var that = this; + // 鍔ㄦ�佽幏鍙栧睆骞曢珮搴� + wx.getSystemInfo({ + success: (result) => { + that.setData({ + height: result.windowHeight + }); + }, + }) }, // 鑾峰彇鐧诲綍鐢ㄦ埛韬唤 getUserInfo() { @@ -169,18 +180,10 @@ }, /** - * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� - */ - onReachBottom() { - - }, - - /** * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� */ - onShareAppMessage() { - - }, + onShareAppMessage() {}, + onShareTimeline() {}, goBack() { wx.navigateBack(); }, @@ -196,7 +199,6 @@ //鏍囩鐨勫垏鎹� onTabsChange(event) { const value = event.detail.value - console.log(value); this.setData({ tabValue: value, isMore: false @@ -233,7 +235,7 @@ } } - let url = '/store/api/ApiQueryProductByAppUser' + let url = '/store/api/ApiQueryProduct' //鍥句功 let queryBook = { AccessControl: { @@ -348,8 +350,6 @@ ...digitalTextbooksObj, ...fields } - - let seminarObj = {} if (this.data.searchVal) { seminarObj = { @@ -455,7 +455,6 @@ method: 'post', data: body }).then((resp) => { - console.log(resp, 'resp'); //鍥句功 0 const data1 = resp[0] const datas1 = handleQueryResourceListData({ @@ -467,7 +466,6 @@ bookTotal: data1.totalCount, [`tabList[${0}].bookTotal`]: data1.totalCount }) - console.log(this.data.tabList, 7777) //鏁板瓧璇剧▼ 1 const data2 = resp[1] const datas2 = handleQueryResourceListData({ @@ -510,7 +508,6 @@ datas5.forEach((items) => { items.subtitleName = items.subtitle + items.name }) - // console.log(datas5, 'sadasd'); this.setData({ biblioClassificationData: datas5, biblioClassificationTotal: data5.totalCount, @@ -519,6 +516,7 @@ this.setData({ loading: false, hidden: false, + isMore: false }) }) wx.stopPullDownRefresh() @@ -569,7 +567,6 @@ const item = event.currentTarget.dataset.item; const URL = app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.datas.freeFile.Value item.determine = false - console.log(URL, 'URL'); setTimeout(() => { if (URL) { item.determine = true @@ -626,21 +623,17 @@ loading: true, hidden: true, }) - console.log(this.data.searchVal); this.retrievalPageGet() this.bibliographyGet() }, onBook(e) { - console.log(e.currentTarget.dataset.item); const item = e.currentTarget.dataset.item wx.navigateTo({ url: '/packageBookService/pages/bookServices/detail/index?id=' + item.id + '&name=' + item.name }) }, onBookExhibitionDetails(e) { - console.log(e.currentTarget.dataset.item); const item = e.currentTarget.dataset.item - wx.navigateTo({ url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name // 鍋囪璺宠浆鍒拌鎯呴〉闈紝骞朵紶閫掍簡id鍙傛暟 }); @@ -650,160 +643,88 @@ onPullDownRefresh() { console.log("涓嬫媺鍒锋柊..."); }, - /** - * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� - */ - onReachBottom(e) { - console.log(this.data.tabValue); - if (this.data.tabValue == 0) { - console.log(0); - if (this.data.bookData.length < this.data.bookTotal) { - this.setData({ - isMore: true, - "pageCount.page": this.data.pageCount.page + 1 - }) - this.retrievalPageGet() - } else { - this.setData({ - isMore: true, - }) - setTimeout(() => { - this.setData({ - isMore: false - }) - }, 100) - - } - - } else if (this.data.tabValue == 1) { - - if (this.data.courseData.length < this.data.courseTotal) { - this.setData({ - isMore: true, - "pageCount.page": this.data.pageCount.page + 1 - }) - this.retrievalPageGet() - } else { - this.setData({ - isMore: true, - }) - setTimeout(() => { - this.setData({ - isMore: false - }) - }, 100) - - } - console.log(2); - } else if (this.data.tabValue == 2) { - - if (this.data.digitalTextbooksData.length < this.data.digitalTextbooksTotal && this.data.digitalTextbooksData.length > 9) { - this.setData({ - isMore: true, - "pageCount.page": this.data.pageCount.page + 1 - }) - this.retrievalPageGet() - } else { - this.setData({ - isMore: true, - }) - setTimeout(() => { - this.setData({ - isMore: false - }) - }, 100) - - } - console.log(2); - } else if (this.data.tabValue == 3) { - if (this.data.seminarData.length < this.data.seminarTotal) { - this.setData({ - isMore: true, - "pageCount.page": this.data.pageCount.page + 1 - }) - this.retrievalPageGet() - } else { - this.setData({ - isMore: true, - }) - setTimeout(() => { - this.setData({ - isMore: false - }) - }, 100) - } - console.log(3); - } else if (this.data.tabValue == 4) { - if (this.data.bookFairData.length < this.data.bookFairTotal) { - this.setData({ - isMore: true, - "pageCount.page": this.data.pageCount.page + 1 - }) - this.bibliographyGet() - } else { - this.setData({ - isMore: true, - }) - setTimeout(() => { - this.setData({ - isMore: false - }) - }, 100) - } - console.log(4); - } else if (this.data.tabValue == 5) { - if (this.data.biblioClassificationData.length < this.data.biblioClassificationTotal) { - this.setData({ - isMore: true, - "pageCount.page": this.data.pageCount.page + 1 - }) - this.retrievalPageGet() - } else { - this.setData({ - isMore: true, - }) - setTimeout(() => { - this.setData({ - isMore: false - }) - }, 100) - } - } - }, // 涓嬫媺鍑芥暟 onPullDownRefresh() { - console.log(456); if (this.data.tabValue == 4) { this.setData({ + bookFairData: [], "pageCount.page": 1 }) this.bibliographyGet() } else { this.setData({ + bookData: [], + courseData: [], + digitalTextbooksData: [], + seminarData: [], + biblioClassificationData: [], "pageCount.page": 1 }) this.retrievalPageGet() } }, - underConstruction() { - wx.showToast({ - title: "寤鸿涓�", - icon: 'none', - duration: 1000 + underConstruction(e) { + const { + book + } = e.currentTarget.dataset; + console.log(book); + wx.navigateTo({ + url: '/pages/digitalCourses/digitalCoursesDetails/index?id=' + book.id + '&path=' + book.idPath, + }); + }, + goTextBookDetail(e) { + const { + item + } = e.currentTarget.dataset; + wx.navigateTo({ + url: '/pages/digitalTextbooks/digitalTextbooksDetails/index?id=' + item.id, + }); + }, + goSubjectDetail(e) { + // return wx.showToast({ + // title: "寤鸿涓�", + // icon: 'none', + // duration: 1000 + // }) + const item = e.currentTarget.dataset.item + // 缃戦〉绫诲瀷璺宠浆鍒扮綉鍧�澶嶅埗椤碉紝鍥犱负url浼犲弬涓嶈兘浼� 甯﹀弬鏁扮殑缃戠粶鍦板潃锛屾墍浠ユ澶勮鎶婄綉缁滃湴鍧�閲岀殑浼犲弬鎽樺嚭鏉ワ紝鏀惧埌url閲� + let urlData = '' + const flags = item.jsek_link.indexOf("?") + if (flags > -1) { + urlData = item.jsek_link.slice(flags + 1, item.jsek_link.length) + } + let url = '/packageBookService/pages/bookServices/linkPage/index' + wx.navigateTo({ + url: urlData ? url + `?path=${item.jsek_link.slice(0,flags)}` + '&' + urlData : url + `?path=${item.jsek_link}` }) + }, // 閭鐐瑰嚮 mailbox(e) { - console.log(e); const key = e.currentTarget.dataset.key; const item = e.currentTarget.dataset.item; - this.setData({ - [key]: true, - dialogKey: key, - Md5: item.datas.freeFile.FileList[0].Md5 - }); + const token = wx.getStorageSync(app.config.tokenKey) + if (!token) { + loginInfo(app, (data) => { + if (data) { + this.getUserInfo() + this.setData({ + [key]: true, + dialogKey: key, + Md5: item.datas.freeFile.FileList[0].Md5 + }); + } + }) + } else { + this.getUserInfo() + this.setData({ + [key]: true, + dialogKey: key, + Md5: item.datas.freeFile.FileList[0].Md5 + }); + } }, //閭鐨勬牎楠� onEmailInput(e) { @@ -822,8 +743,6 @@ this.setData({ [dialogKey]: false }); - console.log(this.data.input); - console.log(this.data.Md5); if (this.data.input) { let query = { eMail: this.data.input, @@ -849,11 +768,9 @@ this.setData({ [dialogKey]: false }); - console.log(111); }, onScrollToLower() { if (this.data.tabValue == 0) { - console.log(0); if (this.data.bookData.length < this.data.bookTotal) { this.setData({ isMore: true, @@ -891,7 +808,6 @@ }, 100) } - console.log(2); } else if (this.data.tabValue == 2) { if (this.data.digitalTextbooksData.length < this.data.digitalTextbooksTotal && this.data.digitalTextbooksData.length > 9) { @@ -911,7 +827,6 @@ }, 100) } - console.log(2); } else if (this.data.tabValue == 3) { if (this.data.seminarData.length < this.data.seminarTotal) { this.setData({ @@ -929,7 +844,6 @@ }) }, 100) } - console.log(3); } else if (this.data.tabValue == 4) { if (this.data.bookFairData.length < this.data.bookFairTotal) { this.setData({ @@ -947,7 +861,6 @@ }) }, 100) } - console.log(4); } else if (this.data.tabValue == 5) { if (this.data.biblioClassificationData.length < this.data.biblioClassificationTotal) { this.setData({ @@ -967,16 +880,7 @@ } } }, - onTabsClick(event) { - console.log(` - Click tab, tab - panel value is $ { - event.detail.value - }. - `); - }, - tabClick() { - console.log(2323); - }, + // 婊戝姩鏃惰Е鍙戠殑浜嬩欢 slideOn(e) { // 鎷垮埌褰撳墠绱㈠紩骞跺姩鎬佹敼鍙� -- Gitblit v1.9.1