design.vue 72 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285
  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 = this.cardValueFindIndex(response.Data.F_DesignStyle,this.designStyles) == -1 ? this.designStyles[0].value : response.Data.F_DesignStyle;
  700. // this.DesignStyle = response.Data.F_DesignStyle || this.designStyles[0].value;
  701. }
  702. this.ColorCard = this.cardValueFindIndex(response.Data.F_ColorCard,this.stoneColors) == -1 ? this.stoneColors[0].value : response.Data.F_ColorCard;
  703. // this.ColorCard = response.Data.F_ColorCard || this.stoneColors[0].value;
  704. this.selectedProcess = this.cardValueFindIndex(response.Data.F_DeepGrooveTech,this.deepSlotProcesses) == -1 ? this.deepSlotProcesses[0].value : response.Data.F_DeepGrooveTech;
  705. // this.selectedProcess = response.Data.F_DeepGrooveTech || this.deepSlotProcesses[0].value;
  706. // 有墙面工艺
  707. if (this.selectedProcess && this.selectedProcess != '平涂') {
  708. const selectedProcessSelctIndex = this.deepSlotProcesses.findIndex(item => item.value === this.selectedProcess);
  709. // 墙面分割线选项
  710. this.splitWays = this.deepSlotProcesses[selectedProcessSelctIndex].subitems;
  711. this.selectedSplit = this.cardValueFindIndex(response.Data.F_DivisionMethod,this.splitWays) == -1 ? this.splitWays[0].value : response.Data.F_DivisionMethod;
  712. // this.selectedSplit = response.Data.F_DivisionMethod || this.splitWays[0].value;
  713. }
  714. this.selectedWindowFrame = this.cardValueFindIndex(response.Data.F_WindowsColor,this.windowFrames) == -1 ? this.windowFrames[0].value : response.Data.F_WindowsColor;
  715. // this.selectedWindowFrame = response.Data.F_WindowsColor || this.windowFrames[0].value;
  716. this.selectedRailing = this.cardValueFindIndex(response.Data.F_CastRailing,this.railings) == -1 ? this.railings[0].value : response.Data.F_CastRailing;
  717. // this.selectedRailing = response.Data.F_CastRailing || this.railings[0].value;
  718. this.selectedTile = this.cardValueFindIndex(response.Data.F_GlazedTile,this.tiles) == -1 ? this.tiles[0].value : response.Data.F_GlazedTile;
  719. // this.selectedTile = response.Data.F_GlazedTile || this.tiles[0].value;//新琉璃瓦
  720. this.selectedSkirtType = this.cardValueFindIndex(response.Data.F_SkirtType,this.skirtTypes) == -1 ? this.skirtTypes[0].value : response.Data.F_SkirtType;
  721. // this.selectedSkirtType = response.Data.F_SkirtType || this.skirtTypes[0].value;//墙裙
  722. this.selectedReliefType = this.cardValueFindIndex(response.Data.F_carvingType,this.outsideRelief) == -1 ? this.outsideRelief[0].value : response.Data.F_carvingType;
  723. // this.selectedReliefType = response.Data.F_carvingType || this.outsideRelief[0].value;//浮雕
  724. this.selectedWindowStyle = this.cardValueFindIndex(response.Data.F_WindowsStyle,this.WindowStyle) == -1 ? this.WindowStyle[0].value : response.Data.F_WindowsStyle;
  725. // this.selectedWindowStyle = response.Data.F_WindowsStyle || this.WindowStyle[0].value;//窗套样式
  726. this.oldf_id = response.Data.F_ID;
  727. this.color_selValue = response.Data.F_Color || null;// 外墙平涂选中的值
  728. if (this.color_selValue) {
  729. // 找到选中的外墙平涂
  730. const selectedItemColor = this.color_options.find(
  731. item => item.value === this.color_selValue
  732. );
  733. this.color_selItem = selectedItemColor;
  734. }
  735. // 判断如果不是服务商,也不用展示
  736. if (that.serviceCodeArray.length == 0) {
  737. that.projectBoxShow = false;
  738. } else {
  739. that.projectBoxShow = that.isNeedProject;
  740. }
  741. that.save_projectBoxShow_org = that.projectBoxShow;
  742. if (this.color_selValue) {
  743. this.activeName = '外墙平涂';
  744. this.projectBoxShow = false;
  745. } else if (this.ColorCard != '无') {
  746. this.activeName = '外墙质感';
  747. } else {
  748. this.activeName = '';
  749. }
  750. if (response.Data.ProjectID) {
  751. this.checkedProject = {
  752. projectid: response.Data.ProjectID
  753. }
  754. }
  755. let projectId = this.$route.query.projectId || null;
  756. if (projectId) {
  757. this.updateCheckedProjectLastNum(projectId);
  758. }
  759. // 罗马柱选项-重新渲染
  760. let F_ColumnType = response.Data.F_ColumnType || '无';
  761. if (!response.Data.F_ColumnType && response.Data.F_DesignStyle == 'CUSTOM') {
  762. F_ColumnType = '';
  763. this.ColumnTypes = [];
  764. } else {
  765. const DesignStyleSelctIndex = this.designStyles.findIndex(item => item.value === this.DesignStyle);
  766. const designStyles = this.designStyles;
  767. if (designStyles[DesignStyleSelctIndex] && designStyles[DesignStyleSelctIndex].subitems) {
  768. this.ColumnTypes = designStyles[DesignStyleSelctIndex].subitems || [];
  769. } else {
  770. this.ColumnTypes = [];
  771. }
  772. }
  773. this.selectedColumnType = this.cardValueFindIndex(F_ColumnType,this.ColumnTypes) == -1 ? this.ColumnTypes[0].value : F_ColumnType;
  774. // this.selectedColumnType = F_ColumnType;//罗马柱
  775. }
  776. }
  777. })
  778. }
  779. //判断选项卡初始化值是否还存在
  780. cardValueFindIndex(value,array){
  781. const index = array.findIndex(item => item.value === value);
  782. return index;
  783. }
  784. // 添加一个新的辅助方法用于将图片URL转换为File对象
  785. private async urlToFile(url: string, filename: string): Promise<File> {
  786. try {
  787. const response = await fetch(url);
  788. const blob = await response.blob();
  789. return new File([blob], filename, { type: blob.type });
  790. } catch (error) {
  791. console.error('图片转换失败:', error);
  792. this.$toast('图片加载失败');
  793. throw error;
  794. }
  795. }
  796. private viewHistory() {
  797. this.UpdateReadStateFn();
  798. // console.log('查看历史生成');
  799. // 实现查看历史生成逻辑
  800. this.$router.push({ path: '/AIDesign/history', query: { wallType: "outside" } });
  801. }
  802. // 方法
  803. private goBack() {
  804. this.$router.back();
  805. }
  806. // private takePhoto() {
  807. // // 实现拍照功能
  808. // console.log('拍摄图片');
  809. // }
  810. private autoScrollToActive(refsName: string, selcIndex: number) {
  811. // console.log("refsName=", refsName)
  812. const container = this.$refs[refsName];
  813. const activeItem = container.children[selcIndex];
  814. const itemWidth = activeItem.offsetWidth * 1.1;
  815. // 判断选中项是否完全在可视范围内
  816. const containerRect = container.getBoundingClientRect(); // 容器可视区域
  817. const itemRect = activeItem.getBoundingClientRect(); // 选中项位置
  818. // 完全可见的条件:左≥容器左,右≤容器右
  819. const isFullyVisibleL = itemRect.left >= containerRect.left;
  820. const isFullyVisibleR = itemRect.right <= containerRect.right;
  821. if (!isFullyVisibleL) {
  822. container.scrollBy({
  823. left: -itemWidth, // 右边滑一格多的距离
  824. behavior: 'smooth' // 平滑滚动
  825. });
  826. } else if (!isFullyVisibleR) {
  827. container.scrollBy({
  828. left: itemWidth, // 左滑一格多的距离
  829. behavior: 'smooth' // 平滑滚动
  830. });
  831. }
  832. }
  833. private selectStyle(value: string, refsName: string, selcIndex: number) {
  834. this.DesignStyle = value;
  835. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  836. // 罗马柱
  837. const designStyles = this.designStyles;
  838. this.ColumnTypes = designStyles[selcIndex].subitems || [];
  839. if (designStyles[selcIndex] && designStyles[selcIndex].subitems && designStyles[selcIndex].subitems[0]) {
  840. this.selectedColumnType = designStyles[selcIndex].subitems[0].value;
  841. } else {
  842. this.selectedColumnType = '无';
  843. }
  844. }
  845. private selectColor(code: string, refsName: string, selcIndex: number) {
  846. this.ColorCard = code;
  847. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  848. }
  849. private selectProcess(value: string, refsName: string, selcIndex: number) {
  850. this.selectedProcess = value;
  851. if (value != '无' && value != '平涂'){
  852. this.splitWays = this.deepSlotProcesses[selcIndex].subitems;
  853. this.selectedSplit = this.splitWays[0].value;
  854. }
  855. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  856. }
  857. private selectSplit(value: string, refsName: string, selcIndex: number) {
  858. this.selectedSplit = value;
  859. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  860. }
  861. private selectWindowStyle(value: string, refsName: string, selcIndex: number) {
  862. this.selectedWindowStyle = value;
  863. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  864. }
  865. private selectWindowFrame(value: string, refsName: string, selcIndex: number) {
  866. this.selectedWindowFrame = value;
  867. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  868. }
  869. private selectRailing(value: string, refsName: string, selcIndex: number) {
  870. this.selectedRailing = value;
  871. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  872. }
  873. private selectTile(value: string, refsName: string, selcIndex: number) {
  874. this.selectedTile = value;
  875. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  876. }
  877. private selectSkirtType(value: string, refsName: string, selcIndex: number) {
  878. this.selectedSkirtType = value;
  879. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  880. }
  881. private selectColumnType(value: string, refsName: string, selcIndex: number) {
  882. this.selectedColumnType = value;
  883. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  884. }
  885. private selectReliefType(value: string, refsName: string, selcIndex: number) {
  886. this.selectedReliefType = value;
  887. this.autoScrollToActive(refsName, selcIndex); // 选中后触发自动滚动
  888. }
  889. // 添加鼠标滚轮事件处理
  890. private handleWheel(e: WheelEvent) {
  891. const container = e.currentTarget as HTMLElement;
  892. if (container) {
  893. container.scrollLeft += e.deltaY;
  894. }
  895. }
  896. // 添加鼠标按下事件处理
  897. private handleMouseDown(e: MouseEvent) {
  898. this.isMouseDown = true;
  899. this.currentScrollElement = e.currentTarget as HTMLElement;
  900. if (this.currentScrollElement) {
  901. this.currentScrollElement.style.cursor = 'grabbing';
  902. this.startX = e.pageX - this.currentScrollElement.offsetLeft;
  903. this.scrollLeft = this.currentScrollElement.scrollLeft;
  904. }
  905. }
  906. // 添加鼠标移动事件处理
  907. private handleMouseMove(e: MouseEvent) {
  908. if (!this.isMouseDown) return;
  909. e.preventDefault();
  910. if (this.currentScrollElement) {
  911. const x = e.pageX - this.currentScrollElement.offsetLeft;
  912. const walk = (x - this.startX) * 2;
  913. this.currentScrollElement.scrollLeft = this.scrollLeft - walk;
  914. }
  915. }
  916. // 添加鼠标释放事件处理
  917. private handleMouseUp() {
  918. this.isMouseDown = false;
  919. if (this.currentScrollElement) {
  920. this.currentScrollElement.style.cursor = 'grab';
  921. }
  922. this.currentScrollElement = null;
  923. }
  924. private generateDesign() {
  925. let that = this;
  926. // console.log(this.Userfile1);
  927. // 实现AI生成功能
  928. if (that.projectBoxShow == true && this.activeName === '外墙质感') {
  929. if (that.checkedProject == null) {
  930. that.$toast.fail('请选择关联项目');
  931. return;
  932. }
  933. // if (that.checkedProject.AvailableQuantity == 0) {
  934. // this.projectActionNumShow = true;
  935. // return;
  936. // }
  937. }
  938. if (!this.Userfile1 && !this.oldf_id) {
  939. this.$toast.fail('请选择图片');
  940. return;
  941. }
  942. // const userInfo: any = JSON.parse(window.localStorage.getItem("userInfoV1")!);
  943. const formData = new FormData();
  944. if (this.activeName === '外墙质感') {
  945. // 如果字典渲染有误,不让提交;墙面工艺、电子色卡都为必填项且没有不需要;
  946. if (!this.selectedProcess || !this.ColorCard) {
  947. this.$toast.fail('数据有误,请重试');
  948. return;
  949. }
  950. // 用户选择的选项
  951. const uDesignStyle = this.DesignStyle === '无' ? '' : this.DesignStyle;
  952. const uColorCard = this.ColorCard === '无' ? '' : this.ColorCard;
  953. const uSelectedProcess = this.selectedProcess === '无' ? '' : this.selectedProcess;
  954. let uSelectedSplit = '';
  955. if (this.selectedProcess === '无' || this.selectedProcess === '平涂'){
  956. uSelectedSplit === '平涂';
  957. }else {
  958. uSelectedSplit = this.selectedSplit === '无' ? '' : this.selectedSplit;
  959. }
  960. const uWindowsColor = (this.selectedWindowFrame === '无' || this.selectedWindowStyle === '无') ? '' : this.selectedWindowFrame;//窗套样式为空也传空
  961. const uCastRailing = this.selectedRailing === '无' ? '' : this.selectedRailing;
  962. const uColumnType = this.selectedColumnType === '无' ? '' : this.selectedColumnType;//没有传空
  963. const uGlazedTile = this.selectedTile === '无' ? '' : this.selectedTile;
  964. const uSkirtType = this.selectedSkirtType === '无' ? '' : this.selectedSkirtType;
  965. const uReliefType = this.selectedReliefType === '无' ? '' : this.selectedReliefType;
  966. const uWindowStyle = this.selectedWindowStyle === '无' ? '' : this.selectedWindowStyle;
  967. formData.append('DesignStyle', uDesignStyle);
  968. formData.append('ColorCard', uColorCard);
  969. formData.append('DeepGrooveTech', uSelectedProcess);
  970. formData.append('DivisionMethod', uSelectedSplit);
  971. formData.append('WindowsColor', uWindowsColor);
  972. formData.append('CastRailing', uCastRailing);
  973. formData.append('GlazedTile', uGlazedTile);
  974. formData.append('columnType', uColumnType);//罗马柱
  975. formData.append('skirtType', uSkirtType);//墙裙
  976. formData.append('ReliefType', uReliefType);//浮雕
  977. formData.append('WindowStyle', uWindowStyle);//窗套
  978. } else if (this.activeName === '外墙平涂') {
  979. // 如果字典渲染有误,不让提交;
  980. if (!this.color_selValue) {
  981. this.$toast.fail('数据有误,请重试');
  982. return;
  983. }
  984. formData.append('DesignStyle', "CHANGE_COLOR");
  985. formData.append('Color', this.color_selValue)
  986. }
  987. // 其他项
  988. // let serviceCodeArray = [];
  989. // if (userInfo.loginTypeList.length > 0) {
  990. // userInfo.loginTypeList.forEach(item => {
  991. // if (item.shopType == 'stoneLikePaint') {
  992. // item.shopList.forEach(childItem => {
  993. // serviceCodeArray.push(childItem.shop_code);
  994. // })
  995. // }
  996. // })
  997. // }
  998. // // 用户企微ID
  999. // formData.append('WXuserid', userInfo.loginName);
  1000. // 项目ID
  1001. if (this.checkedProject && this.projectBoxShow == true && this.activeName === '外墙质感') {
  1002. formData.append('projectid', this.checkedProject.projectid);
  1003. }
  1004. // 企微类型
  1005. // formData.append('wecomType', 5);
  1006. // // 服务商代码
  1007. // if (serviceCodeArray.length > 0) {
  1008. // formData.append('serivceCode', serviceCodeArray.join(','));
  1009. // }
  1010. // // 姓名
  1011. // formData.append('userName', userInfo.userName);
  1012. // const customerCode = userInfo.sysUserExt && userInfo.sysUserExt.customerCode ? userInfo.sysUserExt.customerCode : '';
  1013. // // 经销商代码
  1014. // formData.append('distributorCode', customerCode);
  1015. // //原服务商用户、新增经销商用户
  1016. // // 大区
  1017. // formData.append('regionName', userInfo.officeName || '');
  1018. // // 公司名称
  1019. // formData.append('companyName', userInfo.companyName || '');
  1020. // // 员工号
  1021. // let employeeID = userInfo.sysUserExt && userInfo.sysUserExt.sapEmployeeId ? userInfo.sysUserExt.sapEmployeeId : '';
  1022. // formData.append('employeeID', employeeID);
  1023. // //销售部---原服务商用户、新增经销商用户
  1024. // formData.append('salesDepartment', userInfo.subOfficeName || '');
  1025. // // 销售部ID
  1026. // formData.append('salesDepartmentCode', userInfo.subOfficeCode || '');
  1027. // 样式图片
  1028. if (this.Userfile1) {
  1029. formData.append('Userfile1', this.Userfile1);
  1030. } else {
  1031. formData.append('oldf_id', this.oldf_id);
  1032. }
  1033. // 遍历打印
  1034. formData.forEach((value, key) => {
  1035. console.log(`key: ${key}, value: ${value}`);
  1036. });
  1037. that.AIBtnDisabled = true;
  1038. CreateDesign(formData).then(response => {
  1039. // console.log(response);
  1040. if (response.StatusCode == 200) {
  1041. that.projectActionLoadingShow = false;
  1042. that.AIBtnDisabled = false;
  1043. if (that.projectBoxShow == true) {
  1044. that.updateCheckedProjectLastNum(that.checkedProject.projectid);
  1045. }
  1046. window.localStorage.setItem("type", 'design');
  1047. let projectid = null;
  1048. if (this.checkedProject && this.checkedProject.projectid) {
  1049. projectid = this.checkedProject.projectid;
  1050. } else if (this.$route.query.projectId) {
  1051. projectid = this.$route.query.projectId;
  1052. }
  1053. this.$router.push({
  1054. path: '/AIDesign/result',
  1055. query: {
  1056. F_id: response.Data.F_ID,
  1057. fromPage: 'design',
  1058. wallType: 'outside',
  1059. projectid: projectid
  1060. }
  1061. });
  1062. } else if (response.StatusCode == 410) {
  1063. that.dialogContent = response.Info;
  1064. that.projectActionLoadingShow = false;
  1065. that.AIBtnDisabled = false;
  1066. that.dialogShow = true;
  1067. // that.startCountdown();
  1068. } else {
  1069. that.projectActionLoadingShow = false;
  1070. that.AIBtnDisabled = false;
  1071. that.$toast(response.Info);
  1072. }
  1073. })
  1074. .catch((err) => {
  1075. that.projectActionLoadingShow = false;//弹窗
  1076. that.AIBtnDisabled = false;//ai生成按钮
  1077. })
  1078. }
  1079. private startCountdown() {
  1080. let that = this;
  1081. if (that.isRunning) return;
  1082. that.isRunning = true;
  1083. // startBtn.disabled = true;
  1084. // that.countdownValue = 3;
  1085. // that.countdownInterval = setInterval(() => {
  1086. // that.countdownValue--;
  1087. // if (that.countdownValue >= 0) {
  1088. // if (that.countdownValue === 0) {
  1089. // clearInterval(that.countdownInterval);
  1090. // that.isRunning = false;
  1091. // that.dialogShow = false;
  1092. // }
  1093. // }
  1094. // }, 1000);
  1095. }
  1096. //更新选中关联项目剩余次数
  1097. private updateCheckedProjectLastNum(projectId) {
  1098. let that = this;
  1099. const formData = new FormData();
  1100. // const userInfo: any = JSON.parse(window.localStorage.getItem("userInfoV1")!);
  1101. formData.append('ServiceCode', that.serviceCodeArray.join(','));
  1102. formData.append('projectid', projectId);
  1103. GetProjectlist(formData).then(response => {
  1104. if (response.StatusCode == 200) {
  1105. that.checkedProject = response.Data[0];
  1106. } else {
  1107. // console.log(response.Info)
  1108. }
  1109. });
  1110. }
  1111. //获取关联项目列表
  1112. GetProjectListFn() {
  1113. let that = this;
  1114. const formData = new FormData();
  1115. const userInfo: any = JSON.parse(window.localStorage.getItem("userInfoV1")!);
  1116. formData.append('ServiceCode', that.serviceCodeArray.join(','));
  1117. if (that.projectSearchValue.trim().length != 0) {
  1118. formData.append('keyWord', that.projectSearchValue);
  1119. }
  1120. GetProjectlist(formData).then(response => {
  1121. if (response.StatusCode == 200) {
  1122. if (response.Data.length == 0) {
  1123. that.projectActionShow = true;
  1124. } else {
  1125. that.projectList = response.Data;
  1126. that.projectActionListShow = true;
  1127. }
  1128. } else {
  1129. that.projectActionShow = true;
  1130. }
  1131. that.showChooseProject = false;
  1132. });
  1133. }
  1134. //跳转小程序
  1135. private toXiaoCX() {
  1136. toXiaoChengxu(`${process.env.VUE_APP_BASE_DISID6}`);
  1137. }
  1138. //跳转项目报备链接
  1139. private toProjectLink() {
  1140. this.showProjectPopover = false;
  1141. window.location.href = this.addProjectLink;
  1142. }
  1143. //获取风格选项图片列表
  1144. private getPicList() {
  1145. let that = this;
  1146. const formData = new FormData();
  1147. // const userInfo: any = JSON.parse(window.localStorage.getItem("userInfoV1")!);
  1148. // let roleIdArray = [];
  1149. // if (userInfo.roles.length > 0) {
  1150. // userInfo.roles.forEach(item => {
  1151. // roleIdArray.push(item.roleId);
  1152. // })
  1153. // }
  1154. // formData.append('roleIds', roleIdArray.join(','));
  1155. // formData.append('WXuserid', userInfo.loginName);
  1156. formData.append('baseType', 0);
  1157. // formData.append('wecomType', this.wecomType);
  1158. // const isRefresh = userInfo.isRefreshProvider === '是' ? 1 : 0;//0=否 1=是
  1159. const isRefreshProvider = window.localStorage.getItem("isRefreshProvider");
  1160. const isRefresh = isRefreshProvider === '是' ? 1 : 0;//0=否 1=是
  1161. formData.append('isRefresh', isRefresh);
  1162. GetDictList(formData).then(response => {
  1163. if (response.StatusCode == 200) {
  1164. that.isNeedProject = response.Data.isNeedProject;
  1165. that.addProjectLink = response.Data.projectAddress;
  1166. // 字典获取选择列表
  1167. // 设计风格
  1168. this.designStyles = response.Data.dict.DesignStyle;
  1169. // 仿石漆电子色卡选项
  1170. this.stoneColors = response.Data.dict.ColorCard;
  1171. // 墙面工艺选项
  1172. this.deepSlotProcesses = response.Data.dict.DeepGrooveTech;
  1173. if (this.deepSlotProcesses && this.deepSlotProcesses.length > 0) {
  1174. // 墙面分割线选项
  1175. this.splitWays = this.deepSlotProcesses[0].subitems;
  1176. }
  1177. // 窗套样式选项
  1178. this.windowFrames = response.Data.dict.WindowsColor;
  1179. // 浇筑栏杆选项
  1180. this.railings = response.Data.dict.CastRailing;
  1181. // 琉璃瓦选项
  1182. this.tiles = response.Data.dict.NewGlazedTile;
  1183. // 外墙平涂
  1184. this.color_options = response.Data.dict.outsideColor;
  1185. // 墙裙
  1186. this.skirtTypes = response.Data.dict.outsideSkirtType;
  1187. // 浮雕
  1188. this.outsideRelief = response.Data.dict.outsideRelief;
  1189. // 窗套样式
  1190. this.WindowStyle = response.Data.dict.WindowStyle;
  1191. // 罗马柱选项
  1192. if (this.designStyles && this.designStyles[0] && this.designStyles[0].subitems) {
  1193. this.ColumnTypes = this.designStyles[0].subitems || [];
  1194. this.selectedColumnType = this.designStyles[0].subitems[0].value || '';
  1195. }
  1196. if (this.$route.query.F_id) {
  1197. this.GetEntityData(this.$route.query.F_id);
  1198. } else {
  1199. // 判断如果不是服务商,也不用展示
  1200. if (that.serviceCodeArray.length == 0) {
  1201. that.projectBoxShow = false;
  1202. } else {
  1203. that.projectBoxShow = that.isNeedProject;
  1204. }
  1205. that.save_projectBoxShow_org = that.projectBoxShow;
  1206. this.zgInitData();
  1207. }
  1208. } else {
  1209. that.$toast(response.Info)
  1210. console.log(response.Info);
  1211. }
  1212. }).catch((err) => {
  1213. console.log("=======err=", err)
  1214. // that.$toast(err)
  1215. })
  1216. }
  1217. // 初始化外墙质感
  1218. private zgInitData() {
  1219. this.DesignStyle = this.designStyles[0].value;
  1220. this.ColorCard = this.stoneColors[0].value;
  1221. this.selectedProcess = this.deepSlotProcesses[0].value;
  1222. if (this.selectedProcess != '无' && this.selectedProcess != '平涂'){
  1223. this.selectedSplit = this.splitWays[0].value;
  1224. }
  1225. this.selectedWindowFrame = this.windowFrames[0].value;
  1226. this.selectedRailing = this.railings[0].value;
  1227. this.selectedTile = this.tiles[0].value;
  1228. this.selectedSkirtType = this.skirtTypes[0].value;
  1229. this.selectedReliefType = this.outsideRelief[0].value;
  1230. this.selectedWindowStyle = this.WindowStyle[0].value;
  1231. }
  1232. //关联列表模糊查询
  1233. private onSearch() {
  1234. this.GetProjectListFn();
  1235. }
  1236. //选择关联项目
  1237. private chooseProject() {
  1238. let that = this;
  1239. that.showChooseProject = true;
  1240. that.GetProjectListFn();
  1241. }
  1242. //确认选择
  1243. private chooseSure() {
  1244. let that = this;
  1245. // if (that.projectList[that.checkedProjectId].AvailableQuantity == 0) {
  1246. // this.projectActionNumShow = true;
  1247. // return;
  1248. // } else {
  1249. that.checkedProject = that.projectList[that.checkedProjectId];
  1250. that.projectActionListShow = false;
  1251. // }
  1252. }
  1253. }
  1254. </script>
  1255. <style>
  1256. .actionsTit {
  1257. width: fit-content;
  1258. font-size: 11px;
  1259. height: 34px;
  1260. padding: 5px 10px;
  1261. }
  1262. .van-popover--dark .van-popover__action {
  1263. background-color: #777A7F;
  1264. }
  1265. .van-popover--dark[data-popper-placement^=bottom] .van-popover__arrow {
  1266. border-bottom-color: #777A7F;
  1267. }
  1268. .design-container .van-tab__text {
  1269. font-size: 15px;
  1270. font-weight: 500;
  1271. line-height: 2.6rem;
  1272. }
  1273. .design-container .van-tab--active .van-tab__text {
  1274. font-size: 17px;
  1275. }
  1276. .design-container .van-tabs__nav {
  1277. background-color: transparent;
  1278. }
  1279. </style>
  1280. <style scoped lang="scss">
  1281. .design-container {
  1282. /* margin: 0 auto;
  1283. max-width: 750px; */
  1284. background-color: #f8f9fa;
  1285. min-height: 100vh;
  1286. flex-direction: column;
  1287. }
  1288. .container {
  1289. // padding: 0 20px;
  1290. }
  1291. .padded-lr-20 {
  1292. padding: 0 20px;
  1293. }
  1294. .top-nav {
  1295. display: flex;
  1296. justify-content: space-between;
  1297. align-items: center;
  1298. padding: 16px 20px;
  1299. background-color: white;
  1300. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  1301. position: sticky;
  1302. top: 0;
  1303. z-index: 10;
  1304. }
  1305. .back-btn,
  1306. .more-btn {
  1307. width: 40px;
  1308. height: 40px;
  1309. display: flex;
  1310. justify-content: center;
  1311. align-items: center;
  1312. cursor: pointer;
  1313. }
  1314. .title {
  1315. font-size: 15px;
  1316. font-weight: bold;
  1317. color: #333;
  1318. }
  1319. .history-section {
  1320. margin: 20px 0;
  1321. }
  1322. .history-header {
  1323. display: flex;
  1324. align-items: center;
  1325. gap: 12px;
  1326. padding: 12px 16px;
  1327. background-color: #ffffff;
  1328. border-radius: 18px;
  1329. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  1330. border: 1px solid #e9ecef;
  1331. /* margin-bottom: 10px; */
  1332. }
  1333. .icon-clock {
  1334. font-size: 12px;
  1335. margin-right: 8px;
  1336. }
  1337. .history-header span {
  1338. font-weight: 500;
  1339. color: #EC8868;
  1340. }
  1341. .history-header .badge-dot {
  1342. width: 5px;
  1343. height: 5px;
  1344. background-color: #ff4d4f;
  1345. border-radius: 50%;
  1346. }
  1347. .history-content {
  1348. padding: 20px;
  1349. border-radius: 12px;
  1350. background-color: white;
  1351. text-align: center;
  1352. border: 1px dashed #ddd;
  1353. }
  1354. .no-history {
  1355. color: #999;
  1356. font-size: 12px;
  1357. }
  1358. .image-selection {
  1359. text-align: center;
  1360. }
  1361. .image-placeholder {
  1362. position: relative;
  1363. display: flex;
  1364. flex-direction: column;
  1365. justify-content: center;
  1366. align-items: center;
  1367. height: 200px;
  1368. margin-bottom: 20px;
  1369. background-color: #ffffff;
  1370. border-radius: 12px;
  1371. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  1372. border: 1px dashed #ddd;
  1373. padding: 10px;
  1374. padding-bottom: 50px;
  1375. }
  1376. .project-placeholder {
  1377. position: relative;
  1378. display: flex;
  1379. flex-direction: column;
  1380. align-items: center;
  1381. margin-bottom: 20px;
  1382. background-color: #ffffff;
  1383. border-radius: 12px;
  1384. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  1385. border: 1px dashed #ddd;
  1386. padding: 10px;
  1387. padding-bottom: 30px;
  1388. }
  1389. .project-add-box {
  1390. width: 100%;
  1391. flex-direction: row;
  1392. display: flex;
  1393. justify-content: space-between;
  1394. align-items: center;
  1395. margin-bottom: 20px;
  1396. }
  1397. ::v-deep .van-button--normal {
  1398. font-size: 16px;
  1399. border-radius: 10px;
  1400. }
  1401. .project-action-box {
  1402. flex-direction: column;
  1403. display: flex;
  1404. box-sizing: border-box;
  1405. padding: 15px 5px 45px 5px;
  1406. width: 100%;
  1407. img {
  1408. width: 100%;
  1409. height: auto;
  1410. }
  1411. .tip {
  1412. padding: 0 20px;
  1413. font-size: 16px;
  1414. font-weight: 700;
  1415. }
  1416. .tip-content {
  1417. padding: 0 20px;
  1418. margin-top: 30px;
  1419. font-size: 14px;
  1420. }
  1421. .btn {
  1422. height: 44px;
  1423. line-height: 44px;
  1424. text-align: center;
  1425. margin: 20px;
  1426. font-size: 16px;
  1427. color: #FFFFFF;
  1428. background-color: #2484F2;
  1429. border-radius: 10px;
  1430. }
  1431. .btn2 {
  1432. width: 100%;
  1433. font-size: 14px;
  1434. text-align: center;
  1435. }
  1436. }
  1437. .project-action-list-box {
  1438. flex-direction: column;
  1439. display: flex;
  1440. box-sizing: border-box;
  1441. padding: 0px 15px 0px 15px;
  1442. .search-box-bg {
  1443. left: 0px;
  1444. right: 0px;
  1445. padding: 15px;
  1446. box-sizing: border-box;
  1447. background-color: #ffffff;
  1448. position: absolute;
  1449. z-index: 10;
  1450. .search-box {
  1451. flex-direction: row;
  1452. display: flex;
  1453. border: 1px solid #2484F2;
  1454. background-color: #FFFFFF;
  1455. align-items: center;
  1456. box-sizing: border-box;
  1457. padding-right: 5px;
  1458. .btn {
  1459. width: 50px;
  1460. height: 28px;
  1461. font-size: 11px;
  1462. border-radius: 5px;
  1463. }
  1464. }
  1465. ::v-deep .van-search {
  1466. padding: 0;
  1467. border-radius: 15px;
  1468. }
  1469. }
  1470. .list-item {
  1471. flex-direction: column;
  1472. display: flex;
  1473. box-sizing: border-box;
  1474. border-radius: 10px;
  1475. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  1476. margin-top: 20px;
  1477. padding: 15px;
  1478. position: relative;
  1479. .img-item {
  1480. position: absolute;
  1481. bottom: 0;
  1482. right: 5px;
  1483. }
  1484. .img-checked {
  1485. width: 30px;
  1486. }
  1487. .title-item {
  1488. flex-direction: row;
  1489. display: flex;
  1490. justify-content: space-between;
  1491. align-items: center;
  1492. margin-bottom: 5px;
  1493. .title {
  1494. font-size: 15px;
  1495. font-weight: 700;
  1496. }
  1497. .status {
  1498. font-size: 14px;
  1499. color: #999999;
  1500. min-width: 45px;
  1501. margin-left: 10px;
  1502. }
  1503. }
  1504. .user-item {
  1505. margin-top: 8px;
  1506. .txt {
  1507. font-size: 14px;
  1508. color: #999999;
  1509. margin-left: 10px;
  1510. }
  1511. }
  1512. }
  1513. .btn-box {
  1514. position: absolute;
  1515. bottom: 0px;
  1516. left: 0px;
  1517. right: 0px;
  1518. box-sizing: border-box;
  1519. padding: 15px;
  1520. background-color: #ffffff;
  1521. z-index: 10;
  1522. .btn-item {
  1523. position: relative;
  1524. flex-direction: row;
  1525. display: flex;
  1526. justify-content: flex-end;
  1527. align-items: center;
  1528. border-radius: 8px;
  1529. box-sizing: border-box;
  1530. margin-left: 20px;
  1531. background-color: rgba(134, 144, 156, 1);
  1532. .img-left-icon {
  1533. width: 66px;
  1534. height: 53px;
  1535. position: absolute;
  1536. left: -20px;
  1537. bottom: -3px;
  1538. }
  1539. .btn {
  1540. width: 133px;
  1541. height: 38px;
  1542. line-height: 38px;
  1543. opacity: 1;
  1544. border-radius: 8px;
  1545. text-align: center;
  1546. font-size: 14px;
  1547. color: #FFFFFF;
  1548. background: rgba(36, 132, 242, 1);
  1549. }
  1550. }
  1551. }
  1552. }
  1553. .list-item-checked {
  1554. width: 100%;
  1555. flex-direction: column;
  1556. display: flex;
  1557. box-sizing: border-box;
  1558. border-radius: 10px;
  1559. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  1560. padding: 15px;
  1561. margin-bottom: 20px;
  1562. position: relative;
  1563. .img-item {
  1564. position: absolute;
  1565. bottom: 0;
  1566. right: 5px;
  1567. }
  1568. .img-checked {
  1569. width: 30px;
  1570. }
  1571. .title-item {
  1572. flex-direction: row;
  1573. display: flex;
  1574. justify-content: space-between;
  1575. align-items: center;
  1576. margin-bottom: 5px;
  1577. .title {
  1578. font-size: 15px;
  1579. font-weight: 700;
  1580. }
  1581. .status {
  1582. font-size: 14px;
  1583. color: #999999;
  1584. min-width: 45px;
  1585. margin-left: 10px;
  1586. }
  1587. }
  1588. .user-item {
  1589. flex-direction: row;
  1590. display: flex;
  1591. justify-content: flex-start;
  1592. align-items: center;
  1593. margin-top: 8px;
  1594. .txt {
  1595. font-size: 14px;
  1596. color: #999999;
  1597. margin-left: 10px;
  1598. }
  1599. }
  1600. }
  1601. .selected-image-preview {
  1602. width: 100%;
  1603. height: 100%;
  1604. display: flex;
  1605. justify-content: center;
  1606. align-items: center;
  1607. }
  1608. .preview-image {
  1609. max-width: 100%;
  1610. max-height: 100%;
  1611. object-fit: contain;
  1612. }
  1613. .placeholder-text {
  1614. color: #999;
  1615. font-size: 15px;
  1616. text-align: center;
  1617. margin-bottom: 20px;
  1618. margin-top: 10px;
  1619. }
  1620. .placeholder-text-tit {
  1621. color: #999;
  1622. font-size: 15px;
  1623. text-align: center;
  1624. margin-bottom: 20px;
  1625. margin-top: -10px;
  1626. }
  1627. .image-buttons {
  1628. position: absolute;
  1629. right: 10px;
  1630. bottom: 10px;
  1631. display: flex;
  1632. gap: 16px;
  1633. width: 100%;
  1634. justify-content: flex-end;
  1635. }
  1636. .image-btn {
  1637. padding: 8px 16px;
  1638. border: none;
  1639. border-radius: 8px;
  1640. /* background-color: #666; */
  1641. background-color: #07c160;
  1642. color: white;
  1643. font-size: 12px;
  1644. cursor: pointer;
  1645. display: flex;
  1646. align-items: center;
  1647. gap: 8px;
  1648. transition: all 0.2s ease;
  1649. }
  1650. /* .image-btn:hover {
  1651. background-color: #555;
  1652. } */
  1653. .design-option {
  1654. margin: 20px 0;
  1655. position: relative;
  1656. }
  1657. .rightArrows {
  1658. position: absolute;
  1659. right: -10px;
  1660. top: calc(50% - 10px);
  1661. img {
  1662. height: auto;
  1663. }
  1664. }
  1665. .option-title {
  1666. font-size: 15px;
  1667. font-weight: 600;
  1668. color: #333;
  1669. margin-bottom: 12px;
  1670. }
  1671. .option-title-tit {
  1672. display: flex;
  1673. align-items: center;
  1674. span {
  1675. display: inline-block;
  1676. font-size: 11px;
  1677. color: #959fab;
  1678. line-height: 20px;
  1679. }
  1680. i {
  1681. display: block;
  1682. margin: 0 2px 0 5px;
  1683. line-height: 20px;
  1684. font-weight: bold;
  1685. }
  1686. }
  1687. /* 修改为grid布局,实现2x2排列 */
  1688. .option-grid {
  1689. display: grid;
  1690. grid-template-columns: repeat(2, 1fr);
  1691. gap: 10px;
  1692. }
  1693. .option-item {
  1694. position: relative;
  1695. padding: 10px;
  1696. border: 1px solid #ddd;
  1697. border-radius: 8px;
  1698. background-color: white;
  1699. text-align: center;
  1700. cursor: pointer;
  1701. transition: all 0.2s ease;
  1702. }
  1703. .option-item:hover {
  1704. transform: translateY(-2px);
  1705. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  1706. }
  1707. .option-item.active {
  1708. border-color: #E96337;
  1709. /* background-color: #fff8e6; */
  1710. }
  1711. .style-name {
  1712. font-size: 12px;
  1713. color: #666;
  1714. }
  1715. .design-colors-grid {
  1716. display: flex;
  1717. overflow-x: auto;
  1718. gap: 12px;
  1719. padding: 4px;
  1720. scroll-behavior: smooth;
  1721. cursor: grab;
  1722. user-select: none;
  1723. /* 防止拖拽时选中文本 */
  1724. }
  1725. .design-colors-grid::-webkit-scrollbar {
  1726. display: none;
  1727. /* 隐藏滚动条 */
  1728. }
  1729. .design-colors-grid .option-item {
  1730. padding: 10px 5px;
  1731. // width: 160px;
  1732. // flex: 0 0 auto; /* 防止压缩 */
  1733. }
  1734. .style-image {
  1735. // width: 141px;
  1736. // height: 100px;
  1737. width: 50px;
  1738. height: 50px;
  1739. object-fit: cover;
  1740. border-radius: 4px;
  1741. margin-bottom: 4px;
  1742. }
  1743. .magnifyingGlassBox {
  1744. position: absolute;
  1745. top: 4px;
  1746. right: 4px;
  1747. width: 18px;
  1748. height: 18px;
  1749. border-radius: 50%;
  1750. background-color: rgba(0, 0, 0, 0.5);
  1751. display: flex;
  1752. justify-content: center;
  1753. align-items: center;
  1754. img {
  1755. width: 14px;
  1756. height: auto;
  1757. }
  1758. }
  1759. /* 仿石漆电子色卡特殊样式 - 横向滚动 */
  1760. .stone-colors-grid {
  1761. display: flex;
  1762. overflow-x: auto;
  1763. gap: 12px;
  1764. padding: 4px;
  1765. scroll-behavior: smooth;
  1766. cursor: grab;
  1767. user-select: none;
  1768. /* 防止拖拽时选中文本 */
  1769. }
  1770. .stone-colors-grid::-webkit-scrollbar {
  1771. display: none;
  1772. /* 隐藏滚动条 */
  1773. }
  1774. .stone-colors-grid .option-item {
  1775. width: 50px;
  1776. height: 80px;
  1777. flex: 0 0 auto;
  1778. /* 防止压缩 */
  1779. }
  1780. .color-sample {
  1781. width: 50px;
  1782. height: 50px;
  1783. background-size: cover;
  1784. background-position: center;
  1785. border-radius: 4px;
  1786. margin-bottom: 8px;
  1787. }
  1788. .color-code {
  1789. font-size: 12px;
  1790. color: #666;
  1791. }
  1792. .process-icon,
  1793. .split-icon,
  1794. .railing-icon,
  1795. .tile-icon {
  1796. width: 50px;
  1797. height: 50px;
  1798. display: flex;
  1799. align-items: center;
  1800. justify-content: center;
  1801. margin-bottom: 8px;
  1802. font-size: 15px;
  1803. }
  1804. .split-icon,
  1805. .railing-icon,
  1806. .tile-icon {
  1807. background-size: contain;
  1808. background-repeat: no-repeat;
  1809. background-position: center;
  1810. }
  1811. .frame-icon {
  1812. width: 50px;
  1813. height: 50px;
  1814. border-radius: 4px;
  1815. margin-bottom: 8px;
  1816. }
  1817. .tile-color {
  1818. width: 50px;
  1819. height: 50px;
  1820. border-radius: 4px;
  1821. margin-bottom: 8px;
  1822. }
  1823. .process-name,
  1824. .split-name,
  1825. .frame-name,
  1826. .railing-name,
  1827. .tile-name {
  1828. font-size: 12px;
  1829. color: #666;
  1830. line-height: 13px;
  1831. padding-top: 2px;
  1832. display: inline-block;
  1833. }
  1834. .generate-section {
  1835. display: flex;
  1836. flex-direction: column;
  1837. align-items: center;
  1838. gap: 8px;
  1839. /* 按钮和文字说明之间的间距 */
  1840. margin-bottom: 20px;
  1841. }
  1842. .generate-btn {
  1843. padding: 16px;
  1844. background-color: #E96337;
  1845. border: none;
  1846. border-radius: 12px;
  1847. color: white;
  1848. font-weight: 600;
  1849. cursor: pointer;
  1850. transition: all 0.2s ease;
  1851. text-align: center;
  1852. min-width: 90%;
  1853. }
  1854. /* .generate-btn:hover {
  1855. background-color: #e68a00;
  1856. } */
  1857. .btn-text {
  1858. font-size: 16px;
  1859. font-weight: bold;
  1860. }
  1861. .btn-note {
  1862. font-size: 12px;
  1863. color: #999;
  1864. text-align: center;
  1865. line-height: 1.2;
  1866. }
  1867. .header {
  1868. /*height: 50px;*/
  1869. /*line-height: 50px;*/
  1870. /*text-align: center;*/
  1871. /*background: #fff;*/
  1872. border-bottom: 1px solid #f8f8f8;
  1873. .van-nav-bar__title {
  1874. font-size: 20px;
  1875. color: #333;
  1876. }
  1877. .van-icon {
  1878. font-size: 20px;
  1879. color: #333 !important;
  1880. }
  1881. }
  1882. .dialog-box {
  1883. flex-direction: column;
  1884. display: flex;
  1885. box-sizing: border-box;
  1886. position: relative;
  1887. .dialog-content {
  1888. padding: 20px 20px 10px 20px;
  1889. }
  1890. .dialog-btn {
  1891. height: 44px;
  1892. line-height: 44px;
  1893. text-align: center;
  1894. margin: 20px;
  1895. font-size: 16px;
  1896. color: #FFFFFF;
  1897. background-color: #2484F2;
  1898. border-radius: 10px;
  1899. }
  1900. }
  1901. ::v-deep .van-button__loading+.van-button__text {
  1902. margin-left: 10px;
  1903. }
  1904. /* 样式调整:隐藏原生 input,按钮样式保持不变 */
  1905. .upload-container {
  1906. position: relative;
  1907. display: inline-block;
  1908. .native-upload-input {
  1909. position: absolute;
  1910. top: 0;
  1911. left: 0;
  1912. width: 100%;
  1913. height: 100%;
  1914. opacity: 0;
  1915. cursor: pointer;
  1916. z-index: 1;
  1917. }
  1918. .image-btn {
  1919. padding: 8px 16px;
  1920. border: none;
  1921. border-radius: 8px;
  1922. background-color: #2484F2;
  1923. color: white;
  1924. font-size: 12px;
  1925. cursor: pointer;
  1926. display: flex;
  1927. align-items: center;
  1928. gap: 8px;
  1929. transition: all 0.2s ease;
  1930. }
  1931. }
  1932. .radio-group-container1 {
  1933. padding: 16px 0;
  1934. position: relative;
  1935. .color-plus {
  1936. width: 100%;
  1937. height: 90px;
  1938. margin: 10px auto;
  1939. position: relative;
  1940. margin: 0px auto 10px;
  1941. .cardImg {
  1942. width: 100%;
  1943. height: 100%;
  1944. img {
  1945. width: 100%;
  1946. height: auto;
  1947. }
  1948. }
  1949. .color-plus-info {
  1950. position: absolute;
  1951. width: calc(100% - 20px);
  1952. height: 100%;
  1953. top: 0;
  1954. left: 20px;
  1955. display: flex;
  1956. flex-direction: column;
  1957. justify-content: center;
  1958. .color-plus-tit {
  1959. font-size: 16px;
  1960. font-weight: 500;
  1961. line-height: 26px;
  1962. width: 100%;
  1963. color: #000;
  1964. }
  1965. p {
  1966. font-size: 11px;
  1967. line-height: 15px;
  1968. color: rgba(56, 56, 56, 1);
  1969. }
  1970. .color-plus-subheading {
  1971. font-size: 11px;
  1972. line-height: 15px;
  1973. width: 100%;
  1974. color: #86909C;
  1975. }
  1976. }
  1977. }
  1978. // 上图下文字
  1979. .custom-radio-group4 {
  1980. display: flex;
  1981. flex-wrap: wrap;
  1982. // column-gap: 2px;
  1983. // row-gap: 16px;
  1984. }
  1985. .custom-radio4 {
  1986. width: calc(25% - 2px);
  1987. margin: 0 1px 16px;
  1988. }
  1989. .custom-radio4:nth-child(4n) {
  1990. margin-right: 0;
  1991. }
  1992. .radio-content-text {
  1993. padding: 12px 0;
  1994. text-align: center;
  1995. border: 1px solid #E5E5E5;
  1996. border-radius: 4px;
  1997. box-sizing: border-box;
  1998. transition: all 0.2s;
  1999. font-size: 12px;
  2000. }
  2001. /* 选中指示器(橙色三角形背景) */
  2002. .check-indicator {
  2003. position: absolute;
  2004. width: 20px;
  2005. height: 20px;
  2006. background-color: #F0A43A;
  2007. /* 三角形效果 */
  2008. clip-path: polygon(0 0, 0 100%, 100% 0);
  2009. .van-icon {
  2010. position: relative;
  2011. }
  2012. }
  2013. /* 选项内容容器 */
  2014. .radio-content {
  2015. position: relative;
  2016. width: 100%;
  2017. }
  2018. .custom-radio-text {
  2019. font-size: 12px;
  2020. text-align: center;
  2021. line-height: 14px;
  2022. width: 100%;
  2023. margin: 0 auto;
  2024. position: absolute;
  2025. z-index: 2;
  2026. color: #000;
  2027. bottom: 4px;
  2028. left: 0;
  2029. }
  2030. .radio-content-color {
  2031. font-size: 12px;
  2032. width: 60px;
  2033. height: 60px;
  2034. position: relative;
  2035. border: 1px solid #E5E5E5;
  2036. margin: 0 auto;
  2037. .cardImg {
  2038. width: 100%;
  2039. height: 100%;
  2040. }
  2041. .check-indicator {
  2042. left: 0;
  2043. top: 0;
  2044. .van-icon {
  2045. top: -5px;
  2046. left: 0px;
  2047. }
  2048. }
  2049. }
  2050. .radio-content-text {
  2051. border-radius: 4px;
  2052. .check-indicator {
  2053. border-radius: 2px 0 0 0;
  2054. top: 0;
  2055. left: 0;
  2056. .van-icon {
  2057. top: -5px;
  2058. left: -3px;
  2059. }
  2060. }
  2061. }
  2062. /* 隐藏Vant默认的选中样式 */
  2063. .custom-radio ::v-deep .van-radio__icon {
  2064. display: none;
  2065. }
  2066. .custom-radio ::v-deep .van-radio__label {
  2067. width: 100%;
  2068. margin-left: 0;
  2069. border-radius: inherit;
  2070. flex: 1;
  2071. }
  2072. /* 单个选项样式 */
  2073. .custom-radio {
  2074. flex-shrink: 0;
  2075. align-items: flex-start;
  2076. justify-content: center;
  2077. }
  2078. /* 选中状态的边框样式 */
  2079. ::v-deep .van-radio__icon--checked+.van-radio__label>.radio-content-text {
  2080. border-color: #F0A43A;
  2081. }
  2082. ::v-deep .van-radio__icon--checked+.van-radio__label>.radio-content-color {
  2083. border-color: #F0A43A;
  2084. }
  2085. ::v-deep .van-button--normal {
  2086. font-size: 16px;
  2087. border-radius: 10px;
  2088. }
  2089. }
  2090. </style>