From 986d4798a9dad75b6ae617e52ea2918dfacd3708 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期五, 22 三月 2024 11:19:34 +0800 Subject: [PATCH] 图书详情、答题器bug修改 --- packageBookService/pages/bookServices/examination/questionList/index.js | 18 packageBookService/pages/bookServices/list/index.wxml | 8 packageBookService/pages/bookServices/examination/questionList/index.wxss | 20 + packageBookService/pages/bookServices/examination/questionList/index.wxml | 237 ++++++++++++- packageBookService/pages/bookServices/list/index.wxss | 34 + .vscode/settings.json | 2 packageBookService/pages/bookServices/examination/questionSchedule/index.js | 9 packageBookService/pages/bookServices/detail/index.wxml | 225 +++++++++++-- packageBookService/pages/bookServices/examination/questionOptions/index.js | 3 packageBookService/pages/bookServices/detail/index.wxss | 4 packageBookService/pages/bookServices/detail/components/brief/index.js | 3 packageBookService/pages/bookServices/examination/examination.wxml | 2 packageBookService/pages/bookServices/examination/questionOptions/index.wxml | 135 ++++++- packageBookService/pages/bookServices/examination/questionSchedule/index.wxss | 9 packageBookService/pages/bookServices/examination/examination.js | 180 ++++++++++ packageBookService/pages/bookServices/examination/questionSchedule/index.wxml | 36 ++ packageBookService/pages/bookServices/detail/components/testResource/testResource.js | 19 17 files changed, 797 insertions(+), 147 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 8096c21..22d6d96 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -32,7 +32,7 @@ }, "editor.tabSize": 2, "[wxml]": { - "editor.defaultFormatter": "wechat.miniprogram.wxml-language-features" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[css]": { "editor.defaultFormatter": "HookyQR.beautify" diff --git a/packageBookService/pages/bookServices/detail/components/brief/index.js b/packageBookService/pages/bookServices/detail/components/brief/index.js index 8cc00b8..ad255bb 100644 --- a/packageBookService/pages/bookServices/detail/components/brief/index.js +++ b/packageBookService/pages/bookServices/detail/components/brief/index.js @@ -8,6 +8,5 @@ type: String, value: '', }, - }, - + } }); diff --git a/packageBookService/pages/bookServices/detail/components/testResource/testResource.js b/packageBookService/pages/bookServices/detail/components/testResource/testResource.js index 119ce3b..ec78dac 100644 --- a/packageBookService/pages/bookServices/detail/components/testResource/testResource.js +++ b/packageBookService/pages/bookServices/detail/components/testResource/testResource.js @@ -42,6 +42,9 @@ } }) } + wx.showLoading({ + title: '鍔犺浇涓�', + }) // 鑾峰彇绔犺妭涓嬫槸鍚︽湁棰樼洰 let idPathList = [] let query = { @@ -55,6 +58,7 @@ } } if (value.childrenFolderCount == 0) { + wx.hideLoading() return wx.showToast({ icon: "error", title: '鏆傛棤鏁版嵁', @@ -70,16 +74,7 @@ }) }) } - // query: { - // title: bookData.value.test, - // bookId: route.query.bookId, - // productLinkPath: data.productLinkPath, - // answerTitle: data.name, - // answerType: 'option', - // rootCmsItemId: bookData.value.rootCmsItemId, - // idPathList: JSON.stringify(idPathList) - // } - + wx.hideLoading() wx.navigateTo({ url: `/packageBookService/pages/bookServices/examination/examination?bookId=${this.properties.bookInfo.id}&productLinkPath=${value.productLinkPath}&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&idPathList=${JSON.stringify(idPathList)}&answerTitle=${value.name}&answerType=${'option'}`, }) @@ -106,6 +101,9 @@ }) }, async getMockId() { + wx.showLoading({ + title: '鍔犺浇涓�' + }) let id let query = { start: 0, @@ -124,6 +122,7 @@ // return logIn() // } const mockid = await this.getMockId() + wx.hideLoading() const item = e.currentTarget.dataset.item wx.navigateTo({ url: `/packageBookService/pages/bookServices/examination/examination?bookId=${this.properties.bookInfo.id}&rootCmsItemId=${this.properties.bookInfo.rootCmsItemId}&answerTitle=${item.name}&answerType=${'mock'}&uuid=${item.id}&mockid=${mockid}`, diff --git a/packageBookService/pages/bookServices/detail/index.wxml b/packageBookService/pages/bookServices/detail/index.wxml index 8296b05..b55720f 100644 --- a/packageBookService/pages/bookServices/detail/index.wxml +++ b/packageBookService/pages/bookServices/detail/index.wxml @@ -3,7 +3,12 @@ <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> @@ -14,19 +19,33 @@ <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> @@ -48,15 +67,24 @@ <view class="li-content">{{bookDetail.isbn}}</view> </view> <view class="message-li"> - <view class="li-title" wx:if="{{bookDetail.publicationDate}}">鍑虹増鏃堕棿锛�</view> + <view class="li-title" wx:if="{{bookDetail.publicationDate}}" + >鍑虹増鏃堕棿锛�</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> </view> - <t-image src="/static/images/bookService/detail/square.png" class="right-background"></t-image> + <t-image + src="/static/images/bookService/detail/square.png" + class="right-background" + ></t-image> </view> </view> <!-- 閿�鍞俊鎭� --> @@ -65,11 +93,16 @@ <!-- 鐢靛瓙涔﹀敭浠� --> <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> @@ -77,61 +110,151 @@ <!-- 绾歌川涔﹀敭浠� --> <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.JDLink}}" 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.JDLink}}" + 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}}" wx:if="{{bookDetail.content && bookDetail.authorIntroduction}}"></book-brief> - <view wx:if="{{!bookDetail.content && !bookDetail.authorIntroduction}}" class="noData"> + <book-brief + content="{{bookDetail.content}}" + authorIntroduction="{{bookDetail.authorIntroduction}}" + wx:if="{{bookDetail.content || bookDetail.authorIntroduction}}" + ></book-brief> + <view + wx:if="{{!bookDetail.content && !bookDetail.authorIntroduction}}" + class="noData" + > <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> </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 && !noResources}}"> - <teach-resource applyState="{{applyState}}" rejectCause="{{rejectCause}}" bind:applyResource="applyResource" applyResourceLoading="{{applyResourceLoading}}"></teach-resource> - <tree bookInfo="{{bookDetail}}" treeList="{{teach}}" tab="{{tabValue}}" applyState="{{applyState}}" bind:downloadTeach="downloadTeach" openTeachids="{{openTeachids}}" wx:if="{{teach.length}}"></tree> + <teach-resource + applyState="{{applyState}}" + rejectCause="{{rejectCause}}" + bind:applyResource="applyResource" + applyResourceLoading="{{applyResourceLoading}}" + ></teach-resource> + <tree + bookInfo="{{bookDetail}}" + treeList="{{teach}}" + tab="{{tabValue}}" + applyState="{{applyState}}" + bind:downloadTeach="downloadTeach" + openTeachids="{{openTeachids}}" + wx:if="{{teach.length}}" + ></tree> </view> - <t-loading theme="circular" size="60rpx" class="loading" loading="{{loading}}" /> + <t-loading + theme="circular" + size="60rpx" + class="loading" + loading="{{loading}}" + /> <view wx:if="{{noResources}}" class="noData"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> </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 id="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 + id="tree" + bookInfo="{{bookDetail}}" + tab="{{tabValue}}" + treeList="{{learn}}" + buyIds="{{buyIdList}}" + openLearnids="{{openLearnids}}" + ></tree> </view> <view wx:if="{{noResources}}" class="noData"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </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}}" mockData="{{mockData}}"></test-resource> + <test-resource + list="{{test}}" + bookInfo="{{bookDetail}}" + mockData="{{mockData}}" + ></test-resource> </view> <view wx:if="{{noResources}}" class="noData"> <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </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> @@ -145,22 +268,48 @@ </view> <view class="bottom-btn" bind:tap="appplyPaperBook"> <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 {{(tabValue == 'jsek_teachingResources' || tabValue == 'jesk_note') ? 'disabledColor' : 'shopCarColor' }}" bind:tap="addBookShopcCar">鍔犲叆璐墿杞�</view> - <view class="buy {{(tabValue == 'jsek_teachingResources' || tabValue == 'jesk_note') ? 'disabledColor' : 'buyColor' }}" bind:tap="buyBtn">绔嬪嵆璐拱</view> + <view + class="shopCar {{(tabValue == 'jsek_teachingResources' || tabValue == 'jesk_note') ? 'disabledColor' : 'shopCarColor' }}" + bind:tap="addBookShopcCar" + >鍔犲叆璐墿杞�</view + > + <view + class="buy {{(tabValue == 'jsek_teachingResources' || tabValue == 'jesk_note') ? 'disabledColor' : 'buyColor' }}" + bind:tap="buyBtn" + >绔嬪嵆璐拱</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" +/> <view class="applyBox" bindtap="goApply"> <view class="box"> - <t-image src="/static/images/home/yangshuForm.png" mode="heightFix" class="img" /> + <t-image + src="/static/images/home/yangshuForm.png" + mode="heightFix" + class="img" + /> <view class="num" wx:if="{{num > 0}}">{{num}}</view> </view> -</view> \ No newline at end of file +</view> diff --git a/packageBookService/pages/bookServices/detail/index.wxss b/packageBookService/pages/bookServices/detail/index.wxss index 0cf0628..8b09d1f 100644 --- a/packageBookService/pages/bookServices/detail/index.wxss +++ b/packageBookService/pages/bookServices/detail/index.wxss @@ -281,7 +281,9 @@ .tab-class { - --td-loading-color: #ff6c00 + --td-loading-color: #ff6c00; + --td-tab-nav-bg-color: #fff; + --td-tab-track-color: #ff6c00 } .loading { diff --git a/packageBookService/pages/bookServices/examination/examination.js b/packageBookService/pages/bookServices/examination/examination.js index 3bec06c..d99f15b 100644 --- a/packageBookService/pages/bookServices/examination/examination.js +++ b/packageBookService/pages/bookServices/examination/examination.js @@ -258,8 +258,18 @@ item.isUserAnswer = this.isHaveAnswer(radioChecked) } }) + const cardListUpdata = this.data.cardList + cardListUpdata.forEach(item => { + item.infoList.forEach(citem => { + if (citem.id == id) { + citem.userAnswer = radioChecked + citem.isUserAnswer = this.isHaveAnswer(radioChecked) + } + }) + }) this.setData({ - questionDataList: questionList + questionDataList: questionList, + cardList: cardListUpdata }) if (this.data.answerType == 'mock') { this.setData({ @@ -271,16 +281,27 @@ onChangeInput(e) { const inputData = e.detail.value.detail.value const id = e.detail.value.currentTarget.dataset.id - const index = e.detail.value.currentTarget.dataset.index + const index = Number(e.detail.value.currentTarget.dataset.index) + console.log(index); const questionList = this.data.questionDataList questionList.forEach(item => { if (item.id == id) { - item.userAnswer[index] = inputData, - item.isUserAnswer = this.isHaveAnswer(item.userAnswer) + item.userAnswer[index] = inputData + return item.isUserAnswer = this.isHaveAnswer(inputData) } }) + const cardListUpdata = this.data.cardList + cardListUpdata.forEach(item => { + item.infoList.forEach(citem => { + if (citem.id == id) { + citem.userAnswer[index] = inputData + return citem.isUserAnswer = this.isHaveAnswer(inputData) + } + }) + }) this.setData({ - questionDataList: questionList + questionDataList: questionList, + cardList: cardListUpdata, }) if (this.data.answerType == 'mock') { this.setData({ @@ -563,19 +584,19 @@ errorList: JSON.parse(res[0].value) }) } catch (error) { - } }) }, // 鑾峰彇棰樺簱棰樼洰 - getQuestionList(oldData) { + async getQuestionList(oldData) { // 娓呯┖姝g‘棰樻暟璁板綍 this.setData({ cardList: [], correctNum: 0, }) let flag = 0 - this.data.idPathList.forEach((pathitem) => { + for (let index = 0; index < this.data.idPathList.length; index++) { + const pathitem = this.data.idPathList[index]; const pathList = this.data.cardList pathList.push({ path: pathitem.productLinkPath, @@ -608,7 +629,7 @@ size: 999 } } - app.MG.store.getProductDetail(query).then((res) => { + await app.MG.store.getProductDetail(query).then((res) => { this.setData({ total: res.datas.cmsDatas[0].datas.length }) @@ -738,13 +759,13 @@ }) this.setData({ questionDataList: questionList, - cardList: cardUpdatedList + cardList: cardUpdatedList, }) }) }) - }) + } this.setData({ - loading: false, + loading: false }) }, // 鎵规敼棰樼洰 锛堢粌涔狅紝鎴戠殑閿欓锛屾垜鐨勬敹钘�,锛岀粍鍗凤級 @@ -1368,6 +1389,140 @@ // 鑾峰彇缁勫嵎棰樼洰鍒楄〃 async getMockDataList(questionList, oldList) { const questionDataList = this.data.questionDataList + // for (let pathindex = 0; pathindex < questionList.length; pathindex++) { + // const pathitem = questionList[pathindex]; + // let itemIds = [] + // pathitem.infoList.forEach(item => { + // itemIds.push(item.id + '') + // }) + // let query = { + // path: '*', + // cmsPath: this.data.rootCmsItemId, + // cmsType: '*', + // productId: this.data.bookId, + // queryType: '*', + // itemIds, + // itemFields: { + // Embedded_QuestionBank_Stem: [], + // Embedded_QuestionBank_AnalysisCon: [], + // Embedded_QuestionBank_Answer: [], + // Embedded_QuestionBank_Option: [], + // Embedded_QuestionBank_QuestionType: [], + // Embedded_QuestionBank_StemStyle: [], + // Embedded_QuestionBank_OptionStyle: [], + // Embedded_QuestionBank_KnowledgePoint: [], + // Embedded_QuestionBank_Difficulty: [] + // } + // } + // await app.MG.store.getProductDetail(query).then((res) => { + // res.datas.cmsDatas[0].datas.forEach((item, index) => { + // // 寰幆questionList,缁欐瘡棰樿祴鍊煎垎鏁� + // let oldObj + // if (oldList) oldObj = oldList.find((oldItem) => oldItem.id == item.id) + // let questionObj = { + // // number: pathitem.infoList.find(infoItem => infoItem.itemId == item.id).number, + // id: item.id, + // score: pathitem.infoList.find(infoItem => infoItem.id == item.id).score, + // stem: + // item.Embedded_QuestionBank_QuestionType == 'completion' + // ? JSON.parse(item.Embedded_QuestionBank_Stem) + // .stemTxt.replaceAll('<vacancy>', ',input,') + // .split(',') + // : JSON.parse(item.Embedded_QuestionBank_Stem), // 棰樺共 + // answer: item.Embedded_QuestionBank_Answer, // 绛旀 + // option: item.Embedded_QuestionBank_Option + // ? JSON.parse(item.Embedded_QuestionBank_Option) + // : '', // 閫夋嫨棰橀�夐」 + // analysisCon: item.Embedded_QuestionBank_AnalysisCon, // 瑙f瀽 + // questionType: item.Embedded_QuestionBank_QuestionType, // 棰樺瀷 + // optionStyle: item.Embedded_QuestionBank_OptionStyle, // 閫夐」鏄剧ず绫诲瀷 + // stemStyle: item.Embedded_QuestionBank_StemStyle, // 棰樺共鏄剧ず绫诲瀷 + // difficulty: item.Embedded_QuestionBank_Difficulty + // ? 4 - item.Embedded_QuestionBank_Difficulty + // : 0, // 闅惧害绛夌骇 + // userAnswer: oldObj + // ? oldObj.answer + // : item.Embedded_QuestionBank_QuestionType == 'completion' || + // item.Embedded_QuestionBank_QuestionType == 'multipleChoice' + // ? [] + // : '', + // isUserAnswer: oldObj ? this.isHaveAnswer(oldObj.userAnswer) : false, + // isRight: oldObj ? oldObj.isRight : null, + // // isComplete: oldObj ? oldObj.isComplete : false, + // isComplete: this.data.mockData.state == '3' ? true : oldObj ? this.isHaveAnswer(oldObj.answer) : false, + // isCollect: this.data.collectList.indexOf(item.id) > -1 ? true : false, + // isUnfold: '' // 鎺у埗瑙f瀽鐨勬姌鍙犻潰鏉挎槸鍚﹀睍寮� + // } + // // 澶氶�夊拰濉┖绛旀鑲负鏁扮粍锛岃杞崲JSON鏍煎紡 + // if ( + // questionObj.questionType == 'completion' || + // questionObj.questionType == 'multipleChoice' + // ) { + // try { + // questionObj.answer = JSON.parse(questionObj.answer) + // } catch (error) { + // questionObj.answer = item.Embedded_QuestionBank_Answer + // } + // } + // // 濉┖棰樻敼閫� + // if (questionObj.questionType == 'completion') { + // let index = 0 + // for (let i = 0; i < questionObj.stem.length; i++) { + // const item = questionObj.stem[i] + // if (item == 'input') { + // questionObj.stem[i] = { + // num: index, + // data: 'input' + // } + // if (!oldObj) questionObj.userAnswer[index] = '' + // index++ + // } + // } + // } + // // 鑾峰彇鍥剧墖 + // if (questionObj.stemStyle == 'Image' || questionObj.stemStyle == 'TxtAndImage') { + // questionObj.stem.stemImage = getPublicImage(questionObj.stem.stemImage, 150) + // } + // if (questionObj.optionStyle == 'Image' || questionObj.optionStyle == 'TxtAndImage') { + // questionObj.option.forEach(optionItem => { + // if (optionItem.img) optionItem.img = getPublicImage(optionItem.img, 150) + // }) + // } + // if (oldObj && oldObj.isRight) { + // this.setData({ + // correctNum: this.data.correctNum + 1 + // }) + // } + // if (item.questionType != 'shortAnswer' && item.isComplete) { + // this.setData({ + // subjectiveTotal: this.data.subjectiveTotal + 1 + // }) + // } + // // if (oldObj && isHaveAnswer(oldObj.answer)) countDownRef.value.changeAlready() + // // cardList璧嬪�� + // let cardIndex = this.data.cardList.findIndex((item) => item.catalogName == pathitem.catalogName) + // debugger + // let infoIndex = this.data.cardList[cardIndex].infoList.findIndex(infoItem => infoItem.id == item.id) + + // this.setData({ + // [`cardList[${cardIndex}].infoList[${infoIndex}]`]: questionObj + // }) + // let questionList = [] + // const cardUpdatedList = this.data.cardList + // cardUpdatedList.forEach(aitem => { + // aitem.infoList.forEach((bitem, bindex) => { + // questionList.push(bitem) + // bitem.number = bindex + 1 + // }) + // }) + // this.setData({ + // questionDataList: questionList, + // cardList: cardUpdatedList + // }) + // console.log('缁勫嵎棰樼洰鍒楄〃', this.data.questionDataList); + // }) + // }) + // } questionList.forEach(async (pathitem, pathindex) => { let itemIds = [] pathitem.infoList.forEach(item => { @@ -1500,7 +1655,6 @@ }) }) this.setData({ - // questionDataList: questionDataList, loading: false }) }, diff --git a/packageBookService/pages/bookServices/examination/examination.wxml b/packageBookService/pages/bookServices/examination/examination.wxml index f6ed136..f1223d0 100644 --- a/packageBookService/pages/bookServices/examination/examination.wxml +++ b/packageBookService/pages/bookServices/examination/examination.wxml @@ -32,6 +32,8 @@ currentIndex="{{currentIndex}}" questionList="{{questionDataList}}" submitStatus="{{submitStatus}}" + subjectiveGrade="{{subjectiveGrade}}" + subjectiveNum="{{subjectiveNum}}" ></question-schedule> <question-list wx:if="{{!loading}}" diff --git a/packageBookService/pages/bookServices/examination/questionList/index.js b/packageBookService/pages/bookServices/examination/questionList/index.js index b489b78..7cd9c3e 100644 --- a/packageBookService/pages/bookServices/examination/questionList/index.js +++ b/packageBookService/pages/bookServices/examination/questionList/index.js @@ -16,13 +16,18 @@ type: Number, value: 1 }, - isNight:{ - type:Boolean, - value:false + isNight: { + type: Boolean, + value: false }, - answerType:{ - type:Boolean, - value:'' + answerType: { + type: String, + value: '' + } + }, + observers: { + 'questionList': function (newValue) { + console.log(newValue); } }, created() { @@ -33,6 +38,7 @@ */ data: { inputstyle: 'border: 2rpx solid rgba(220,220,220,1);border-radius: 12rpx;', + shortAnswer: 'font-size: 28rpx', placeholderstyle: "font-size:28rpx", current: 2, autoplay: true, diff --git a/packageBookService/pages/bookServices/examination/questionList/index.wxml b/packageBookService/pages/bookServices/examination/questionList/index.wxml index 66a3bbf..08c85f6 100644 --- a/packageBookService/pages/bookServices/examination/questionList/index.wxml +++ b/packageBookService/pages/bookServices/examination/questionList/index.wxml @@ -1,35 +1,75 @@ <!--pages/bookServices/examination/questionList/index.wxml--> -<view class="question-list" style="background-color:{{isNight ? '#000' : '#fff'}}"> +<view + class="question-list" + style="background-color:{{isNight ? '#000' : '#fff'}}" +> <!-- 棰樺瀷title --> - <view class="question-title" wx:if="{{questionList[showIndex].type}}" style="background-color:{{isNight ? '#000' : '#fff'}}"> - <text class="title-name">{{questionList[showIndex].type}}</text><text class="title-score" style="color: {{isNight ? '#fff' : '#000'}};">(姣忛{{questionList[showIndex].score}}鍒�)</text> + <view + class="question-title" + wx:if="{{questionList[showIndex].type}}" + style="background-color:{{isNight ? '#000' : '#fff'}}" + > + <text class="title-name">{{questionList[showIndex].type}}</text + ><text class="title-score" style="color: {{isNight ? '#fff' : '#000'}};" + >(姣忛{{questionList[showIndex].score}}鍒�)</text + > </view> <!-- 棰樼洰鍒楄〃 --> <swiper class="swiper" bind:change="changeSwiper" current="{{currentIndex}}"> <swiper-item wx:for="{{questionList}}" wx:key="{{id}}"> <!-- 棰樺共 --> - <view class="question-stem title-score" style="color: {{isNight ? '#fff' : '#000'}};"> + <view + class="question-stem title-score" + style="color: {{isNight ? '#fff' : '#000'}};" + > <!-- 棰樺彿 --> <text>{{item.number}}.</text> <!-- 浠呮枃瀛� --> - <view wx:if="{{item.stemStyle == 'Txt' && item.questionType != 'completion'}}">{{item.stem.stemTxt}}</view> + <view + wx:if="{{item.stemStyle == 'Txt' && item.questionType != 'completion'}}" + >{{item.stem.stemTxt}}</view + > <!-- 浠呭浘鐗� --> <view wx:elif="{{item.stemStyle == 'Image'}}"> <t-image src="{{item.stem.stemImage}}" /> </view> <!-- 鍥剧墖鍔犳枃瀛� --> - <view wx:elif="{{item.stemStyle == 'TxtAndImage'}}" class="title-TxtAndImage"> + <view + wx:elif="{{item.stemStyle == 'TxtAndImage'}}" + class="title-TxtAndImage" + > <text>{{item.stem.stemTxt}}</text> <t-image src="{{item.stem.stemImage}}"></t-image> </view> <!-- 瀵屾枃鏈� --> - <view wx:elif="{{item.stemStyle == 'RichText'}} " class="title-RichText"> + <view + wx:elif="{{item.stemStyle == 'RichText'}} " + class="title-RichText" + > <rich-text nodes="{{item.stem.stemTxt}}"></rich-text> </view> <!-- 濉┖棰� --> <view wx:if="{{item.questionType == 'completion'}}"> - <view class="completion-box" wx:for="{{item.stem}}" wx:for-item="inputItem" wx:for-index="inputIndex" wx:key="inputIndex"> - <t-input disabled="{{item.isComplete}}" bind:change="onChangeInput" data-value="{{item.option}}" data-id="{{item.id}}" data-index="{{inputItem.num}}" class="title-input" style="{{inputstyle}}" placeholder-style="{{placeholderstyle}}" wx:if="{{inputItem.data == 'input'}}" placeholder="璇疯緭鍏ユ枃瀛�" value="{{item.userAnswer[inputItem.num]}}"></t-input> + <view + class="completion-box" + wx:for="{{item.stem}}" + wx:for-item="inputItem" + wx:for-index="inputIndex" + wx:key="inputIndex" + > + <t-input + disabled="{{item.isComplete}}" + bind:change="onChangeInput" + data-value="{{item.option}}" + data-id="{{item.id}}" + data-index="{{inputItem.num}}" + class="title-input" + style="{{inputstyle}}" + placeholder-style="{{placeholderstyle}}" + wx:if="{{inputItem.data == 'input'}}" + placeholder="璇疯緭鍏ユ枃瀛�" + value="{{item.userAnswer[inputItem.num]}}" + ></t-input> <text wx:else>{{inputItem}}</text> </view> </view> @@ -37,19 +77,44 @@ <!-- 绛旈鍖哄煙 --> <view class="question-answer"> <!-- 鍗曢�夐 --> - <t-radio-group wx:if="{{item.questionType == 'singleChoice' || item.questionType == 'judge'}}" defaultValue="{{item.userAnswer}}" disabled="{{item.isComplete}}" bind:change="onChangeRadio" class="radio-group" data-value="{{item.option}}" data-id="{{item.id}}"> - <view wx:for="{{item.option}}" wx:for-item="contentItem" wx:for-index="contentIndex" wx:key="contentIndex"> - <t-radio value="{{contentItem.value}}" icon="none" placement="right" borderless> - <view class="radio-item {{item.userAnswer == contentItem.value ? 'radio-active' : ''}} {{(answerType == 'collectQuestion' || answerType == 'errorQuestion') && (item.answer == contentItem.value && item.answer == item.userAnswer ? 'radio-correct' : item.userAnswer == contentItem.value && item.userAnswer != item.answer ?'radio-error' :'')}}"> + <t-radio-group + wx:if="{{item.questionType == 'singleChoice' || item.questionType == 'judge'}}" + defaultValue="{{item.userAnswer}}" + disabled="{{item.isComplete}}" + bind:change="onChangeRadio" + class="radio-group" + data-value="{{item.option}}" + data-id="{{item.id}}" + > + <view + wx:for="{{item.option}}" + wx:for-item="contentItem" + wx:for-index="contentIndex" + wx:key="contentIndex" + > + <t-radio + value="{{contentItem.value}}" + icon="none" + placement="right" + borderless + > + <view + class="radio-item {{(answerType == 'option' || answerType == 'mock' ) && !submitStatus && item.userAnswer == contentItem.value ? 'radio-active' : ''}} {{ (item.answer == contentItem.value && item.answer == item.userAnswer && submitStatus) ? 'radio-correct' : (item.userAnswer == contentItem.value && item.userAnswer != item.answer && submitStatus) ?'radio-error' :'' }}" + > <!-- 浠呮枃瀛� --> - <text wx:if="{{item.optionStyle == 'Txt'}}">{{contentItem.value}}銆亄{contentItem.txt}}</text> + <text wx:if="{{item.optionStyle == 'Txt'}}" + >{{contentItem.value}}銆亄{contentItem.txt}}</text + > <!-- 浠呭浘鐗� --> <view wx:if="{{item.optionStyle == 'Image'}}" class="fl-center"> <text>{{contentItem.value}}銆�</text> <t-image src="{{contentItem.img}}"></t-image> </view> <!-- 鏂囧瓧鍔犲浘鐗� --> - <view wx:if="{{item.optionStyle == 'TxtAndImage'}}" class="fl-center"> + <view + wx:if="{{item.optionStyle == 'TxtAndImage'}}" + class="fl-center" + > <text>{{contentItem.value}}銆�</text> <text>{{contentItem.txt}}</text> <t-image src="{{contentItem.img}}"></t-image> @@ -59,25 +124,51 @@ <text>{{contentItem.value}}銆�</text> <rich-text nodes="{{contentItem.txt}}"></rich-text> </view> - <text wx:if="{{(answerType == 'collectQuestion' || answerType == 'errorQuestion') && (item.answer == contentItem.value && item.answer == item.userAnswer)}}">瀵�</text> - <text wx:if="{{(answerType == 'collectQuestion' || answerType == 'errorQuestion') && (item.userAnswer == contentItem.value && item.userAnswer != item.answer)}}">閿�</text> + <text + wx:if="{{submitStatus && (item.answer == contentItem.value && item.answer == item.userAnswer)}}" + >瀵�</text + > + <text + wx:if="{{ submitStatus && (item.userAnswer == contentItem.value && item.userAnswer != item.answer)}}" + >閿�</text + > </view> </t-radio> </view> </t-radio-group> <!-- 澶氶�夐 --> - <t-checkbox-group disabled="{{item.isComplete}}" class="checkbox-group" wx:elif="{{item.questionType == 'multipleChoice'}}" t-class="box" borderless bind:change="onChangeRadio" data-value="{{item.option}}" data-id="{{item.id}}" defaultValue="{{item.userAnswer}}"> - <view wx:for="{{item.option}}" wx:for-item="contentItem" wx:for-index="contentIndex" wx:key="contentIndex"> + <t-checkbox-group + disabled="{{item.isComplete}}" + class="checkbox-group" + wx:elif="{{item.questionType == 'multipleChoice'}}" + t-class="box" + borderless + bind:change="onChangeRadio" + data-value="{{item.option}}" + data-id="{{item.id}}" + defaultValue="{{item.userAnswer}}" + > + <view + wx:for="{{item.option}}" + wx:for-item="contentItem" + wx:for-index="contentIndex" + wx:key="contentIndex" + > <t-checkbox block="{{false}}" value="{{contentItem.value}}"> <!-- 浠呮枃瀛� --> - <text wx:if="{{item.optionStyle == 'Txt'}}">{{contentItem.value}}銆亄{contentItem.txt}}</text> + <text wx:if="{{item.optionStyle == 'Txt'}}" + >{{contentItem.value}}銆亄{contentItem.txt}}</text + > <!-- 浠呭浘鐗� --> <view wx:if="{{item.optionStyle == 'Image'}}" class="fl-center"> <text>{{contentItem.value}}銆�</text> <t-image src="{{contentItem.img}}"></t-image> </view> <!-- 鏂囧瓧鍔犲浘鐗� --> - <view wx:if="{{item.optionStyle == 'TxtAndImage'}}" class="fl-center"> + <view + wx:if="{{item.optionStyle == 'TxtAndImage'}}" + class="fl-center" + > <text>{{contentItem.value}}銆�</text> <text>{{contentItem.txt}}</text> <t-image src="{{contentItem.img}}"></t-image> @@ -91,26 +182,110 @@ </view> </t-checkbox-group> <!-- 绠�绛� 缈昏瘧 --> - <t-textarea disabled="{{item.isComplete}}" value="{{item.userAnswer}}" bind:change="onChangeRadio" data-value="{{item.option}}" data-id="{{item.id}}" class="option-textarea" wx:elif="{{item.questionType == 'shortAnswer'}}" t-class="external-class" placeholder="璇疯緭鍏ユ枃瀛�" bordered maxlength="500" disableDefaultPadding="{{true}}" indicator style="{{style}}" /> + <t-textarea + disabled="{{item.isComplete}}" + value="{{item.userAnswer}}" + bind:change="onChangeRadio" + data-value="{{item.option}}" + data-id="{{item.id}}" + class="option-textarea" + wx:elif="{{item.questionType == 'shortAnswer'}}" + t-class="external-class" + placeholder="璇疯緭鍏ユ枃瀛�" + bordered + maxlength="500" + disableDefaultPadding="{{true}}" + indicator + style="{{style}}" + /> </view> - <!-- 瑙f瀽 --> - <view class="analysis" wx:if="{{item.isComplete}}"> + <!-- 鍗曢�夈�佸閫夎В鏋� --> + <view + class="analysis" + wx:if="{{item.isComplete && (item.questionType == 'singleChoice' || item.questionType == 'judge' || item.questionType == 'multipleChoice')}}" + > <view class="analysis-answer"> <view class="answer-correct answer-center"> <text class="analysis-title-box">姝g‘绛旀锛�</text> - <rich-text nodes="{{item.answer}}" style="font-size: 40rpx"></rich-text> + <rich-text + nodes="{{item.answer}}" + style="font-size: 40rpx" + ></rich-text> </view> - <view class="answer-center marginL {{item.isRight ? 'answer-correct' : 'answer-error'}}" wx:if="{{item.questionType !== 'shortAnswer'}}"> - <text class="analysis-title-box">鎮ㄧ殑绛旀锛�</text><text class="answer-text">{{item.userAnswer}}</text> + <view + class="answer-center marginL {{item.isRight ? 'answer-correct' : 'answer-error'}}" + wx:if="{{item.questionType !== 'shortAnswer'}}" + > + <text class="analysis-title-box">鎮ㄧ殑绛旀锛�</text + ><text class="answer-text">{{item.userAnswer}}</text> </view> </view> - <view class="analysis-text" wx:if="{{item.analysisCon}}" style="color: {{isNight ? '#fff' : '#000'}};"> - 绛旀瑙f瀽锛�<rich-text nodes="{{item.analysisCon}}" class="analysis-content"></rich-text> + <view + class="analysis-text" + wx:if="{{item.analysisCon}}" + style="color: {{isNight ? '#fff' : '#000'}};" + > + 绛旀瑙f瀽锛�<rich-text + nodes="{{item.analysisCon}}" + class="analysis-content" + ></rich-text> + </view> + </view> + <!-- 濉┖銆佺畝绛旇В鏋� --> + <view + class="analysis" + wx:if="{{(item.questionType == 'shortAnswer' || item.questionType == 'completion') && item.isComplete}}" + > + <view + style="display: {{item.questionType == 'completion' ? 'flex' : 'block'}}" + > + <text + wx:if="{{item.questionType == 'completion'}}" + class="short-answer-fz answer-correct" + >姝g‘绛旀:</text + > + <text + wx:if="{{item.questionType == 'shortAnswer'}}" + class="short-answer-fz" + > + 鍙傝�冪瓟妗堬細 + </text> + <rich-text + wx:if="{{item.questionType == 'shortAnswer'}}" + nodes="{{item.answer}}" + style="font-size: 28rpx; color:{{item.questionType == 'completion' ? '#1FBC1F' : '#000'}}" + ></rich-text> + <view + wx:if="{{item.questionType == 'completion'}}" + class="short-answer-fz answer-correct" + >{{item.answer}}</view + > + </view> + <view + wx:if="{{item.questionType == 'completion'}}" + class="short-answer-mr" + style="display: {{item.questionType == 'completion' ? 'flex' : 'block'}}" + > + <text + class="short-answer-fz {{item.isRight ? 'answer-correct' : 'answer-error'}}" + >鎮ㄧ殑绛旀锛�</text + > + <view + class="short-answer-fz {{item.isRight ? 'answer-correct' : 'answer-error'}}" + >{{item.userAnswer}}</view + > + </view> + <view class="short-answer-mr"> + <text class="short-answer-fz">绛旀瑙f瀽锛�</text> + <rich-text + nodes="{{item.analysisCon}}" + style="font-size: 28rpx" + ></rich-text> </view> </view> </swiper-item> - <swiper-item> + <swiper-item wx:if="{{answerType !== 'collectQuestion'}}"> <text>娌℃湁鏇村浜嗐�傘�傘��</text> </swiper-item> </swiper> -</view> \ No newline at end of file +</view> diff --git a/packageBookService/pages/bookServices/examination/questionList/index.wxss b/packageBookService/pages/bookServices/examination/questionList/index.wxss index 8cb16ff..34fbd19 100644 --- a/packageBookService/pages/bookServices/examination/questionList/index.wxss +++ b/packageBookService/pages/bookServices/examination/questionList/index.wxss @@ -32,8 +32,8 @@ } .swiper { - min-height: 900rpx; - + /* min-height: 900rpx; */ + height: 100%; } /* 鍗曢�夐 */ @@ -52,7 +52,7 @@ } .radio-active { - background-color: #ff6c00; + background-color: #fff0e6; } .radio-correct { @@ -110,7 +110,7 @@ width: 97%; } -/* 瑙f瀽 */ +/* 鍗曢�� 銆佸閫� 瑙f瀽 */ .analysis { margin-top: 40rpx; } @@ -122,6 +122,7 @@ .answer-correct { color: #1FBC1F; + } .answer-error { @@ -160,4 +161,15 @@ color: #333333; font-size: 28rpx; margin-top: 20rpx; +} + +/* 绠�鍗曘�佺炕璇戣В鏋� */ + +.short-answer-fz { + font-size: 28rpx; +} + +.short-answer-mr { + margin-top: + 40rpx; } \ No newline at end of file diff --git a/packageBookService/pages/bookServices/examination/questionOptions/index.js b/packageBookService/pages/bookServices/examination/questionOptions/index.js index 88d1ec6..66344a8 100644 --- a/packageBookService/pages/bookServices/examination/questionOptions/index.js +++ b/packageBookService/pages/bookServices/examination/questionOptions/index.js @@ -224,6 +224,9 @@ }, // 搴曢儴鎻愪氦鎸夐挳 submitBtn() { + this.setData({ + noReady: 0 + }) // 鎴戠殑閿欓鍜屾敹钘� 鐩存帴璧版彁浜ら�昏緫 if (this.properties.answerType == 'collectQuestion' || this.properties.answerType == 'errorQuestion') { this.submitPaper() diff --git a/packageBookService/pages/bookServices/examination/questionOptions/index.wxml b/packageBookService/pages/bookServices/examination/questionOptions/index.wxml index 7057d37..69c72da 100644 --- a/packageBookService/pages/bookServices/examination/questionOptions/index.wxml +++ b/packageBookService/pages/bookServices/examination/questionOptions/index.wxml @@ -1,30 +1,64 @@ <!--pages/bookServices/examination/questionOptions/index.wxml--> -<view class="page-bottom" style="color: {{isNight ? '#fff' : '#000'}}; background-color:{{isNight ? '#000' : '#fff'}}"> - <view class="li-option" bind:tap="setCollect" style="color: {{isNight ? '#fff' : '#000'}};"> - <t-image src="{{ questionDataList[currentIndex].isCollect ? '/static/images/bookService/detail/collecting.png' : '/static/images/bookService/examination/collect.png'}}"> +<view + class="page-bottom" + style="color: {{isNight ? '#fff' : '#000'}}; background-color:{{isNight ? '#000' : '#fff'}}" +> + <view + class="li-option" + bind:tap="setCollect" + style="color: {{isNight ? '#fff' : '#000'}};" + > + <t-image + src="{{ questionDataList[currentIndex].isCollect ? '/static/images/bookService/detail/collecting.png' : '/static/images/bookService/examination/collect.png'}}" + > </t-image> 鏀惰棌 </view> - <view class="li-option" bind:tap="handlePopup" style="color: {{isNight ? '#fff' : '#000'}};"> - <t-image src="/static/images/bookService/examination/questionCard.png"></t-image> + <view + class="li-option" + bind:tap="handlePopup" + style="color: {{isNight ? '#fff' : '#000'}};" + > + <t-image + src="/static/images/bookService/examination/questionCard.png" + ></t-image> 绛旈鍗� </view> - <view class="li-option" bind:tap="setUpBtn" style="color: {{isNight ? '#fff' : '#000'}};"> + <view + class="li-option" + bind:tap="setUpBtn" + style="color: {{isNight ? '#fff' : '#000'}};" + > <t-image src="/static/images/bookService/examination/setting.png"></t-image> 璁剧疆 </view> - <view class="li-option" bind:tap="resterBtn" wx:if="{{answerType == 'option' || (answerType == 'mock' && !submitStatus)}}" style="color: {{isNight ? '#fff' : '#000'}};"> + <view + class="li-option" + bind:tap="resterBtn" + wx:if="{{answerType == 'option' || (answerType == 'mock' && !submitStatus)}}" + style="color: {{isNight ? '#fff' : '#000'}};" + > <t-image src="/static/images/bookService/examination/reset.png"></t-image> 閲嶅仛 </view> <view class="bottom-submit"> - <t-button theme="primary" size="large" style="{{btnStyle}}" bind:tap="submitBtn">{{(answerType == 'option' || answerType == 'mock') && !submitStatus ? '鎻愪氦' : - '閫�鍑�'}}</t-button> + <t-button + theme="primary" + size="large" + style="{{btnStyle}}" + bind:tap="submitBtn" + >{{(answerType == 'option' || answerType == 'mock') && !submitStatus ? + '鎻愪氦' : '閫�鍑�'}}</t-button + > </view> </view> <!-- 绛旈鍗� --> -<t-popup visible="{{questionCardState}}" bind:visible-change="onVisibleChange" placement="bottom"> +<t-popup + visible="{{questionCardState}}" + bind:visible-change="onVisibleChange" + placement="bottom" +> <view class="popup-block"> <view class="popup-header"> <view class="popup-title">绛旈鍗�</view> @@ -47,7 +81,15 @@ <text class="title-text">{{item.catalogName}}</text> </view> <view class="question-list"> - <view bind:tap="goQuestion" data-id="{{citem.id}}" wx:for="{{item.infoList}}" wx:for-item="citem" wx:for-index="cindex" class="question-box {{citem.isUserAnswer ? 'answered' : 'un-answered'}}"> + <view + bind:tap="goQuestion" + data-id="{{citem.id}}" + wx:for="{{item.infoList}}" + wx:for-item="citem" + wx:for-index="cindex" + wx:key="cindex" + class="question-box {{citem.isUserAnswer ? 'answered' : 'un-answered'}}" + > {{citem.number}} </view> </view> @@ -57,7 +99,11 @@ </t-popup> <!-- 璁剧疆 --> -<t-popup visible="{{setUpPopup}}" bind:visible-change="onSetUpChange" placement="bottom"> +<t-popup + visible="{{setUpPopup}}" + bind:visible-change="onSetUpChange" + placement="bottom" +> <view class="popup-block set-up-popup"> <view class="popup-header"> <view class="popup-title">璁剧疆</view> @@ -66,27 +112,46 @@ <view class="brightness"> <text>A-</text> <view class="brightness-slider"> - <t-slider value="{{sliderValue}}" theme="capsule" step="{{10}}" bind:change="onChangeSlider" /> + <t-slider + value="{{sliderValue}}" + theme="capsule" + step="{{10}}" + bind:change="onChangeSlider" + /> </view> <text>A+</text> </view> <!-- 妯″紡 --> <view> - <t-radio-group class="test-radio" t-class="horizontal-box" value="{{radioItem}}" bind:change="onRadioChange" style="margin: 0px"> + <t-radio-group + class="test-radio" + t-class="horizontal-box" + value="{{radioItem}}" + bind:change="onRadioChange" + style="margin: 0px" + > <view class="card {{radioItem == 'daytime' ? 'card--active' : ''}}"> <t-radio value="daytime" icon="none" borderless> <view class="radio-content" slot="content"> - <t-image src="{{ radioItem == 'daytime' ? '/static/images/bookService/examination/rijian.png' : '/static/images/bookService/detail/notest.png'}}"></t-image> - <text style="color: {{radioItem == 'daytime' ? '#fff':''}};">鏃ラ棿妯″紡</text> + <t-image + src="{{ radioItem == 'daytime' ? '/static/images/bookService/examination/rijian.png' : '/static/images/bookService/detail/notest.png'}}" + ></t-image> + <text style="color: {{radioItem == 'daytime' ? '#fff':''}};" + >鏃ラ棿妯″紡</text + > </view> </t-radio> </view> <view class="card {{radioItem == 'night' ? 'card--active' : ''}}"> <t-radio value="night" icon="none" borderless> <view class="radio-content" slot="content"> - <t-image src="{{ radioItem == 'night' ? '/static/images/bookService/detail/practice-icon.png' : '/static/images/bookService/examination/yejian.png'}}"></t-image> - <text style="color: {{radioItem == 'night' ? '#fff':''}};">澶滈棿妯″紡</text> + <t-image + src="{{ radioItem == 'night' ? '/static/images/bookService/detail/practice-icon.png' : '/static/images/bookService/examination/yejian.png'}}" + ></t-image> + <text style="color: {{radioItem == 'night' ? '#fff':''}};" + >澶滈棿妯″紡</text + > </view> </t-radio> </view> @@ -97,7 +162,15 @@ <!-- 娴嬭瘯鎶ュ憡 --> -<t-dialog class="test-report" visible="{{testReportState}}" cancel-btn="{{null}}" confirm-btn="{{null}}" close-btn="{{true}}" title="娴嬭瘯鎶ュ憡" bind:close="closeTestReportDialog"> +<t-dialog + class="test-report" + visible="{{testReportState}}" + cancel-btn="{{null}}" + confirm-btn="{{null}}" + close-btn="{{true}}" + title="娴嬭瘯鎶ュ憡" + bind:close="closeTestReportDialog" +> <view slot="content" class="test-report"> <view class="report-content-top"> <view class="report-li"> @@ -110,24 +183,34 @@ </view> <view class="report-li"> <view class="report-li-left">鍏朵腑瀹㈣棰橈細</view> - <view class="report-li-right">{{subjectiveTotal}}閬擄紝鍒嗗�納{subjectiveGrade}}鍒�</view> + <view class="report-li-right" + >{{subjectiveTotal}}閬擄紝鍒嗗�納{subjectiveGrade}}鍒�</view + > </view> <view class="report-li"> <view class="report-li-left">绛斿锛�</view> - <view class="report-li-right"><text class="correct-color">{{correctNum}}</text> 閬�</view> + <view class="report-li-right" + ><text class="correct-color">{{correctNum}}</text> 閬�</view + > </view> <view class="report-li"> <view class="report-li-left">绛旈敊锛�</view> - <view class="report-li-right"><text class="error-color">{{subjectiveTotal - correctNum}}</text> - 閬�</view> + <view class="report-li-right" + ><text class="error-color">{{subjectiveTotal - correctNum}}</text> + 閬�</view + > </view> <view class="report-li"> <view class="report-li-left">瀹㈣棰樺緱鍒嗭細</view> - <view class="report-li-right"><text class="score-color">{{subjectiveNum}}</text> 鍒�</view> + <view class="report-li-right" + ><text class="score-color">{{subjectiveNum}}</text> 鍒�</view + > </view> </view> <view class="report-content-bottom"> - <t-button theme="primary" bind:tap="viewAnswer" style="width: 560rpx">鏌ョ湅绛旀涓庤В鏋�</t-button> + <t-button theme="primary" bind:tap="viewAnswer" style="width: 560rpx" + >鏌ョ湅绛旀涓庤В鏋�</t-button + > </view> </view> -</t-dialog> \ No newline at end of file +</t-dialog> diff --git a/packageBookService/pages/bookServices/examination/questionSchedule/index.js b/packageBookService/pages/bookServices/examination/questionSchedule/index.js index 531b569..0039701 100644 --- a/packageBookService/pages/bookServices/examination/questionSchedule/index.js +++ b/packageBookService/pages/bookServices/examination/questionSchedule/index.js @@ -28,7 +28,16 @@ isNight: { type: Boolean, value: false + }, + subjectiveGrade: { + type: Number, + value: 0 + }, + subjectiveNum: { + type: Number, + value: 0 } + }, created( diff --git a/packageBookService/pages/bookServices/examination/questionSchedule/index.wxml b/packageBookService/pages/bookServices/examination/questionSchedule/index.wxml index ac5ebbf..b95c893 100644 --- a/packageBookService/pages/bookServices/examination/questionSchedule/index.wxml +++ b/packageBookService/pages/bookServices/examination/questionSchedule/index.wxml @@ -1,12 +1,40 @@ <!--pages/bookServices/examination/questionSchedule/questionSchedule.wxml--> -<view class="schedule" id="schedule" style="background-color:{{isNight ? '#000' : '#fff'}}"> +<view + wx:if="{{((answerType == 'option' || answerType == 'mock') && !submitStatus) || answerType == 'collectQuestion' || answerType =='errorQuestion'}}" + class="schedule" + id="schedule" + style="background-color:{{isNight ? '#000' : '#fff'}}" +> <view class="schedule-top"> - <view class="question-schedule" style="color: {{isNight ? '#fff' : '#000'}};">绛旈杩涘害<text class="parimary-color question-num">{{ready}}</text> + <!-- 绛旈杩涘害 --> + <view + class="question-schedule" + style="color: {{isNight ? '#fff' : '#000'}};" + >{{(answerType == 'option' || answerType == 'mock') ? '绛旈杩涘害' : + answerType == 'collectQuestion' ? '鏀惰棌鏁伴噺' : '閿欓鏁伴噺' }}<text + class="parimary-color question-num" + >{{ready}}</text + > <text>/{{questionList.length}}</text> </view> - <view class="remainder" wx:if="{{!submitStatus && (answerType == 'option' || answerType == 'mock')}}" style="color: {{isNight ? '#fff' : '#000'}};">鍓╀綑鏃堕棿 <text class="parimary-color">{{showTime}}</text></view> + <view + class="remainder" + wx:if="{{!submitStatus && (answerType == 'option' || answerType == 'mock')}}" + style="color: {{isNight ? '#fff' : '#000'}};" + >鍓╀綑鏃堕棿 <text class="parimary-color">{{showTime}}</text></view + > </view> + <!-- 杩涘害鏉� --> <view class="schedule-progress"> <t-progress percentage="{{percentage}}" color="#ff6c00" label="" /> </view> -</view> \ No newline at end of file +</view> + +<!-- 缁冧範銆佺粍鍗� 鎻愪氦鍚� --> +<view wx:else class="schedule submit-message"> + <view> + 瀹㈣棰樺緱鍒嗭細<text class="parimary-color">{{subjectiveNum}}鍒�</text> / + {{subjectiveGrade}}鍒� + </view> + <view> {{ready}} /{{questionList.length}} </view> +</view> diff --git a/packageBookService/pages/bookServices/examination/questionSchedule/index.wxss b/packageBookService/pages/bookServices/examination/questionSchedule/index.wxss index c806b93..b18978b 100644 --- a/packageBookService/pages/bookServices/examination/questionSchedule/index.wxss +++ b/packageBookService/pages/bookServices/examination/questionSchedule/index.wxss @@ -29,4 +29,13 @@ .question-num { margin-left: 10rpx; +} + +.submit-message { + display: flex; + justify-content: space-between; + align-items: center; + padding: 40rpx 20rpx; + color: #000; + font-size: 28rpx; } \ No newline at end of file diff --git a/packageBookService/pages/bookServices/list/index.wxml b/packageBookService/pages/bookServices/list/index.wxml index fc24cad..2994416 100644 --- a/packageBookService/pages/bookServices/list/index.wxml +++ b/packageBookService/pages/bookServices/list/index.wxml @@ -19,10 +19,10 @@ </scroll-view> <view class="header-sort" bind:tap="sortClick"> <view class="sort-name">鎺掑簭</view> - <view class="sort-icon"> - <t-icon name="swap-left" size="24rpx" class="icon-right" color="{{sort == 'Asc' ? '#ff6c00' : ''}}" /> - <t-icon name="swap-left" size="24rpx" class="icon-left" color="{{sort == 'Desc' ? '#ff6c00' : ''}}" /> - </view> + <!-- <view class="sort-icon"> --> + <t-icon name="swap-left" size="28rpx" class="icon-right" color="{{sort == 'Asc' ? '#ff6c00' : ''}}" /> + <t-icon name="swap-left" size="28rpx" class="icon-left" color="{{sort == 'Desc' ? '#ff6c00' : ''}}" /> + <!-- </view> --> </view> </view> <t-pull-down-refresh value="{{enable}}" loadingProps="{{loadingProps}}" loadingTexts="{{['涓嬫媺鍒锋柊', '鏉炬墜鍒锋柊', '姝e湪鍒锋柊', '鍒锋柊瀹屾垚']}}" bind:refresh="onRefresh" class="down-refresh"> diff --git a/packageBookService/pages/bookServices/list/index.wxss b/packageBookService/pages/bookServices/list/index.wxss index 862b086..2bc3abc 100644 --- a/packageBookService/pages/bookServices/list/index.wxss +++ b/packageBookService/pages/bookServices/list/index.wxss @@ -15,31 +15,51 @@ } .header-sort { + position: relative; background-color: #fff; - line-height: 96rpx; - width: 150rpx; + line-height: 90rpx; + height: 94rpx; + width: 15vw; font-size: 28rpx; color: #999; display: flex; + border-bottom: 1px solid #ededed; +} + +.sort-name { + padding: 4rpx 0 0 10rpx; } .header-scroll { - width: 80vw; + height: 96rpx; + width: 85vw; } -.sort-icon { +.icon-left { + position: absolute; + top: 38rpx; + right: 26rpx; + transform: rotate(270deg); +} + +.icon-right { + position: absolute; + top: 38rpx; + right: 10rpx; + transform: rotate(90deg); +} + +/* .sort-icon { transform: rotate(90deg); position: relative; } .sort-icon .icon-left { transform: rotate(180deg); -} +} */ .list-container { height: 80vh; - margin-top: 20rpx; - /* background-color: #fff; */ } .assort-title { -- Gitblit v1.9.1