design.vue 70 KB

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