make2.vue 9.8 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_13.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_13.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/video2.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://e.zhichao.art/images/1_13.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 'make2.scss';
  256. </style>