|
@@ -4,6 +4,9 @@ import {
|
|
|
import {
|
|
|
store
|
|
|
} from '~/store/index'
|
|
|
+import {
|
|
|
+ publishWorks
|
|
|
+} from '~/api/works'
|
|
|
Component({
|
|
|
behaviors: [storeBindingsBehavior],
|
|
|
storeBindings: {
|
|
@@ -52,6 +55,9 @@ Component({
|
|
|
uid: wx.getStorageSync('uid')
|
|
|
},
|
|
|
success: (res) => {
|
|
|
+ const formateRes = JSON.parse(res.data);
|
|
|
+ let audioPath = formateRes.data;
|
|
|
+ this.shareWorks(audioPath);
|
|
|
this.setData({
|
|
|
uploadSuccess: true,
|
|
|
})
|
|
@@ -73,5 +79,22 @@ Component({
|
|
|
uploadSuccess: false
|
|
|
})
|
|
|
},
|
|
|
+ async shareWorks(audio) {
|
|
|
+ const data = {
|
|
|
+ "lessonId": this.data.id,
|
|
|
+ "originVideo": this.data.videoUrl,
|
|
|
+ "audioPath": audio,
|
|
|
+ "title": this.data.title,
|
|
|
+ "iconImg": this.data.img,
|
|
|
+ "summary": this.data.summary,
|
|
|
+ "productId": this.data.productId,
|
|
|
+ "grade": this.data.grade,
|
|
|
+ "exampleId": this.data.exampleId,
|
|
|
+ "coverImg": this.data.coverImg,
|
|
|
+ "shareImg": this.data.shareImg
|
|
|
+ };
|
|
|
+ let res = await publishWorks(data)
|
|
|
+ console.log(data, res, '嘎嘎嘎嘎');
|
|
|
+ },
|
|
|
}
|
|
|
})
|