Toolbar.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <template>
  2. <!-- 编辑器-基础-中间部分 -->
  3. <div class="app-view-toolbar app-view-full-toolbar">
  4. <div class="main">
  5. <div class="ui-title-big">基础设置</div>
  6. <div class="upload-con">
  7. <div class="uc-l">
  8. <div class="preview">
  9. <img :src="info.icon || require('@/assets/images/default/img_cover_default_2.png')" alt="" />
  10. <button class="ui-button submit setting-cover-btn" @click="onClickSettingCover">设置封面</button>
  11. </div>
  12. <div class="ui-remark">512*512px,支持jpg/png格式</div>
  13. </div>
  14. <div class="uc-r">
  15. <div class="ui-title">
  16. <span class="">标题</span>
  17. </div>
  18. <div class="title-input-wrapper">
  19. <input
  20. v-model="info.name"
  21. @blur="onTitleInputBlur"
  22. @keydown.enter="onTitleInputEnter"
  23. type="text"
  24. maxlength="50"
  25. placeholder="请输入作品标题"
  26. />
  27. <span class="count">{{titleLength}}/50</span>
  28. </div>
  29. <div class="ui-title jianjie"><span>简介</span></div>
  30. <div class="jianjie-textarea-wrapper">
  31. <textarea
  32. v-model="info.description"
  33. @blur="onDescriptionInputBlur"
  34. maxlength="500"
  35. placeholder="请输入作品简介"
  36. type="text"
  37. />
  38. <span class="count">{{jianjieLength}}/500</span>
  39. </div>
  40. </div>
  41. </div>
  42. <menu>
  43. <li
  44. v-for="(item) in tabs"
  45. :key="item"
  46. :class="{active: activeTab === item}"
  47. @click="activeTab = item"
  48. >
  49. {{item}}
  50. </li>
  51. </menu>
  52. <div class="settings-view-wrapper">
  53. <OpeningTipSettings v-show="activeTab === '开场提示'"></OpeningTipSettings>
  54. <OpeningAnimationSettings v-show="activeTab === '开场动画'"></OpeningAnimationSettings>
  55. <PasswordSettings v-show="activeTab === '访问密码'"></PasswordSettings>
  56. <AutoCruiseSettings v-show="activeTab === '自动巡游'"></AutoCruiseSettings>
  57. <BackgroundMusicSettings v-show="activeTab === '背景音乐'"></BackgroundMusicSettings>
  58. <CustomLogoSettings v-show="activeTab === '自定义LOGO'"></CustomLogoSettings>
  59. <CustomMaskSettings v-show="activeTab === '自定义遮罩'"></CustomMaskSettings>
  60. <CustomButtonSettings v-show="activeTab === '自定义按钮'"></CustomButtonSettings>
  61. </div>
  62. </div>
  63. <div class="dialog" style="z-index: 2000" v-if="isShowSettingCoverWindow">
  64. <MaterialSelectorForEditor
  65. :selectableType="['image', 'pano', '3D']"
  66. title="选择素材"
  67. @cancle="isShowSettingCoverWindow = false"
  68. @submit="onCoverSelected"
  69. />
  70. </div>
  71. </div>
  72. </template>
  73. <script>
  74. import { mapGetters } from "vuex";
  75. import MaterialSelectorForEditor from "@/components/materialSelectorForEditor.vue";
  76. import OpeningTipSettings from '@/views/base/openingTipSettings.vue'
  77. import OpeningAnimationSettings from '@/views/base/openingAnimationSettings.vue'
  78. import PasswordSettings from "@/views/base/passwordSettings.vue";
  79. import AutoCruiseSettings from '@/views/base/autoCruiseSettings.vue'
  80. import BackgroundMusicSettings from "@/views/base/backgroundMusicSettings.vue";
  81. import CustomLogoSettings from "@/views/base/customLogoSettings.vue";
  82. import CustomMaskSettings from "@/views/base/customMaskSettings.vue";
  83. import CustomButtonSettings from "@/views/base/customButtonSettings.vue";
  84. export default {
  85. components: {
  86. MaterialSelectorForEditor,
  87. OpeningTipSettings,
  88. OpeningAnimationSettings,
  89. PasswordSettings,
  90. AutoCruiseSettings,
  91. BackgroundMusicSettings,
  92. CustomLogoSettings,
  93. CustomMaskSettings,
  94. CustomButtonSettings,
  95. },
  96. data() {
  97. return {
  98. isShowSettingCoverWindow: false,
  99. tabs: [
  100. '开场提示',
  101. '开场动画',
  102. '访问密码',
  103. '自动巡游',
  104. '背景音乐',
  105. '自定义LOGO',
  106. '自定义遮罩',
  107. '自定义按钮',
  108. ],
  109. activeTab: '开场提示',
  110. }
  111. },
  112. computed: {
  113. ...mapGetters({
  114. info: 'info'
  115. }),
  116. titleLength() {
  117. return this.info?.name?.length || '0'
  118. },
  119. jianjieLength() {
  120. return this.info?.description?.length || '0'
  121. },
  122. },
  123. mounted() {
  124. },
  125. watch: {
  126. },
  127. methods: {
  128. onClickSettingCover() {
  129. this.isShowSettingCoverWindow = true
  130. },
  131. onCoverSelected(selected) {
  132. if (selected[0].materialType === 'image') {
  133. this.info.icon = selected[0].icon
  134. } else if (selected[0].materialType === 'pano') {
  135. this.info.icon = selected[0].icon
  136. } else if (selected[0].materialType === '3D') {
  137. this.info.icon = selected[0].thumb
  138. }
  139. this.isShowSettingCoverWindow = false
  140. },
  141. onTitleInputBlur() {
  142. this.info.name = this.info.name.trim()
  143. },
  144. onTitleInputEnter(e) {
  145. e.target.blur()
  146. },
  147. onDescriptionInputBlur() {
  148. this.info.description = this.info.description.trim()
  149. }
  150. },
  151. }
  152. </script>
  153. <style lang="less" scoped>
  154. .main {
  155. position: fixed;
  156. width: 930px;
  157. top: 90px;
  158. left: calc(50% - (930px) / 2);
  159. }
  160. .upload-con {
  161. display: flex;
  162. margin-bottom: 30px;
  163. .uc-l {
  164. .preview {
  165. overflow: hidden;
  166. position: relative;
  167. img {
  168. height: 100%;
  169. }
  170. .setting-cover-btn {
  171. position: absolute;
  172. left: 50%;
  173. transform: translateX(-50%);
  174. bottom: 16px;
  175. }
  176. }
  177. .ui-remark{
  178. margin-top: 16px;
  179. }
  180. }
  181. .uc-r {
  182. width: 100%;
  183. > .title-input-wrapper {
  184. position: relative;
  185. border: 1px solid rgba(151, 151, 151, 0.2);
  186. padding: 0 16px;
  187. background: #252526;
  188. border-radius: 2px;
  189. height: 36px;
  190. width: 100%;
  191. &:focus-within {
  192. border-color: #0076F6;
  193. }
  194. > input {
  195. border: none;
  196. background: transparent;
  197. outline: none;
  198. height: 100%;
  199. width: calc(100% - 50px);
  200. padding: 0;
  201. color: #fff;
  202. letter-spacing: 1px;
  203. font-size: 14px;
  204. }
  205. > .count {
  206. position: absolute;
  207. top: 50%;
  208. transform: translateY(-50%);
  209. right: 16px;
  210. font-size: 14px;
  211. color: rgba(255, 255, 255, 0.2);
  212. }
  213. }
  214. > .jianjie {
  215. margin-top: 20px;
  216. }
  217. > .jianjie-textarea-wrapper {
  218. position: relative;
  219. border: 1px solid rgba(151, 151, 151, 0.2);
  220. background: #252526;
  221. border-radius: 2px;
  222. height: 123px;
  223. width: 100%;
  224. &:focus-within {
  225. border-color: #0076F6;
  226. }
  227. > textarea {
  228. padding: 9px 16px 30px 16px;
  229. resize: none;
  230. border: none;
  231. background: transparent;
  232. outline: none;
  233. width: 100%;
  234. height: calc(100% - 30px);
  235. color: #fff;
  236. letter-spacing: 1px;
  237. font-size: 14px;
  238. }
  239. > .count {
  240. position: absolute;
  241. right: 16px;
  242. bottom: 9px;
  243. font-size: 14px;
  244. color: rgba(255, 255, 255, 0.2);
  245. }
  246. }
  247. }
  248. }
  249. menu {
  250. display: inline-block;
  251. width: 133px;
  252. font-size: 14px;
  253. color: rgba(255, 255, 255, 0.5);
  254. padding-left: 0;
  255. margin: 0;
  256. vertical-align: top;
  257. li {
  258. display: block;
  259. height: 47px;
  260. padding-left: 16px;
  261. cursor: pointer;
  262. &::after {
  263. content: "";
  264. display: inline-block;
  265. height: 100%;
  266. vertical-align: middle;
  267. }
  268. &.active {
  269. font-size: 16px;
  270. font-weight: bold;
  271. color: #FFFFFF;
  272. background: #252526;
  273. &::before {
  274. content: "";
  275. display: inline-block;
  276. width: 2px;
  277. height: 10px;
  278. border-radius: 1px;
  279. background: #0076F6;
  280. margin-right: 4px;
  281. vertical-align: middle;
  282. }
  283. }
  284. }
  285. }
  286. .settings-view-wrapper {
  287. vertical-align: top;
  288. display: inline-block;
  289. width: 797px;
  290. }
  291. </style>