PanelView.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <div class="mobile-panel">
  3. <button
  4. class="return"
  5. @click="emits('close')"
  6. />
  7. <div
  8. class="mobile-panel__title"
  9. :style="{
  10. backgroundImage: `url(${require(`@/assets/images/mobile/bg_${theme}_01.jpg`)})`
  11. }"
  12. >
  13. <h1 :class="{small: title.length >= 9}">
  14. {{ title }}
  15. </h1>
  16. </div>
  17. <div
  18. class="mobile-panel__main"
  19. :class="{
  20. hasTab: tabbar.length
  21. }"
  22. :style="{
  23. backgroundImage: `url(${require(`@/assets/images/mobile/bg_${theme}_02.jpg`)})`
  24. }"
  25. >
  26. <div
  27. v-if="tabbar.length"
  28. class="tabbar"
  29. >
  30. <template
  31. v-for="(item, idx) in tabbar"
  32. :key="idx"
  33. >
  34. <span
  35. :class="{
  36. active: activeTabIdx === idx
  37. }"
  38. @click="activeTabIdx = idx"
  39. >
  40. {{ item }}
  41. </span>
  42. </template>
  43. </div>
  44. <slot />
  45. </div>
  46. <img
  47. class="mobile-panel__bd"
  48. :src="require(`@/assets/images/mobile/bg_${theme}_03.jpg`)"
  49. >
  50. </div>
  51. </template>
  52. <script setup>
  53. import { computed } from 'vue'
  54. const {
  55. windowSizeInCssForRef,
  56. windowSizeWhenDesignForRef,
  57. } = useSizeAdapt(1920, 970)
  58. const props = defineProps({
  59. theme: {
  60. type: Number,
  61. default: 1
  62. },
  63. tabbar: {
  64. type: Array,
  65. default: () => [],
  66. required: false
  67. },
  68. curTab: {
  69. type: Number,
  70. default: 0,
  71. required: true
  72. },
  73. title: {
  74. type: String,
  75. required: true
  76. }
  77. })
  78. const emits = defineEmits(['update:curTab', 'close'])
  79. const activeTabIdx = computed({
  80. set(val) {
  81. emits('update:curTab', val)
  82. },
  83. get() {
  84. return props.curTab
  85. }
  86. })
  87. </script>
  88. <style lang="less" scoped>
  89. .mobile-panel {
  90. display: flex;
  91. position: absolute;
  92. top: 0;
  93. left: 0;
  94. right: 0;
  95. bottom: 0;
  96. z-index: 1;
  97. .return{
  98. position: absolute;
  99. width: 100px;
  100. height: 100px;
  101. top: 10px;
  102. left: 42px;
  103. background-image: url(@/assets/images/btn-return.png);
  104. background-size: contain;
  105. background-repeat: no-repeat;
  106. background-position: center center;
  107. z-index: 1;
  108. }
  109. &__title {
  110. flex-shrink: 0;
  111. position: relative;
  112. width: calc(475 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  113. height: 100%;
  114. background: url("@/assets/images/mobile/bg_1_01.jpg") no-repeat center / cover;
  115. h1 {
  116. position: absolute;
  117. left: calc(50% + 12 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  118. top: calc(50% + 80 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  119. font-size: calc(60 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  120. font-family: "SourceHanSerifCN-SemiBold";
  121. color: #FBF7DC;
  122. writing-mode: vertical-lr;
  123. letter-spacing: 0.3em;
  124. transform: translate(-50%, -50%);
  125. white-space: nowrap;
  126. z-index: 1;
  127. &.small {
  128. font-size: calc(54 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  129. }
  130. }
  131. }
  132. &__main {
  133. position: relative;
  134. flex: 1;
  135. background: url("@/assets/images/mobile/bg_1_02.jpg") no-repeat center / cover;
  136. &.hasTab {
  137. padding-top: 70px;
  138. }
  139. .tabbar {
  140. position: absolute;
  141. display: flex;
  142. align-items: center;
  143. left: 0;
  144. top: 0;
  145. right: 0;
  146. span{
  147. flex: 1;
  148. position: relative;
  149. padding: 0 20px;
  150. line-height: 70px;
  151. color: #FFF3C3;
  152. background: #AC997F;
  153. font-size: 32px;
  154. letter-spacing: 8px;
  155. font-family: "SourceHanSerifCN-SemiBold";
  156. box-shadow: 3px 4px 9px 0px rgba(0,0,0,0.25);
  157. white-space: nowrap;
  158. cursor: pointer;
  159. text-align: center;
  160. &:not(:last-child)::after {
  161. content: '';
  162. top: 50%;
  163. right: -0.5px;
  164. position: absolute;
  165. width: 1px;
  166. height: calc(34 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  167. background-color: #FFF3C3;
  168. transform: translateY(-50%);
  169. }
  170. }
  171. .active{
  172. color: #43310E;
  173. background: linear-gradient(322deg, #C69D49 0%, #F8E6A9 68%);
  174. }
  175. }
  176. }
  177. &__bd {
  178. flex-shrink: 0;
  179. height: 100%;
  180. }
  181. }
  182. </style>