12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539 |
- <template>
- <view class="questionBank">
- <uni-nav-bar
- class="navbar"
- @clickLeft="clickLeft"
- left-icon="back"
- :statusBar="true"
- :title="examData.examName"
- ></uni-nav-bar>
- <swiper
- class="swiper"
- :current="current"
- @change="swiperChange"
- :interval="interval"
- >
- <swiper-item v-for="(bank, bankIndex) in questionList" :key="bankIndex">
- <view class="pageContent">
- <view class="pad_8 titBox">
- <view class="firstLetter">
- <view class="leftLetters">
- <view class="btnType">
- <text v-if="bank.type == 1">单选</text>
- <text v-if="bank.type == 2">多选</text>
- <text v-if="bank.type == 3">判断</text>
- <text v-if="bank.type == 4">案例</text>
- <text v-if="bank.type == 5">简答</text>
- </view>
- <text>{{ bankIndex + 1 }}/{{ questionList.length }}</text>
- </view>
- <view style="color: #666; font-size: 28rpx">{{
- countdown(lastTime)
- }}</view>
- <view class="leftLetters"></view>
- </view>
- <view class="titles"
- ><rich-text :nodes="bank.content"></rich-text
- ></view>
- </view>
- <template v-if="bank.type == 1">
- <view class="pad_8 titBox no-margin">
- <view v-if="!bank.ques">
- <view
- v-for="(item, index) in bank.jsonStr"
- :key="index"
- class="lisSty"
- @click="radioSelect(item.optionsId, bankIndex)"
- >
- <view class="activeTI">{{ ast[index] }}</view>
- <view class="flex_auto">{{ item.content }}</view>
- </view>
- </view>
- <view v-if="bank.ques">
- <view
- v-for="(item, index) in bank.jsonStr"
- :key="index"
- class="lisSty"
- @click="radioSelect(item.optionsId, bankIndex)"
- >
- <text
- :class="{
- right:
- bankType == 1 && (item.optionsId == bank.ques ||
- item.optionsId == bank.ans),
- wrong:
- bankType == 1 && (item.optionsId == bank.ques && bank.ques != bank.ans),
- user_choose: bankType == 2 && (item.optionsId == bank.ques),
- }"
- class="activeTI"
- >
- {{ ast[index] }}
- </text>
- <view class="flex_auto">{{ item.content }}</view>
- </view>
- </view>
- </view>
- <view v-if="bankType == 1 && bank.ques">
- <view class="pad_8 answer">
- <view>正确答案:{{ ast[bank.ans - 1] }}</view>
- <view>我的答案:{{ ast[bank.ques - 1] }}</view>
- </view>
- <view class="pad_8 answerInfos">
- <view class="answerTitle">答案解析</view>
- <view class="answerContent"
- ><rich-text :nodes="bank.analysisContent"></rich-text
- ></view>
- </view>
- </view>
- </template>
- <template v-if="bank.type == 2">
- <view class="pad_8 titBox no-margin">
- <view v-if="!bank.ques">
- <view
- v-for="(item, index) in bank.jsonStr"
- :key="index"
- class="lisSty"
- @click="checkboxSelect(item.optionsId, bankIndex, index)"
- >
- <view :class="{ checked: item.checked }" class="activeTI">{{
- ast[index]
- }}</view>
- <view class="flex_auto">{{ item.content }}</view>
- </view>
- </view>
- <view
- v-if="bankType == 2 || (bankType == 1 && !bank.ques)"
- class="submit_checkbox"
- :class="{ disabled: !isCheckboxChecked(bank.jsonStr) }"
- @click="checkboxSubmit(bankIndex)"
- >确认答案</view
- >
- <view v-if="bank.ques">
- <view
- v-for="(item, index) in bank.jsonStr"
- :key="index"
- class="lisSty"
- @click="checkboxSelect(item.optionsId, bankIndex, index)"
- >
- <text
- :class="{
- right:
- bankType == 1 && (bank.ques.indexOf(item.optionsId) != -1 ||
- bank.ans.indexOf(item.optionsId) != -1),
- wrong:
- bankType == 1 && (bank.ques.indexOf(item.optionsId) != -1 &&
- bank.ans.indexOf(item.optionsId) == -1),
- user_choose: bankType == 2 && item.checked,
- }"
- class="activeTI"
- >
- {{ ast[index] }}
- </text>
- <view class="flex_auto">{{ item.content }}</view>
- </view>
- </view>
- </view>
- <view v-if="bankType == 1 && bank.ques">
- <view class="pad_8 answer">
- <view>
- 正确答案:
- <text
- v-for="(ansItem, ansItemIndex) in bank.ans"
- :key="ansItemIndex"
- >{{ ast[ansItem - 1] }}</text
- >
- </view>
- <view>
- 我的答案:
- <text
- v-for="(quesItem, quesItemIndex) in bank.ques"
- :key="quesItemIndex"
- >{{ ast[quesItem - 1] }}</text
- >
- </view>
- </view>
- <view class="pad_8 answerInfos">
- <view class="answerTitle">答案解析</view>
- <view class="answerContent"
- ><rich-text :nodes="bank.analysisContent"></rich-text
- ></view>
- </view>
- </view>
- </template>
- <template v-if="bank.type == 3">
- <view class="pad_8 titBox no-margin">
- <view v-if="!bank.ques">
- <view
- v-for="(item, index) in judge"
- :key="index"
- class="lisSty"
- @click="judgeSelect(index, bankIndex)"
- >
- <view class="activeTI">{{ ast[index] }}</view>
- <view class="flex_auto">
- {{ item }}
- </view>
- </view>
- </view>
- <view v-if="bank.ques">
- <view
- v-for="(item, index) in judge"
- :key="index"
- class="lisSty"
- @click="judgeSelect(index, bankIndex)"
- >
- <text
- :class="{
- right: bankType == 1 && (index == (bank.ques == 1 ? 0 : 1) || index != bank.ans),
- wrong: bankType == 1 && (index == (bank.ques == 1 ? 0 : 1) && bank.ques != bank.ans),
- user_choose: bankType == 2 && (index == (bank.ques == 1 ? 0 : 1)),
- }"
- class="activeTI"
- >
- {{ ast[index] }}
- </text>
- <view class="flex_auto">
- {{ item }}
- </view>
- </view>
- </view>
- </view>
- <view v-if="bankType == 1 && bank.ques">
- <view class="pad_8 answer">
- <view>正确答案:{{ ast[bank.ans == 1 ? 0 : 1] }}</view>
- <view>我的答案:{{ ast[bank.ques == 1 ? 0 : 1] }}</view>
- </view>
- <view class="pad_8 answerInfos">
- <view class="answerTitle">答案解析</view>
- <view class="answerContent"
- ><rich-text :nodes="bank.analysisContent"></rich-text
- ></view>
- </view>
- </view>
- </template>
- <!-- 简答题 -->
- <template v-if="bank.type == 5">
- <view class="pad_8 titBox">
- <view class="ans">
- <view
- class="ans_input"
- v-if="
- bankType == 2 || (bankType == 1 && (!bank.ques ||
- (!bank.ques.imageList.length && !bank.ques.text)))
- "
- >
- <view class="top flex">
- <image
- :data-index="bankIndex"
- class="icon"
- @click="chooseImg(bankIndex)"
- src="/static/camera.png"
- mode=""
- ></image>
- <view class="progress"
- >{{ bank.ansText.imageList.length || "0" }}/4</view
- >
- <view
- class="submit"
- :class="{ disabled: !bank.ansText.text && hasImgs(bank) }"
- @click="submitAns(bankIndex)"
- >确认答案</view
- >
- </view>
- <view class="textarea">
- <textarea
- v-model="bank.ansText.text"
- placeholder="在此输入答案"
- ></textarea>
- </view>
- <view class="imgs">
- <view
- class="img"
- v-for="(img, imgIndex) in bank.ansText.imageList"
- :key="imgIndex"
- >
- <text @click="deleteImg(imgIndex, bankIndex)">x</text>
- <image :src="$method.splitImgHost(img, true)"></image>
- </view>
- </view>
- </view>
- <view
- class="ans_submit answerInfos"
- v-if="bankType == 1 && (bank.ques.text || bank.ques.imageList.length)"
- >
- <view class="answerTitle">我的答案:</view>
- {{ bank.ques.text }}
- <view class="imgs"
- ><image
- class="img"
- v-for="(ques, quesIndex) in bank.ques.imageList"
- :key="quesIndex"
- :src="$method.splitImgHost(ques, true)"
- ></image
- ></view>
- </view>
- </view>
- </view>
- <view
- v-if="bankType == 1 && bank.ques && (bank.ques.text || bank.ques.imageList.length)"
- >
- <view class="pad_8 answerInfos">
- <view class="answerTitle">答案解析:</view>
- <view class="answerContent"
- ><rich-text :nodes="bank.analysisContent"></rich-text
- ></view>
- </view>
- </view>
- </template>
- <!-- 案例题 -->
- <template v-if="bank.type == 4">
- <view class="tabs">
- <view
- class="tab"
- :class="{ current: tabIndex == bank.current }"
- :key="tabIndex"
- v-for="(tab, tabIndex) in bank.jsonStr"
- @click="tabSelect(tabIndex, bankIndex)"
- >
- 问题{{ tabIndex + 1 }}
- </view>
- </view>
- <view
- v-for="(ansItem, ansIndex) in bank.jsonStr"
- v-if="bank.current == ansIndex"
- :key="ansIndex"
- >
- <template v-if="ansItem.type == 1">
- <view class="pad_8 titBox">
- <view class="leftLetters">
- <view class="btnType">
- <text>单选</text>
- </view>
- </view>
- <view class="titles">
- <rich-text :nodes="ansItem.content"></rich-text>
- </view>
- <view v-if="!bank.ques[ansIndex]">
- <view
- v-for="(option, childIndex) in ansItem.optionsList"
- :key="childIndex"
- class="lisSty"
- @click="
- radioSelectChild(option.optionsId, ansIndex, bankIndex)
- "
- >
- <view class="activeTI">{{ ast[childIndex] }}</view>
- <view class="flex_auto">
- <rich-text
- class="textChild"
- :nodes="option.content"
- ></rich-text>
- </view>
- </view>
- </view>
- <view v-if="bank.ques[ansIndex]">
- <view
- v-for="(option, childIndex) in ansItem.optionsList"
- :key="childIndex"
- class="lisSty"
- @click="
- radioSelectChild(option.optionsId, ansIndex, bankIndex)
- "
- >
- <text
- :class="{
- right:
- bankType == 1 && (option.optionsId == bank.ques[ansIndex] ||
- option.optionsId == bank.ans[ansIndex]),
- wrong:
- bankType == 1 && (option.optionsId == bank.ques[ansIndex] &&
- bank.ques[ansIndex] != bank.ans[ansIndex]),
- user_choose: bankType == 2 && (option.optionsId == bank.ques[ansIndex]),
- }"
- class="activeTI"
- >
- {{ ast[childIndex] }}
- </text>
- <view class="flex_auto">
- <rich-text :nodes="option.content"></rich-text>
- </view>
- </view>
- </view>
- </view>
- <view v-if="bankType == 1 && bank.ques[ansIndex]">
- <view class="pad_8 answer">
- <view>正确答案:{{ ast[bank.ans[ansIndex] - 1] }}</view>
- <view>我的答案:{{ ast[bank.ques[ansIndex] - 1] }}</view>
- </view>
- <view class="pad_8 answerInfos">
- <view class="answerTitle">答案解析</view>
- <view class="answerContent"
- ><rich-text :nodes="option.analysisContent"></rich-text
- ></view>
- </view>
- </view>
- </template>
- <template v-if="ansItem.type == 2">
- <view class="pad_8 titBox">
- <view class="leftLetters">
- <view class="btnType">
- <text>多选</text>
- </view>
- </view>
- <view class="titles">
- <rich-text :nodes="ansItem.content"></rich-text>
- </view>
- <view v-if="!bank.ques[ansIndex]">
- <view
- v-for="(option, childindex) in ansItem.optionsList"
- :key="childindex"
- class="lisSty"
- @click="
- checkboxSelectChild(bankIndex, ansIndex, childindex)
- "
- >
- <view
- :class="{ checked: option.checked }"
- class="activeTI"
- >{{ ast[childindex] }}</view
- >
- <view class="flex_auto">
- <rich-text :nodes="option.content"></rich-text>
- </view>
- </view>
- </view>
- <view
- v-if="bankType == 2 || (bankType == 1 && !bank.ques[ansIndex])"
- class="submit_checkbox"
- :class="{
- disabled: !isCheckboxChecked(ansItem.optionsList),
- }"
- @click="checkboxSubmitChild(bankIndex, ansIndex)"
- >确认答案</view
- >
- <view v-if="bank.ques && bank.ques[ansIndex]">
- <view
- v-for="(option, childindex) in ansItem.optionsList"
- :key="childindex"
- class="lisSty"
- @click="
- checkboxSelectChild(bankIndex, ansIndex, childindex)
- "
- >
- <text
- :class="{
- right: bankType == 1 && right(bankIndex, ansIndex, option),
- wrong: bankType == 1 && wrong(bankIndex, ansIndex, option),
- user_choose: bankType == 2 && option.checked,
- }"
- class="activeTI"
- >
- {{ ast[childindex] }}
- </text>
- <view class="flex_auto">
- <rich-text :nodes="option.content"></rich-text>
- </view>
- </view>
- </view>
- </view>
- <view v-if="bankType == 1 && bank.ques[ansIndex]">
- <view class="pad_8 answer">
- <view>
- 正确答案:
- <text
- :key="ansItemIndex1"
- v-for="(ansItem1, ansItemIndex1) in bank.ans[ansIndex]"
- >{{ ast[ansItem1 - 1] }}</text
- >
- </view>
- <view>
- 我的答案:
- <text
- :key="quesItemIndex"
- v-for="(quesItem, quesItemIndex) in bank.ques[ansIndex]"
- >{{ ast[quesItem - 1] }}</text
- >
- </view>
- </view>
- <view class="pad_8 answerInfos">
- <view class="answerTitle">答案解析</view>
- <view class="answerContent"
- ><rich-text :nodes="ansItem.analysisContent"></rich-text
- ></view>
- </view>
- </view>
- </template>
- <template v-if="ansItem.type == 3">
- <view class="pad_8 titBox">
- <view class="leftLetters">
- <view class="btnType">
- <text>判断</text>
- </view>
- </view>
- <view class="titles">
- <rich-text :nodes="ansItem.content"></rich-text>
- </view>
- <view v-if="!bank.ques[ansIndex]">
- <view
- v-for="(option, childindex) in judge"
- :key="childindex"
- class="lisSty"
- @click="judgeSelectChild(ansIndex, childindex, bankIndex)"
- >
- <view class="activeTI">{{ ast[childindex] }}</view>
- <view class="flex_auto">
- {{ option }}
- </view>
- </view>
- </view>
- <view v-if="bank.ques[ansIndex]">
- <view
- v-for="(option, childindex) in judge"
- :key="childindex"
- class="lisSty"
- @click="judgeSelectChild(ansIndex, childindex, bankIndex)"
- >
- <text
- :class="{
- right:
- bankType == 1 && (childindex == (bank.ques[ansIndex] == 1 ? 0 : 1) ||
- childindex != bank.ans[ansIndex]),
- wrong:
- bankType == 1 && (childindex == (bank.ques[ansIndex] == 1 ? 0 : 1) &&
- bank.ques[ansIndex] != bank.ans[ansIndex]),
- user_choose: bankType == 2 && (childindex == (bank.ques[ansIndex] == 1 ? 0 : 1)),
- }"
- class="activeTI"
- >
- {{ ast[childindex] }}
- </text>
- <view class="flex_auto">
- {{ option }}
- </view>
- </view>
- </view>
- </view>
- <view v-if="bankType == 1 && bank.ques[ansIndex]">
- <view class="pad_8 answer">
- <view>正确答案:{{ ast[bank.ans[ansIndex] == 1 ? 0 : 1] }}</view>
- <view>我的答案:{{ ast[bank.ques[ansIndex] == 1 ? 0 : 1] }}</view>
- </view>
- <view class="pad_8 answerInfos">
- <view class="answerTitle">答案解析</view>
- <view class="answerContent"
- ><rich-text :nodes="ansItem.analysisContent"></rich-text
- ></view>
- </view>
- </view>
- </template>
- <!-- 简答题 -->
- <template v-if="ansItem.type == 5">
- <view class="pad_8 titBox_title">
- <view class="leftLetters">
- <view class="btnType">
- <text>简答</text>
- </view>
- </view>
- <view class="titles">
- <rich-text :nodes="ansItem.content"></rich-text>
- </view>
- </view>
- <view class="pad_8 titBox_title">
- <view class="ans">
- <view
- class="ans_input"
- v-if="
- bankType == 2 || (bankType == 1 &&
- (!bank.ques[ansIndex] ||
- (!bank.ques[ansIndex].text &&
- !bank.ques[ansIndex].imageList.length)))
- "
- >
- <view class="top flex">
- <image
- class="icon"
- @click="chooseImgChild(bankIndex, ansIndex)"
- src="/static/08-10_032.jpg"
- mode=""
- ></image>
- <view class="progress"
- >{{ ansItem.ansText.imageList.length || "0" }}/4</view
- >
- <view
- class="submit"
- @click="submitAnsChild(bankIndex, ansIndex)"
- >确认答案</view
- >
- </view>
- <view class="textarea">
- <textarea
- v-model="ansItem.ansText.text"
- placeholder="在此输入答案"
- ></textarea>
- </view>
- <view class="imgs">
- <view
- class="img"
- :key="imgIndex"
- v-for="(img, imgIndex) in ansItem.ansText.imageList"
- >
- <text
- @click="
- deleteImgChild(imgIndex, bankIndex, ansIndex)
- "
- >x</text
- >
- <image :src="$method.splitImgHost(img, true)"></image>
- </view>
- </view>
- </view>
- <view
- class="ans_submit answerInfos"
- v-if="bankType == 1 && bank.ques[ansIndex]"
- >
- <view class="answerTitle">我的答案</view>
- {{ bank.ques[ansIndex].text }}
- <view class="imgs">
- <image
- class="img"
- :key="quesIndex"
- v-for="(ques, quesIndex) in bank.ques[ansIndex]
- .imageList"
- :src="$method.splitImgHost(ques, true)"
- ></image>
- </view>
- </view>
- </view>
- </view>
- <view v-if="bankType == 1 && bank.ques[ansIndex]">
- <view class="pad_8 answerInfos">
- <view class="answerTitle">答案解析</view>
- <view class="answerContent"
- ><rich-text :nodes="ansItem.analysisContent"></rich-text
- ></view>
- </view>
- </view>
- </template>
- </view>
- </template>
- <view class="footer_btn">
- <!-- <view class="collect">
- <view v-if="collectList[bankIndex]">
- <image src="/static/icon/collected.png" mode=""></image>
- <view>取消收藏</view>
- </view>
- </view> -->
- <view
- class="collect show"
- @click="collect(collectList[bankIndex], bankIndex)"
- >
- <view v-if="collectList[bankIndex]">
- <image src="/static/icon/collected.png" mode=""></image>
- <view>取消收藏</view>
- </view>
- <view v-if="!collectList[bankIndex]">
- <image src="/static/icon/collect.png" mode=""></image>
- <view>收藏</view>
- </view>
- </view>
- <view class="flex_center" @click="openFooterTab">
- <view class="up-icon">
- <image src="/static/up.png"></image>
- </view>
- 答题卡
- </view>
- <view class="collect show" @click="pdsubmit">
- <view>
- <image src="/static/jj.png" mode=""></image>
- <view>交卷</view>
- </view>
- </view>
- </view>
- </view>
- </swiper-item>
- </swiper>
- <u-popup v-model="show" mode="bottom" border-radius="14" height="680rpx">
- <view class="popupView">
- <view class="popupTops">
- <view class="topIcon"></view>
- 点击编号即可跳转至对应题目
- </view>
- <view class="popupContent">
- <scroll-view scroll-y="true" style="height: 506rpx">
- <view class="boxSty">
- <view
- v-for="(item, index) in questionList"
- :key="index"
- @click="changeIndex(index)"
- :class="{
- isRight: bankType == 1 && isRight(item, index),
- isWrong: bankType == 1 && isWrong(item, index),
- isPart: bankType == 1 && isPart(item, index),
- isOver: bankType == 1 && isOver(item, index),
- check_ans: bankType == 2 && isCheck(item, index),
- }"
- class="liListSty"
- >
- {{ index + 1 }}
- </view>
- </view>
- </scroll-view>
- </view>
- </view>
- </u-popup>
- <view class="dialog" v-if="showDialog">
- <view class="text">左右滑动切换上下题</view>
- <view class="btn" @click="hideDialog">我知道了</view>
- </view>
- <view class="dialog-arrow" v-if="showArrow">
- <image class="pointer" src="/static/arrow-left.png" mode=""></image>
- <view class="text">您当前正在测试, 若想退出请点击左上角返回按钮。</view>
- <view class="btn" @click="showArrow = false">我知道了</view>
- </view>
- <view class="dialog_wrap" v-if="testOver">
- <view class="bg"></view>
- <view class="dialog">
- <view class="title">温馨提示</view>
- <view class="content">
- <view>您已完成所有题目,</view>
- <view>快去交卷吧!</view>
- </view>
- <view class="btns">
- <view class="btn" @click="noSubmit()">暂不交卷</view>
- <view class="btn active" @click="submitNow()">立即交卷</view>
- </view>
- </view>
- </view>
- <view class="dialog_wrap" v-if="isLastCount">
- <view class="bg"></view>
- <view class="dialog">
- <view class="title">温馨提示</view>
- <view class="content">
- <view
- >您当前正在测试,还剩{{ lastCount }}道题未完成,离开视为交卷</view
- >
- </view>
- <view class="btns">
- <view class="btn" @click="noLeave()">暂不离开</view>
- <view class="btn active" @click="leaveNow()">继续离开</view>
- </view>
- </view>
- </view>
- <u-popup
- v-model="showpopups"
- mode="center"
- border-radius="24"
- height="439rpx"
- width="640rpx"
- :mask-close-able="false"
- >
- <view class="popboxs">
- <view class="classTops">温馨提示</view>
- <view class="textStys">
- {{
- cgType === 7
- ? "您还未交卷,确定结束做题吗?"
- : cgType === 8
- ? `您还有${lastCount}道题未作答, 现在继续作答,还是下次继续?`
- : cgType === 6
- ? `您还有${lastCount}道题未作答, 您确定要交卷吗?`
- : cgType == 9
- ? `您已完成所有题目,快去交卷吧!`
- : ""
- }}
- </view>
- <view class="classFootsty" v-if="cgType === 6">
- <view class="btnsty btns1" @click="submit()">立即交卷</view>
- <view class="btnsty btns2" @click="showpopups = false">继续做题</view>
- </view>
- <view class="classFootsty" v-if="cgType === 7">
- <view class="btnsty btns1" @click="showpopups = false">下次继续</view>
- <view class="btnsty btns2" @click="backPages">结束做题</view>
- </view>
- <view class="classFootsty" v-if="cgType === 8">
- <view class="btnsty btns1" @click="leaveNow()">下次继续</view>
- <view class="btnsty btns2" @click="showpopups = false">继续作答</view>
- </view>
- <view class="classFootsty" v-if="cgType === 9">
- <view class="btnsty btns1" @click="showpopups = false">暂不交卷</view>
- <view class="btnsty btns2" @click="submit()">立即交卷</view>
- </view>
- </view>
- </u-popup>
- <!-- 节卷不需要拍照 -->
- <u-mask :show="examType != 2 && photoPopup">
- <!-- 播放前拍照start -->
- <view
- v-if="examType != 2 && photoPopup"
- :mask-close-able="false"
- style="bottom: 0; position: fixed; width: 100%; z-index: 999"
- >
- <view class="photoBox">
- <view class="photoTop">
- <view class="sqzz" v-if="false"
- ><u-icon
- name="close"
- color="#333333"
- size="30"
- @click="closePhoto"
- ></u-icon
- ></view>
- <view class="centersq">请正视手机屏幕</view>
- <view class="sqzz"></view>
- </view>
- <view class="photoCenter">
- <view
- class="center_camera"
- v-if="photoPopup && isTaking"
- >
- <camera
- device-position="front"
- flash="off"
- @error="error"
- style="width: 100%; height: 100%"
- >
- <!-- 加人脸框 -->
- <cover-view class="head_take">
- <cover-view class="headTake_up color"></cover-view>
- <cover-view class="headTake_minddle">
- <cover-view class="min_left color"></cover-view>
- <cover-view class="min_img"></cover-view>
- <cover-view class="min_right color"></cover-view>
- </cover-view>
- <cover-view class="headTake_down color"></cover-view>
- </cover-view>
- </camera>
- </view>
- <view class="custom" v-if="!isTaking"
- ><image :src="avatarUrl" mode=""></image
- ></view>
- </view>
- <view class="photoBoxbtns">
- <!-- <view class="btnResult" v-if="isTaking" @click="takePhoto"
- >拍照</view
- > -->
- <view v-if="isTaking" class="takePhoto_btn">
- <view style='width: 100rpx;height: 2rpx;'></view>
- <view class="middle_btn" @click="takePhoto">
- <view class="square"></view>
- </view>
- <view class="rights" @click="takePhTips()">
- <text>拍照提示</text>
- <u-icon name="arrow-right" color="#FFFFFF" size="30"></u-icon>
- </view>
- </view>
- <view class="btnResult" v-if="!isTaking" @click="reTake">重拍</view>
- <view class="btnResult" v-if="!isTaking" @click="submitPhoto"
- >确认</view
- >
- </view>
- </view>
- </view>
- </u-mask>
- <!-- 拍照提示 -->
- <popup-photo :popupPhotoShow.sync="popupPhotoShow" @takePhoto='toTakePhoto()'></popup-photo>
- </view>
- </template>
- <script>
- import PopupPhoto from '@/components/popup/index.vue'
- export default {
- components: {
- PopupPhoto,
- },
- data() {
- return {
- photoPopup: false,
- showpopups: false,
- id: "",
- current: 0,
- questionList: [],
- ast: ["A", "B", "C", "D", "E", "F", "G"],
- judge: ["正确", "错误"],
- ans: [],
- ques: [],
- show: false,
- showDialog: false,
- bankList: [],
- collectList: [],
- goodsId: "",
- recordId: "",
- isSubmit: false,
- lastTime: 0, //剩余考试时长
- allTimes: 0, //总考试时长
- timer: null,
- wrongList: [],
- bankType: 0, //试卷类型
- needBack: false, //是否是考试
- testOver: false,
- isLastCount: false, //是否有未答题目
- lastCount: 0, //剩余没有回答的题目数
- chapterId: 0,
- moduleId: 0,
- sectionId: 0,
- showArrow: false, //退出提示
- isFromVideo: "",
- gradeId: "",
- courseId: 0,
- cgType: 0, //对应设计稿弹窗编码,
- avatarUrl: "",
- ossAvatarUrl: "",
- goodsDetail: {},
- isTakePhoto: false,
- orderGoodsId: 0,
- isTaking: true, //是否正在拍照
- needPhoto: false, //是否需要拍照
- examType: 0, // 3-模块,1-章,2-节
- compareFaceData: 0, // 拍照匹配相似度
- learning: -1, // 1合格,0不合格
- originShowDialog: false,
- uploadLock: false, //上传图片
- examData: {},
- popupPhotoShow: false,
- };
- },
- watch: {
- photoPopup(n) {
- // 拍照弹窗和showDialog同时出现时,先展示拍照弹窗再展示showDialog弹窗
- if (n) {
- this.showDialog && (this.showDialog = false)
- } else {
- this.originShowDialog && (this.showDialog = true)
- }
- }
- },
- async onLoad(option) {
- this.examType = option.type
- this.id = option.id;
- this.goodsId = option.goodsid;
- this.chapterId = option.chapterId;
- this.courseId = option.courseId;
- this.sectionId = option.sectionId
- this.moduleId = option.moduleId;
- this.isFromVideo = option.isFromVideo || "";
- this.gradeId = option.gradeId || "";
- this.orderGoodsId = Number(option.orderGoodsId);
- this.learning = option.learning
- console.log('learning:', this.learning)
- let isBack = option.isback;
- let showDialog = uni.getStorageSync("showDialog");
- if (showDialog) {
- this.showDialog = false;
- } else {
- this.showDialog = true;
- this.originShowDialog = true
- uni.setStorageSync("showDialog", "1");
- }
- //考试时候用手势或者返回键 被迫返回做题
- if (isBack) {
- console.log(getApp());
- let app = getApp();
- let globalData = app.globalData;
- for (var k in globalData.bankData) {
- this[k] = globalData.bankData[k];
- }
- this.showArrow = true;
- //需要拍没拍过直接弹出摄像头
- if (this.needPhoto && !this.isTakePhoto) {
- if (this.learning != 1) {
- if (uni.getStorageSync('tabkePhotoShow')) {
- this.photoPopup = true;
- this.isTaking = true;
- this.avatarUrl = "";
- } else {
- this.popupPhotoShow = true
- uni.setStorageSync('tabkePhotoShow', 1) // 本地缓存用来判断是否已经弹出过弹窗
- }
-
- }
- } else {
- //不需要拍照
- if (this.lastTime) {
- this.timer = setInterval(() => {
- if (this.lastTime <= 0) {
- clearInterval(this.timer);
- uni.showToast({
- icon: "none",
- mask: true,
- title: "考试时间已到,系统将自动交卷",
- duration: 10000,
- });
- this.submit();
- return;
- }
- this.lastTime--;
- }, 1000);
- }
- }
- } else {
- await this.getGoodsDetail();
- // 请求题目列表
- this.goodsQuestionList();
- this.bankExam();
- }
- },
- onUnload() {
- if (this.isSubmit) {
- clearInterval(this.timer);
- return;
- }
- if (this.needPhoto && !this.isTakePhoto) {
- return;
- }
- //考试试卷 阻止ios手势返回,自动跳回答题页
- if (this.needBack) {
- let app = getApp();
- app.globalData.bankData = this.$data;
- clearInterval(this.timer);
- uni.navigateTo({
- url:
- "/pages2/class/questionBank?id=" +
- this.id +
- "&goodsid=" +
- this.goodsId +
- "&isback=true&orderGoodsId=" +
- this.orderGoodsId,
- });
- } else {
- //点击返回按钮确认允许退出,交卷
- clearInterval(this.timer);
- this.examRecordEdit();
- }
- },
- methods: {
- getGoodsDetail() {
- return new Promise((resolve) => {
- let self = this;
- this.$api.goodsDetail(this.goodsId).then((res) => {
- self.goodsDetail = res.data.data;
- if (self.goodsDetail.goodsPhotoExamConfig) {
- let goodsPhotoExamConfig = JSON.parse(
- self.goodsDetail.goodsPhotoExamConfig
- );
- if (goodsPhotoExamConfig.photograph > 0) {
- self.needPhoto = true;
- }
- }
- resolve();
- });
- });
- },
- reTake() {
- this.isTaking = true;
- },
- postStudyRecord() {
- let self = this;
- let data = {
- photo: self.ossAvatarUrl,
- recordId: self.recordId,
- };
- if (this.ossAvatarUrl) {
- data.similarity = this.compareFaceData // 相似度
- }
- // console.log(data, "拍照提交");
- this.$api.studyExamPhotoRecord(data).then((res) => {
- // console.log(res, "拍照提交结果");
- if (res.data.code != 200) {
- uni.showToast({
- icon: "none",
- mask: true,
- title: res.data.msg,
- duration: 10000,
- });
- return;
- }
- self.ossAvatarUrl = "";
- self.isTakePhoto = true;
- //拍照
- if (this.lastTime) {
- this.timer = setInterval(() => {
- if (this.lastTime <= 0) {
- clearInterval(this.timer);
- uni.showToast({
- icon: "none",
- mask: true,
- title: "考试时间已到,系统将自动交卷",
- duration: 10000,
- });
- this.submit();
- return;
- }
- this.lastTime--;
- }, 1000);
- }
- });
- },
- uploadFile(options, int) {
- var self = this;
- return new Promise((resolve, reject) => {
- var data = {
- imageStatus: int,
- gradeId: this.gradeId,
- };
- self.$api.aliyunpolicy(data).then((res) => {
- if (res.data.code != 200) {
- self.$method.showToast("签名错误" + JSON.stringify(res.data));
- return;
- }
- var ossToken = res.data.data.resultContent;
- if (ossToken.host == null || ossToken.host == undefined) {
- self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
- return;
- }
- uni.uploadFile({
- url: ossToken.host,
- name: "file",
- filePath: options,
- fileType: "image",
- header: {
- AuthorizationToken: "WX " + uni.getStorageSync("token"),
- },
- formData: {
- key: ossToken.dir,
- OSSAccessKeyId: ossToken.accessid,
- policy: ossToken.policy,
- Signature: ossToken.signature,
- callback: ossToken.callback,
- success_action_status: 200,
- },
- success: (result) => {
- // if (result.statusCode === 200) {
- self.ossAvatarUrl = ossToken.dir;
- resolve(ossToken.dir);
- // } else {
- // uni.showToast({
- // title: "上传失败",
- // icon: "none",
- // });
- // return;
- // }
- },
- fail: (error) => {
- uni.showToast({
- title: "上传接口报错" + error,
- icon: "none",
- });
- this.uploadLock = false
- this.openPhoto()
- return;
- },
- });
- });
- });
- },
- imageInfos() {
- var self = this;
- return new Promise((resolve, reject) => {
- uni.getImageInfo({
- src: self.avatarUrl,
- success: async (res) => {
- let canvasWidth = res.width; //图片原始长宽
- let canvasHeight = res.height;
- if (canvasWidth > 2000 || canvasHeight > 2000) {
- uni.compressImage({
- src: self.avatarUrl,
- quality: 75,
- width: "35%",
- height: "35%",
- success: async (rest) => {
- const waitUpload = await self.uploadFile(
- rest.tempFilePath,
- 0
- );
- resolve(waitUpload);
- },
- });
- } else if (canvasWidth > 1000 || canvasHeight > 1000) {
- uni.compressImage({
- src: self.avatarUrl,
- quality: 75,
- width: "50%",
- height: "50%",
- success: async (rest) => {
- const waitUpload = await self.uploadFile(
- rest.tempFilePath,
- 0
- );
- resolve(waitUpload);
- },
- });
- } else {
- console.log("无需压缩");
- const waitUpload = await self.uploadFile(self.avatarUrl, 0);
- resolve(waitUpload);
- }
- },
- });
- });
- },
- /**
- * 人脸匹配
- */
- faceRecognition() {
- return new Promise((resolve) => {
- let fileSystem = uni.getFileSystemManager();
- fileSystem.readFile({
- filePath: `${this.avatarUrl}`,
- encoding: "base64",
- position: 0,
- success: (res) => {
- let base64 = "data:image/jpg;base64," + res.data;
- console.log('试卷-base64Data人脸识别参数:', {
- imageA: base64,
- orderGoodsId: this.orderGoodsId,
- gradeId: this.gradeId,
- })
-
- let timer = setTimeout(() => {
- uni.showToast({
- icon: "none",
- title: '拍照超时,请重新拍照',
- success: () => {
- setTimeout(() => {
- uni.navigateBack()
- }, 1000)
- }
- })
- }, 10 * 1000)
- this.$api
- .faceCertificationCompareFace({
- imageA: base64,
- orderGoodsId: this.orderGoodsId,
- gradeId: this.gradeId,
- })
- .then((res) => {
- clearTimeout(timer)
- resolve(res.data.data);
- }).catch((err) => {
- clearTimeout(timer)
- // 当前网络延迟,
- console.log('人脸识别错误:', err)
- uni.showModal({
- content: "当前网络延迟",
- showCancel: false,
- success: (resultst) => {
- if (resultst.confirm) {
- uni.navigateBack()
- }
- },
- })
- })
- },
- fail(err) {
- console.error(err, "err");
- },
- });
- });
- },
- toTakePhoto() {
- this.popupPhotoShow = false
- this.openPhoto()
- },
- takePhTips() {
- this.popupPhotoShow = true
- this.isTaking = false
- this.photoPopup = false
- },
- // 确认拍照
- async submitPhoto() {
- if (this.uploadLock) {
- return
- }
- this.uploadLock = true
- let compareFaceData = await this.faceRecognition();
- this.compareFaceData = compareFaceData
- // if (compareFaceData == 0) {
- // uni.showToast({
- // title: "人脸匹配不通过,请重新拍照上传",
- // icon: "none",
- // duration: 2000,
- // });
- // // setTimeout(() => {
- // // this.uploadLock = false;
- // // this.openPhoto();
- // // }, 2000);
- // return;
- // }
- if (compareFaceData >= 80) {
- const waitYS = await this.imageInfos();
- this.postStudyRecord(); //提交记录
- this.photoPopup = false;
- } else {
- uni.showToast({
- title: "人脸匹配不通过,请重新拍照上传",
- icon: "none",
- duration: 2000,
- });
- setTimeout(() => {
- this.uploadLock = false
- this.openPhoto()
- }, 2000);
- }
- },
- //拍照
- openPhoto() {
- // this.enableAutoRotation = false;
- this.photoPopup = true;
- this.isTaking = true;
- uni.setKeepScreenOn({
- keepScreenOn: true,
- });
- uni.authorize({
- scope: "scope.camera",
- success() {},
- });
- },
- //确认拍照
- takePhoto() {
- var self = this;
- const ctx = uni.createCameraContext();
- ctx.takePhoto({
- quality: "high",
- success: (res) => {
- console.log(res.tempImagePath);
- self.avatarUrl = res.tempImagePath;
- // self.submitPhoto();
- this.isTaking = false;
- },
- fail: (err) => {
- console.log(err);
- },
- });
- },
- /**
- * 是否有上传图片
- */
- hasImgs(bank) {
- return bank.ansText.imageList.length == 0;
- },
- /**
- * 获取试卷类型2考试,1练习
- */
- bankExam() {
- this.$api.bankExam(this.id).then((res) => {
- this.bankType = res.data.data.doType;
- this.examData = res.data.data
- if (this.bankType == 2) {
- this.needBack = true;
- }
- });
- },
- /**
- * 点击后退按钮
- */
- clickLeft() {
- //需要拍照没有拍直接返回
- if (this.needPhoto && !this.isTakePhoto) {
- this.isSubmit = true;
- uni.navigateBack({
- delta: 1,
- });
- return;
- }
- if (this.bankType == 1) {
- let ansCount = this.questionOverNum(); //已答题数
- this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
- //所有题目答完
- if (this.lastCount == 0) {
- // this.testOver = true;
- this.cgType = 7;
- //未答完
- } else {
- this.cgType = 8;
- // this.isLastCount = true;
- }
- this.showpopups = true;
- } else if (this.bankType == 2) {
- let ansCount = this.questionOverNum(); //已答题数
- this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
- //所有题目答完
- if (this.lastCount == 0) {
- this.testOver = true;
- //未答完
- } else {
- this.isLastCount = true;
- }
- }
- },
- /**
- * 返回上一页
- */
- backPages() {
- this.needBack = false;
- uni.navigateBack({
- delta: 1,
- });
- },
- /**
- * 获取已经回答的题目数
- * hasSpecail (是否包含简答和案例)
- */
- questionOverNum(hasSpecail) {
- let count = 0;
- this.questionList.forEach((item) => {
- if (item.type == 1 || item.type == 2 || item.type == 3) {
- if (item.ques) {
- count++;
- }
- } else if (item.type == 4) {
- //案例题
- if (hasSpecail) {
- let isOver = item.jsonStr.every((jsonItem, indexs) => {
- if (
- jsonItem.type == 1 ||
- jsonItem.type == 2 ||
- jsonItem.type == 3
- ) {
- if (item.ques[indexs]) {
- return true;
- } else {
- return false;
- }
- } else if (jsonItem.type == 5) {
- console.log(jsonItem, 111);
- if (
- item.ques[indexs] &&
- (item.ques[indexs].text.length ||
- item.ques[indexs].imageList.length)
- ) {
- return true;
- } else {
- return false;
- }
- }
- });
- if (isOver) {
- count++;
- console.log(item, 444);
- }
- }
- } else if (item.type == 5) {
- //简答题
- if (hasSpecail) {
- if (
- item.ques &&
- (item.ques.text.length || item.ques.imageList.length)
- ) {
- count++;
- }
- }
- }
- });
- return count;
- },
- /**
- * 是否做完所有题目
- */
- isDoOver() {
- let questionOverNum = this.questionOverNum(true); //获取已经回答的题目数(包括简答和案例)
- if (this.questionList.length == questionOverNum) {
- //全部做完弹窗
- this.cgType = 9;
- this.showpopups = true;
- }
- },
- /**
- * 暂不交卷
- */
- noSubmit() {
- //设为允许退出页面
- this.needBack = false;
- uni.navigateBack({
- delta: 1,
- });
- },
- /**
- * 不离开
- */
- noLeave() {
- this.isLastCount = false;
- },
- /**
- * 立即离开并交卷
- */
- leaveNow() {
- this.isSubmit = true;
- uni.navigateBack({
- delta: 1,
- });
- //需要拍照没有拍,返回不扣次数
- if (this.needPhoto && !this.isTakePhoto) {
- return;
- }
- this.submit('leaveNow')
- return
- let score = 0; //计算总分
- let reportStatus = 0;
- let number = 0;
- let doQuestionIds = []; //做过的题目id
- let doQuestionNum = 0; //做过的题目数量
- let passScore = 0;
- let allScore = 0; //总分
- this.questionList.forEach((item, index) => {
- passScore = item.passScore;
- if (item.type == 1) {
- if (item.ques == item.ans) {
- item.scoreResult = item.score;
- score += item.score;
- number++;
- } else {
- item.scoreResult = 0;
- }
- if (item.ques) {
- doQuestionNum++;
- doQuestionIds.push(item.questionId);
- }
- allScore += item.score;
- } else if (item.type == 2) {
- let isRight =
- item.ques &&
- item.ques.every((quesItem, quesIndex) => {
- return item.ques[quesIndex] == item.ans[quesIndex];
- });
- if (isRight) {
- //全对
- item.scoreResult = item.score;
- score += item.score;
- number++;
- } else {
- let hasPart = false;
- let checkboxScore = 1; //获取单题总分数
- item.ques &&
- item.ques.forEach((ques, quesIndex) => {
- //选错一个全扣
- if (item.ques) {
- if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
- checkboxScore = 0;
- }
- } else {
- checkboxScore = 0;
- }
- });
- //没选错
- if (checkboxScore) {
- checkboxScore = 0;
- item.ans.forEach((ans, quesIndex) => {
- //漏选扣一部分,对n题给n X partScore 分
- if (item.ques) {
- if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
- checkboxScore += item.partScore;
- hasPart = true;
- }
- } else {
- checkboxScore = 0;
- }
- });
- }
- if (!hasPart) {
- item.scoreResult = 0;
- } else {
- item.scoreResult = checkboxScore;
- }
- score += checkboxScore;
- }
- if (item.ques && item.ques.length) {
- doQuestionNum++;
- doQuestionIds.push(item.questionId);
- }
- allScore += item.score;
- } else if (item.type == 3) {
- if (item.ques == item.ans) {
- item.scoreResult = item.score;
- score += item.score;
- number++;
- } else {
- item.scoreResult = 0;
- }
- if (item.ques) {
- doQuestionNum++;
- doQuestionIds.push(item.questionId);
- }
- allScore += item.score;
- } else {
- allScore += item.score;
- }
- });
- if (score >= passScore) {
- reportStatus = 1;
- } else {
- reportStatus = 0;
- }
- this.$api
- .bankRecordEdit({
- moduleId: this.moduleId || 0,
- chapterId: this.chapterId || 0,
- sectionId: this.sectionId || 0,
- gradeId: this.gradeId,
- courseId: this.courseId,
- orderGoodsId: this.orderGoodsId,
- goodsId: this.goodsId,
- examId: this.id,
- recordId: this.recordId,
- reportStatus: reportStatus,
- rightQuestionNum: number,
- doQuestionNum: doQuestionNum,
- status: 1,
- doQuestionIds: doQuestionIds.join(","),
- performance: score,
- totalScore: allScore,
- type: this.examType,
- // examTime: parseInt(this.allTimes),
- // doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
- // historyExamJson: JSON.stringify(this.questionList)
- })
- .then((res) => {});
- },
- /**
- * 立即交卷
- */
- submitNow() {
- this.showpopups = false;
- this.needBack = false;
- this.submit();
- },
- /**
- * 离开页面统计回答正确题数
- */
- examRecordEdit() {
- if (!this.isSubmit) {
- this.submit('leave')
- return
- let number = 0;
- let score = 0;
- let doQuestionNum = 0;
- let reportStatus = 0;
- let lessQuestionNum = 0;
- this.questionList.forEach((item, index) => {
- if (item.type == 1) {
- if (item.ques == item.ans) {
- score += item.score;
- number++;
- }
- if (item.ques) {
- doQuestionNum++;
- }
- } else if (item.type == 2) {
- let isRight =
- item.ques &&
- item.ques.every((quesItem, quesIndex) => {
- return item.ques[quesIndex] == item.ans[quesIndex];
- });
- if (isRight) {
- score += item.score;
- number++;
- } else {
- let hasPart = false;
- let checkboxScore = 1; //获取单题总分数
- item.ques.forEach((ques, quesIndex) => {
- //选错一个全扣
- if (item.ques) {
- if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
- checkboxScore = 0;
- }
- } else {
- checkboxScore = 0;
- }
- });
- //没选错
- if (checkboxScore) {
- checkboxScore = 0;
- item.ans.forEach((ans, quesIndex) => {
- //漏选扣一部分
- if (item.ques) {
- if (item.ques.indexOf(item.ans[quesIndex]) == -1) {
- checkboxScore += item.partScore;
- hasPart = true;
- }
- } else {
- checkboxScore = 0;
- }
- });
- }
- if (!hasPart) {
- item.scoreResult = 0;
- } else {
- lessQuestionNum++
- item.scoreResult = checkboxScore;
- score += checkboxScore;
- // number++;
- }
- }
- if (item.ques && item.ques.length) {
- doQuestionNum++;
- }
- } else if (item.type == 3) {
- if (item.ques == item.ans) {
- score += item.score;
- number++;
- }
- if (item.ques) {
- doQuestionNum++;
- }
- } else if (item == 4) {
- if (item.ques.length) {
- doQuestionNum++;
- }
- } else if (item.type == 5) {
- if (item.ques) {
- doQuestionNum++;
- }
- }
- });
- if (score >= 60) {
- reportStatus = 1;
- }
- this.$api
- .bankRecordEdit({
- moduleId: this.moduleId || 0,
- chapterId: this.chapterId || 0,
- sectionId: this.sectionId || 0,
- gradeId: this.gradeId,
- courseId: this.courseId,
- orderGoodsId: this.orderGoodsId,
- goodsId: this.goodsId,
- examId: this.id,
- recordId: this.recordId,
- lessQuestionNum:lessQuestionNum,
- performance: score,
- reportStatus: reportStatus,
- status: 1,
- type: this.examType,
- // historyExamJson: JSON.stringify(this.questionList)
- })
- .then((res) => {});
- }
- },
- /**
- * @param {Object} second倒计时过滤器
- */
- countdown(second) {
- if (second) {
- let h = parseInt((second / 60 / 60) % 24); // 计算小时
- let m = parseInt((second / 60) % 60); // 计算分数
- let s = parseInt(second % 60); // 计算当前秒数
- if (h < 10) h = "0" + h;
- if (m < 10) m = "0" + m;
- if (s < 10) s = "0" + s;
- return h + ":" + m + ":" + s;
- } else {
- return "";
- }
- },
- /**
- * 请求题目列表
- */
- goodsQuestionList() {
- this.$api
- .goodsQuestionList({
- examId: this.id,
- })
- .then(async (res) => {
- if (!res.data.data.length) {
- this.hideDialog();
- uni.showModal({
- showCancel: false,
- content: "该试卷暂无题目",
- success: function (k) {
- if (k.confirm) {
- uni.navigateBack();
- }
- },
- });
- return;
- }
- this.allTimes = res.data.data[0].answerTime * 60;
- this.lastTime =
- res.data.data[0].answerTime && res.data.data[0].answerTime * 60;
- res.data.data.forEach((item, index) => {
- if (typeof item.jsonStr == "string") {
- item.jsonStr = JSON.parse(item.jsonStr);
- if (item.type == 2) {
- //多选
- item.jsonStr.forEach((str) => {
- str.optionsId = "" + str.optionsId;
- });
- let arr = item.answerQuestion.split(",");
- arr.forEach((a, i) => {
- arr[i] = "" + a;
- });
- item.ans = arr;
- item.analysisContent &&
- (item.analysisContent = item.analysisContent.replace(
- /<img/gi,
- '<img style="max-width:100%;"'
- ));
- item.content &&
- (item.content = item.content.replace(
- /<img/gi,
- '<img style="max-width:100%;"'
- ));
- return;
- } else if (item.type == 5) {
- //简答题
- item.ansText = {
- text: "",
- imageList: [],
- };
- item.ques = {
- text: "",
- imageList: [],
- };
- item.analysisContent &&
- (item.analysisContent = item.analysisContent.replace(
- /<img/gi,
- '<img style="max-width:100%;"'
- ));
- item.content &&
- (item.content = item.content.replace(
- /<img/gi,
- '<img style="max-width:100%;"'
- ));
- } else if (item.type == 4) {
- //案例题
- console.log(item.jsonStr);
- item.ques = [];
- item.current = 0;
- let ansArr = [];
- item.jsonStr.forEach((json, index) => {
- if (json.type == 1) {
- ansArr[index] = json.answerQuestion;
- json.content &&
- (json.content = json.content.replace(
- /<img/gi,
- '<img style="max-width:100%;"'
- ));
- } else if (json.type == 2) {
- json.optionsList.forEach((str) => {
- str.optionsId = "" + str.optionsId;
- });
- let arr = json.answerQuestion.split(",");
- arr.forEach((a, i) => {
- arr[i] = "" + a;
- });
- ansArr[index] = arr;
- json.content &&
- (json.content = json.content.replace(
- /<img/gi,
- '<img style="max-width:100%;"'
- ));
- } else if (json.type == 3) {
- ansArr[index] = json.answerQuestion;
- json.content &&
- (json.content = json.content.replace(
- /<img/gi,
- '<img style="max-width:100%;"'
- ));
- } else if (json.type == 5) {
- ansArr[index] = {
- text: "",
- imageList: [],
- };
- json.ansText = {
- text: "",
- imageList: [],
- };
- json.content &&
- (json.content = json.content.replace(
- /<img/gi,
- '<img style="max-width:100%;"'
- ));
- }
- });
- item.analysisContent &&
- (item.analysisContent = item.analysisContent.replace(
- /<img/gi,
- '<img style="max-width:100%;"'
- ));
- item.content &&
- (item.content = item.content.replace(
- /<img/gi,
- '<img style="max-width:100%;"'
- ));
- item.ans = ansArr;
- return;
- }
- item.content &&
- (item.content = item.content.replace(
- /<img/gi,
- '<img style="max-width:100%;"'
- ));
- item.ans = item.answerQuestion;
- }
- });
- this.questionList = res.data.data;
- this.lastCount = this.questionList.length;
- this.getCollectInfo(this.current)
- await this.examRecord();
- });
- },
- /**
- * 记录总题数,获取recordId
- * hasSpecial (是否包含简答和案例) true 包含 false 不包含
- */
- examRecord(hasSpecial) {
- return new Promise((resolve) => {
- let questionList = 0;
- // if(!hasSpecial) {
- this.questionList.forEach((item, index) => {
- if (item.type == 1 || item.type == 2 || item.type == 3) {
- questionList++;
- }
- });
- // } else {
- // questionList = this.questionList.length;
- // }
- this.$api
- .bankRecord({
- courseId: this.courseId,
- // chapterExamId: this.chapterId || 0,
- // moduleExamId: this.moduleId || 0,
- chapterId: this.chapterId || 0,
- moduleId: this.moduleId || 0,
- sectionId: this.sectionId || 0,
- examId: this.id,
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- gradeId: this.gradeId,
- totalQuestionNum: questionList,
- allQuestionNum: this.questionList.length,
- type: this.examType,
- })
- .then((res) => {
- this.recordId = res.data.data;
- if (this.needPhoto) {
- if (this.learning != 1) {
- if (uni.getStorageSync('tabkePhotoShow')) {
- this.photoPopup = true; //拍照
- this.isTaking = true;
- } else {
- this.popupPhotoShow = true
- uni.setStorageSync('tabkePhotoShow', 1) // 本地缓存用来判断是否已经弹出过弹窗
- }
- }
-
- } else {
- if (this.lastTime) {
- this.timer = setInterval(() => {
- if (this.lastTime <= 0) {
- clearInterval(this.timer);
- uni.showToast({
- icon: "none",
- mask: true,
- title: "考试时间已到,系统将自动交卷",
- duration: 10000,
- });
- this.submit();
- return;
- }
- this.lastTime--;
- }, 1000);
- }
- resolve();
- }
- });
- });
- },
- /**
- * @param {Object} e单选点击
- */
- radioSelect(optionsId, bindex) {
- // if (this.questionList[bindex].ques) return;
- if (this.questionList[bindex].ques && this.bankType == 1) {
- return
- }
- this.$set(this.questionList[bindex], "ques", optionsId);
- // if ((bindex + 1) < this.questionList.length) {
- // this.current = bindex + 1
- // }
- this.isDoOver();
- },
- /**
- * @param {Object} e案例单选点击
- */
- radioSelectChild(optionsId, ansIndex, bindex) {
- // if (this.questionList[bindex].ques[ansIndex]) return;
- if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
- return
- }
- this.$set(this.questionList[bindex].ques, ansIndex, optionsId);
- this.isDoOver();
- },
- /**
- * @param {Object} 多选点击
- */
- checkboxSelect(optionsId, bindex, index) {
- if (this.questionList[bindex].ques && this.bankType == 1) {
- return
- }
- this.$set(
- this.questionList[bindex].jsonStr[index],
- "checked",
- !this.questionList[bindex].jsonStr[index].checked
- );
- console.log('this.questionList[bindex].jsonStr:', this.questionList[bindex].jsonStr[index])
- },
- /**
- * @param {Object} 案例多选点击
- */
- checkboxSelectChild(bindex, ansIndex, childIndex) {
- if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
- return
- }
- this.$set(
- this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex],
- "checked",
- !this.questionList[bindex].jsonStr[ansIndex].optionsList[childIndex]
- .checked
- );
- },
- isCheckboxChecked(arr) {
- return arr.some((item) => {
- if (item.checked) {
- return true;
- }
- });
- },
- /**
- * @param {Object} 多选确认
- */
- checkboxSubmit(bindex) {
- // if (this.questionList[bindex].ques) return;
- if (this.questionList[bindex].ques && this.bankType == 1) {
- return
- }
- let arr = [];
- this.questionList[bindex].jsonStr.forEach((item) => {
- if (item.checked) {
- arr.push(item.optionsId);
- }
- });
- if (!arr.length) {
- delete this.questionList[bindex].ques
- uni.showToast({
- title: "请选择答案",
- icon: "none",
- });
- return;
- }
- this.$set(this.questionList[bindex], "ques", arr);
- this.$u.toast('已确认答案')
- this.isDoOver();
- // let isWrong = this.questionList[bindex].ques.some(
- // (quesItem, quesIndex) => {
- // return (
- // this.questionList[bindex].ques[quesIndex] !=
- // this.questionList[bindex].ans[quesIndex]
- // );
- // }
- // );
- // let isWrong = this.questionList[bindex].ques.some((item, i) => {
- // return this.questionList[bindex].ans.indexOf(item) == -1;
- // })
- },
- /**
- * @param {Object} 案例多选确认
- */
- checkboxSubmitChild(bindex, ansIndex) {
- // if (this.questionList[bindex].ques[ansIndex]) return;
- if (this.questionList[bindex].ques[ansIndex] && this.bankType == 1) {
- return
- }
- let arr = [];
- this.questionList[bindex].jsonStr[ansIndex].optionsList.forEach(
- (item) => {
- if (item.checked) {
- arr.push(item.optionsId);
- }
- }
- );
- if (!arr.length) {
- delete this.questionList[bindex].ques[ansIndex]
- uni.showToast({
- title: "请选择答案",
- icon: "none",
- });
- return;
- }
- this.$set(this.questionList[bindex].ques, ansIndex, arr);
- this.$u.toast('已确认答案')
- this.isDoOver();
- },
- /**
- * @param {Object} index
- * @param {Object} bindex
- * 判断题
- */
- judgeSelect(index, bindex) {
- // if (this.questionList[bindex].ques) return;
- if (this.questionList[bindex].ques && this.bankType == 1) {
- return
- }
- this.$set(this.questionList[bindex], "ques", index == 0 ? '1' : '0');
- this.isDoOver();
- },
- /**
- * @param {Object} ansindex
- * @param {Object} childindex
- * @param {Object} bindex
- * 案例判断题
- */
- judgeSelectChild(ansindex, childindex, bindex) {
- // if (this.questionList[bindex].ques[ansindex]) return;
- if (this.questionList[bindex].ques[ansindex] && this.bankType == 1) {
- return
- }
- this.$set(this.questionList[bindex].ques, ansindex, childindex == 0 ? '1' : '0');
- this.isDoOver();
- },
- openFooterTab() {
- this.show = true;
- },
- hideDialog() {
- this.showDialog = false;
- },
- changeIndex(index) {
- this.current = index;
- },
- swiperChange(e) {
- this.current = e.detail.current;
- this.getCollectInfo(this.current)
- },
- /**
- * @param {Object} current
- * 获取收藏信息
- */
- getCollectInfo(current) {
- this.$api
- .getCollectInfo({
- examId: this.id,
- questionId: this.questionList[current].questionId,
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- })
- .then((res) => {
- if (res.data.code == 500) {
- this.$set(this.collectList, current, false);
- } else if (res.data.code == 200) {
- this.$set(this.collectList, current, res.data.data);
- }
- });
- },
- /**
- * @param {Object} state
- * @param {Object} index
- * 收藏
- */
- collect(state, index) {
- if (!state) {
- this.$api.collectQuestion({
- examId: this.id,
- questionId: this.questionList[index].questionId,
- goodsId: this.goodsId || "",
- orderGoodsId: this.orderGoodsId,
- })
- .then((res) => {
- if (res.data.code == 200) {
- this.$set(this.collectList, index, true);
- uni.showToast({
- title: "收藏成功",
- duration: 2000,
- icon: "none",
- });
- this.getCollectInfo(index);
- }
- });
- } else {
- this.$api
- .deleteCollectQuestion(this.collectList[index].collectQuestionId)
- .then((res) => {
- if (res.data.code == 200) {
- this.$set(this.collectList, index, false);
- uni.showToast({
- title: "取消收藏成功",
- duration: 2000,
- icon: "none",
- });
- }
- });
- }
- return;
- },
- pdsubmit() {
- let ansCount = this.questionOverNum(true); //已答题数
- this.lastCount = this.questionList.length - ansCount; //统计未答完的题数
- //没有答完
- if (this.lastCount !== 0) {
- this.cgType = 6;
- this.showpopups = true;
- return;
- }
- if (this.bankType == 2) {
- if (this.lastTime > 0) {
- let lastTime = this.countdown(this.lastTime);
- uni.showModal({
- title: "提示",
- content: `时间还剩余${lastTime},确定交卷吗?`,
- confirmText: "交卷",
- cancelText: "继续答题",
- success: (res) => {
- if (res.confirm) {
- //确定
- this.submit();
- } else {
- //取消
- }
- },
- });
- return;
- }
- }
- this.submit();
- },
- /**
- * 交卷
- */
- submit(typesubmit) {
- console.log('交卷', typesubmit)
- let score = 0; //计算总分
- let reportStatus = 0;
- let number = 0; //做对的题目数量
- let doQuestionNum = 0; //做过的题目数量
- let allScore = 0; //总分
- let passScore = 0;
- let doWrongQuestionIds = []; //错题和未做题id(客观题)
- let doQuestionIds = []; //做过的题目id
- let rightQuestionIds = []; //做对的题目id
- let lessQuestionNum = 0;
- this.questionList.forEach((item, index) => {
- passScore = item.passScore;
- if (item.type == 1) {
- //正确
- if (item.ques == item.ans) {
- item.scoreResult = item.score;
- score += item.score;
- number++;
- rightQuestionIds.push(item.questionId);
- } else {
- //错误
- item.scoreResult = 0;
- if (item.ques) {
- doWrongQuestionIds.push(item.questionId);
- }
-
- }
- allScore += item.score;
- if (item.ques) {
- doQuestionNum++;
- doQuestionIds.push(item.questionId);
- }
- } else if (item.type == 2) {
- let isRight =
- item.ans &&
- item.ans.every((quesItem, quesIndex) => {
- if (item.ques) {
- return item.ques[quesIndex] == item.ans[quesIndex];
- } else {
- return false;
- }
- });
- if (isRight) {
- score += item.score;
- number++;
- item.scoreResult = item.score;
- rightQuestionIds.push(item.questionId);
- } else {
- let hasPart = false;
- let checkboxScore = 1; //获取单题总分数
- item.ques &&
- item.ques.forEach((ques, quesIndex) => {
- //选错一个全扣
- if (item.ques) {
- if (item.ans.indexOf(item.ques[quesIndex]) == -1) {
- checkboxScore = 0;
- }
- } else {
- checkboxScore = 0;
- }
- });
- console.log(checkboxScore);
- //没选错
- if (checkboxScore) {
- checkboxScore = 0;
- item.ans.forEach((ans, quesIndex) => {
- //漏选扣一部分,对n题给n X partScore 分
- if (item.ques) {
- if (item.ques.indexOf(item.ans[quesIndex]) != -1) {
- checkboxScore += item.partScore;
- hasPart = true;
- }
- } else {
- checkboxScore = 0;
- }
- });
- }
- if (!hasPart) {
- //0分
- item.scoreResult = 0;
- if (item.ques) {
- doWrongQuestionIds.push(item.questionId);
- }
- } else {
- //部分分
- // number++;
- // doWrongQuestionIds.push(item.questionId);
- lessQuestionNum++
- item.scoreResult = checkboxScore;
- score += checkboxScore;
- // rightQuestionIds.push(item.questionId)
- }
- }
- allScore += item.score;
- if (item.ques && item.ques.length) {
- doQuestionNum++;
- doQuestionIds.push(item.questionId);
- }
- } else if (item.type == 3) {
- if (item.ques == item.ans) {
- item.scoreResult = item.score;
- score += item.score;
- number++;
- rightQuestionIds.push(item.questionId);
- } else {
- item.scoreResult = 0;
- if (item.ques) {
- doWrongQuestionIds.push(item.questionId);
- }
- }
- allScore += item.score;
- if (item.ques) {
- doQuestionNum++;
- doQuestionIds.push(item.questionId);
- }
- } else if (item.type == 4) {
- allScore += item.score;
- if (item.ques && item.ques.length) {
- doQuestionNum++;
- doQuestionIds.push(item.questionId);
- }
- } else if (item.type == 5) {
- allScore += item.score;
- if (item.ques && (item.ques.imageList || item.ques.text)) {
- doQuestionNum++;
- doQuestionIds.push(item.questionId);
- }
- }
- });
- //大于分及格
- if (score >= passScore) {
- reportStatus = 1;
- } else {
- reportStatus = 0;
- }
- clearInterval(this.timer);
- //交卷
- this.$api
- .bankRecordEdit({
- moduleId: this.moduleId || 0,
- chapterId: this.chapterId || 0,
- sectionId: this.sectionId || 0,
- gradeId: this.gradeId,
- examId: this.id,
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- reportStatus: reportStatus,
- recordId: this.recordId,
- courseId: this.courseId,
- rightQuestionNum: number,
- lessQuestionNum: lessQuestionNum,
- status: 1,
- doQuestionIds: doQuestionIds.join(","),
- rightQuestionIds: rightQuestionIds.join(','),
- doQuestionNum: doQuestionNum,
- performance: score,
- totalScore: allScore,
- type: this.examType,
- examTime: parseInt(this.allTimes),
- doTime: parseInt(this.allTimes) - parseInt(this.lastTime),
- historyExamJson: JSON.stringify(this.questionList)
- })
- .then((res) => {
- this.isSubmit = true;
- if (res.data.code == 200) {
- uni.showToast({
- title: "交卷成功",
- duration: 1000,
- mask: true,
- icon: "none",
- });
- if (!typesubmit) {
- console.log('跳转----')
- setTimeout(() => {
- uni.redirectTo({
- url:
- "/pages2/class/question_report?rightQuestionNum=" +
- number +
- "&doWrongQuestionNum=" +
- doWrongQuestionIds.length +
- "&score=" +
- score +
- "&totalScore=" +
- allScore +
- "&reportStatus=" +
- reportStatus +
- "&lessQuestionNum=" +
- lessQuestionNum +
- "&examId=" + this.id + '&recordId=' + this.recordId + '&type=' + this.examType + '&orderGoodsId='+ this.orderGoodsId,
- });
- }, 1000);
- }
- }
- });
- //错题集id提交(客观题)
- this.$api
- .examWrongRecord({
- moduleId: this.moduleId || 0,
- chapterId: this.chapterId || 0,
- sectionId: this.sectionId || 0,
- gradeId: this.gradeId,
- courseId: this.courseId,
- examId: this.id,
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- questionIds: doWrongQuestionIds,
- recordId: this.recordId,
- type: 2, // 视频课程的传2
- })
- .then((res) => {})
- .catch((err) => {})
- },
- /**
- * @param {Object} imgIndex
- * @param {Object} bankIndex
- * 删除简答图片
- */
- deleteImg(imgIndex, bankIndex) {
- this.questionList[bankIndex].ansText.imageList.splice(imgIndex, 1);
- },
- /**
- * @param {Object} imgIndex
- * @param {Object} bankIndex
- * @param {Object} ansIndex
- * 删除案例题简答图片
- */
- deleteImgChild(imgIndex, bankIndex, ansIndex) {
- this.questionList[bankIndex].jsonStr[ansIndex].ansText.imageList.splice(
- imgIndex,
- 1
- );
- },
- /**
- * @param {Object} bankindex
- * 选择上传图片
- */
- chooseImg(bankindex) {
- if (
- this.questionList[bankindex] &&
- this.questionList[bankindex].ansText &&
- this.questionList[bankindex].ansText.imageList.length >= 4
- ) {
- uni.showToast({
- icon: "none",
- title: "最多选择4张",
- });
- return;
- }
- uni.chooseImage({
- count: 1, //默认9
- sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
- sourceType: ["album", "camera"], //从相册选择
- success: (res) => {
- let self = this;
- // console.log(JSON.stringify(res.tempFilePaths));
- let img = res.tempFilePaths[0];
- uni.getImageInfo({
- src: img,
- success: async (res) => {
- let canvasWidth = res.width; //图片原始长宽
- let canvasHeight = res.height;
- if (canvasWidth > 1000 || canvasHeight > 1000) {
- uni.compressImage({
- src: img,
- quality: 75,
- width: "50%",
- height: "50%",
- success: async (rest) => {
- const dir = await self.uploadFile(rest.tempFilePath, 0);
- this.questionList[bankindex].ansText.imageList.push(dir);
- },
- });
- } else {
- const dir = await self.uploadFile(img, 0);
- this.questionList[bankindex].ansText.imageList.push(dir);
- }
- },
- });
- },
- });
- },
- /**
- * @param {Object} bankindex
- * @param {Object} ansindex
- * 案例题选择上传图片
- */
- chooseImgChild(bankindex, ansindex) {
- uni.chooseImage({
- count: 1, //默认9
- sizeType: ["compressed"], //可以指定是原图还是压缩图,默认二者都有
- sourceType: ["album", "camera"], //从相册选择
- success: (res) => {
- let self = this;
- // console.log(JSON.stringify(res.tempFilePaths));
- let img = res.tempFilePaths[0];
- uni.getImageInfo({
- src: img,
- success: async (res) => {
- let canvasWidth = res.width; //图片原始长宽
- let canvasHeight = res.height;
- if (canvasWidth > 1000 || canvasHeight > 1000) {
- uni.compressImage({
- src: img,
- quality: 75,
- width: "50%",
- height: "50%",
- success: async (rest) => {
- const dir = await self.uploadFile(rest.tempFilePath, 0);
- this.questionList[bankindex].jsonStr[
- ansindex
- ].ansText.imageList.push(dir);
- },
- });
- } else {
- const dir = await self.uploadFile(img, 0);
- this.questionList[bankindex].jsonStr[
- ansindex
- ].ansText.imageList.push(dir);
- }
- },
- });
- },
- });
- },
- /**
- * @param {Object} type
- * @param {Object} bankindex
- * 简答题答案确认
- */
- submitAns(bankindex) {
- console.log(this.questionList[bankindex]);
- if (
- !this.questionList[bankindex].ansText.text &&
- !this.questionList[bankindex].ansText.imageList.length
- ) {
- uni.showToast({
- title: "请输入内容或上传图片",
- duration: 2000,
- icon: "none",
- });
- return;
- }
- this.$set(this.questionList[bankindex], "ques", {
- imageList: this.questionList[bankindex].ansText.imageList,
- text: this.questionList[bankindex].ansText.text,
- });
- this.isDoOver();
- },
- /**
- * @param {Object} bankindex
- * @param {Object} ansindex
- * 案例题简答答案确认
- */
- submitAnsChild(bankindex, ansindex) {
- if (
- !this.questionList[bankindex].jsonStr[ansindex].ansText.text &&
- !this.questionList[bankindex].jsonStr[ansindex].ansText.imageList.length
- ) {
- uni.showToast({
- title: "请输入内容或上传图片",
- duration: 2000,
- icon: "none",
- });
- return;
- }
- this.$set(this.questionList[bankindex].ques, ansindex, {
- imageList:
- this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
- text: this.questionList[bankindex].jsonStr[ansindex].ansText.text,
- });
- this.isDoOver();
- },
- isCheck(item, index) {
- if (this.questionList[index].ques) {
- return true
- }
- },
- isRight(item, index) {
- //单选
- if (this.questionList[index].ques) {
- if (item.type == 1) {
- return this.questionList[index].ques == this.questionList[index].ans;
- //多选
- } else if (item.type == 2) {
- //每一项都相等
- return this.questionList[index].ans.every((item, i) => {
- return item == this.questionList[index].ques[i];
- });
- //判断
- } else if (item.type == 3) {
- return this.questionList[index].ques == this.questionList[index].ans;
- // } else if (item.type == 5) {
- // if(this.questionList[index].ques.text){
- // return true
- // }else{
- // return false
- // }
- } else {
- return false;
- }
- } else {
- return false;
- }
- },
- right(bankIndex, ansIndex, option) {
- if (
- this.questionList[bankIndex].ques[ansIndex] &&
- this.questionList[bankIndex].ans[ansIndex]
- ) {
- if (
- this.questionList[bankIndex].ques[ansIndex].indexOf(
- option.optionsId
- ) != -1 ||
- this.questionList[bankIndex].ans[ansIndex].indexOf(
- option.optionsId
- ) != -1
- ) {
- return true;
- } else {
- return false;
- }
- } else {
- return false;
- }
- },
- wrong(bankIndex, ansIndex, option) {
- if (
- this.questionList[bankIndex].ques[ansIndex] &&
- this.questionList[bankIndex].ans[ansIndex]
- ) {
- if (
- this.questionList[bankIndex].ques[ansIndex].indexOf(
- option.optionsId
- ) != -1 &&
- this.questionList[bankIndex].ans[ansIndex].indexOf(
- option.optionsId
- ) == -1
- ) {
- return true;
- } else {
- return false;
- }
- } else {
- return false;
- }
- },
- isWrong(item, index) {
- if (this.questionList[index].ques) {
- //单选
- if (item.type == 1) {
- return this.questionList[index].ques != this.questionList[index].ans;
- //多选
- } else if (item.type == 2) {
- //每一项都相等
- return this.questionList[index].ques.some((item, i) => {
- return this.questionList[index].ans.indexOf(item) == -1;
- });
- //判断
- } else if (item.type == 3) {
- return this.questionList[index].ques != this.questionList[index].ans;
- } else {
- return false;
- }
- } else {
- return false;
- }
- },
- isPart(item, index) {
- if (this.questionList[index].ques) {
- if (item.type == 2) {
- let isWrong = this.questionList[index].ques.some((item, i) => {
- return this.questionList[index].ans.indexOf(item) == -1;
- });
- let isRight = this.questionList[index].ans.every((item, i) => {
- return item == this.questionList[index].ques[i];
- });
- if (!isRight && !isWrong) {
- return true;
- }
- }
- } else {
- return false;
- }
- },
- isOver(item, index) {
- if (this.questionList[index].ques) {
- if (item.type == 4) {
- //案例题
- let isOver = item.jsonStr.every((jsonItem, indexs) => {
- if (
- jsonItem.type == 1 ||
- jsonItem.type == 2 ||
- jsonItem.type == 3
- ) {
- if (item.ques[indexs]) {
- return true;
- } else {
- return false;
- }
- } else if (jsonItem.type == 5) {
- if (
- item.ques[indexs] &&
- (item.ques[indexs].text || item.ques[indexs].imageList.length)
- ) {
- console.log("chil");
- return true;
- } else {
- return false;
- }
- }
- });
- if (isOver) {
- return true;
- } else {
- return false;
- }
- } else if (item.type == 5) {
- //简答题
- //每一项都相等
- if (item.ques && (item.ques.imageList.length || item.ques.text)) {
- return true;
- }
- //判断
- } else {
- return false;
- }
- } else {
- return false;
- }
- },
- tabSelect(index, bankindex) {
- this.$set(this.questionList[bankindex], "current", index);
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .photoBox {
- width: 100%;
- // background-color: #ffffff;
- // border-radius: 24px 24px 0px 0px;
- .photoTop {
- width: 100%;
- height: 74rpx;
- border-radius: 20px 20px 0px 0px;
- background-color: #ffffff;
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 0rpx 38rpx;
- .sqzz {
- width: 28rpx;
- height: 28rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .centersq {
- color: #333;
- font-size: 30rpx;
- font-weight: 500;
- }
- }
- .photoCenter {
- width: 750rpx;
- height: 75vh;
- position: relative;
- .center_camera {
- width: 100%;
- height: 75vh;
- // position: fixed;
- .head_take {
- width: 100%;
- height: 75vh;
- display: flex;
- flex-direction: column;
- }
- .headTake_up {
- width: 100%;
- height: 100rpx;
- }
- .headTake_minddle {
- display: flex;
- .min_img {
- width: 500rpx;
- height: 550rpx;
- }
- .min_left, .min_right {
- flex: 1;
- height: 550rpx;
- }
- }
- .headTake_down {
- width: 100%;
- flex: 1;
- }
- .color {
- background-color: #333;
- opacity: 0.5;
- }
- }
- .custom {
- width: 750rpx;
- height: 75vh;
- position: absolute;
- z-index: 1000;
- top: 0;
- left: 0;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- .photoBoxbtns {
- display: flex;
- .takePhoto_btn {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- background-color: #808080;
- padding: 50rpx;
- .middle_btn {
- width: 120rpx;
- height: 120rpx;
- border-radius: 40rpx;
- border: 4rpx solid #FFFFFF;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .square {
- width: 96rpx;
- height: 96rpx;
- background: #FFFFFF;
- border-radius: 28rpx;
- }
- .rights {
- font-size: 32rpx;
- font-weight: 500;
- color: #FFFFFF;
- }
- }
- .btnResult {
- height: 100rpx;
- width: 100%;
- background-color: #07c160;
- text-align: center;
- line-height: 100rpx;
- color: #fff;
- font-size: 32rpx;
- font-weight: bold;
- }
- }
- }
- .navbar {
- position: relative;
- z-index: 20000;
- }
- .questionBank {
- width: 100%;
- height: 100vh;
- display: flex;
- flex-direction: column;
- }
- .swiper {
- width: 100%;
- flex: 1;
- }
- .lisSty {
- margin-bottom: 16rpx;
- display: flex;
- .flex_auto {
- flex: 1;
- }
- }
- .activeTI {
- vertical-align: middle;
- display: inline-block;
- border: 1rpx solid #eee;
- border-radius: 50rpx;
- height: 48rpx;
- line-height: 46rpx;
- text-align: center;
- width: 48rpx;
- margin-right: 15rpx;
- color: #666;
- font-size: 30rpx;
- &.right {
- color: #fff;
- background: #36c75a;
- }
- &.wrong {
- color: #fff;
- background: #ff3b30;
- }
- &.checked, &.user_choose {
- color: #fff;
- background: #007aff;
- }
- }
- .submit_checkbox {
- position: fixed;
- left: 0;
- right: 0;
- bottom: 120rpx;
- margin: 20rpx auto;
- width: 526rpx;
- height: 80rpx;
- background: rgba(0, 122, 255, 1);
- color: #fff;
- text-align: center;
- line-height: 80rpx;
- font-size: 30rpx;
- border-radius: 40rpx;
- &.disabled {
- opacity: 0.6;
- }
- }
- .titles {
- overflow: hidden;
- margin-bottom: 24rpx;
- }
- .titBox {
- padding: 41rpx 25rpx 24rpx 25rpx;
- }
- .titBox_title {
- padding: 21rpx;
- }
- .tabs {
- margin: 10rpx;
- display: flex;
- .tab {
- margin: 0 4rpx;
- padding: 10rpx 13rpx;
- text-align: center;
- color: #007aff;
- font-size: 28rpx;
- border-radius: 16rpx;
- background: #fff;
- &.current {
- color: #fff;
- background: #007aff;
- }
- }
- }
- .ans {
- margin: 8rpx 8rpx 8rpx;
- .ans_input {
- border-radius: 16rpx;
- background: #fff;
- .top {
- border-bottom: 1rpx solid #eeeeee;
- padding: 16rpx;
- display: flex;
- align-items: center;
- .icon {
- margin-right: 20rpx;
- width: 40rpx;
- height: 38rpx;
- }
- .progress {
- flex: 1;
- }
- .submit {
- width: 168rpx;
- height: 48rpx;
- line-height: 48rpx;
- text-align: center;
- color: #fff;
- font-size: 30rpx;
- background: #007aff;
- border-radius: 24rpx;
- &.disabled {
- opacity: 0.6;
- }
- }
- }
- .textarea {
- textarea {
- width: 100%;
- height: 287rpx;
- padding: 10rpx;
- }
- }
- .imgs {
- overflow: hidden;
- display: flex;
- width: 100%;
- .img {
- width: 104rpx;
- height: 104rpx;
- border-radius: 8rpx;
- position: relative;
- margin: 20rpx;
- text {
- position: absolute;
- right: -15rpx;
- top: -15rpx;
- width: 30rpx;
- height: 30rpx;
- text-align: center;
- line-height: 30rpx;
- color: #fff;
- background: #ff3b30;
- border-radius: 50%;
- }
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- }
- .ans_submit {
- padding: 16rpx;
- border-radius: 16rpx;
- background: #fff;
- .imgs {
- overflow: hidden;
- display: flex;
- width: 100%;
- .img {
- width: 104rpx;
- height: 104rpx;
- border-radius: 8rpx;
- position: relative;
- margin: 20rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- }
- }
- .leftLetters {
- display: flex;
- align-items: center;
- width: 220rpx;
- .btnType {
- padding: 5rpx 10rpx;
- border: 1rpx solid #007aff;
- border-radius: 10rpx;
- background-color: rgba(0, 122, 255, 0.1);
- font-size: 28rpx;
- color: #007aff;
- margin-right: 15rpx;
- }
- }
- .firstLetter {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 30rpx;
- }
- .popupView {
- height: 100%;
- padding-bottom: 100rpx;
- .popupTops {
- height: 77rpx;
- border-bottom: 1rpx solid #eee;
- text-align: center;
- line-height: 77rpx;
- font-size: 24rpx;
- color: #999;
- position: relative;
- .topIcon {
- position: absolute;
- top: 10rpx;
- left: 50%;
- transform: translateX(-50%);
- width: 80rpx;
- height: 8rpx;
- background-color: #999;
- border-radius: 4rpx;
- }
- }
- .popupContent {
- }
- }
- .pageContent {
- position: relative;
- background-color: #eaeef1;
- height: 100%;
- padding-top: 8rpx;
- padding-bottom: 100rpx;
- overflow-y: scroll;
- }
- .pad_8 {
- background-color: #fff;
- margin: 0rpx 8rpx 8rpx;
- border-radius: 16rpx;
- &.no-margin {
- margin-top: -16rpx;
- border-radius: 0 0 16rpx 16rpx;
- }
- }
- .answer {
- height: 80rpx;
- line-height: 80rpx;
- padding: 0rpx 24rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- color: #666;
- font-size: 30rpx;
- }
- .footer_btn {
- background-color: #fff;
- z-index: 10078;
- position: fixed;
- bottom: 0rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- width: 100%;
- height: 98rpx;
- padding: 0rpx 38rpx;
- border-top: 1rpx solid #eee;
- .flex_center {
- flex: 1;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- margin: 0 200rpx;
- font-size: 24rpx;
- color: #999999;
- .up-icon {
- margin-bottom: 18rpx;
- width: 100%;
- display: flex;
- justify-content: center;
- image {
- width: 58rpx;
- height: 21rpx;
- }
- }
- }
- .collect {
- visibility: hidden;
- width: 100rpx;
- &.show {
- visibility: visible;
- }
- > view {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- image {
- width: 32rpx;
- height: 32rpx;
- margin-bottom: 6rpx;
- }
- view {
- font-size: 24rpx;
- color: #999999;
- }
- }
- }
- }
- .boxSty {
- padding: 44rpx 41rpx 0rpx;
- }
- .liListSty {
- border: 1rpx solid #eeeeee;
- width: 88rpx;
- height: 88rpx;
- border-radius: 32rpx;
- text-align: center;
- line-height: 88rpx;
- color: #333;
- font-size: 32rpx;
- float: left;
- margin: 20rpx 23rpx;
- &.isRight {
- border: 1rpx solid #eeeeee;
- color: #fff;
- background: #36c75a;
- }
- &.isWrong {
- border: 1rpx solid #eeeeee;
- color: #fff;
- background: #ff3b30;
- }
- &.isPart {
- border: 1rpx solid #eeeeee;
- color: #fff;
- background: #FFC53D;
- }
- &.isOver {
- border: 1rpx solid #eeeeee;
- color: #fff;
- background: blue;
- }
- &.check_ans {
- border: 1rpx solid #eeeeee;
- color: #fff;
- background: #007aff;
- }
- }
- .answerInfos {
- padding: 25rpx 25rpx 25rpx 23rpx;
- }
- .answerTitle {
- margin-bottom: 28rpx;
- color: #666;
- font-size: 30rpx;
- }
- .answerContent {
- font-size: 30rpx;
- color: #666;
- }
- .textChild {
- display: inline-block;
- vertical-align: middle;
- }
- .dialog {
- position: fixed;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- background-color: rgba(0, 0, 0, 0.8);
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- z-index: 20000;
- .text {
- font-size: 32rpx;
- color: #ffffff;
- text-align: center;
- }
- .btn {
- width: 242rpx;
- height: 82rpx;
- border: 2rpx solid #ffffff;
- border-radius: 16rpx;
- text-align: center;
- line-height: 82rpx;
- margin: 41rpx auto;
- color: #fff;
- font-size: 32rpx;
- }
- }
- .dialog-arrow {
- padding-top: 124rpx;
- position: fixed;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- background-color: rgba(0, 0, 0, 0.8);
- z-index: 20000;
- .pointer {
- margin-left: 87rpx;
- display: block;
- width: 95rpx;
- height: 98rpx;
- }
- .text {
- padding-left: 177rpx;
- font-size: 32rpx;
- color: #ffffff;
- }
- .btn {
- width: 242rpx;
- height: 82rpx;
- border: 2rpx solid #ffffff;
- border-radius: 16rpx;
- text-align: center;
- line-height: 82rpx;
- margin: 500rpx auto 0;
- color: #fff;
- font-size: 32rpx;
- }
- }
- .dialog_wrap {
- position: fixed;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- z-index: 9999999999;
- .bg {
- background: rgba(0, 0, 0, 0.3);
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- }
- .dialog {
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate3D(-50%, -50%, 0);
- width: 640rpx;
- height: 439rpx;
- background: #ffffff;
- border-radius: 24rpx;
- .title {
- font-size: 30rpx;
- font-weight: bold;
- color: #333333;
- line-height: 48rpx;
- text-align: center;
- margin-top: 40rpx;
- }
- .content {
- margin: 35rpx 35rpx 0;
- font-size: 30rpx;
- color: #666666;
- line-height: 48rpx;
- }
- .btns {
- margin-top: 35rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- .btn {
- width: 200rpx;
- height: 80rpx;
- line-height: 80rpx;
- text-align: center;
- background: #f5f5f5;
- border-radius: 40rpx;
- font-size: 30rpx;
- color: rgba(0, 122, 255, 1);
- background: #f5f5f5;
- margin: 0 20rpx;
- &.active {
- color: #f5f5f5;
- background: rgba(0, 122, 255, 1);
- }
- }
- }
- }
- }
- .popboxs {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .classTops {
- flex-shrink: 0;
- padding: 39rpx 0rpx 4rpx;
- font-weight: bold;
- color: #333;
- font-size: 30rpx;
- }
- .textStys {
- width: 100%;
- flex: 1;
- padding: 36rpx;
- }
- .classFootsty {
- flex-shrink: 0;
- display: flex;
- align-items: center;
- justify-content: center;
- padding: 10rpx 0rpx 40rpx;
- .btnsty {
- width: 200rpx;
- height: 80rpx;
- border-radius: 40rpx;
- font-weight: bold;
- font-size: 30rpx;
- text-align: center;
- line-height: 80rpx;
- }
- .btns1 {
- background-color: #f5f5f5;
- color: #007aff;
- }
- .btns2 {
- margin-left: 40rpx;
- background-color: #007aff;
- color: #ffffff;
- }
- }
- </style>
|