editor.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194
  1. <template>
  2. <div class="editor">
  3. <!-- title -->
  4. <div class="work-title">{{ this.wid ? "编辑" : "添加" }}项目作品</div>
  5. <div class="work-title-tips">
  6. 项目信息是最重要的信息,切勿填写“123456”等无关信息;<br />为了给有诚意的开发者更多接单机会,因此导致的审核不通过,可能<span
  7. >不再二次审核</span
  8. >
  9. </div>
  10. <!--项目类型-->
  11. <div class="work-field" style="margin-top: 30px;">
  12. <div class="work-label">项目类型(可加1-3个标签)</div>
  13. <div class="work-tag-container">
  14. <div class="work-tag-list">
  15. <div class="work-tag-input1">
  16. <el-input
  17. style="width:560px"
  18. ref="tag-input"
  19. placeholder="比如直播APP;电商商城;可视化大屏;网站爬虫程序;按回车确认"
  20. v-model.trim.lazy="tagValue"
  21. @keyup.enter.native="tagSubmit"
  22. >
  23. </el-input>
  24. <!-- 比如直播APP;电商商城;可视化大屏;网站爬虫程序;RPA软件;AI图像识别 -->
  25. <!-- <div class="work-tag-placeholder" @click="inputFocus">
  26. </div> -->
  27. </div>
  28. </div>
  29. <div class="work-tag-input">
  30. <div
  31. id="work-tag-input-placeholder"
  32. class="work-tag-input-placeholder"
  33. @click.stop="isShowTagList = !isShowTagList"
  34. >
  35. 添加标签
  36. <i
  37. id="work-tag-input-icon"
  38. :class="isShowTagList ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"
  39. ></i>
  40. </div>
  41. </div>
  42. <div
  43. class="work-tag-select-container"
  44. @click.stop=""
  45. v-show="isShowTagList"
  46. >
  47. <div
  48. v-for="(rowsItem, index) in tagArr"
  49. :key="index"
  50. class="work-tag-select-row"
  51. >
  52. <span
  53. v-for="(item, index2) in rowsItem"
  54. :key="index2"
  55. class="work-tag-item"
  56. :class="{
  57. cur: dynamicTags.indexOf(item) > -1
  58. }"
  59. @click.stop="addTags(item)"
  60. >{{ item }}</span
  61. >
  62. </div>
  63. </div>
  64. </div>
  65. <div class="work-tag-ul" v-show="dynamicTags.length > 0">
  66. <el-tag
  67. :key="tag"
  68. v-for="(tag, index) in dynamicTags"
  69. closable
  70. :disable-transitions="false"
  71. @close="delTags(index)"
  72. >
  73. {{ tag }}
  74. </el-tag>
  75. </div>
  76. </div>
  77. <!--作品名称-->
  78. <div class="work-field" style="margin-top: 30px;">
  79. <div class="work-label">项目名称</div>
  80. <el-input
  81. type="textarea"
  82. :rows="1"
  83. resize="none"
  84. show-word-limit
  85. v-model="workName"
  86. class=""
  87. placeholder="比如抖音;微信;QQ;淘宝"
  88. :maxlength="50"
  89. @blur="workNameBlur"
  90. />
  91. </div>
  92. <!--作品描述-->
  93. <div class="work-field" style="align-items:flex-start">
  94. <div class="work-label">详细信息(重点)</div>
  95. <el-input
  96. type="textarea"
  97. v-model="content"
  98. :placeholder="textareaPlaceholder"
  99. :maxlength="10000"
  100. :minlength="80"
  101. :show-word-limit="true"
  102. class="work-el-textarea"
  103. :rows="8"
  104. />
  105. </div>
  106. <!--作品链接-->
  107. <!-- <div class="work-field">
  108. <div class="work-label">作品链接</div>
  109. <el-input
  110. v-model="workUrl"
  111. class="title _title"
  112. placeholder="例如:https://www.proginn.com 若无法添加作品有效链接,请添加作品截图"
  113. ></el-input>
  114. </div> -->
  115. <!--作品封面图 -->
  116. <div class="work-field">
  117. <div class="work-label" style="margin-bottom: 10px;">
  118. 项目图片(至少2张)
  119. </div>
  120. <multi-uploader v-model="workImages"></multi-uploader>
  121. </div>
  122. <!-- 所属分类 & 作品类型 -->
  123. <div class="work-field">
  124. <div class="work-label">所属分类</div>
  125. <div class="work-cate-type">
  126. <el-cascader
  127. class="work-cate-cascader"
  128. v-model="selectedWorkCate"
  129. :options="workCate"
  130. :props="{ expandTrigger: 'hover' }"
  131. placeholder="请选择作品分类"
  132. ></el-cascader>
  133. </div>
  134. </div>
  135. <!-- 作品资源 -->
  136. <div v-if="from!='sign'" class="work-field">
  137. <div class="work-label" style="margin-bottom: 10px;">
  138. 作品资源<span class="upload-tips"
  139. >文件小于1GB,请勿上传侵权内容作品</span
  140. >
  141. </div>
  142. <div class="">
  143. <el-upload
  144. style="display:inline-block"
  145. action="#"
  146. ref="upload"
  147. :on-success="handleSuccess"
  148. :on-change="uploadFileChange"
  149. :on-remove="uploadFileDelete"
  150. :on-err="uploadFileError"
  151. :multiple="false"
  152. :show-file-list="false"
  153. :file-list="uploadFileList"
  154. >
  155. <div class=" app__f_r app__al_c">
  156. <button
  157. slot="trigger"
  158. class="upload-btn"
  159. v-if="uploadFileList.length === 0"
  160. >
  161. 点击添加
  162. </button>
  163. </div>
  164. </el-upload>
  165. <div v-if="uploadFileList.length > 0" class="app__mw_40_p">
  166. <div class="app__f_r app__al_c">
  167. <p class="app__fs_15 app__txt_ellipsis">
  168. {{ uploadFileList.length > 0 ? uploadFileList[0].name : "" }}
  169. </p>
  170. <button
  171. class="app__fc_999 app__fs_18 app__ml_20"
  172. @click="uploadFileDelete"
  173. >
  174. x
  175. </button>
  176. </div>
  177. <el-progress
  178. :percentage="uploadPercentage"
  179. status="success"
  180. :stroke-width="8"
  181. class="app__mt_10"
  182. />
  183. </div>
  184. </div>
  185. </div>
  186. <!-- 资源价格 -->
  187. <div class="work-field" v-if="uploadFileList.length > 0">
  188. <div class="work-label">资源价格</div>
  189. <div class="work-price-wrapper">
  190. <el-input
  191. class="work-price-input"
  192. type="number"
  193. placeholder="请输入资源价格"
  194. @input="priceChange"
  195. v-model="price"
  196. ></el-input>
  197. <span>元</span>
  198. </div>
  199. </div>
  200. <!-- btn group -->
  201. <footer class="editor-footer">
  202. <el-button
  203. type="primary"
  204. @click="publish"
  205. class="btn-save"
  206. v-bind:disabled="isPublishing || !canNext"
  207. >{{ submitText }}</el-button
  208. >
  209. <!-- <el-button @click="cancel">取消</el-button>-->
  210. </footer>
  211. </div>
  212. </template>
  213. <script>
  214. import editor from "@/components/editor";
  215. import multiUploader from "@/components/multi-uploader";
  216. import axios from "axios";
  217. import oos from "../../mixins/oos";
  218. import { Toast, Overlay } from "vant";
  219. function creatMockTag() {
  220. let result = [
  221. [
  222. "区块链",
  223. "棋牌",
  224. "企业服务",
  225. "直播",
  226. "招聘",
  227. "云计算",
  228. "人工智能",
  229. "社交",
  230. "音视频",
  231. "电商",
  232. "教育",
  233. "安全",
  234. "即时通讯"
  235. ],
  236. [
  237. "外卖",
  238. "旅游",
  239. "团购",
  240. "医疗",
  241. "金融",
  242. "出行",
  243. "可视化",
  244. "AR",
  245. "VR",
  246. "硬件",
  247. "本地生活",
  248. "地图"
  249. ],
  250. ["app", "小程序", "网站", "管理后台", "游戏", "工业程序"]
  251. ];
  252. return result;
  253. }
  254. export default {
  255. head() {
  256. return {
  257. script: []
  258. };
  259. },
  260. components: {
  261. editor,
  262. multiUploader
  263. },
  264. data() {
  265. return {
  266. topicId: "", // 编辑
  267. hashID: null,
  268. workName: "",
  269. title: "",
  270. subTitle: "",
  271. content: "",
  272. cover_url: "",
  273. dialogVisible: false,
  274. disabled: false,
  275. collectionId: "",
  276. collectionList: [],
  277. categoryList: [
  278. {
  279. value: "default",
  280. label: "推荐"
  281. }
  282. ],
  283. fileList: [],
  284. uploading: false,
  285. workUrl: "",
  286. isPublishing: false,
  287. workImages: [],
  288. wid: "",
  289. work_up_url: "",
  290. workList: [],
  291. // 所属分类
  292. workCate: [],
  293. selectedWorkCate: [],
  294. // 资源类型: 1 免费,2 付费
  295. workType: 1,
  296. // 资源价格
  297. price: 1,
  298. from:"",
  299. // 标签
  300. isFocus: false,
  301. tagValue: "",
  302. isShowTagList: false,
  303. dynamicTags: [],
  304. tagArr: creatMockTag(),
  305. textareaPlaceholder:
  306. "可以参考以下内容:\n1.【60%】项目分为哪些功能模块,对使用者来说能实现哪些功能 \n2.【40%】我负责哪些任务,使用了什么技术栈,最终达到了什么成果 \n3.【选填】有哪些难点,怎么解决的"
  307. };
  308. },
  309. mixins: [oos],
  310. computed: {
  311. /**
  312. * 提交保存时的文字:
  313. * 1. 没有作品资源时,文案为“保存”
  314. * 2. 有作品资源时,文案为“保存并提交审核”
  315. */
  316. submitText() {
  317. let res = "保存";
  318. if (this.uploadFileList && this.uploadFileList.length) {
  319. res = "保存并提交审核";
  320. }
  321. return res;
  322. },
  323. canNext() {
  324. const condition = this.dynamicTags.length > 0;
  325. const condition2 = this.workName !== "";
  326. const condition3 = this.content !== "";
  327. const condition4 = this.workImages.length > 1;
  328. return condition && condition2 && condition3 && condition4;
  329. }
  330. },
  331. created() {},
  332. mounted() {
  333. let from=this.$route.query.from;
  334. this.from=from;
  335. this.needLogin();
  336. this.getWorkCate();
  337. // this.needVerify();
  338. // this.getHejiList();
  339. this.wid = this.$route.query.wid || "";
  340. if (this.wid) {
  341. this.getWorkDetail();
  342. this.getWorkFile();
  343. }
  344. console.log("url", this.$route.query.wid);
  345. this.$nextTick(() => {
  346. this.createSelectMask();
  347. });
  348. },
  349. methods: {
  350. createSelectMask() {
  351. let body = document.querySelector("body");
  352. body.addEventListener(
  353. "click",
  354. e => {
  355. let id = e.target.id;
  356. if (
  357. id == "work-tag-input-placeholder" ||
  358. id == "work-tag-input-icon"
  359. ) {
  360. this.isShowTagList = true;
  361. } else {
  362. this.isShowTagList = false;
  363. }
  364. },
  365. false
  366. );
  367. },
  368. getWorkDetail(data) {
  369. this.$axios
  370. .$post(`/api/user_works/get_detail`, { wid: this.$route.query.wid })
  371. .then(res => {
  372. console.log(res);
  373. if (res.status == 1) {
  374. this.workName = res.data.name || "";
  375. this.content = res.data.description || "";
  376. this.setWorkImages(res.data);
  377. this.workUrl = res.data.url || "";
  378. this.dynamicTags =
  379. res.data.tag === "" ? [] : res.data.tag.split(",");
  380. if (res.data.cate_id_one && res.data.cate_id_two) {
  381. this.selectedWorkCate = [
  382. res.data.cate_id_one,
  383. res.data.cate_id_two
  384. ];
  385. }
  386. this.workType = res.data.price > 0 ? 2 : 1;
  387. this.price = res.data.price || 0;
  388. }
  389. });
  390. },
  391. getWorkFile() {
  392. this.$axios
  393. .$post(`/api/UserWorks/getWorkFile`, { wid: this.$route.query.wid })
  394. .then(res => {
  395. console.log(res);
  396. if (res.status === 1) {
  397. this.uploadFileList.push({
  398. name: res.data.file_name,
  399. url: res.data.file_url_abs,
  400. path: res.data.file_url
  401. });
  402. console.log(this.uploadFileList);
  403. }
  404. })
  405. .catch(err => {
  406. console.log(err);
  407. });
  408. },
  409. /**
  410. * 获取作品分类
  411. */
  412. getWorkCate() {
  413. this.$axios
  414. .$post("/api/user_works/cate")
  415. .then(res => {
  416. if (res.status === 1) {
  417. let workCate = res.data || [];
  418. this.workCate = workCate.map(item => {
  419. let children = item.child.map(child => {
  420. return {
  421. value: child.category_id,
  422. label: child.name
  423. };
  424. });
  425. return {
  426. value: item.category_id,
  427. label: item.name,
  428. children: children
  429. };
  430. });
  431. }
  432. })
  433. .catch(err => {
  434. console.log("get work cate error: ", err);
  435. });
  436. },
  437. setWorkImages(data) {
  438. let images = data.images;
  439. if (images && images.length > 0) {
  440. images.forEach((image, index) => {
  441. let imageName = this.getImageName(image.url);
  442. console.log("imageName", imageName);
  443. this.workImages.push({ name: imageName + index, url: image.url });
  444. });
  445. }
  446. console.log(this.workImages);
  447. },
  448. getImageName(imageName) {
  449. if (imageName) {
  450. try {
  451. const lastquotaIndex = imageName.lastIndexOf("/");
  452. const lastDotIndex = imageName.lastIndexOf(".");
  453. return imageName.substring(lastquotaIndex + 1, lastDotIndex);
  454. } catch (e) {
  455. console.log(e);
  456. }
  457. }
  458. return "";
  459. },
  460. getHejiList() {
  461. this.$axios
  462. .post("/api/jishuquan/get_collections", {
  463. uid: this.$store.state.userinfo.uid,
  464. page: 1,
  465. size: 200
  466. })
  467. .then(res => {
  468. if (res.data.status === 1) {
  469. this.collectionList = res.data.data;
  470. }
  471. });
  472. },
  473. /**
  474. * 发布项目作品
  475. */
  476. publish() {
  477. const self = this;
  478. this.cnzz("资源下载", "工作台+保存", "");
  479. //防止快速连点
  480. if (this.isPublishing) {
  481. return;
  482. }
  483. this.isPublishing = true;
  484. const validCheckResult = this.publishValidCheck();
  485. if (!validCheckResult.success) {
  486. this.$message.error(validCheckResult.msg);
  487. this.isPublishing = false;
  488. return;
  489. }
  490. let workFile =
  491. this.uploadFileList.length > 0 ? this.uploadFileList[0].url : "";
  492. const data = {
  493. name: this.workName,
  494. description: this.content,
  495. url: this.workUrl,
  496. image_list: this.workImages.map(it => it.url).join(","),
  497. work_file: workFile,
  498. type: this.workType,
  499. cate_id_one: this.selectedWorkCate[0],
  500. cate_id_two: this.selectedWorkCate[1],
  501. price: this.price,
  502. tag: this.dynamicTags.join(",")
  503. };
  504. if (this.wid) {
  505. data.wid = this.wid;
  506. this.$axios.$post(`/api/user_works/update`, data).then(res => {
  507. console.log(res);
  508. if (res.status === -99) {
  509. this.goHome();
  510. }
  511. if (res.status === 1) {
  512. if (this.uploadFileList && this.uploadFileList.length) {
  513. // 有作品资源时
  514. this.$message.success("提交成功,系统将在1-3个工作日完成审核");
  515. } else {
  516. // 无作品资源时
  517. this.$message.success("编辑作品成功!");
  518. }
  519. setTimeout(() => {
  520. //window.location.href = `/wo/${self.$store.state.userinfo.uid}/works`;
  521. if (this.$route.query.from === "sign") {
  522. this.$router.back();
  523. } else {
  524. window.location.href = res.data.work_url;
  525. }
  526. }, 800);
  527. // window.location.href = res.data.work_url;
  528. } else {
  529. this.$message.error("编辑作品失败,请重试");
  530. }
  531. this.isPublishing = false;
  532. });
  533. } else {
  534. this.$axios.$post(`/api/user_works/add`, data).then(res => {
  535. console.log(res);
  536. if (res.status === -99) {
  537. this.goHome();
  538. }
  539. if (res.status === 1) {
  540. if (this.uploadFileList && this.uploadFileList.length) {
  541. // 有作品资源时
  542. this.$message.success("提交成功,系统将在1-3个工作日完成审核");
  543. } else {
  544. // 无作品资源时
  545. this.$message.success("添加作品成功!");
  546. }
  547. this.wid = res.data.wid || "";
  548. setTimeout(() => {
  549. if(this.from=="sign")
  550. {
  551. location.href = "/sign/new_v2?step=3";
  552. }
  553. else
  554. {
  555. window.location.href = res.data.work_url;
  556. }
  557. }, 800);
  558. } else {
  559. this.$message.error("添加作品失败,请重试");
  560. }
  561. this.isPublishing = false;
  562. });
  563. }
  564. },
  565. /**
  566. * 输入合法性检查
  567. * @return {{msg: string, success: boolean}}
  568. */
  569. publishValidCheck() {
  570. if (this.dynamicTags.length === 0) {
  571. return { success: false, msg: "请请输入(项目类型、标签)" };
  572. }
  573. if (!this.workName) {
  574. return { success: false, msg: "请输入作品名称" };
  575. }
  576. if (this.workName.length < 2) {
  577. return { success: false, msg: "作品名称不可少于2字符" };
  578. }
  579. if (this.workName.length > 50) {
  580. return { success: false, msg: "作品名称不可超过50字符,请删减" };
  581. }
  582. if (!this.content) {
  583. return { success: false, msg: "请输入作品描述" };
  584. }
  585. if (this.content.length < 80) {
  586. return { success: false, msg: "作品描述不可少于80字符" };
  587. }
  588. if (this.content.length > 10000) {
  589. return { success: false, msg: "作品描述不可大于10000字符,请删减" };
  590. }
  591. if (this.workImages.length < 2) {
  592. return { success: false, msg: "至少上传2张作品截图" };
  593. }
  594. // 上传文件后,才需要填写分类及价格
  595. if (this.uploadFileList.length) {
  596. if (
  597. this.selectedWorkCate.length !== 2 ||
  598. !this.selectedWorkCate[0] ||
  599. !this.selectedWorkCate[1]
  600. ) {
  601. return { success: false, msg: "请选择作品分类" };
  602. }
  603. if (this.price <= 0) {
  604. //return {success: false, msg: "请输入大于0的资源价格"};
  605. }
  606. if (
  607. String(this.price).indexOf(".") > -1 &&
  608. String(this.price).length - String(this.price).indexOf(".") - 1 > 2
  609. ) {
  610. return { success: false, msg: "资源价格最多保留两位小数" };
  611. }
  612. }
  613. return { success: true, msg: "" };
  614. },
  615. cancel() {
  616. this.$router.back();
  617. },
  618. handleChange(val) {
  619. this.content = val;
  620. },
  621. handleDeleteFile() {
  622. this.cover_url = "";
  623. },
  624. handleFileChange(file) {
  625. console.log(file);
  626. if (file.size / 1024 > 2048) {
  627. this.$message.error("图片大小不得超过2M,请重新选择");
  628. return false;
  629. }
  630. const formData = new FormData();
  631. formData.append("target", '{ "type": 3 }');
  632. formData.append("id", "WU_FILE_0");
  633. formData.append("name", file.name);
  634. formData.append("type", file.type);
  635. formData.append("lastModifiedDate", file.lastModifiedDate);
  636. formData.append("size", file.size);
  637. formData.append("file", file);
  638. this.$axios
  639. .$post(`/file/proxyUpload`, formData, {
  640. headers: { "Content-Type": "multipart/form-data" }
  641. })
  642. .then(res => {
  643. this.cover_url = (res.data && res.data.url) || "";
  644. this.fileList = [
  645. {
  646. name: "file.name",
  647. url: this.cover_url
  648. }
  649. ];
  650. });
  651. },
  652. workNameBlur(e) {
  653. this.workName = this.workName.replace(/[&|\*|#|\\]/g, "");
  654. },
  655. handleSuccess(response, file, fileList) {},
  656. showUploadTips() {
  657. this.$message.info("先保存项目作品,才能上传作品资源");
  658. },
  659. priceChange(e) {
  660. if (e > 10000) {
  661. this.price = 10000;
  662. this.$toast("最高金额10000元");
  663. }
  664. },
  665. tagSubmit() {
  666. let verifyResult = this.verifyTag(this.tagValue);
  667. if (this.tagValue !== "" && verifyResult) {
  668. this.dynamicTags.push(this.tagValue);
  669. this.tagValue = "";
  670. return;
  671. }
  672. },
  673. addTags(tagItem) {
  674. const text = tagItem;
  675. let verifyResult = this.verifyTag(text);
  676. if (verifyResult) {
  677. this.dynamicTags.push(text);
  678. return;
  679. }
  680. },
  681. verifyTag(value) {
  682. if (value === "") {
  683. this.$message.error("不能为空");
  684. return false;
  685. }
  686. if (this.dynamicTags.includes(value)) {
  687. this.$message.error("已存在相同标签");
  688. return false;
  689. }
  690. if (this.dynamicTags.length === 3) {
  691. this.$message.error("最多3个标签");
  692. return false;
  693. }
  694. return true;
  695. },
  696. inputFocus() {
  697. // 维持input focus态
  698. this.$refs["tag-input"].focus();
  699. },
  700. tagInputFocus() {
  701. this.isShowTagList = true;
  702. this.isFocus = true;
  703. },
  704. hideTags() {
  705. this.isFocus = false;
  706. setTimeout(() => {
  707. if (!this.isFocus) {
  708. this.isShowTagList = false;
  709. }
  710. }, 100);
  711. },
  712. delTags(index) {
  713. this.dynamicTags.splice(index, 1);
  714. }
  715. }
  716. };
  717. </script>
  718. <style lang="scss">
  719. @import "../../assets/css/common.css";
  720. @import "../../assets/css/public.css";
  721. .work-title {
  722. line-height: 37px;
  723. padding: 5px 0px 0;
  724. font-size: 26px;
  725. font-family: PingFangSC, PingFangSC-Medium;
  726. font-weight: 500;
  727. text-align: center;
  728. color: #1d2a3a;
  729. }
  730. .work-title-tips {
  731. margin-top: 10px;
  732. white-space: nowrap;
  733. font-size: 14px;
  734. font-family: PingFangSC-Regular, PingFang SC;
  735. font-weight: 400;
  736. color: #0b121a;
  737. line-height: 22px;
  738. text-align: center;
  739. padding-bottom: 15px;
  740. border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  741. span {
  742. color: #ff361b;
  743. }
  744. }
  745. .editor {
  746. position: relative;
  747. padding: 30px 0 80px;
  748. width: 1100px;
  749. background: #fff;
  750. .title,
  751. .sub-title {
  752. .el-input__inner {
  753. padding: 0;
  754. border: 0;
  755. border-radius: 0;
  756. }
  757. }
  758. .title {
  759. margin: 10px auto 20px;
  760. font-size: 28px;
  761. font-family: PingFangSC-Medium;
  762. font-weight: 500;
  763. color: rgba(29, 42, 58, 1);
  764. line-height: 40px;
  765. }
  766. ._title {
  767. font-size: 15px !important;
  768. margin: 0 !important;
  769. border-bottom: 1px solid #ddd;
  770. }
  771. .sub-title {
  772. margin-bottom: 28px;
  773. min-height: 18px;
  774. font-size: 14px;
  775. font-family: PingFangSC-Regular;
  776. font-weight: 400;
  777. color: rgba(145, 154, 167, 1);
  778. line-height: 18px;
  779. border: 0;
  780. .el-textarea__inner {
  781. height: 18px;
  782. line-height: 18px;
  783. border: 0;
  784. padding-left: 0;
  785. }
  786. }
  787. .label {
  788. margin: 20px auto 10px;
  789. font-size: 13px;
  790. font-family: PingFangSC-Medium;
  791. font-weight: 500;
  792. color: rgba(25, 34, 46, 1);
  793. line-height: 18px;
  794. }
  795. .ql-toolbar {
  796. border-width: 1px 0 0 0 !important;
  797. }
  798. .quill-editor {
  799. height: 450px;
  800. border-left: 0 !important;
  801. border-right: 0 !important;
  802. font-size: 14px;
  803. line-height: 25px;
  804. }
  805. .ql-snow.ql-toolbar::after {
  806. display: inline-block;
  807. }
  808. .class {
  809. width: 320px;
  810. }
  811. .tags {
  812. width: 560px;
  813. }
  814. footer {
  815. margin: 40px 0;
  816. /*button {*/
  817. /* width: 100px;*/
  818. /* height: 40px;*/
  819. /* border-radius: 0;*/
  820. /*}*/
  821. }
  822. strong {
  823. font-weight: 800 !important;
  824. }
  825. em {
  826. font-style: italic !important;
  827. }
  828. }
  829. .uploadInfo {
  830. display: flex;
  831. padding-left: 30px;
  832. align-items: center;
  833. .left {
  834. width: 150px;
  835. height: 180px;
  836. flex-shrink: 0;
  837. overflow: hidden;
  838. position: relative;
  839. background: #fff;
  840. .el-icon-delete {
  841. display: none;
  842. }
  843. .avatar-uploader .el-upload {
  844. width: 150px;
  845. height: 150px;
  846. border: 1px dashed #dce1e8;
  847. border-radius: 6px;
  848. cursor: pointer;
  849. position: relative;
  850. overflow: hidden;
  851. img {
  852. width: 100%;
  853. height: auto;
  854. object-fit: contain;
  855. object-position: top left;
  856. }
  857. }
  858. .avatar-uploader .el-upload:hover {
  859. border-color: #409eff;
  860. .el-icon-plus {
  861. color: #409eff;
  862. }
  863. .el-p-upload {
  864. color: #409eff;
  865. }
  866. .el-icon-delete {
  867. display: block;
  868. }
  869. }
  870. .avatar-uploader-icon {
  871. /*position: absolute;*/
  872. /*top: 0;*/
  873. /*left: 0;*/
  874. font-size: 44px;
  875. color: #dce1e8;
  876. /*width: 150px;*/
  877. /*height: 150px;*/
  878. /*line-height: 140px;*/
  879. text-align: center;
  880. }
  881. .el-p-upload {
  882. color: #dce1e8;
  883. }
  884. .avatar {
  885. width: 180px;
  886. height: 140px;
  887. display: block;
  888. }
  889. .title {
  890. position: absolute;
  891. left: 50%;
  892. bottom: 40px;
  893. transform: translateX(-50%);
  894. font-size: 13px;
  895. font-weight: 500;
  896. color: #dce1e8;
  897. line-height: 18px;
  898. text-decoration: underline;
  899. }
  900. }
  901. .right {
  902. margin-left: 18px;
  903. height: 34px;
  904. p {
  905. font-size: 12px;
  906. font-weight: 400;
  907. color: rgba(145, 154, 167, 1);
  908. line-height: 17px;
  909. }
  910. }
  911. }
  912. .editor-footer {
  913. text-align: center;
  914. }
  915. .btn-save {
  916. width: 140px;
  917. height: 48px;
  918. // background: #96c6ff;
  919. border-radius: 24px;
  920. outline: none;
  921. border: none;
  922. // margin: 0 auto;
  923. }
  924. .work-field {
  925. // width: 100%;
  926. margin: 20px 140px;
  927. display: flex;
  928. flex-direction: column;
  929. .work-label {
  930. margin-bottom: 18px;
  931. height: 21px;
  932. font-size: 15px;
  933. font-family: PingFangSC-Semibold, PingFang SC;
  934. font-weight: 600;
  935. color: #000000;
  936. line-height: 21px;
  937. position: relative;
  938. padding-left: 13px;
  939. &::before {
  940. content: "";
  941. position: absolute;
  942. left: 0;
  943. top: 50%;
  944. transform: translateY(-50%);
  945. width: 2px;
  946. height: 14px;
  947. background: #308eff;
  948. border-radius: 1px;
  949. font-size: 0;
  950. }
  951. &::after {
  952. content: "*";
  953. color: #ff4e33;
  954. margin-left: 10px;
  955. line-height: 21px;
  956. }
  957. }
  958. .upload-tips {
  959. line-height: 20px;
  960. margin-left: 10px;
  961. font-size: 14px;
  962. font-weight: 400;
  963. color: #999999;
  964. }
  965. .upload-btn {
  966. width: 160px;
  967. height: 40px;
  968. line-height: 40px;
  969. border: 1px solid #308eff;
  970. border-radius: 6px;
  971. font-size: 14px;
  972. font-family: PingFangSC, PingFangSC-Medium;
  973. font-weight: 500;
  974. text-align: center;
  975. color: #308eff;
  976. }
  977. .work-cate-type {
  978. width: 100%;
  979. height: 40px;
  980. display: flex;
  981. align-items: center;
  982. .work-cate-cascader {
  983. width: 315px;
  984. margin-right: 30px;
  985. }
  986. .service-cate {
  987. width: 220px;
  988. margin-right: 10px;
  989. }
  990. }
  991. .work-price-wrapper {
  992. display: flex;
  993. align-items: center;
  994. .work-price-input {
  995. width: 315px;
  996. }
  997. span {
  998. margin-left: 8px;
  999. font-size: 14px;
  1000. font-family: PingFangSC, PingFangSC-Medium;
  1001. font-weight: 500;
  1002. color: #19222e;
  1003. }
  1004. }
  1005. }
  1006. .custom-radio {
  1007. .el-radio__inner {
  1008. width: 20px;
  1009. height: 20px;
  1010. border: none;
  1011. border-radius: 0;
  1012. background: url("~@/assets/img/common/custom-radio.png") no-repeat !important;
  1013. &:after {
  1014. content: none;
  1015. }
  1016. }
  1017. .is-checked {
  1018. .el-radio__inner {
  1019. background: url("~@/assets/img/common/custom-radio-checked.png") no-repeat !important;
  1020. }
  1021. }
  1022. }
  1023. .work-tag-container {
  1024. display: flex;
  1025. align-items: center;
  1026. position: relative;
  1027. position: 3;
  1028. }
  1029. .work-tag-select-container {
  1030. position: absolute;
  1031. z-index: 20;
  1032. bottom: 0;
  1033. left: 0;
  1034. right: 0;
  1035. transform: translateY(100%);
  1036. // height: 300px;
  1037. background: #ffffff;
  1038. box-shadow: 0px 0px 16px 0px rgba(95, 109, 141, 0.16);
  1039. border: 1px solid #ebeced;
  1040. padding: 0 10px;
  1041. box-sizing: border-box;
  1042. .work-tag-select-row {
  1043. padding: 12px 0;
  1044. border-bottom: 1px solid #e9eaeb;
  1045. line-height: 2;
  1046. }
  1047. .work-tag-item {
  1048. font-size: 14px;
  1049. font-family: PingFangSC-Regular, PingFang SC;
  1050. font-weight: 400;
  1051. color: #0b121a;
  1052. margin: 0 10px;
  1053. // word-break: normal;
  1054. display: inline-block;
  1055. cursor: pointer;
  1056. &.cur {
  1057. color: #308eff;
  1058. }
  1059. }
  1060. }
  1061. .work-tag-list {
  1062. flex: 1;
  1063. height: 40px;
  1064. background: #ffffff;
  1065. border-radius: 4px;
  1066. // border: 1px solid #dcdfe6;
  1067. // display: flex;
  1068. // align-items: center;
  1069. // padding-left: 14px;
  1070. .el-tag + .el-tag {
  1071. margin-left: 10px;
  1072. }
  1073. }
  1074. .work-tag-placeholder {
  1075. font-size: 15px;
  1076. font-family: PingFangSC-Regular, PingFang SC;
  1077. font-weight: 400;
  1078. color: #c0c4cc;
  1079. user-select: none;
  1080. }
  1081. .work-tag-input {
  1082. width: 244px;
  1083. height: 40px;
  1084. background: #ffffff;
  1085. border-radius: 4px;
  1086. // border: 1px solid #dcdfe6;
  1087. margin-left: 16px;
  1088. }
  1089. .work-tag-ul {
  1090. margin-top: 16px;
  1091. .el-tag {
  1092. margin-right: 10px;
  1093. padding: 0 5px;
  1094. height: 22px;
  1095. border: 1px solid #308eff;
  1096. font-size: 12px;
  1097. font-family: PingFangSC-Regular, PingFang SC;
  1098. font-weight: 400;
  1099. color: #308eff;
  1100. line-height: 22px;
  1101. background: #fff;
  1102. }
  1103. }
  1104. .work-tag-input-placeholder {
  1105. width: 244px;
  1106. height: 40px;
  1107. background: #308eff;
  1108. border-radius: 4px;
  1109. text-align: center;
  1110. font-size: 15px;
  1111. font-family: PingFangSC-Regular, PingFang SC;
  1112. font-weight: 400;
  1113. color: #fff;
  1114. line-height: 40px;
  1115. text-indent: 14px;
  1116. cursor: pointer;
  1117. user-select: none;
  1118. }
  1119. .work-el-textarea {
  1120. position: relative;
  1121. .el-textarea__inner {
  1122. padding-top: 20px;
  1123. padding-bottom: 20px;
  1124. }
  1125. &::before {
  1126. content: "最少80字符哦~";
  1127. color: #909399;
  1128. background: #fff;
  1129. position: absolute;
  1130. font-size: 12px;
  1131. bottom: 5px;
  1132. left: 10px;
  1133. }
  1134. }
  1135. </style>
  1136. <style>
  1137. input::-webkit-outer-spin-button,
  1138. input::-webkit-inner-spin-button {
  1139. -webkit-appearance: none !important;
  1140. }
  1141. input[type="number"] {
  1142. -moz-appearance: textfield !important;
  1143. }
  1144. </style>