index.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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" @click="goPage('/pages/vip/M_purchase')">
  8. <image src="/static/icon/coin_m.png" mode="aspectFit"></image>
  9. <text>{{ myinfo.num_gmm | formatNumberToK}}</text> <view class="money-add">+</view>
  10. </view>
  11. <view class="gold-box" @click="goPage('/pages/my/job?type=recharge')">
  12. <image src="/static/icon/coin_cd.png" mode="aspectFit"></image>
  13. <text>{{ myinfo.num_gmd | formatNumberToK}}</text> <view class="money-add">+</view>
  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. <!-- 新手引导组件 -->
  70. <novice-guidance :step="step"></novice-guidance>
  71. </view>
  72. </template>
  73. <script>
  74. import tabbarView from "@/components/tabbar/tabbar.vue";
  75. import tabbar from "@/mixins/tabbar";
  76. export default {
  77. components: {
  78. tabbarView,
  79. },
  80. mixins: [tabbar],
  81. data() {
  82. return {
  83. myinfo: {},
  84. windowHeight: uni.getWindowInfo().windowHeight,
  85. tabCurrent: 0,
  86. step: {
  87. name: "make",
  88. guideList: [
  89. {
  90. el: ".currency-area",
  91. tips: "积分可在这里查看,每日签到可获得积分!",
  92. next: "知道了",
  93. },
  94. {
  95. el: ".character",
  96. tips: "创建星灵,入驻星球",
  97. next: "知道了",
  98. tipesStyle: "left: 40px;"
  99. },
  100. {
  101. el: ".music",
  102. tips: "输入灵感,生成歌曲",
  103. next: "知道了",
  104. },
  105. {
  106. el: ".cube",
  107. tips: "输入关键词,生成萌玩",
  108. next: "完成",
  109. }]
  110. }
  111. }
  112. },
  113. onLoad() { },
  114. onShow() {
  115. this.getMyInfo();
  116. },
  117. // 下拉刷新数据
  118. methods: {
  119. getMyInfo() {
  120. uni.request({
  121. url: this.$apiHost + '/My/getnum',
  122. method: 'GET',
  123. header: {
  124. 'content-type': 'application/json',
  125. 'sign': getApp().globalData.headerSign
  126. },
  127. data: {
  128. uuid: getApp().globalData.uuid
  129. },
  130. success: (res) => {
  131. console.log("获取用户信息:", res.data);
  132. this.myinfo = res.data
  133. }
  134. })
  135. },
  136. tabChange(index) {
  137. this.tabCurrent = index;
  138. },
  139. handleCardClick(type) {
  140. console.log('Card clicked:', type);
  141. uni.$emit('check_login', () => {
  142. if (type == 'cube') {
  143. uni.navigateTo({
  144. url: '/pages/makedetail/makeImgDetail'
  145. })
  146. } else if (type == 'music') {
  147. uni.navigateTo({
  148. url: '/pages/makedetail/makeMusicDetail'
  149. })
  150. } else if (type == 'character') {
  151. uni.navigateTo({
  152. url: '/pages/my/myStar'
  153. })
  154. } else {
  155. uni.showToast({
  156. title: '待开放'
  157. })
  158. }
  159. })
  160. },
  161. handleTutorialClick(index) {
  162. console.log('Tutorial clicked:', index + 1);
  163. },
  164. goPage(page) {
  165. uni.navigateTo({
  166. url: page,
  167. });
  168. },
  169. }
  170. }
  171. </script>
  172. <style lang="scss">
  173. @import './index.scss';
  174. </style>