JDScene.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <div class="scene-integrated w">
  3. <div class="scene-inner flex" :style="{ background: dataInfo.themeColor }">
  4. <!-- 左侧标题区 -->
  5. <div class="scene-left">
  6. <div class="s-h-group flex">
  7. <h3 class="s-main-t">{{ dataInfo.mainTitle }}</h3>
  8. <span class="s-sub-t">{{ dataInfo.subTitle }}</span>
  9. </div>
  10. <div class="enter-pill" @click="onPath(dataInfo.jumpLink)">{{ dataInfo.btnText }} <i class="arr-ic"></i></div>
  11. </div>
  12. <!-- 右侧卡片区 -->
  13. <div class="scene-right flex-1">
  14. <div class="s-grid-h flex">
  15. <div class="s-item-card" :style="{ background: s.bgColor, opacity: s.opacity }" v-for="(s, i) in dataInfo.cardList" :key="i">
  16. <div class="item-top flex-between">
  17. <div class="item-info flex">
  18. <p class="item-t" :style="{ color: s.titleColor }">{{ s.title }}</p>
  19. <p class="item-d" :style="{ color: s.subTitleColor }">{{ s.subTitle }}</p>
  20. </div>
  21. <div class="item-arrow">
  22. <i class="icon-arr"></i>
  23. </div>
  24. </div>
  25. <div class="item-pic">
  26. <el-image class="item-img" :src="s.imageUrl" />
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. </template>
  34. <script setup name="Index" lang="ts">
  35. import { currentScenarioGlobalSetting } from '@/api/home/index-enterprise';
  36. import { onPath } from '@/utils/siteConfig';
  37. const dataInfo = ref<any>({
  38. cardList: []
  39. });
  40. currentScenarioGlobalSetting({}).then((res) => {
  41. if (res.code == 200) {
  42. dataInfo.value = res.data;
  43. }
  44. });
  45. const scenes = [
  46. { title: '耗材采购', desc: '纸墨随买随用', img: '@/assets/jd/scene_stationery.png' },
  47. { title: '防暑降温', desc: '守护员工健康', img: '@/assets/jd/scene_cooling.png' },
  48. { title: '员工团建', desc: '同心聚力', img: '@/assets/jd/scene_teambuilding.png' },
  49. { title: '营销物资', desc: '全场景解决方案', img: '@/assets/jd/scene_marketing.png' }
  50. ];
  51. </script>
  52. <style scoped>
  53. .scene-integrated {
  54. margin-top: 15px;
  55. }
  56. .scene-inner {
  57. background: linear-gradient(90deg, #6be7b5 0%, #39d696 100%);
  58. border-radius: 12px;
  59. padding: 14px 20px;
  60. align-items: center;
  61. min-height: 140px;
  62. }
  63. .scene-left {
  64. width: 380px;
  65. color: #fff;
  66. padding-right: 20px;
  67. }
  68. .s-h-group {
  69. align-items: baseline;
  70. margin-bottom: 15px;
  71. }
  72. .s-main-t {
  73. font-size: 24px;
  74. font-weight: 800;
  75. white-space: nowrap;
  76. }
  77. .s-sub-t {
  78. font-size: 24px;
  79. font-weight: 800;
  80. opacity: 0.95;
  81. margin-left: 12px;
  82. white-space: nowrap;
  83. }
  84. .enter-pill {
  85. display: inline-flex;
  86. align-items: center;
  87. background: #fff;
  88. color: #e1251b;
  89. padding: 6px 18px;
  90. border-radius: 20px;
  91. font-size: 13px;
  92. font-weight: bold;
  93. text-decoration: none;
  94. cursor: pointer;
  95. }
  96. .arr-ic {
  97. display: inline-block;
  98. width: 12px;
  99. height: 12px;
  100. background: #e1251b;
  101. border-radius: 50%;
  102. margin-left: 6px;
  103. position: relative;
  104. }
  105. .arr-ic::after {
  106. content: '';
  107. position: absolute;
  108. left: 3px;
  109. top: 3px;
  110. width: 4px;
  111. height: 4px;
  112. border-top: 2px solid #fff;
  113. border-right: 2px solid #fff;
  114. transform: rotate(45deg);
  115. }
  116. .scene-right {
  117. overflow: hidden;
  118. }
  119. .s-grid-h {
  120. gap: 10px;
  121. }
  122. .s-item-card {
  123. flex: 1;
  124. background: #e8fbf1; /* Pale green background matching Figure 2 */
  125. border-radius: 10px;
  126. height: 130px;
  127. display: flex;
  128. flex-direction: column;
  129. overflow: hidden;
  130. transition: transform 0.3s;
  131. }
  132. .s-item-card:hover {
  133. transform: translateY(-3px);
  134. }
  135. .item-top {
  136. padding: 8px 12px;
  137. align-items: center;
  138. }
  139. .item-info {
  140. align-items: baseline;
  141. gap: 8px;
  142. }
  143. .item-t {
  144. font-size: 18px;
  145. font-weight: 900;
  146. color: #026034;
  147. white-space: nowrap;
  148. }
  149. .item-d {
  150. font-size: 13px;
  151. font-weight: 600;
  152. color: #111;
  153. white-space: nowrap;
  154. overflow: hidden;
  155. text-overflow: ellipsis;
  156. }
  157. .item-arrow {
  158. width: 16px;
  159. height: 16px;
  160. background: #34c759;
  161. border-radius: 50%;
  162. display: flex;
  163. align-items: center;
  164. justify-content: center;
  165. flex-shrink: 0;
  166. }
  167. .icon-arr {
  168. width: 4px;
  169. height: 4px;
  170. border-top: 2px solid #fff;
  171. border-right: 2px solid #fff;
  172. transform: rotate(45deg);
  173. margin-left: -1px;
  174. }
  175. .item-pic {
  176. flex: 1;
  177. overflow: hidden;
  178. padding: 0 8px 8px;
  179. }
  180. .item-img {
  181. width: 100%;
  182. height: 100%;
  183. object-fit: cover;
  184. border-radius: 6px;
  185. }
  186. @media screen and (max-width: 1599px) {
  187. .scene-left {
  188. width: 340px;
  189. }
  190. .s-main-t {
  191. font-size: 20px;
  192. }
  193. .s-sub-t {
  194. font-size: 20px;
  195. font-weight: 800;
  196. }
  197. .s-item-card:nth-child(4) {
  198. display: none;
  199. } /* 当宽度小于 1600px 时隐藏第4个卡片 */
  200. }
  201. @media screen and (max-width: 1209px) {
  202. .s-item-card:nth-child(3) {
  203. display: none;
  204. } /* 宽度更小时隐藏第3个卡片 */
  205. }
  206. </style>