add.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  1. <template>
  2. <div class="lenrn_content" style="margin: 20px 0 30px !important">
  3. <el-container>
  4. <el-container>
  5. <el-container>
  6. <el-header>
  7. <el-steps align-center :active="active" style="padding-top: 20px" finish-status="success">
  8. <el-step title="完善企业信息"></el-step>
  9. <el-step title="添加解决方案"></el-step>
  10. <el-step title="缴纳保证金"></el-step>
  11. <el-step title="提交审核"></el-step>
  12. </el-steps>
  13. <el-divider></el-divider>
  14. </el-header>
  15. <el-main>
  16. <el-form v-if="active==1" style="margin-top: 60px" ref="form" label-width="80px">
  17. <el-form-item label="LOGO">
  18. <div class="common-upload">
  19. <el-upload
  20. class="avatar-uploader"
  21. action="/upload_image"
  22. :show-file-list="false"
  23. :on-success="(response, file, fileList)=> upload_img_success(response, file, fileList,1)">
  24. <img v-if="saleInfo.img_icon" :src="saleInfo.img_icon" class="avatar">
  25. <i v-else class="el-icon-plus avatar-uploader-icon" style="border-radius: 6px;border: 1px dashed #d9d9d9;height: 178px;line-height: 178px;width: 178px"></i>
  26. </el-upload>
  27. </div>
  28. </el-form-item>
  29. <el-form-item label="课程名称">
  30. <el-input show-word-limit maxlength="15" v-model="saleInfo.title"></el-input>
  31. </el-form-item>
  32. <el-form-item label="副标题">
  33. <el-input show-word-limit maxlength="15" placeholder="请简单概况一下课程亮点" type="textarea" v-model="saleInfo.desc"></el-input>
  34. </el-form-item>
  35. <el-form-item label="计费模式">
  36. <el-radio v-model="saleInfo.pricetype" label="1">免费</el-radio>
  37. <el-radio v-model="saleInfo.pricetype" label="2">付费</el-radio>
  38. </el-form-item>
  39. <el-form-item style="display:inline-block" v-if="saleInfo.pricetype==2" label="课程价格">
  40. <el-input v-model="saleInfo.price" v-onlyNumber="{precision: 2, min: 0, max: 99999}" type="number"></el-input>
  41. </el-form-item>
  42. <el-form-item style="display:inline-block" v-if="saleInfo.pricetype==2" label="划线价格">
  43. <el-input v-model="saleInfo.yprice" v-onlyNumber="{precision: 2, min: 0, max: 99999}" type="number"></el-input>
  44. </el-form-item>
  45. <el-form-item label="课程状态">
  46. <el-radio v-model="saleInfo.point" label="1">更新</el-radio>
  47. <el-radio v-model="saleInfo.point" label="2">完结</el-radio>
  48. </el-form-item>
  49. <el-form-item label="分类">
  50. <el-select v-model="saleInfo.cate_id" placeholder="请选择">
  51. <el-option
  52. v-for="item in consultCate"
  53. :key="item.value"
  54. :label="item.label"
  55. :value="item.value">
  56. </el-option>
  57. </el-select>
  58. </el-form-item>
  59. <el-form-item label="课程描述">
  60. <div class="content-field">
  61. <div class="content-editor">
  62. <editor
  63. :hideImage="false"
  64. :content="saleInfo.content"
  65. @change="(val)=> editor_change(val,1)"
  66. placeholder="课程描述"></editor>
  67. </div>
  68. </div>
  69. </el-form-item>
  70. <el-form-item>
  71. <el-button @click="active_set(2,false)" type="primary">下一步</el-button>
  72. </el-form-item>
  73. </el-form>
  74. <el-form v-if="active==2" style="margin-top: 60px" ref="form" label-width="80px">
  75. <solution_add></solution_add>
  76. </el-form>
  77. <el-form v-if="active==3" style="margin-top: 60px" ref="form" label-width="80px">
  78. <el-form-item label="视频封面">
  79. <div class="common-upload">
  80. <el-upload
  81. class="avatar-uploader"
  82. action="/upload_image"
  83. :show-file-list="false"
  84. :on-success="(response, file, fileList)=> upload_img_success(response, file, fileList,3)">
  85. <img v-if="saleInfo.video_img" :src="saleInfo.video_img" class="avatar">
  86. <i v-else class="el-icon-plus avatar-uploader-icon" style="border-radius: 6px;border: 1px dashed #d9d9d9;height: 178px;line-height: 178px;width: 178px"></i>
  87. </el-upload>
  88. <div class="look-img">
  89. <div class="text-hover">
  90. <span class="text">查看示意图</span>
  91. <div class="img">
  92. <img class="active-img2" src="@/assets/img/learn/video-add@2x.png"/>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </el-form-item>
  98. <el-form-item label="章节管理">
  99. <div v-for="(item,index) in video_list" :key="item.id">
  100. <el-input style="margin-top: 10px" placeholder="请输入内容" v-model="item.video_name">
  101. <template slot="prepend">第{{index+1}}章</template>
  102. <el-button slot="append" @click="del_zj(index,item.id)" icon="el-icon-delete"></el-button>
  103. </el-input>
  104. <div v-for="(item2,index2) in item.list" :key="item2.id" style="background: #f6f6f6;padding: 10px;margin-top: 10px">
  105. <el-input style="margin-top: 10px" placeholder="请输入课程名称" v-model="item2.video_name" class="input-with-select">
  106. <div slot="prepend" style="width: 120px;text-align: center">{{index+1}}-{{index2+1}}</div>
  107. <el-checkbox slot="append" style="margin-right: 15px" v-model="item2.checked">试看</el-checkbox>
  108. <el-button slot="append" @click="del_kc(index,index2,item2.id)" icon="el-icon-delete"></el-button>
  109. </el-input>
  110. <div style="padding-top: 10px;padding-bottom: 10px">
  111. <el-upload
  112. class="upload-demo"
  113. style="display: inline-block"
  114. action=""
  115. :show-file-list="false"
  116. :http-request="(e)=> fileChange(e,index,index2)">
  117. <el-button size="small" type="primary">点击上传</el-button>
  118. </el-upload>
  119. <div class="file-upload" style="margin-top: 10px">
  120. <el-progress :text-inside="true" :stroke-width="20" :percentage="item2.progress"></el-progress>
  121. </div>
  122. </div>
  123. </div>
  124. <div style="background: #f6f6f6;padding: 10px;margin-top: 10px;text-align:center">
  125. <el-button @click="add_new_kc(index)" :disabled="kc_disabled" type="primary">添加新的课程</el-button>
  126. <el-button @click="add_new_zj()" :disabled="zj_disabled" type="primary">添加新的章节</el-button>
  127. </div>
  128. </div>
  129. </el-form-item>
  130. <el-form-item>
  131. <el-button @click="active_set(2,true)" type="primary">上一步</el-button>
  132. <el-button @click="active_set(4,false)" type="primary">下一步</el-button>
  133. </el-form-item>
  134. </el-form>
  135. <el-form v-if="active==4" style="margin-top: 60px" ref="form" label-width="80px">
  136. <el-form-item style="display: none" label="群二维码">
  137. <el-upload
  138. class="avatar-uploader"
  139. action="/upload_image"
  140. :show-file-list="false"
  141. :on-success="(response, file, fileList)=> upload_img_success(response, file, fileList,4)">
  142. <img v-if="saleInfo.ewm" :src="saleInfo.ewm" class="avatar">
  143. <i v-else class="el-icon-plus avatar-uploader-icon" style="border-radius: 6px;border: 1px dashed #d9d9d9;height: 178px;line-height: 178px;width: 178px"></i>
  144. </el-upload>
  145. </el-form-item>
  146. <el-form-item label="公告栏">
  147. <div class="content-field">
  148. <div class="content-editor">
  149. <editor
  150. :hideImage="false"
  151. :content="saleInfo.notice_msg"
  152. @change="(val)=> editor_change(val,3)"
  153. placeholder="公告栏用于发布课程通知,常见用于课件下载等信息。"></editor>
  154. </div>
  155. </div>
  156. </el-form-item>
  157. <el-form-item>
  158. <el-button @click="active_set(3,true)" type="primary">上一步</el-button>
  159. <el-button @click="active_set(5,false)" type="primary">确认提交</el-button>
  160. </el-form-item>
  161. </el-form>
  162. </el-main>
  163. </el-container>
  164. </el-container>
  165. </el-container>
  166. <!-- vueCropper 剪裁图片实现-->
  167. <el-dialog title="图片剪裁" :visible.sync="dialogVisible" append-to-body>
  168. <div class="cropper-content">
  169. <div class="cropper" style="text-align:center">
  170. <vueCropper
  171. ref="cropper"
  172. :img="option.img"
  173. :outputSize="option.size"
  174. :outputType="option.outputType"
  175. :info="true"
  176. :full="option.full"
  177. :canMove="option.canMove"
  178. :canMoveBox="option.canMoveBox"
  179. :original="option.original"
  180. :autoCrop="option.autoCrop"
  181. :fixed="option.fixed"
  182. :fixedNumber="option.fixedNumber"
  183. :centerBox="option.centerBox"
  184. :infoTrue="option.infoTrue"
  185. :fixedBox="option.fixedBox"
  186. ></vueCropper>
  187. </div>
  188. </div>
  189. <div slot="footer" class="dialog-footer">
  190. <el-button @click="dialogVisible = false">取 消</el-button>
  191. <el-button type="primary" @click="finish">确认</el-button>
  192. </div>
  193. </el-dialog>
  194. </div>
  195. </template>
  196. <script>
  197. import { mapState } from "vuex";
  198. import editor from "@/components/editor";
  199. import solution_add from "@/components/company/solution_add";
  200. import multiUploader from '@/components/multi-uploader';
  201. if(process.client)
  202. {
  203. import('@/assets/js/aliyun-upload-sdk/aliyun-upload-sdk-1.5.2.min.js');
  204. }
  205. export default {
  206. head: {
  207. title: '新建咨询服务',
  208. },
  209. head() {
  210. return {
  211. script: [
  212. {src: 'https://gosspublic.alicdn.com/aliyun-oss-sdk-6.13.0.min.js'},
  213. ]
  214. }
  215. },
  216. components: {
  217. editor,
  218. multiUploader,
  219. solution_add
  220. },
  221. data () {
  222. return {
  223. sale_id: '', // 编辑时
  224. kc_disabled:false,
  225. zj_disabled:false,
  226. active:1,
  227. selectedConsultCate: [],//选中的技能分类
  228. consultCate: [], // 技能分类数据源
  229. saleInfo:{
  230. point:"1",
  231. pricetype:"1",
  232. img_icon:"",
  233. video_img:"",
  234. ewm:"",
  235. desc:"",
  236. price: '0.00',
  237. yprice: '0.00'
  238. },
  239. dialogVisible: false,
  240. // 裁剪组件的基础配置option
  241. option: {
  242. img: '', // 裁剪图片的地址
  243. type:'',//类型
  244. info: true, // 裁剪框的大小信息
  245. outputSize: 1, // 裁剪生成图片的质量
  246. outputType: 'jpeg', // 裁剪生成图片的格式
  247. canScale: false, // 图片是否允许滚轮缩放
  248. autoCrop: true, // 是否默认生成截图框
  249. // autoCropWidth: 300, // 默认生成截图框宽度
  250. // autoCropHeight: 200, // 默认生成截图框高度
  251. fixedBox: true, // 固定截图框大小 不允许改变
  252. fixed: true, // 是否开启截图框宽高固定比例
  253. fixedNumber: [16, 9], // 截图框的宽高比例
  254. full: true, // 是否输出原图比例的截图
  255. canMoveBox: false, // 截图框能否拖动
  256. original: false, // 上传图片按照原始比例渲染
  257. centerBox: false, // 截图框是否被限制在图片里面
  258. infoTrue: true // true 为展示真实输出图片宽高 false 展示看到的截图框宽高
  259. },
  260. teacherInfo:{
  261. img:""
  262. },
  263. video_list:[{"id":"","video_name":"","list":[{"id":"","kc_id":"1","progress":0,"video_name":"","checked":false,"time_type":0,"ymd":"","his":""}]}],
  264. }
  265. },
  266. mounted () {
  267. this.needLogin()
  268. var sale_id = this.$route.query.id ? this.$route.query.id : 0;
  269. this._getConsultCate()
  270. if (sale_id!=0) {
  271. this.sale_id=sale_id;
  272. this.getDetail();
  273. }
  274. if (this.saleInfo.price > 0)
  275. {
  276. this.saleInfo.pricetype="2";
  277. }
  278. else
  279. {
  280. this.saleInfo.pricetype="1";
  281. }
  282. },
  283. methods: {
  284. time_type(zj_id,kc_id,type){
  285. this.video_list[zj_id].list[kc_id].time_type=type;
  286. },
  287. // 点击裁剪,这一步是可以拿到处理后的地址
  288. finish() {
  289. this.$refs.cropper.getCropBlob((data) => {
  290. console.log("裁剪",data)
  291. let formData = new FormData();
  292. formData.append("file", data);
  293. this.$axios.$post('/upload_image', formData,{
  294. headers: {
  295. "Content-Type": "multipart/form-data"
  296. }
  297. }).then(res => {
  298. this.dialogVisible = false
  299. this.type=0;
  300. if(this.option.type==1)
  301. {
  302. this.saleInfo.img_icon=res.filename;
  303. }
  304. else if(this.option.type==2)
  305. {
  306. this.teacherInfo.img=res.filename;
  307. }
  308. else if(this.option.type==3)
  309. {
  310. this.saleInfo.video_img=res.filename;
  311. }
  312. }).catch(err => {
  313. })
  314. })
  315. },
  316. add_new_zj(){
  317. this.add_three(2);
  318. },
  319. add_new_kc(zj_id){
  320. this.add_three(3,0,zj_id);
  321. },
  322. del_kc(zj_id,kc_id,id){
  323. /*for(var i=0;i<this.video_list.length;i++)
  324. {
  325. for(var j=0;j<this.video_list[i].list.length;j++)
  326. {
  327. if(zj_id==i && kc_id==j)
  328. {
  329. this.video_list[i].list.splice(j,1);
  330. }
  331. }
  332. }*/
  333. this.$axios.$post('/api/sale/del_video', { sale_id: this.sale_id,id:id}).then(res => {
  334. if (res.status === 1) {
  335. this.video_list=res.data;
  336. }
  337. }).catch(err => {
  338. })
  339. },
  340. del_zj(zj_id,id){
  341. if(this.video_list.length==1){
  342. this.$message.error('已经是最后一个章节了不能删除了')
  343. return false
  344. }
  345. /* for(var i=0;i<this.video_list.length;i++)
  346. {
  347. if(zj_id==i)
  348. {
  349. this.video_list.splice(i,1);
  350. }
  351. }*/
  352. this.$axios.$post('/api/sale/del_video', { sale_id: this.sale_id, id}).then(res => {
  353. if (res.status === 1) {
  354. this.video_list=res.data;
  355. }
  356. }).catch(err => {
  357. })
  358. },
  359. active_set(val,return_=true){
  360. if(return_)
  361. {
  362. this.active=val;
  363. return;
  364. }
  365. if(val==2)
  366. {
  367. this.saleInfo.cate_id_one=this.saleInfo.cate_id;
  368. this.saleInfo.cate_id_two=0;
  369. this.add_one();
  370. }
  371. else if(val==3)
  372. {
  373. this.add_two();
  374. }
  375. else if(val==4)
  376. {
  377. this.add_three();//效验课程数据
  378. }
  379. else if(val==5)
  380. {
  381. this.add_fore();//提交审核
  382. }
  383. else
  384. {
  385. this.active=val;
  386. }
  387. },
  388. upload_img_success(res, file, fileList,type){
  389. if(type==1)
  390. {
  391. let filename=res.filename;
  392. // 上传成功后将图片地址赋值给裁剪框显示图片
  393. this.$nextTick(() => {
  394. this.option.img =filename;
  395. this.option.fixedNumber=[16,9]
  396. this.option.type=type;
  397. this.dialogVisible = true
  398. })
  399. }
  400. else if(type==2)
  401. {
  402. let filename=res.filename;
  403. // 上传成功后将图片地址赋值给裁剪框显示图片
  404. this.$nextTick(() => {
  405. this.option.img =filename;
  406. this.option.fixedNumber=[100,100]
  407. this.option.type=type;
  408. this.dialogVisible = true
  409. })
  410. }
  411. else if(type==3)
  412. {
  413. let filename=res.filename;
  414. // 上传成功后将图片地址赋值给裁剪框显示图片
  415. this.$nextTick(() => {
  416. this.option.img =filename;
  417. this.option.fixedNumber=[7,5]
  418. this.option.type=type;
  419. this.dialogVisible = true
  420. })
  421. }
  422. else if(type==4)
  423. {
  424. this.saleInfo.ewm=res.filename;
  425. }
  426. },
  427. editor_change(val,type)//编辑器内容发生改变的时候
  428. {
  429. if(type==1) {
  430. this.saleInfo.content = val;
  431. }
  432. else if(type==2) {
  433. this.teacherInfo.content = val;
  434. }
  435. else if(type==3) {
  436. this.saleInfo.notice_msg = val;
  437. }
  438. },
  439. fileChange (e,zj_id,kc_id) {
  440. let videoFile = e.file
  441. let filename=e.file.name;
  442. this.createUploader(videoFile,zj_id,kc_id,filename)
  443. },
  444. createUploader (videoFile,zj_id,kc_id,filename) {
  445. let self = this
  446. let uploader = new AliyunUpload.Vod({
  447. timeout: 60000,
  448. partSize: 1048576,
  449. parallel: 5,
  450. retryCount: 3,
  451. retryDuration: 2,
  452. region: 'cn-shanghai',
  453. userId: '1024',
  454. // 添加文件成功
  455. addFileSuccess: function (uploadInfo) {
  456. self.statusText = '添加文件成功, 等待上传...'
  457. console.log("addFileSuccess: " + uploadInfo.file.name)
  458. },
  459. // 开始上传
  460. onUploadstarted: function (uploadInfo) {
  461. self.$axios.$post("/api/sale/video", {filename: uploadInfo.file.name}).then(({data}) => {
  462. let uploadAuth = data.UploadAuth;
  463. let uploadAddress = data.UploadAddress;
  464. let videoId = data.VideoId;
  465. self.videoId = data.VideoId;
  466. self.video_list[zj_id].list[kc_id].temp_video_id=videoId;
  467. self.video_list[zj_id].list[kc_id].video_name=data.filename;
  468. uploader.setUploadAuthAndAddress(uploadInfo, uploadAuth, uploadAddress, videoId)
  469. })
  470. self.statusText = '文件开始上传...'
  471. console.log("onUploadStarted:" + uploadInfo.file.name + ", endpoint:" + uploadInfo.endpoint + ", bucket:" + uploadInfo.bucket + ", object:" + uploadInfo.object)
  472. },
  473. // 文件上传成功
  474. onUploadSucceed: function (uploadInfo) {
  475. //self.video_list[zj_id].list[kc_id].video_id= self.video_list[zj_id].list[kc_id].temp_video_id;
  476. //self.add_three(4);//保存课程
  477. },
  478. // 文件上传进度,单位:字节, 可以在这个函数中拿到上传进度并显示在页面上
  479. onUploadProgress: function (uploadInfo, totalSize, progress) {
  480. let progressPercent = Math.ceil(progress * 100)
  481. self.video_list[zj_id].list[kc_id].progress=progressPercent;
  482. self.video_list[zj_id].list[kc_id].video_id= self.video_list[zj_id].list[kc_id].temp_video_id;
  483. },
  484. })
  485. uploader.addFile(videoFile);
  486. uploader.startUpload();//上传文件
  487. },
  488. /** 获取咨询分类 */
  489. async _getConsultCate () {
  490. this.$axios.$post('/api/sale/cateListYes', { type: 4, point: 1 }).then(res => {
  491. if (res.status === 1) {
  492. let consultCate = res.data || []
  493. this.consultCate = consultCate.map(item => {
  494. let children = item.child_list.map(child => {
  495. return {
  496. value: child.category_id,
  497. label: child.name
  498. }
  499. })
  500. return {
  501. value: item.category_id,
  502. label: item.name,
  503. children: children
  504. }
  505. })
  506. }
  507. }).catch(err => {
  508. console.log('get consult cate error: ', err)
  509. })
  510. },
  511. /** 第一步添加 */
  512. async add_one() {
  513. this.active=2;
  514. },
  515. /** 第二步添加 */
  516. async add_two() {
  517. if(!this.teacherInfo.name)
  518. {
  519. this.$message.error('讲师名称必须填写');
  520. return false;
  521. }
  522. if(!this.teacherInfo.op)
  523. {
  524. this.$message.error('职称必须填写');
  525. return false;
  526. }
  527. if(!this.teacherInfo.img)
  528. {
  529. this.$message.error('封面必须上传');
  530. return false;
  531. }
  532. if(!this.teacherInfo.content)
  533. {
  534. this.$message.error('自我介绍必须填写');
  535. return false;
  536. }
  537. this.teacherInfo.sale_id=this.sale_id;
  538. var data=JSON.stringify(this.teacherInfo);
  539. await this.$axios.$post('/api/sale/sale_add_two', { data }).then(res => {
  540. if (res.status === 1) {
  541. this.active=3;
  542. }
  543. }).catch(err => {
  544. })
  545. },
  546. /** 第三步添加 */
  547. async add_three(type=1,kc_id=0,zj_id=0) {
  548. var video_list=JSON.stringify(this.video_list);
  549. var saleInfo=JSON.stringify(this.saleInfo);
  550. await this.$axios.$post('/api/sale/sale_add_three', {type, sale_id:this.sale_id, video_list,saleInfo }).then(res => {
  551. if (res.status === 1) {
  552. if(!res.data.result)
  553. {
  554. this.video_list=res.data.list;
  555. if(type==1)
  556. {
  557. this.active=4;
  558. }
  559. else if(type==2)
  560. {
  561. var new_object={"id":"","video_name":"","list":[{"id":"","kc_id":"","progress":0,"video_name":"","checked":false,"time_type":0,"ymd":"","his":""}]};
  562. this.video_list.push(new_object);
  563. this.add_video();
  564. }
  565. else if(type==3)
  566. {
  567. var new_object={"id":"","kc_id":"","progress":0,"video_name":"","checked":false,"time_type":0,"ymd":"","his":""};
  568. this.video_list[zj_id].list.push(new_object);
  569. this.add_video();
  570. }
  571. }
  572. else
  573. {
  574. this.$message.error(res.data.result_msg);
  575. }
  576. }
  577. }).catch(err => {
  578. })
  579. },
  580. /** 第四步添加 */
  581. async add_fore() {
  582. var video_list=JSON.stringify(this.video_list);
  583. var saleInfo=JSON.stringify(this.saleInfo);
  584. await this.$axios.$post('/api/sale/sale_add_fore', {sale_id:this.sale_id, video_list, saleInfo}).then(res => {
  585. if (res.status === 1) {
  586. this.$message.success('我们已经收到您的审核提交,请耐心等待');
  587. location.href = `/workbench/learn/index`
  588. }
  589. }).catch(err => {
  590. })
  591. },
  592. /** 课程添加 */
  593. async add_video() {
  594. this.kc_disabled=true;
  595. this.zj_disabled=true;
  596. var data=JSON.stringify(this.video_list);
  597. await this.$axios.$post('/api/sale/sale_add_video', { data,sale_id:this.sale_id}).then(res => {
  598. if (res.status === 1) {
  599. this.video_list=res.data;
  600. }
  601. this.kc_disabled=false;
  602. this.zj_disabled=false;
  603. }).catch(err => {
  604. this.kc_disabled=false;
  605. this.zj_disabled=false;
  606. })
  607. },
  608. /** 课程添加 */
  609. async getDetail() {
  610. await this.$axios.$post('/api/sale/info', {sale_id:this.sale_id}).then(res => {
  611. if (res.status === 1) {
  612. if(res.data.video.length>0)
  613. {
  614. this.video_list=res.data.video;
  615. }
  616. this.saleInfo=res.data.sale;
  617. this.teacherInfo=res.data.teacher;
  618. this.selectedConsultCate = [res.data.sale.cate_id_one, res.data.sale.cate_id_two]
  619. }
  620. }).catch(err => {
  621. })
  622. },
  623. }
  624. }
  625. </script>
  626. <style scope lang="scss">
  627. @import "@/assets/css/consult/create.scss";
  628. .common-upload {
  629. display: flex;
  630. align-items: end;
  631. .look-img {
  632. margin-left: 14px;
  633. .text {
  634. font-size: 14px;
  635. font-family: PingFangSC, PingFangSC-Medium;
  636. font-weight: 500;
  637. color: #308eff;
  638. cursor: pointer;
  639. }
  640. .text-hover:hover {
  641. position: relative;
  642. .img {
  643. display: block;
  644. }
  645. }
  646. .img {
  647. background: #fff;
  648. border: 1px solid #e0e5ed;
  649. box-shadow: 0px 2px 20px 0px rgba(22,40,63,0.15);
  650. border-radius: 10px;
  651. text-align: center;
  652. position: relative;
  653. position: absolute;
  654. top: -120px;
  655. left: 0;
  656. width: 300px;
  657. height: 120px;
  658. display: none;
  659. transition: all ease .3s;
  660. .active-img2 {
  661. width: 234px;
  662. height: 71px;
  663. background-size: cover;
  664. overflow: hidden;
  665. margin-top: 24px;
  666. }
  667. .active-img1 {
  668. width: 262px;
  669. height: 78px;
  670. background-size: cover;
  671. overflow: hidden;
  672. margin-top: 22px;
  673. }
  674. }
  675. .img:after {
  676. content: '';
  677. width: 0;
  678. height: 0;
  679. border-right: 10px solid transparent;
  680. border-bottom: 10px solid transparent;
  681. border-top: 10px solid #e0e5ed;
  682. border-left: 10px solid transparent;
  683. position: absolute;
  684. left: 24px;
  685. bottom: -20px;
  686. }
  687. .img:before {
  688. content: '';
  689. width: 0;
  690. height: 0;
  691. border-right: 9px solid transparent;
  692. border-bottom: 9px solid transparent;
  693. border-top: 9px solid #fff;
  694. border-left: 9px solid transparent;
  695. position: absolute;
  696. left: 25px;
  697. bottom: -18px;
  698. z-index: 1;
  699. }
  700. }
  701. }
  702. </style>
  703. <style>
  704. .el-select .el-input {
  705. width: 130px;
  706. }
  707. .avatar-uploader img{max-width: 200px}
  708. .input-with-select .el-input-group__prepend {
  709. background-color: #fff;
  710. }
  711. .lenrn_content{width: 1000px;margin: 0px auto;background: white}
  712. input::-webkit-outer-spin-button,
  713. input::-webkit-inner-spin-button {
  714. -webkit-appearance: none !important;
  715. }
  716. input[type="number"]{
  717. -moz-appearance: textfield !important;
  718. }
  719. .el-form-item__content .content-field span{line-height: normal}
  720. .cropper-content{
  721. width: 100%;
  722. height: 300px;
  723. }
  724. .cropper {
  725. width: 100%;
  726. height: 240px;
  727. }
  728. .btnGroup{
  729. float: right;
  730. margin-top: 10px;
  731. margin-right: 15px;
  732. }
  733. </style>
  734. <style lang="scss">
  735. // 编辑器样式
  736. .content-editor {
  737. .my-editor {
  738. .ql-snow {
  739. border: 1px solid #d7dfe8 !important;
  740. border-radius: 3px 3px 0 0 !important;
  741. }
  742. .quill-editor {
  743. border-width: 1px !important;
  744. border-top: 0 !important;
  745. border-color: #d7dfe8 !important;
  746. border-radius: 0 0 3px 3px !important;
  747. }
  748. }
  749. }
  750. // 图片上传器样式
  751. .consult-image-uploader {
  752. .el-upload-list__item {
  753. width: 300px !important;
  754. height: 168.75px !important;
  755. line-height: 168.75px !important;
  756. }
  757. .el-upload--picture-card {
  758. width: 300px !important;
  759. height: 168.75px !important;
  760. line-height: 168.75px !important;
  761. .el-upload-list__item-thumbnail {
  762. object-fit: scale-down !important;
  763. }
  764. }
  765. .el-upload-list--picture-card {
  766. .el-upload-list__item-thumbnail {
  767. object-fit: scale-down !important;
  768. }
  769. }
  770. }
  771. </style>