index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <view class="container">
  3. <!-- 顶部导航栏 -->
  4. <view class="header-box">
  5. <text class="title">星球造物</text>
  6. <view class="currency-area">
  7. <view class="coin-box">
  8. <image src="/static/icon/coin_m.png" mode="aspectFit"></image>
  9. <text>{{ myinfo.num_gmm }}</text>
  10. </view>
  11. <view class="gold-box">
  12. <image src="/static/icon/coin_cd.png" mode="aspectFit"></image>
  13. <text>{{ myinfo.num_gmd }}</text>
  14. </view>
  15. </view>
  16. </view>
  17. <!-- 功能卡片区域 -->
  18. <view class="card-grid">
  19. <!-- AI创角卡片 -->
  20. <view class="card card-large character" @click="handleCardClick('character')">
  21. <view class="card-content">
  22. <view class="text-area">
  23. <text class="card-title">AI创角</text>
  24. <text class="card-desc">生成独一无二的星球成员</text>
  25. </view>
  26. <view class="btn-box">立即查看</view>
  27. <!-- <image src="/static/icon/star.png" class="star-icon star-1" mode="aspectFit"></image>
  28. <image src="/static/icon/star.png" class="star-icon star-2" mode="aspectFit"></image>
  29. <image src="/static/make/character.png" class="card-image" mode="aspectFit"></image> -->
  30. </view>
  31. </view>
  32. <!-- AI灵感写歌卡片 -->
  33. <view class="card card-medium music" @click="handleCardClick('music')">
  34. <view class="card-content">
  35. <view class="text-area">
  36. <text class="card-title">AI灵感写歌</text>
  37. <text class="card-desc">快速生成专属原创曲目</text>
  38. </view>
  39. <image src="/static/make/planet.png" class="card-image" mode="aspectFit"></image>
  40. </view>
  41. </view>
  42. <!-- 萌萌智绘魔方卡片 -->
  43. <view class="card card-medium cube" @click="handleCardClick('cube')">
  44. <view class="card-content">
  45. <view class="text-area">
  46. <text class="card-title">萌萌智绘魔方</text>
  47. <text class="card-desc">AI随机生成萌玩原型</text>
  48. </view>
  49. <image src="/static/make/book.png" class="card-image" mode="aspectFit"></image>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="guide-title"> 引导教程</view>
  54. <!-- 引导教程区域 -->
  55. <view class="tutorial">
  56. <view class="tutorial-block " @click="handleTutorialClick(index)" v-for="(tutorial, index) in 3"
  57. :key="index">
  58. <text class="tutorial-btn-box">
  59. <view class="tutorial-btn">
  60. <image src="../../static/make/cz_icon_guanfangjiaocheng.png"></image>
  61. <text>官方教程</text>
  62. </view>
  63. </text>
  64. <text class="tutorial-title"> 萌创星球教程</text>
  65. <view class="tutorial-content">教你如何创作内容,激发创作灵感</view>
  66. </view>
  67. </view>
  68. <tabbar-view :tabbars="tabbars" :currentIndex="1" ref="tabbar"></tabbar-view>
  69. </view>
  70. </template>
  71. <script>
  72. import tabbarView from "@/components/tabbar/tabbar.vue";
  73. import tabbar from "@/mixins/tabbar";
  74. export default {
  75. components: {
  76. tabbarView,
  77. },
  78. mixins: [tabbar],
  79. data() {
  80. return {
  81. myinfo: {},
  82. windowHeight: uni.getWindowInfo().windowHeight,
  83. tabCurrent: 0
  84. }
  85. },
  86. onLoad() { },
  87. onShow() {
  88. this.getMyInfo();
  89. },
  90. // 下拉刷新数据
  91. methods: {
  92. getMyInfo() {
  93. uni.request({
  94. url: this.$apiHost + '/My/getnum',
  95. method: 'GET',
  96. header: {
  97. 'content-type': 'application/json',
  98. 'sign': getApp().globalData.headerSign
  99. },
  100. data: {
  101. uuid: getApp().globalData.uuid
  102. },
  103. success: (res) => {
  104. console.log("获取用户信息:", res.data);
  105. this.myinfo = res.data
  106. }
  107. })
  108. },
  109. tabChange(index) {
  110. this.tabCurrent = index;
  111. },
  112. handleCardClick(type) {
  113. console.log('Card clicked:', type);
  114. uni.$emit('check_login', () => {
  115. if (type == 'cube') {
  116. uni.navigateTo({
  117. url: '/pages/makedetail/makeImgDetail'
  118. })
  119. } else if (type == 'music') {
  120. uni.navigateTo({
  121. url: '/pages/makedetail/makeMusicDetail'
  122. })
  123. } else if (type == 'character') {
  124. uni.navigateTo({
  125. url: '/pages/my/myStar'
  126. })
  127. } else {
  128. uni.showToast({
  129. title: '待开放'
  130. })
  131. }
  132. })
  133. },
  134. handleTutorialClick(index) {
  135. console.log('Tutorial clicked:', index + 1);
  136. }
  137. }
  138. }
  139. </script>
  140. <style lang="scss">
  141. @import './index.scss';
  142. </style>