design.vue 75 KB

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