index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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="isRecharge ? 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" v-if="isRecharge">+</view>
  10. </view>
  11. <view class="gold-box" @click="isRecharge ?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" v-if="isRecharge">+</view>
  14. </view>
  15. <image style="width: 64rpx ; height: 64rpx;" src="/static/icon/renwu.png" mode="aspectFit" @click="goPage('/pages/my/job')"></image>
  16. </view>
  17. </view>
  18. <!-- 功能卡片区域 -->
  19. <view class="card-grid">
  20. <!-- AI创角卡片 -->
  21. <view class="card card-large character" @click="handleCardClick('character')">
  22. <view class="card-content">
  23. <view class="text-area">
  24. <text class="card-title">AI创角</text>
  25. <text class="card-desc">生成独一无二的星球成员</text>
  26. </view>
  27. <view class="btn-box">立即查看</view>
  28. <!-- <image src="/static/icon/star.png" class="star-icon star-1" mode="aspectFit"></image>
  29. <image src="/static/icon/star.png" class="star-icon star-2" mode="aspectFit"></image>
  30. <image src="/static/make/character.png" class="card-image" mode="aspectFit"></image> -->
  31. </view>
  32. </view>
  33. <!-- AI灵感写歌卡片 -->
  34. <view class="card card-medium music" @click="handleCardClick('music')">
  35. <view class="card-content">
  36. <view class="text-area" style="display: flex;flex-direction: column;;">
  37. <text class="card-title">AI灵感写歌</text>
  38. <text class="card-desc">快速生成专属原创曲目</text>
  39. </view>
  40. <image src="/static/make/planet.png" class="card-image" mode="aspectFit"></image>
  41. </view>
  42. </view>
  43. <!-- 萌萌智绘魔方卡片 -->
  44. <view class="card card-medium cube" @click="handleCardClick('cube')">
  45. <view class="card-content">
  46. <view class="text-area" style="display: flex;flex-direction: column;">
  47. <text class="card-title">萌萌智绘魔方</text>
  48. <text class="card-desc">AI随机生成萌玩原型</text>
  49. </view>
  50. <image src="/static/make/book.png" class="card-image" mode="aspectFit"></image>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="guide-title"> 引导教程</view>
  55. <!-- 引导教程区域 -->
  56. <view class="tutorial">
  57. <view class="tutorial-block " @click="goWeb(item.url,item.subheading )" v-for="(item, index) in tutorial"
  58. :key="index">
  59. <text class="tutorial-btn-box">
  60. <view class="tutorial-btn">
  61. <image src="../../static/make/cz_icon_guanfangjiaocheng.png"></image>
  62. <text>{{ item.title }}</text>
  63. </view>
  64. </text>
  65. <text class="tutorial-title"> {{ item.subheading }}</text>
  66. <view class="tutorial-content">{{ item.content }}</view>
  67. </view>
  68. </view>
  69. <tabbar-view :tabbars="tabbars" :currentIndex="1" ref="tabbar"></tabbar-view>
  70. <!-- 新手引导组件 -->
  71. <novice-guidance :step="step" v-if="isGuiding"></novice-guidance>
  72. </view>
  73. </template>
  74. <script>
  75. import tabbarView from "@/components/tabbar/tabbar.vue";
  76. import tabbar from "@/mixins/tabbar";
  77. import { mapState } from 'vuex'
  78. export default {
  79. components: {
  80. tabbarView,
  81. },
  82. mixins: [tabbar],
  83. data() {
  84. return {
  85. myinfo: {},
  86. windowHeight: uni.getWindowInfo().windowHeight,
  87. tabCurrent: 0,
  88. step: {
  89. name: "make",
  90. guideList: [
  91. {
  92. el: ".currency-area",
  93. tips: "积分可在这里查看,每日签到可获得积分!",
  94. next: "知道了",
  95. },
  96. {
  97. el: ".character",
  98. tips: "创建星灵,入驻星球",
  99. next: "知道了",
  100. tipesStyle: "left: 40px;"
  101. },
  102. {
  103. el: ".music",
  104. tips: "输入灵感,生成歌曲",
  105. next: "知道了",
  106. },
  107. {
  108. el: ".cube",
  109. tips: "输入关键词,生成萌玩",
  110. next: "完成",
  111. }]
  112. },
  113. tutorial:[
  114. {title:"官方教程",url:"https://docs.qingque.cn/d/home/eZQC3yyQj9gK-KnVUZOT6vYmn?identityId=2HSXOrUAEOx",subheading:"星球造物,AI创角",content:"使用自然语言,创建独属于你的智能体"},
  115. {title:"官方教程",url:"https://docs.qingque.cn/d/home/eZQDGgIXzR08ssYlwoy2tjiNA?identityId=2HSXOrUAEOx",subheading:"AI灵感写歌",content:"使用AI超能力释放你的无限创造力!"},
  116. {title:"官方教程",url:"https://docs.qingque.cn/d/home/eZQBj5luSHVkaqpJmL5PTuFfZ?identityId=2HSXOrUAEOx",subheading:"萌萌智绘魔方",content:"教你如何创作内容,激发创作灵感!" },
  117. ]
  118. }
  119. },
  120. computed: {
  121. ...mapState('switchingModule', ['isRecharge', 'isGuiding'])
  122. },
  123. onLoad() {
  124. },
  125. onShow() {
  126. this.getMyInfo();
  127. },
  128. // 下拉刷新数据
  129. methods: {
  130. goWeb(url, title) {
  131. uni.navigateTo({
  132. url: `/pages/webview/index?url=${encodeURIComponent(url)}&title=${encodeURIComponent(title) }`
  133. })},
  134. getMyInfo() {
  135. uni.request({
  136. url: this.$apiHost + '/My/getnum',
  137. method: 'GET',
  138. header: {
  139. 'content-type': 'application/json',
  140. 'sign': getApp().globalData.headerSign
  141. },
  142. data: {
  143. uuid: getApp().globalData.uuid
  144. },
  145. success: (res) => {
  146. console.log("获取用户信息:", res.data);
  147. this.myinfo = res.data
  148. }
  149. })
  150. },
  151. tabChange(index) {
  152. this.tabCurrent = index;
  153. },
  154. handleCardClick(type) {
  155. console.log('Card clicked:', type);
  156. uni.$emit('check_login', () => {
  157. if (type == 'cube') {
  158. uni.navigateTo({
  159. url: '/pages/makedetail/makeImgDetail'
  160. })
  161. } else if (type == 'music') {
  162. uni.navigateTo({
  163. url: '/pages/makedetail/makeMusicDetail'
  164. })
  165. } else if (type == 'character') {
  166. uni.navigateTo({
  167. url: '/pages/my/myStar'
  168. })
  169. } else {
  170. uni.showToast({
  171. title: '待开放'
  172. })
  173. }
  174. })
  175. },
  176. handleTutorialClick(index) {
  177. console.log('Tutorial clicked:', index + 1);
  178. },
  179. goPage(page) {
  180. uni.navigateTo({
  181. url: page,
  182. });
  183. },
  184. }
  185. }
  186. </script>
  187. <style lang="scss">
  188. @import './index.scss';
  189. </style>