From 7231b5929a66bb1ec3b832be85f5e3f6ce40ad9f Mon Sep 17 00:00:00 2001 From: yiming <m13691596795@163.com> Date: 星期五, 15 三月 2024 16:01:52 +0800 Subject: [PATCH] feat: 十大 --- pages/resourceDetails/myVideo/index.wxml | 5 pages/resourceDetails/myVideo/index.wxss | 9 style/theme.wxss | 8 pages/bookExhibitionList/index.js | 13 pages/bookServices/detail/index.js | 85 ++++ static/images/bibliographyList/square@2x.png | 0 pages/retrievalPage/index.js | 5 pages/bookExhibitionDetails/index.wxml | 2 pages/cart/index.wxss | 80 +++ pages/resourceDetails/document/index.wxml | 9 pages/bookExhibitionDetails/index.wxss | 18 pages/bookServices/detail/components/tree/index.wxml | 161 +------- pages/cart/index.wxml | 25 + pages/resourceDetails/document/index.wxss | 13 pages/bookServices/detail/index.wxml | 189 +-------- pages/resourceDetails/myAudio/index.wxml | 53 +- pages/cart/paymentPage/index.wxml | 101 +++-- pages/cart/paymentPage/index.wxss | 35 + pages/bookExhibitionList/index.wxml | 4 pages/resourceDetails/myVideo/index.js | 27 pages/resourceDetails/myAudio/index.wxss | 51 +- pages/retrievalPage/index.wxml | 4 pages/retrievalPage/index.wxss | 23 pages/cart/index.json | 4 /dev/null | 0 pages/cart/index.js | 37 + pages/bookServices/detail/index.json | 4 pages/bookServices/detail/components/tree/components/util.js | 27 + pages/bibliographyList/index.wxml | 1 pages/resourceDetails/myAudio/index.js | 8 pages/bibliographyList/index.wxss | 9 pages/bookServices/detail/components/tree/index.js | 65 +++ project.config.json | 2 static/images/bibliographyList/square.png | 0 pages/bibliographyList/index.js | 7 35 files changed, 603 insertions(+), 481 deletions(-) diff --git a/pages/bibliographyList/index.js b/pages/bibliographyList/index.js index d3fee23..4c3cd21 100644 --- a/pages/bibliographyList/index.js +++ b/pages/bibliographyList/index.js @@ -15,7 +15,8 @@ teacherTotal: 0, value: '', BarHeight: '', - navBarHeight: '' + navBarHeight: '', + }, /** @@ -226,9 +227,9 @@ console.log(111); const item = event.currentTarget.dataset.item; // console.log(item.datas.freeFile.Value); - const URL = 'http://182.92.203.7:3001/file/api/ApiDownload?md5=' + 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 diff --git a/pages/bibliographyList/index.wxml b/pages/bibliographyList/index.wxml index 630119d..3b9aa81 100644 --- a/pages/bibliographyList/index.wxml +++ b/pages/bibliographyList/index.wxml @@ -14,7 +14,6 @@ </view> - <!--鐘舵�佹爮楂樺害 --> <!-- <view style="width: 100%; height:{{BarHeight}}px;"></view> <view style="width: 70%; height:{{navBarHeight}}px;"> diff --git a/pages/bibliographyList/index.wxss b/pages/bibliographyList/index.wxss index 8901705..a6426d2 100644 --- a/pages/bibliographyList/index.wxss +++ b/pages/bibliographyList/index.wxss @@ -110,4 +110,13 @@ box-sizing: border-box; line-height: 75rpx; height: 75rpx; +} + +.t-tabs__item--active { + color: #FF6C00 !important; + +} + +.t-tabs__track { + background-color: #FF6C00 !important; } \ No newline at end of file diff --git a/pages/bookExhibitionDetails/index.wxml b/pages/bookExhibitionDetails/index.wxml index b9fcb50..87b5129 100644 --- a/pages/bookExhibitionDetails/index.wxml +++ b/pages/bookExhibitionDetails/index.wxml @@ -18,7 +18,7 @@ -<image class="partingBox" src="/static/images/bookExhibitionDetails/Parting.png" mode="" /> +<image class="partingBox" src="/static/images/bookExhibitionDetails/Parting.png" mode="aspectFill" /> <image class="bannerBox" src="{{bookImage}}" mode="" /> diff --git a/pages/bookExhibitionDetails/index.wxss b/pages/bookExhibitionDetails/index.wxss index f6a4d81..c8feec7 100644 --- a/pages/bookExhibitionDetails/index.wxss +++ b/pages/bookExhibitionDetails/index.wxss @@ -16,15 +16,33 @@ font-size: 40rpx; font-weight: bold; margin-bottom: 5rpx; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; } .titleBox { + height: 60rpx; font-weight: 800; font-size: 45rpx; display: flex; justify-content: center; padding: 0 30rpx; /* text-indent: 6%; */ + + /* overflow: hidden; + text-overflow: ellipsis; + + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; */ + margin: 0 130rpx; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; + overflow: hidden; + text-overflow: ellipsis; } .informationBox { diff --git a/pages/bookExhibitionList/index.js b/pages/bookExhibitionList/index.js index 067ceae..c1e3eaa 100644 --- a/pages/bookExhibitionList/index.js +++ b/pages/bookExhibitionList/index.js @@ -29,7 +29,6 @@ options: [ { value: '*', - label: '鎬诲垎绫�', }, { @@ -50,7 +49,9 @@ price: 'jsek_teacherEducation', label: '鏁欏笀鏁欒偛', }, + ], + }, multipleSelect: { value: [], @@ -169,6 +170,8 @@ }); this.bookExhibitionGet(); // 璋冪敤鏂规硶鍔犺浇鏇村鏁版嵁 console.log(1111); + + } }, @@ -199,6 +202,7 @@ queryType: '*', fields: { jsek_link: [], + subtitle: [], 'bookClassification*': this.data.keynoteValue || [], ...searchObj }, @@ -208,7 +212,10 @@ // width: 100 // }, }).then(res => { - + res.datas.forEach((item) => { + item.subtitleName = item.subtitle + item.name + }) + console.log(res, 'item'); this.data.total = res.total // list.push(res.datas) @@ -217,7 +224,7 @@ this.setData({ bookExhibitionList: list }) - + //鍙栨秷 wx.hideLoading() // console.log(this.data.bookExhibitionList, '鏁版嵁'); diff --git a/pages/bookExhibitionList/index.wxml b/pages/bookExhibitionList/index.wxml index 31f662a..e58ac3a 100644 --- a/pages/bookExhibitionList/index.wxml +++ b/pages/bookExhibitionList/index.wxml @@ -35,14 +35,14 @@ <view class="assembleContent"> <view class="titleBox"> <view class="frameBox"></view> - <image class="titleTextBox" src="/static/images/bookExhibitionList/zhuantitaolun.png" mode="aspectFit"/> + <image class="titleTextBox" src="/static/images/bookExhibitionList/zhuantitaolun.png" mode="aspectFit" /> </view> <view class="outside"> <view class="contentBox" wx:for="{{bookExhibitionList}}" wx:key="index" wx:for-item="item" wx:for-index="index" bindtap="onBookExhibitionDetails" data-item="{{item}}"> <image wx:if="{{item.icon}}" src="{{item.icon}}" mode="aspectFit" /> <image wx:else="" src="/static/images/bookExhibitionList/banner.png" mode="" /> - <view class="textBox" title="{{item.name}}"> <text>{{item.name}}</text></view> + <view class="textBox" title="{{item.subtitleName}}"> <text>{{item.subtitleName}}</text></view> </view> </view> diff --git a/pages/bookServices/detail/components/tree/components/util.js b/pages/bookServices/detail/components/tree/components/util.js new file mode 100644 index 0000000..f8a3bc2 --- /dev/null +++ b/pages/bookServices/detail/components/tree/components/util.js @@ -0,0 +1,27 @@ +/* 鍔犺浇鍔ㄧ敾鐩稿叧 */ +const showLoading = (tips = '鍔犺浇涓�...') => { + wx.showNavigationBarLoading() + wx.showLoading({ + title: tips, + }) +} + +const hideLoading = () => { + wx.hideLoading() + wx.hideNavigationBarLoading() +} + +const hideLoadingWithErrorTips = (err = '鍔犺浇澶辫触...') => { + hideLoading() + wx.showToast({ + title: err, + icon: 'error', + duration: 2000 + }) +} + +module.exports = { + showLoading: showLoading, + hideLoading: hideLoading, + hideLoadingWithErrorTips: hideLoadingWithErrorTips, +} diff --git a/pages/bookServices/detail/components/tree/index.js b/pages/bookServices/detail/components/tree/index.js index c7c1b33..57c889e 100644 --- a/pages/bookServices/detail/components/tree/index.js +++ b/pages/bookServices/detail/components/tree/index.js @@ -1,5 +1,6 @@ import Message from 'tdesign-miniprogram/message/message'; +const util = require('./components/util') // 寮曞叆灏佽杩囩殑鍔犺浇鎻愮ず const app = getApp() Component({ properties: { @@ -33,11 +34,14 @@ } }, data: { - activeValues: [0] + activeValues: [0], + webpageSrc: '' }, onShow() { }, + + methods: { // 鑺傜偣灞曞紑 handleChange(e) { @@ -83,17 +87,69 @@ // "pages/resourceDetails/myAudio/index", // "pages/resourceDetails/myVideo/index", // "pages/resourceDetails/document/index", + + + let url if (item.selectType == 'video') { url = '/pages/resourceDetails/myVideo/index' } else if (item.selectType == 'audio') { url = '/pages/resourceDetails/myAudio/index' - } else { + } else if (item.selectType == 'picture' || item.selectType == 'zip') { url = '/pages/resourceDetails/document/index' } + + // else { + // + // } wx.navigateTo({ url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parent.productLinkPath}&parentName=${parent.name}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}`, }) + + + if (item.selectType == 'document' || item.selectType == 'pdf') { + const fileLink = app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file + console.log(fileLink, 'fileLink'); + //鎻愮ず鍔犺浇涓� + util.showLoading() + // 鍗曟涓嬭浇鍏佽鐨勬渶澶ф枃浠朵负 200MB + wx.downloadFile({ + url: fileLink, // 鍦板潃宸叉墦鐮侊紝鑷繁鎹釜鍏朵粬鐨勫湴鍧�锛�"https://www.xxxxx.com/file/娴嬭瘯閫氱煡.pdf"锛� + success: function (res) { + console.log(res, "wx.downloadFile success res") + if (res.statusCode != 200) { + util.hideLoadingWithErrorTips() + return false + } + var Path = res.tempFilePath //杩斿洖鐨勬枃浠朵复鏃跺湴鍧�锛岀敤浜庡悗闈㈡墦寮�鏈湴棰勮鎵�鐢� + wx.openDocument({ + filePath: Path, + showMenu: true, + success: function (res) { + console.log('鎵撳紑鎴愬姛'); + util.hideLoading() + } + }) + }, + fail: function (err) { + console.log(err, "wx.downloadFile fail err"); + util.hideLoadingWithErrorTips() + } + }) + + + } + + if (item.selectType == 'webpage') { + console.log(11); + this.setData({ + webpageSrc: item.jsek_link + }) + console.log(this.data.webpageSrc, 'webpageSrc'); + } + + + }, // 鎷垮埌鎵�鏈夐」 getAllChildren(id) { @@ -116,6 +172,7 @@ result.push(...item.children); } } + console.log(this.properties.treeList); this.properties.treeList.forEach(item => { findChildren(item); }); @@ -180,6 +237,7 @@ // 绔犺妭鍕鹃�� checkResourceTitle(e) { const item = e.currentTarget.dataset.item + console.log(item, 'item'); let list = this.flattenTree([item]) let ids = [] list.forEach(item => { @@ -188,5 +246,8 @@ const tab = this.findAndUpdateItemsByIds([item], ids) console.log(ids, tab); } + }, + onCloudShoppingCart() { + console.log(this.properties.treeList); } }) \ No newline at end of file diff --git a/pages/bookServices/detail/components/tree/index.wxml b/pages/bookServices/detail/components/tree/index.wxml index ce30d1f..9d3efdd 100644 --- a/pages/bookServices/detail/components/tree/index.wxml +++ b/pages/bookServices/detail/components/tree/index.wxml @@ -1,168 +1,59 @@ <view class="tree"> <t-collapse default-value="{{activeValues}}" bind:change="handleChange"> - <t-collapse-panel - wx:for="{{treeList}}" - wx:for-item="item" - wx:for-index="index" - wx:key="id" - value="{{index}}" - expandIcon - > + <t-collapse-panel wx:for="{{treeList}}" wx:for-item="item" wx:for-index="index" wx:key="id" value="{{index}}" expandIcon> <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="{{item.checked}}" data-item="{{item}}" bind:change="checkResourceTitle" /> </view> <text>{{item.name}}</text> </view> - <view - class="list" - wx:for="{{item.children}}" - wx:for-item="citem" - wx:for-index="cindex" - wx:key="cindex" - > + <view class="list" wx:for="{{item.children}}" wx:for-item="citem" wx:for-index="cindex" wx:key="cindex"> <!-- // 鍒ゆ柇 鏃犲瓙椤� 涓斾负鍟嗗搧item 鐩存帴鏄剧ず --> - <view - class="listItems" - wx:if="{{citem.childrenFolderCount <= 0 && citem.type == 'productItem'}}" - > - <view - class="itemsInfo" - wx:if="{{citem.name}}" - data-item="{{citem}}" - data-index="{{cindex}}" - > - <view - class="contentBox" - bind:tap="goPlayer" - data-item="{{citem}}" - data-parent="{{item}}" - > + <view class="listItems" wx:if="{{citem.childrenFolderCount <= 0 && citem.type == 'productItem'}}"> + <view class="itemsInfo" wx:if="{{citem.name}}" data-item="{{citem}}" data-index="{{cindex}}"> + <view class="contentBox" bind:tap="goPlayer" data-item="{{citem}}" data-parent="{{item}}"> <!-- 鏁欏璧勬簮 浜戝涔� 鍥炬爣 --> - <view - class="box-image" - style="{{ tab == 'jsek_teachingResources' ? 'width: 350rpx;' : 'width: 450rpx;'}}" - > + <view class="box-image" style="{{ tab == 'jsek_teachingResources' ? 'width: 350rpx;' : 'width: 450rpx;'}}"> <view class="checkBox" wx:if="{{tab == 'jsek_cloudLearning'}}"> - <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}}" - /> + <!-- 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}}" /> </view> <!-- 鏁欏璧勬簮鍥炬爣 --> <view class="teach-icon"> - <t-image - wx:if="{{citem.selectType == 'audio'}}" - src="/static/images/bookService/detail/audioIcon.png" - mode="aspectFill" - /> - <t-image - wx:if="{{citem.selectType == 'video'}}" - src="/static/images/bookService/detail/video.png" - mode="aspectFill" - /> - <t-image - wx:if="{{citem.selectType == 'pdf'}}" - src="/static/images/bookService/detail/pdf.png" - mode="aspectFill" - /> - <t-image - wx:if="{{citem.selectType == 'webpage'}}" - src="/static/images/bookService/detail/net.png" - mode="aspectFill" - /> - <t-image - wx:if="{{citem.selectType == 'picture'}}" - src="/static/images/bookService/detail/picture.png" - mode="aspectFill" - /> - <t-image - wx:if="{{citem.selectType == 'zip'}}" - src="/static/images/bookService/detail/zip.png" - mode="aspectFill" - /> - <t-image - wx:if="{{ citem.fileMap[citem.file].extension == 'doc' || citem.fileMap[citem.file].extension == 'docx'}}" - src="/static/images/bookService/detail/word.png" - mode="aspectFill" - /> - <t-image - wx:if="{{ citem.fileMap[citem.file].extension == 'xlsx' || citem.fileMap[citem.file].extension == 'xlsx'}}" - src="/static/images/bookService/detail/excel.png" - mode="aspectFill" - /> - <t-image - wx:if="{{ citem.fileMap[citem.file].extension == 'ppt' || citem.fileMap[citem.file].extension == 'pptx'}}" - src="/static/images/bookService/detail/PPT.png" - mode="aspectFill" - /> + <t-image wx:if="{{citem.selectType == 'audio'}}" src="/static/images/bookService/detail/audioIcon.png" mode="aspectFill" /> + <t-image wx:if="{{citem.selectType == 'video'}}" src="/static/images/bookService/detail/video.png" mode="aspectFill" /> + <t-image wx:if="{{citem.selectType == 'pdf'}}" src="/static/images/bookService/detail/pdf.png" mode="aspectFill" /> + <t-image wx:if="{{citem.selectType == 'webpage'}}" src="/static/images/bookService/detail/net.png" mode="aspectFill" /> + <t-image wx:if="{{citem.selectType == 'picture'}}" src="/static/images/bookService/detail/picture.png" mode="aspectFill" /> + <t-image wx:if="{{citem.selectType == 'zip'}}" src="/static/images/bookService/detail/zip.png" mode="aspectFill" /> + <t-image wx:if="{{ citem.fileMap[citem.file].extension == 'doc' || citem.fileMap[citem.file].extension == 'docx'}}" src="/static/images/bookService/detail/word.png" mode="aspectFill" /> + <t-image wx:if="{{ citem.fileMap[citem.file].extension == 'xlsx' || citem.fileMap[citem.file].extension == 'xlsx'}}" src="/static/images/bookService/detail/excel.png" mode="aspectFill" /> + <t-image wx:if="{{ citem.fileMap[citem.file].extension == 'ppt' || citem.fileMap[citem.file].extension == 'pptx'}}" src="/static/images/bookService/detail/PPT.png" mode="aspectFill" /> </view> <!-- 浜戝涔犲浘鏍� --> <view> </view> <!-- 鍚嶇О --> - <text - class="name" - style="{{ tab == 'jsek_teachingResources' ? 'width: 300rpx;' : 'width: 400rpx;'}}" - >{{citem.name}}</text - > + <text class="name" style="{{ tab == 'jsek_teachingResources' ? 'width: 300rpx;' : 'width: 400rpx;'}}">{{citem.name}}</text> </view> <!-- 鏁欏璧勬簮绫诲瀷 --> <view class="teachClass"> {{citem.resourceClass}} </view> - <view - class="teach-btn" - wx:if="{{tab == 'jsek_teachingResources'}}" - > + <view class="teach-btn" wx:if="{{tab == 'jsek_teachingResources'}}"> <!-- 涓嬭浇鎸夐挳 --> - <t-image - src="/static/images/bookService/detail/download-icon.png" - width="16" - height="16" - class="download" - data-value="{{citem}}" - catchtap="downloadTeach" - ></t-image> + <t-image src="/static/images/bookService/detail/download-icon.png" width="16" height="16" class="download" data-value="{{citem}}" catchtap="downloadTeach"></t-image> </view> <view wx:if="{{tab == 'jsek_cloudLearning'}}"> <!-- 浜戝涔犺瘯鐪嬪浘鏍� --> - <t-image - src="/static/images/bookService/detail/shikan.png" - class="testSee" - wx:if="{{!citem.isbuy ? false : citem.freeFile ? true : false}}" - ></t-image> + <t-image src="/static/images/bookService/detail/shikan.png" class="testSee" wx:if="{{!citem.isbuy ? false : citem.freeFile ? true : false}}"></t-image> <!-- 浜戝涔犲姞鍏ヨ喘鐗╄溅鍥炬爣 --> - <t-image - src="/static/images/bookService/detail/cart.png" - wx:if="{{citem.isShopCar}}" - class="shopCar" - ></t-image> + <t-image src="/static/images/bookService/detail/cart.png" wx:if="{{citem.isShopCar}}" class="shopCar" bind:tap="onCloudShoppingCart"></t-image> <!-- 浜戝涔犺喘涔板浘鏍� --> - <t-image - src="/static/images/bookService/detail/need-buy.png" - class="need-buy" - wx:if="{{citem.isbuy }}" - ></t-image> + <t-image bind:tap="onCloudShoppingCart" src="/static/images/bookService/detail/need-buy.png" class="need-buy" wx:if="{{citem.isbuy }}"></t-image> </view> </view> </view> </view> <!-- // 鍒ゆ柇 涓嶆槸鍟嗗搧 鏈夊瓙椤� 閫掑綊缁勪欢 --> - <tree - wx:else - bookInfo="{{bookInfo}}" - treeList="{{[citem]}}" - itemId="{{itemId}}" - tab="{{tab}}" - openTeachids="{{openTeachids}}" - openLearnids="{{openLearnids}}" - ></tree> + <tree wx:else bookInfo="{{bookInfo}}" treeList="{{[citem]}}" itemId="{{itemId}}" tab="{{tab}}" openTeachids="{{openTeachids}}" openLearnids="{{openLearnids}}"></tree> </view> <view class="listItems" wx:if="{{children.length <= 0 && !loading}}"> 鏆傛棤鏁版嵁 @@ -173,3 +64,5 @@ </t-collapse-panel> </t-collapse> </view> + +<web-view wx:if="{{webpageSrc}}" src="{{webpageSrc}}"></web-view> \ No newline at end of file diff --git a/pages/bookServices/detail/index.js b/pages/bookServices/detail/index.js index 396240d..6e744f6 100644 --- a/pages/bookServices/detail/index.js +++ b/pages/bookServices/detail/index.js @@ -1,5 +1,6 @@ // pages/bookServices/detail/index.js import Message from 'tdesign-miniprogram/message/index.js'; +import Toast from 'tdesign-miniprogram/toast/index'; const app = getApp(); Page({ /** @@ -41,6 +42,7 @@ loading: false, isShowTeachDownload: false, // 鎻愮ずPC涓嬭浇寮圭獥鐘舵�� confirmBtn: { content: '鎴戠煡閬撲簡', variant: 'base' }, + }, resetTree: function (e) { @@ -380,6 +382,8 @@ item.checked = false }) const list = await this.getAllResource(res.datas.cmsDatas[0].datas) + + console.log(list, 'list'); this.setData({ teach: list, loading: false @@ -507,18 +511,89 @@ }, // 鍥句功娣诲姞璐墿杞� - addBookShopcCar() { + async addBookShopcCar() { + const shoppingCartGetId = [] + let query = { + start: 0, + size: 999, + filterList: [], + searchList: [] + } + const res = await app.MG.store.getShoppingCartProductList(query) + res.datas.forEach((item) => { + shoppingCartGetId.push(item.saleMethod.id) + }) + console.log(shoppingCartGetId, 'shoppingCartGetId'); + console.log(this.data.bookDetail.defaultSaleMethodId, 'this.data.bookDetail.defaultSaleMethodId'); + const determine = shoppingCartGetId.some((item) => item == this.data.bookDetail.defaultSaleMethodId) + console.log(determine); + + if (!determine) { + let query = { + requests: [ + { + saleMethodId: this.data.bookDetail.defaultSaleMethodId, + storeEventId: null, + agentCode: '鐢靛瓙涔�' + } + ] + } + const addRes = app.MG.store.addShoppingCart(query) + this.showSuccessToast() + + } else { + Toast({ + context: this, + selector: '#t-toast', + message: '宸叉坊鍔�', + theme: 'success', + direction: 'column', + }); + } + + }, + + showSuccessToast() { + Toast({ + context: this, + selector: '#t-toast', + message: '娣诲姞鎴愬姛', + theme: 'success', + direction: 'column', + }); + }, + + + + async buyBook() { + let bookOrdersId = '' + let query = { + remarks: '鐢靛瓙涔�', requests: [ { saleMethodId: this.data.bookDetail.defaultSaleMethodId, - storeEventId: null, - agentCode: '鐢靛瓙涔�' + count: 1 } ] } - const addRes = app.MG.store.addShoppingCart(query) + // 鍙戣捣璁㈠崟鍒濆鍖栬姹傚苟绛夊緟缁撴灉 + const res = await app.MG.store.initOrder(query) + // 鑾峰彇璁㈠崟鍙峰苟璧嬪�肩粰 orderNumber.value + bookOrdersId = res.orderNumber + console.log(bookOrdersId); + // 妫�鏌ヨ鍗曞彿鏄惁瀛樺湪 + if (bookOrdersId) { + const url = '/pages/cart/paymentPage/index?orderNumber=' + bookOrdersId + wx.navigateTo({ + url + }) + } else { + console.log(222); + } + }, + // 鑾峰彇鏁欏璧勬簮涓嬭浇鏄惁鐢宠閫氳繃 getApplyInfo(id) { // 鑾峰彇褰撳墠鏃堕棿 @@ -908,7 +983,7 @@ if (initOrderRes.orderNumber) { // bookService: orderNumber.value, 灏戜紶杩欎釜 锛屾殏鏃朵笉鐭ラ亾鏈変粈涔堢敤 wx.navigateTo({ - url: `/pages/cart/paymentPage/index?&bookId=${this.data.bookDetail.id}&bookName=${this.data.bookDetail.name}&orderNum=${initOrderRes.orderNumber}`, + url: `/pages/cart/paymentPage/index?&bookId=${this.data.bookDetail.id}&bookName=${this.data.bookDetail.name}&orderNumber=${initOrderRes.orderNumber}`, }) } else { // 璁㈠崟鍙蜂笉瀛樺湪锛屾樉绀鸿鍛婃秷鎭� diff --git a/pages/bookServices/detail/index.json b/pages/bookServices/detail/index.json index 72d8522..53b160f 100644 --- a/pages/bookServices/detail/index.json +++ b/pages/bookServices/detail/index.json @@ -1,4 +1,5 @@ { + "component": true, "usingComponents": { "t-icon": "tdesign-miniprogram/icon/icon", "t-image": "tdesign-miniprogram/image/image", @@ -14,7 +15,8 @@ "tree": "/pages/bookServices/detail/components/tree/index", "suggest": "/pages/bookServices/detail/components/suggest/suggest", "t-loading": "tdesign-miniprogram/loading/loading", - "t-dialog": "tdesign-miniprogram/dialog/dialog" + "t-dialog": "tdesign-miniprogram/dialog/dialog", + "t-toast": "tdesign-miniprogram/toast/toast" }, "navigationStyle": "custom", "onReachBottomDistance": 200 diff --git a/pages/bookServices/detail/index.wxml b/pages/bookServices/detail/index.wxml index fff1970..cef98ff 100644 --- a/pages/bookServices/detail/index.wxml +++ b/pages/bookServices/detail/index.wxml @@ -3,48 +3,30 @@ <view style="width: 100%; height: {{barHeight}}px; "></view> <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> <view> - <t-icon - name="chevron-left" - size="30" - data-name="{{item}}" - bind:click="goBack" - /> + <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> </view> <view class="navbar-title">{{options.name}}</view> </view> +<t-toast id="t-toast" /> <scroll-view scroll-y="{{true}}" class="book" bindscrolltolower="onReachBottom"> <!-- 鍥句功璇︽儏 --> <view class="book-box"> <view class="book-detail"> <view class="detail-left"> <view class="book-img"> - <t-image - src="{{bookDetail.icon}}" - mode="aspectFill" - width="120" - height="170" - aria-label="{{bookDetail.name}}" - /> + <t-image src="{{bookDetail.icon}}" mode="aspectFill" width="120" height="170" aria-label="{{bookDetail.name}}" /> </view> <view class="book-use"> <view class="collect" bind:tap="setCollect"> <view> - <t-image - src="/static/images/bookService/detail/collect.png" - wx:if="{{!bookDetail.isFavourite}}" - ></t-image> - <t-image - src="/static/images/bookService/detail/collecting.png" - wx:if="{{bookDetail.isFavourite}}" - ></t-image> + <t-image src="/static/images/bookService/detail/collect.png" wx:if="{{!bookDetail.isFavourite}}"></t-image> + <t-image src="/static/images/bookService/detail/collecting.png" wx:if="{{bookDetail.isFavourite}}"></t-image> </view> <view class="use-title">鏀惰棌</view> </view> <view class="suggest" bind:tap="suggestBtn"> <view> - <t-image - src="/static/images/bookService/detail/suggest.png" - ></t-image> + <t-image src="/static/images/bookService/detail/suggest.png"></t-image> </view> <view class="use-title">鎴戣寤鸿</view> </view> @@ -69,11 +51,7 @@ <view class="li-title">鍑虹増鏃堕棿锛�</view> <view class="li-content">{{bookDetail.publicationDate}}</view> </view> - <view - class="message-li" - wx:if="{{bookDetail.class}}" - style="height: 80rpx" - > + <view class="message-li" wx:if="{{bookDetail.class}}" style="height: 80rpx"> <view class="li-title">鍥句功鍒嗙被锛�</view> <view class="class-name showTow">{{bookDetail.class}}</view> </view> @@ -86,16 +64,11 @@ <!-- 鐢靛瓙涔﹀敭浠� --> <view class="electron-price"> <view> - <t-image - src="/static/images/bookService/detail/electon-price.png" - ></t-image> + <t-image src="/static/images/bookService/detail/electon-price.png"></t-image> </view> <view class="price"> - <view class="price-text" - >楼{{bookDetail.price == '0.00' ? '鍏嶈垂' :bookDetail.price}}</view - > - <view class="price-old" wx:if="{{bookDetail.oldPrice != '0.00'}}" - >楼{{bookDetail.oldPrice}} <view class="line"></view> + <view class="price-text">楼{{bookDetail.price == '0.00' ? '鍏嶈垂' :bookDetail.price}}</view> + <view class="price-old" wx:if="{{bookDetail.oldPrice != '0.00'}}">楼{{bookDetail.oldPrice}} <view class="line"></view> </view> </view> <view> </view> @@ -103,131 +76,49 @@ <!-- 绾歌川涔﹀敭浠� --> <view class="paper-price"> <view> - <t-image - src="/static/images/bookService/detail/paper-price.png" - ></t-image> + <t-image src="/static/images/bookService/detail/paper-price.png"></t-image> </view> - <view class="price" - >楼{{bookDetail.paperPrice == '0.00' ? '鍏嶈垂' : - bookDetail.paperPrice}}</view - > + <view class="price">楼{{bookDetail.paperPrice == '0.00' ? '鍏嶈垂' : + bookDetail.paperPrice}}</view> </view> </view> <!-- 缃戝簵 --> <view class="book-web"> - <t-image - src="/static/images/bookService/detail/jd.png" - wx:if="{{bookDetail.JDLink}}" - bind:tap="goShop" - data-link="{{bookDetail.tmallLink}}" - data-type="jd" - ></t-image> - <t-image - src="/static/images/bookService/detail/tmall.png" - width="32" - height="22" - bind:tap="goShop" - data-link="{{bookDetail.tmallLink}}" - wx:if="{{bookDetail.tmallLink}}" - ></t-image> - <t-image - src="/static/images/bookService/detail/dangdang.png" - bind:tap="goShop" - data-link="{{bookDetail.dangdangLink}}" - wx:if="{{bookDetail.dangdangLink}}" - ></t-image> - <t-image - src="/static/images/bookService/detail/jd.png" - bind:tap="goShop" - data-link="{{bookDetail.weidianLink}}" - wx:if="{{bookDetail.weidianLink}}" - ></t-image> + <t-image src="/static/images/bookService/detail/jd.png" wx:if="{{bookDetail.JDLink}}" bind:tap="goShop" data-link="{{bookDetail.tmallLink}}" data-type="jd"></t-image> + <t-image src="/static/images/bookService/detail/tmall.png" width="32" height="22" bind:tap="goShop" data-link="{{bookDetail.tmallLink}}" wx:if="{{bookDetail.tmallLink}}"></t-image> + <t-image src="/static/images/bookService/detail/dangdang.png" bind:tap="goShop" data-link="{{bookDetail.dangdangLink}}" wx:if="{{bookDetail.dangdangLink}}"></t-image> + <t-image src="/static/images/bookService/detail/jd.png" bind:tap="goShop" data-link="{{bookDetail.weidianLink}}" wx:if="{{bookDetail.weidianLink}}"></t-image> </view> </view> </view> <view class="book-resource"> - <t-tabs - defaultValue="{{tabValue}}" - bind:change="onTabsChange" - t-class="custom-tabs" - t-class-content="custom-panel" - class="tab-class" - > + <t-tabs defaultValue="{{tabValue}}" bind:change="onTabsChange" t-class="custom-tabs" t-class-content="custom-panel" class="tab-class"> <t-tab-panel label="鍥句功绠�浠�" value="brief" style="{{tabPanelstyle}}"> - <book-brief - content="{{bookDetail.content}}" - authorIntroduction="{{bookDetail.authorIntroduction}}" - ></book-brief> + <book-brief content="{{bookDetail.content}}" authorIntroduction="{{bookDetail.authorIntroduction}}"></book-brief> </t-tab-panel> <t-tab-panel label="鐢靛瓙涔�" value="1" style="{{tabPanelstyle}}"> 鐢靛瓙涔� </t-tab-panel> - <t-tab-panel - label="鏁欏璧勬簮" - value="jsek_teachingResources" - class="{{loading ? 'loading': ''}}" - > + <t-tab-panel label="鏁欏璧勬簮" value="jsek_teachingResources" class="{{loading ? 'loading': ''}}"> <view wx:if="{{!loading && teach.length}}"> - <teach-resource - applyState="{{applyState}}" - rejectCause="{{rejectCause}}" - bind:applyResource="applyResource" - ></teach-resource> - <tree - bookInfo="{{bookDetail}}" - treeList="{{teach}}" - tab="{{tabValue}}" - applyState="{{applyState}}" - bind:downloadTeach="downloadTeach" - openTeachids="{{openTeachids}}" - ></tree> + <teach-resource applyState="{{applyState}}" rejectCause="{{rejectCause}}" bind:applyResource="applyResource"></teach-resource> + <tree bookInfo="{{bookDetail}}" treeList="{{teach}}" tab="{{tabValue}}" applyState="{{applyState}}" bind:downloadTeach="downloadTeach" openTeachids="{{openTeachids}}"></tree> </view> - <t-loading - theme="circular" - size="60rpx" - class="loading" - loading="{{loading}}" - /> + <t-loading theme="circular" size="60rpx" class="loading" loading="{{loading}}" /> </t-tab-panel> - <t-tab-panel - label="浜戝涔�" - value="jsek_cloudLearning" - style="{{tabPanelstyle}}" - > + <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> + <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> </view> </t-tab-panel> - <t-tab-panel - label="浜戞祴璇�" - value="questionBank" - style="{{tabPanelstyle}}" - > + <t-tab-panel label="浜戞祴璇�" value="questionBank" style="{{tabPanelstyle}}"> <view wx:if="{{!loading && test.length}}"> - <test-resource - list="{{test}}" - bookInfo="{{bookDetail}}" - ></test-resource> + <test-resource list="{{test}}" bookInfo="{{bookDetail}}"></test-resource> </view> </t-tab-panel> <t-tab-panel label="浜戠瑪璁�" value="jesk_note" style="{{tabPanelstyle}}"> - <note - bookInfo="{{bookDetail}}" - id="note" - class="note-list" - bind:changeLoaidng="changeLoaidng" - ></note> + <note bookInfo="{{bookDetail}}" id="note" class="note-list" bind:changeLoaidng="changeLoaidng"></note> </t-tab-panel> </t-tabs> </view> @@ -241,29 +132,15 @@ </view> <view class="bottom-btn"> <view> - <t-image - src="/static/images/bookService/detail/paper-book.png" - ></t-image> + <t-image src="/static/images/bookService/detail/paper-book.png"></t-image> </view> <view class="btn-text">绾歌川鏍蜂功鐢宠</view> </view> <view class="shopCar" bind:tap="addBookShopcCar">鍔犲叆璐墿杞�</view> - <view class="buy">绔嬪嵆璐拱</view> + <view class="buy" bind:tap="buyBook">绔嬪嵆璐拱</view> </view> </scroll-view> <!-- 鎴戣寤鸿寮圭獥 --> -<suggest - class="suggest-component" - id="suggest-component" - bookIcon="{{bookDetail.icon}}" - bookName="{{bookDetail.name}}" -></suggest> +<suggest class="suggest-component" id="suggest-component" bookIcon="{{bookDetail.icon}}" bookName="{{bookDetail.name}}"></suggest> <!-- 鏁欏璧勬簮涓嬭浇鎻愮ず寮圭獥 --> -<t-dialog -class="teachDownloadDialog" - visible="{{isShowTeachDownload}}" - title="鎻愮ず" - content="璇峰墠寰�PC绔笅杞�" - confirm-btn="{{ confirmBtn }}" - bind:confirm="closeTeachDownload" -/> +<t-dialog class="teachDownloadDialog" visible="{{isShowTeachDownload}}" title="鎻愮ず" content="璇峰墠寰�PC绔笅杞�" confirm-btn="{{ confirmBtn }}" bind:confirm="closeTeachDownload" /> \ No newline at end of file diff --git a/pages/cart/index.js b/pages/cart/index.js index db4d31b..c2194e7 100644 --- a/pages/cart/index.js +++ b/pages/cart/index.js @@ -1,6 +1,7 @@ const app = getApp(); // import { getPublicImage } from '@/assets/js/middleGround/tool.js' import { getPublicImage } from '../../assets/js/middleGround/tool'; +import Toast from 'tdesign-miniprogram/toast/index'; Page({ data: { @@ -9,7 +10,8 @@ checkAll: false, checkedList: [], selectedCount: 0, - totalPrice: 0.00 + totalPrice: 0.00, + type: '' }, onLoad(options) { @@ -39,6 +41,12 @@ app.MG.store.getShoppingCartProductList(query).then(res => { 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' + }) + }); this.setData({ @@ -101,19 +109,30 @@ const selectedItems = this.data.shoppingCartData.filter(item => item.checked); - console.log(selectedItems, 789); + // console.log(selectedItems, 789); const selectedIds = selectedItems.map(item => item.id); console.log('閫変腑鐨勫晢鍝� id:', selectedIds); + if (selectedIds.length) { + app.MG.store.shoppingCartCreateOrder({ linkIds: selectedIds }).then(res => { + console.log(res.orderNumber, 456); + const url = '/pages/cart/paymentPage/index?orderNumber=' + res.orderNumber + wx.navigateTo({ + url + }); - app.MG.store.shoppingCartCreateOrder({ linkIds: selectedIds }).then(res => { - console.log(res.orderNumber, 456); - const url = '/pages/cart/paymentPage/index?orderNumber=' + res.orderNumber - wx.navigateTo({ - url + + }) + } else { + + Toast({ + context: this, + selector: '#t-toast', + message: '璇烽�夋嫨鍟嗗搧', + theme: 'warning', + direction: 'column', }); + } - - }) } diff --git a/pages/cart/index.json b/pages/cart/index.json index cfbbec2..e06cfaa 100644 --- a/pages/cart/index.json +++ b/pages/cart/index.json @@ -4,6 +4,8 @@ "t-checkbox": "tdesign-miniprogram/checkbox/checkbox", "t-swipe-cell": "tdesign-miniprogram/swipe-cell/swipe-cell", "t-cell": "tdesign-miniprogram/cell/cell", - "t-button": "tdesign-miniprogram/button/button" + "t-button": "tdesign-miniprogram/button/button", + "t-toast": "tdesign-miniprogram/toast/toast", + "t-empty": "tdesign-miniprogram/empty/empty" } } \ No newline at end of file diff --git a/pages/cart/index.wxml b/pages/cart/index.wxml index 931b46a..32e95b2 100644 --- a/pages/cart/index.wxml +++ b/pages/cart/index.wxml @@ -1,12 +1,31 @@ <view class="outsideContentBox"> <!-- <checkbox-group bindchange="HandelItemChange"> --> + <view wx:if="{{!shoppingCartData}}" class="noDataBox"> + <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" font-size="80" /> + + </view> <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 class="itemWarp"> - <t-cell bordered="{{false}}" title="{{item.productMonWithLinkDto.product.name}}" description="锟{item.saleMethod.price}}"> + <t-cell bordered="{{false}}"> + <view slot="title" class="titleBox"> + <view class="labelBox"> + <view class="eBook" wx:if="{{type == 'product'}}">鐢靛瓙涔�</view> + <view wx:if="{{type == 'item'}}" class="cloudLearning">浜戝涔�</view> + + </view> + + <view class="boosName"> + {{item.productMonWithLinkDto.product.name}} + </view> + + + </view> + <view slot="description" class="descriptionBox" wx:if="{{item.saleMethod.price != 0}}"> 锟{item.saleMethod.price}}</view> + <view wx:else slot="description" class="descriptionBox"> 绔嬪嵆棰嗗彇</view> <view slot="left-icon" class="left-icon"> <view class="contentCheckbox"> <t-checkbox icon="rectangle" value=" {{item.id}}" data-item="{{item}}" checked="{{item.checked}}" bindchange="HandelItemChange" /> @@ -35,4 +54,6 @@ <t-button class="tButtonBox" size="small" shape="round" bind:tap="goPaymentPage">鍘荤粨绠�({{selectedCount}})</t-button> </view> </view> -</view> \ No newline at end of file +</view> + +<t-toast id="t-toast" /> \ No newline at end of file diff --git a/pages/cart/index.wxss b/pages/cart/index.wxss index 35eecdb..cfe290d 100644 --- a/pages/cart/index.wxss +++ b/pages/cart/index.wxss @@ -56,25 +56,24 @@ .settlementBox { - /* width: 100%; */ + width: 80%; display: flex; align-items: center; /* justify-content: space-between; */ } .totalPrice { + flex: 1; /* margin: 0 50rpx; */ } .buttonBox { - - /* margin: 0 30rpx; */ - margin-left: 140rpx; + margin-right: 80rpx; } .tButtonBox { - background-color: #FF6C00; + /* background-color: #FF6C00; */ width: 200rpx; height: 80rpx; } @@ -166,4 +165,75 @@ .imageStyle { width: 100%; height: 100%; +} + +.t-checkbox { + --td-checkbox-icon-checked-color: #FF6C00; +} + +.t-checkbox--block { + padding: 0 !important; +} + +.t-button--default { + background-color: #FF6C00 !important; +} + +.noDataBox { + width: 100%; + margin-top: 200rpx; + display: flex; + justify-content: center; + align-items: center; +} + +page { + background: #F2F3F8; +} + +.titleBox { + display: flex; + flex-direction: row; + + margin: 15rpx; + +} + +.descriptionBox { + margin: 15rpx; +} + +.labelBox { + width: 125rpx; + height: 38rpx; + font-size: 22rpx; + color: #FFFFFF; + font-family: PingFang SC, PingFang SC; + margin-right: 30rpx; + border-radius: 0px 0px 0px 5px; +} + +.eBook { + width: 100%; + height: 100%; + background: #FF6C00; + text-align: center; + line-height: 38rpx; +} + +.cloudLearning { + width: 100%; + height: 100%; + background: #5F92FD; + text-align: center; + line-height: 38rpx; +} + +.boosName { + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; } \ No newline at end of file diff --git a/pages/cart/paymentPage/index.wxml b/pages/cart/paymentPage/index.wxml index 45f3e31..945c7a5 100644 --- a/pages/cart/paymentPage/index.wxml +++ b/pages/cart/paymentPage/index.wxml @@ -1,68 +1,82 @@ -<!--pages/cart/paymentPage/index.wxml--> -<view style="width: 100%; height: {{barHeight}}px; "></view> -<view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> - <view> - <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> +<!-- 澶撮儴 --> +<view class="titleBox"> + + <view style="width: 100%; height: {{barHeight}}px; "></view> + <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> + <view> + <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> + </view> + <view class="navbar-title">鎻愪氦璁㈠崟</view> </view> - <view class="navbar-title">鎻愪氦璁㈠崟</view> </view> - - - -<view class="content"> +<view class="paymentPageBox"> - <!-- - <t-button t-class="wrapper" theme="primary" size="large" variant="outline" data-key="showCloseBtn" bind:tap="showDialog" block> - 甯﹀叧闂寜閽� - </t-button> --> - <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 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"> + <image src="{{item.paymentIcon }}" mode="aspectFit" /> + </view> + + <view class="cartListContent"> + <view class="cartListDetails">{{item.orderSaleMethod.product.name}}</view> + <view class="textBox">鍥句功鏈嶅姟-鐢靛瓙涔�</view> + <view class="priceBox">锟{item.payPrice}}</view> + </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"> - <image src="{{item.paymentIcon }}" mode="aspectFit" /> - <view class="cartListContent"> - <view class="cartListDetails">{{item.orderSaleMethod.product.name}}</view> - <view class="textBox">鍥句功鏈嶅姟-鐢靛瓙涔�</view> - <view class="priceBox">锟{item.payPrice}}</view> + + + <view class="priceBreakdown"> + <view class="priceBreakdownContent">浠锋牸鏄庣粏</view> + <view class="amountMoney"> + <view>鍟嗗搧閲戦</view> + <view>锟{payPrice}}</view> </view> - + <view class="amount"> + <view>鍚堣锛氾骏{{payPrice}}</view> + </view> </view> + + </view> - - <view class="priceBreakdown"> - <view class="priceBreakdownContent">浠锋牸鏄庣粏</view> - <view class="amountMoney"> - <view>鍟嗗搧閲戦</view> - <view>锟{payPrice}}</view> - </view> - <view class="amount"> - <view>鍚堣锛氾骏{{payPrice}}</view> - </view> - </view> - - - - <view class="interval"></view> + <!-- <view class="interval"></view> --> <view class="paymentBox"> <view class="residue">寰呮敮浠橈細<text class="residueTextBox">锟{payPrice}}</text></view> @@ -70,5 +84,4 @@ <t-button class="buttonBox" shape="round" bind:tap="confirmOrderGet">寰俊鏀粯</t-button> </view> </view> - </view> \ No newline at end of file diff --git a/pages/cart/paymentPage/index.wxss b/pages/cart/paymentPage/index.wxss index 5a5f81e..695fc63 100644 --- a/pages/cart/paymentPage/index.wxss +++ b/pages/cart/paymentPage/index.wxss @@ -18,10 +18,12 @@ .content { width: 100%; - height: 1250rpx; + background-color: #F2F3F8; padding: 40rpx 0; padding-top: 1rpx; + margin-top: 110rpx; + } .shoppingCartList { @@ -31,10 +33,15 @@ margin: 30rpx 0; } -image { +.imageBox { width: 150rpx; height: 210rpx; margin: 30rpx; +} + +image { + width: 100%; + height: 100%; } .cartListContent { @@ -74,10 +81,10 @@ } .priceBreakdown { - height: 280rpx; + height: 250rpx; background: #fff; padding: 30rpx; - + margin-bottom: 120rpx; } .priceBreakdownContent { @@ -117,6 +124,10 @@ justify-content: space-between; padding: 30rpx; align-items: center; + background-color: #fff; + width: 100%; + position: fixed; + bottom: 0; } .residue { @@ -132,6 +143,7 @@ .buttonBox { background-color: #FF6C00; border: #fff; + margin-right: 80rpx; } .myQrcodeBox { @@ -141,4 +153,19 @@ .myQrcodeTextBox { text-align: center; margin: 30rpx 0; +} + +.paymentPageBox {} + +page { + background-color: #F2F3F8; + position: relative; +} + +.titleBox { + background-color: #fff; + position: fixed; + top: 0; + width: 100%; + } \ No newline at end of file diff --git a/pages/resourceDetails/document/index.wxml b/pages/resourceDetails/document/index.wxml index 9eae17e..19620c0 100644 --- a/pages/resourceDetails/document/index.wxml +++ b/pages/resourceDetails/document/index.wxml @@ -13,13 +13,15 @@ <view class="pictureBox" wx:if="{{selectType == 'picture'}}"> - <image src="{{showData}}" mode="" /> + <image src="{{showData}}" mode="aspectFit" /> </view> <view wx:if="{{selectType == 'zip'}}"> <view class="zipImageBox"> <image src="/static/images/document/zip200px.png" mode="aspectFill " /> </view> + + <view class="button-example"> <t-button size="large" bind:tap="onDownloadButton"> <view class="text"> @@ -43,7 +45,4 @@ <web-view wx:if="{{selectType == 'webpage'}}" src="{{webpageSrc}}"></web-view> -<!-- <button bind:tap="handleTap">鐐逛綅</button> --> - - - +<!-- <button bind:tap="handleTap">鐐逛綅</button> --> \ No newline at end of file diff --git a/pages/resourceDetails/document/index.wxss b/pages/resourceDetails/document/index.wxss index 9bee7b2..2375ebb 100644 --- a/pages/resourceDetails/document/index.wxss +++ b/pages/resourceDetails/document/index.wxss @@ -3,7 +3,6 @@ background-color: #fff; display: flex; align-items: center; - } .navbar-title { @@ -18,7 +17,6 @@ .button-example { margin: 0 70rpx; - background-color: #ff6c00; display: flex; justify-content: center; @@ -26,7 +24,6 @@ .button-example .text { background-color: #ff6c00; - } .t-button--default { @@ -62,15 +59,9 @@ .pictureBox { display: flex; justify-content: center; - } .pictureBox image { - width: 520rpx; - height: 800rpx; -} - -image { - width: 750rpx; - height: 1200rpx; + /* width: 520rpx; + height: 800rpx; */ } \ No newline at end of file diff --git a/pages/resourceDetails/myAudio/index.js b/pages/resourceDetails/myAudio/index.js index 245375a..544125b 100644 --- a/pages/resourceDetails/myAudio/index.js +++ b/pages/resourceDetails/myAudio/index.js @@ -580,7 +580,7 @@ onLeftSwitch() { this.setData({ speed: 1.0, - myAudioCurrent: 0 + myAudioCurrent: '00:00' }) const index = this.data.threeLeveData.findIndex((item) => item.id == this.data.selectId) if (this.data.threeLeveData[index - 1]) { @@ -599,7 +599,7 @@ onRightSwitch() { this.setData({ speed: 1.0, - myAudioCurrent: 0 + myAudioCurrent: '00:00' }) console.log('鍙冲垏鎹�'); const index = this.data.threeLeveData.findIndex((item) => item.id == this.data.selectId) @@ -655,9 +655,7 @@ myAudio.playbackRate = this.data.speed; // 鎾斁閫熺巼 }, 200); }, - handleChange(e) { - console.log(e.detail.value); - }, + // 鎷栧姩杩涘害鏉★紝鍒版寚瀹氫綅缃� hanle_slider_change(e) { const position = e.detail.value; diff --git a/pages/resourceDetails/myAudio/index.wxml b/pages/resourceDetails/myAudio/index.wxml index ddf7634..daf0f65 100644 --- a/pages/resourceDetails/myAudio/index.wxml +++ b/pages/resourceDetails/myAudio/index.wxml @@ -3,7 +3,7 @@ <view> <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> </view> - <view class="navbar-title">璧勬簮璇︽儏-瑙嗛</view> + <view class="navbar-title">璧勬簮璇︽儏-闊抽</view> </view> @@ -14,40 +14,47 @@ <image src="/static/images/resourceDetailsMyAudio/cd.png" alt="" /> </view> - <slider class="mp-slider-bar" block-size="16" value="{{myAudioPos}}" bindchange="hanle_slider_change"></slider> <!-- 瑙嗛鎾斁鐨勬寜閽� --> - <view class="functionBox"> + <view class="bigFunctionBox"> + <slider activeColor='#FF6C00' class="mp-slider-bar" block-size="16" value="{{myAudioPos}}" bindchange="hanle_slider_change"></slider> + + <view class="functionBox"> - <!-- 宸﹀垏鎹� --> - <view class="leftSwitchBox color" bind:tap="onLeftSwitch"> - <t-icon name="previous" size="24" /> - </view> - <!-- 鏆傚仠鎾斁 --> - <view class="audioIconBox color"> - <view wx:if="{{!isplay}}" bind:tap='play'> - <t-icon name="play-circle-stroke" size="24" /> + <!-- 宸﹀垏鎹� --> + <view class="leftSwitchBox color" bind:tap="onLeftSwitch"> + <t-icon name="previous" size="24" /> </view> - <view wx:else bind:tap="stop"> - <t-icon name="pause-circle-stroke" size="24" /> + + <!-- 鏆傚仠鎾斁 --> + <view class="audioIconBox color"> + <view wx:if="{{!isplay}}" bind:tap='play'> + <t-icon name="play-circle-stroke" size="24" /> + </view> + <view wx:else bind:tap="stop"> + <t-icon name="pause-circle-stroke" size="24" /> + </view> </view> - </view> - <!-- 鍙冲垏鎹� --> - <view class="rightSwitchBox color" bind:tap="onRightSwitch"> - <t-icon name="next" size="24" /> - </view> + <!-- 鍙冲垏鎹� --> + <view class="rightSwitchBox color" bind:tap="onRightSwitch"> + <t-icon name="next" size="24" /> + </view> - <view class="current-time color">{{myAudioCurrent}} </view> - <view class="color" style="margin: 0 10rpx;">/</view> - <view class="duration-time color"> {{myAudioDuration}} </view> + <!-- 鏃堕棿 --> + <view class="current-time color">{{myAudioCurrent}} </view> + <view class="color" style="margin: 0 10rpx;">/</view> + <view class="duration-time color"> {{myAudioDuration}} </view> - <view class="publicBtn color" style="margin-left:100rpx ;" bind:tap="onSpeed"> + <view class="publicBtn color" style="margin-left:100rpx ;" bind:tap="onSpeed"> - <text class="publicText">{{"x "+speed}}</text> + <text class="publicText">{{"x "+speed}}</text> + </view> </view> </view> + + </view> <!-- 鏍囬 --> diff --git a/pages/resourceDetails/myAudio/index.wxss b/pages/resourceDetails/myAudio/index.wxss index e7ae00d..4d891e6 100644 --- a/pages/resourceDetails/myAudio/index.wxss +++ b/pages/resourceDetails/myAudio/index.wxss @@ -3,12 +3,10 @@ background-color: #fff; display: flex; align-items: center; - } .navbar-title { white-space: nowrap; - /* overflow: hidden; */ text-overflow: ellipsis; color: #0F1214; font-size: 40rpx; @@ -31,7 +29,6 @@ } .contentBox .custom-tabs { - /* margin-bottom: 32rpx; */ width: 400rpx; } @@ -43,9 +40,7 @@ .custom-panel { - /* height: 120px; */ width: 750rpx; - /* height: 200rpx; */ } @@ -56,7 +51,6 @@ right: 0; width: 350rpx; border-bottom: 1px solid #f4f4f4; - } .takeNotes image { @@ -76,7 +70,6 @@ display: flex; align-items: flex-end; justify-content: space-between; - } .iconBox { @@ -110,7 +103,6 @@ .input-example { --td-input-vertical-padding: 24rpx; - background-color: #fff; padding: 32rpx 32rpx 16rpx; } @@ -124,15 +116,9 @@ .buttonBox { display: flex; - /* justify-content: flex-end; */ justify-content: center; } - -/* .inputBox { - height: 500rpx; -} */ - .detailsName { margin: 30rpx; @@ -140,7 +126,6 @@ height: 60rpx; display: flex; align-items: center; - padding-left: 20rpx; background-color: #FFF6F0 } @@ -212,13 +197,6 @@ padding-bottom: 16rpx; } -.dialogIconBox { - /* width: 500rpx; - height: 300rpx; - color: #000; - background-color: ccc; */ -} - .popup { padding: 40rpx; width: 600rpx; @@ -257,7 +235,6 @@ margin-bottom: 20rpx; max-height: 600rpx; text-align: justify; - /* padding-bottom: 200rpx; */ } .note-bottom { @@ -293,9 +270,6 @@ .audioBackground { flex: 1; background-size: 100% 110%; - - /* background-repeat: no-repeat; - background-position: center center; */ background-color: #f9f9f9; display: flex; justify-content: center; @@ -305,22 +279,16 @@ .audioBackground image { width: 270rpx; height: 280rpx; - } .functionBox { height: 96rpx; - background: #000000; - opacity: 0.6; display: flex; align-items: center; } -.functionBox .audioIconBox {} - .functionBox .color { color: #fff; - } .rightSwitchBox { @@ -329,4 +297,23 @@ .leftSwitchBox { margin: 0 30rpx; +} + +.bigFunctionBox { + background: #000000; + opacity: 0.6; +} + +.mp-slider-bar { + margin: 0 18rpx; + margin-top: 10rpx; +} + +.t-tabs__item--active { + color: #FF6C00 !important; + +} + +.t-tabs__track { + background-color: #FF6C00 !important; } \ No newline at end of file diff --git a/pages/resourceDetails/myVideo/index.js b/pages/resourceDetails/myVideo/index.js index 0606bf4..d99b880 100644 --- a/pages/resourceDetails/myVideo/index.js +++ b/pages/resourceDetails/myVideo/index.js @@ -65,7 +65,8 @@ cmsId: options.cmsId, parentName: options.parentName, parentProductLinkPath: options.parentProductLinkPath, - productLinkPath: options.productLinkPath + productLinkPath: options.productLinkPath, + flag: false }) this.resourceDetailsData() @@ -126,7 +127,8 @@ onTabsClick(event) { - }, handleChange(e) { + }, + handleChange(e) { this.setData({ activeValues: e.detail.value, }); @@ -148,15 +150,15 @@ closeDialog() { this.setData({ - dialogKey: false + dialogKey: false, + textvalue: '', + flag: false }); }, goBack() { wx.navigateBack(); }, resourceDetailsData() { - - let query = { path: '*', queryType: '*', @@ -189,13 +191,15 @@ this.setData({ threeLeveData: this.data.threeLeveData }) + + if (this.data.productLinkPath == item.productLinkPath) { + this.setData({ + showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file, + titleName: item.name + }) + } } - if (this.data.productLinkPath == item.productLinkPath) { - this.setData({ - showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file, - titleName: item.name - }) - } + }) this.data.threeLeveData.forEach((item) => { @@ -258,7 +262,6 @@ console.log(e.currentTarget.dataset.value); this.setData({ flag: e.currentTarget.dataset.value - }) }, // 鏍囬杈撳叆妗嗗�� diff --git a/pages/resourceDetails/myVideo/index.wxml b/pages/resourceDetails/myVideo/index.wxml index 8c8a0b4..8f5847e 100644 --- a/pages/resourceDetails/myVideo/index.wxml +++ b/pages/resourceDetails/myVideo/index.wxml @@ -9,12 +9,10 @@ <view class="videoBox"> <!-- autoplay='false' 鏄惁鑷姩鎾斁 --> <video src="{{showData}}" play-btn-position='center' object-fit='fill' controls enable-play-gesture enable-auto-rotation></video> - </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"> <!-- 璧勬簮鍒楄〃 --> @@ -22,12 +20,9 @@ <view class="wrapper"> <t-collapse value="{{activeValues}}" bind:change="handleChange"> <t-collapse-panel header="{{parentName}}" value="{{0}}" expandIcon> - <view class="detailsName" wx:for="{{threeLeveData}}" wx:key="index" wx:for-item="item" wx:for-index="index" bind:tap="onVideo" data-item="{{item}}" data-index="{{index}}"> <view style="color: {{selectedId == index ? '#ff6c00' : '#000'}}">{{item.name}}</view> </view> - - </t-collapse-panel> </t-collapse> </view> diff --git a/pages/resourceDetails/myVideo/index.wxss b/pages/resourceDetails/myVideo/index.wxss index 420db58..511cbd2 100644 --- a/pages/resourceDetails/myVideo/index.wxss +++ b/pages/resourceDetails/myVideo/index.wxss @@ -287,4 +287,13 @@ width: 30rpx; height: 30rpx; margin: 0 15rpx; +} + +.t-tabs__item--active { + color: #FF6C00 !important; + +} + +.t-tabs__track { + background-color: #FF6C00 !important; } \ No newline at end of file diff --git a/pages/retrievalPage/index.js b/pages/retrievalPage/index.js index 72634ee..060d8f2 100644 --- a/pages/retrievalPage/index.js +++ b/pages/retrievalPage/index.js @@ -431,6 +431,11 @@ fields }) + datas5.forEach((items) => { + items.subtitleName = items.subtitle + items.name + + }) + console.log(datas5, 'sadasd'); this.setData({ biblioClassificationData: datas5, biblioClassificationTotal: data5.totalCount diff --git a/pages/retrievalPage/index.wxml b/pages/retrievalPage/index.wxml index 132654a..ab0107a 100644 --- a/pages/retrievalPage/index.wxml +++ b/pages/retrievalPage/index.wxml @@ -22,7 +22,7 @@ <view class="bookDataBox"> - <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="bookDataForBox" wx:for="{{bookData}}" wx:key="index" wx:for-item="item" wx:for-index="index" data-item="{{item}}" bind:tap="onBook"> <view class="imageBox"> <image src="{{item.icon}}" mode="aspectFill" /> </view> @@ -153,7 +153,7 @@ <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="" /> - <view class="textBox" title="{{item.name}}"> <text>{{item.name}}</text></view> + <view class="textBox" title="{{item.name}}"> <text>{{item.subtitleName}}</text></view> </view> </view> diff --git a/pages/retrievalPage/index.wxss b/pages/retrievalPage/index.wxss index 1d9cce0..a893adc 100644 --- a/pages/retrievalPage/index.wxss +++ b/pages/retrievalPage/index.wxss @@ -131,17 +131,14 @@ } .body-info .name { - font-size: 32rpx; - height: 88rpx; - color: #333333; - font-weight: bold; - line-height: 44rpx; - display: -webkit-box; - margin-bottom: 10rpx; + + font-size: 25rpx; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; text-overflow: ellipsis; + display: -webkit-box; + margin-bottom: 10rpx; } .body-info .time { @@ -176,7 +173,8 @@ .listBox1 .listItemBox { height: 220rpx; - margin-bottom: 30rpx; + margin-bottom: 20rpx; + padding: 30rpx; } .listBox1 .specialSubject-img { @@ -286,4 +284,13 @@ color: #333333; padding: 15rpx; margin-bottom: 10rpx; +} + +.t-tabs__item--active { + color: #FF6C00 !important; + +} + +.t-tabs__track { + background-color: #FF6C00 !important; } \ No newline at end of file diff --git a/project.config.json b/project.config.json index d702033..7f717ad 100644 --- a/project.config.json +++ b/project.config.json @@ -48,7 +48,7 @@ }, "compileType": "miniprogram", "libVersion": "2.23.1", - "appid": "wx5461028c83fea0b3", + "appid": "wx7f362fe7cb6e0d1f", "projectname": "tdesign-miniprogram-starter-retail", "simulatorType": "wechat", "simulatorPluginLibVersion": {}, diff --git a/static/images/bibliographyList/square.png b/static/images/bibliographyList/square.png new file mode 100644 index 0000000..fc6a912 --- /dev/null +++ b/static/images/bibliographyList/square.png Binary files differ diff --git a/static/images/bibliographyList/square@2x.png b/static/images/bibliographyList/square@2x.png new file mode 100644 index 0000000..da0fa8c --- /dev/null +++ b/static/images/bibliographyList/square@2x.png Binary files differ diff --git a/static/video/sea.mp4 b/static/video/sea.mp4 deleted file mode 100644 index 328ebe3..0000000 --- a/static/video/sea.mp4 +++ /dev/null Binary files differ diff --git a/style/theme.wxss b/style/theme.wxss index 8b563f4..b0f01a6 100644 --- a/style/theme.wxss +++ b/style/theme.wxss @@ -22,13 +22,13 @@ --td-button-font-weight: 500; --td-button-medium-font-size: 32rpx; --td-button-default-color: #fff; - --td-button-default-bg-color: #fa4126; - --td-button-default-border-color: #fa4126; + --td-button-default-bg-color: #FF6C00; + --td-button-default-border-color: #FF6C00; --td-button-default-disabled-color: #fff; --td-button-default-disabled-bg: #cccccc; --td-button-default-disabled-border-color: #cccccc; - --td-button-default-active-bg-color: #fa4126; - --td-button-default-active-border-color: #fa4126; + --td-button-default-active-bg-color: #FF6C00; + --td-button-default-active-border-color: #FF6C00; } .t-textarea { -- Gitblit v1.9.1