design.vue 65 KB

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