Files
juzi/taobao/pages/camera/camera.axml
T
xsl 9eec4369da feat(taobao): add native mini program with shared backend
Preserve H5 flows while adding Taobao identity, native capture, reports and isolated local development. Fix canceled province selection and expired-session logout. Record passing local regressions, two pre-existing H5 assertion failures and pending platform validation.
2026-10-19 20:14:31 +08:00

78 lines
4.2 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- ═════ 05-07 拍照页 ═════
覆盖在 camera 原生组件上的一切必须用 cover-view / cover-image -->
<view class="cam">
<view a:if="{{debugMode && !cameraEnabled}}" class="debug-banner">相机验收 · 免登录 · 照片只在本页处理,不上传</view>
<view a:if="{{debugComplete}}" class="debug-results">
<view class="debug-title">三步拍摄与 JPEG 压缩已完成</view>
<view>请核对实际照片方向是否为正脸、右脸、左脸;本页不判断姿态是否合格。</view>
<view class="debug-result" a:for="{{debugPhotos}}" a:key="key">
<image src="{{item.photo}}" mode="aspectFit" />
<view>{{item.title}} · JPEG {{item.width}}×{{item.height}} · 约{{item.kilobytes}}KB</view>
</view>
<button class="btn-primary" onTap="onDebugRestart">重新验收</button>
<button onTap="onCancel">退出并清空本页照片</button>
</view>
<view a:if="{{!cameraEnabled && !debugComplete}}" class="camera-permission">
<view>{{stepText}} · {{stepTip}}</view>
<view>{{permissionMessage}}</view>
<button class="btn-primary" onTap="onEnableCamera">开启相机</button>
<button onTap="onOpenSettings">授权设置</button>
<button onTap="onSystemCamera">使用系统相机</button>
<button onTap="onAlbum">从相册选择</button>
<view a:if="{{previewUrl}}">
<image src="{{previewUrl}}" mode="aspectFit" style="width:100%;height:400rpx;" />
<button onTap="onRetake">重新选择</button><button class="btn-primary" onTap="onConfirm">使用照片</button>
</view>
<view a:if="{{analyzing}}">{{debugMode ? '正在验证本地图片压缩…' : '正在生成您的肌肤报告…'}}</view>
</view>
<camera a:if="{{cameraEnabled}}" id="skin-camera" class="cam-device" device-position="{{devicePosition}}"
flash="off" onError="onCameraError" onStop="onCameraStop">
<!-- 顶部步骤文案 -->
<cover-view class="cam-step">
<cover-view a:if="{{debugMode}}">开发调试 · 不上传照片</cover-view>
<cover-view class="cam-step-no">{{stepText}}</cover-view>
<cover-view class="cam-step-tip">{{stepTip}}</cover-view>
</cover-view>
<!-- 取景蒙版:人脸轮廓(骨架版用椭圆线框,朝向提示随步切换;精确轮廓 TODO:换 cover-image 轮廓图) -->
<cover-view class="cam-mask">
<cover-view class="cam-oval mask-{{maskStep}}"></cover-view>
</cover-view>
<!-- 底部引导要点 -->
<cover-view class="cam-guide">
<cover-view class="cam-guide-item" a:for="{{guides}}" a:key="*this">{{item}}</cover-view>
</cover-view>
<!-- 控制条:相册 / 快门 / 翻转 -->
<cover-view class="cam-controls">
<cover-view class="cam-side" onTap="onAlbum">相册</cover-view>
<cover-view class="cam-shutter" onTap="onShutter">
<cover-view class="cam-shutter-dot"></cover-view>
</cover-view>
<cover-view class="cam-side" onTap="onFlip">翻转</cover-view>
</cover-view>
<!-- 本步完成停顿卡 -->
<cover-view class="cam-done" a:if="{{doneTip}}">{{doneTip}}</cover-view>
<!-- 拍后预览:确认使用 / 重拍 -->
<cover-view class="cam-preview" a:if="{{previewUrl}}" catchTap="noop">
<cover-image class="cam-preview-img" src="{{previewUrl}}"></cover-image>
<cover-view class="cam-preview-btns">
<cover-view class="cam-preview-btn" onTap="onRetake">重拍</cover-view>
<cover-view class="cam-preview-btn ok" onTap="onConfirm">使用照片</cover-view>
</cover-view>
</cover-view>
<!-- 分析中 -->
<cover-view class="cam-analyzing" a:if="{{analyzing}}">
<cover-view class="cam-analyzing-text">{{debugMode ? '正在验证本地图片压缩…' : '正在生成您的肌肤报告…'}}</cover-view>
<cover-view class="cam-cancel" onTap="onCancel">{{debugMode ? '退出验收' : '返回,稍后查看历史报告'}}</cover-view>
</cover-view>
</camera>
<!-- 压缩降级用的隐藏画布(canvas 重绘压缩,不可见) -->
<canvas id="compress-canvas" class="compress-canvas" width="{{compressWidth}}" height="{{compressHeight}}" style="width:{{compressWidth}}px;height:{{compressHeight}}px;" />
</view>