|
@@ -512,12 +512,16 @@
|
|
|
<view class="sqzz"></view>
|
|
|
</view>
|
|
|
<view class="photoCenter">
|
|
|
- <view style="width: 100%; height: 979rpx;position: fixed;" v-if="photoPopup">
|
|
|
+ <view style="width: 100%; height: 979rpx;position: fixed;" v-if="photoPopup && isTaking">
|
|
|
<camera device-position="front" flash="off" @error="error" style="width: 100%; height: 100%;" ></camera>
|
|
|
</view>
|
|
|
- <view class="custom"><image src="/static/zhezhao.png" mode=""></image></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 class="btnResult" v-if="!isTaking" @click="reTake">重拍</view>
|
|
|
+ <view class="btnResult" v-if="!isTaking" @click="submitPhoto">确认</view>
|
|
|
</view>
|
|
|
- <view class="btnResult" @click="takePhoto">拍照</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
@@ -565,6 +569,7 @@ export default {
|
|
|
ossAvatarUrl: '',
|
|
|
goodsDetail:{},
|
|
|
isTakePhoto:false,
|
|
|
+ isTaking:true, //是否正在拍照
|
|
|
needPhoto:false //是否需要拍照
|
|
|
};
|
|
|
},
|
|
@@ -601,6 +606,8 @@ export default {
|
|
|
//需要拍没拍过直接弹出摄像头
|
|
|
if(this.needPhoto && !this.isTakePhoto) {
|
|
|
this.photoPopup = true;
|
|
|
+ this.isTaking = true;
|
|
|
+ this.avatarUrl = ''
|
|
|
} else { //不需要拍照
|
|
|
if(this.lastTime) {
|
|
|
this.timer = setInterval(() => {
|
|
@@ -668,6 +675,9 @@ export default {
|
|
|
});
|
|
|
})
|
|
|
},
|
|
|
+ reTake() {
|
|
|
+ this.isTaking = true;
|
|
|
+ },
|
|
|
postStudyRecord() {
|
|
|
let self = this
|
|
|
let data = {
|
|
@@ -806,6 +816,7 @@ export default {
|
|
|
async submitPhoto() {
|
|
|
const waitYS = await this.imageInfos();
|
|
|
this.postStudyRecord(); //提交记录
|
|
|
+ this.photoPopup = false;
|
|
|
},
|
|
|
//确认拍照
|
|
|
takePhoto() {
|
|
@@ -816,9 +827,10 @@ export default {
|
|
|
success: res => {
|
|
|
console.log(res.tempImagePath);
|
|
|
self.avatarUrl = res.tempImagePath;
|
|
|
- self.submitPhoto();
|
|
|
+ // self.submitPhoto();
|
|
|
+ this.isTaking = false;
|
|
|
|
|
|
- self.photoPopup = false;
|
|
|
+ // self.photoPopup = false;
|
|
|
},
|
|
|
fail: err => {
|
|
|
console.log(err);
|
|
@@ -1386,6 +1398,7 @@ export default {
|
|
|
|
|
|
if(self.needPhoto){
|
|
|
self.photoPopup = true; //拍照
|
|
|
+ this.isTaking = true;
|
|
|
} else {
|
|
|
if(this.lastTime) {
|
|
|
this.timer = setInterval(() => {
|
|
@@ -2078,16 +2091,23 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .btnResult {
|
|
|
- height: 100rpx;
|
|
|
- width: 100%;
|
|
|
- background-color: #07c160;
|
|
|
- text-align: center;
|
|
|
- line-height: 100upx;
|
|
|
- color: #fff;
|
|
|
- font-size: 32upx;
|
|
|
- font-weight: bold;
|
|
|
+
|
|
|
+ .photoBoxbtns {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+
|
|
|
+ .btnResult {
|
|
|
+ height: 100rpx;
|
|
|
+ width: 100%;
|
|
|
+ background-color: #07c160;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 100upx;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 32upx;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
.navbar {
|