cream层级比较高所以给cover-image加了z-index
<view class="creamBox">
<view class="noless"></view>
<view v-if="faceSrc != ''" class="viewImage">
<image :src="faceSrc" mode="aspectFill"></image>
</view>
<view v-else class="paizhao">
<camera
:binderror="handleCameraError"
:device-position="devicePosition"
flash="off"
class="xiangji"
>
<cover-image
src="/pagesLogin/static/cream-line.png"
style="width: 100%; height: 90%; margin-top: 20px; z-index: 998"
></cover-image>
</camera>
</view>
</view>
//自定义拍照
takePhoto(e: any) {
this.faceSrc = "";
const ctx = uni.createCameraContext();
ctx.takePhoto({
quality: "high",
success: (res) => {
this.faceSrc = res.tempImagePath;
this.uploadFace(this.faceSrc);
},
});
}