Compare commits

..

No commits in common. "67d2215c9312588ce42204a05e57fb596e0bb39a" and "d4e1dc0fd32fe109a27053b99f363f8448224700" have entirely different histories.

2 changed files with 26 additions and 31 deletions

View File

@ -20,12 +20,12 @@
<view class="dot"></view> <view class="dot"></view>
<u-count-down :time="5 * 1000" format="ss" ref="countDown" v-if="isAnimate"></u-count-down> <u-count-down :time="5 * 1000" format="ss" ref="countDown" v-if="isAnimate"></u-count-down>
</view> </view>
<view style="width:400rpx;"> <view style="width:284rpx;">
<u-button <u-button
:text="tips" text="⚪长按录制"
shape="circle" shape="circle"
color="#76C458" color="#76C458"
@click="startRecord" @longpress="startRecord"
@touchend="stopRecord" @touchend="stopRecord"
></u-button> ></u-button>
<view style="margin-top: 20rpx;"> <view style="margin-top: 20rpx;">
@ -41,52 +41,47 @@ export default {
data() { data() {
return { return {
isAnimate: false, isAnimate: false,
tempVideoPath: "", tempVideoPath: ""
tips: "⚪录制"
}; };
}, },
onLoad() { onLoad() {
this.ctx = uni.createCameraContext(); this.ctx = uni.createCameraContext();
this.tips = "⚪录制";
}, },
methods: { methods: {
startRecord() { startRecord() {
this.ctx.startRecord({ this.ctx.startRecord({
success: res => { success: res => {
this.isAnimate = true; this.isAnimate = true;
this.tips = "⚪录制中";
setTimeout(() => { setTimeout(() => {
this.ctx.stopRecord({ this.ctx.stopRecord({
success: res => { success: res => {
console.log("自动停止录像", res); console.log("自动停止录像", res);
this.isAnimate = false;
this.$common.msgToast("录制完成");
this.tempVideoPath = res.tempVideoPath; this.tempVideoPath = res.tempVideoPath;
this.tips = "⚪录制完成"; this.isAnimate = false;
} }
}); });
}, 5000); }, 5000);
} }
}); });
}, },
// stopRecord() { stopRecord() {
// // //
// this.ctx.stopRecord({ this.ctx.stopRecord({
// success: res => { success: res => {
// console.log("", res); console.log("手动停止录像", res);
// this.tempVideoPath = res.tempVideoPath; this.tempVideoPath = res.tempVideoPath;
// this.isAnimate = false; this.isAnimate = false;
// }, },
// fail: function(error) { fail: function(error) {
// console.log(error); console.log(error);
// this.isAnimate = false; this.isAnimate = false;
// uni.showModal({ uni.showModal({
// content: "", content: "停止录像失败",
// showCancel: false showCancel: false
// }); });
// } }
// }); });
// }, },
back() { back() {
uni.navigateTo({ uni.navigateTo({
url: url:

View File

@ -108,8 +108,8 @@ export default {
this.video = await this.uploadFilePromise(options.tempVideoPath) this.video = await this.uploadFilePromise(options.tempVideoPath)
console.log('this.video', this.video) console.log('this.video', this.video)
const data = { const data = {
num: uni.getStorageSync("info").num || '', num: uni.getStorageSync("info").name || '',
name: uni.getStorageSync("info").name || '', name: uni.getStorageSync("info").num || '',
fileList: uni.getStorageSync("info").fileList || [], fileList: uni.getStorageSync("info").fileList || [],
fileList2: uni.getStorageSync("info").fileList2, fileList2: uni.getStorageSync("info").fileList2,
video: this.video video: this.video
@ -138,10 +138,10 @@ export default {
fileList: this.fileList, fileList: this.fileList,
fileList2: this.fileList2 fileList2: this.fileList2
} }
uni.setStorageSync("info", data)
uni.navigateTo({ uni.navigateTo({
url: '/pages/cameraContext/cameraContext' url: '/pages/cameraContext/cameraContext'
}); });
uni.setStorageSync("info", data)
}, },
async completeRegistration() { async completeRegistration() {
console.log({ console.log({