Commit 14b78db9 authored by lvtz's avatar lvtz

微官网首页

parents cd9033c3 ceaeef90
......@@ -49,6 +49,10 @@ Component({
showAuthSettingDia: false
},
pageLifetimes: {
// show () {
// console.log(this.data.role, 'role')
// console.log(this.data.sid, 'role')
// },
hide() {
// 如果在录制中停止录制
if (this.data.audioStatus.play == 'play') {
......@@ -57,6 +61,7 @@ Component({
}
},
created () {
},
attached () {
},
......@@ -70,8 +75,8 @@ Component({
recorderManager.onStop((res) => {
const that = this;
const { tempFilePath } = res;
const fileType = tempFilePath.substr(tempFilePath.lastIndexOf('.') + 1);
if (!this.data.audioStatus.upload) {
return;
}
let filename = '';
......@@ -79,21 +84,23 @@ Component({
let mediaAccess;
if (that.data.role == '2c') {
mediaAccess = cMediaOssAccess({
type: 2
type: 2,
school_id:this.data.sid,
ext: fileType
})
} if (that.data.role == '2b') {
mediaAccess = bMediaOssAccess({
type: 2,
school_id:this.data.sid
school_id:this.data.sid,
ext: fileType
})
}
mediaAccess.then((acc) => {
let access = acc.data;
filename = `${access.dir}${getRandomFilename(tempFilePath)}`;
return wxUploadFile({
url: access.host,
formData: {
key: filename,
key: access.path,
policy: access.policy,
OSSAccessKeyId: access.accessid,
signature: access.signature,
......
This diff is collapsed.
......@@ -177,17 +177,19 @@
<!-- 打卡出问题,去客服消息跳 H5 -->
<!-- <view class="red-text" wx:if="{{pagefrom!='morethemeindex'}}">一个作业只能打卡一次喔!</view> -->
<sound-recording
show="{{audioStatus.show}}"
bind:addVoice="addVoice"
bind:pushVoice="pushVoice"
bind:beforevoiceupload="beforevoiceupload"
bind:voiceuploadsuccess="voiceuploadsuccess"
bind:voiceuploadfail="voiceuploadfail"
role="{{recordRole}}"
>
</sound-recording>
<view class="" wx:if="{{sid != 0}}">
<sound-recording
show="{{audioStatus.show}}"
bind:addVoice="addVoice"
bind:pushVoice="pushVoice"
bind:beforevoiceupload="beforevoiceupload"
bind:voiceuploadsuccess="voiceuploadsuccess"
bind:voiceuploadfail="voiceuploadfail"
role="{{recordRole}}"
sid="{{sid}}"
>
</sound-recording>
</view>
<view class="getmobiledialog common-dialog" wx:if="{{getmobiledialogshow}}">
<view class="dialog-box">
<view class="warn-text-a">请授权微信手机号,方便加入课程微信群</view>
......
......@@ -297,6 +297,12 @@ page {
/* .clock-editor-box .clock-video-box .media-box-video-item{
width: 100%;
} */
.clock-editor-box .clock-video-box .videostatus {
font-size: 12px;
white-space: nowrap;
line-height: 44rpx;
overflow: hidden;
}
.clock-editor-box .clock-video-box .videostatus.fail {
background-color: #64d3be;
color: #fff;
......@@ -306,6 +312,7 @@ page {
height: 40rpx;
bottom: 0;
z-index: 50;
font-size: 12px;
}
@keyframes progressani {
0% {
......@@ -337,6 +344,7 @@ page {
width: 100%;
text-align: center;
color: #fff;
font-size: 12px;
}
.clock-editor-box
.clock-video-box
......@@ -374,6 +382,7 @@ page {
transparent
);
-webkit-background-size: 40px 40px;
font-size: 24rpx;
background-size: 40px 40px;
float: left;
height: 100%;
......
......@@ -147,23 +147,24 @@ Page({
ext: fileType
})
}).then((data) => {
const acc = data.data;
// filename = `${access.dir}${getRandomFilename(tempFiles[0].path)}`;
filename = acc.path;
console.log(filename, 'filename ');
return wxUploadFile({
url: acc.host,
formData: {
key: filename,
policy: acc.policy,
OSSAccessKeyId: acc.accessid,
signature: acc.signature,
callback: acc.callback,
success_action_status: '200'
},
filePath: tempFiles[0].path,
name: 'file',
})
if (data.code == 200) {
const acc = data.data;
// filename = `${access.dir}${getRandomFilename(tempFiles[0].path)}`;
filename = acc.path;
return wxUploadFile({
url: acc.host,
formData: {
key: filename,
policy: acc.policy,
OSSAccessKeyId: acc.accessid,
signature: acc.signature,
callback: acc.callback,
success_action_status: '200'
},
filePath: tempFiles[0].path,
name: 'file',
})
}
}).then((res) => {
const {data} = res;
console.log(data, 'data')
......
......@@ -156,6 +156,7 @@ function wxChooseImage (data) {
resolve(res);
},
fail (err) {
console.log('wxChooseVideo错误');
reject(err);
}
})
......@@ -199,6 +200,7 @@ function wxChooseVideo(data) {
resolve(res);
},
fail (e) {
console.log('wxChooseVideo错误');
reject(e);
}
})
......@@ -215,6 +217,7 @@ function wxChooseMessageFile(data) {
resolve(res);
},
fail (e) {
console.log('wxChooseMessageFile错误');
reject(e);
}
})
......@@ -233,6 +236,19 @@ function wxGetImageInfo ({src}) {
})
})
}
function wxGetVideoInfo ({src}) {
return new Promise((resolve, reject) => {
wx.getVideoInfo({
src,
success (res) {
resolve(res)
},
fail (e) {
reject(e)
}
})
})
}
function wxSaveImageToPhotosAlbum ({filePath}) {
return new Promise((resolve, reject) => {
wx.saveImageToPhotosAlbum({
......@@ -335,5 +351,6 @@ export {
wxGetUserInfo,
wxCheckSession,
wxOpenSetting,
wxChooseMessageFile
wxChooseMessageFile,
wxGetVideoInfo
}
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