viewMask.vue 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292
  1. <template src="./viewMask.html">
  2. </template>
  3. <script>
  4. const util = require('@/utils/util.js').default;
  5. import router from "@/router";
  6. import { MessageBox } from 'mint-ui';
  7. import spaceTypes from '@/static/spaceTypesIE.js';
  8. // const config = require('@/services/url$config.js');
  9. import touchHandle from '@/mixins/touchHandle.js';
  10. import {
  11. setStorage,
  12. getStorage,
  13. } from '@/utils/localStorage';
  14. // import requestConfig from '@/static/lib/requestConfig';
  15. // const app = getApp(); //获取应用实例
  16. export default {
  17. mixins: [touchHandle],
  18. data: function() {
  19. return {
  20. currentIndex:0, //当前看到的图片序号
  21. showAIImage: false,//是否显示当前AI结果集合 默认不显示,因为没有
  22. aiImagesList:[
  23. ],//AI生成的图片列表
  24. styleList: [], //风格列表数据
  25. curStyleIndex: 0, //当前选中的风格序号
  26. aiFlag:false,
  27. aiImage: "",
  28. inputBase64Url: "",
  29. aiPicId: "", // 图生图任务ID
  30. randomTimer:null,
  31. timer: null,
  32. outTimer: null,
  33. imageWidth: 750,
  34. imageHeight: 448,
  35. showAIFlag:false,//继续生成状态切换标志
  36. checked:false,
  37. shottingImg:'',
  38. count:0,
  39. random:1,
  40. // disableAble:false,
  41. myloading:false,
  42. loadingMsg:'',
  43. screenWidth:0,
  44. screenHeight:0,
  45. modelType:2, //当前模型类型,1指创意设计 2指精准设计 默认2
  46. themeIndex:0,
  47. themeList:[
  48. {
  49. id:1,
  50. text:'默认',
  51. prot:'',
  52. },
  53. {
  54. id:2,
  55. leftColor:'#F4EBDE',
  56. rightColor:'#C1C9B4',
  57. text:'莫兰素雅',
  58. prot:'Soft grays, warm earth tones, subtle blues, soft pinks,',
  59. },
  60. {
  61. id:3,
  62. leftColor:'#1F1F1F',
  63. rightColor:'#FFFFFF',
  64. text:'经典黑白',
  65. prot:'Classic black and pure white,',
  66. },
  67. {
  68. id:4,
  69. leftColor:'#6FA5BE',
  70. rightColor:'#E2CCC5',
  71. text:'海岸珊瑚',
  72. prot:'Deep ocean blue paired with vibrant coral red,',
  73. },
  74. {
  75. id:5,
  76. leftColor:'#849059',
  77. rightColor:'#E6CEB4',
  78. text:'森林璀璨',
  79. prot:'Deep forest green paired with luxurious gold,'
  80. },
  81. {
  82. id:6,
  83. leftColor:'#A1BACB',
  84. rightColor:'#E6DFD8',
  85. text:'梦幻静谧',
  86. prot:'Dreamy powder blue paired with neutral gray,'
  87. },
  88. {
  89. id:7,
  90. leftColor:'#303B2B',
  91. rightColor:'#D8C8A6',
  92. text:'自然和谐',
  93. prot:'Natural olive green paired with warm beige,'
  94. },
  95. {
  96. id:8,
  97. leftColor:'#652C30',
  98. rightColor:'#D5C3B0',
  99. text:'醇酒乳香',
  100. prot:'Rich burgundy paired with soft cream,'
  101. },
  102. {
  103. id:9,
  104. leftColor:'#E3C7C5',
  105. rightColor:'#EDE4DB',
  106. text:'雅致浪漫',
  107. prot:'Understated taupe paired with romantic pink,'
  108. },
  109. {
  110. id:10,
  111. leftColor:'#2C3C6E',
  112. rightColor:'#F0DBBD',
  113. text:'夜空璀璨',
  114. prot:'Elegant navy blue paired with glamorous gold,'
  115. },
  116. {
  117. id:11,
  118. leftColor:'#ACC9A1',
  119. rightColor:'#E6DCC6',
  120. text:'复古翠绿',
  121. prot:'Vintage tan paired with vibrant green,'
  122. },
  123. {
  124. id:12,
  125. leftColor:'#AAA8A7',
  126. rightColor:'#D8A176',
  127. text:'暖阳灰影',
  128. prot:'Warm orange paired with cool gray,'
  129. },
  130. {
  131. id:13,
  132. leftColor:'#413D41',
  133. rightColor:'#D1B687',
  134. text:'耀眼黑金',
  135. prot:'black and gold,'
  136. },
  137. ],
  138. timeOut:20000, //超时时间
  139. subType:0,
  140. currentImg:null,
  141. reqList:[
  142. {
  143. model:'batouresearch/sdxl-controlnet-lora',
  144. level:'5',
  145. aiPicId:'',
  146. resultImg:'',
  147. }
  148. ],
  149. reqListReset:[
  150. {
  151. model:'deployments/elabgroup/elab-sdxl-controlnet-lora',
  152. level:'3',
  153. aiPicId:'',
  154. resultImg:'',
  155. },{
  156. model:'batouresearch/sdxl-controlnet-lora',
  157. level:'5',
  158. aiPicId:'',
  159. resultImg:'',
  160. }
  161. ],
  162. // dialogVisible: false,
  163. // dialogAIVisible: false,
  164. datalist:[],
  165. connectUsImg:'',
  166. curSpaceId:'',
  167. queryObj:null,
  168. form:null,
  169. }
  170. },
  171. props:{
  172. spaceObj: {
  173. type: Object,
  174. default: null,
  175. },
  176. spaceList: {
  177. type: [Array ,Object],
  178. default: [],
  179. },
  180. layoutList:{
  181. type: [Array ,Object],
  182. default: [],
  183. }
  184. },
  185. watch: {
  186. spaceObj(newVal, oldVal) {
  187. if (newVal == null) {
  188. return;
  189. }
  190. console.log("当前空间数据view-mark-watch:", newVal,newVal.layoutSpaceName,newVal.layoutSpaceType);
  191. this.getAiBeautyFamily();
  192. // this.curSpaceArea = parseFloat(
  193. // (newVal.spaceWidth * newVal.spaceHeight) / 10000
  194. // ).toFixed(2);
  195. // this.getOverallArrangementDetailsList();
  196. },
  197. spaceList(newVal, oldVal) {
  198. if (newVal == null) {
  199. return;
  200. }
  201. console.log("当前空间数据spaceList-watch:", newVal);
  202. if(newVal && newVal.length>0){
  203. this.datalist = [];
  204. newVal.forEach(it=>{
  205. if(it.spaceName && !it.isSizeLock){
  206. this.datalist.push(it);
  207. }
  208. })
  209. }
  210. },
  211. layoutList(newVal, oldVal) {
  212. if (newVal == null) {
  213. return;
  214. }
  215. this.updataLable();
  216. },
  217. customizedRecordId: {
  218. handler(newVal) {
  219. console.warn("***watch-customizedRecordId***", newVal);
  220. if (newVal != null) {
  221. this.getIdData();
  222. }
  223. },
  224. immediate: true,
  225. },
  226. },
  227. filters:{
  228. // spaceTypeFilter(type){
  229. // let name = spaceTypes[type - 1];
  230. // return name || '-'
  231. // },
  232. },
  233. mounted() {//组件挂载时事件
  234. // console.warn("***mounted-nav***",this.seedItem)
  235. // if(this.seedItem){
  236. // this.title = this.seedItem.seedText;
  237. // }
  238. // wx.checkJsApi({
  239. // jsApiList: ['previewImage'], // 需要检测的JS接口列表,所有JS接口列表见附录2,
  240. // success: function(res) {
  241. // // 以键值对的形式返回,可用的api值true,不可用为false
  242. // // 如:{"checkResult":{"chooseImage":true},"errMsg":"checkJsApi:ok"}
  243. // console.warn("checkJsApi",res)
  244. // // alert('su'+ JSON.stringify(res))
  245. // },
  246. // fail:(err)=>{
  247. // console.warn("checkJsApi-err",err)
  248. // // alert('err'+ JSON.stringify(err) )
  249. // }
  250. // })
  251. this.screenWidth = window.screen.width;
  252. this.screenHeight = window.screen.height;
  253. if(window.innerWidth && window.screen.width){
  254. this.screenWidth = Math.min(window.innerWidth,window.screen.width)
  255. }
  256. if(window.innerHeight && window.screen.height){
  257. this.screenHeight = Math.min(window.innerHeight,window.screen.height)
  258. }
  259. this.connectUsImg = 'https://dm.static.elab-plus.com/miniProgram/conentUs.png';
  260. let firstData = JSON.parse(getStorage('firstData'));
  261. if(firstData && firstData[0]){
  262. this.connectUsImg = firstData[0].selectOptionImageUrl;
  263. }
  264. let queryObj = getStorage('queryObj') ? JSON.parse(getStorage('queryObj')) : null;
  265. this.queryObj = queryObj;
  266. },
  267. beforeDestroy:function(){
  268. console.warn("***beforeDestroy***");//更新到页面上的数据
  269. this.stopInterval();
  270. },
  271. computed: {
  272. aiData() {
  273. return this.$store.state.aiData;
  274. },
  275. landDataId() {
  276. return this.$store.state.landDataId;
  277. },
  278. houseName() {
  279. return this.$store.state.houseName;
  280. },
  281. curHouseObj() {
  282. return this.$store.state.curHouseObj;
  283. },
  284. userId() {
  285. return this.$store.state.userId;
  286. },
  287. customizedRecordId() {
  288. return this.$store.state.customizedRecordId;
  289. },
  290. },
  291. methods:{
  292. //更改空间显示名称 X空间 类型 根据布局所属类型来显示
  293. updataLable(){
  294. let list = this.layoutList;
  295. this.datalist.forEach(lable=>{
  296. if(lable.spaceType==15){
  297. let layoutId = lable.layoutId;
  298. let layout = list.find(it=>it.id == layoutId);
  299. if(layout){
  300. let name = spaceTypes[layout.type - 1];
  301. lable.text = name;
  302. }
  303. }else{
  304. let name = spaceTypes[lable.spaceType - 1];
  305. lable.text = name;
  306. }
  307. })
  308. this.$forceUpdate()
  309. console.warn("***updataLable***",this.datalist)
  310. },
  311. swiperChangeImg(e){
  312. this.currentIndex = e.detail?e.detail.current:e;
  313. this.checked = this.aiImagesList[this.currentIndex].checked;
  314. console.warn("***swiperChangeImg***",this.checked);//更新到页面上的数据
  315. },
  316. //切换空间
  317. changeSpace(item){
  318. this.$parent.changeSpace(item.spaceId);
  319. let param = {
  320. type: 'CLK', //埋点类型
  321. clkId: 'clk_2cmina_23080417', //点击ID
  322. clkName: 'changeangle_clk', //点击前往的页面名称
  323. clkParams: {
  324. locusName: "空间切换",
  325. locusValue:item.text,
  326. spaceId:item.spaceId,
  327. type:item.text,
  328. }
  329. };
  330. util.trackRequest(param);
  331. },
  332. //视角切换
  333. switchActor(){
  334. // this.$parent.clearHandle()
  335. this.$emit('switchActor');
  336. this.showAIImage = false;//隐藏AI结果集合-执行切换视角
  337. let index = this.$parent.currentActor.userIndex;//当前视角的序号
  338. let nextIndex = (index + 1) % this.$parent.actors.length;
  339. let param = {
  340. type: 'CLK', //埋点类型
  341. clkId: 'clk_2cmina_23080417', //点击ID
  342. clkName: 'changeangle_clk', //点击前往的页面名称
  343. clkParams: {
  344. locusName: "视角切换",
  345. type:this.$parent.actors[nextIndex].actorEum
  346. }
  347. };
  348. util.trackRequest(param);
  349. },
  350. showOrHideWebGl(){
  351. // this.$parent.clearHandle()
  352. this.showAIImage = !this.showAIImage;
  353. let param = {
  354. type: 'CLK', //埋点类型
  355. clkId: 'clk_2cmina_23080415', //点击ID
  356. clkName: 'contrast_clk', //点击前往的页面名称
  357. clkParams: {
  358. locusName: "对比",
  359. }
  360. };
  361. util.trackRequest(param);
  362. },
  363. //空间或者风格切换
  364. selectAction(selItem,type,index) {
  365. console.log('点击动作111:', selItem,type,index)
  366. var self = this;
  367. if(this.themeIndex == index){
  368. return false
  369. }
  370. this.themeIndex = index;
  371. let param = {
  372. type: 'CLK', //埋点类型
  373. clkId: 'clk_2cmina_23112701', //点击ID
  374. clkName: 'AIstyle_theme_clk', //点击前往的页面名称
  375. clkParams: {
  376. locusName: "AI 主题",
  377. type:this.themeList[this.themeIndex].text
  378. }
  379. };
  380. util.trackRequest(param);
  381. },
  382. //切换模式
  383. changeModel(){
  384. this.modelType = (this.modelType + 1) >2 ? 1 : 2;
  385. },
  386. //保存到相册
  387. save() {
  388. //表示canvas正在绘制,不能进行保存
  389. if (!this.aiImagesList || this.aiImagesList.length==0) {
  390. return false;
  391. }
  392. var _resultImg = this.aiImagesList[this.currentIndex].image;
  393. //正在选择照片,不能生效
  394. if (!_resultImg || _resultImg.length==0) {
  395. this.showToast("请选中图片后再试!");
  396. return false;
  397. }
  398. var para = {
  399. type: 'CLK', //埋点类型
  400. clkId: 'clk_2cmina_56', //点击ID,固定
  401. clkName: "share-savepic", //点击名称
  402. expand: {
  403. "resultImg": (_resultImg || ""),
  404. },
  405. }
  406. util.trackRequest(para);
  407. if(navigator.userAgent.toLocaleLowerCase().includes('micromessenger')){
  408. this.$message("请长按图片保存!");
  409. }else{
  410. this.saveImageHandle(_resultImg);
  411. }
  412. },
  413. downloadIamge(imgsrc) { //下载图片地址和图片名
  414. var fileName = "4DImage" + util.formatDate(new Date(), "yyyyMMddhhmmss") + '.jpg';
  415. const image = new Image();
  416. // 解决跨域 Canvas 污染问题
  417. image.setAttribute("crossOrigin", "anonymous");
  418. image.onload = ()=> {
  419. // let canvas = document.createElement("canvas");
  420. // canvas.width = image.width;
  421. // canvas.height = image.height;
  422. // const context = canvas.getContext("2d");
  423. // context.drawImage(image, 0, 0, image.width, image.height);
  424. // const url = canvas.toDataURL("image/jpg"); //得到图片的base64编码数据
  425. const a = document.createElement("a"); // 生成一个a元素
  426. const event = new MouseEvent("click"); // 创建一个单击事件
  427. a.download = fileName || "photo"; // 设置图片名称
  428. a.href = imgsrc; // 将生成的URL设置为a.href属性
  429. a.dispatchEvent(event); // 触发a的单击事件
  430. this.showToast("保存成功!");
  431. };
  432. image.src = imgsrc;
  433. },
  434. saveImageHandle(_resultImg){
  435. let param = {
  436. type: 'CLK', //埋点类型
  437. clkId: 'clk_2cmina_23080414', //点击ID
  438. clkName: 'download_clk', //点击前往的页面名称
  439. clkParams: {
  440. locusName: "下载",
  441. img:_resultImg
  442. }
  443. };
  444. util.trackRequest(param);
  445. this.downloadIamge(_resultImg);
  446. },
  447. //点赞喜欢
  448. changeAIImg() {
  449. // let lastPage = getCurrentPages()[getCurrentPages().length - 2] ? getCurrentPages()[getCurrentPages().length - 2].$vm : null;
  450. this.checked = !this.checked;//变更选项
  451. this.aiImagesList[this.currentIndex].checked = this.checked;
  452. console.warn("***changeAIImg***",this.checked,this.aiData)
  453. // if(this.aiData){//给上一个页面回传生成的数据
  454. // let space = this.aiData.find(it=>{
  455. // return it.spaceId == this.spaceObj.spaceId
  456. // })
  457. // if(space){
  458. // space.aiImagesList[this.currentIndex].checked = this.checked;
  459. // }
  460. // }
  461. if(this.checked){
  462. let param = {
  463. type: 'CLK', //埋点类型
  464. clkId: 'clk_2cmina_23080418', //点击ID
  465. clkName: 'chooseprogramme_clk', //点击前往的页面名称
  466. clkParams: {
  467. locusName: "选定风格/视角",
  468. style:this.styleList[this.curStyleIndex].styleName,
  469. img:this.aiImagesList[this.currentIndex].image,
  470. }
  471. };
  472. util.trackRequest(param);
  473. }
  474. },
  475. rightScroll(){//右滑
  476. if(this.currentIndex <= (this.aiImagesList.length - 1) && this.currentIndex > 0){
  477. // this.currentIndex --;
  478. this.$refs.carousel.prev();
  479. }
  480. },
  481. leftScroll(){//继续生成
  482. if(this.currentIndex != this.aiImagesList.length - 1){
  483. if(this.currentIndex<this.aiImagesList.length - 1){
  484. // this.currentIndex ++;
  485. this.$refs.carousel.next();
  486. }
  487. return false;
  488. }
  489. console.log("***leftScroll***",this.currentIndex,this.aiImagesList.length)
  490. this.aiSubmit(2);//继续生成下一张
  491. },
  492. //预览图片-使用微信自带的预览功能,即H5中不可用
  493. previewAction() {
  494. if(wx && typeof(wx.previewImage)=='function'){
  495. let imglist = this.aiImagesList.map(it=>it.image);
  496. wx.previewImage({
  497. current: this.currentIndex,
  498. urls: imglist,
  499. success: (res) => {
  500. console.log('图片预览:', res);
  501. },
  502. fail:(err)=>{
  503. console.warn('图片预览-err:', res);
  504. }
  505. })
  506. }
  507. },
  508. mynavigateFuc(e) {
  509. if (e) {
  510. // this.$parent.clearHandle();
  511. let param = {
  512. type: 'CLK', //埋点类型
  513. clkId: 'clk_2cmina_23080408', //点击ID
  514. clkName: 'WeCom_clk', //点击前往的页面名称
  515. clkParams: {
  516. locusName: "联系定制",
  517. }
  518. };
  519. util.trackRequest(param);
  520. if(window.__wxjs_environment === 'miniprogram'){
  521. wx.miniProgram.navigateTo({url: '/pages/transfer/transfer?event=openCustomerServiceChat&houseId='+this.$store.state.houseId})
  522. }else{
  523. this.$message.warning("敬请期待");
  524. }
  525. }
  526. },
  527. catchTapEvent:function(){
  528. return false;
  529. },
  530. //获取AI风格列表
  531. async getAiBeautyFamily() {
  532. // const spaceName = this.spaceTypes[this.spaceObj.spaceType - 1].title;
  533. let res = await requestConfig("getHardboundEffects", {
  534. // "houseId": this.$route.query.houseId || this.$store.state.houseId,
  535. "spaceType": this.spaceObj.layoutSpaceType || this.spaceObj.spaceType,
  536. "spaceName": this.spaceObj.layoutSpaceName || this.spaceObj.spaceName,
  537. });
  538. this.styleList = [];
  539. // alert("***getAiBeautyFamily-res***"+JSON.stringify(res))
  540. if (res.success) {
  541. let list = res.list;
  542. this.styleList = list;
  543. }
  544. },
  545. //风格选择
  546. selectStyle(idx){
  547. if(this.curStyleIndex == idx){
  548. return false
  549. }
  550. this.curStyleIndex = idx;
  551. let param = {
  552. type: 'CLK', //埋点类型
  553. clkId: 'clk_2cmina_23080416', //点击ID
  554. clkName: 'AIstyle_ret_clk', //点击前往的页面名称
  555. clkParams: {
  556. locusName: "AI 风格",
  557. type:this.styleList[this.curStyleIndex].styleName
  558. }
  559. };
  560. util.trackRequest(param);
  561. },
  562. // AI渲染
  563. async aiSubmit(type) {
  564. if(!this.styleList || this.styleList.length==0 || this.curStyleIndex==-1
  565. || !this.styleList[this.curStyleIndex].prompt || !this.styleList[this.curStyleIndex].negativePrompt){
  566. return false;
  567. }
  568. // 防止连续点击处理
  569. if (this.aiFlag) {
  570. return
  571. }
  572. this.aiFlag = true;
  573. this.aiImage = "";//清空AI结果图
  574. this.stopInterval();
  575. // if(!this.showAIImage){
  576. this.myloading = true;
  577. this.loadingMsg = "启动中";
  578. // }
  579. // this.inputBase64Url = await this.shottingAction(2);//开始截图-返回的是base64的数据
  580. // this.startServer();
  581. // let base64 = await this.$parent.shottingAction(2);//开始截图-返回的是base64
  582. let shottingImg = await this.$parent.shottingAction();//开始截图-返回的是图片地址
  583. if(!shottingImg){
  584. this.showToast("渲染失败,请重试");
  585. return false;
  586. }
  587. // ?x-oss-process=image/auto-orient,1/quality,Q_46/format,jpg //阿里OSS
  588. // "?imageMogr2/auto-orient/format/webp/blur/1x0/quality/75";//七牛云压缩图片
  589. shottingImg += "?x-oss-process=image/auto-orient,1/quality,Q_46/format,jpg";//压缩图片
  590. this.shottingImg = shottingImg;
  591. this.changeImg2Base64(this.shottingImg, false);
  592. console.warn("***shottingImg***",this.shottingImg)
  593. if(type==1){
  594. let param = {
  595. type: 'CLK', //埋点类型
  596. clkId: 'clk_2cmina_23080413', //点击ID
  597. clkName: 'AIcreate_clk', //点击前往的页面名称
  598. clkParams: {
  599. locusName: "AI生成",
  600. userparamter:{
  601. shottingImg:this.shottingImg,
  602. style:this.styleList[this.curStyleIndex].styleName
  603. }
  604. }
  605. };
  606. util.trackRequest(param);
  607. }else{
  608. let param = {
  609. type: 'CLK', //埋点类型
  610. clkId: 'clk_2cmina_23080419', //点击ID
  611. clkName: 'continueAIcreate_clk', //点击前往的页面名称
  612. clkParams: {
  613. locusName: "继续生成",
  614. userparamter:{
  615. shottingImg:this.shottingImg,
  616. style:this.styleList[this.curStyleIndex].styleName
  617. }
  618. }
  619. };
  620. util.trackRequest(param);
  621. }
  622. },
  623. image2Base64(imgUrl) {//导入的图片路径
  624. var toBase64= new Promise(function(resolve, reject){
  625. window.URL = window.URL || window.webkitURL;
  626. var xhr = new XMLHttpRequest();
  627. xhr.open("get", imgUrl, true);
  628. // 至关重要
  629. xhr.responseType = "blob";//文件流
  630. xhr.onload = function (res) {
  631. if (res.currentTarget.status == 200) {
  632. //得到一个blob对象
  633. var blob = res.currentTarget.response;
  634. // 至关重要
  635. let oFileReader = new FileReader();
  636. oFileReader.onloadend = function (e) {
  637. let base64 = e.target.result;//base64
  638. resolve(base64)
  639. };
  640. oFileReader.readAsDataURL(blob);
  641. }
  642. }
  643. xhr.send();
  644. });
  645. return toBase64;
  646. },
  647. changeImg2Base64(url, isRepeat) {
  648. var self = this;
  649. if(isRepeat && self.inputBase64Url){//重复使用
  650. self.startServer();
  651. }else{
  652. self.startServer();
  653. }
  654. },
  655. //前置逻辑
  656. async prevHandle(parmas){
  657. //不是首次请求,则无需前置判断 用户上传的也不需要前置处理
  658. if(this.subType!=0){
  659. return '';
  660. }
  661. return new Promise(async (resolve, reject) => {
  662. let _data = JSON.parse(JSON.stringify(parmas))
  663. delete _data.webhook;
  664. let res = await requestConfig("img2img_local", _data);
  665. if (res.success) {
  666. if (res.success && res.single) {
  667. let resultImg = res.single;
  668. resolve(resultImg);
  669. }else{
  670. resolve('');
  671. }
  672. }else{
  673. resolve('');
  674. }
  675. })
  676. },
  677. //开始图生图流程
  678. async startServer() {
  679. if(!this.styleList || this.curStyleIndex < 0 || !this.styleList[this.curStyleIndex].imgUrl){
  680. return false
  681. }
  682. if(this.$parent.pvCurPageName!="room_show"){//说明用户切换页面了
  683. console.warn("***用户已经退出页面***")
  684. return false;
  685. }
  686. let imgUrl = this.styleList[this.curStyleIndex].imgUrl;
  687. let subType = this.subType;
  688. let session_hash = Date.now();
  689. let theme = this.themeList[this.themeIndex];//主题数据
  690. let prompt = this.styleList[this.curStyleIndex].prompt + theme.prot;
  691. let noPromot = this.styleList[this.curStyleIndex].negativePrompt;
  692. let unit = 768 / this.screenWidth;
  693. this.imageWidth = parseInt((this.screenWidth * unit).toFixed());
  694. this.imageHeight = parseInt((this.$parent.canvasHeight * unit).toFixed());
  695. this.timeOut = this.modelType==1? 20000: 50000;
  696. var parmas = {
  697. negativePrompt: noPromot,
  698. prompt: prompt,
  699. "batchSize": 1,
  700. brandId: $config.brandId,
  701. height: this.imageHeight,
  702. width: this.imageWidth,
  703. "moduleType": "AI_Biography",
  704. "steps":20,
  705. "sampler":"DDIM",
  706. "controlNetSessionHash":session_hash,
  707. "cfgScale":12,
  708. "denoising":0.9,
  709. image:this.shottingImg,
  710. styleImage:imgUrl,
  711. keyword: "replicate",
  712. model: this.modelType==1? "lucataco/ssd-1b" : 'catio-apps/controlnet-interior-design',
  713. };
  714. if(this.modelType==2){//精准设计
  715. if(subType == 0){//首次
  716. parmas.model = this.reqList[0].model;
  717. }else{//重试
  718. parmas.model = this.reqListReset[0].model;
  719. }
  720. }else{//创意设计
  721. if(subType == 0){//首次
  722. parmas.model = "lucataco/ssd-1b";
  723. }else{//重试
  724. parmas.model = "deployments/elabgroup/elab-ssd-1b";
  725. }
  726. }
  727. this.curSpaceId = this.spaceObj.spaceId;//生成时的空间id
  728. let result = await this.prevHandle(parmas);
  729. console.warn("***prevHandle***",result)
  730. if(result && result.length>0){
  731. this.randomHandle(result)
  732. return false;
  733. }else{
  734. if(this.modelType==2){//精准设计
  735. this.otherHandle(parmas);//发送其他AI请求
  736. }
  737. let res = await requestConfig("generateTaskImgToImgForAliyun", parmas);
  738. console.log("图生图结果:", res);
  739. let that = this;
  740. if (res.success && res.single) {
  741. this.aiPicId = res.single;
  742. if(this.modelType==2){//精准设计
  743. if(subType == 0){//首次
  744. this.reqList[0].aiPicId = this.aiPicId;
  745. }else{//重试
  746. this.reqListReset[0].aiPicId = this.aiPicId;
  747. }
  748. }
  749. if (this.aiPicId) {
  750. this.startInterval();//开始轮询AI生成图的结果
  751. }else{
  752. this.stopInterval()
  753. }
  754. }else{
  755. this.stopInterval()
  756. this.showToast("渲染失败,请重试")
  757. }
  758. }
  759. },
  760. stopInterval() {
  761. if (this.randomTimer) {
  762. clearInterval(this.randomTimer);
  763. this.randomTimer = null;
  764. }
  765. if (this.timer) {
  766. // clearInterval(this.timer);
  767. this.timer = null;
  768. }
  769. if (this.outTimer) {
  770. clearTimeout(this.outTimer)
  771. this.outTimer = null
  772. }
  773. this.subType = 0;
  774. this.reqList.forEach(it=>{
  775. it.aiPicId = '';
  776. it.resultImg = '';
  777. })
  778. this.reqListReset.forEach(it=>{
  779. it.aiPicId = '';
  780. it.resultImg = '';
  781. })
  782. // this.random = 1;
  783. this.myloading = false;
  784. this.aiFlag = false;
  785. },
  786. //随机处理
  787. randomHandle(resultImg){
  788. if(this.timer || !resultImg){
  789. return false;
  790. }
  791. let self = this;
  792. var count = 1;
  793. var process = 0;//进度
  794. var randomNum = Math.floor(Math.random() * 4 + 5);//5-8随机数
  795. this.randomTimer = setInterval(function() {
  796. process = parseInt(count * 100/(randomNum));
  797. if(process>=100){
  798. process = 99;
  799. }
  800. if (count < randomNum) {//没有到上限
  801. // if(!self.showAIImage){
  802. self.myloading = true;
  803. self.loadingMsg = '生成中…' + process + '%';
  804. // }
  805. }else{
  806. self.myloading = false;
  807. self.resultHandle(resultImg);
  808. }
  809. count = count + 1;
  810. }, 1000);
  811. },
  812. otherHandle(parmas){
  813. let reqList = [];
  814. if(this.subType == 0){//首次
  815. reqList = this.reqList;
  816. }else{//重试
  817. reqList = this.reqListReset;
  818. }
  819. reqList.forEach(async (it,index)=>{
  820. let _data = JSON.parse(JSON.stringify(parmas));
  821. if(index>0){
  822. _data.model = it.model;
  823. let res = await requestConfig("generateTaskImgToImgForAliyun", _data);
  824. if (res.success) {
  825. console.log('生成结果123:', res);
  826. it.aiPicId = res.single || '';
  827. }
  828. }
  829. })
  830. },
  831. //开始生成AI图的轮询,每隔1s轮询一次
  832. startInterval() {
  833. if(this.timer){
  834. return false;
  835. }
  836. let self = this;
  837. this.count = 1;//轮询次数
  838. var random = 0;
  839. this.currentImg = false;//当次生成图还没有结果
  840. this.timer = 1;
  841. this.getOutPicture();//不在轮询,而是等结果
  842. this.setOutTimer();//设置超时逻辑
  843. },
  844. //设置一个超时逻辑,到底指定时间后停止轮询,当前是90s
  845. setOutTimer() {
  846. if (this.outTimer) {
  847. clearTimeout(this.outTimer)
  848. this.outTimer = null
  849. }
  850. var self = this;
  851. this.outTimer = setTimeout(function() {
  852. if (self.timer) {
  853. let hasResult = false;
  854. if(self.modelType==2){//精准设计
  855. let reqList = [];
  856. if(self.subType == 0){//首次
  857. reqList = self.reqList;
  858. }else{//重试
  859. reqList = self.reqListReset;
  860. }
  861. reqList.some((item,index) => {
  862. if(item.resultImg){
  863. hasResult = true;
  864. self.resultHandle(item.resultImg)
  865. }
  866. });
  867. }
  868. console.warn("***hasResult***",hasResult)
  869. if(!hasResult){//没有结果
  870. self.stopInterval();//停止轮询
  871. // self.$message.warning("AI开了个小差,请稍后再试");
  872. // self.dialogVisible = true;//弹出超时提示
  873. MessageBox.confirm('',{
  874. title: '提示',
  875. message: '当前AI使用火爆,请继续尝试?',
  876. showCancelButton: true,
  877. confirmButtonText:'继续尝试',
  878. cancelButtonText:'取消等待',
  879. }).then(action => {
  880. console.warn("***MessageBox-action***",action)
  881. if(action == 'confirm'){
  882. self.confirmHandle(1);
  883. }
  884. }).catch(err=>{
  885. console.warn("***MessageBox-err***",err)
  886. if(err == 'cancel'){
  887. self.cancelHandle();
  888. }
  889. });
  890. // MessageBox.confirm('确定执行此操作?')
  891. }
  892. }
  893. clearTimeout(self.outTimer);
  894. self.outTimer = null
  895. }, this.timeOut);
  896. },
  897. confirmHandle(type){
  898. console.log('用户点击确定')
  899. this.subType = type || 0;
  900. this.startServer();
  901. },
  902. cancelHandle(){
  903. console.log('用户点击取消')
  904. this.subType = 0;
  905. },
  906. //获取生成图结果
  907. getOutPicture() {
  908. if(this.timer==null){
  909. console.warn("***当前轮询已经结束了1***")
  910. return false;
  911. }
  912. if(this.modelType==2){//精准设计
  913. let reqList = [];
  914. if(this.subType == 0){//首次
  915. reqList = this.reqList;
  916. }else{//重试
  917. reqList = this.reqListReset;
  918. }
  919. reqList.forEach((item,index) => {
  920. this.singleHandle(item)
  921. });
  922. }
  923. else{
  924. this.singleHandle({aiPicId:this.aiPicId})
  925. }
  926. },
  927. //发出获取结果请求获取AI生成结果
  928. async singleHandle(model){
  929. if(!model || !model.aiPicId){
  930. return false;
  931. }
  932. var parmas = {
  933. id: model.aiPicId,
  934. };
  935. let res = await requestConfig("getPredictions", parmas);
  936. if (res.success && res.single) {
  937. if(this.currentImg){//当前已经有生成图了
  938. console.warn("***当前已经有最高级生成图了***")
  939. return false;
  940. }
  941. if(this.timer==null){
  942. console.warn("***当前轮询已经结束了***")
  943. return false;
  944. }
  945. if (res.single.status == 'succeeded' && res.single.output) {
  946. if(this.modelType==2){//精准设计
  947. model.resultImg = res.single.output;
  948. if(model.level=='5'){//最高级了
  949. this.currentImg = true;
  950. setTimeout(()=>{
  951. this.resultHandle(res.single.output)
  952. },1500)
  953. }
  954. }else{
  955. this.currentImg = true;
  956. setTimeout(()=>{
  957. this.resultHandle(res.single.output)
  958. },1500)
  959. }
  960. console.warn("***有生成图了***",model)
  961. }
  962. if(this.modelType==2){//最高优先级返回没有图片,则处理进度条事宜
  963. if(model.level=='5'){
  964. this.processHandle(res.single);
  965. }
  966. }else{//普通设计
  967. this.processHandle(res.single);
  968. }
  969. } else if (!res.success) {
  970. this.stopInterval();//停止轮询
  971. this.showToast("渲染失败,请重试")
  972. }
  973. },
  974. //进度处理
  975. processHandle(single){
  976. console.warn("***single***",single.status,single.progress,this.count,single);
  977. let self = this;
  978. if(single.status=='starting'){//启动中的逻辑
  979. if(this.count>=20){
  980. this.stopInterval();//停止轮询
  981. // this.dialogAIVisible = true;
  982. MessageBox.confirm('',{
  983. title: '提示',
  984. message: 'AI开了小差,是否重新生成?',
  985. showCancelButton: true,
  986. confirmButtonText:'继续生成',
  987. cancelButtonText:'放弃生成',
  988. }).then(action => {
  989. console.warn("***MessageBox-action***",action)
  990. if(action == 'confirm'){
  991. this.confirmHandle(0);
  992. }
  993. }).catch(err=>{
  994. if(err == 'cancel'){
  995. this.cancelHandle();
  996. }
  997. });
  998. }else{
  999. this.myloading = true;
  1000. this.loadingMsg = '启动中';
  1001. }
  1002. this.count = this.count + 1;
  1003. this.getOutPicture();
  1004. }else if(single.status=='processing'){
  1005. let random = single.progress || 0;
  1006. if(random >= 100){
  1007. random = 99;
  1008. }
  1009. this.myloading = true;
  1010. this.loadingMsg = '生成中…' + parseInt(random) + '%';
  1011. this.getOutPicture();
  1012. }else if(single.status=='succeeded'){
  1013. this.myloading = true;
  1014. this.loadingMsg = '生成中…100%';
  1015. }
  1016. },
  1017. //返回结果处理
  1018. resultHandle(resultImg){
  1019. this.currentImg = true;
  1020. // this.random = 100;
  1021. this.aiImage = resultImg;
  1022. this.showAIFlag = true;
  1023. let newImage = resultImg;
  1024. let aiStyleName = this.styleList[this.curStyleIndex].styleName;
  1025. let _data = {
  1026. image:newImage,
  1027. checked:false,
  1028. list:[newImage],
  1029. spaceId:this.curSpaceId,//记录下当前生成的AI图是哪个空间的,因为会切换空间
  1030. }
  1031. this.aiImagesList.push(_data);
  1032. this.showAIImage = true;//显示AI结果集合-因为生成了AI图片
  1033. if(this.$parent && typeof(this.$parent.clearHandle)=="function" ){
  1034. this.$parent.clearHandle();
  1035. }
  1036. this.stopInterval();
  1037. if(this.aiImagesList.length>1){
  1038. setTimeout(()=>{
  1039. this.$refs.carousel.setActiveItem(this.aiImagesList.length-1);//切换到最后一张
  1040. }, 1000);
  1041. }
  1042. },
  1043. //空间数据整理
  1044. spaceAIHandle(){
  1045. let curHouseObj = this.$parent.curHouseObj;//当前户型数据对象
  1046. let aiImagesList = this.aiImagesList;//AI生成图数据对象
  1047. let wallList = this.$parent.wallList;//当前户型墙体数据列表对象
  1048. let spaceList = JSON.parse(curHouseObj.houseJson);
  1049. //遍历当前户型下的每一个空间
  1050. spaceList.forEach((item)=>{
  1051. let space = item;
  1052. let list = aiImagesList.filter(it=>it.spaceId==space.spaceId);//找到AI生成图中的当前空间
  1053. if(list && list.length>0){
  1054. list = list.filter(it=>it.checked==true);//过滤选中的
  1055. list = list.map(it=>{
  1056. return it.image
  1057. })
  1058. space.hardboundEffect = list;
  1059. console.warn("submitHouse: ", list,space);
  1060. }
  1061. let wall = wallList.find(it=>it.id==space.wallId);
  1062. if(wall){//找到当前空间的墙体数据
  1063. space.wallList = JSON.stringify(wall);
  1064. }
  1065. })
  1066. setStorage('spaceList', spaceList);//把空间选择的数据存入本地缓存里面,方便后续使用
  1067. console.warn("**spaceList**",spaceList)
  1068. },
  1069. //进入下一步
  1070. gonext(){
  1071. this.spaceAIHandle()
  1072. router.push({
  1073. name: "webgl_rxdz_test_env",
  1074. query:{
  1075. houseId:this.$route.query.houseId || this.$store.state.houseId,
  1076. }
  1077. });
  1078. },
  1079. submit() {
  1080. this.spaceAIHandle();
  1081. setTimeout(()=>{
  1082. if(this.customizedRecordId){//修改
  1083. this.updateHandle();
  1084. }else{//完全新增
  1085. this.resultDataHandle();
  1086. }
  1087. },200)
  1088. },
  1089. //获取作品信息
  1090. async getIdData(){
  1091. let userId = this.userId || '';
  1092. let params = {
  1093. id: this.customizedRecordId,
  1094. brandId: $config.brandId,
  1095. houseId: this.houseId,
  1096. userId,
  1097. type:'QIANCE',
  1098. };
  1099. const res = await requestConfig('getCustomizedRecord', params);
  1100. if (res.success && res.list && res.list[0]) {
  1101. let single = res.list[0];
  1102. this.form = single;
  1103. // this.hardboundEffect = this.form.layoutImgCustomized? [this.form.layoutImgCustomized] : [];//赋值轮播图
  1104. }
  1105. },
  1106. //提交结果数据处理
  1107. async resultDataHandle(){
  1108. let houseId = this.houseId || this.$route.query.houseId || this.$store.state.houseId || curHouseObj.houseId;
  1109. // let firstData = JSON.parse(getStorage('firstData'));
  1110. let secondData = JSON.parse(getStorage('secondData'));
  1111. let thirdData = JSON.parse(getStorage('thirdData'));
  1112. let curHouseObj = JSON.parse(getStorage('curHouseObj'));
  1113. let spaceList = JSON.parse(getStorage('spaceList'));
  1114. let shottingImg = getStorage('shottingImg');
  1115. let expand = [];//扩展数据
  1116. let checkIndexList = [];
  1117. let otherlist = [];
  1118. let userId = this.userId ? this.userId : '';
  1119. let houseData = {
  1120. "layoutId": curHouseObj.id,
  1121. "layoutName": curHouseObj.name,
  1122. "layoutArea": curHouseObj.houseArea,
  1123. "floor": 1,
  1124. "layoutImgCustomized": shottingImg,
  1125. "style": "",
  1126. "houseJson": []
  1127. }
  1128. // firstData.forEach(it=>{
  1129. // let _dt = {
  1130. // name:it.name,
  1131. // value:it.selectOptionImageUrl,
  1132. // }
  1133. // expand.push(_dt);
  1134. // })
  1135. secondData.forEach(it=>{
  1136. let _dt = {
  1137. name:it.name,
  1138. value:it.selectOptionName,
  1139. }
  1140. expand.push(_dt);
  1141. })
  1142. thirdData.forEach(it=>{
  1143. let _dt = {
  1144. name:it.spaceName,
  1145. value:it.selectOptionName,
  1146. }
  1147. expand.push(_dt);
  1148. })
  1149. let mainImage = '';
  1150. if(thirdData && thirdData.length>0){
  1151. mainImage = thirdData[1] ? thirdData[1].hardboundEffect[0] : thirdData[0].hardboundEffect[0];
  1152. }
  1153. houseData.houseJson = spaceList.concat(thirdData);
  1154. // houseData.expand = expand;
  1155. let param = {
  1156. "brandId": $config.brandId,
  1157. "houseId": houseId,
  1158. "userId": userId,
  1159. "floot": 1,
  1160. "spaceName": curHouseObj.name,
  1161. "spaceStructure": '',
  1162. "curFloor":1,
  1163. layoutStruct:[houseData],
  1164. type:'QIANCE',
  1165. expand:JSON.stringify(expand),
  1166. mainImage:mainImage,
  1167. }
  1168. if(this.landDataId){
  1169. param.landDataId = this.landDataId;
  1170. }
  1171. if(this.houseName){
  1172. param.houseName = this.houseName;
  1173. }
  1174. console.warn("submitHouse-param: ", param);
  1175. // setStorage('envData',checkIndexList);
  1176. const loading = this.$loading({
  1177. lock: true,
  1178. text: '提交中...',
  1179. spinner: 'el-icon-loading',
  1180. background: 'rgba(0, 0, 0, 0.7)'
  1181. });
  1182. let res = await requestConfig("saveCustomizedRecord", param);
  1183. loading.close();
  1184. if(res && res.success && res.single){//提交成功
  1185. let data = {
  1186. houseId:houseId,
  1187. id:res.single,
  1188. }
  1189. router.push({
  1190. name: "webgl_rxdz_text_customize",
  1191. query:data
  1192. });
  1193. }
  1194. },
  1195. //修改结果数据处理
  1196. async updateHandle(){
  1197. let houseId = this.houseId || this.$route.query.houseId || this.$store.state.houseId || curHouseObj.houseId;
  1198. // let firstData = JSON.parse(getStorage('firstData'));
  1199. // let secondData = JSON.parse(getStorage('secondData'));
  1200. // let thirdData = JSON.parse(getStorage('thirdData'));
  1201. let curHouseObj = JSON.parse(getStorage('curHouseObj'));
  1202. let spaceList = JSON.parse(getStorage('spaceList'));
  1203. let shottingImg = getStorage('shottingImg');
  1204. let expand = [];//扩展数据
  1205. let checkIndexList = [];
  1206. let otherlist = [];
  1207. let userId = this.userId ? this.userId : '';
  1208. let houseData = {
  1209. "layoutId": curHouseObj.id,
  1210. "layoutName": this.form.layoutStruct[0].layoutName || curHouseObj.name,
  1211. "layoutArea": this.form.layoutStruct[0].layoutArea || curHouseObj.houseArea,
  1212. "floor": 1,
  1213. "layoutImgCustomized": shottingImg,
  1214. "style": this.form.layoutStruct[0].style || "",
  1215. "houseJson": []
  1216. }
  1217. // let mainImage = '';
  1218. // if(thirdData && thirdData.length>0){
  1219. // mainImage = thirdData[1] ? thirdData[1].hardboundEffect[0] : thirdData[0].hardboundEffect[0];
  1220. // }
  1221. // houseData.houseJson = spaceList.concat(this.form.layoutStruct[0].houseJson);
  1222. houseData.houseJson = this.form.layoutStruct[0].houseJson.concat(spaceList);
  1223. // houseData.expand = expand;
  1224. let param = {
  1225. id:this.customizedRecordId,
  1226. "brandId": $config.brandId,
  1227. "houseId": houseId,
  1228. "userId": userId,
  1229. "floot": 1,
  1230. // "spaceName": this.form.spaceName || curHouseObj.name,
  1231. "spaceName": curHouseObj.name,
  1232. "spaceStructure": '',
  1233. "curFloor":1,
  1234. layoutStruct:[houseData],
  1235. type:'QIANCE',
  1236. expand:this.form.expand,
  1237. // mainImage:this.form.mainImage,
  1238. }
  1239. if(this.landDataId){
  1240. param.landDataId = this.landDataId;
  1241. }
  1242. if(this.houseName){
  1243. param.houseName = this.houseName;
  1244. }
  1245. console.warn("submitHouse-update-param: ", param);
  1246. // setStorage('envData',checkIndexList);
  1247. const loading = this.$loading({
  1248. lock: true,
  1249. text: '提交中...',
  1250. spinner: 'el-icon-loading',
  1251. background: 'rgba(0, 0, 0, 0.7)'
  1252. });
  1253. let res = await requestConfig("saveCustomizedRecord", param);
  1254. loading.close();
  1255. if(res && res.success && res.single){//提交成功
  1256. let data = {
  1257. houseId:houseId,
  1258. id:res.single,
  1259. }
  1260. wx.miniProgram.redirectTo({url: '/webgl/pages/webgl_rxdz_text_customize/webgl_rxdz_text_customize?id='+data.id+"&houseId="+houseId})
  1261. // router.push({
  1262. // name: "webgl_rxdz_text_customize",
  1263. // query:data
  1264. // });
  1265. }
  1266. },
  1267. showToast(title,time=3000){
  1268. this.myloading = false;
  1269. this.$store.state.loading = true;
  1270. this.$store.state.loadingMsg = title || "";
  1271. setTimeout(()=>{
  1272. this.$store.state.loading = false;
  1273. }, time);
  1274. }
  1275. }
  1276. }
  1277. </script>
  1278. <style lang="scss" scoped>
  1279. @import "./viewMask.scss";
  1280. </style>
  1281. <style lang="css" scoped>
  1282. /* @import "@/common/css/common.css"; */
  1283. </style>