| | |
| | | { |
| | | "pages": [ |
| | | "pages/student/index", |
| | | "pages/home/home", |
| | | "pages/retrievalPage/index", |
| | | "pages/cart/paymentPage/index", |
| | | "pages/student/index", |
| | | "pages/cart/index", |
| | | "pages/bookExhibitionList/index", |
| | | "pages/bookExhibitionDetails/index", |
| | |
| | | "pages/bookServices/list/index", |
| | | "pages/bookServices/detail/index", |
| | | "pages/bookServices/examination/examination", |
| | | "pages/bookServices/webpage/index" |
| | | "pages/bookServices/webpage/index", |
| | | "pages/components/webView/index" |
| | | ] |
| | | } |
| | | ], |
| | |
| | | export const fontUrl = "http://192.168.3.132:5173"; |
| | | // export const fontUrl = "http://182.92.203.7:3007/jsek/website"; |
| | | // export const fontUrl = "http://jsysf.bnuic.com/website"; |
| | | |
| | | // export const epubUrl = "http://182.92.203.7:3007/epubReadMobile/"; |
| | | export const epubUrl = "http://jsysf.bnuic.com/epubReadMobile/#/"; |
| | | |
| | | const config = { |
| | | requestCtx, |
| | |
| | | seminar, |
| | | fontUrl, |
| | | reg_tel, |
| | | reg_telphone |
| | | reg_telphone, |
| | | epubUrl |
| | | }; |
| | | export default config; |
| | |
| | | const util = require('./components/util') // 引入封装过的加载提示 |
| | | const app = getApp() |
| | | Component({ |
| | | // checked: false, |
| | | |
| | | properties: { |
| | | treeList: { |
| | | type: Array, |
| | |
| | | }, |
| | | data: { |
| | | activeValues: [0], |
| | | webpageSrc: '' |
| | | webpageSrc: '', |
| | | cloudShoppingCart: [] |
| | | }, |
| | | onShow() { |
| | | |
| | |
| | | methods: { |
| | | // 节点展开 |
| | | handleChange(e) { |
| | | // console.log(this.properties.treeList, 'this.properties.treeList'); |
| | | this.setData({ |
| | | activeValues: e.detail.value, |
| | | }); |
| | | console.log('传递', this.properties.buyIds); |
| | | // console.log('传递', this.properties.buyIds); |
| | | }, |
| | | handleCheck(data) { |
| | | for (let index = 0; index < data.length; index++) { |
| | |
| | | }, |
| | | // 跳转音视频播放器 |
| | | goPlayer(e) { |
| | | console.log(e); |
| | | // debugger |
| | | const item = e.currentTarget.dataset.item |
| | | const parent = e.currentTarget.dataset.parent |
| | | let url |
| | |
| | | result.push(...item.children); |
| | | } |
| | | } |
| | | console.log(this.properties.treeList); |
| | | console.log(this.properties.treeList, 'this.properties.treeList'); |
| | | this.properties.treeList.forEach(item => { |
| | | findChildren(item); |
| | | }); |
| | |
| | | }, |
| | | // 拿到当前项子项 |
| | | flattenTree(tree) { |
| | | |
| | | let result = []; |
| | | |
| | | function flatten(node) { |
| | | |
| | | result.push(node); |
| | | |
| | | if (node.children && node.children.length > 0) { |
| | | |
| | | node.children.forEach(child => { |
| | | flatten(child); |
| | | }); |
| | | } |
| | | } |
| | | tree.forEach(node => { |
| | | |
| | | flatten(node); |
| | | }); |
| | | // console.log(result, 'result'); |
| | | return result |
| | | }, |
| | | |
| | | |
| | | |
| | | findAndUpdateItemById(tree, id) { |
| | | function findAndUpdate(node) { |
| | | if (node.id === id) { |
| | |
| | | }, |
| | | // 变为true |
| | | findAndUpdateItemsByIds(tree, ids) { |
| | | |
| | | function findAndUpdate(node) { |
| | | |
| | | if (ids.includes(node.id)) { |
| | | node.checked = true; // 将目标项的 check 属性设置为 true |
| | | // console.log(node, 'node'); |
| | | node.checked = !node.checked // 将目标项的 check 属性设置为 true |
| | | } |
| | | if (node.children && node.children.length > 0) { |
| | | for (let child of node.children) { |
| | |
| | | } |
| | | |
| | | for (let node of tree) { |
| | | |
| | | findAndUpdate(node); // 对每个顶层节点执行查找和更新操作 |
| | | } |
| | | // console.log(tree, 'tree345'); |
| | | return tree; // 返回修改后的完整数组 |
| | | }, |
| | | |
| | | // 章节勾选 |
| | | checkResourceTitle(e) { |
| | | // 这个时候checked的值是fals |
| | | const item = e.currentTarget.dataset.item |
| | | console.log(item, 'item'); |
| | | |
| | | let list = this.flattenTree([item]) |
| | | |
| | | |
| | | let ids = [] |
| | | list.forEach(item => { |
| | | ids.push(item.id) |
| | | }) |
| | | const tab = this.findAndUpdateItemsByIds([item], ids) |
| | | console.log(ids, tab); |
| | | |
| | | const updatedTreeList = this.findAndUpdateItemsByIds(this.properties.treeList, ids); |
| | | // console.log(updatedTreeList, 'updatedTreeList'); //这个时候checked的值就变成了true |
| | | |
| | | this.setData({ |
| | | treeList: updatedTreeList // 更新 treeList 数据 |
| | | }); |
| | | |
| | | console.log(list, 'list'); |
| | | list.forEach(items => { |
| | | console.log(items.checked, 'itesasd'); |
| | | if (!items.checked) { |
| | | this.setData({ |
| | | cloudShoppingCart: items |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | this.onCloudShoppingCart() |
| | | }, |
| | | onCloudShoppingCart() { |
| | | console.log(this.properties.treeList); |
| | | // 子项勾选 |
| | | checkResource(e) { |
| | | const item = e.currentTarget.dataset.item |
| | | |
| | | |
| | | // let list = this.flattenTree([item]) |
| | | // console.log(list, 'list121'); |
| | | // let ids = [] |
| | | // list.forEach(items => { |
| | | // console.log(items.id, 'itemsId'); |
| | | // ids.push(items.id) |
| | | // }) |
| | | }, |
| | | oncheckbox() { |
| | | console.log(111); |
| | | }, |
| | | logdata(e) { |
| | | console.log(e); |
| | | // 加入购物车 |
| | | async onCloudShoppingCart() { |
| | | let requests = [] |
| | | const item = this.data.cloudShoppingCart |
| | | console.log(item, 'item'); |
| | | item.forEach((items) => { |
| | | if (items.saleMethod.length) { |
| | | requests.push({ |
| | | saleMethodId: items.saleMethod[0].Id, |
| | | count: 1 |
| | | }) |
| | | } |
| | | }) |
| | | let query = { |
| | | remarks: '云学习', |
| | | requests |
| | | } |
| | | // 查询订单 |
| | | let initOrderRes = await app.MG.store.initOrder(query) |
| | | let parameter = { |
| | | orderNum: initOrderRes.orderNumber |
| | | } |
| | | const confirmOrderRes = await app.MG.store.confirmOrder(parameter) |
| | | // if (confirmOrderRes.orderNumber) { |
| | | // wx.navigateTo({ |
| | | // url: `/pages/cart/paymentPage/index?orderNumber=${confirmOrderRes.orderNumber}`, |
| | | // }) |
| | | // requests = [] |
| | | // } |
| | | }, |
| | | }, |
| | | }) |
| | |
| | | <view slot="header" class="header-title"> |
| | | <view wx:if="{{tab == 'jsek_cloudLearning'}}"> |
| | | <t-checkbox icon="rectangle" checked="{{item.checked}}" data-item="{{item}}" bind:change="checkResourceTitle" /> |
| | | <!-- <t-checkbox icon="rectangle" checked="{{true}}" data-item="{{item}}" bind:change="checkResourceTitle" /> --> |
| | | |
| | | </view> |
| | | <text>{{item.name}}</text> |
| | | </view> |
| | |
| | | <view class="box-image" style="{{ tab == 'jsek_teachingResources' ? 'width: 350rpx;' : 'width: 450rpx;'}}"> |
| | | <view class="checkBox" wx:if="{{tab == 'jsek_cloudLearning'}}"> |
| | | <!-- checked="{{citem.checked}}" --> |
| | | <t-checkbox icon="rectangle" checked="{{citem.checked}}" disabled="{{citem.selectType=='webpage' || citem.isDownload != 1 || citem.fileMap[citem.file].protectType == 'Private'}}" catch:change="checkResource" data-item="{{citem}}" /> |
| | | <!-- <t-checkbox icon="rectangle" checked="{{citem.checked}}" disabled="{{citem.selectType=='webpage' || citem.isDownload != 1 || citem.fileMap[citem.file].protectType == 'Private'}}" catch:change="checkResource" data-item="{{citem}}" /> --> |
| | | <t-checkbox icon="rectangle" checked="{{citem.checked}}" data-item="{{citem}}" catch:change="checkResource" /> |
| | | </view> |
| | | <!-- 教学资源图标 --> |
| | | <view class="teach-icon"> |
| | |
| | | console.log('教学资源', this.data.teach); |
| | | this.findChildIds(this.data.teach, this.data.openTeachids = []) |
| | | } else if (type.refCode == 'jsek_cloudLearning') { |
| | | // res.datas.cmsDatas[0].datas.forEach(item => { |
| | | // item.checked = false |
| | | // }) |
| | | // const list = await this.getAllResource(res.datas.cmsDatas[0].datas) |
| | | console.log(list, 'currentlist'); |
| | | res.datas.cmsDatas[0].datas.forEach(item => { |
| | | item.checked = false |
| | | }) |
| | | const list = await this.getAllResource(res.datas.cmsDatas[0].datas) |
| | | console.log(list, 'list'); |
| | | this.setData({ |
| | | learn: list, |
| | | loading: false |
| | |
| | | async allAddShoppiingCar() { |
| | | const child = this.selectComponent('#learn-resource') |
| | | const token = wx.getStorageSync('jsek-token') |
| | | if (!token) { |
| | | return wx.getUserProfile({ |
| | | desc: '用户登录', |
| | | success: (res) => { |
| | | console.log(res); |
| | | } |
| | | }) |
| | | } |
| | | // if (!token) { |
| | | // return wx.getUserProfile({ |
| | | // desc: '用户登录', |
| | | // success: (res) => { |
| | | // console.log(res); |
| | | // } |
| | | // }) |
| | | // } |
| | | let shopList = this.handleTreeData(this.data.learn).filter((item) => this.resourceIsBuy(item)) |
| | | this.getShoppingCartProductGet() |
| | | if (!shopList.length) return wx.showToast({ |
| | |
| | | }) |
| | | res = await app.MG.store.initOrder(query) |
| | | } |
| | | |
| | | if (res.orderNumber && this.data.mockData.price) { |
| | | wx.navigateTo({ |
| | | url: `/pages/cart/paymentPage/index?orderNumber=${res.orderNumber}`, |
| | |
| | | this.buyBook() |
| | | } |
| | | else if (this.data.tabValue == 'jsek_cloudLearning') { |
| | | console.log('云学习'); |
| | | const tree = this.selectComponent('#tree') |
| | | |
| | | tree.onCloudShoppingCart() |
| | | |
| | | |
| | | } else if (this.data.tabValue == 'questionBank') { |
| | | this.buyMock() |
| | | } else { |
| | | console.log(this.data.tabValue); |
| | | } |
| | | } |
| | | }, |
| | | |
| | | }) |
| | |
| | | <t-tab-panel label="云学习" value="jsek_cloudLearning" style="{{tabPanelstyle}}"> |
| | | <view wx:if="{{!loading && learn.length}}"> |
| | | <learn-resource bind:getFreeResource="getFreeResource" bind:allAddShoppiingCar="allAddShoppiingCar" id="learn-resource"></learn-resource> |
| | | <tree bookInfo="{{bookDetail}}" tab="{{tabValue}}" treeList="{{learn}}" buyIds="{{buyIdList}}" openLearnids="{{openLearnids}}"></tree> |
| | | <tree id="tree" bookInfo="{{bookDetail}}" tab="{{tabValue}}" treeList="{{learn}}" buyIds="{{buyIdList}}" openLearnids="{{openLearnids}}"></tree> |
| | | </view> |
| | | </t-tab-panel> |
| | | <t-tab-panel label="云测试" value="questionBank" style="{{tabPanelstyle}}"> |
| | |
| | | .box-bottom { |
| | | position: fixed; |
| | | left: 0; |
| | | bottom: 40rpx; |
| | | bottom: env(safe-area-inset-bottom); |
| | | width: 100%; |
| | | height: 110rpx; |
| | | } |
New file |
| | |
| | | // packageBookService/pages/components/webView/index.js |
| | | const app = getApp() |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | src: "", |
| | | link: false, |
| | | epubObj: null, |
| | | currentPage: '', |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | if (options && options.link) { |
| | | this.setData({ |
| | | src: decodeURIComponent(options.link), |
| | | link: options.link ? true : false, |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | epubObj: options, |
| | | src: '' |
| | | }) |
| | | if (options) { |
| | | wx.setNavigationBarTitle({ |
| | | title: options.fileName, |
| | | }) |
| | | this.getProgress(options) |
| | | } |
| | | } |
| | | }, |
| | | |
| | | onLoadWeb(e) { |
| | | console.log(e, "load") |
| | | }, |
| | | |
| | | onError(e) { |
| | | console.log(e, "err") |
| | | }, |
| | | |
| | | setWebViewSrc: function (data) { |
| | | var url = app.config.epubUrl + |
| | | "?md5=" + |
| | | data.md5 + |
| | | "&bookName=" + |
| | | data.fileName + |
| | | "&url=" + app.config.requestCtx + |
| | | "&token=" + |
| | | wx.getStorageSync(app.config.tokenKey) + |
| | | "&recordLocation=" + |
| | | this.data.currentPage |
| | | this.setData({ |
| | | src: url |
| | | }) |
| | | }, |
| | | |
| | | |
| | | // 获取UserKey |
| | | getProgress: function (dataObj) { |
| | | app.MG.identity |
| | | .getUserKey({ |
| | | domain: "bookReadProgress", |
| | | keys: [this.data.epubObj.md5], |
| | | }) |
| | | .then((res) => { |
| | | if (res.length) { |
| | | try { |
| | | this.setData({ |
| | | currentPage: JSON.parse(res[0].value).page, |
| | | }); |
| | | } catch (error) { |
| | | this.setData({ |
| | | currentPage: "", |
| | | }); |
| | | } |
| | | if (this.data.currentPage > this.data.probationPage) { |
| | | this.setData({ |
| | | currentPage: "", |
| | | }); |
| | | } |
| | | } |
| | | this.setWebViewSrc(dataObj); |
| | | }); |
| | | }, |
| | | // 设置userKey |
| | | setProgress: function (data) { |
| | | if (data.page && data.page != this.data.currentPage) { |
| | | app.MG.identity |
| | | .setUserKey({ |
| | | setKeyRequests: [{ |
| | | domain: "bookReadProgress", |
| | | key: this.data.epubObj.md5, |
| | | value: JSON.stringify(data), |
| | | },], |
| | | }) |
| | | .then((res) => { }); |
| | | } |
| | | }, |
| | | |
| | | drawBack(e) { |
| | | let { |
| | | currentLocation, |
| | | percentage, |
| | | type |
| | | } = |
| | | e.detail.data[0]; |
| | | if (type == "progress" && type != "backDetail") { |
| | | this.setProgress({ |
| | | page: currentLocation, |
| | | progress: percentage, |
| | | }); |
| | | } else if (type == "backDetail") { |
| | | this.setProgress({ |
| | | page: 1, |
| | | progress: "0%", |
| | | }); |
| | | } |
| | | }, |
| | | /** |
| | | * 生命周期函数--监听页面初次渲染完成 |
| | | */ |
| | | onReady() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面卸载 |
| | | */ |
| | | onUnload() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页面相关事件处理函数--监听用户下拉动作 |
| | | */ |
| | | onPullDownRefresh() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | | onReachBottom() { |
| | | |
| | | }, |
| | | }) |
New file |
| | |
| | | { |
| | | "navigationBarTitleText": "京师E课", |
| | | "usingComponents": {} |
| | | } |
New file |
| | |
| | | <!--packageBookService/pages/components/webView/index.wxml--> |
| | | <view class="page-body"> |
| | | <web-view bind:message="drawBack" binderror="onError" bindload="onLoadWeb" src="{{src}}"></web-view> |
| | | </view> |
New file |
| | |
| | | /* packageBookService/pages/components/webView/index.wxss */ |
| | | .page-body { |
| | | width: 100vw; |
| | | height: calc(100vh - env(safe-area-inset-bottom)); |
| | | overflow: hidden; |
| | | } |
| | |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | showDropdown: false, |
| | | noteList: [], |
| | | navBarHeight: '', |
| | | barHeight: '', |
| | |
| | | myAudio.onCanplay(() => { |
| | | myAudio.duration; //必须写,不然获取不到。。。 |
| | | setTimeout(() => { |
| | | console.log(myAudio.duration); |
| | | console.log(myAudio.duration, 'myAudio.duration'); |
| | | this.setData({ |
| | | myAudioDuration: this.format(myAudio.duration), |
| | | myAudioCurrent: this.format(myAudio.currentTime) |
| | |
| | | myAudioPos: position, |
| | | myAudioCurrent: this.format(currentTime) |
| | | }) |
| | | }, |
| | | |
| | | |
| | | toggleDropdown() { |
| | | this.setData({ |
| | | showDropdown: !this.data.showDropdown |
| | | }); |
| | | }, |
| | | smallSpeed() { |
| | | this.setData({ |
| | | speed: 0.5, |
| | | showDropdown: !this.data.showDropdown |
| | | }) |
| | | }, |
| | | centreSpeed() { |
| | | this.setData({ |
| | | speed: 1.5, |
| | | showDropdown: !this.data.showDropdown |
| | | }) |
| | | }, |
| | | bigSpeed() { |
| | | this.setData({ |
| | | speed: 2, |
| | | showDropdown: !this.data.showDropdown |
| | | }) |
| | | }, |
| | | smallSpeeDmultiple() { |
| | | this.setData({ |
| | | speed: 1, |
| | | showDropdown: !this.data.showDropdown |
| | | }) |
| | | } |
| | | |
| | | |
| | | }) |
| | |
| | | "t-textarea": "tdesign-miniprogram/textarea/textarea", |
| | | "t-loading": "tdesign-miniprogram/loading/loading", |
| | | "t-popup": "tdesign-miniprogram/popup/popup", |
| | | "t-slider": "tdesign-miniprogram/slider/slider" |
| | | "t-slider": "tdesign-miniprogram/slider/slider", |
| | | "t-dropdown-menu": "tdesign-miniprogram/dropdown-menu/dropdown-menu", |
| | | "t-dropdown-item": "tdesign-miniprogram/dropdown-item/dropdown-item" |
| | | }, |
| | | "navigationStyle": "custom" |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | |
| | | <view class="audioPlayerBox"> |
| | | <view class="audioBackground" style="background-image: url('/static/images/resourceDetailsMyAudio/video-bg.png');"> |
| | | |
| | | <image src="/static/images/resourceDetailsMyAudio/cd.png" alt="" /> |
| | | </view> |
| | | <!-- 视频播放的按钮 --> |
| | | <view class="bigFunctionBox"> |
| | | |
| | | |
| | | <view class="functionBox"> |
| | | <!-- 左切换 --> |
| | | <!-- <view class="leftSwitchBox color" bind:tap="onLeftSwitch"> |
| | |
| | | <view class="color" style="margin: 0 10rpx;">/</view> |
| | | <view class="duration-time color"> {{myAudioDuration}} </view> |
| | | |
| | | <view class="publicBtn color" style="margin-left:40rpx ; width: 80rpx;" bind:tap="onSpeed"> |
| | | |
| | | <text class="publicText">{{"x "+speed}}</text> |
| | | <!-- bind:tap="onSpeed" --> |
| | | <view class="publicBtn color"> |
| | | <view class="publicText" bind:tap="toggleDropdown"> |
| | | <view> |
| | | {{"x "+speed}} |
| | | </view> |
| | | <t-icon style="margin-top: 10rpx;" wx:if="{{showDropdown}}" name="caret-up-small" size="14" bind:click="onIconTap" /> |
| | | <t-icon style="margin-top: 10rpx;" wx:else name="caret-down-small" size="14" bind:click="onIconTap" /> |
| | | </view> |
| | | <view class="multipleBox" wx:if="{{showDropdown}}"> |
| | | <view wx:if="{{speed != 0.5}}" style="margin: 5rpx 0;" bind:tap="smallSpeed">x0.5</view> |
| | | <view wx:if="{{speed != 1}}" style="margin: 5rpx 0;" bind:tap="smallSpeeDmultiple">x1</view> |
| | | <view wx:if="{{speed != 1.5}}" style="margin: 5rpx 0;" bind:tap="centreSpeed">x1.5</view> |
| | | <view wx:if="{{speed != 2}}" style="margin: 5rpx 0;" bind:tap="bigSpeed">x2</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | </view> |
| | | </view> |
| | | |
| | | <!-- 标题 --> |
| | | <view class="titleBox">{{titleName}}</view> |
| | | |
| | | <view class="contentBox"> |
| | | <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" t-class-content="custom-panel"> |
| | | <!-- 资源列表 --> |
| | |
| | | |
| | | .audioBackground { |
| | | flex: 1; |
| | | background-size: 100% 110%; |
| | | /* background-image: no-repeat; */ |
| | | background-repeat: no-repeat; |
| | | background-position: center center; |
| | | background-size: 100% 100%; |
| | | background-color: #f9f9f9; |
| | | display: flex; |
| | | justify-content: center; |
| | |
| | | |
| | | .t-tabs__item--active { |
| | | color: #FF6C00 !important; |
| | | |
| | | } |
| | | |
| | | .t-tabs__track { |
| | |
| | | .audioIconBox { |
| | | /* margin-top: 10rpx; */ |
| | | } |
| | | |
| | | .publicBtn { |
| | | margin-right: 10rpx; |
| | | /* margin-left: 40rpx; */ |
| | | margin-left: 20rpx; |
| | | width: 120rpx; |
| | | position: relative; |
| | | } |
| | | |
| | | .multipleBox { |
| | | position: absolute; |
| | | /* top: 0; */ |
| | | bottom: 60rpx; |
| | | right: 10rpx; |
| | | background-color: #000; |
| | | padding: 15rpx; |
| | | font-size: 25rpx; |
| | | /* padding-bottom: 100rpx; */ |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | .publicText { |
| | | display: flex; |
| | | |
| | | } |
| | |
| | | // packagePersonal/pages/userSetting/index.js |
| | | const app = getApp() |
| | | Page({ |
| | | |
| | | /** |
| | | * 页面的初始数据 |
| | | */ |
| | | data: { |
| | | |
| | | userInfo: {}, |
| | | defaultAvatarUrl: 'https://cdn-we-retail.ym.tencent.com/miniapp/usercenter/icon-user-center-avatar@2x.png', |
| | | visible: false |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | onLoad() { |
| | | if (wx.getStorageSync(app.config.tokenKey)) { |
| | | this.getUserInfo() |
| | | } |
| | | }, |
| | | |
| | | /** |
| | |
| | | onShow() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面隐藏 |
| | | */ |
| | | onHide() { |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面卸载 |
| | | */ |
| | | onUnload() { |
| | | |
| | | // 获取登录用户身份 |
| | | getUserInfo() { |
| | | app.MG.identity.getCurrentAppUser().then(res => { |
| | | // 用户信息优先级:教师认证 > 微信 > 学生(注册时默认) |
| | | if (res) { |
| | | let defaultUser = {}; |
| | | let teacherRole = res.roleLinks.find((item) => item.role.refCode == 'teacher') |
| | | let teacherInfos = res.infoList.find((item) => item.type == 'teacherInfo') |
| | | let secretData = res.secretList.find(i => i.type == 'LoginNameAndPassword') |
| | | let WeChatInfo = res.infoList.find((item) => item.type === "WeChat"); |
| | | let phoneInfo = res.secretList.find((item) => item.type == 'MobilePhone') |
| | | let emailInfo = res.secretList.find((item) => item.type == 'EMail') |
| | | if (teacherRole && teacherInfos) { |
| | | defaultUser = { |
| | | ...teacherInfos, |
| | | fullName: teacherInfos.fullName, |
| | | icon: teacherInfos.icon, |
| | | userId: res.userId, |
| | | role: 'Teacher', |
| | | roleId: teacherRole.role.id, |
| | | phoneNumber: phoneInfo?.credential, |
| | | Email: emailInfo ? emailInfo.credential : JSON.parse(teacherInfos.data).email |
| | | } |
| | | } else if (WeChatInfo) { |
| | | defaultUser = { |
| | | ...WeChatInfo, |
| | | fullName: WeChatInfo.name, |
| | | icon: WeChatInfo.icon, |
| | | userId: res.userId, |
| | | phoneNumber: phoneInfo?.credential, |
| | | Email: emailInfo?.credential |
| | | } |
| | | } else if (secretData) { |
| | | defaultUser = { |
| | | fullName: secretData.credential, |
| | | icon: "", |
| | | userId: res.userId, |
| | | phoneNumber: phoneInfo?.credential, |
| | | Email: emailInfo?.credential |
| | | } |
| | | } |
| | | this.setData({ |
| | | userInfo: defaultUser |
| | | }) |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | /** |
| | |
| | | { |
| | | "usingComponents": {} |
| | | "navigationBarTitleText": "设置", |
| | | "usingComponents": { |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-avatar": "tdesign-miniprogram/avatar/avatar" |
| | | } |
| | | } |
| | |
| | | <!--packagePersonal/pages/userSetting/index.wxml--> |
| | | <text>packagePersonal/pages/userSetting/index.wxml</text> |
| | | <view class="container"> |
| | | <view class="itemList"> |
| | | <view class="label">头像</view> |
| | | <view class="contentImg"> |
| | | <t-avatar image="{{defaultAvatarUrl}}" class="user-center-card__header__avatar" /> |
| | | </view> |
| | | <t-icon name="chevron-right" size="40rpx" color="#C2C2C2" /> |
| | | </view> |
| | | <view class="itemList"> |
| | | <view class="label">用户名</view> |
| | | <view class="content">{{userInfo.fullName || '微信用户'}}</view> |
| | | <t-icon name="chevron-right" size="40rpx" color="#C2C2C2" /> |
| | | </view> |
| | | <view class="itemList"> |
| | | <view class="label">手机号码</view> |
| | | <view class="content">{{userInfo.phoneNumber || '未绑定手机号'}}</view> |
| | | <t-icon name="chevron-right" size="40rpx" color="#C2C2C2" /> |
| | | </view> |
| | | <view class="itemList"> |
| | | <view class="label">邮箱</view> |
| | | <view class="content">{{userInfo.Email}}</view> |
| | | <t-icon name="chevron-right" size="40rpx" color="#C2C2C2" /> |
| | | </view> |
| | | </view> |
| | | <t-popup visible="{{visible}}" bind:visible-change="onVisibleChange" placement="bottom"> |
| | | <view class="block"> |
| | | <view class="header"> |
| | | <view class="title">请选择您的用户类型</view> |
| | | </view> |
| | | <view class="body"> |
| | | |
| | | <view wx:for="{{userTypeList}}" wx:for-item="item" wx:for-index="index" wx:key="index" data-info="{{item}}" bindtap="tabUserTypeClick" class="{{item.value === userTypeActive ? 'activeItem item' : 'item'}}"> |
| | | {{ item.lable }} |
| | | </view> |
| | | </view> |
| | | <view class="footer"> |
| | | <button class="submit" bindtap="submit">确定</button> |
| | | </view> |
| | | </view> |
| | | </t-popup> |
| | |
| | | /* packagePersonal/pages/userSetting/index.wxss */ |
| | | .container { |
| | | padding: 20rpx 0; |
| | | } |
| | | |
| | | .itemList { |
| | | border-bottom: 2rpx solid #E9E9E9; |
| | | padding: 30rpx; |
| | | display: flex; |
| | | /* height: 120rpx; */ |
| | | align-items: center; |
| | | justify-content: space-between !important; |
| | | } |
| | | |
| | | .label { |
| | | font-weight: bold; |
| | | width: 180rpx; |
| | | } |
| | | |
| | | .contentImg { |
| | | height: 120rpx; |
| | | width: 120rpx; |
| | | flex: 1; |
| | | text-align: right; |
| | | margin-right: 20rpx; |
| | | } |
| | | |
| | | .user-center-card__header__avatar { |
| | | width: 120rpx; |
| | | height: 120rpx; |
| | | border-radius: 48rpx; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .content { |
| | | flex: 1; |
| | | color: #5C5C5C; |
| | | } |
| | |
| | | onPullDownRefresh() { |
| | | |
| | | }, |
| | | |
| | | onPullDownRefresh() { |
| | | this.data.page.size = 16 //更改显示的值 |
| | | this.bookExhibitionGet(); // 调用方法加载更多数据 |
| | | }, |
| | | /** |
| | | * 页面上拉触底事件的处理函数 |
| | | */ |
| | |
| | | 'page.size': newSize |
| | | }); |
| | | this.bookExhibitionGet(); // 调用方法加载更多数据 |
| | | console.log(1111); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | "t-icon": "tdesign-miniprogram/icon/icon" |
| | | }, |
| | | "onReachBottomDistance": 200, |
| | | "navigationStyle": "custom" |
| | | "navigationStyle": "custom", |
| | | "enablePullDownRefresh": true |
| | | } |
| | |
| | | |
| | | |
| | | </t-dropdown-menu> |
| | | |
| | | |
| | | |
| | | <view class="outsideSortBox"> |
| | | <view class="sortBox" bind:tap="onSwapRight"> |
| | | <text>排序</text> |
| | | <view class="iconBox"> |
| | |
| | | </view> |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | <view class="assembleContent"> |
| | | <view class="titleBox"> |
| | | <view class="frameBox"></view> |
| | |
| | | /* width: 300px; */ |
| | | background-color: #fff; |
| | | /* padding: 16rpx 32rpx; */ |
| | | |
| | | } |
| | | |
| | | .iconBox { |
| | |
| | | .sortBox { |
| | | color: #999999; |
| | | display: flex; |
| | | /* border-bottom: 1px #ededed solid; */ |
| | | align-items: center; |
| | | height: 86rpx; |
| | | width: 195rpx; |
| | | margin-top: 8rpx; |
| | | font-size: 30rpx; |
| | | font-size: 25rpx; |
| | | } |
| | | |
| | | .outsideSortBox { |
| | | width: 96rpx; |
| | | height: 95rpx; |
| | | margin: 0 15rpx; |
| | | box-shadow: 0px 0px 1px 0px rgba(0, 0, 0, 0.16); |
| | | padding: 0 10rpx; |
| | | } |
| | | |
| | | .sortBox text { |
| | | font-family: PingFang SC, PingFang SC; |
| | | font-weight: 400; |
| | | font-size: 25rpx; |
| | | color: #999999; |
| | | } |
| | | |
| | | .titleBox { |
| | | display: flex; |
| | |
| | | height: 54rpx; |
| | | background: #FF6C00; |
| | | border-radius: 0rpx 9rpx 9rpx 0rpx; |
| | | |
| | | } |
| | | |
| | | .titleTextBox { |
| | | |
| | | margin-left: 5px; |
| | | |
| | | width: 150rpx; |
| | | height: 37rpx; |
| | | |
| | | |
| | | } |
| | | |
| | | .classification { |
| | | width: 550rpx; |
| | | /* margin-bottom: 50rpx; */ |
| | | |
| | | margin: 0 30rpx; |
| | | } |
| | | |
| | | .menuBox { |
| | | display: flex; |
| | | height: 75rpx; |
| | | |
| | | } |
| | | |
| | | .assembleContent { |
| | | background-color: #F2F3F8; |
| | | } |
| | | |
| | | /* .t-dropdown-menu__item--active { |
| | | color: #0F1214; |
| | | } */ |
| | | |
| | | .t-dropdown-menu:after, |
| | | .t-dropdown-menu::after { |
| | | height: 0px; |
| | | } |
| | | |
| | | |
| | | .t-dropdown-item__body, |
| | | .t-dropdown-item__footer, |
| | | .t-radio { |
| | | background: #F6F6F6 !important; |
| | | } |
| | | |
| | | .t-dropdown-item__body { |
| | | padding: 40rpx 0; |
| | | } |
| | | |
| | | .t-dropdown-menu__item { |
| | | margin: 10rpx 10rpx 0 10rpx; |
| | | border-radius: 40rpx; |
| | | height: 68rpx; |
| | | background: #F6F6F6 !important; |
| | | } |
| | | |
| | | .t-dropdown-menu__item--active { |
| | | height: 68rpx !important; |
| | | background: #F6F6F6 !important; |
| | | /* border-radius: 40rpx 40rpx 0 0; */ |
| | | } |
| | | |
| | | .t-dropdown-menu__item--active, |
| | | .t-radio__icon--checked, |
| | | .t-checkbox__icon--checked { |
| | | color: #FF6C00 !important |
| | | } |
| | | |
| | | .t-checkbox__icon--disabled { |
| | | color: #c0c4cc !important; |
| | | } |
| | | |
| | | .t-radio--block { |
| | | padding: 20rpx !important; |
| | | } |
| | | |
| | | .t-radio__border { |
| | | height: 0 !important; |
| | | } |
| | | |
| | | /* .t-button--primary { |
| | | color: #fff !important; |
| | | background-color: #FF6C00 !important; |
| | | |
| | | } |
| | | |
| | | .t-button--light { |
| | | color: #fff !important; |
| | | /* background-color: #FF6C00 !important; */ |
| | | /* } */ |
| | | |
| | | /* .menu--t-dropdown-menu::after { |
| | | background-color: var(--td-component-border, var(--td-gray-color-4, #fff)) !important; |
| | | |
| | | } |
| | | */ |
| | |
| | | }); |
| | | this.shoppingCartGet(); |
| | | }, |
| | | |
| | | onShow() { |
| | | this.shoppingCartGet(); |
| | | }, |
| | | onDelete(e) { |
| | | const item = e.currentTarget.dataset.item; |
| | | app.MG.store.delShoppingCart({ |
| | |
| | | direction: 'column', |
| | | }); |
| | | } |
| | | }, |
| | | onLogin() { |
| | | wx.navigateTo({ |
| | | url: '/pages/testLogin/index' |
| | | }); |
| | | } |
| | | }); |
| | |
| | | <view class="outsideContentBox"> |
| | | <!-- <checkbox-group bindchange="HandelItemChange"> --> |
| | | <view wx:if="{{!shoppingCartData}}" class="noDataBox"> |
| | | <view wx:if="{{shoppingCartData.length <= 0}}" class="noDataBox"> |
| | | <t-empty icon="folder-open" description="暂无数据" font-size="80" /> |
| | | |
| | | </view> |
| | | <!-- <button bind:tap="onLogin"> 去登录</button> --> |
| | | <t-swipe-cell wx:for="{{shoppingCartData}}" wx:key="index" wx:for-item="item" wx:for-index="index"> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- <view class="contentBox"> --> |
| | | <!-- <view class="contentCheckbox"> |
| | | <checkbox value="{{item.id}}" checked="{{item.checked}}"></checkbox> |
| | |
| | | </view> |
| | | <view slot="right" class="btn delete-btn" bind:tap="onDelete" data-item="{{item}}">删除</view> |
| | | </t-swipe-cell> |
| | | |
| | | </view> |
| | | |
| | | <view class="bottomBox"> |
| | |
| | | } |
| | | |
| | | .bottomBox { |
| | | background-color: #0052d9; |
| | | position: fixed; |
| | | bottom: 0; |
| | | /* bottom: 0; */ |
| | | left: 0; |
| | | right: 0; |
| | | |
| | | padding-bottom: 53px; |
| | | height: 112rpx; |
| | | bottom: calc(env(safe-area-inset-bottom) + 112rpx); |
| | | height: 120rpx; |
| | | background: #FFFFFF; |
| | | box-shadow: 0rpx -2rpx 0rpx 2rpx rgba(0, 0, 0, 0.08); |
| | | display: flex; |
| | |
| | | purchasedIds: [], |
| | | productList: [], |
| | | payPrice: '', |
| | | drawQrcodeText: 'https://www.baidu.com/', |
| | | orderGoods: '', |
| | | |
| | | |
| | | confirmBtn: { content: '确定', variant: 'base' }, |
| | | dialogKey: 'false', |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad(options) { |
| | | |
| | | const systInfo = wx.getSystemInfoSync(); |
| | | const menu = wx.getMenuButtonBoundingClientRect(); // 胶囊信息 |
| | | const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 导航栏高度 |
| | |
| | | selectedIds: options.selectedIds |
| | | }) |
| | | console.log('接收到的订单号:', this.data.orderNumber); |
| | | |
| | | |
| | | this.getOrderByOrderNum() |
| | | |
| | | |
| | | |
| | | |
| | | drawQrcode({ |
| | | |
| | | width: 200, // 必须,二维码宽度,与canvas的width保持一致 |
| | | |
| | | height: 200, // 必须,二维码高度,与canvas的height保持一致 |
| | | |
| | | canvasId: 'myQrcode', |
| | | |
| | | background: '#ffffff', // 非必须,二维码背景颜色,默认值白色 |
| | | |
| | | foreground: '#2bb15e', // 非必须,二维码前景色,默认值黑色 '#000000' |
| | | |
| | | // ctx: wx.createCanvasContext('myQrcode'), // 非必须,绘图上下文,可通过 wx.createCanvasContext('canvasId') 获取,v1.0.0+版本支持 |
| | | |
| | | text: this.data.drawQrcodeText, // 必须,二维码内容 |
| | | // v1.0.0+版本支持在二维码上绘制图片 |
| | | |
| | | image: { |
| | | // imageResource: '../../images/icon.png', // 指定二维码小图标 |
| | | dx: 70, |
| | | dy: 70, |
| | | dWidth: 60, |
| | | dHeight: 60 |
| | | } |
| | | }) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | }, |
| | | |
| | | /** |
| | |
| | | orderNum: this.data.orderGoods |
| | | } |
| | | app.MG.store.confirmOrder(query).then(res => { |
| | | this.makeWeChatQrPayGet() |
| | | }) |
| | | // 调取微信二维码支付 |
| | | console.log(res.orderNumber, 'res'); |
| | | if (res.orderNumber) { |
| | | const resOrderNum = { |
| | | orderNum: res.orderNumber, |
| | | }; |
| | | |
| | | }, |
| | | // 调取微信二维码支付 |
| | | makeWeChatQrPayGet() { |
| | | let query = { |
| | | orderNum: this.data.orderGoods |
| | | // 用户未绑定微信 报500 |
| | | app.MG.store.makeWeChatPay(resOrderNum).then(payRes => { |
| | | const payVal = JSON.parse(payRes); |
| | | console.log(payVal); |
| | | }) |
| | | } |
| | | app.MG.store.makeWeChatQrPay(query).then((res) => { |
| | | |
| | | this.setData({ |
| | | drawQrcodeText: res |
| | | // this.makeWeChatQrPayGet() |
| | | }) |
| | | this.data.dialogKey = true |
| | | console.log(this.data.drawQrcodeText, 'drawQrcodeText'); |
| | | }) |
| | | // 调取微信二维码支付 |
| | | }, |
| | | showDialog(e) { |
| | | const { key } = e.currentTarget.dataset; |
| | | this.setData({ [key]: true, dialogKey: key }); |
| | | }, |
| | | closeDialog() { |
| | | const { dialogKey } = this.data; |
| | | this.setData({ [dialogKey]: false }); |
| | | }, |
| | | |
| | | }) |
| | |
| | | |
| | | <view class="paymentPageBox"> |
| | | <view class="content"> |
| | | <t-dialog visible="{{showCloseBtn}}" close-btn bind:confirm="closeDialog" bind:cancel="closeDialog"> |
| | | <view slot="content" class="slotContent"> |
| | | <view class="myQrcodeBox"> |
| | | <canvas style="width: 200px; height: 200px;margin:0 auto" canvas-id="myQrcode"></canvas> |
| | | <view class="myQrcodeTextBox">微信扫码支付</view> |
| | | </view> |
| | | </view> |
| | | </t-dialog> |
| | | |
| | | <view class="shoppingCartList"> |
| | | <view class="cartList" wx:for="{{productList}}" wx:key="index" wx:for-item="item" wx:for-index="index"> |
| | | <view class="imageBox"> |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <view style="text-align: center; color: #b9b9b9" wx:if="{{pageLoading}}"> |
| | | <t-loading theme="circular" size="40rpx" text="加载中..." inherit-color /> |
| | | </view> |
| | |
| | | let userTypeData = res.infoList.find((item) => item.type == 'userType') |
| | | let type = ""; |
| | | if (userTypeData) { |
| | | this.data.userTypeActive = JSON.parse(userTypeData.data).userType; |
| | | this.setData({ |
| | | userTypeActive: JSON.parse(userTypeData.data).userType, |
| | | }); |
| | | type = userTypeList.find((item) => item.value === this.data.userTypeActive)?.lable; |
| | | } else { |
| | | type = '-' |
| | |
| | | }, |
| | | //修改用户类型 |
| | | editUserType() { |
| | | console.log(44) |
| | | if (!this.data.visible) { |
| | | this.setData({ |
| | | visible: true, |
| | |
| | | this.setData({ |
| | | visible: e.detail.visible, |
| | | }); |
| | | }, |
| | | tabUserTypeClick(e) { |
| | | console.log(e) |
| | | let { info } = e.currentTarget.dataset; |
| | | this.setData({ |
| | | userTypeActive: info.value, |
| | | }); |
| | | }, |
| | | submit() { |
| | | let userTypeInfo = { |
| | | requests: [ |
| | | { |
| | | data: JSON.stringify({ userType: this.data.userTypeActive }), |
| | | name: '用户类型', |
| | | type: 'userType' |
| | | } |
| | | ] |
| | | } |
| | | app.MG.identity.setAppUserInfo(userTypeInfo).then((res) => { |
| | | if (res) { |
| | | wx.showToast({ |
| | | title: "修改成功", |
| | | icon: 'success', |
| | | duration: 1000, |
| | | }) |
| | | this.getUserInfo() |
| | | this.setData({ |
| | | visible: false, |
| | | }); |
| | | } |
| | | }) |
| | | }, |
| | | //设置 |
| | | gotoUserEditPage() { |
| | |
| | | onShareAppMessage() { |
| | | |
| | | }, |
| | | //跳转关于我们和联系我们 |
| | | onAboutUS() { |
| | | console.log(111); |
| | | } |
| | | }) |
| | |
| | | <view class="domainList"> |
| | | <view wx:for="{{menuData}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toPages" data-info="{{item}}" class="listItem"> |
| | | <view class="icon"> |
| | | <t-image src="{{item.icon}}" mode="heightFix" class="img" /> |
| | | <image src="{{item.icon}}" mode="aspectFit" class="img" /> |
| | | </view> |
| | | <view class="label"> |
| | | <text>{{item.title}}</text> |
| | |
| | | <view class="domainList1"> |
| | | <view wx:for="{{moreMenu}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toPages" data-info="{{item}}" class="listItem"> |
| | | <view class="icon"> |
| | | <t-image src="{{item.icon}}" mode="heightFix" class="img" /> |
| | | <image src="{{item.icon}}" mode="aspectFit" class="img" /> |
| | | </view> |
| | | <view class="label"> |
| | | <text>{{item.title}}</text> |
| | |
| | | <view class="domainList2"> |
| | | <view wx:for="{{moreMenu1}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toPages" data-info="{{item}}" class="listItem"> |
| | | <view class="icon"> |
| | | <t-image src="{{item.icon}}" mode="heightFix" class="img" /> |
| | | <image src="{{item.icon}}" mode="aspectFit" class="img" /> |
| | | </view> |
| | | <view class="label"> |
| | | <text>{{item.title}}</text> |
| | |
| | | <view class="title">请选择您的用户类型</view> |
| | | </view> |
| | | <view class="body"> |
| | | <view wx:for="{{userTypeList}}" wx:for-item="item" wx:for-index="index" wx:key="index" data-info="{{item}}" bindtap="tabUserTypeClick" :class="item.value == userTypeActive ? 'activeItem item hover' : 'item hover'"> |
| | | |
| | | <view wx:for="{{userTypeList}}" wx:for-item="item" wx:for-index="index" wx:key="index" data-info="{{item}}" bindtap="tabUserTypeClick" class="{{item.value === userTypeActive ? 'activeItem item' : 'item'}}"> |
| | | {{ item.lable }} |
| | | </view> |
| | | </view> |
| | | <view class="footer"> |
| | | <button class="submit" bindtap="submit">提交</button> |
| | | <button class="submit" bindtap="submit">确定</button> |
| | | </view> |
| | | </view> |
| | | </t-popup> |
| | |
| | | width: 46rpx; |
| | | height: 46rpx; |
| | | margin: 0 auto; |
| | | display: flex; |
| | | } |
| | | |
| | | .listItem .icon .t-image { |
| | | width: 100%; |
| | | |
| | | .listItem .icon .img { |
| | | /* width: 100%; */ |
| | | height: 100%; |
| | | object-fit: contain; |
| | | |
| | | } |
| | | |
| | | .listItem .label { |
| | |
| | | |
| | | .block { |
| | | width: 100vw; |
| | | height: 240px; |
| | | background: #fff; |
| | | border-top-left-radius: 16rpx; |
| | | border-top-right-radius: 16rpx; |
| | | } |
| | | |
| | | .header { |
| | | .block .header { |
| | | display: flex; |
| | | align-items: center; |
| | | height: 116rpx; |
| | | } |
| | | |
| | | .title { |
| | | .block .title { |
| | | flex: 1; |
| | | text-align: center; |
| | | font-weight: 600; |
| | | font-size: 36rpx; |
| | | } |
| | | |
| | | .block .body { |
| | | padding: 0 20rpx; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | justify-content: space-between; |
| | | } |
| | | |
| | | .item { |
| | | width: calc(100%/2 - 30rpx); |
| | | text-align: center; |
| | | padding: 30rpx 0; |
| | | margin: 0 10rpx 20rpx 10rpx; |
| | | background: #F9F9F9; |
| | | border: 4rpx solid #F9F9F9; |
| | | border-radius: 10rpx; |
| | | } |
| | | |
| | | .activeItem { |
| | | border: 4rpx solid #ff6c00; |
| | | background: #fff; |
| | | } |
| | | |
| | | .footer { |
| | | width: 80%; |
| | | margin: 10rpx auto; |
| | | } |
| | | |
| | | .submit { |
| | | background: #ff6c00; |
| | | color: #fff; |
| | | border-radius: 50rpx; |
| | | } |
| | |
| | | |
| | | datas5.forEach((items) => { |
| | | items.subtitleName = items.subtitle + items.name |
| | | |
| | | }) |
| | | console.log(datas5, 'sadasd'); |
| | | this.setData({ |
| | |
| | | downloadData(event) { |
| | | console.log(111); |
| | | const item = event.currentTarget.dataset.item; |
| | | // console.log(item.datas.freeFile.searchVal); |
| | | const URL = 'http://182.92.203.7:3001/file/api/ApiDownload?md5=' + item.datas.freeFile.searchVal |
| | | // console.log(item.datas.freeFile.Value); |
| | | 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 |
| | |
| | | |
| | | |
| | | }) |
| | | } |
| | | }, |
| | | 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参数 |
| | | }); |
| | | }, |
| | | //触底函数 |
| | | onReachBottom() { |
| | | console.log("上拉加载...."); |
| | | }, |
| | | //上拉函数 |
| | | onPullDownRefresh() { |
| | | console.log("下拉刷新..."); |
| | | }, |
| | | |
| | | |
| | | }) |
| | |
| | | "t-icon": "tdesign-miniprogram/icon/icon", |
| | | "t-search": "tdesign-miniprogram/search/search", |
| | | "t-tabs": "tdesign-miniprogram/tabs/tabs", |
| | | "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel" |
| | | "t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel", |
| | | "t-empty": "tdesign-miniprogram/empty/empty" |
| | | }, |
| | | "navigationStyle": "custom" |
| | | "navigationStyle": "custom", |
| | | "enablePullDownRefresh": true |
| | | } |
| | |
| | | <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" t-class-content="custom-panel"> |
| | | <t-tab-panel label="图书({{bookTotal}})" value="0"> |
| | | <view class="bookDataBox"> |
| | | <view wx:if="{{bookData.length <= 0}}" class="noDataBox"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | |
| | | |
| | | <view class="bookDataForBox" wx:for="{{bookData}}" wx:key="index" wx:for-item="item" wx:for-index="index" data-item="{{item}}" bind:tap="onBook"> |
| | |
| | | |
| | | |
| | | <view class="listBox1"> |
| | | <view wx:if="{{courseData.length <= 0}}" class="noDataBox"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | <view wx:if="{{courseData.length>0}}"> |
| | | <view wx:for="{{courseData}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toList" data-info="{{item}}" class="listItemBox"> |
| | | <view class="listItem flex"> |
| | |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="empyt" wx:else> |
| | | <t-empty icon="folder-open" description="暂无数据" font-size="80" /> |
| | | </view> |
| | | |
| | | </view> |
| | | |
| | | |
| | |
| | | |
| | | <view class="bookDataBox"> |
| | | |
| | | |
| | | <view wx:if="{{digitalTextbooksData.length <= 0}}" class="noDataBox"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | <view class="bookDataForBox" wx:for="{{digitalTextbooksData}}" wx:key="index" wx:for-item="item" wx:for-index="index"> |
| | | <view class="imageBox"> |
| | | <image src="{{item.icon}}" mode="" /> |
| | |
| | | </t-tab-panel> |
| | | <t-tab-panel label="专题({{seminarTotal}})" value="3"> |
| | | <view class="listBox"> |
| | | <view wx:if="{{seminarData.length <= 0}}" class="noDataBox"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | <view wx:for="{{seminarData}}" wx:for-item="item" wx:for-index="index" wx:key="index" bindtap="toList" data-info="{{item}}" class="listItemBox"> |
| | | <view class="listItem"> |
| | | <view class="specialSubject-img"> |
| | |
| | | |
| | | |
| | | <view class="outsideHigherBox"> |
| | | <view wx:if="{{bookFairData.length <= 0 }}" class="noDataBox"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | <view class="higherBox" wx:for="{{bookFairData}}" wx:key="index" wx:for-item="item" wx:for-index="index"> |
| | | <view class="outsideHigherImageBox"> |
| | | <image class="higherImageBox" src="{{item.icon}}" mode="" /> |
| | |
| | | </t-tab-panel> |
| | | <t-tab-panel label="书展({{biblioClassificationTotal}})" value="5"> |
| | | <view class="outside"> |
| | | <view wx:if="{{biblioClassificationData.length <= 0}}" class="noDataBox"> |
| | | <t-empty icon="folder-open" description="暂无数据" /> |
| | | </view> |
| | | <view class="contentBox" wx:for="{{biblioClassificationData}}" wx:key="index" wx:for-item="item" wx:for-index="index" bindtap="onBookExhibitionDetails" data-item="{{item}}"> |
| | | <image class="bookFairImage" wx:if="{{item.icon}}" src="{{item.icon}}" mode="" /> |
| | | <image class="bookFairImage" wx:else="" src="/static/images/bookExhibitionList/banner.png" mode="" /> |
| | |
| | | .t-tabs__track { |
| | | background-color: #FF6C00 !important; |
| | | } |
| | | |
| | | .noDataBox { |
| | | /* display: flex; |
| | | justify-content: center; |
| | | align-items: center */ |
| | | margin: 0 auto; |
| | | margin-top: 250rpx; |
| | | } |
| | |
| | | text: '书目下载', |
| | | key: 6, |
| | | icon: '/static/images/home/shumuxiazai@2x.png', |
| | | url: '', |
| | | url: '/pages/bibliographyList/index', |
| | | }, |
| | | { |
| | | text: '教师认证', |