make.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  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 step1"></image>
  19. </block>
  20. <block v-if="step == 2">
  21. <image src="/static/make/1_12.png" class="avator step2" mode="widthFix"></image>
  22. </block>
  23. <block v-if="step == 3">
  24. <view class="scroll-text step3">
  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 step4">
  37. 这纷扰世界,我凌音只在自己的角落,守着内心的宁静与热爱。
  38. </text>
  39. </block>
  40. <block v-if="step == 5">
  41. <view class="bg-content step5">
  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 step-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. <!-- 新手引导组件 -->
  84. <novice-guidance :step="guideStep" :tipStyle="{
  85. background: 'linear-gradient(180deg, #1cbbb4, #0081ff)',
  86. borderRadius: '12rpx',
  87. padding: '20rpx',
  88. boxShadow: '0 4rpx 12rpx rgba(0,0,0,0.1)'
  89. }"></novice-guidance>
  90. </view>
  91. </template>
  92. <script>
  93. export default {
  94. components: {},
  95. data() {
  96. return {
  97. innerAudioContext: null,
  98. tabCurrentIndex: 0,
  99. step: 1,
  100. btnName: '生成形象',
  101. danmuList: [{
  102. text: '这纷扰世界',
  103. color: '#ff0000',
  104. time: 1
  105. },
  106. {
  107. text: '我凌音只在自己的角落',
  108. color: '#ff00ff',
  109. time: 2
  110. },
  111. {
  112. text: '守着内心的宁静与热爱',
  113. color: '#ff00ff',
  114. time: 3
  115. }
  116. ],
  117. video_url: '',
  118. guideStep: {
  119. name: "makeGuide",
  120. guideList: [{
  121. el: ".step1",
  122. tips: "这是第一步,选择你的头像",
  123. next: "下一步",
  124. style: {
  125. background: 'linear-gradient(180deg, #1cbbb4, #0081ff)',
  126. borderRadius: '12rpx',
  127. padding: '20rpx',
  128. boxShadow: '0 4rpx 12rpx rgba(0,0,0,0.1)'
  129. }
  130. },
  131. {
  132. el: ".step2",
  133. tips: "这是第二步,选择你的形象",
  134. next: "下一步",
  135. style: {
  136. background: 'linear-gradient(180deg, #ff6b6b, #ff8e8e)',
  137. borderRadius: '12rpx',
  138. padding: '20rpx',
  139. boxShadow: '0 4rpx 12rpx rgba(0,0,0,0.1)'
  140. }
  141. },
  142. {
  143. el: ".step3",
  144. tips: "这是第三步,编辑你的个人介绍",
  145. next: "下一步",
  146. style: {
  147. background: 'linear-gradient(180deg, #4facfe, #00f2fe)',
  148. borderRadius: '12rpx',
  149. padding: '20rpx',
  150. boxShadow: '0 4rpx 12rpx rgba(0,0,0,0.1)'
  151. }
  152. },
  153. {
  154. el: ".step4",
  155. tips: "这是第四步,设置你的出场台词",
  156. next: "下一步",
  157. style: {
  158. background: 'linear-gradient(180deg, #a18cd1, #fbc2eb)',
  159. borderRadius: '12rpx',
  160. padding: '20rpx',
  161. boxShadow: '0 4rpx 12rpx rgba(0,0,0,0.1)'
  162. }
  163. },
  164. {
  165. el: ".step5",
  166. tips: "这是第五步,选择你的背景音乐",
  167. next: "下一步",
  168. style: {
  169. background: 'linear-gradient(180deg, #84fab0, #8fd3f4)',
  170. borderRadius: '12rpx',
  171. padding: '20rpx',
  172. boxShadow: '0 4rpx 12rpx rgba(0,0,0,0.1)'
  173. }
  174. },
  175. {
  176. el: ".step-btn",
  177. tips: "点击按钮生成你的专属形象",
  178. next: "完成",
  179. style: {
  180. background: 'linear-gradient(180deg, #f093fb, #f5576c)',
  181. borderRadius: '12rpx',
  182. padding: '20rpx',
  183. boxShadow: '0 4rpx 12rpx rgba(0,0,0,0.1)'
  184. }
  185. }]
  186. }
  187. }
  188. },
  189. onReady: function(res) {
  190. this.videoContext = uni.createVideoContext('myVideo')
  191. },
  192. onLoad() {
  193. let that = this;
  194. // setTimeout(function() {
  195. // that.playBg();
  196. // }, 2000);
  197. },
  198. onHide() {
  199. if (this.innerAudioContext != null) {
  200. try {
  201. this.innerAudioContext.pause();
  202. this.innerAudioContext.destroy()
  203. this.innerAudioContext = null
  204. } catch (e) {
  205. //TODO handle the exception
  206. }
  207. }
  208. },
  209. onUnload() {
  210. if (this.innerAudioContext != null) {
  211. try {
  212. this.innerAudioContext.pause();
  213. this.innerAudioContext.destroy()
  214. this.innerAudioContext = null
  215. } catch (e) {
  216. //TODO handle the exception
  217. }
  218. }
  219. },
  220. methods: {
  221. backup() {
  222. if (this.innerAudioContext != null) {
  223. try {
  224. this.innerAudioContext.pause();
  225. this.innerAudioContext.destroy()
  226. this.innerAudioContext = null
  227. } catch (e) {
  228. //TODO handle the exception
  229. }
  230. }
  231. // uni.navigateBack({
  232. // delta: 1
  233. // });
  234. // uni.switchTab({
  235. // url: '/pages/make/index'
  236. // })
  237. uni.navigateBack();
  238. },
  239. next() {
  240. // this.$refs.modal.open()
  241. if (this.step == 1) {
  242. uni.showLoading({});
  243. let that = this;
  244. setTimeout(function() {
  245. that.showStep2();
  246. }, 1000);
  247. } else if (this.step == 2) {
  248. uni.showLoading({});
  249. let that = this;
  250. setTimeout(function() {
  251. that.showStep3();
  252. }, 1000);
  253. } else if (this.step == 3) {
  254. uni.showLoading({});
  255. let that = this;
  256. setTimeout(function() {
  257. that.showStep4();
  258. }, 1000);
  259. } else if (this.step == 4) {
  260. uni.showLoading({});
  261. let that = this;
  262. setTimeout(function() {
  263. that.showStep5();
  264. }, 1000);
  265. } else if (this.step == 5) {
  266. uni.showLoading({});
  267. let that = this;
  268. setTimeout(function() {
  269. that.step = 9;
  270. that.playBg();
  271. uni.hideLoading();
  272. }, 1000);
  273. } else {
  274. // this.step = 5;
  275. // uni.redirectTo({
  276. // url:'/pages/make/'
  277. // })
  278. // this.playBg();
  279. }
  280. },
  281. showStep2() {
  282. uni.hideLoading();
  283. this.step = 2;
  284. this.btnName = "生成背景";
  285. },
  286. showStep3() {
  287. uni.hideLoading();
  288. this.step = 3;
  289. this.btnName = "生成出场台词";
  290. },
  291. showStep4() {
  292. uni.hideLoading();
  293. this.step = 4;
  294. this.btnName = "生成音乐";
  295. },
  296. showStep5() {
  297. uni.hideLoading();
  298. this.step = 5;
  299. this.btnName = "查看形象";
  300. },
  301. showVideo() {
  302. this.video_url = '/static/make/video.mp4';
  303. },
  304. playBg() {
  305. this.innerAudioContext = uni.createInnerAudioContext();
  306. this.innerAudioContext.autoplay = true;
  307. this.innerAudioContext.loop = true;
  308. this.innerAudioContext.sessionCategory = "soloAmbient";
  309. this.innerAudioContext.src = 'https://t.yujianmate.com/images/1_12.mp3';
  310. // console.log('this.innerAudioContext',this.innerAudioContext);
  311. this.innerAudioContext.onPlay(() => {
  312. console.log('开始播放');
  313. });
  314. this.innerAudioContext.onError((res) => {
  315. // console.log(res.errMsg);
  316. // console.log(res.errCode);
  317. });
  318. let self = this;
  319. setTimeout(function() {
  320. if (self.innerAudioContext != null) {
  321. // if(self.innerAudioContext.paused) {
  322. // }
  323. // self.innerAudioContext.play();
  324. }
  325. }, 1000);
  326. },
  327. }
  328. }
  329. </script>
  330. <style scoped lang="scss">
  331. @import 'make.scss';
  332. </style>