index copy.vue 6.6 KB

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