openingTipSettings.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <div class="opening-tip-settings">
  3. <span class="title">{{$i18n.t(`edit_settings.opening_tips_setting`)}}</span>
  4. <i class="iconfont icon-help_i tool-tip-for-editor" v-tooltip="$i18n.t(`edit_settings.opening_tips`)">
  5. </i>
  6. <br>
  7. <div class="image-selection">
  8. <div class="title">{{$i18n.t(`edit_settings.pc`)}}</div>
  9. <div class="bottom">
  10. <SelectedImage
  11. :imgSrc="info.workOpeningTip.pcIcon"
  12. :defaultImgSrc="require('@/assets/images/default/img_tipspc_default.png')"
  13. @cancel="onCancelPcTip"
  14. ></SelectedImage>
  15. <div class="bottom-right">
  16. <button class="ui-button submit" @click="isShowSelectionWindow = true, selectingFor = 'pc'">{{$i18n.t(`edit_settings.select_image`)}}</button>
  17. <div class="ui-remark" v-html="$i18n.t(`edit_settings.opening_size`)"></div>
  18. </div>
  19. </div>
  20. </div>
  21. <div class="image-selection">
  22. <div class="title">{{$i18n.t(`edit_settings.mobile`)}}</div>
  23. <div class="bottom">
  24. <SelectedImage
  25. :imgSrc="info.workOpeningTip.appIcon"
  26. :defaultImgSrc="require('@/assets/images/default/img_tipsmb_default.png')"
  27. @cancel="onCancelAppTip"
  28. ></SelectedImage>
  29. <div class="bottom-right">
  30. <button class="ui-button submit" @click="isShowSelectionWindow = true, selectingFor = 'mobile'">{{$i18n.t(`edit_settings.select_image`)}}</button>
  31. <div class="ui-remark" v-html="$i18n.t(`edit_settings.opening_size`)"></div>
  32. </div>
  33. </div>
  34. </div>
  35. <div class="title">{{$i18n.t(`edit_settings.show_setting`)}}</div>
  36. <div class="switch-wrapper">
  37. <span class="label">{{$i18n.t(`edit_settings.first_notice`)}}</span>
  38. <switcher :value="info.workOpeningTip.isRemind" @change="onSwitcherChange"></switcher>
  39. </div>
  40. <div class="range-wrapper">
  41. <RangeItem :value="rang" @input="onRangeChange" />
  42. </div>
  43. <div class="dialog" style="z-index: 2000" v-if="isShowSelectionWindow">
  44. <MaterialSelector
  45. :title="$i18n.t(`gather.select_material`)"
  46. :isMultiSelection="false"
  47. @cancel="isShowSelectionWindow = false"
  48. @submit="handleSubmitFromMaterialSelector"
  49. :selectableType="['image']"
  50. />
  51. </div>
  52. </div>
  53. </template>
  54. <script>
  55. import MaterialSelector from "@/components/materialSelector.vue";
  56. import { mapGetters } from "vuex";
  57. import Switcher from "@/components/shared/Switcher";
  58. import RangeItem from "@/components/rangeItem/index.vue";
  59. import SelectedImage from "@/components/selectedImageInEditor.vue";
  60. export default {
  61. components: {
  62. MaterialSelector,
  63. Switcher,
  64. RangeItem,
  65. SelectedImage,
  66. },
  67. data() {
  68. return {
  69. isShowSelectionWindow: false,
  70. selectingFor: '', // 'pc', 'mobile'
  71. rang: {
  72. label: this.$i18n.t('edit_settings.display_time'),
  73. unit: this.$i18n.t('edit_settings.second'),
  74. value: 1,
  75. min: 0,
  76. max: 3,
  77. gradient: 1,
  78. tip:true
  79. }
  80. }
  81. },
  82. computed: {
  83. ...mapGetters({
  84. // info:'info'
  85. info:'base/baseInfo'
  86. })
  87. },
  88. mounted() {
  89. this.$nextTick(()=>{
  90. this.rang.value = this.info.workOpeningTip.remindTime
  91. })
  92. },
  93. methods: {
  94. handleSubmitFromMaterialSelector(selected) {
  95. if (this.selectingFor === 'pc') {
  96. this.info.workOpeningTip.pcIcon = selected[0].icon
  97. this.info.workOpeningTip.pcIconId = selected[0].id
  98. } else if (this.selectingFor === 'mobile') {
  99. this.info.workOpeningTip.appIcon = selected[0].icon
  100. this.info.workOpeningTip.appIconId = selected[0].id
  101. }
  102. this.isShowSelectionWindow = false
  103. },
  104. onCancelPcTip() {
  105. this.info.workOpeningTip.pcIcon = ''
  106. this.info.workOpeningTip.pcIconId = null
  107. },
  108. onCancelAppTip() {
  109. this.info.workOpeningTip.appIcon = ''
  110. this.info.workOpeningTip.appIconId = null
  111. },
  112. onSwitcherChange(data){
  113. this.info.workOpeningTip.isRemind = data
  114. },
  115. onRangeChange(data) {
  116. console.log(data.value);
  117. this.info.workOpeningTip.remindTime = parseInt(data.value)
  118. },
  119. }
  120. }
  121. </script>
  122. <style lang="less" scoped>
  123. .opening-tip-settings {
  124. padding: 24px 30px;
  125. background: #252526;
  126. height: 546px;
  127. .title {
  128. font-size: 18px;
  129. color: #FFFFFF;
  130. }
  131. .tool-tip-for-editor {
  132. margin-left: 4px;
  133. font-size: 12px;
  134. cursor: default;
  135. position: relative;
  136. top: -2px;
  137. }
  138. .image-selection {
  139. width: 50%;
  140. display: inline-block;
  141. margin-top: 16px;
  142. margin-bottom: 24px;
  143. .title {
  144. color: rgba(255, 255, 255, 0.6);
  145. font-size: 14px;
  146. margin-bottom: 16px;
  147. }
  148. .bottom {
  149. display: flex;
  150. align-items: flex-start;
  151. .bottom-right {
  152. display: inline-block;
  153. button {
  154. margin-bottom: 20px;
  155. }
  156. .ui-remark {
  157. font-size: 14px;
  158. }
  159. }
  160. }
  161. }
  162. .switch-wrapper {
  163. display: flex;
  164. align-items: center;
  165. justify-content: space-between;
  166. margin-top: 18px;
  167. .label {
  168. color: rgba(255, 255, 255, 0.6);
  169. font-size: 14px;
  170. }
  171. }
  172. .range-wrapper {
  173. margin-top: 18px;
  174. }
  175. }
  176. </style>