Commit 98f77daf authored by zhoucong's avatar zhoucong

优化vlog 流程

parent f881bb72
...@@ -34,7 +34,21 @@ ...@@ -34,7 +34,21 @@
}, },
onReady() {}, onReady() {},
onLoad() { onLoad() {
this.getMyVlogList() this.$request("distribution/vlog/getVlogCreateInfo", {//获取结果
userId: uni.getStorageSync("openid")
}).then(res=>{
if(res.code==="00"){
setTimeout(()=>{
this.getMyVlogList()
},1000)
}else{
uni.showModal({
title: '提示',
content: '视频合成失败,需要在打卡点重新获取素材',
showCancel:false
});
}
})
}, },
methods: { methods: {
navTo(item){ navTo(item){
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<view>不遮挡面部</view> <view>不遮挡面部</view>
</view> </view>
</view> </view>
<u-button v-if="buttonShow" type="success" size="medium" @click="takePhoto">开始识别</u-button> <!-- <u-button type="success" size="medium" @click="takePhoto">开始识别</u-button> -->
</view> </view>
</template> </template>
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
text: 3, //倒计时 text: 3, //倒计时
show: false, //摄像头倒计时文本 show: false, //摄像头倒计时文本
base64: "", //照片base64 base64: "", //照片base64
buttonShow: false
} }
}, },
onLoad() { //代替 vue 里面的 created onLoad() { //代替 vue 里面的 created
...@@ -64,38 +63,29 @@ ...@@ -64,38 +63,29 @@
enableImgBeauty: true //默认填true enableImgBeauty: true //默认填true
} }
this.$request("distribution/vlog/createVlog",data).then(res => {//创建任务 this.$request("distribution/vlog/createVlog",data).then(res => {//创建任务
uni.showLoading({
title: '人脸识别中'
});
if (res.code === "00") { if (res.code === "00") {
setTimeout(() => { var that=this
this.$request("distribution/vlog/getVlogCreateInfo", {//获取结果 uni.showModal({
userId: uni.getStorageSync("openid") title: '提示',
}).then(res => { content: '视频合成中,请在1~2分钟后在我的VLOG视频集中查看',
if (res.code === "00") { showCancel:false,
uni.showToast({ success(res) {
title: '识别成功', if (res.confirm) {
duration: 1500 that.$u.route("pages/vlog/vlogIndex/vlogIndex")
});
this.$u.route("pages/vlog/myVlog/myVlog")
} else {
uni.showModal({
title: '提示',
content: '识别失败,请重新扫脸',
showCancel:false
});
this.buttonShow = true
} }
}) }
}, 8000) });
}else{ }else{
uni.hideLoading()
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '打卡点未录取足够的素材', content: '请先在打卡点录制素材',
showCancel:false showCancel:false,
success(res) {
if (res.confirm) {
that.$u.route("pages/vlog/vlogIndex/vlogIndex")
}
}
}); });
this.buttonShow = true
} }
}) })
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment