coverBase.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869
  1. <template>
  2. <!--
  3. info里面的数据介绍
  4. 封面类型下拉框 coverSelect
  5. videoAndImg:图片+视频
  6. img:图片
  7. video:视频
  8. ----------图片
  9. pc端图片地址 coverPc
  10. pc端图片位置 coverPcLoc
  11. center:居中
  12. full:全屏
  13. 移动端图片地址 coverMo
  14. 移动端图片位置 coverMoLoc
  15. center:居中
  16. full:全屏
  17. 图片的背景设置下拉框 coverImgBac
  18. colorFill:纯色填充
  19. imgTile:图片平铺
  20. 图片背景颜色选择纯色填充的色值 imgColorSelec
  21. 图片背景选择图片平铺的图片地址 coverBac
  22. --------视频
  23. pc端视频地址 videoPc
  24. pc端视频图片 videoPcIcon
  25. pc端视频位置 videoPcLoc
  26. center:居中
  27. full:全屏
  28. 移动端视频地址 videoMo
  29. 移动端端视频图片 videoMoIcon
  30. 移动端视频位置 videoMoLoc
  31. center:居中
  32. full:全屏
  33. 视频的背景设置下拉框 coverVideoBac
  34. colorFill:纯色填充
  35. imgTile:图片平铺
  36. 视频背景颜色选择纯色填充的色值 videoColorSelec
  37. 视频背景选择图片平铺的图片地址 videoBacImg
  38. 视频的进入方式 coverVideoInWay
  39. 0:播放完不自动进入
  40. 1:播放完自动进入
  41. 视频控件是否显示 coverVideoControl
  42. 0:不显示
  43. 1:显示
  44. 视频的出场顺序 coverVideoOrder
  45. before:开场图片前
  46. later:开场图片后
  47. -->
  48. <div class="coverBase" v-if="info.coverInfo">
  49. <!-- 顶上标题 -->
  50. <span class="title">{{ coverBase_button }}</span>
  51. <i
  52. class="iconfont icon-material_prompt tool-tip-for-editor"
  53. v-tooltip="coverBase_button_tips"
  54. >
  55. </i>
  56. <br />
  57. <div class="switch-wrapper">
  58. <span class="label">{{$i18n.t('edit_settings.cover_show')}}</span>
  59. <Switcher :value="info.coverInfo.isShowCover" @change="onSwitcherChange"></Switcher>
  60. </div>
  61. <div class="cover_pull">
  62. <!-- 封面类型选择下拉框 -->
  63. <div class="cover_pull_tit">{{ cover_pull_tit }}</div>
  64. <Select v-model="info.coverInfo.coverSelect">
  65. <Option
  66. v-for="item in selecList"
  67. :key="item.type"
  68. :label="item.txt"
  69. :value="item.type"
  70. >
  71. </Option>
  72. </Select>
  73. <!-- 关于图片 -->
  74. <div class="mainImgBox" v-show="info.coverInfo.coverSelect !== 'video'">
  75. <div class="coverImgTit">{{ coverImgTit }}</div>
  76. <div class="coverImgBox">
  77. <!-- pc图片 -->
  78. <div class="coverImgBox_ll">
  79. <div class="tit">{{ $i18n.t(`edit_settings.pc`) }}</div>
  80. <div class="coverImgMain">
  81. <SelectedImage
  82. :imgSrc="info.coverInfo.coverPc"
  83. :defaultImgSrc="require('@/assets/img/coverUpTit1.png')"
  84. @cancel="onCancelPcTip"
  85. ></SelectedImage>
  86. <div class="imgRight">
  87. <!-- 上传图片按钮 -->
  88. <button
  89. class="ui-button submit"
  90. @click="
  91. (isShowSelectionWindow = true),
  92. (selectingFor = 'pc'),
  93. (upType = 'image'),
  94. (upTypeSta = 'imgBac')
  95. "
  96. >
  97. {{ $i18n.t(`edit_settings.select_image`) }}
  98. </button>
  99. <!-- 上传提示 -->
  100. <div
  101. class="ui-remark"
  102. v-html="$i18n.t(`edit_settings.coverUpTit1`)"
  103. ></div>
  104. <!-- 选择居中和全屏 -->
  105. <div class="coverImglocBox">
  106. <div
  107. :class="{ active: info.coverInfo.coverPcLoc === 'center' }"
  108. @click="info.coverInfo.coverPcLoc = 'center'"
  109. >
  110. <div class="inco"></div>
  111. <div class="txt">{{ coverImgLoc1 }}</div>
  112. </div>
  113. <div
  114. :class="{ active: info.coverInfo.coverPcLoc === 'full' }"
  115. @click="info.coverInfo.coverPcLoc = 'full'"
  116. >
  117. <div class="inco inco2"></div>
  118. <div class="txt">{{ coverImgLoc2 }}</div>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </div>
  124. <div class="coverImgBox_rr">
  125. <div class="tit">{{ $i18n.t(`edit_settings.mobile`) }}</div>
  126. <!-- 移动端图片 -->
  127. <div class="coverImgMain">
  128. <SelectedImage
  129. :imgSrc="info.coverInfo.coverMo"
  130. :defaultImgSrc="require('@/assets/img/coverUpTit1.png')"
  131. @cancel="onCancelAppTip"
  132. ></SelectedImage>
  133. <div class="imgRight">
  134. <!-- 上传图片按钮 -->
  135. <button
  136. class="ui-button submit"
  137. @click="
  138. (isShowSelectionWindow = true),
  139. (selectingFor = 'mobile'),
  140. (upType = 'image'),
  141. (upTypeSta = 'imgBac')
  142. "
  143. >
  144. {{ $i18n.t(`edit_settings.select_image`) }}
  145. </button>
  146. <!-- 上传提示 -->
  147. <div
  148. class="ui-remark"
  149. v-html="$i18n.t(`edit_settings.coverUpTit2`)"
  150. ></div>
  151. <!-- 选择居中和全屏 -->
  152. <div class="coverImglocBox">
  153. <div
  154. :class="{ active: info.coverInfo.coverMoLoc === 'center' }"
  155. @click="info.coverInfo.coverMoLoc = 'center'"
  156. >
  157. <div class="inco"></div>
  158. <div class="txt">{{ coverImgLoc1 }}</div>
  159. </div>
  160. <div
  161. :class="{ active: info.coverInfo.coverMoLoc === 'full' }"
  162. @click="info.coverInfo.coverMoLoc = 'full'"
  163. >
  164. <div class="inco inco2"></div>
  165. <div class="txt">{{ coverImgLoc2 }}</div>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. <!-- 图片背景设置 -->
  173. <div class="coverImgBacBox">
  174. <div class="tit">{{ $i18n.t(`edit_settings.coverImgBacTit`) }}</div>
  175. <Select v-model="info.coverInfo.coverImgBac">
  176. <Option
  177. v-for="item in coverImgBacList"
  178. :key="item.type"
  179. :label="item.txt"
  180. :value="item.type"
  181. >
  182. </Option>
  183. </Select>
  184. <!-- 选择颜色 -->
  185. <div
  186. class="imgColorSelec"
  187. v-show="info.coverInfo.coverImgBac === 'colorFill'"
  188. >
  189. <div class="ll">{{ info.coverInfo.imgColorSelec }}</div>
  190. <div
  191. class="rr"
  192. :style="`background-color: ${info.coverInfo.imgColorSelec};`"
  193. ></div>
  194. <ColorPicker
  195. @change="imgColorSelecChange"
  196. v-model="info.coverInfo.imgColorSelec"
  197. :predefine="predefineColors"
  198. >
  199. </ColorPicker>
  200. </div>
  201. <!-- 选择背景图片 -->
  202. <div
  203. class="imgClolrBacImg"
  204. v-show="info.coverInfo.coverImgBac === 'imgTile'"
  205. >
  206. <SelectedImage
  207. :imgSrc="info.coverInfo.coverBac"
  208. :defaultImgSrc="require('@/assets/img/coverUpTit1.png')"
  209. @cancel="onCancelBac"
  210. ></SelectedImage>
  211. <!-- 上传图片按钮 -->
  212. <div class="imgRight">
  213. <button
  214. class="ui-button submit"
  215. @click="
  216. (isShowSelectionWindow = true),
  217. (selectingFor = 'bac'),
  218. (upType = 'image'),
  219. (upTypeSta = 'imgBac')
  220. "
  221. >
  222. {{ $i18n.t(`edit_settings.select_image`) }}
  223. </button>
  224. <div
  225. class="ui-remark"
  226. v-html="$i18n.t(`edit_settings.coverUpTit3`)"
  227. ></div>
  228. </div>
  229. </div>
  230. </div>
  231. </div>
  232. <!-- 关于视频 -->
  233. <div class="mainVideoBox" v-show="info.coverInfo.coverSelect !== 'img'">
  234. <div class="coverImgTit">
  235. {{ $i18n.t(`edit_settings.coverVideoTit`) }}
  236. </div>
  237. <div class="coverImgBox">
  238. <!-- pc视频 -->
  239. <div class="coverImgBox_ll">
  240. <div class="tit">{{ $i18n.t(`edit_settings.pc`) }}</div>
  241. <div class="coverImgMain">
  242. <SelectedImage
  243. :imgSrc="info.coverInfo.videoPcIcon"
  244. :defaultImgSrc="require('@/assets/img/coverUpTit2.png')"
  245. @cancel="clearVideoPc"
  246. ></SelectedImage>
  247. <div class="imgRight">
  248. <!-- 上传视频按钮 -->
  249. <button
  250. class="ui-button submit"
  251. @click="
  252. (isShowSelectionWindow = true),
  253. (selectingFor = 'pc'),
  254. (upType = 'video'),
  255. (upTypeSta = 'videoBac')
  256. "
  257. >
  258. {{ $i18n.t(`edit_settings.select_video`) }}
  259. </button>
  260. <!-- 上传提示 -->
  261. <div
  262. class="ui-remark"
  263. v-html="$i18n.t(`edit_settings.coverUpTit4`)"
  264. ></div>
  265. <!-- 选择居中和全屏 -->
  266. <div class="coverImglocBox">
  267. <div
  268. :class="{ active: info.coverInfo.videoPcLoc === 'center' }"
  269. @click="info.coverInfo.videoPcLoc = 'center'"
  270. >
  271. <div class="inco"></div>
  272. <div class="txt">{{ coverImgLoc1 }}</div>
  273. </div>
  274. <div
  275. :class="{ active: info.coverInfo.videoPcLoc === 'full' }"
  276. @click="info.coverInfo.videoPcLoc = 'full'"
  277. >
  278. <div class="inco inco2"></div>
  279. <div class="txt">{{ coverImgLoc2 }}</div>
  280. </div>
  281. </div>
  282. </div>
  283. </div>
  284. </div>
  285. <div class="coverImgBox_rr">
  286. <div class="tit">{{ $i18n.t(`edit_settings.mobile`) }}</div>
  287. <!-- 移动端视频 -->
  288. <div class="coverImgMain">
  289. <SelectedImage
  290. :imgSrc="info.coverInfo.videoMoIcon"
  291. :defaultImgSrc="require('@/assets/img/coverUpTit2.png')"
  292. @cancel="claerVideoMo"
  293. ></SelectedImage>
  294. <div class="imgRight">
  295. <!-- 上传视频按钮 -->
  296. <button
  297. class="ui-button submit"
  298. @click="
  299. (isShowSelectionWindow = true),
  300. (selectingFor = 'mobile'),
  301. (upType = 'video'),
  302. (upTypeSta = 'videoBac')
  303. "
  304. >
  305. {{ $i18n.t(`edit_settings.select_video`) }}
  306. </button>
  307. <!-- 上传提示 -->
  308. <div
  309. class="ui-remark"
  310. v-html="$i18n.t(`edit_settings.coverUpTit5`)"
  311. ></div>
  312. <!-- 选择居中和全屏 -->
  313. <div class="coverImglocBox">
  314. <div
  315. :class="{ active: info.coverInfo.videoMoLoc === 'center' }"
  316. @click="info.coverInfo.videoMoLoc = 'center'"
  317. >
  318. <div class="inco"></div>
  319. <div class="txt">{{ coverImgLoc1 }}</div>
  320. </div>
  321. <div
  322. :class="{ active: info.coverInfo.videoMoLoc === 'full' }"
  323. @click="info.coverInfo.videoMoLoc = 'full'"
  324. >
  325. <div class="inco inco2"></div>
  326. <div class="txt">{{ coverImgLoc2 }}</div>
  327. </div>
  328. </div>
  329. </div>
  330. </div>
  331. </div>
  332. </div>
  333. <!-- 视频背景设置 -->
  334. <div class="coverImgBacBox">
  335. <div class="tit">{{ $i18n.t(`edit_settings.coverImgBacTit`) }}</div>
  336. <Select v-model="info.coverInfo.coverVideoBac">
  337. <Option
  338. v-for="item in coverImgBacList"
  339. :key="item.type"
  340. :label="item.txt"
  341. :value="item.type"
  342. >
  343. </Option>
  344. </Select>
  345. <!-- 选择颜色 -->
  346. <div
  347. class="imgColorSelec"
  348. v-show="info.coverInfo.coverVideoBac === 'colorFill'"
  349. >
  350. <div class="ll">{{ info.coverInfo.videoColorSelec }}</div>
  351. <div
  352. class="rr"
  353. :style="`background-color: ${info.coverInfo.videoColorSelec};`"
  354. ></div>
  355. <ColorPicker
  356. @change="videoColorSelecChange"
  357. v-model="info.coverInfo.videoColorSelec"
  358. :predefine="predefineColors"
  359. >
  360. </ColorPicker>
  361. </div>
  362. <!-- 选择背景图片 -->
  363. <div
  364. class="imgClolrBacImg"
  365. v-show="info.coverInfo.coverVideoBac === 'imgTile'"
  366. >
  367. <SelectedImage
  368. :imgSrc="info.coverInfo.videoBacImg"
  369. :defaultImgSrc="require('@/assets/img/coverUpTit1.png')"
  370. @cancel="onCancelBac2"
  371. ></SelectedImage>
  372. <!-- 上传图片按钮 -->
  373. <div class="imgRight">
  374. <button
  375. class="ui-button submit"
  376. @click="
  377. (isShowSelectionWindow = true),
  378. (selectingFor = 'bac'),
  379. (upType = 'image'),
  380. (upTypeSta = 'videoBac')
  381. "
  382. >
  383. {{ $i18n.t(`edit_settings.select_image`) }}
  384. </button>
  385. <div
  386. class="ui-remark"
  387. v-html="$i18n.t(`edit_settings.coverUpTit3`)"
  388. ></div>
  389. </div>
  390. </div>
  391. </div>
  392. <!-- 进入方式 -->
  393. <div class="coverImgTit">
  394. {{ $i18n.t(`edit_settings.coverVideoInWay`) }}
  395. </div>
  396. <div class="VideoTit">
  397. <div class="VideoTitL">
  398. {{ $i18n.t(`edit_settings.coverVideoInWayTit`) }}
  399. </div>
  400. <div class="VideoTitR">
  401. <Switcher
  402. :value="info.coverInfo.coverVideoInWay"
  403. @change="coverVideoInWayChange"
  404. ></Switcher>
  405. </div>
  406. </div>
  407. <!-- 视频控件 -->
  408. <div class="coverImgTit">
  409. {{ $i18n.t(`edit_settings.coverVideoControl`) }}
  410. </div>
  411. <div class="VideoTit">
  412. <div class="VideoTitL">
  413. {{ $i18n.t(`edit_settings.coverVideoControlTit`) }}
  414. </div>
  415. <div class="VideoTitR">
  416. <Switcher
  417. :value="info.coverInfo.coverVideoControl"
  418. @change="coverVideoControlChange"
  419. ></Switcher>
  420. </div>
  421. </div>
  422. <!-- 出现顺序 -->
  423. <div class="coverImgTit">
  424. {{ $i18n.t(`edit_settings.coverVideoOrder`) }}
  425. </div>
  426. <Select v-model="info.coverInfo.coverVideoOrder">
  427. <Option
  428. v-for="item in coverVideoOrderList"
  429. :key="item.type"
  430. :label="item.txt"
  431. :value="item.type"
  432. >
  433. </Option>
  434. </Select>
  435. </div>
  436. <br />
  437. <br />
  438. </div>
  439. <div class="dialog" style="z-index: 2000" v-if="isShowSelectionWindow">
  440. <MaterialSelector
  441. :title="$i18n.t(`gather.select_material`)"
  442. :isMultiSelection="false"
  443. @cancle="isShowSelectionWindow = false"
  444. @submit="handleSubmitFromMaterialSelector"
  445. :selectableType="[upType]"
  446. :initialMaterialType="upType"
  447. />
  448. </div>
  449. </div>
  450. </template>
  451. <script>
  452. import Switcher from "@/components/shared/Switcher";
  453. import { Select, Option, ColorPicker } from "element-ui";
  454. import { i18n } from "@/lang";
  455. import { mapGetters } from "vuex";
  456. import SelectedImage from "@/components/selectedImageInEditor.vue";
  457. import MaterialSelector from "@/components/materialSelector.vue";
  458. export default {
  459. name: "coverBase",
  460. components: {
  461. Select,
  462. Option,
  463. ColorPicker,
  464. Switcher,
  465. MaterialSelector,
  466. SelectedImage,
  467. },
  468. data() {
  469. return {
  470. coverBase_button: i18n.t("edit_settings.coverBase_button"),
  471. coverBase_button_tips: i18n.t("edit_settings.coverBase_button_tips"),
  472. cover_pull_tit: i18n.t("edit_settings.cover_pull_tit"),
  473. coverImgTit: i18n.t("edit_settings.coverImgTit"),
  474. coverImgLoc1: i18n.t("edit_settings.coverImgLoc1"),
  475. coverImgLoc2: i18n.t("edit_settings.coverImgLoc2"),
  476. upType: "",
  477. upTypeSta: "",
  478. selecList: [
  479. {
  480. txt: i18n.t("edit_settings.coverSelecVideoAndImg"),
  481. type: "videoAndImg",
  482. },
  483. { txt: i18n.t("edit_settings.coverSelecImg"), type: "img" },
  484. { txt: i18n.t("edit_settings.coverSelecVideo"), type: "video" },
  485. ],
  486. coverInfo: {
  487. // 封面类型下拉框数据
  488. coverSelect: "img",
  489. // 图片pc端位置
  490. coverPcLoc: "center",
  491. // 图片移动端位置
  492. coverMoLoc: "center",
  493. // 图片的背景设置
  494. coverImgBac: "colorFill",
  495. // 图片的背景颜色
  496. imgColorSelec: "#000000",
  497. // 有关上传视频
  498. // 视频pc端地址
  499. videoPc:'',
  500. // 视频pc端位置
  501. videoPcLoc: "center",
  502. // 视频pc端图片
  503. videoPcIcon:'',
  504. // 视频移动端地址
  505. videoMo:'',
  506. // 视频移动端位置
  507. videoMoLoc: "center",
  508. // 视频移动端图片
  509. videoMoIcon:'',
  510. // 视频的背景设置
  511. coverVideoBac: "colorFill",
  512. videoColorSelec: "#000000",
  513. // 视频的进入方式
  514. coverVideoInWay: 0,
  515. // 视频控件是否显示
  516. coverVideoControl: 0,
  517. // 视频的出现顺序
  518. coverVideoOrder: "before",
  519. isShowCover: 0
  520. },
  521. coverImgBacList: [
  522. { txt: i18n.t("edit_settings.coverImgBacSelec1"), type: "colorFill" },
  523. { txt: i18n.t("edit_settings.coverImgBacSelec2"), type: "imgTile" },
  524. ],
  525. predefineColors: [
  526. "#000000",
  527. "#ff4500",
  528. "#ff8c00",
  529. "#ffd700",
  530. "#90ee90",
  531. "#00ced1",
  532. "#1e90ff",
  533. "#c71585",
  534. ],
  535. isShowSelectionWindow: false,
  536. selectingFor: "", // 'pc', 'mobile'
  537. coverVideoOrderList: [
  538. { txt: i18n.t("edit_settings.coverVideoOrderTit1"), type: "before" },
  539. { txt: i18n.t("edit_settings.coverVideoOrderTit2"), type: "later" },
  540. ],
  541. };
  542. },
  543. computed: {
  544. ...mapGetters({
  545. info: "info",
  546. }),
  547. },
  548. watch: {},
  549. methods: {
  550. //是否显示
  551. onSwitcherChange(data) {
  552. console.log(data,'dadad');
  553. this.info.coverInfo.isShowCover = data
  554. },
  555. // 视频的进入方式
  556. coverVideoInWayChange(val) {
  557. this.info.coverInfo.coverVideoInWay = val;
  558. },
  559. coverVideoControlChange(val) {
  560. this.info.coverInfo.coverVideoControl = val;
  561. },
  562. // 图片的颜色选择器改变事件
  563. imgColorSelecChange(val) {
  564. this.info.coverInfo.imgColorSelec = val;
  565. },
  566. videoColorSelecChange(val) {
  567. this.info.coverInfo.videoColorSelec = val;
  568. },
  569. handleSubmitFromMaterialSelector(selected) {
  570. // 点击确定的时候是选择的图片上传
  571. if (this.upTypeSta === "imgBac") {
  572. if (this.selectingFor === "pc")
  573. this.info.coverInfo.coverPc = selected[0].icon;
  574. else if (this.selectingFor === "mobile")
  575. this.info.coverInfo.coverMo = selected[0].icon;
  576. else this.info.coverInfo.coverBac = selected[0].icon;
  577. } else {
  578. // 视频上传
  579. if (this.selectingFor === "pc"){
  580. console.log(selected[0],'selected[0]');
  581. this.info.coverInfo.videoPc = selected[0].ossPath;
  582. this.info.coverInfo.videoPcIcon = selected[0].icon;
  583. }
  584. else if (this.selectingFor === "mobile"){
  585. this.info.coverInfo.videoMo = selected[0].ossPath;
  586. this.info.coverInfo.videoMoIcon = selected[0].icon;
  587. }
  588. else this.info.coverInfo.videoBacImg = selected[0].icon;
  589. }
  590. this.isShowSelectionWindow = false;
  591. },
  592. onCancelPcTip() {
  593. this.info.coverInfo.coverPc = "";
  594. },
  595. onCancelAppTip() {
  596. this.info.coverInfo.coverMo = "";
  597. },
  598. onCancelBac() {
  599. this.info.coverInfo.coverBac = "";
  600. },
  601. // 关于视频
  602. clearVideoPc() {
  603. console.log(165168484);
  604. console.log(this.info.coverInfo.videoPc);
  605. this.info.coverInfo.videoPc = "";
  606. this.info.coverInfo.videoPcIcon = "";
  607. },
  608. claerVideoMo() {
  609. this.info.coverInfo.videoMo = "";
  610. this.info.coverInfo.videoMoIcon = "";
  611. },
  612. onCancelBac2() {
  613. this.info.coverInfo.videoBacImg = "";
  614. },
  615. },
  616. created() {
  617. if (!this.info.coverInfo) {
  618. this.$store.commit("SetInfo", {
  619. coverInfo: { ...this.coverInfo },
  620. ...this.info,
  621. });
  622. }
  623. // else{
  624. // this.coverInfo={...this.info.coverInfo}
  625. // }
  626. },
  627. mounted() {},
  628. beforeCreate() {}, //生命周期 - 创建之前
  629. beforeMount() {}, //生命周期 - 挂载之前
  630. beforeUpdate() {}, //生命周期 - 更新之前
  631. updated() {}, //生命周期 - 更新之后
  632. beforeDestroy() {}, //生命周期 - 销毁之前
  633. destroyed() {}, //生命周期 - 销毁完成
  634. activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
  635. };
  636. </script>
  637. <style lang='less' scoped>
  638. .coverBase {
  639. padding: 24px 30px;
  640. background: #252526;
  641. height: 520px;
  642. overflow-y: auto;
  643. .title {
  644. font-size: 18px;
  645. color: #ffffff;
  646. }
  647. .switch-wrapper {
  648. display: flex;
  649. align-items: center;
  650. justify-content: space-between;
  651. margin: 18px 0;
  652. .label {
  653. color: rgba(255, 255, 255, 0.6);
  654. font-size: 14px;
  655. }
  656. }
  657. .tool-tip-for-editor {
  658. margin-left: 4px;
  659. font-size: 12px;
  660. cursor: default;
  661. position: relative;
  662. top: -2px;
  663. }
  664. .cover_pull {
  665. margin-top: 10px;
  666. .cover_pull_tit {
  667. margin-bottom: 10px;
  668. font-size: 14px;
  669. color: rgba(255, 255, 255, 0.5);
  670. }
  671. /deep/.el-select {
  672. background: #1a1b1d;
  673. border-radius: 4px;
  674. border: 1px solid #404040;
  675. width: 300px;
  676. height: 36px;
  677. }
  678. /deep/.el-input {
  679. height: 36px;
  680. line-height: 36px;
  681. }
  682. /deep/.el-input__inner {
  683. color: #fff;
  684. height: 36px;
  685. line-height: 36px;
  686. background-color: transparent;
  687. border-color: transparent !important;
  688. }
  689. }
  690. .coverImgTit {
  691. font-size: 18px;
  692. color: #ffffff;
  693. margin-top: 16px;
  694. margin-bottom: 10px;
  695. }
  696. .coverImgBox {
  697. display: flex;
  698. justify-content: space-between;
  699. & > div {
  700. width: 48%;
  701. .tit {
  702. font-size: 14px;
  703. opacity: 0.5;
  704. margin-bottom: 10px;
  705. }
  706. .coverImgMain {
  707. display: flex;
  708. .imgBox {
  709. width: 136px;
  710. height: 136px;
  711. background: #1a1b1d;
  712. border-radius: 4px;
  713. border: 1px solid #404040;
  714. }
  715. .ui-remark {
  716. margin: 12px 0;
  717. font-size: 14px;
  718. }
  719. .coverImglocBox {
  720. display: flex;
  721. width: 140px;
  722. height: 36px;
  723. background: #1a1b1d;
  724. border-radius: 4px;
  725. border: 1px solid #404040;
  726. & > div {
  727. cursor: pointer;
  728. width: 50%;
  729. font-size: 14px;
  730. color: #fff;
  731. opacity: 0.5;
  732. display: flex;
  733. justify-content: center;
  734. align-items: center;
  735. .inco {
  736. margin-top: 2px;
  737. width: 16px;
  738. height: 16px;
  739. position: relative;
  740. border: 1px solid #fff;
  741. margin-right: 3px;
  742. &::before {
  743. content: "";
  744. position: absolute;
  745. top: 1px;
  746. left: 3px;
  747. width: 8px;
  748. height: 12px;
  749. background-color: #fff;
  750. }
  751. }
  752. .inco2 {
  753. &::before {
  754. content: "";
  755. position: absolute;
  756. top: 1px;
  757. left: 1px;
  758. width: 12px;
  759. height: 12px;
  760. background-color: #fff;
  761. }
  762. }
  763. }
  764. .active {
  765. opacity: 1;
  766. background-color: #0076f6;
  767. }
  768. }
  769. }
  770. }
  771. }
  772. .coverImgBacBox {
  773. margin-top: 16px;
  774. .tit {
  775. font-size: 14px;
  776. opacity: 0.5;
  777. margin-bottom: 10px;
  778. }
  779. }
  780. .imgColorSelec {
  781. cursor: pointer;
  782. width: 300px;
  783. height: 36px;
  784. margin-top: 10px;
  785. background: #1a1b1d;
  786. border-radius: 4px;
  787. border: 1px solid #404040;
  788. display: flex;
  789. justify-content: space-between;
  790. padding: 0 12px;
  791. align-items: center;
  792. position: relative;
  793. .rr {
  794. width: 20px;
  795. height: 20px;
  796. }
  797. /deep/.el-color-picker {
  798. position: absolute;
  799. top: 0;
  800. left: 0;
  801. z-index: 10;
  802. width: 298px;
  803. height: 36px;
  804. }
  805. /deep/.el-color-picker__trigger {
  806. opacity: 0;
  807. width: 298px;
  808. height: 36px;
  809. }
  810. }
  811. .imgClolrBacImg {
  812. margin-top: 10px;
  813. width: 334px;
  814. display: flex;
  815. .ui-remark {
  816. margin: 12px 0;
  817. font-size: 14px;
  818. }
  819. }
  820. .mainVideoBox {
  821. .VideoTit {
  822. display: flex;
  823. justify-content: space-between;
  824. margin-bottom: 10px;
  825. .VideoTitL {
  826. font-size: 14px;
  827. color: rgba(255, 255, 255, 0.5);
  828. }
  829. }
  830. }
  831. }
  832. </style>