小程序拍题:接整页点选链路(detect→点框→prepare 逐条勾→import),换相机图标
This commit is contained in:
@@ -4,25 +4,42 @@
|
||||
<view class="chip mode" bindtap="onToggleMode">{{mode === "photo" ? "改成手输" : "改成拍一张"}}</view>
|
||||
</view>
|
||||
|
||||
<!-- ① 拍一张 -->
|
||||
<!-- ① 拍一张 → 切块 → 点选 -->
|
||||
<block wx:if="{{mode === 'photo'}}">
|
||||
<view class="shot {{subject === 'chinese' ? 'chn' : 'math'}}" bindtap="onPick">
|
||||
<block wx:if="{{images.length}}">
|
||||
<image class="thumb" src="{{images[0]}}" mode="aspectFill" />
|
||||
<view class="shot-n">已选 {{images.length}} 张,点一下重拍</view>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<view class="plus">+</view>
|
||||
<view class="shot-t">整页拍一张</view>
|
||||
<view class="shot-s">卷子放平、光打亮,一次拍半页(5–8 道)最准</view>
|
||||
</block>
|
||||
<view wx:if="{{!photo}}" class="shot {{subject === 'chinese' ? 'chn' : 'math'}}" bindtap="onPick">
|
||||
<view class="plus">+</view>
|
||||
<view class="shot-t">整页拍一张</view>
|
||||
<view class="shot-s">卷子放平、光打亮,一次拍半页(5–8 道)最准</view>
|
||||
</view>
|
||||
|
||||
<button class="btn" bindtap="onCut" disabled="{{cutting}}">
|
||||
{{cutting ? "识别中…" : "识别这一页"}}
|
||||
</button>
|
||||
<block wx:else>
|
||||
<view class="stage">
|
||||
<image class="page" src="{{photo}}" mode="widthFix" />
|
||||
<view class="overlay">
|
||||
<view
|
||||
wx:for="{{blocks}}"
|
||||
wx:key="i"
|
||||
class="blk {{item.on ? 'on' : ''}}"
|
||||
style="left:{{item.px}}%; top:{{item.py}}%; width:{{item.pw}}%; height:{{item.ph}}%"
|
||||
data-i="{{item.i}}"
|
||||
catchtap="toggleBlock"
|
||||
>
|
||||
<view class="blk-n">{{item.i + 1}}<text wx:if="{{item.n > 1}}" class="blk-more">×{{item.n}}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="cutinfo" wx:if="{{cutInfo}}">{{cutInfo}}</view>
|
||||
<view class="cutinfo" wx:if="{{cutInfo}}">{{cutInfo}}</view>
|
||||
|
||||
<view class="row2" wx:if="{{blocks.length}}">
|
||||
<button class="btn plain half" bindtap="onRetake" disabled="{{importing}}">重拍</button>
|
||||
<button class="btn half" bindtap="onImport" disabled="{{detecting || importing || !pickedBlocks}}">
|
||||
{{importing ? "入库中…" : (pickedBlocks ? "入库选中的 " + pickedQty + " 道" : "先点选做错的")}}
|
||||
</button>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<view class="muted small" wx:if="{{photo}}" style="margin-top:8px">看不清就点「重拍」;切多切少无所谓,最后是你在图上点。</view>
|
||||
</block>
|
||||
|
||||
<!-- ② 手输一道 -->
|
||||
@@ -57,23 +74,30 @@
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- ③ 切出来的题:勾选 -->
|
||||
<view class="card" style="margin-top:18px" wx:if="{{questions.length}}">
|
||||
<view class="card-title">切出 {{questions.length}} 道,把做错的勾上</view>
|
||||
<view class="muted" style="margin-bottom:6px">默认全选,你只需要取消勾选「做对了」的。</view>
|
||||
<view class="q" wx:for="{{questions}}" wx:key="id" data-i="{{index}}" bindtap="toggleQ">
|
||||
<view class="box {{item.checked ? 'on' : ''}}">{{item.checked ? "✓" : ""}}</view>
|
||||
<!-- ③ 一块多道:逐条勾选 -->
|
||||
<view class="card" style="margin-top:16px" wx:if="{{pickOpen}}">
|
||||
<view class="card-title">这块里有几道?</view>
|
||||
<view class="muted" style="margin-bottom:8px">口算卡一块十几道,切题时会把没做错的也一起切进来。取消不要的那几道再入库。</view>
|
||||
|
||||
<view class="q" wx:for="{{pickItems}}" wx:key="k" data-k="{{index}}" bindtap="togglePick">
|
||||
<view class="box {{item.on ? 'on' : ''}}">{{item.on ? "✓" : ""}}</view>
|
||||
<view class="qmain">
|
||||
<view class="qstem">{{item.stem}}</view>
|
||||
<view class="qstem {{item.on ? '' : 'off'}}">{{item.stem}}</view>
|
||||
<view class="muted small">{{item.tag}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<button class="btn" style="margin-top:14px" bindtap="onImport" disabled="{{importing}}">
|
||||
{{importing ? "入库中…" : "加入错题本"}}
|
||||
|
||||
<view class="row2" style="margin-top:12px">
|
||||
<button class="btn plain half" bindtap="onPickNone">全不勾</button>
|
||||
<button class="btn plain half" bindtap="onPickAll">全勾</button>
|
||||
</view>
|
||||
<button class="btn" style="margin-top:10px" bindtap="confirmPick" disabled="{{importing}}">
|
||||
{{importing ? "入库中…" : "入库勾上的"}}
|
||||
</button>
|
||||
<view class="muted small" style="margin-top:6px" bindtap="closePick">先不入库,回去重新点</view>
|
||||
</view>
|
||||
|
||||
<!-- ④ 题单预览:排完就地显示今天的量 -->
|
||||
<!-- ④ 题单预览 -->
|
||||
<view class="card queue" wx:if="{{queue.n > 0}}">
|
||||
<view class="card-title">今天的题单</view>
|
||||
<view class="qbig">
|
||||
@@ -86,7 +110,6 @@
|
||||
</view>
|
||||
|
||||
<view class="note">
|
||||
{{mode === "photo" ? "识别用的是本机的 Windows 中文 OCR(不联网、不上传第三方)。算式的答案会自己算出来;应用题、看拼音写词这类没有标准答案的,标成「你自己判」。" : "手输适合几种情况:卷子已经扔了、老师口头报的题、错题想马上记一道。题干抄关键词就行,不用一字不差。"}}
|
||||
{{mode === "photo" ? "拍一整页,系统先切成块;你在图上点哪几道做错了,只把点中的裁出来单独识别。算式的答案会自己算出来;应用题、看拼音写词这类没有标准答案的,标成「你自己判」。" : "手输适合几种情况:卷子已经扔了、老师口头报的题、错题想马上记一道。题干抄关键词就行,不用一字不差。"}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user