index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <template>
  2. <div class="home-container AI-Design-container">
  3. <div class="header" v-if="loginMode === 'codeLogin' || agentFrom === 'zhsc'">
  4. <van-nav-bar title="首页"></van-nav-bar>
  5. </div>
  6. <div class="header" v-if="loginMode === 'wxidLogin' && agentFrom !== 'zhsc'">
  7. <van-nav-bar title="首页" left-arrow @click-left="returnPage" @click-right="toHome">
  8. <template #right>
  9. <van-icon name="wap-home-o" color="#333" size="26" />
  10. </template>
  11. </van-nav-bar>
  12. </div>
  13. <!-- 顶部装饰背景图 -->
  14. <div class="top-bg">
  15. <img v-show="currentTab === 'inside'" src="@/assets/AIDesign/top-inside.jpg" class="bg-image" />
  16. <img v-show="currentTab === 'outside'" src="@/assets/AIDesign/top-outside.jpg" class="bg-image" />
  17. </div>
  18. <!-- 新版tab -->
  19. <div class="new-tab-wrapper" :class="currentTab === 'outside' ? 'outside-tab-bg' : 'inside-tab-bg'">
  20. <div class="tab-title" @click="currentTab = 'outside'"></div>
  21. <div class="tab-title" @click="currentTab = 'inside'"></div>
  22. </div>
  23. <!-- 外墙-功能卡片区域 -->
  24. <div class="feature-cards" v-show="currentTab === 'outside'">
  25. <!-- 我要设计 -->
  26. <div class="card card-design" @click="handleDesignClick('outside')">
  27. <div class="card-content">
  28. <div class="card-title" style="color: #512E79;">我要设计</div>
  29. <div class="card-desc" style="color: #7F639E;">AI在线生图,快速预览效果</div>
  30. </div>
  31. <div class="card-icon">
  32. <img src="@/assets/AIDesign/design-robot.png" alt="设计图标" />
  33. </div>
  34. </div>
  35. <!-- 一键诊断 -->
  36. <div class="card card-diagnosis" @click="handleDiagnosisClick('outside')">
  37. <div class="card-content">
  38. <div class="card-title" style="color: #2F655B;">一键诊断</div>
  39. <div class="card-desc" style="color: #6D9587;">AI诊断墙面问题,提供解决方案</div>
  40. </div>
  41. <div class="card-icon">
  42. <img src="@/assets/AIDesign/diagnosis-printer.png" alt="诊断图标" />
  43. </div>
  44. </div>
  45. <!-- 五行推荐 -->
  46. <!-- <div class="card card-five-element" @click="handleFiveElementClick">
  47. <div class="card-content">
  48. <div class="card-title" style="color: #635A30;">五行推荐(规划中)</div>
  49. <div class="card-desc" style="color: #8F865B;">根据五行推荐最适合的颜色</div>
  50. </div>
  51. <div class="card-icon">
  52. <img src="@/assets/AIDesign/five-element-planet.png" alt="五行图标" />
  53. </div>
  54. </div> -->
  55. </div>
  56. <!-- 内墙-功能卡片区域 -->
  57. <div class="feature-cards" v-show="currentTab === 'inside'">
  58. <!-- 我要设计 -->
  59. <div class="card card-design" @click="handleDesignClick('inside')">
  60. <div class="card-content">
  61. <div class="card-title" style="color: #512E79;">我要设计</div>
  62. <div class="card-desc" style="color: #7F639E;">AI在线生图,快速预览效果</div>
  63. </div>
  64. <div class="card-icon">
  65. <img src="@/assets/AIDesign/design-robot.png" alt="设计图标" />
  66. </div>
  67. </div>
  68. <!-- 一键诊断 -->
  69. <div class="card card-diagnosis" @click="handleDiagnosisClick('inside')">
  70. <div class="card-content">
  71. <div class="card-title" style="color: #2F655B;">一键诊断</div>
  72. <div class="card-desc" style="color: #6D9587;">AI诊断墙面问题,提供解决方案</div>
  73. </div>
  74. <div class="card-icon">
  75. <img src="@/assets/AIDesign/diagnosis-printer.png" alt="诊断图标" />
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </template>
  81. <script lang="ts">
  82. import { Component, Vue } from "vue-property-decorator";
  83. import { toLBHome, getWxconfig, getWecomType, checkAndSaveUserWecomType } from '@/utils/index';
  84. import axios from "axios";
  85. declare let wx: any;
  86. @Component
  87. export default class extends Vue {
  88. private currentTab = 'outside';
  89. private agentFrom = '';
  90. // 入口新判断
  91. created() {
  92. getWxconfig();
  93. this.loginMode = window.localStorage.getItem("loginMode") || 'codeLogin';
  94. const agentFrom = window.localStorage.getItem('agentFrom');
  95. this.agentFrom = agentFrom;
  96. // 经销商随身邦,好邦手进去,默认在内墙空间;服务商进去,默认外墙空间
  97. if (agentFrom === 'ssb' || agentFrom === 'hbs') {
  98. this.currentTab = 'inside';
  99. } else {
  100. this.currentTab = 'outside';
  101. }
  102. checkAndSaveUserWecomType()
  103. }
  104. handleTabChange(tabType: 'outside' | 'inside'): void {
  105. this.currentTab = tabType;
  106. }
  107. returnPage() {
  108. toLBHome();
  109. }
  110. toHome() {
  111. toLBHome()
  112. }
  113. // 点击事件处理
  114. handleDesignClick(type) {
  115. if (type === 'outside') {
  116. // 外墙设计页
  117. this.$router.push("/AIDesign/design");
  118. } else if (type === 'inside') {
  119. // 内墙设计页
  120. this.$router.push("/AIDesign/insideDesign");
  121. }
  122. }
  123. handleDiagnosisClick(wallType) {
  124. // if (wallType === "outside") {
  125. // this.$toast('规划中,敬请期待');
  126. // return;
  127. // }
  128. this.$router.push({ path: '/AIDesign/diagnose', query: { wallType } });
  129. }
  130. handleFiveElementClick() {
  131. this.$toast('规划中,敬请期待');
  132. // this.$router.push("/AIDesign/five-element");
  133. }
  134. }
  135. </script>
  136. <style scoped lang="scss">
  137. .home-container {
  138. /* padding: 20px; */
  139. background-color: #f7f7f7;
  140. min-height: 100vh;
  141. flex-direction: column;
  142. }
  143. /* 顶部背景图 */
  144. .top-bg {
  145. font-size: 0;
  146. line-height: 0;
  147. position: relative;
  148. .bg-image {
  149. width: 100%;
  150. height: auto;
  151. /* object-fit: cover; */
  152. }
  153. }
  154. /* 标题样式 */
  155. .smart-space-title {
  156. padding: 0 20px;
  157. position: relative;
  158. font-size: 20px;
  159. font-weight: bold;
  160. color: #333;
  161. margin-bottom: 20px;
  162. display: flex;
  163. align-items: center;
  164. gap: 5px;
  165. }
  166. .smart-space-title-new {
  167. display: flex;
  168. justify-content: space-between;
  169. // background-color: #dce0ea;
  170. background-color: #d9e0ef;
  171. height: 5.5rem;
  172. line-height: 5.5rem;
  173. margin-bottom: 3rem;
  174. padding-top: 1.8rem;
  175. position: relative;
  176. top: -2px;
  177. .tab-title {
  178. flex: 1;
  179. text-align: center;
  180. font-size: 20px;
  181. font-weight: bold;
  182. color: #333;
  183. position: relative;
  184. z-index: 0;
  185. }
  186. }
  187. .new-tab-wrapper {
  188. width: 100%;
  189. height: 60px;
  190. margin-bottom: 20px;
  191. display: flex;
  192. justify-content: space-between;
  193. align-items: center;
  194. .tab-title {
  195. width: 50%;
  196. height: 100%;
  197. }
  198. }
  199. .outside-tab-bg {
  200. background: url('../../assets/AIDesign/tab1.png') no-repeat;
  201. background-size: 100% auto;
  202. }
  203. .inside-tab-bg {
  204. background: url('../../assets/AIDesign/tab2.png') no-repeat;
  205. background-size: 100% auto;
  206. }
  207. /* 功能卡片容器 */
  208. .feature-cards {
  209. padding: 0 20px;
  210. display: flex;
  211. flex-direction: column;
  212. gap: 16px;
  213. }
  214. /* 卡片通用样式 */
  215. .card {
  216. display: flex;
  217. justify-content: space-between;
  218. align-items: center;
  219. padding: 16px;
  220. border-radius: 16px;
  221. cursor: pointer;
  222. transition: transform 0.2s ease;
  223. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  224. }
  225. .card:hover {
  226. transform: translateY(-2px);
  227. }
  228. .card-content {
  229. flex: 1;
  230. }
  231. .card-title {
  232. font-size: 15px;
  233. font-weight: 600;
  234. color: #333;
  235. }
  236. .card-desc {
  237. font-size: 12px;
  238. color: #666;
  239. margin-top: 4px;
  240. }
  241. .card-icon {
  242. width: 80px;
  243. height: 80px;
  244. display: flex;
  245. align-items: center;
  246. justify-content: center;
  247. }
  248. .card-icon img {
  249. width: 80px;
  250. height: 80px;
  251. }
  252. /* 各卡片背景色 */
  253. .card-design {
  254. background: linear-gradient(135deg, #e6e6ff, #f0f0ff);
  255. /* border: 1px solid #d0d0ff; */
  256. }
  257. .card-diagnosis {
  258. background: linear-gradient(135deg, #e6ffe6, #f0fff0);
  259. /* border: 1px solid #c0ffc0; */
  260. }
  261. .card-five-element {
  262. margin-bottom: 1rem;
  263. background: linear-gradient(135deg, #fff8e6, #fff0e6);
  264. /* border: 1px solid #ffd0c0; */
  265. }
  266. .header {
  267. /*height: 50px;*/
  268. /*line-height: 50px;*/
  269. /*text-align: center;*/
  270. /*background: #fff;*/
  271. border-bottom: 1px solid #f8f8f8;
  272. .van-nav-bar__title {
  273. font-size: 20px;
  274. color: #333;
  275. }
  276. .van-icon {
  277. font-size: 20px;
  278. color: #333 !important;
  279. }
  280. }
  281. </style>