add.vue 28 KB

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