make.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  1. <template>
  2. <view class="setps-container">
  3. <image src="/static/icon/icon-11.png" class="setps-container-title_image"></image>
  4. <image src="/static/me/backup.png" class="backup" @click="backup"></image>
  5. <view class="setps-container-top">
  6. <text class="setps-container-top_title">STEP {{step}}</text>
  7. <view class="setps-container-top_line">
  8. <view class="setps-container-top_line__lineTow" v-if="step == 1"></view>
  9. <view class="setps-container-top_line__lineTow2" v-if="step == 2"></view>
  10. <view class="setps-container-top_line__lineTow3" v-if="step == 3"></view>
  11. <view class="setps-container-top_line__lineTow4" v-if="step == 4"></view>
  12. <view class="setps-container-top_line__lineTow5" v-if="step == 5"></view>
  13. </view>
  14. <text class="setps-container-top_desc">生成个人形象</text>
  15. </view>
  16. <view class="setps-container-center">
  17. <block v-if="step == 1">
  18. <image src="/static/me/xinxiang.png" class="avator"></image>
  19. </block>
  20. <block v-if="step == 2">
  21. <image src="/static/make/1_12.png" class="avator" mode="widthFix"></image>
  22. </block>
  23. <block v-if="step == 3">
  24. <view class="scroll-text">
  25. <text class="scroll-text-content">
  26. 《凌音的二次元世界》
  27. 在二次元的领域中,有一位独特的少女,她名叫凌音。凌音拥有着令人心动的可爱外貌,同时又散发着一种高冷的气质,她的纤细身姿更是增添了几分独特的魅力。
  28. 凌音的性格温柔而婉约,她的安静和内向使她常常沉浸在自己的世界中。她虽然表面上给人一种高冷的感觉,但实际上她是外冷内热的,内心深处充满了温暖和关怀。她的敏感和多愁善感让她对周围的事物有着细腻的感受,也使得她在艺术方面有着独特的领悟力。
  29. 凌音对颜色有着特别的喜好,她钟情于白色和浅蓝色。白色代表着纯洁和无暇,而浅蓝色则给人一种宁静和清新的感觉,这两种颜色恰如她的内心世界,纯净而美好。她热爱冬天,尤其喜欢下雪的日子。雪花纷纷扬扬地飘落,整个世界变得银装素裹,这让她感受到一种宁静和美好,也让她的内心得到了慰藉。
  30. 凌音的爱好丰富多样。她热爱电影,通过电影她可以体验到不同的人生和情感,电影中的每一个画面和情节都能触动她的心灵。摄影也是她的喜好之一,她喜欢用镜头捕捉生活中的美好瞬间,将那些稍纵即逝的美丽定格为永恒。动漫和二次元是她的精神寄托,她沉浸在那个充满奇幻和想象的世界中,寻找着自己的梦想和希望。此外,她也喜欢宅在家里,享受一个人的宁静时光,阅读、思考或者做一些自己喜欢的事情。
  31. 凌音就是这样一个独特的二次元少女,她的存在仿佛是一首优美的诗篇,让人忍不住想要去了解她、接近她。在她的世界里,有着无尽的美好和梦想,等待着她去探索和发现。
  32. </text>
  33. </view>
  34. </block>
  35. <block v-if="step == 4">
  36. <text class="cucang">
  37. 这纷扰世界,我凌音只在自己的角落,守着内心的宁静与热爱。
  38. </text>
  39. </block>
  40. <block v-if="step == 5">
  41. <view class="bg-content">
  42. <image src="/static/make/music.png" class="avator" mode="widthFix"></image>
  43. </view>
  44. </block>
  45. <!-- <view class="avator"></view> -->
  46. <!-- <swiper class="swiper" :current="tabCurrentIndex" duration="300">
  47. <swiper-item class="swiper-item">
  48. </swiper-item>
  49. </swiper> -->
  50. <!-- <setp-a></setp-a> -->
  51. </view>
  52. <view class="setps-container-bottom">
  53. <text class="setps-container-bottom__tips"></text>
  54. <view class="setps-container-bottom__btn" @click="next">{{btnName}}<text>(100彩豆)</text></view>
  55. </view>
  56. <view class="pop" v-if="step == 9">
  57. <view class="blurred-background"></view>
  58. <!-- <view class="video-container">
  59. <view class="video-text">这纷扰世界,我凌音只在自己的角落,守着内心的宁静与热爱。</view>
  60. </view> -->
  61. <image src="/static/make/1_12.png" class="xinxiang" mode="aspectFill"></image>
  62. <image src="/static/make/play_video.png" class="play_video" mode="widthFix" @click="showVideo()"></image>
  63. <block v-if="video_url != ''">
  64. <video id="myVideo" autoplay="true" :src="video_url" style="width:100%;height:100%;z-index: 88;"
  65. loop="true"></video>
  66. </block>
  67. <image src="/static/me/backup.png" class="backup" @click="backup"></image>
  68. <view class="cucang">
  69. 这纷扰世界,我凌音只在自己的角落,守着内心的宁静与热爱。
  70. </view>
  71. <view class="scroll-text">
  72. <text class="scroll-text-content">
  73. 《凌音的二次元世界》
  74. 在二次元的领域中,有一位独特的少女,她名叫凌音。凌音拥有着令人心动的可爱外貌,同时又散发着一种高冷的气质,她的纤细身姿更是增添了几分独特的魅力。
  75. 凌音的性格温柔而婉约,她的安静和内向使她常常沉浸在自己的世界中。她虽然表面上给人一种高冷的感觉,但实际上她是外冷内热的,内心深处充满了温暖和关怀。她的敏感和多愁善感让她对周围的事物有着细腻的感受,也使得她在艺术方面有着独特的领悟力。
  76. 凌音对颜色有着特别的喜好,她钟情于白色和浅蓝色。白色代表着纯洁和无暇,而浅蓝色则给人一种宁静和清新的感觉,这两种颜色恰如她的内心世界,纯净而美好。她热爱冬天,尤其喜欢下雪的日子。雪花纷纷扬扬地飘落,整个世界变得银装素裹,这让她感受到一种宁静和美好,也让她的内心得到了慰藉。
  77. 凌音的爱好丰富多样。她热爱电影,通过电影她可以体验到不同的人生和情感,电影中的每一个画面和情节都能触动她的心灵。摄影也是她的喜好之一,她喜欢用镜头捕捉生活中的美好瞬间,将那些稍纵即逝的美丽定格为永恒。动漫和二次元是她的精神寄托,她沉浸在那个充满奇幻和想象的世界中,寻找着自己的梦想和希望。此外,她也喜欢宅在家里,享受一个人的宁静时光,阅读、思考或者做一些自己喜欢的事情。
  78. 凌音就是这样一个独特的二次元少女,她的存在仿佛是一首优美的诗篇,让人忍不住想要去了解她、接近她。在她的世界里,有着无尽的美好和梦想,等待着她去探索和发现。
  79. </text>
  80. </view>
  81. </view>
  82. <!-- <modal ref="modal" content-text="注册完成后将无法更改生日,为了良好的使用体验,请慎重选择!"></modal> -->
  83. </view>
  84. </template>
  85. <script>
  86. export default {
  87. components: {},
  88. data() {
  89. return {
  90. innerAudioContext: null,
  91. tabCurrentIndex: 0,
  92. step: 1,
  93. btnName: '生成形象',
  94. danmuList: [{
  95. text: '这纷扰世界',
  96. color: '#ff0000',
  97. time: 1
  98. },
  99. {
  100. text: '我凌音只在自己的角落',
  101. color: '#ff00ff',
  102. time: 2
  103. },
  104. {
  105. text: '守着内心的宁静与热爱',
  106. color: '#ff00ff',
  107. time: 3
  108. }
  109. ],
  110. video_url: '',
  111. }
  112. },
  113. onReady: function(res) {
  114. this.videoContext = uni.createVideoContext('myVideo')
  115. },
  116. onLoad() {
  117. let that = this;
  118. // setTimeout(function() {
  119. // that.playBg();
  120. // }, 2000);
  121. },
  122. onHide() {
  123. if (this.innerAudioContext != null) {
  124. try {
  125. this.innerAudioContext.pause();
  126. this.innerAudioContext.destroy()
  127. this.innerAudioContext = null
  128. } catch (e) {
  129. //TODO handle the exception
  130. }
  131. }
  132. },
  133. onUnload() {
  134. if (this.innerAudioContext != null) {
  135. try {
  136. this.innerAudioContext.pause();
  137. this.innerAudioContext.destroy()
  138. this.innerAudioContext = null
  139. } catch (e) {
  140. //TODO handle the exception
  141. }
  142. }
  143. },
  144. methods: {
  145. backup() {
  146. if (this.innerAudioContext != null) {
  147. try {
  148. this.innerAudioContext.pause();
  149. this.innerAudioContext.destroy()
  150. this.innerAudioContext = null
  151. } catch (e) {
  152. //TODO handle the exception
  153. }
  154. }
  155. // uni.navigateBack({
  156. // delta: 1
  157. // });
  158. // uni.switchTab({
  159. // url: '/pages/make/index'
  160. // })
  161. uni.navigateBack();
  162. },
  163. next() {
  164. // this.$refs.modal.open()
  165. if (this.step == 1) {
  166. uni.showLoading({});
  167. let that = this;
  168. setTimeout(function() {
  169. that.showStep2();
  170. }, 1000);
  171. } else if (this.step == 2) {
  172. uni.showLoading({});
  173. let that = this;
  174. setTimeout(function() {
  175. that.showStep3();
  176. }, 1000);
  177. } else if (this.step == 3) {
  178. uni.showLoading({});
  179. let that = this;
  180. setTimeout(function() {
  181. that.showStep4();
  182. }, 1000);
  183. } else if (this.step == 4) {
  184. uni.showLoading({});
  185. let that = this;
  186. setTimeout(function() {
  187. that.showStep5();
  188. }, 1000);
  189. } else if (this.step == 5) {
  190. uni.showLoading({});
  191. let that = this;
  192. setTimeout(function() {
  193. that.step = 9;
  194. that.playBg();
  195. uni.hideLoading();
  196. }, 1000);
  197. } else {
  198. // this.step = 5;
  199. // uni.redirectTo({
  200. // url:'/pages/make/'
  201. // })
  202. // this.playBg();
  203. }
  204. },
  205. showStep2() {
  206. uni.hideLoading();
  207. this.step = 2;
  208. this.btnName = "生成背景";
  209. },
  210. showStep3() {
  211. uni.hideLoading();
  212. this.step = 3;
  213. this.btnName = "生成出场台词";
  214. },
  215. showStep4() {
  216. uni.hideLoading();
  217. this.step = 4;
  218. this.btnName = "生成音乐";
  219. },
  220. showStep5() {
  221. uni.hideLoading();
  222. this.step = 5;
  223. this.btnName = "查看形象";
  224. },
  225. showVideo() {
  226. this.video_url = '/static/make/video.mp4';
  227. },
  228. playBg() {
  229. this.innerAudioContext = uni.createInnerAudioContext();
  230. this.innerAudioContext.autoplay = true;
  231. this.innerAudioContext.loop = true;
  232. this.innerAudioContext.sessionCategory = "soloAmbient";
  233. this.innerAudioContext.src = 'https://t.yujianmate.com/images/1_12.mp3';
  234. // console.log('this.innerAudioContext',this.innerAudioContext);
  235. this.innerAudioContext.onPlay(() => {
  236. console.log('开始播放');
  237. });
  238. this.innerAudioContext.onError((res) => {
  239. // console.log(res.errMsg);
  240. // console.log(res.errCode);
  241. });
  242. let self = this;
  243. setTimeout(function() {
  244. if (self.innerAudioContext != null) {
  245. // if(self.innerAudioContext.paused) {
  246. // }
  247. // self.innerAudioContext.play();
  248. }
  249. }, 1000);
  250. },
  251. }
  252. }
  253. </script>
  254. <style scoped lang="scss">
  255. @import 'make.scss';
  256. </style>