PanelView.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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. margin-left: constant(safe-area-inset-left);
  100. margin-left: env(safe-area-inset-left);
  101. width: 100px;
  102. height: 100px;
  103. right: 42px;
  104. bottom: 30px;
  105. background-image: url(@/assets/images/btn-return.png);
  106. background-size: contain;
  107. background-repeat: no-repeat;
  108. background-position: center center;
  109. z-index: 1;
  110. }
  111. &__title {
  112. flex-shrink: 0;
  113. position: relative;
  114. width: calc(475 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  115. height: 100%;
  116. background: url("@/assets/images/mobile/bg_1_01.jpg") no-repeat center / cover;
  117. h1 {
  118. position: absolute;
  119. left: calc(50% + 12 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  120. top: calc(50% + 80 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  121. font-size: calc(60 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  122. font-family: "SourceHanSerifCN-SemiBold";
  123. color: #FBF7DC;
  124. writing-mode: vertical-lr;
  125. letter-spacing: 0.3em;
  126. transform: translate(-50%, -50%);
  127. white-space: nowrap;
  128. z-index: 1;
  129. &.small {
  130. font-size: calc(54 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  131. }
  132. }
  133. }
  134. &__main {
  135. position: relative;
  136. flex: 1;
  137. background: url("@/assets/images/mobile/bg_1_02.jpg") no-repeat center / cover;
  138. &.hasTab {
  139. padding-top: 70px;
  140. }
  141. .tabbar {
  142. position: absolute;
  143. display: flex;
  144. align-items: center;
  145. left: 0;
  146. top: 0;
  147. span{
  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. cursor: pointer;
  158. &:not(:last-child)::after {
  159. content: '';
  160. top: 50%;
  161. right: -0.5px;
  162. position: absolute;
  163. width: 1px;
  164. height: calc(34 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  165. background-color: #FFF3C3;
  166. transform: translateY(-50%);
  167. }
  168. }
  169. .active{
  170. color: #43310E;
  171. background: linear-gradient(322deg, #C69D49 0%, #F8E6A9 68%);
  172. }
  173. }
  174. }
  175. &__bd {
  176. flex-shrink: 0;
  177. height: 100%;
  178. }
  179. }
  180. </style>