design.vue 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263
  1. <template>
  2. <div class="design-container AI-Design-container">
  3. <div class="header">
  4. <van-nav-bar title="外墙设计" left-arrow @click-left="returnPage" @click-right="toHome">
  5. <template #right>
  6. <van-icon name="wap-home-o" color="#333" size="26" />
  7. </template>
  8. </van-nav-bar>
  9. </div>
  10. <div class="container">
  11. <!-- 历史生图 -->
  12. <div class="history-section padded-lr-20">
  13. <div class="history-header" @click="viewHistory">
  14. <van-icon name="clock-o" color="#EC8868" />
  15. <span>历史生图</span>
  16. <span v-if="!readState" class="badge-dot"></span>
  17. </div>
  18. </div>
  19. <!-- 关联项目 -->
  20. <div class="image-selection padded-lr-20" v-show="projectBoxShow">
  21. <div class="project-placeholder">
  22. <div class="project-add-box">
  23. <span style="font-weight: 700;"><span style="color: red;margin-right: 5px;">*</span>关联项目</span>
  24. <van-popover placement="bottom-end" :offset="[17, 4]" v-model="showProjectPopover" theme="dark"
  25. trigger="click">
  26. <div role="menu" class="van-popover__content">
  27. <div role="menuitem" class="van-popover__action van-popover__action--with-icon" @click="toProjectLink">
  28. <img width="30px" :src="require('@/assets/AIDesign/projectIcon.png')" alt="">
  29. <div class="van-popover__action-text van-hairline--bottom">我要报备</div>
  30. </div>
  31. </div>
  32. <template #reference>
  33. <van-icon name="plus" size="20" />
  34. </template>
  35. </van-popover>
  36. </div>
  37. <div class="list-item-checked" v-if="checkedProject != null">
  38. <div class="title-item" v-show="checkedProject.fulladdress">
  39. <span class="title" style="text-align: left;">{{ checkedProject.fulladdress }}</span>
  40. <span class="status">已报备</span>
  41. </div>
  42. <div class="user-item" v-show="checkedProject.contact">
  43. <van-icon name="user-o" />
  44. <span class="txt">{{ checkedProject.contact }}</span>
  45. </div>
  46. <div class="user-item" v-show="checkedProject.tel">
  47. <van-icon name="phone-o" />
  48. <span class="txt">{{ checkedProject.tel }}</span>
  49. </div>
  50. <!-- <div class="user-item">
  51. <van-icon name="info-o" color="#D43030" />
  52. <span class="txt" style="color: #D43030;">剩余免费生成次数:{{ checkedProject.AvailableQuantity }}</span>
  53. </div> -->
  54. </div>
  55. <div class="placeholder" style="width: 100%">
  56. <p v-if="checkedProject == null" class="placeholder-text">当前暂无已关联的项目,请选择已报备项目</p>
  57. <van-button type="primary" color="#2484F2" block @click="chooseProject" :loading="showChooseProject"
  58. :disabled="showChooseProject" loading-type="spinner" loading-text="选择项目"
  59. style="width: 80%;margin-left: 10%;">选择项目</van-button>
  60. </div>
  61. </div>
  62. </div>
  63. <!-- 图片选择 -->
  64. <div class="image-selection padded-lr-20">
  65. <div class="image-placeholder">
  66. <div v-if="selectedImage" class="selected-image-preview">
  67. <img :src="selectedImage" alt="预览图片" class="preview-image" @click="imgClick(selectedImage)" />
  68. </div>
  69. <div v-else class="placeholder">
  70. <img width="50" :src="require('@/assets/AIDesign/picture.png')" />
  71. <p class="placeholder-text">请上传一张待设计<span class="red-name-title">【外墙】</span>的房屋照片</p>
  72. <p class="placeholder-text-tit">(避免模糊、光线不佳)</p>
  73. </div>
  74. <div class="image-buttons">
  75. <!-- 原生上传按钮 -->
  76. <div class="upload-container">
  77. <input type="file" accept="image/*" class="native-upload-input" @change="handleFileChange">
  78. <button class="image-btn">
  79. <span>选择图片</span>
  80. </button>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. <!-- 服务商不展示 -->
  86. <section v-show="wecomType != 2" class="padded-lr-20">
  87. <van-tabs v-model="activeName" @change="tabsChange" title-active-color="#383838" color="#383838"
  88. title-inactive-color="#b3b3b3" line-width="78" line-height="4">
  89. <van-tab title="外墙质感" name="外墙质感"></van-tab>
  90. <van-tab title="外墙平涂" name="外墙平涂"></van-tab>
  91. </van-tabs>
  92. </section>
  93. <!-- 外墙质感选项 -->
  94. <section v-show="activeName === '外墙质感'" class="padded-lr-20">
  95. <!-- 设计风格 -->
  96. <div class="design-option">
  97. <div class="option-title option-title-tit">
  98. <div>设计风格</div>
  99. <van-popover v-model="showPopover" trigger="click" :actions="popover_actions" placement="right"
  100. custom-class="my-custom-popup">
  101. <template #reference>
  102. <van-icon name="info-o" color="#2484F2" size="16" />
  103. </template>
  104. </van-popover>
  105. </div>
  106. <div class="option-grid stone-colors-grid" ref="designsRef">
  107. <div v-for="(style, index) in designStyles" :key="index" class="option-item"
  108. :class="{ active: DesignStyle === style.value }" @click="selectStyle(style.value, 'designsRef', index)">
  109. <img :src="imgBaseUrl + style.imgPath" alt="" class="style-image" />
  110. <div class="style-name">{{ style.text }}</div>
  111. </div>
  112. <div class="rightArrows">
  113. <img width="12" :src="require('@/assets/AIDesign/rightjt.png')" />
  114. </div>
  115. </div>
  116. </div>
  117. <!-- 仿石漆电子色卡 -->
  118. <div class="design-option">
  119. <div class="option-title">仿石漆电子色卡</div>
  120. <div class="option-grid stone-colors-grid" ref="stoneColorsRef" @mousedown="handleMouseDown"
  121. @mousemove="handleMouseMove" @mouseup="handleMouseUp" @mouseleave="handleMouseUp">
  122. <div v-for="(color, index) in stoneColors" :key="index" class="option-item"
  123. :class="{ active: ColorCard === color.value }" @click="selectColor(color.value, 'stoneColorsRef', index)">
  124. <div class="split-icon" :style="{ backgroundImage: `url(${imgBaseUrl}${color.imgPath})` }"></div>
  125. <div class="split-name">{{ color.text }}</div>
  126. </div>
  127. </div>
  128. <div class="rightArrows">
  129. <img width="12" :src="require('@/assets/AIDesign/rightjt.png')" />
  130. </div>
  131. </div>
  132. <!-- 墙面工艺 -->
  133. <div class="design-option">
  134. <div class="option-title">墙面工艺</div>
  135. <div class="option-grid stone-colors-grid" ref="processesRef" @mousedown="handleMouseDown"
  136. @mousemove="handleMouseMove" @mouseup="handleMouseUp" @mouseleave="handleMouseUp">
  137. <div v-for="(process, index) in deepSlotProcesses" :key="index" class="option-item"
  138. :class="{ active: selectedProcess === process.value }"
  139. @click="selectProcess(process.value, 'processesRef', index)">
  140. <div v-if="process.value" class="split-icon"
  141. :style="{ backgroundImage: `url(${imgBaseUrl}${process.imgPath})` }"></div>
  142. <div v-else class="split-icon">
  143. <img width="50" :src="require('@/assets/AIDesign/nothing1.png')" />
  144. </div>
  145. <div class="split-name">{{ process.text }}</div>
  146. </div>
  147. </div>
  148. </div>
  149. <!-- 墙面分割线 -->
  150. <div class="design-option" v-show="selectedProcess != '无' && selectedProcess != '平涂'">
  151. <div class="option-title">墙面分割线</div>
  152. <div class="option-grid stone-colors-grid" ref="splitsRef" @mousedown="handleMouseDown"
  153. @mousemove="handleMouseMove" @mouseup="handleMouseUp" @mouseleave="handleMouseUp">
  154. <div v-for="(split, index) in splitWays" :key="index" class="option-item"
  155. :class="{ active: selectedSplit === split.value }" @click="selectSplit(split.value, 'splitsRef', index)">
  156. <div class="split-icon" :style="{ backgroundImage: `url(${imgBaseUrl}${split.imgPath})` }"></div>
  157. <div class="split-name">{{ split.text }}</div>
  158. </div>
  159. </div>
  160. </div>
  161. <!-- 罗马柱样式 -->
  162. <div class="design-option" v-if="ColumnTypes.length > 0">
  163. <div class="option-title">罗马柱</div>
  164. <div class="option-grid stone-colors-grid" ref="ColumnTypeRef" @mousedown="handleMouseDown"
  165. @mousemove="handleMouseMove" @mouseup="handleMouseUp" @mouseleave="handleMouseUp">
  166. <div v-for="(Column, index) in ColumnTypes" :key="index" class="option-item"
  167. :class="{ active: selectedColumnType === Column.value }"
  168. @click="selectColumnType(Column.value, 'ColumnTypeRef', index)">
  169. <div class="railing-icon" :style="{ backgroundImage: `url(${imgBaseUrl}${Column.imgPath})` }"></div>
  170. <div class="railing-name">{{ Column.text }}</div>
  171. <div v-show="Column.value != '无' && Column.value != 'CUSTOM'" class="magnifyingGlassBox"
  172. @click.stop="openComponentPreview(index - 1, ColumnTypes)">
  173. <img :src="require('@/assets/AIDesign/magnifyingGlassIcon.png')" />
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. <!-- 罗马柱图片预览 -->
  179. <van-image-preview v-model="showPreviewList" :images="imgValuesArray" @change="onChangePreviewList" :loop="true"
  180. :start-position="startIndex">
  181. <template v-slot:index>
  182. {{ currentTitle }} ({{ currentIndex + 1 }}/{{ imgValuesArray.length }})
  183. </template>
  184. </van-image-preview>
  185. <!-- 浇筑栏杆 -->
  186. <div class="design-option">
  187. <div class="option-title">栏杆</div>
  188. <div class="option-grid stone-colors-grid" ref="railingsRef" @mousedown="handleMouseDown"
  189. @mousemove="handleMouseMove" @mouseup="handleMouseUp" @mouseleave="handleMouseUp">
  190. <div v-for="(railing, index) in railings" :key="index" class="option-item"
  191. :class="{ active: selectedRailing === railing.value }"
  192. @click="selectRailing(railing.value, 'railingsRef', index)">
  193. <div class="railing-icon" :style="{ backgroundImage: `url(${imgBaseUrl}${railing.imgPath})` }"></div>
  194. <div class="railing-name">{{ railing.text }}</div>
  195. </div>
  196. </div>
  197. </div>
  198. <!-- 窗套样式 -->
  199. <div class="design-option">
  200. <div class="option-title">窗套样式</div>
  201. <div class="option-grid stone-colors-grid" ref="WindowStyleRef" @mousedown="handleMouseDown"
  202. @mousemove="handleMouseMove" @mouseup="handleMouseUp" @mouseleave="handleMouseUp">
  203. <div v-for="(WindowStyleItem, index) in WindowStyle" :key="index" class="option-item"
  204. :class="{ active: selectedWindowStyle === WindowStyleItem.value }"
  205. @click="selectWindowStyle(WindowStyleItem.value, 'WindowStyleRef', index)">
  206. <div v-if="WindowStyleItem.value" class="split-icon"
  207. :style="{ backgroundImage: `url(${imgBaseUrl}${WindowStyleItem.imgPath})` }">
  208. </div>
  209. <div v-else class="split-icon">
  210. <img width="50" :src="require('@/assets/AIDesign/nothing1.png')" />
  211. </div>
  212. <div class="split-name">{{ WindowStyleItem.text }}</div>
  213. <div v-show="WindowStyleItem.value != '无' && WindowStyleItem.value != 'CUSTOM'" class="magnifyingGlassBox"
  214. @click.stop="openComponentPreview(index - 1, WindowStyle)">
  215. <img :src="require('@/assets/AIDesign/magnifyingGlassIcon.png')" />
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. <!-- 窗套颜色 -->
  221. <div class="design-option" v-show="selectedWindowStyle != '无'">
  222. <div class="option-title">窗套颜色</div>
  223. <div class="option-grid stone-colors-grid" ref="windowsRef" @mousedown="handleMouseDown"
  224. @mousemove="handleMouseMove" @mouseup="handleMouseUp" @mouseleave="handleMouseUp">
  225. <div v-for="(windowFrame, index) in windowFrames" :key="index" class="option-item"
  226. :class="{ active: selectedWindowFrame === windowFrame.value }"
  227. @click="selectWindowFrame(windowFrame.value, 'windowsRef', index)">
  228. <div v-if="windowFrame.value" class="split-icon"
  229. :style="{ backgroundImage: `url(${imgBaseUrl}${windowFrame.imgPath})` }">
  230. </div>
  231. <div v-else class="split-icon">
  232. <img width="50" :src="require('@/assets/AIDesign/nothing1.png')" />
  233. </div>
  234. <div class="split-name">{{ windowFrame.text }}</div>
  235. </div>
  236. </div>
  237. <div class="rightArrows">
  238. <img width="12" :src="require('@/assets/AIDesign/rightjt.png')" />
  239. </div>
  240. </div>
  241. <!-- 墙裙 -->
  242. <div class="design-option">
  243. <div class="option-title">墙裙</div>
  244. <div class="option-grid stone-colors-grid" ref="skirtTypesRef" @mousedown="handleMouseDown"
  245. @mousemove="handleMouseMove" @mouseup="handleMouseUp" @mouseleave="handleMouseUp">
  246. <div v-for="(skirt, index) in skirtTypes" :key="index" class="option-item"
  247. :class="{ active: selectedSkirtType === skirt.value }"
  248. @click="selectSkirtType(skirt.value, 'skirtTypesRef', index)">
  249. <div class="tile-icon" :style="{ backgroundImage: `url(${imgBaseUrl}${skirt.imgPath})` }"></div>
  250. <div class="tile-name">{{ skirt.text }}</div>
  251. </div>
  252. </div>
  253. <div class="rightArrows">
  254. <img width="12" :src="require('@/assets/AIDesign/rightjt.png')" />
  255. </div>
  256. </div>
  257. <!-- 琉璃瓦 -->
  258. <div class="design-option">
  259. <div class="option-title">琉璃瓦</div>
  260. <div class="option-grid stone-colors-grid" ref="tilesRef" @mousedown="handleMouseDown"
  261. @mousemove="handleMouseMove" @mouseup="handleMouseUp" @mouseleave="handleMouseUp">
  262. <div v-for="(tile, index) in tiles" :key="index" class="option-item"
  263. :class="{ active: selectedTile === tile.value }" @click="selectTile(tile.value, 'tilesRef', index)">
  264. <div class="tile-icon" :style="{ backgroundImage: `url(${imgBaseUrl}${tile.imgPath})` }"></div>
  265. <div class="tile-name">{{ tile.text }}</div>
  266. </div>
  267. </div>
  268. <div class="rightArrows">
  269. <img width="12" :src="require('@/assets/AIDesign/rightjt.png')" />
  270. </div>
  271. </div>
  272. <!-- 浮雕 -->
  273. <div class="design-option">
  274. <div class="option-title">浮雕</div>
  275. <div class="option-grid stone-colors-grid" ref="outsideReliefRef" @mousedown="handleMouseDown"
  276. @mousemove="handleMouseMove" @mouseup="handleMouseUp" @mouseleave="handleMouseUp">
  277. <div v-for="(Relief, index) in outsideRelief" :key="index" class="option-item"
  278. :class="{ active: selectedReliefType === Relief.value }"
  279. @click="selectReliefType(Relief.value, 'outsideReliefRef', index)">
  280. <div class="railing-icon" :style="{ backgroundImage: `url(${imgBaseUrl}${Relief.imgPath})` }"></div>
  281. <div class="railing-name">{{ Relief.text }}</div>
  282. <div v-show="Relief.value != '无' && Relief.value != 'CUSTOM'" class="magnifyingGlassBox"
  283. @click.stop="openComponentPreview(index - 1, outsideRelief)">
  284. <img :src="require('@/assets/AIDesign/magnifyingGlassIcon.png')" />
  285. </div>
  286. </div>
  287. </div>
  288. </div>
  289. </section>
  290. <!-- 外墙平涂选项 -->
  291. <section v-show="activeName === '外墙平涂'" class="radio-group-container1">
  292. <!--外墙平涂-放大版 -->
  293. <div class="color-plus" v-if="color_selItem">
  294. <div class="cardImg" :style="{ backgroundColor: color_selItem.value.slice(0, 7) }"></div>
  295. <div class="color-plus-info">
  296. <div class="color-plus-tit">{{ color_selItem.text }}</div>
  297. <p>{{ color_selItem.ext1 }}</p>
  298. </div>
  299. </div>
  300. <van-radio-group v-model="color_selValue" class="custom-radio-group4 padded-lr-20" @change="handleColorChange">
  301. <van-radio v-for="(item, index) in color_options" :key="index" :name="item.value"
  302. class="custom-radio custom-radio4">
  303. <div class="radio-content radio-content-color">
  304. <div class="cardImg" :style="{ backgroundColor: item.value.slice(0, 7) }"></div>
  305. <div v-if="color_selValue === item.value" class="check-indicator">
  306. <van-icon name="success" color="#fff" size="10" />
  307. </div>
  308. <div class="custom-radio-text">{{ item.text }}</div>
  309. </div>
  310. </van-radio>
  311. </van-radio-group>
  312. </section>
  313. <!-- AI生成按钮 -->
  314. <div class="generate-section padded-lr-20">
  315. <van-button v-show="AIBtnDisabled" type="primary" block color="#E87838" disabled loading loading-type="spinner"
  316. loading-text="AI生成"></van-button>
  317. <van-button v-show="!AIBtnDisabled" type="primary" block @click="generateDesign"
  318. color="#E87838">AI生成</van-button>
  319. <div class="btn-note">*效果图仅供参考, 不作为交付标准</div>
  320. </div>
  321. </div>
  322. <van-action-sheet v-model="projectActionShow">
  323. <div class="project-action-box">
  324. <img src="../../assets/AIDesign/project_action_null.png">
  325. <div class="tip">您还没有已报备的项目</div>
  326. <div class="tip-content">创建一个报备项目后,就能进行AI生图!<br />快去试试吧~</div>
  327. <div class="btn" @click="toProjectLink">我要报备</div>
  328. <div class="btn2" @click="projectActionShow = false">稍后再说</div>
  329. </div>
  330. </van-action-sheet>
  331. <van-action-sheet v-model="projectActionNumShow">
  332. <div class="project-action-box">
  333. <img src="../../assets/AIDesign/project_action_num_0.png">
  334. <div class="tip" style="margin-top: 20px;">该项目的免费生成次数已用完</div>
  335. <div class="tip-content">希望这3张AI效果图能满足您的设计需求,<br />如需进一步沟通,可点击<span
  336. style="color: #2484F2;text-decoration: underline;" @click="toXiaoCX">转人工设计</span></div>
  337. <div class="btn" @click="projectActionNumShow = false">我知道了</div>
  338. </div>
  339. </van-action-sheet>
  340. <van-action-sheet v-model="projectActionLoadingShow">
  341. <div class="project-action-box">
  342. <img src="../../assets/AIDesign/project_action_loading.png">
  343. <div class="tip" style="margin-top: 20px;">正在为您飞速上传...</div>
  344. <div class="tip-content">为了给您更好的生图效果,请避免上传模糊、光线不佳、非外墙的图片。<br />立邦AI效果图仅为意向图,不作为施工交付标准。</div>
  345. <div class="btn" @click="projectActionLoadingShow = false">我知道了</div>
  346. </div>
  347. </van-action-sheet>
  348. <van-action-sheet v-model="projectActionListShow">
  349. <div class="project-action-list-box">
  350. <div class="search-box-bg">
  351. <div class="search-box">
  352. <van-search v-model="projectSearchValue" style="flex-grow: 1" shape="round" placeholder="项目地址/业主姓名/业主电话" />
  353. <van-button type="primary" size="mini" color="#2484F2" class="btn" @click="onSearch">搜索</van-button>
  354. </div>
  355. </div>
  356. <div style="width: 90%;height: 50px;"></div>
  357. <div class="list-item" :style="checkedProjectId == index ? 'border: 1px solid #2484F2;' : ''"
  358. v-for="(item, index) in projectList" :key="index" @click="checkedProjectId = index">
  359. <div class="title-item">
  360. <span class="title">{{ item.fulladdress }}</span>
  361. <span class="status">已报备</span>
  362. </div>
  363. <div class="user-item">
  364. <van-icon name="user-o" />
  365. <span class="txt">{{ item.contact }}</span>
  366. </div>
  367. <div class="user-item">
  368. <van-icon name="phone-o" />
  369. <span class="txt">{{ item.tel }}</span>
  370. </div>
  371. <!-- <div class="user-item">
  372. <van-icon name="info-o" color="#D43030" />
  373. <span class="txt" style="color: #D43030;">剩余免费生成次数:{{ item.AvailableQuantity }}</span>
  374. </div> -->
  375. <div class="img-item" v-show="checkedProjectId == index">
  376. <img src="../../assets/AIDesign/project_checked.png" class="img-checked">
  377. </div>
  378. </div>
  379. <div style="width: 90%;height: 80px;"></div>
  380. <div class="btn-box">
  381. <div class="btn-item">
  382. <img src="../../assets/AIDesign/project_btn_left_icon.png" class="img-left-icon">
  383. <div class="btn" @click="chooseSure">确认选择</div>
  384. </div>
  385. </div>
  386. </div>
  387. </van-action-sheet>
  388. <van-dialog v-model="dialogShow" :show-confirm-button="false">
  389. <div class="dialog-box">
  390. <div class="dialog-content">{{ dialogContent }}</div>
  391. <!-- <div class="dialog-btn" @click="dialogShow = false">知道了({{countdownValue}})</div> -->
  392. <div class="dialog-btn" @click="dialogShow = false">知道了</div>
  393. </div>
  394. </van-dialog>
  395. </div>
  396. </template>
  397. <script lang="ts">
  398. import { Component, Vue } from "vue-property-decorator";
  399. import { CreateDesign, GetEntity, GetReadState, UpdateReadState, GetProjectlist, GetDictList } from "@/api/indexAI";
  400. import { ImagePreview, Popover } from 'vant';
  401. import { Dialog } from 'vant';
  402. import { getWecomType, toLBHome, toXiaoChengxu } from '@/utils/index';
  403. declare let wx: any;
  404. import axios from "axios";
  405. @Component({
  406. components: {
  407. VanPopover: Popover,
  408. VanImagePreview: ImagePreview.Component
  409. },
  410. })
  411. export default class extends Vue {
  412. // 添加鼠标拖拽相关引用
  413. $refs!: {
  414. stoneColorsRef: HTMLDivElement;
  415. processesRef: HTMLDivElement;
  416. splitsRef: HTMLDivElement;
  417. windowsRef: HTMLDivElement;
  418. railingsRef: HTMLDivElement;
  419. tilesRef: HTMLDivElement;
  420. skirtTypesRef: HTMLDivElement;
  421. outsideReliefRef: HTMLDivElement;
  422. WindowStyleRef: HTMLDivElement;
  423. };
  424. private readState = true;
  425. private projectActionShow = false;
  426. private projectActionNumShow = false;
  427. private projectActionListShow = false;
  428. private projectActionLoadingShow = false;
  429. // 添加鼠标拖拽相关数据
  430. private isMouseDown = false;
  431. private startX = 0;
  432. private scrollLeft = 0;
  433. private currentScrollElement: HTMLElement | null = null;
  434. private addProjectLink = '';
  435. private serviceCodeArray = [];
  436. private countdownValue = 3;
  437. private countdownInterval;
  438. private isRunning = false;
  439. private dialogShow = false;
  440. private dialogContent = '';
  441. private AIBtnDisabled = false;
  442. private projectBoxShow = false;
  443. private save_projectBoxShow_org = false;
  444. private projectSearchValue = '';
  445. private checkedProjectId = null;
  446. private checkedProject = null
  447. private projectList = [];
  448. private wecomType = null;
  449. private selectedImage: string | null = null; // 存储选择的图片
  450. // 当前选中的选项
  451. private oldf_id = null;
  452. private Userfile1 = null;
  453. private designStyles = []; // 设计风格选项
  454. private stoneColors = [];// 仿石漆电子色卡选项
  455. private deepSlotProcesses = []; // 墙面工艺选项
  456. private splitWays = [];// 墙面分割线选项
  457. private windowFrames = [];// 窗套样式选项
  458. private railings = []; // 浇筑栏杆选项
  459. private tiles = []; // 琉璃瓦选项
  460. private ColumnTypes = [];// 罗马柱选项
  461. private skirtTypes = [];// 墙裙
  462. private outsideRelief = [];//浮雕
  463. private WindowStyle = [];//窗套样式
  464. // 外墙质感
  465. private DesignStyle = null;//设计风格
  466. private ColorCard = null;//电子色卡
  467. private selectedProcess = null;//墙面工艺
  468. private selectedSplit = null;//墙面分割线
  469. private selectedColumnType = null;//罗马柱
  470. private selectedRailing = null;//栏杆
  471. private selectedWindowFrame = null;//窗套样式
  472. private selectedTile = null;//琉璃瓦
  473. private selectedSkirtType = null;//墙裙
  474. private selectedReliefType = null;//浮雕
  475. private selectedWindowStyle = null;//窗套样式
  476. private color_options = [];//外墙平涂列表
  477. private color_selItem = null;//选中的外墙平涂
  478. private color_selValue = '';// 外墙平涂选中的值
  479. private activeName = "外墙质感";// tab选中的项
  480. private imgBaseUrl = '';//图片头
  481. private isNeedProject = null;//是否展示项目
  482. private showPreviewList = false;//罗马柱图片预览
  483. private imgValuesArray = [];//罗马柱图片列表
  484. private titlesArray = [];//罗马柱名称列表
  485. private startIndex = 0;//罗马柱预览开始索引
  486. private currentIndex = 0;//罗马柱预览索引
  487. private currentTitle = null;//罗马柱预览名称
  488. private showPopover = false;//设计风格提示
  489. private popover_actions = [{ text: "风格主要对应罗马柱类型,请按需选择", className: "actionsTit" }];
  490. private showChooseProject = false;
  491. private showProjectPopover = false;
  492. created() {
  493. // 图片头
  494. if (window.location.href.indexOf('aidesign.') > -1) {
  495. this.imgBaseUrl = 'https://aidesign.nipponpaint.com.cn'
  496. } else {
  497. this.imgBaseUrl = 'https://aidesigntest.nipponpaint.com.cn'
  498. }
  499. if (window.localStorage.getItem('agentFromAI') === 'stoneLikePaint') {
  500. this.getServiceCode();
  501. }
  502. }
  503. activated() {
  504. // 初始化数据
  505. this.initialize();
  506. this.getPicList();//获取完选项各列表之后再去判断F_id并取值
  507. this.GetReadStateFn();
  508. }
  509. private initialize() {
  510. // 企微类型
  511. const agentFrom = window.localStorage.getItem('agentFromAI');
  512. this.wecomType = getWecomType(agentFrom);
  513. this.selectedImage = '';
  514. this.projectActionLoadingShow = false;
  515. this.AIBtnDisabled = false;
  516. this.checkedProjectId = null;
  517. this.checkedProject = null;
  518. this.oldf_id = null;
  519. this.Userfile1 = null;
  520. this.DesignStyle = null;
  521. this.ColorCard = null;
  522. this.selectedProcess = null;
  523. this.selectedSplit = null;
  524. this.selectedWindowFrame = null;
  525. this.selectedRailing = null;
  526. this.selectedColumnType = null;//罗马柱
  527. this.selectedTile = null;
  528. this.selectedSkirtType = null;
  529. this.showChooseProject = false;
  530. this.isNeedProject = null;
  531. this.showPreviewList = false;
  532. this.imgValuesArray = [];
  533. this.titlesArray = [];
  534. this.startIndex = 0;
  535. this.currentIndex = 0;
  536. this.currentTitle = null;
  537. this.activeName = "外墙质感";// tab选中的项
  538. this.color_selItem = null;//选中的外墙平涂
  539. this.color_options = [];//外墙平涂列表
  540. this.color_selValue = '';// 外墙平涂选中的值
  541. }
  542. tabsChange(value: string) {
  543. if (value === '外墙平涂') {
  544. // 色卡默认第一个
  545. this.color_selItem = this.color_options[0];
  546. this.color_selValue = this.color_options[0].value;
  547. this.projectBoxShow = false;
  548. } else {
  549. this.projectBoxShow = this.save_projectBoxShow_org;
  550. }
  551. }
  552. // 选择外墙平涂
  553. handleColorChange(value: string | number) {
  554. const selectedItem = this.color_options.find(
  555. item => item.value === value
  556. );
  557. this.color_selItem = selectedItem || null;
  558. }
  559. private getServiceCode() {
  560. let that = this;
  561. const userInfo: any = JSON.parse(window.localStorage.getItem("userInfoV1")!);
  562. let serviceCodeArray = [];
  563. // if (userInfo && userInfo.loginTypeList && userInfo.loginTypeList.length > 0) {
  564. // userInfo.loginTypeList.forEach(item => {
  565. // if (item.shopType == 'stoneLikePaint') {
  566. // item.shopList.forEach(childItem => {
  567. // serviceCodeArray.push(childItem.shop_code);
  568. // })
  569. // }
  570. // })
  571. // }
  572. if (userInfo && userInfo.ServiceCode) {
  573. serviceCodeArray = userInfo.ServiceCode.split(',').map(item => item.trim()).filter(item => item !== '');
  574. }
  575. that.serviceCodeArray = serviceCodeArray;
  576. }
  577. // 处理文件选择(对应 beforeRead + afterRead)
  578. handleFileChange(e) {
  579. const file = e.target.files[0]; // 获取选中的文件
  580. if (!file) return; // 未选择文件直接返回
  581. // 1. 校验文件类型(对应 beforeRead 的类型检查)
  582. if (!file.type.match('image.*')) {
  583. this.$toast('请选择图片文件');
  584. this.clearInput(e.target); // 清除选择,避免重复触发同一文件
  585. return;
  586. }
  587. let FileSize = (file.size / 1024 / 1024).toFixed(2);
  588. // console.log("用户选择的图片大小=", file.size + 'KB', ' =', FileSize + 'M')
  589. // 2. 校验文件大小(对应 beforeRead 的大小检查)
  590. const maxSize = 20 * 1024 * 1024; // 10MB
  591. if (file.size > maxSize) {
  592. this.$toast('图片大小不能超过10MB');
  593. this.clearInput(e.target);
  594. return;
  595. }
  596. // 3. 处理选中的文件(对应 afterRead)
  597. this.handleAfterRead(file);
  598. // 清除 input 值,确保同一文件能被再次选择
  599. this.clearInput(e.target);
  600. }
  601. // 处理校验通过后的文件(对应 afterRead)
  602. handleAfterRead(file) {
  603. console.log("选中的图片信息:", file);
  604. // 生成图片预览(如果需要,和 van-uploader 的 content 类似)
  605. const reader = new FileReader();
  606. reader.onload = (event) => {
  607. this.selectedImage = event.target.result; // 预览图的 base64
  608. };
  609. reader.readAsDataURL(file); // 转换为 base64
  610. this.Userfile1 = file; // 保存原始文件对象(用于后续上传)
  611. }
  612. // 清除 input 值(解决同一文件无法重复选择的问题)
  613. clearInput(input) {
  614. input.value = '';
  615. }
  616. beforeRead(file) {
  617. // 检查文件类型
  618. if (!file.type.match('image.*')) {
  619. this.$toast('请选择图片文件');
  620. return false;
  621. }
  622. // 检查文件大小(例如限制为10MB)
  623. const maxSize = 10 * 1024 * 1024;
  624. if (file.size > maxSize) {
  625. this.$toast('图片大小不能超过10MB');
  626. return false;
  627. }
  628. return true;
  629. }
  630. afterRead(file) {
  631. // console.log(file.file);
  632. this.selectedImage = file.content;
  633. this.Userfile1 = file.file;
  634. }
  635. returnPage() {
  636. this.$router.push({ path: "/AIDesign" });
  637. }
  638. toHome() {
  639. toLBHome()
  640. }
  641. imgClick(url) {
  642. ImagePreview([url]);
  643. }
  644. // 处理罗马柱
  645. openComponentPreview(initIndex: number, list) {
  646. if (list.length > 0) {
  647. const imgArray = list
  648. .filter(item => item.value != '无' && item.imgPath);
  649. this.imgValuesArray = imgArray.map(item => this.imgBaseUrl + item.imgPath);
  650. this.titlesArray = imgArray.map(item => item.text);
  651. this.startIndex = Math.max(0, Math.min(initIndex, this.imgValuesArray.length - 1));
  652. this.currentIndex = this.startIndex;
  653. this.currentTitle = this.titlesArray[initIndex] || "无标题";
  654. this.showPreviewList = true;
  655. } else {
  656. this.$toast('暂无图片');
  657. }
  658. }
  659. onChangePreviewList(index) {
  660. this.currentTitle = this.titlesArray[index] || "无标题";
  661. this.currentIndex = index;
  662. }
  663. GetReadStateFn() {
  664. const formData = new FormData();
  665. const userInfo: any = JSON.parse(window.localStorage.getItem("userInfoV1")!);
  666. // formData.append('WXuserid', userInfo.loginName);
  667. const outsideType_val = this.activeName === '外墙质感' ? 0 : 1;
  668. formData.append('outsideType', outsideType_val);
  669. GetReadState(formData).then(response => {
  670. if (response.StatusCode == 200) {
  671. this.readState = response.Data.readState;
  672. }
  673. });
  674. }
  675. UpdateReadStateFn() {
  676. const formData = new FormData();
  677. // const userInfo: any = JSON.parse(window.localStorage.getItem("userInfoV1")!);
  678. // formData.append('WXuserid', userInfo.loginName);
  679. const outsideType_val = this.activeName === '外墙质感' ? 0 : 1;
  680. formData.append('outsideType', outsideType_val);
  681. UpdateReadState(formData).then(response => { });
  682. }
  683. GetEntityData(F_id) {
  684. let that = this;
  685. const formData = new FormData();
  686. formData.append('F_id', F_id);
  687. const outsideType_val = this.activeName === '外墙质感' ? 0 : 1;
  688. formData.append('outsideType', outsideType_val);
  689. GetEntity(formData).then(response => {
  690. // console.log(response);
  691. if (response.StatusCode == 200) {
  692. if (response.Data) {
  693. if (response.Data.F_UserFilePath) {
  694. this.selectedImage = response.Data.BaseUrl + response.Data.F_UserFilePath;
  695. }
  696. if (response.Data.F_Color) {
  697. this.DesignStyle = this.designStyles[0].value;
  698. } else {
  699. this.DesignStyle = response.Data.F_DesignStyle || this.designStyles[0].value;
  700. }
  701. this.ColorCard = response.Data.F_ColorCard || this.stoneColors[0].value;
  702. this.selectedProcess = response.Data.F_DeepGrooveTech || this.deepSlotProcesses[0].value;
  703. // 有墙面工艺
  704. if (this.selectedProcess) {
  705. const selectedProcessSelctIndex = this.deepSlotProcesses.findIndex(item => item.value === this.selectedProcess);
  706. // 墙面分割线选项
  707. this.splitWays = this.deepSlotProcesses[selectedProcessSelctIndex].subitems;
  708. }
  709. this.selectedSplit = response.Data.F_DivisionMethod || this.splitWays[0].value;
  710. this.selectedWindowFrame = response.Data.F_WindowsColor || this.windowFrames[0].value;
  711. this.selectedRailing = response.Data.F_CastRailing || this.railings[0].value;
  712. this.selectedTile = response.Data.F_GlazedTile || this.tiles[0].value;//新琉璃瓦
  713. this.selectedSkirtType = response.Data.F_SkirtType || this.skirtTypes[0].value;//墙裙
  714. this.selectedReliefType = response.Data.F_carvingType || this.outsideRelief[0].value;//浮雕
  715. this.selectedWindowStyle = response.Data.F_WindowsStyle || this.WindowStyle[0].value;//窗套样式
  716. this.oldf_id = response.Data.F_ID;
  717. this.color_selValue = response.Data.F_Color || null;// 外墙平涂选中的值
  718. if (this.color_selValue) {
  719. // 找到选中的外墙平涂
  720. const selectedItemColor = this.color_options.find(
  721. item => item.value === this.color_selValue
  722. );
  723. this.color_selItem = selectedItemColor;
  724. }
  725. // 判断如果不是服务商,也不用展示
  726. if (that.serviceCodeArray.length == 0) {
  727. that.projectBoxShow = false;
  728. } else {
  729. that.projectBoxShow = that.isNeedProject;
  730. }
  731. that.save_projectBoxShow_org = that.projectBoxShow;
  732. if (this.color_selValue) {
  733. this.activeName = '外墙平涂';
  734. this.projectBoxShow = false;
  735. } else if (this.ColorCard != '无') {
  736. this.activeName = '外墙质感';
  737. } else {
  738. this.activeName = '';
  739. }
  740. if (response.Data.ProjectID) {
  741. this.checkedProject = {
  742. projectid: response.Data.ProjectID
  743. }
  744. }
  745. let projectId = this.$route.query.projectId || null;
  746. if (projectId) {
  747. this.updateCheckedProjectLastNum(projectId);
  748. }
  749. // 罗马柱选项-重新渲染
  750. let F_ColumnType = response.Data.F_ColumnType || '无';
  751. if (!response.Data.F_ColumnType && response.Data.F_DesignStyle == 'CUSTOM') {
  752. F_ColumnType = '';
  753. this.ColumnTypes = [];
  754. } else {
  755. const DesignStyleSelctIndex = this.designStyles.findIndex(item => item.value === this.DesignStyle);
  756. const designStyles = this.designStyles;
  757. if (designStyles[DesignStyleSelctIndex] && designStyles[DesignStyleSelctIndex].subitems) {
  758. this.ColumnTypes = designStyles[DesignStyleSelctIndex].subitems || [];
  759. } else {
  760. this.ColumnTypes = [];
  761. }
  762. }
  763. this.selectedColumnType = F_ColumnType;//罗马柱
  764. }
  765. }
  766. })
  767. }
  768. // 添加一个新的辅助方法用于将图片URL转换为File对象
  769. private async urlToFile(url: string, filename: string): Promise<File> {
  770. try {
  771. const response = await fetch(url);
  772. const blob = await response.blob();
  773. return new File([blob], filename, { type: blob.type });
  774. } catch (error) {
  775. console.error('图片转换失败:', error);
  776. this.$toast('图片加载失败');
  777. throw error;
  778. }
  779. }
  780. private viewHistory() {
  781. this.UpdateReadStateFn();
  782. // console.log('查看历史生成');
  783. // 实现查看历史生成逻辑
  784. this.$router.push({ path: '/AIDesign/history', query: { wallType: "outside" } });
  785. }
  786. // 方法
  787. private goBack() {
  788. this.$router.back();
  789. }
  790. // private takePhoto() {
  791. // // 实现拍照功能
  792. // console.log('拍摄图片');
  793. // }
  794. private autoScrollToActive(refsName: string, selcIndex: number) {
  795. // console.log("refsName=", refsName)
  796. const container = this.$refs[refsName];
  797. const activeItem = container.children[selcIndex];
  798. const itemWidth = activeItem.offsetWidth * 1.1;
  799. // 判断选中项是否完全在可视范围内
  800. const containerRect = container.getBoundingClientRect(); // 容器可视区域
  801. const itemRect = activeItem.getBoundingClientRect(); // 选中项位置
  802. // 完全可见的条件:左≥容器左,右≤容器右
  803. const isFullyVisibleL = itemRect.left >= containerRect.left;
  804. const isFullyVisibleR = itemRect.right <= containerRect.right;
  805. if (!isFullyVisibleL) {
  806. container.scrollBy({
  807. left: -itemWidth, // 右边滑一格多的距离
  808. behavior: 'smooth' // 平滑滚动
  809. });
  810. } else if (!isFullyVisibleR) {
  811. container.scrollBy({
  812. left: itemWidth, // 左滑一格多的距离
  813. behavior: 'smooth' // 平滑滚动
  814. });
  815. }
  816. }
  817. private selectStyle(value: string, refsName: string, selcIndex: number) {
  818. this.DesignStyle = value;
  819. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  820. // 罗马柱
  821. const designStyles = this.designStyles;
  822. this.ColumnTypes = designStyles[selcIndex].subitems || [];
  823. if (designStyles[selcIndex] && designStyles[selcIndex].subitems && designStyles[selcIndex].subitems[0]) {
  824. this.selectedColumnType = designStyles[selcIndex].subitems[0].value;
  825. } else {
  826. this.selectedColumnType = '无';
  827. }
  828. }
  829. private selectColor(code: string, refsName: string, selcIndex: number) {
  830. this.ColorCard = code;
  831. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  832. }
  833. private selectProcess(value: string, refsName: string, selcIndex: number) {
  834. this.selectedProcess = value;
  835. if (value != '无' && value != '平涂'){
  836. this.splitWays = this.deepSlotProcesses[selcIndex].subitems;
  837. this.selectedSplit = this.splitWays[0].value;
  838. }
  839. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  840. }
  841. private selectSplit(value: string, refsName: string, selcIndex: number) {
  842. this.selectedSplit = value;
  843. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  844. }
  845. private selectWindowStyle(value: string, refsName: string, selcIndex: number) {
  846. this.selectedWindowStyle = value;
  847. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  848. }
  849. private selectWindowFrame(value: string, refsName: string, selcIndex: number) {
  850. this.selectedWindowFrame = value;
  851. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  852. }
  853. private selectRailing(value: string, refsName: string, selcIndex: number) {
  854. this.selectedRailing = value;
  855. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  856. }
  857. private selectTile(value: string, refsName: string, selcIndex: number) {
  858. this.selectedTile = value;
  859. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  860. }
  861. private selectSkirtType(value: string, refsName: string, selcIndex: number) {
  862. this.selectedSkirtType = value;
  863. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  864. }
  865. private selectColumnType(value: string, refsName: string, selcIndex: number) {
  866. this.selectedColumnType = value;
  867. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  868. }
  869. private selectReliefType(value: string, refsName: string, selcIndex: number) {
  870. this.selectedReliefType = value;
  871. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  872. }
  873. // 添加鼠标滚轮事件处理
  874. private handleWheel(e: WheelEvent) {
  875. const container = e.currentTarget as HTMLElement;
  876. if (container) {
  877. container.scrollLeft += e.deltaY;
  878. }
  879. }
  880. // 添加鼠标按下事件处理
  881. private handleMouseDown(e: MouseEvent) {
  882. this.isMouseDown = true;
  883. this.currentScrollElement = e.currentTarget as HTMLElement;
  884. if (this.currentScrollElement) {
  885. this.currentScrollElement.style.cursor = 'grabbing';
  886. this.startX = e.pageX - this.currentScrollElement.offsetLeft;
  887. this.scrollLeft = this.currentScrollElement.scrollLeft;
  888. }
  889. }
  890. // 添加鼠标移动事件处理
  891. private handleMouseMove(e: MouseEvent) {
  892. if (!this.isMouseDown) return;
  893. e.preventDefault();
  894. if (this.currentScrollElement) {
  895. const x = e.pageX - this.currentScrollElement.offsetLeft;
  896. const walk = (x - this.startX) * 2;
  897. this.currentScrollElement.scrollLeft = this.scrollLeft - walk;
  898. }
  899. }
  900. // 添加鼠标释放事件处理
  901. private handleMouseUp() {
  902. this.isMouseDown = false;
  903. if (this.currentScrollElement) {
  904. this.currentScrollElement.style.cursor = 'grab';
  905. }
  906. this.currentScrollElement = null;
  907. }
  908. private generateDesign() {
  909. let that = this;
  910. // console.log(this.Userfile1);
  911. // 实现AI生成功能
  912. if (that.projectBoxShow == true && this.activeName === '外墙质感') {
  913. if (that.checkedProject == null) {
  914. that.$toast.fail('请选择关联项目');
  915. return;
  916. }
  917. // if (that.checkedProject.AvailableQuantity == 0) {
  918. // this.projectActionNumShow = true;
  919. // return;
  920. // }
  921. }
  922. if (!this.Userfile1 && !this.oldf_id) {
  923. this.$toast.fail('请选择图片');
  924. return;
  925. }
  926. // const userInfo: any = JSON.parse(window.localStorage.getItem("userInfoV1")!);
  927. const formData = new FormData();
  928. if (this.activeName === '外墙质感') {
  929. // 如果字典渲染有误,不让提交;墙面工艺、电子色卡都为必填项且没有不需要;
  930. if (!this.selectedProcess || !this.ColorCard) {
  931. this.$toast.fail('数据有误,请重试');
  932. return;
  933. }
  934. // 用户选择的选项
  935. const uDesignStyle = this.DesignStyle === '无' ? '' : this.DesignStyle;
  936. const uColorCard = this.ColorCard === '无' ? '' : this.ColorCard;
  937. const uSelectedProcess = this.selectedProcess === '无' ? '' : this.selectedProcess;
  938. let uSelectedSplit = this.selectedSplit === '无' ? '' : this.selectedSplit;
  939. const uWindowsColor = (this.selectedWindowFrame === '无' || this.selectedWindowStyle === '无') ? '' : this.selectedWindowFrame;//窗套样式为空也传空
  940. const uCastRailing = this.selectedRailing === '无' ? '' : this.selectedRailing;
  941. const uColumnType = this.selectedColumnType === '无' ? '' : this.selectedColumnType;//没有传空
  942. const uGlazedTile = this.selectedTile === '无' ? '' : this.selectedTile;
  943. const uSkirtType = this.selectedSkirtType === '无' ? '' : this.selectedSkirtType;
  944. const uReliefType = this.selectedReliefType === '无' ? '' : this.selectedReliefType;
  945. const uWindowStyle = this.selectedWindowStyle === '无' ? '' : this.selectedWindowStyle;
  946. formData.append('DesignStyle', uDesignStyle);
  947. formData.append('ColorCard', uColorCard);
  948. formData.append('DeepGrooveTech', uSelectedProcess);
  949. formData.append('DivisionMethod', uSelectedSplit);
  950. formData.append('WindowsColor', uWindowsColor);
  951. formData.append('CastRailing', uCastRailing);
  952. formData.append('GlazedTile', uGlazedTile);
  953. formData.append('columnType', uColumnType);//罗马柱
  954. formData.append('skirtType', uSkirtType);//墙裙
  955. formData.append('ReliefType', uReliefType);//浮雕
  956. formData.append('WindowStyle', uWindowStyle);//窗套
  957. } else if (this.activeName === '外墙平涂') {
  958. // 如果字典渲染有误,不让提交;
  959. if (!this.color_selValue) {
  960. this.$toast.fail('数据有误,请重试');
  961. return;
  962. }
  963. formData.append('DesignStyle', "CHANGE_COLOR");
  964. formData.append('Color', this.color_selValue)
  965. }
  966. // 其他项
  967. // let serviceCodeArray = [];
  968. // if (userInfo.loginTypeList.length > 0) {
  969. // userInfo.loginTypeList.forEach(item => {
  970. // if (item.shopType == 'stoneLikePaint') {
  971. // item.shopList.forEach(childItem => {
  972. // serviceCodeArray.push(childItem.shop_code);
  973. // })
  974. // }
  975. // })
  976. // }
  977. // // 用户企微ID
  978. // formData.append('WXuserid', userInfo.loginName);
  979. // 项目ID
  980. if (this.checkedProject && this.projectBoxShow == true && this.activeName === '外墙质感') {
  981. formData.append('projectid', this.checkedProject.projectid);
  982. }
  983. // 企微类型
  984. // formData.append('wecomType', 5);
  985. // // 服务商代码
  986. // if (serviceCodeArray.length > 0) {
  987. // formData.append('serivceCode', serviceCodeArray.join(','));
  988. // }
  989. // // 姓名
  990. // formData.append('userName', userInfo.userName);
  991. // const customerCode = userInfo.sysUserExt && userInfo.sysUserExt.customerCode ? userInfo.sysUserExt.customerCode : '';
  992. // // 经销商代码
  993. // formData.append('distributorCode', customerCode);
  994. // //原服务商用户、新增经销商用户
  995. // // 大区
  996. // formData.append('regionName', userInfo.officeName || '');
  997. // // 公司名称
  998. // formData.append('companyName', userInfo.companyName || '');
  999. // // 员工号
  1000. // let employeeID = userInfo.sysUserExt && userInfo.sysUserExt.sapEmployeeId ? userInfo.sysUserExt.sapEmployeeId : '';
  1001. // formData.append('employeeID', employeeID);
  1002. // //销售部---原服务商用户、新增经销商用户
  1003. // formData.append('salesDepartment', userInfo.subOfficeName || '');
  1004. // // 销售部ID
  1005. // formData.append('salesDepartmentCode', userInfo.subOfficeCode || '');
  1006. // 样式图片
  1007. if (this.Userfile1) {
  1008. formData.append('Userfile1', this.Userfile1);
  1009. } else {
  1010. formData.append('oldf_id', this.oldf_id);
  1011. }
  1012. // 遍历打印
  1013. formData.forEach((value, key) => {
  1014. console.log(`key: ${key}, value: ${value}`);
  1015. });
  1016. that.AIBtnDisabled = true;
  1017. CreateDesign(formData).then(response => {
  1018. // console.log(response);
  1019. if (response.StatusCode == 200) {
  1020. that.projectActionLoadingShow = false;
  1021. that.AIBtnDisabled = false;
  1022. if (that.projectBoxShow == true) {
  1023. that.updateCheckedProjectLastNum(that.checkedProject.projectid);
  1024. }
  1025. window.localStorage.setItem("type", 'design');
  1026. let projectid = null;
  1027. if (this.checkedProject && this.checkedProject.projectid) {
  1028. projectid = this.checkedProject.projectid;
  1029. } else if (this.$route.query.projectId) {
  1030. projectid = this.$route.query.projectId;
  1031. }
  1032. this.$router.push({
  1033. path: '/AIDesign/result',
  1034. query: {
  1035. F_id: response.Data.F_ID,
  1036. fromPage: 'design',
  1037. wallType: 'outside',
  1038. projectid: projectid
  1039. }
  1040. });
  1041. } else if (response.StatusCode == 410) {
  1042. that.dialogContent = response.Info;
  1043. that.projectActionLoadingShow = false;
  1044. that.AIBtnDisabled = false;
  1045. that.dialogShow = true;
  1046. // that.startCountdown();
  1047. } else {
  1048. that.projectActionLoadingShow = false;
  1049. that.AIBtnDisabled = false;
  1050. that.$toast(response.Info);
  1051. }
  1052. })
  1053. .catch((err) => {
  1054. that.projectActionLoadingShow = false;//弹窗
  1055. that.AIBtnDisabled = false;//ai生成按钮
  1056. })
  1057. }
  1058. private startCountdown() {
  1059. let that = this;
  1060. if (that.isRunning) return;
  1061. that.isRunning = true;
  1062. // startBtn.disabled = true;
  1063. // that.countdownValue = 3;
  1064. // that.countdownInterval = setInterval(() => {
  1065. // that.countdownValue--;
  1066. // if (that.countdownValue >= 0) {
  1067. // if (that.countdownValue === 0) {
  1068. // clearInterval(that.countdownInterval);
  1069. // that.isRunning = false;
  1070. // that.dialogShow = false;
  1071. // }
  1072. // }
  1073. // }, 1000);
  1074. }
  1075. //更新选中关联项目剩余次数
  1076. private updateCheckedProjectLastNum(projectId) {
  1077. let that = this;
  1078. const formData = new FormData();
  1079. // const userInfo: any = JSON.parse(window.localStorage.getItem("userInfoV1")!);
  1080. formData.append('ServiceCode', that.serviceCodeArray.join(','));
  1081. formData.append('projectid', projectId);
  1082. GetProjectlist(formData).then(response => {
  1083. if (response.StatusCode == 200) {
  1084. that.checkedProject = response.Data[0];
  1085. } else {
  1086. // console.log(response.Info)
  1087. }
  1088. });
  1089. }
  1090. //获取关联项目列表
  1091. GetProjectListFn() {
  1092. let that = this;
  1093. const formData = new FormData();
  1094. const userInfo: any = JSON.parse(window.localStorage.getItem("userInfoV1")!);
  1095. formData.append('ServiceCode', that.serviceCodeArray.join(','));
  1096. if (that.projectSearchValue.trim().length != 0) {
  1097. formData.append('keyWord', that.projectSearchValue);
  1098. }
  1099. GetProjectlist(formData).then(response => {
  1100. if (response.StatusCode == 200) {
  1101. if (response.Data.length == 0) {
  1102. that.projectActionShow = true;
  1103. } else {
  1104. that.projectList = response.Data;
  1105. that.projectActionListShow = true;
  1106. }
  1107. } else {
  1108. that.projectActionShow = true;
  1109. }
  1110. that.showChooseProject = false;
  1111. });
  1112. }
  1113. //跳转小程序
  1114. private toXiaoCX() {
  1115. toXiaoChengxu(`${process.env.VUE_APP_BASE_DISID6}`);
  1116. }
  1117. //跳转项目报备链接
  1118. private toProjectLink() {
  1119. this.showProjectPopover = false;
  1120. window.location.href = this.addProjectLink;
  1121. }
  1122. //获取风格选项图片列表
  1123. private getPicList() {
  1124. let that = this;
  1125. const formData = new FormData();
  1126. // const userInfo: any = JSON.parse(window.localStorage.getItem("userInfoV1")!);
  1127. // let roleIdArray = [];
  1128. // if (userInfo.roles.length > 0) {
  1129. // userInfo.roles.forEach(item => {
  1130. // roleIdArray.push(item.roleId);
  1131. // })
  1132. // }
  1133. // formData.append('roleIds', roleIdArray.join(','));
  1134. // formData.append('WXuserid', userInfo.loginName);
  1135. formData.append('baseType', 0);
  1136. // formData.append('wecomType', this.wecomType);
  1137. // const isRefresh = userInfo.isRefreshProvider === '是' ? 1 : 0;//0=否 1=是
  1138. const isRefreshProvider = window.localStorage.getItem("isRefreshProvider");
  1139. const isRefresh = isRefreshProvider === '是' ? 1 : 0;//0=否 1=是
  1140. formData.append('isRefresh', isRefresh);
  1141. GetDictList(formData).then(response => {
  1142. if (response.StatusCode == 200) {
  1143. that.isNeedProject = response.Data.isNeedProject;
  1144. that.addProjectLink = response.Data.projectAddress;
  1145. // 字典获取选择列表
  1146. // 设计风格
  1147. this.designStyles = response.Data.dict.DesignStyle;
  1148. // 仿石漆电子色卡选项
  1149. this.stoneColors = response.Data.dict.ColorCard;
  1150. // 墙面工艺选项
  1151. this.deepSlotProcesses = response.Data.dict.DeepGrooveTech;
  1152. if (this.deepSlotProcesses && this.deepSlotProcesses.length > 0) {
  1153. // 墙面分割线选项
  1154. this.splitWays = this.deepSlotProcesses[0].subitems;
  1155. }
  1156. // 窗套样式选项
  1157. this.windowFrames = response.Data.dict.WindowsColor;
  1158. // 浇筑栏杆选项
  1159. this.railings = response.Data.dict.CastRailing;
  1160. // 琉璃瓦选项
  1161. this.tiles = response.Data.dict.NewGlazedTile;
  1162. // 外墙平涂
  1163. this.color_options = response.Data.dict.outsideColor;
  1164. // 墙裙
  1165. this.skirtTypes = response.Data.dict.outsideSkirtType;
  1166. // 浮雕
  1167. this.outsideRelief = response.Data.dict.outsideRelief;
  1168. // 窗套样式
  1169. this.WindowStyle = response.Data.dict.WindowStyle;
  1170. // 罗马柱选项
  1171. if (this.designStyles && this.designStyles[0] && this.designStyles[0].subitems) {
  1172. this.ColumnTypes = this.designStyles[0].subitems || [];
  1173. this.selectedColumnType = this.designStyles[0].subitems[0].value || '';
  1174. }
  1175. if (this.$route.query.F_id) {
  1176. this.GetEntityData(this.$route.query.F_id);
  1177. } else {
  1178. // 判断如果不是服务商,也不用展示
  1179. if (that.serviceCodeArray.length == 0) {
  1180. that.projectBoxShow = false;
  1181. } else {
  1182. that.projectBoxShow = that.isNeedProject;
  1183. }
  1184. that.save_projectBoxShow_org = that.projectBoxShow;
  1185. this.zgInitData();
  1186. }
  1187. } else {
  1188. that.$toast(response.Info)
  1189. console.log(response.Info);
  1190. }
  1191. }).catch((err) => {
  1192. console.log("=======err=", err)
  1193. // that.$toast(err)
  1194. })
  1195. }
  1196. // 初始化外墙质感
  1197. private zgInitData() {
  1198. this.DesignStyle = this.designStyles[0].value;
  1199. this.ColorCard = this.stoneColors[0].value;
  1200. this.selectedProcess = this.deepSlotProcesses[0].value;
  1201. if (this.selectedProcess != '无' && this.selectedProcess != '平涂'){
  1202. this.selectedSplit = this.splitWays[0].value;
  1203. }
  1204. this.selectedWindowFrame = this.windowFrames[0].value;
  1205. this.selectedRailing = this.railings[0].value;
  1206. this.selectedTile = this.tiles[0].value;
  1207. this.selectedSkirtType = this.skirtTypes[0].value;
  1208. this.selectedReliefType = this.outsideRelief[0].value;
  1209. this.selectedWindowStyle = this.WindowStyle[0].value;
  1210. }
  1211. //关联列表模糊查询
  1212. private onSearch() {
  1213. this.GetProjectListFn();
  1214. }
  1215. //选择关联项目
  1216. private chooseProject() {
  1217. let that = this;
  1218. that.showChooseProject = true;
  1219. that.GetProjectListFn();
  1220. }
  1221. //确认选择
  1222. private chooseSure() {
  1223. let that = this;
  1224. // if (that.projectList[that.checkedProjectId].AvailableQuantity == 0) {
  1225. // this.projectActionNumShow = true;
  1226. // return;
  1227. // } else {
  1228. that.checkedProject = that.projectList[that.checkedProjectId];
  1229. that.projectActionListShow = false;
  1230. // }
  1231. }
  1232. }
  1233. </script>
  1234. <style>
  1235. .actionsTit {
  1236. width: fit-content;
  1237. font-size: 11px;
  1238. height: 34px;
  1239. padding: 5px 10px;
  1240. }
  1241. .van-popover--dark .van-popover__action {
  1242. background-color: #777A7F;
  1243. }
  1244. .van-popover--dark[data-popper-placement^=bottom] .van-popover__arrow {
  1245. border-bottom-color: #777A7F;
  1246. }
  1247. .design-container .van-tab__text {
  1248. font-size: 15px;
  1249. font-weight: 500;
  1250. line-height: 2.6rem;
  1251. }
  1252. .design-container .van-tab--active .van-tab__text {
  1253. font-size: 17px;
  1254. }
  1255. .design-container .van-tabs__nav {
  1256. background-color: transparent;
  1257. }
  1258. </style>
  1259. <style scoped lang="scss">
  1260. .design-container {
  1261. /* margin: 0 auto;
  1262. max-width: 750px; */
  1263. background-color: #f8f9fa;
  1264. min-height: 100vh;
  1265. flex-direction: column;
  1266. }
  1267. .container {
  1268. // padding: 0 20px;
  1269. }
  1270. .padded-lr-20 {
  1271. padding: 0 20px;
  1272. }
  1273. .top-nav {
  1274. display: flex;
  1275. justify-content: space-between;
  1276. align-items: center;
  1277. padding: 16px 20px;
  1278. background-color: white;
  1279. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  1280. position: sticky;
  1281. top: 0;
  1282. z-index: 10;
  1283. }
  1284. .back-btn,
  1285. .more-btn {
  1286. width: 40px;
  1287. height: 40px;
  1288. display: flex;
  1289. justify-content: center;
  1290. align-items: center;
  1291. cursor: pointer;
  1292. }
  1293. .title {
  1294. font-size: 15px;
  1295. font-weight: bold;
  1296. color: #333;
  1297. }
  1298. .history-section {
  1299. margin: 20px 0;
  1300. }
  1301. .history-header {
  1302. display: flex;
  1303. align-items: center;
  1304. gap: 12px;
  1305. padding: 12px 16px;
  1306. background-color: #ffffff;
  1307. border-radius: 18px;
  1308. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  1309. border: 1px solid #e9ecef;
  1310. /* margin-bottom: 10px; */
  1311. }
  1312. .icon-clock {
  1313. font-size: 12px;
  1314. margin-right: 8px;
  1315. }
  1316. .history-header span {
  1317. font-weight: 500;
  1318. color: #EC8868;
  1319. }
  1320. .history-header .badge-dot {
  1321. width: 5px;
  1322. height: 5px;
  1323. background-color: #ff4d4f;
  1324. border-radius: 50%;
  1325. }
  1326. .history-content {
  1327. padding: 20px;
  1328. border-radius: 12px;
  1329. background-color: white;
  1330. text-align: center;
  1331. border: 1px dashed #ddd;
  1332. }
  1333. .no-history {
  1334. color: #999;
  1335. font-size: 12px;
  1336. }
  1337. .image-selection {
  1338. text-align: center;
  1339. }
  1340. .image-placeholder {
  1341. position: relative;
  1342. display: flex;
  1343. flex-direction: column;
  1344. justify-content: center;
  1345. align-items: center;
  1346. height: 200px;
  1347. margin-bottom: 20px;
  1348. background-color: #ffffff;
  1349. border-radius: 12px;
  1350. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  1351. border: 1px dashed #ddd;
  1352. padding: 10px;
  1353. padding-bottom: 50px;
  1354. }
  1355. .project-placeholder {
  1356. position: relative;
  1357. display: flex;
  1358. flex-direction: column;
  1359. align-items: center;
  1360. margin-bottom: 20px;
  1361. background-color: #ffffff;
  1362. border-radius: 12px;
  1363. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  1364. border: 1px dashed #ddd;
  1365. padding: 10px;
  1366. padding-bottom: 30px;
  1367. }
  1368. .project-add-box {
  1369. width: 100%;
  1370. flex-direction: row;
  1371. display: flex;
  1372. justify-content: space-between;
  1373. align-items: center;
  1374. margin-bottom: 20px;
  1375. }
  1376. ::v-deep .van-button--normal {
  1377. font-size: 16px;
  1378. border-radius: 10px;
  1379. }
  1380. .project-action-box {
  1381. flex-direction: column;
  1382. display: flex;
  1383. box-sizing: border-box;
  1384. padding: 15px 5px 45px 5px;
  1385. width: 100%;
  1386. img {
  1387. width: 100%;
  1388. height: auto;
  1389. }
  1390. .tip {
  1391. padding: 0 20px;
  1392. font-size: 16px;
  1393. font-weight: 700;
  1394. }
  1395. .tip-content {
  1396. padding: 0 20px;
  1397. margin-top: 30px;
  1398. font-size: 14px;
  1399. }
  1400. .btn {
  1401. height: 44px;
  1402. line-height: 44px;
  1403. text-align: center;
  1404. margin: 20px;
  1405. font-size: 16px;
  1406. color: #FFFFFF;
  1407. background-color: #2484F2;
  1408. border-radius: 10px;
  1409. }
  1410. .btn2 {
  1411. width: 100%;
  1412. font-size: 14px;
  1413. text-align: center;
  1414. }
  1415. }
  1416. .project-action-list-box {
  1417. flex-direction: column;
  1418. display: flex;
  1419. box-sizing: border-box;
  1420. padding: 0px 15px 0px 15px;
  1421. .search-box-bg {
  1422. left: 0px;
  1423. right: 0px;
  1424. padding: 15px;
  1425. box-sizing: border-box;
  1426. background-color: #ffffff;
  1427. position: absolute;
  1428. z-index: 10;
  1429. .search-box {
  1430. flex-direction: row;
  1431. display: flex;
  1432. border: 1px solid #2484F2;
  1433. background-color: #FFFFFF;
  1434. align-items: center;
  1435. box-sizing: border-box;
  1436. padding-right: 5px;
  1437. .btn {
  1438. width: 50px;
  1439. height: 28px;
  1440. font-size: 11px;
  1441. border-radius: 5px;
  1442. }
  1443. }
  1444. ::v-deep .van-search {
  1445. padding: 0;
  1446. border-radius: 15px;
  1447. }
  1448. }
  1449. .list-item {
  1450. flex-direction: column;
  1451. display: flex;
  1452. box-sizing: border-box;
  1453. border-radius: 10px;
  1454. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  1455. margin-top: 20px;
  1456. padding: 15px;
  1457. position: relative;
  1458. .img-item {
  1459. position: absolute;
  1460. bottom: 0;
  1461. right: 5px;
  1462. }
  1463. .img-checked {
  1464. width: 30px;
  1465. }
  1466. .title-item {
  1467. flex-direction: row;
  1468. display: flex;
  1469. justify-content: space-between;
  1470. align-items: center;
  1471. margin-bottom: 5px;
  1472. .title {
  1473. font-size: 15px;
  1474. font-weight: 700;
  1475. }
  1476. .status {
  1477. font-size: 14px;
  1478. color: #999999;
  1479. min-width: 45px;
  1480. margin-left: 10px;
  1481. }
  1482. }
  1483. .user-item {
  1484. margin-top: 8px;
  1485. .txt {
  1486. font-size: 14px;
  1487. color: #999999;
  1488. margin-left: 10px;
  1489. }
  1490. }
  1491. }
  1492. .btn-box {
  1493. position: absolute;
  1494. bottom: 0px;
  1495. left: 0px;
  1496. right: 0px;
  1497. box-sizing: border-box;
  1498. padding: 15px;
  1499. background-color: #ffffff;
  1500. z-index: 10;
  1501. .btn-item {
  1502. position: relative;
  1503. flex-direction: row;
  1504. display: flex;
  1505. justify-content: flex-end;
  1506. align-items: center;
  1507. border-radius: 8px;
  1508. box-sizing: border-box;
  1509. margin-left: 20px;
  1510. background-color: rgba(134, 144, 156, 1);
  1511. .img-left-icon {
  1512. width: 66px;
  1513. height: 53px;
  1514. position: absolute;
  1515. left: -20px;
  1516. bottom: -3px;
  1517. }
  1518. .btn {
  1519. width: 133px;
  1520. height: 38px;
  1521. line-height: 38px;
  1522. opacity: 1;
  1523. border-radius: 8px;
  1524. text-align: center;
  1525. font-size: 14px;
  1526. color: #FFFFFF;
  1527. background: rgba(36, 132, 242, 1);
  1528. }
  1529. }
  1530. }
  1531. }
  1532. .list-item-checked {
  1533. width: 100%;
  1534. flex-direction: column;
  1535. display: flex;
  1536. box-sizing: border-box;
  1537. border-radius: 10px;
  1538. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  1539. padding: 15px;
  1540. margin-bottom: 20px;
  1541. position: relative;
  1542. .img-item {
  1543. position: absolute;
  1544. bottom: 0;
  1545. right: 5px;
  1546. }
  1547. .img-checked {
  1548. width: 30px;
  1549. }
  1550. .title-item {
  1551. flex-direction: row;
  1552. display: flex;
  1553. justify-content: space-between;
  1554. align-items: center;
  1555. margin-bottom: 5px;
  1556. .title {
  1557. font-size: 15px;
  1558. font-weight: 700;
  1559. }
  1560. .status {
  1561. font-size: 14px;
  1562. color: #999999;
  1563. min-width: 45px;
  1564. margin-left: 10px;
  1565. }
  1566. }
  1567. .user-item {
  1568. flex-direction: row;
  1569. display: flex;
  1570. justify-content: flex-start;
  1571. align-items: center;
  1572. margin-top: 8px;
  1573. .txt {
  1574. font-size: 14px;
  1575. color: #999999;
  1576. margin-left: 10px;
  1577. }
  1578. }
  1579. }
  1580. .selected-image-preview {
  1581. width: 100%;
  1582. height: 100%;
  1583. display: flex;
  1584. justify-content: center;
  1585. align-items: center;
  1586. }
  1587. .preview-image {
  1588. max-width: 100%;
  1589. max-height: 100%;
  1590. object-fit: contain;
  1591. }
  1592. .placeholder-text {
  1593. color: #999;
  1594. font-size: 15px;
  1595. text-align: center;
  1596. margin-bottom: 20px;
  1597. margin-top: 10px;
  1598. }
  1599. .placeholder-text-tit {
  1600. color: #999;
  1601. font-size: 15px;
  1602. text-align: center;
  1603. margin-bottom: 20px;
  1604. margin-top: -10px;
  1605. }
  1606. .image-buttons {
  1607. position: absolute;
  1608. right: 10px;
  1609. bottom: 10px;
  1610. display: flex;
  1611. gap: 16px;
  1612. width: 100%;
  1613. justify-content: flex-end;
  1614. }
  1615. .image-btn {
  1616. padding: 8px 16px;
  1617. border: none;
  1618. border-radius: 8px;
  1619. /* background-color: #666; */
  1620. background-color: #07c160;
  1621. color: white;
  1622. font-size: 12px;
  1623. cursor: pointer;
  1624. display: flex;
  1625. align-items: center;
  1626. gap: 8px;
  1627. transition: all 0.2s ease;
  1628. }
  1629. /* .image-btn:hover {
  1630. background-color: #555;
  1631. } */
  1632. .design-option {
  1633. margin: 20px 0;
  1634. position: relative;
  1635. }
  1636. .rightArrows {
  1637. position: absolute;
  1638. right: -10px;
  1639. top: calc(50% - 10px);
  1640. img {
  1641. height: auto;
  1642. }
  1643. }
  1644. .option-title {
  1645. font-size: 15px;
  1646. font-weight: 600;
  1647. color: #333;
  1648. margin-bottom: 12px;
  1649. }
  1650. .option-title-tit {
  1651. display: flex;
  1652. align-items: center;
  1653. span {
  1654. display: inline-block;
  1655. font-size: 11px;
  1656. color: #959fab;
  1657. line-height: 20px;
  1658. }
  1659. i {
  1660. display: block;
  1661. margin: 0 2px 0 5px;
  1662. line-height: 20px;
  1663. font-weight: bold;
  1664. }
  1665. }
  1666. /* 修改为grid布局,实现2x2排列 */
  1667. .option-grid {
  1668. display: grid;
  1669. grid-template-columns: repeat(2, 1fr);
  1670. gap: 10px;
  1671. }
  1672. .option-item {
  1673. position: relative;
  1674. padding: 10px;
  1675. border: 1px solid #ddd;
  1676. border-radius: 8px;
  1677. background-color: white;
  1678. text-align: center;
  1679. cursor: pointer;
  1680. transition: all 0.2s ease;
  1681. }
  1682. .option-item:hover {
  1683. transform: translateY(-2px);
  1684. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  1685. }
  1686. .option-item.active {
  1687. border-color: #E96337;
  1688. /* background-color: #fff8e6; */
  1689. }
  1690. .style-name {
  1691. font-size: 12px;
  1692. color: #666;
  1693. }
  1694. .design-colors-grid {
  1695. display: flex;
  1696. overflow-x: auto;
  1697. gap: 12px;
  1698. padding: 4px;
  1699. scroll-behavior: smooth;
  1700. cursor: grab;
  1701. user-select: none;
  1702. /* 防止拖拽时选中文本 */
  1703. }
  1704. .design-colors-grid::-webkit-scrollbar {
  1705. display: none;
  1706. /* 隐藏滚动条 */
  1707. }
  1708. .design-colors-grid .option-item {
  1709. padding: 10px 5px;
  1710. // width: 160px;
  1711. // flex: 0 0 auto; /* 防止压缩 */
  1712. }
  1713. .style-image {
  1714. // width: 141px;
  1715. // height: 100px;
  1716. width: 50px;
  1717. height: 50px;
  1718. object-fit: cover;
  1719. border-radius: 4px;
  1720. margin-bottom: 4px;
  1721. }
  1722. .magnifyingGlassBox {
  1723. position: absolute;
  1724. top: 4px;
  1725. right: 4px;
  1726. width: 18px;
  1727. height: 18px;
  1728. border-radius: 50%;
  1729. background-color: rgba(0, 0, 0, 0.5);
  1730. display: flex;
  1731. justify-content: center;
  1732. align-items: center;
  1733. img {
  1734. width: 14px;
  1735. height: auto;
  1736. }
  1737. }
  1738. /* 仿石漆电子色卡特殊样式 - 横向滚动 */
  1739. .stone-colors-grid {
  1740. display: flex;
  1741. overflow-x: auto;
  1742. gap: 12px;
  1743. padding: 4px;
  1744. scroll-behavior: smooth;
  1745. cursor: grab;
  1746. user-select: none;
  1747. /* 防止拖拽时选中文本 */
  1748. }
  1749. .stone-colors-grid::-webkit-scrollbar {
  1750. display: none;
  1751. /* 隐藏滚动条 */
  1752. }
  1753. .stone-colors-grid .option-item {
  1754. width: 50px;
  1755. height: 80px;
  1756. flex: 0 0 auto;
  1757. /* 防止压缩 */
  1758. }
  1759. .color-sample {
  1760. width: 50px;
  1761. height: 50px;
  1762. background-size: cover;
  1763. background-position: center;
  1764. border-radius: 4px;
  1765. margin-bottom: 8px;
  1766. }
  1767. .color-code {
  1768. font-size: 12px;
  1769. color: #666;
  1770. }
  1771. .process-icon,
  1772. .split-icon,
  1773. .railing-icon,
  1774. .tile-icon {
  1775. width: 50px;
  1776. height: 50px;
  1777. display: flex;
  1778. align-items: center;
  1779. justify-content: center;
  1780. margin-bottom: 8px;
  1781. font-size: 15px;
  1782. }
  1783. .split-icon,
  1784. .railing-icon,
  1785. .tile-icon {
  1786. background-size: contain;
  1787. background-repeat: no-repeat;
  1788. background-position: center;
  1789. }
  1790. .frame-icon {
  1791. width: 50px;
  1792. height: 50px;
  1793. border-radius: 4px;
  1794. margin-bottom: 8px;
  1795. }
  1796. .tile-color {
  1797. width: 50px;
  1798. height: 50px;
  1799. border-radius: 4px;
  1800. margin-bottom: 8px;
  1801. }
  1802. .process-name,
  1803. .split-name,
  1804. .frame-name,
  1805. .railing-name,
  1806. .tile-name {
  1807. font-size: 12px;
  1808. color: #666;
  1809. line-height: 13px;
  1810. padding-top: 2px;
  1811. display: inline-block;
  1812. }
  1813. .generate-section {
  1814. display: flex;
  1815. flex-direction: column;
  1816. align-items: center;
  1817. gap: 8px;
  1818. /* 按钮和文字说明之间的间距 */
  1819. margin-bottom: 20px;
  1820. }
  1821. .generate-btn {
  1822. padding: 16px;
  1823. background-color: #E96337;
  1824. border: none;
  1825. border-radius: 12px;
  1826. color: white;
  1827. font-weight: 600;
  1828. cursor: pointer;
  1829. transition: all 0.2s ease;
  1830. text-align: center;
  1831. min-width: 90%;
  1832. }
  1833. /* .generate-btn:hover {
  1834. background-color: #e68a00;
  1835. } */
  1836. .btn-text {
  1837. font-size: 16px;
  1838. font-weight: bold;
  1839. }
  1840. .btn-note {
  1841. font-size: 12px;
  1842. color: #999;
  1843. text-align: center;
  1844. line-height: 1.2;
  1845. }
  1846. .header {
  1847. /*height: 50px;*/
  1848. /*line-height: 50px;*/
  1849. /*text-align: center;*/
  1850. /*background: #fff;*/
  1851. border-bottom: 1px solid #f8f8f8;
  1852. .van-nav-bar__title {
  1853. font-size: 20px;
  1854. color: #333;
  1855. }
  1856. .van-icon {
  1857. font-size: 20px;
  1858. color: #333 !important;
  1859. }
  1860. }
  1861. .dialog-box {
  1862. flex-direction: column;
  1863. display: flex;
  1864. box-sizing: border-box;
  1865. position: relative;
  1866. .dialog-content {
  1867. padding: 20px 20px 10px 20px;
  1868. }
  1869. .dialog-btn {
  1870. height: 44px;
  1871. line-height: 44px;
  1872. text-align: center;
  1873. margin: 20px;
  1874. font-size: 16px;
  1875. color: #FFFFFF;
  1876. background-color: #2484F2;
  1877. border-radius: 10px;
  1878. }
  1879. }
  1880. ::v-deep .van-button__loading+.van-button__text {
  1881. margin-left: 10px;
  1882. }
  1883. /* 样式调整:隐藏原生 input,按钮样式保持不变 */
  1884. .upload-container {
  1885. position: relative;
  1886. display: inline-block;
  1887. .native-upload-input {
  1888. position: absolute;
  1889. top: 0;
  1890. left: 0;
  1891. width: 100%;
  1892. height: 100%;
  1893. opacity: 0;
  1894. cursor: pointer;
  1895. z-index: 1;
  1896. }
  1897. .image-btn {
  1898. padding: 8px 16px;
  1899. border: none;
  1900. border-radius: 8px;
  1901. background-color: #2484F2;
  1902. color: white;
  1903. font-size: 12px;
  1904. cursor: pointer;
  1905. display: flex;
  1906. align-items: center;
  1907. gap: 8px;
  1908. transition: all 0.2s ease;
  1909. }
  1910. }
  1911. .radio-group-container1 {
  1912. padding: 16px 0;
  1913. position: relative;
  1914. .color-plus {
  1915. width: 100%;
  1916. height: 90px;
  1917. margin: 10px auto;
  1918. position: relative;
  1919. margin: 0px auto 10px;
  1920. .cardImg {
  1921. width: 100%;
  1922. height: 100%;
  1923. img {
  1924. width: 100%;
  1925. height: auto;
  1926. }
  1927. }
  1928. .color-plus-info {
  1929. position: absolute;
  1930. width: calc(100% - 20px);
  1931. height: 100%;
  1932. top: 0;
  1933. left: 20px;
  1934. display: flex;
  1935. flex-direction: column;
  1936. justify-content: center;
  1937. .color-plus-tit {
  1938. font-size: 16px;
  1939. font-weight: 500;
  1940. line-height: 26px;
  1941. width: 100%;
  1942. color: #000;
  1943. }
  1944. p {
  1945. font-size: 11px;
  1946. line-height: 15px;
  1947. color: rgba(56, 56, 56, 1);
  1948. }
  1949. .color-plus-subheading {
  1950. font-size: 11px;
  1951. line-height: 15px;
  1952. width: 100%;
  1953. color: #86909C;
  1954. }
  1955. }
  1956. }
  1957. // 上图下文字
  1958. .custom-radio-group4 {
  1959. display: flex;
  1960. flex-wrap: wrap;
  1961. // column-gap: 2px;
  1962. // row-gap: 16px;
  1963. }
  1964. .custom-radio4 {
  1965. width: calc(25% - 2px);
  1966. margin: 0 1px 16px;
  1967. }
  1968. .custom-radio4:nth-child(4n) {
  1969. margin-right: 0;
  1970. }
  1971. .radio-content-text {
  1972. padding: 12px 0;
  1973. text-align: center;
  1974. border: 1px solid #E5E5E5;
  1975. border-radius: 4px;
  1976. box-sizing: border-box;
  1977. transition: all 0.2s;
  1978. font-size: 12px;
  1979. }
  1980. /* 选中指示器(橙色三角形背景) */
  1981. .check-indicator {
  1982. position: absolute;
  1983. width: 20px;
  1984. height: 20px;
  1985. background-color: #F0A43A;
  1986. /* 三角形效果 */
  1987. clip-path: polygon(0 0, 0 100%, 100% 0);
  1988. .van-icon {
  1989. position: relative;
  1990. }
  1991. }
  1992. /* 选项内容容器 */
  1993. .radio-content {
  1994. position: relative;
  1995. width: 100%;
  1996. }
  1997. .custom-radio-text {
  1998. font-size: 12px;
  1999. text-align: center;
  2000. line-height: 14px;
  2001. width: 100%;
  2002. margin: 0 auto;
  2003. position: absolute;
  2004. z-index: 2;
  2005. color: #000;
  2006. bottom: 4px;
  2007. left: 0;
  2008. }
  2009. .radio-content-color {
  2010. font-size: 12px;
  2011. width: 60px;
  2012. height: 60px;
  2013. position: relative;
  2014. border: 1px solid #E5E5E5;
  2015. margin: 0 auto;
  2016. .cardImg {
  2017. width: 100%;
  2018. height: 100%;
  2019. }
  2020. .check-indicator {
  2021. left: 0;
  2022. top: 0;
  2023. .van-icon {
  2024. top: -5px;
  2025. left: 0px;
  2026. }
  2027. }
  2028. }
  2029. .radio-content-text {
  2030. border-radius: 4px;
  2031. .check-indicator {
  2032. border-radius: 2px 0 0 0;
  2033. top: 0;
  2034. left: 0;
  2035. .van-icon {
  2036. top: -5px;
  2037. left: -3px;
  2038. }
  2039. }
  2040. }
  2041. /* 隐藏Vant默认的选中样式 */
  2042. .custom-radio ::v-deep .van-radio__icon {
  2043. display: none;
  2044. }
  2045. .custom-radio ::v-deep .van-radio__label {
  2046. width: 100%;
  2047. margin-left: 0;
  2048. border-radius: inherit;
  2049. flex: 1;
  2050. }
  2051. /* 单个选项样式 */
  2052. .custom-radio {
  2053. flex-shrink: 0;
  2054. align-items: flex-start;
  2055. justify-content: center;
  2056. }
  2057. /* 选中状态的边框样式 */
  2058. ::v-deep .van-radio__icon--checked+.van-radio__label>.radio-content-text {
  2059. border-color: #F0A43A;
  2060. }
  2061. ::v-deep .van-radio__icon--checked+.van-radio__label>.radio-content-color {
  2062. border-color: #F0A43A;
  2063. }
  2064. ::v-deep .van-button--normal {
  2065. font-size: 16px;
  2066. border-radius: 10px;
  2067. }
  2068. }
  2069. </style>