generate.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873
  1. <template>
  2. <view>
  3. <view style="color: #fff;">
  4. <tn-nav-bar :isBack="isBack" backgroundColor="#26b3a0" :bottomShadow="false">MidJourney绘图</tn-nav-bar>
  5. <view :style="{ height: tobheight + 'px' }"></view>
  6. </view>
  7. <view v-if="showdrawing" class="template-details">
  8. <u-notice-bar
  9. :text="noticebar" step></u-notice-bar>
  10. <view class="lazy-loading tn-flex justify-center align-center flex-wrap">
  11. <view class="preloader_1">
  12. <view></view>
  13. <view></view>
  14. <view></view>
  15. <view></view>
  16. <view></view>
  17. </view>
  18. <view class="drawing">
  19. {{drawingtitle}}
  20. </view>
  21. <!-- #ifdef MP-WEIXIN -->
  22. <view v-if="showprogress" class="progress">
  23. <u-line-progress :percentage="percentage" activeColor="#9b59b6" height="18"></u-line-progress>
  24. </view>
  25. <!-- #endif -->
  26. </view>
  27. </view>
  28. <view v-if="mjurl" class="displaypage" >
  29. <view class="generategraph">
  30. <!-- <u--image @load="previewload" @error="previewerror" @click="preview(mjurl)" width="100%" height="100%" :src="mjurl" mode="widthFix" radius="8" >
  31. <template v-slot:loading>
  32. <u-loading-icon color="#3c9cff" size="36" text="图片渲染中" textSize="18" :vertical="true"></u-loading-icon>
  33. </template>
  34. <view slot="error" style="font-size: 32rpx;text-align: center;">
  35. 图片加载失败
  36. </view>
  37. </u--image> -->
  38. <image @click="preview(mjurl)" show-menu-by-longpress webp :src="mjurl" @load="previewload" @error="previewerror" mode="widthFix"></image>
  39. </view>
  40. <block v-if="done">
  41. <u-subsection v-if="radiolist7.length == 2" :list="subsectionlist" mode="subsection" fontSize="15" :current="current" @change="tapsubsection"></u-subsection>
  42. <view class="u-demo-block">
  43. <view style="margin-top: 30rpx;">
  44. <view class="u-page__radio-item">
  45. <u-radio-group v-model="radiovalue7" :borderBottom="true" placement="column"
  46. iconPlacement="right" @change="groupChange">
  47. <u-radio labelSize="18" size="22" iconSize="16" :customStyle="{marginBottom: '16px'}" v-for="(item, index) in radiolist7"
  48. :key="index" :label="item.name" :name="item.name">
  49. </u-radio>
  50. </u-radio-group>
  51. </view>
  52. </view>
  53. </view>
  54. </block>
  55. <block v-else>
  56. <view class="drawingdone">
  57. {{drawingtitle}}
  58. </view>
  59. <!-- <u-line-progress :percentage="percentage" activeColor="#3c9cff" height="18"></u-line-progress> -->
  60. <view class="u-flex align-center justify-center">
  61. <tn-circle-progress :percent="percentage" :borderWidth="18" activeColor="#3c9cff" :showPercent="true"></tn-circle-progress>
  62. </view>
  63. </block>
  64. <view style="height: 100px;"></view>
  65. </view>
  66. <!-- 底部tabbar start-->
  67. <view class="tabbar footerfixed dd-glass tn-color-white" style="border-radius: 16rpx;">
  68. <view class="action" @click="getisback">
  69. <view class="bar-icon">
  70. <view class="tn-icon-left-circle">
  71. </view>
  72. </view>
  73. <view class="">立即退出</view>
  74. </view>
  75. <view class="action" @click="getdownload">
  76. <view class="bar-icon">
  77. <view class="tn-icon-download">
  78. </view>
  79. </view>
  80. <view class="">下载/分享</view>
  81. </view>
  82. <view class="action" @click="parameters">
  83. <view class="bar-icon">
  84. <view class="tn-icon-creative">
  85. </view>
  86. </view>
  87. <view class="">绘画口令</view>
  88. </view>
  89. <view class="action" @click="setOpen">
  90. <view class="tn-flex-direction-column tn-flex-row-center tn-flex-col-center tn-button--clear-style">
  91. <view class="bar-icon">
  92. <view class="tn-icon-up-circle">
  93. </view>
  94. </view>
  95. <view class="">{{showopen?'已公开':'公开作品'}}</view>
  96. </view>
  97. </view>
  98. <view class="action" @click="createnow" style="color: #fff420;">
  99. <view class="bar-icon">
  100. <view class="tn-icon-write">
  101. </view>
  102. </view>
  103. <view >再次创作</view>
  104. </view>
  105. </view>
  106. <wike-model v-if="signShow"
  107. :authorize="false"
  108. :title="signTitle"
  109. btnText="立即获取"
  110. @save="signSign"
  111. @close="signShow = false"
  112. ></wike-model>
  113. </view>
  114. </template>
  115. <script>
  116. import {
  117. mapMutations,
  118. mapActions,
  119. mapState,
  120. mapGetters
  121. } from 'vuex';
  122. import {
  123. API_STEROOT,
  124. } from '@/common/request/request';
  125. let asynchronous;
  126. export default {
  127. data() {
  128. return {
  129. signShow:false,
  130. signTitle:'',
  131. noticebar:[
  132. '精美图片需要时间打磨,预计1-2分钟左右出图',
  133. ],
  134. fronid:'',
  135. mj_id:'',
  136. mj_hash:'',
  137. mjurl:'',
  138. // https://img0.baidu.com/it/u=489552572,2707768722&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500
  139. customButtonGroups: [{
  140. text: '保存/分享',
  141. backgroundColor: 'tn-cool-bg-color-8',
  142. color: '#FFFFFF'
  143. }, {
  144. text: '立即创作',
  145. backgroundColor: 'tn-cool-bg-color-8--reverse',
  146. color: '#FFFFFF'
  147. }],
  148. tobheight: 45,
  149. platform: this.$platform.get(),
  150. subsectionlist: ['对第1张图片', '对第2张图片', '对第3张图片','对第4张图片'],
  151. // 或者如下,也可以配置keyName参数修改对象键名
  152. // list: [{name: '未付款'}, {name: '待评价'}, {name: '已付款'}],
  153. current: 0,
  154. //横向两端排列形式数据
  155. radiolist7: [
  156. {
  157. name: '进行放大使用',
  158. disabled: false
  159. },
  160. {
  161. name: '变换生成四张类似的图片',
  162. disabled: false
  163. },
  164. ],
  165. // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
  166. radiovalue7: '进行放大使用',
  167. prompt:'',
  168. showdrawing:true,
  169. drawingtitle:'',
  170. showprogress:true,
  171. percentage:0,
  172. instruction:'进行放大使用',
  173. model_id:'mj',
  174. version:'-- v5',
  175. action:'',
  176. showopen:false,
  177. needCoin:0,
  178. done:false,
  179. isBack:false,
  180. plan:{}
  181. }
  182. },
  183. computed: {
  184. ...mapGetters(['appInfo', 'userInfo','isLogin','userData'])
  185. },
  186. onUnload() {
  187. clearTimeout(asynchronous);
  188. },
  189. onLoad() {
  190. var that = this;
  191. if (that.platform == 'wxMiniProgram') {
  192. var menumtop = uni.getMenuButtonBoundingClientRect().top - uni.getSystemInfoSync().statusBarHeight;
  193. var paddingtop = uni.getSystemInfoSync().statusBarHeight + menumtop;
  194. that.tobheight = menumtop + paddingtop + uni.getMenuButtonBoundingClientRect().height;
  195. }
  196. // #ifdef H5
  197. that.noticebar.push('图片生成中请不要退出此页面,否则可能会无法生成')
  198. that.drawingtitle = '正在提交任务,请不要退出'
  199. // #endif
  200. // #ifdef MP-WEIXIN
  201. // that.noticebar.push('长时间未出图?可稍后在 我的-绘画记录 里查看')
  202. that.drawingtitle = '正在努力绘制中...'
  203. // #endif
  204. if (that.$Route.query.urls) {
  205. this.showprogress = false
  206. this.drawingtitle = '图片正在加载中...'
  207. // that.getModels()
  208. that.gallerydetail(that.$Route.query.urls)
  209. }
  210. if(that.$Route.query.prompt){
  211. that.prompt = that.$Route.query.prompt
  212. that.model_id = that.$Route.query.model_id
  213. that.version = that.$Route.query.version
  214. that.needCoin = that.$Route.query.needCoin
  215. that.action = 'imagine'
  216. // console.log(that.prompt);
  217. // #ifdef MP-WEIXIN
  218. that.galleryimagine()
  219. // #endif
  220. // #ifdef H5
  221. this.gettest()
  222. console.log('this.gettest()------');
  223. // #endif
  224. }
  225. that.getPlan()
  226. },
  227. onShow() {
  228. if (this.isLogin) {
  229. this.getUserData();
  230. }
  231. },
  232. methods: {
  233. ...mapActions(['appInit', 'logout', 'getUserInfo', 'getUserData']),
  234. getisback(){
  235. if(!this.done){
  236. uni.showModal({
  237. confirmColor: '#26B3A0',
  238. confirmText: '立即退出',
  239. title: '提示',
  240. content: '图片生成中,退出此页面后可能无法生成',
  241. success(src) {
  242. if (src.confirm) {
  243. uni.navigateBack()
  244. }
  245. }
  246. })
  247. }else{
  248. uni.navigateBack()
  249. }
  250. },
  251. getModels(){
  252. let that = this;
  253. this.$http('gallery.getModels',{engine: 'mj'}).then(res => {
  254. if (res.code == 0) {
  255. console.log(res.data);
  256. }
  257. });
  258. },
  259. gallerydetail(id){
  260. let that = this;
  261. this.$http('gallery.detail',{id:id}).then(res => {
  262. if (res.code == 0) {
  263. this.showdrawing = false
  264. this.parameter = res.data
  265. this.prompt = res.data.prompt
  266. this.fronid = res.data.id
  267. this.mjurl = res.data.imgs_file[0]?res.data.imgs_file[0]:res.data.origin_url
  268. this.mj_id = res.data.mj_id
  269. this.mj_hash = res.data.mj_hash
  270. this.done = true
  271. this.isBack = true
  272. if(res.data.mj_action == 'upscale'){
  273. this.radiolist7.splice(0,1)
  274. this.radiovalue7 = '变换生成四张类似的图片'
  275. this.instruction = '变换生成四张类似的图片'
  276. }
  277. }else{
  278. }
  279. });
  280. },
  281. parameters(){
  282. var that = this;
  283. uni.showModal({
  284. showCancel:false,
  285. title:'绘画描述',
  286. content: that.prompt,
  287. confirmColor:'#26b3a0',
  288. confirmText:'关闭'
  289. })
  290. },
  291. signSign(){
  292. uni.navigateTo({
  293. url:'/pages/user/member/member'
  294. })
  295. this.signShow = false
  296. },
  297. setOpen(){
  298. var that = this;
  299. // #ifdef H5
  300. if(!that.done){
  301. uni.showToast({
  302. title:'图片生成中',
  303. icon:'none'
  304. })
  305. return;
  306. }
  307. // #endif
  308. // #ifdef MP-WEIXIN
  309. if(that.showdrawing ){
  310. uni.showToast({
  311. title:'图片生成中',
  312. icon:'none'
  313. })
  314. return;
  315. }
  316. // #endif
  317. if(that.showopen){
  318. uni.showToast({
  319. title:'图片已公开',
  320. icon:'none'
  321. })
  322. return;
  323. }
  324. uni.showModal({
  325. confirmColor: '#26B3A0',
  326. confirmText: '确认公开',
  327. title: '提示',
  328. content: '是否确认公开此绘画作品',
  329. success(src) {
  330. if (src.confirm) {
  331. that.$http('gallery.setOpen',{id:that.fronid}).then(res => {
  332. if (res.code == 0) {
  333. uni.showToast({
  334. title:'提交成功,等待审核'
  335. })
  336. that.showopen = true
  337. }
  338. });
  339. }
  340. }
  341. });
  342. },
  343. groupChange(n){
  344. this.radiovalue7 = n
  345. this.instruction = n
  346. },
  347. createnow(){
  348. var that = this;
  349. var alias = this.appInfo.number_alias ? this.appInfo.number_alias : '点数';
  350. var tst = '再次创作需要消耗'+that.needCoin+alias+'或消耗一次会员套餐次数';
  351. // #ifdef H5
  352. if(!that.done){
  353. uni.showToast({
  354. title:'图片生成中',
  355. icon:'none'
  356. })
  357. return;
  358. }
  359. // #endif
  360. // #ifdef MP-WEIXIN
  361. if(that.showdrawing){
  362. uni.showToast({
  363. title:'图片生成中',
  364. icon:'none'
  365. })
  366. return;
  367. }
  368. // #endif
  369. if (that.appInfo.time_member && that.appInfo.time_member == 1) {
  370. if (that.userData.vip_info && that.userData.is_validity > 0 && that.userData.vip_info.mj_used ==
  371. that.userData.vip_info.mj_times && this.userData.coin < that.needCoin) {
  372. var alias = that.appInfo.number_alias ? that.appInfo.number_alias : '点数';
  373. // this.signTitle = "<p style='font-weight: 550;font-size: 16px;'>您的绘画<span>" + alias +
  374. // "</span>不足或会员套餐内剩余绘画次数不足,无法生成绘画</p>"
  375. this.signTitle =
  376. "<p style='font-weight: 550;font-size: 16px;'>绘画需要<span style='color: #26b3a0;padding: 0 4px;'>" +
  377. that.needCoin + "</span><span>" + alias +
  378. "</span></p><p style='padding-top: 10px;'>您的绘画<span>" + alias +"</span>不足或会员套餐内剩余次数不足,无法生成绘画</p>"
  379. this.signShow = true
  380. return;
  381. }
  382. if (that.userData.is_validity == 0&&this.userData.coin < that.needCoin) {
  383. var alias = that.appInfo.number_alias ? that.appInfo.number_alias : '点数';
  384. this.signTitle =
  385. "<p style='font-weight: 550;font-size: 16px;'>绘画需要<span style='color: #26b3a0;padding: 0 4px;'>" +
  386. that.needCoin + "</span><span>" + alias +
  387. "</span></p><p style='padding-top: 10px;'>您的绘画<span>" + alias +"</span>不足或会员套餐内剩余次数不足,无法生成绘画</p>"
  388. this.signShow = true
  389. return;
  390. }
  391. }else{
  392. if( that.userData.coin<that.needCoin){
  393. this.signTitle = "<p style='font-weight: 550;font-size: 16px;'>再次创作需要<span style='color: #26b3a0;padding: 0 4px;'>"+that.needCoin+"</span><span>"+alias+"</span></p><p style='padding-top: 10px;'>您当前有<span style='color: #26b3a0;padding: 0 4px;'>"+this.userData.coin+"</span><span>"+alias+"</span>,无法生成,快去获取<span>"+alias+"</span>吧</p>"
  394. this.signShow = true
  395. return;
  396. }
  397. }
  398. uni.showModal({
  399. confirmColor: '#26B3A0',
  400. confirmText: '确认创作',
  401. title: '提示',
  402. content: tst,
  403. success(src) {
  404. if (src.confirm) {
  405. that.mjurl = ''
  406. that.done = false
  407. that.creation()
  408. }
  409. }
  410. });
  411. },
  412. creation(){
  413. this.percentage = 0
  414. this.showdrawing = true
  415. this.progressbar()
  416. if(this.instruction == '进行放大使用'){
  417. if(this.radiolist7.length == 2){
  418. this.radiolist7.splice(0,1)
  419. }
  420. this.radiovalue7 = '变换生成四张类似的图片'
  421. this.instruction = '变换生成四张类似的图片'
  422. this.action = 'upscale'
  423. // this.current = 0
  424. // #ifdef MP-WEIXIN
  425. // this.upscale()
  426. this.galleryimagine()
  427. this.showprogress = true
  428. // #endif
  429. // #ifdef H5
  430. this.gettest()
  431. // #endif
  432. }else{
  433. let s = {
  434. name: '进行放大使用',
  435. disabled: false
  436. }
  437. if(this.radiolist7.length == 1){
  438. this.radiolist7.splice(0,0,s)
  439. }
  440. // this.current = 0
  441. this.radiovalue7 = '进行放大使用'
  442. this.instruction = '进行放大使用'
  443. this.action = 'variation'
  444. // #ifdef MP-WEIXIN
  445. // this.variation()
  446. this.galleryimagine()
  447. this.showprogress = true
  448. // #endif
  449. // #ifdef H5
  450. this.gettest()
  451. // #endif
  452. }
  453. // console.log(this.current,this.mj_hash,this.mj_id,this.fronid);
  454. },
  455. // upscale(){
  456. // this.$http('gallery.upscale', {index: this.current + 1,hash: this.mj_hash,id: this.mj_id,pid: this.fronid}).then(res => {
  457. // if (res.code == 0) {
  458. // this.getAsyncResult(res.data)
  459. // }
  460. // });
  461. // },
  462. // variation(){
  463. // this.$http('gallery.variation', {index: this.current + 1,hash: this.mj_hash,id: this.mj_id,pid: this.fronid}).then(res => {
  464. // if (res.code == 0) {
  465. // this.getAsyncResult(res.data)
  466. // }
  467. // });
  468. // },
  469. // 绘制MJ最终调用的接口
  470. gettest(){
  471. var that = this;
  472. let uniacid = uni.getStorageSync("uniacid") || "";
  473. var chatgpturl = API_STEROOT + 'api.gallery/imagine?uniacid=' + uniacid;
  474. let param = {
  475. prompt: that.prompt,
  476. action: that.action,
  477. model_id: that.model_id,
  478. version: that.version,
  479. id: that.mj_id,
  480. index: this.current + 1,
  481. // id:''
  482. }
  483. let headers = {
  484. 'token': uni.getStorageSync("token") || "",
  485. 'platform': this.platform,
  486. 'Content-Type': 'application/json',
  487. }
  488. console.log('headers',headers);
  489. console.log('绘制MJ传递的参数:',param);
  490. fetch(chatgpturl, {method: 'POST',headers:headers,body: JSON.stringify(param)})
  491. .then(x => {
  492. if (x.status === 404) {
  493. uni.showToast({
  494. title:'绘制失败,请重试',
  495. icon:'none'
  496. })
  497. return;
  498. }
  499. if (x.status === 200) return x.body;
  500. throw x;
  501. })
  502. .then(x => {
  503. const k = x.getReader();
  504. return new ReadableStream({
  505. start(V) {
  506. function F() {
  507. k.read().then(({
  508. done: E,
  509. value: U
  510. }) => {
  511. if (E) {
  512. return;
  513. }
  514. V.enqueue(U);
  515. const L = new TextDecoder().decode(U);
  516. // console.log(L);
  517. // const N = JSON.parse(L)
  518. try {
  519. const N = JSON.parse(L)
  520. console.log('fetch(chatgpturl)方法返回值:',N);
  521. if(N.code){
  522. uni.showModal({
  523. showCancel:false,
  524. title:'提示',
  525. confirmText:'退出',
  526. content:N.detail,
  527. confirmColor:'#26b3a0',
  528. success(tay) {
  529. if(tay.confirm){
  530. uni.navigateBack()
  531. }
  532. }
  533. })
  534. return;
  535. }
  536. that.mjurl = N.image_url
  537. if(N.progress==100){
  538. that.mj_id = N.image_id
  539. that.done = true
  540. that.percentage = 0
  541. // that.drawingtitle = '正在提交任务,请不要退出'
  542. that.isBack = true
  543. that.current = 0
  544. }
  545. that.percentage = N.progress
  546. } catch(err) {
  547. console.log('JSON.parse 出错了:' + err);
  548. // uni.showModal({
  549. // confirmText:'退出',
  550. // showCancel:false,
  551. // confirmColor:'#26b3a0',
  552. // title:'提示',
  553. // content:err,
  554. // success(tit) {
  555. // if(tit.confirm){
  556. // uni.navigateBack()
  557. // }
  558. // }
  559. // })
  560. }
  561. F();
  562. })
  563. }
  564. F();
  565. }
  566. })
  567. })
  568. .then(x =>
  569. new Response(x, {
  570. headers: {
  571. 'Content-Type': 'application/json'
  572. }
  573. }).text()
  574. );
  575. },
  576. getPlan() {
  577. this.$http('conf.getGroupConf', {
  578. group: 'system.plan'
  579. }).then(res => {
  580. if (res.code == 0) {
  581. this.needCoin = res.data.unlock_mj_aipainting
  582. this.plan = res.data;
  583. uni.setNavigationBarTitle({
  584. title: this.appInfo.site_name
  585. });
  586. // console.log(this.plan);
  587. }
  588. });
  589. },
  590. galleryimagine(){
  591. let that = this;
  592. this.progressbar()
  593. this.$http('gallery.imagine', {prompt: that.prompt,model_id:that.model_id,version: that.version,id: that.mj_id,
  594. index: this.current + 1,action: that.action}).then(res => {
  595. if (res.code == 0) {
  596. this.getAsyncResult(res.data)
  597. }else{
  598. uni.showToast({
  599. icon:'error',
  600. title:res.msg
  601. })
  602. setTimeout(() => {
  603. uni.navigateBack()
  604. }, 1500);
  605. }
  606. });
  607. },
  608. getAsyncResult(id){
  609. let that = this;
  610. this.$http('gallery.getAsyncResult', {
  611. uuid: id
  612. }).then(res => {
  613. if (res.code == 0) {
  614. if(res.data.done == 1){
  615. this.drawingtitle = '图片正在渲染中...'
  616. this.fronid = res.data.id
  617. this.mj_id = res.data.mj_id
  618. this.mj_hash = res.data.mj_hash
  619. this.mjurl = res.data.imgs_file[0]
  620. this.current = 0
  621. this.done = true
  622. this.percentage = 0
  623. this.isBack = true
  624. clearTimeout(asynchronous);
  625. this.getUserData();
  626. }else{
  627. asynchronous = setTimeout(() => {
  628. that.getAsyncResult(id)
  629. }, 5000);
  630. return;
  631. }
  632. }else{
  633. uni.showToast({
  634. icon:'error',
  635. title:res.msg
  636. })
  637. setTimeout(() => {
  638. uni.navigateBack()
  639. }, 1500);
  640. }
  641. })
  642. },
  643. previewload(){
  644. this.showdrawing = false
  645. this.drawingtitle = '正在努力绘制中,请不要退出'
  646. // this.percentage = 0
  647. },
  648. previewerror(){
  649. this.showdrawing = false
  650. this.drawingtitle = '正在提交任务,请不要退出'
  651. // this.percentage = 0
  652. },
  653. preview(e){
  654. if(this.done){
  655. uni.previewImage({
  656. urls:[e]
  657. })
  658. }
  659. },
  660. tapsubsection(index){
  661. this.current = index
  662. },
  663. progressbar(){
  664. var that = this;
  665. if(that.percentage < 99){
  666. setTimeout(() => {
  667. that.percentage = uni.$u.range(0, 99, that.percentage + 1)
  668. that.progressbar()
  669. }, 800);
  670. }
  671. },
  672. //下载分享
  673. getdownload(){
  674. uni.showModal({
  675. showCancel:false,
  676. title:'提示',
  677. content:'长按图片下载/分享',
  678. confirmColor:'#26b3a0'
  679. })
  680. },
  681. }
  682. }
  683. </script>
  684. <style lang="scss" scoped>
  685. .displaypage{
  686. margin: 30rpx;
  687. }
  688. .generategraph {
  689. // width: 100%;
  690. // border-radius: 16rpx;
  691. margin-bottom: 36rpx;
  692. image{
  693. width: 100%;
  694. border-radius: 16rpx;
  695. will-change: transform;
  696. }
  697. }
  698. .u_radio {
  699. flex-direction: column;
  700. }
  701. /* 底部tabbar start*/
  702. /* 毛玻璃*/
  703. .dd-glass {
  704. width: 100%;
  705. backdrop-filter: blur(20rpx);
  706. -webkit-backdrop-filter: blur(20rpx);
  707. }
  708. .footerfixed {
  709. position: fixed;
  710. // margin: 20rpx;
  711. margin: 40rpx 30rpx;
  712. width: 92%;
  713. bottom: calc(env(safe-area-inset-bottom) / 2);
  714. ;
  715. z-index: 999;
  716. // background-color: rgba(0, 0, 0, 0.15);
  717. background: linear-gradient(to right,#00BCD4,#00ca88);
  718. box-shadow: 0rpx 0rpx 30rpx 0rpx rgba(0, 0, 0, 0.07);
  719. }
  720. .tabbar {
  721. display: flex;
  722. align-items: center;
  723. min-height: 110rpx;
  724. justify-content: space-between;
  725. padding: 0;
  726. height: calc(110rpx + env(safe-area-inset-bottom) / 2);
  727. // padding-bottom: calc(env(safe-area-inset-bottom) / 2);
  728. }
  729. .tabbar .action {
  730. font-size: 22rpx;
  731. position: relative;
  732. flex: 1;
  733. text-align: center;
  734. padding: 0;
  735. display: block;
  736. height: auto;
  737. line-height: 1;
  738. margin: 0;
  739. overflow: initial;
  740. }
  741. .tabbar .action .bar-icon {
  742. width: 100rpx;
  743. position: relative;
  744. display: block;
  745. height: auto;
  746. margin: 0 auto 10rpx;
  747. text-align: center;
  748. font-size: 42rpx;
  749. }
  750. .tabbar .action .bar-icon image {
  751. width: 50rpx;
  752. height: 50rpx;
  753. display: inline-block;
  754. }
  755. .template-details {
  756. margin: 0;
  757. width: 100%;
  758. height: 100vh;
  759. color: #fff;
  760. overflow: hidden;
  761. }
  762. .lazy-loading{
  763. // background: #000;
  764. height: 100%;
  765. }
  766. .drawing{
  767. position: absolute;
  768. top: 46%;
  769. color: #000;
  770. // color: #606266;
  771. font-size: 18px;
  772. }
  773. .drawingdone{
  774. margin: 35rpx 0;
  775. text-align: center;
  776. color: #606266;
  777. font-size: 18px;
  778. }
  779. .progress{
  780. position: absolute;
  781. top: 52%;
  782. width: 60%;
  783. }
  784. .preloader_1{
  785. position:absolute;
  786. margin-right: 65px;
  787. top: 42%;
  788. // right: 8%;
  789. // bottom: 18%;
  790. // position: fixed;
  791. // right: 58%;
  792. // top: 42%;
  793. }
  794. .preloader_1 view{
  795. display:block;
  796. bottom:0px;
  797. width: 9px;
  798. height: 5px;
  799. background:#9b59b6;
  800. position:absolute;
  801. animation: preloader_1 1.5s infinite ease-in-out;
  802. }
  803. .preloader_1 view:nth-child(2){
  804. left:11px;
  805. animation-delay: .2s;
  806. }
  807. .preloader_1 view:nth-child(3){
  808. left:22px;
  809. animation-delay: .4s;
  810. }
  811. .preloader_1 view:nth-child(4){
  812. left:33px;
  813. animation-delay: .6s;
  814. }
  815. .preloader_1 view:nth-child(5){
  816. left:44px;
  817. animation-delay: .8s;
  818. }
  819. @keyframes preloader_1 {
  820. 0% {height:5px;transform:translateY(0px);background:#9b59b6;}
  821. 25% {height:30px;transform:translateY(15px);background:#3498db;}
  822. 50% {height:5px;transform:translateY(0px);background:#9b59b6;}
  823. 100% {height:5px;transform:translateY(0px);background:#9b59b6;}
  824. }
  825. </style>