Commit 14b78db9 authored by lvtz's avatar lvtz

微官网首页

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