design.vue 75 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409
  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 = '';
  1010. if (this.selectedProcess === '无' || this.selectedProcess === '平涂'){
  1011. uSelectedSplit === '平涂';
  1012. }else {
  1013. uSelectedSplit = this.selectedSplit === '无' ? '' : this.selectedSplit;
  1014. }
  1015. const uWindowsColor = (this.selectedWindowFrame === '无' || this.selectedWindowStyle === '无') ? '' : this.selectedWindowFrame;//窗套样式为空也传空
  1016. const uCastRailing = this.selectedRailing === '无' ? '' : this.selectedRailing;
  1017. const uColumnType = this.selectedColumnType === '无' ? '' : this.selectedColumnType;//没有传空
  1018. const uGlazedTile = this.selectedTile === '无' ? '' : this.selectedTile;
  1019. const uSkirtType = this.selectedSkirtType === '无' ? '' : this.selectedSkirtType;
  1020. const uReliefType = this.selectedReliefType === '无' ? '' : this.selectedReliefType;
  1021. const uWindowStyle = this.selectedWindowStyle === '无' ? '' : this.selectedWindowStyle;
  1022. formData.append('DesignStyle', uDesignStyle);
  1023. formData.append('ColorCard', uColorCard);
  1024. formData.append('DeepGrooveTech', uSelectedProcess);
  1025. formData.append('DivisionMethod', uSelectedSplit);
  1026. formData.append('WindowsColor', uWindowsColor);
  1027. formData.append('CastRailing', uCastRailing);
  1028. formData.append('GlazedTile', uGlazedTile);
  1029. formData.append('columnType', uColumnType);//罗马柱
  1030. formData.append('skirtType', uSkirtType);//墙裙
  1031. formData.append('ReliefType', uReliefType);//浮雕
  1032. formData.append('WindowStyle', uWindowStyle);//窗套
  1033. } else if (this.activeName === '外墙平涂') {
  1034. // 如果字典渲染有误,不让提交;
  1035. if (!this.color_selValue) {
  1036. this.$toast.fail('数据有误,请重试');
  1037. return;
  1038. }
  1039. formData.append('DesignStyle', "CHANGE_COLOR");
  1040. formData.append('Color', this.color_selValue)
  1041. }
  1042. // 其他项
  1043. // let serviceCodeArray = [];
  1044. // if (userInfo.loginTypeList.length > 0) {
  1045. // userInfo.loginTypeList.forEach(item => {
  1046. // if (item.shopType == 'stoneLikePaint') {
  1047. // item.shopList.forEach(childItem => {
  1048. // serviceCodeArray.push(childItem.shop_code);
  1049. // })
  1050. // }
  1051. // })
  1052. // }
  1053. // // 用户企微ID
  1054. // formData.append('WXuserid', userInfo.loginName);
  1055. // 项目ID
  1056. if (this.checkedProject && this.projectBoxShow == true && this.activeName === '外墙质感') {
  1057. formData.append('projectid', this.checkedProject.projectid);
  1058. }
  1059. // 企微类型
  1060. // formData.append('wecomType', 5);
  1061. // // 服务商代码
  1062. // if (serviceCodeArray.length > 0) {
  1063. // formData.append('serivceCode', serviceCodeArray.join(','));
  1064. // }
  1065. // // 姓名
  1066. // formData.append('userName', userInfo.userName);
  1067. // const customerCode = userInfo.sysUserExt && userInfo.sysUserExt.customerCode ? userInfo.sysUserExt.customerCode : '';
  1068. // // 经销商代码
  1069. // formData.append('distributorCode', customerCode);
  1070. // //原服务商用户、新增经销商用户
  1071. // // 大区
  1072. // formData.append('regionName', userInfo.officeName || '');
  1073. // // 公司名称
  1074. // formData.append('companyName', userInfo.companyName || '');
  1075. // // 员工号
  1076. // let employeeID = userInfo.sysUserExt && userInfo.sysUserExt.sapEmployeeId ? userInfo.sysUserExt.sapEmployeeId : '';
  1077. // formData.append('employeeID', employeeID);
  1078. // //销售部---原服务商用户、新增经销商用户
  1079. // formData.append('salesDepartment', userInfo.subOfficeName || '');
  1080. // // 销售部ID
  1081. // formData.append('salesDepartmentCode', userInfo.subOfficeCode || '');
  1082. // 样式图片
  1083. if (this.Userfile1) {
  1084. formData.append('Userfile1', this.Userfile1);
  1085. } else {
  1086. formData.append('oldf_id', this.oldf_id);
  1087. }
  1088. // 遍历打印
  1089. formData.forEach((value, key) => {
  1090. console.log(`key: ${key}, value: ${value}`);
  1091. });
  1092. that.AIBtnDisabled = true;
  1093. CreateDesign(formData).then(response => {
  1094. // console.log(response);
  1095. if (response.StatusCode == 200) {
  1096. that.projectActionLoadingShow = false;
  1097. that.AIBtnDisabled = false;
  1098. if (that.projectBoxShow == true) {
  1099. that.updateCheckedProjectLastNum(that.checkedProject.projectid);
  1100. }
  1101. window.localStorage.setItem("type", 'design');
  1102. let projectid = null;
  1103. if (this.checkedProject && this.checkedProject.projectid) {
  1104. projectid = this.checkedProject.projectid;
  1105. } else if (this.$route.query.projectId) {
  1106. projectid = this.$route.query.projectId;
  1107. }
  1108. this.$router.push({
  1109. path: '/AIDesign/result',
  1110. query: {
  1111. F_id: response.Data.F_ID,
  1112. fromPage: 'design',
  1113. wallType: 'outside',
  1114. projectid: projectid
  1115. }
  1116. });
  1117. } else if (response.StatusCode == 410) {
  1118. that.dialogContent = response.Info;
  1119. that.projectActionLoadingShow = false;
  1120. that.AIBtnDisabled = false;
  1121. that.dialogShow = true;
  1122. // that.startCountdown();
  1123. } else {
  1124. that.projectActionLoadingShow = false;
  1125. that.AIBtnDisabled = false;
  1126. that.$toast(response.Info);
  1127. }
  1128. })
  1129. .catch((err) => {
  1130. that.projectActionLoadingShow = false;//弹窗
  1131. that.AIBtnDisabled = false;//ai生成按钮
  1132. })
  1133. }
  1134. private startCountdown() {
  1135. let that = this;
  1136. if (that.isRunning) return;
  1137. that.isRunning = true;
  1138. // startBtn.disabled = true;
  1139. // that.countdownValue = 3;
  1140. // that.countdownInterval = setInterval(() => {
  1141. // that.countdownValue--;
  1142. // if (that.countdownValue >= 0) {
  1143. // if (that.countdownValue === 0) {
  1144. // clearInterval(that.countdownInterval);
  1145. // that.isRunning = false;
  1146. // that.dialogShow = false;
  1147. // }
  1148. // }
  1149. // }, 1000);
  1150. }
  1151. //更新选中关联项目剩余次数
  1152. private updateCheckedProjectLastNum(projectId) {
  1153. let that = this;
  1154. const formData = new FormData();
  1155. // const userInfo: any = JSON.parse(window.localStorage.getItem("userInfoV1")!);
  1156. formData.append('ServiceCode', that.serviceCodeArray.join(','));
  1157. formData.append('projectid', projectId);
  1158. GetProjectlist(formData).then(response => {
  1159. if (response.StatusCode == 200) {
  1160. that.checkedProject = response.Data[0];
  1161. } else {
  1162. // console.log(response.Info)
  1163. }
  1164. });
  1165. }
  1166. //获取关联项目列表
  1167. GetProjectListFn() {
  1168. let that = this;
  1169. const formData = new FormData();
  1170. const userInfo: any = JSON.parse(window.localStorage.getItem("userInfoV1")!);
  1171. formData.append('ServiceCode', that.serviceCodeArray.join(','));
  1172. if (that.projectSearchValue.trim().length != 0) {
  1173. formData.append('keyWord', that.projectSearchValue);
  1174. }
  1175. GetProjectlist(formData).then(response => {
  1176. if (response.StatusCode == 200) {
  1177. if (response.Data.length == 0) {
  1178. that.projectActionShow = true;
  1179. } else {
  1180. that.projectList = response.Data;
  1181. that.projectActionListShow = true;
  1182. }
  1183. } else {
  1184. that.projectActionShow = true;
  1185. }
  1186. that.showChooseProject = false;
  1187. });
  1188. }
  1189. //跳转小程序
  1190. private toXiaoCX() {
  1191. toXiaoChengxu(`${process.env.VUE_APP_BASE_DISID6}`);
  1192. }
  1193. //跳转项目报备链接
  1194. private toProjectLink() {
  1195. this.showProjectPopover = false;
  1196. // window.location.href = this.addProjectLink;
  1197. toXiaoChengxu(`${process.env.VUE_APP_BASE_DISID9}`,'packageC/projectFiling/index');
  1198. }
  1199. //获取风格选项图片列表
  1200. private getPicList() {
  1201. let that = this;
  1202. const formData = new FormData();
  1203. // const userInfo: any = JSON.parse(window.localStorage.getItem("userInfoV1")!);
  1204. // let roleIdArray = [];
  1205. // if (userInfo.roles.length > 0) {
  1206. // userInfo.roles.forEach(item => {
  1207. // roleIdArray.push(item.roleId);
  1208. // })
  1209. // }
  1210. // formData.append('roleIds', roleIdArray.join(','));
  1211. // formData.append('WXuserid', userInfo.loginName);
  1212. formData.append('baseType', 0);
  1213. // formData.append('wecomType', this.wecomType);
  1214. // const isRefresh = userInfo.isRefreshProvider === '是' ? 1 : 0;//0=否 1=是
  1215. const isRefreshProvider = window.localStorage.getItem("isRefreshProvider");
  1216. const isRefresh = isRefreshProvider === '是' ? 1 : 0;//0=否 1=是
  1217. formData.append('isRefresh', isRefresh);
  1218. GetDictList(formData).then(response => {
  1219. if (response.StatusCode == 200) {
  1220. that.isNeedProject = response.Data.isNeedProject;
  1221. that.addProjectLink = response.Data.projectAddress;
  1222. // 字典获取选择列表
  1223. // 设计风格
  1224. this.designStyles = response.Data.dict.DesignStyle;
  1225. // 仿石漆电子色卡选项
  1226. this.stoneColors = response.Data.dict.ColorCard;
  1227. // 墙面工艺选项
  1228. this.deepSlotProcesses = response.Data.dict.DeepGrooveTech;
  1229. if (this.deepSlotProcesses && this.deepSlotProcesses.length > 0) {
  1230. // 墙面分割线选项
  1231. this.splitWays = this.deepSlotProcesses[0].subitems;
  1232. }
  1233. // 窗套样式选项
  1234. this.windowFrames = response.Data.dict.WindowsColor;
  1235. // 浇筑栏杆选项
  1236. this.railings = response.Data.dict.CastRailing;
  1237. // 琉璃瓦选项
  1238. this.tiles = response.Data.dict.NewGlazedTile;
  1239. // 外墙平涂
  1240. this.color_options = response.Data.dict.outsideColor;
  1241. // 墙裙
  1242. this.skirtTypes = response.Data.dict.outsideSkirtType;
  1243. // 浮雕
  1244. this.outsideRelief = response.Data.dict.outsideRelief;
  1245. // 窗套样式
  1246. this.WindowStyle = response.Data.dict.WindowStyle;
  1247. // 罗马柱选项
  1248. if (this.designStyles && this.designStyles[0] && this.designStyles[0].subitems) {
  1249. this.ColumnTypes = this.designStyles[0].subitems || [];
  1250. this.selectedColumnType = this.designStyles[0].subitems[0].value || '';
  1251. }
  1252. if (this.$route.query.F_id) {
  1253. this.GetEntityData(this.$route.query.F_id);
  1254. } else {
  1255. // 判断如果不是服务商,也不用展示
  1256. if (that.serviceCodeArray.length == 0) {
  1257. that.projectBoxShow = false;
  1258. } else {
  1259. that.projectBoxShow = that.isNeedProject;
  1260. if (that.projectBoxShow == true){
  1261. that.GetPointsFn();
  1262. }
  1263. }
  1264. that.save_projectBoxShow_org = that.projectBoxShow;
  1265. this.zgInitData();
  1266. }
  1267. } else {
  1268. that.$toast(response.Info)
  1269. console.log(response.Info);
  1270. }
  1271. }).catch((err) => {
  1272. console.log("=======err=", err)
  1273. // that.$toast(err)
  1274. })
  1275. }
  1276. // 初始化外墙质感
  1277. private zgInitData() {
  1278. this.DesignStyle = this.designStyles[0].value;
  1279. this.ColorCard = this.stoneColors[0].value;
  1280. this.selectedProcess = this.deepSlotProcesses[0].value;
  1281. if (this.selectedProcess != '无' && this.selectedProcess != '平涂'){
  1282. this.selectedSplit = this.splitWays[0].value;
  1283. }
  1284. this.selectedWindowFrame = this.windowFrames[0].value;
  1285. this.selectedRailing = this.railings[0].value;
  1286. this.selectedTile = this.tiles[0].value;
  1287. this.selectedSkirtType = this.skirtTypes[0].value;
  1288. this.selectedReliefType = this.outsideRelief[0].value;
  1289. this.selectedWindowStyle = this.WindowStyle[0].value;
  1290. }
  1291. //关联列表模糊查询
  1292. private onSearch() {
  1293. this.GetProjectListFn();
  1294. }
  1295. //选择关联项目
  1296. private chooseProject() {
  1297. let that = this;
  1298. that.showChooseProject = true;
  1299. that.GetProjectListFn();
  1300. }
  1301. //确认选择
  1302. private chooseSure() {
  1303. let that = this;
  1304. // if (that.projectList[that.checkedProjectId].AvailableQuantity == 0) {
  1305. // this.projectActionNumShow = true;
  1306. // return;
  1307. // } else {
  1308. that.checkedProject = that.projectList[that.checkedProjectId];
  1309. that.projectActionListShow = false;
  1310. // }
  1311. }
  1312. }
  1313. </script>
  1314. <style>
  1315. .actionsTit {
  1316. width: fit-content;
  1317. font-size: 11px;
  1318. height: 34px;
  1319. padding: 5px 10px;
  1320. }
  1321. .van-popover--dark .van-popover__action {
  1322. background-color: #777A7F;
  1323. }
  1324. .van-popover--dark[data-popper-placement^=bottom] .van-popover__arrow {
  1325. border-bottom-color: #777A7F;
  1326. }
  1327. .design-container .van-tab__text {
  1328. font-size: 15px;
  1329. font-weight: 500;
  1330. line-height: 2.6rem;
  1331. }
  1332. .design-container .van-tab--active .van-tab__text {
  1333. font-size: 17px;
  1334. }
  1335. .design-container .van-tabs__nav {
  1336. background-color: transparent;
  1337. }
  1338. </style>
  1339. <style scoped lang="scss">
  1340. .design-container {
  1341. /* margin: 0 auto;
  1342. max-width: 750px; */
  1343. background-color: #f8f9fa;
  1344. min-height: 100vh;
  1345. flex-direction: column;
  1346. }
  1347. .point-box{
  1348. width: 100%;
  1349. box-sizing: border-box;
  1350. font-size: 14px;
  1351. color: #999;
  1352. text-align: left;
  1353. margin-left: 20px;
  1354. span{
  1355. color: #000;
  1356. }
  1357. }
  1358. .container {
  1359. // padding: 0 20px;
  1360. }
  1361. .padded-lr-20 {
  1362. padding: 0 20px;
  1363. }
  1364. .top-nav {
  1365. display: flex;
  1366. justify-content: space-between;
  1367. align-items: center;
  1368. padding: 16px 20px;
  1369. background-color: white;
  1370. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  1371. position: sticky;
  1372. top: 0;
  1373. z-index: 10;
  1374. }
  1375. .back-btn,
  1376. .more-btn {
  1377. width: 40px;
  1378. height: 40px;
  1379. display: flex;
  1380. justify-content: center;
  1381. align-items: center;
  1382. cursor: pointer;
  1383. }
  1384. .title {
  1385. font-size: 15px;
  1386. font-weight: bold;
  1387. color: #333;
  1388. }
  1389. .history-section {
  1390. margin: 20px 0;
  1391. }
  1392. .history-header {
  1393. display: flex;
  1394. align-items: center;
  1395. gap: 12px;
  1396. padding: 12px 16px;
  1397. background-color: #ffffff;
  1398. border-radius: 18px;
  1399. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  1400. border: 1px solid #e9ecef;
  1401. /* margin-bottom: 10px; */
  1402. }
  1403. .icon-clock {
  1404. font-size: 12px;
  1405. margin-right: 8px;
  1406. }
  1407. .history-header span {
  1408. font-weight: 500;
  1409. color: #EC8868;
  1410. }
  1411. .history-header .badge-dot {
  1412. width: 5px;
  1413. height: 5px;
  1414. background-color: #ff4d4f;
  1415. border-radius: 50%;
  1416. }
  1417. .history-content {
  1418. padding: 20px;
  1419. border-radius: 12px;
  1420. background-color: white;
  1421. text-align: center;
  1422. border: 1px dashed #ddd;
  1423. }
  1424. .no-history {
  1425. color: #999;
  1426. font-size: 12px;
  1427. }
  1428. .image-selection {
  1429. text-align: center;
  1430. }
  1431. .image-placeholder {
  1432. position: relative;
  1433. display: flex;
  1434. flex-direction: column;
  1435. justify-content: center;
  1436. align-items: center;
  1437. height: 200px;
  1438. margin-bottom: 20px;
  1439. background-color: #ffffff;
  1440. border-radius: 12px;
  1441. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  1442. border: 1px dashed #ddd;
  1443. padding: 10px;
  1444. padding-bottom: 50px;
  1445. }
  1446. .project-placeholder {
  1447. position: relative;
  1448. display: flex;
  1449. flex-direction: column;
  1450. align-items: center;
  1451. margin-bottom: 20px;
  1452. background-color: #ffffff;
  1453. border-radius: 12px;
  1454. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  1455. border: 1px dashed #ddd;
  1456. padding: 10px;
  1457. padding-bottom: 30px;
  1458. }
  1459. .project-add-box {
  1460. width: 100%;
  1461. flex-direction: row;
  1462. display: flex;
  1463. justify-content: space-between;
  1464. align-items: center;
  1465. margin-bottom: 20px;
  1466. }
  1467. ::v-deep .van-button--normal {
  1468. font-size: 16px;
  1469. border-radius: 10px;
  1470. }
  1471. .project-action-box {
  1472. flex-direction: column;
  1473. display: flex;
  1474. box-sizing: border-box;
  1475. padding: 15px 5px 45px 5px;
  1476. width: 100%;
  1477. img {
  1478. width: 100%;
  1479. height: auto;
  1480. }
  1481. .tip {
  1482. padding: 0 20px;
  1483. font-size: 16px;
  1484. font-weight: 700;
  1485. }
  1486. .tip-content {
  1487. padding: 0 20px;
  1488. margin-top: 30px;
  1489. font-size: 14px;
  1490. }
  1491. .btn {
  1492. height: 44px;
  1493. line-height: 44px;
  1494. text-align: center;
  1495. margin: 20px;
  1496. font-size: 16px;
  1497. color: #FFFFFF;
  1498. background-color: #2484F2;
  1499. border-radius: 10px;
  1500. }
  1501. .btn2 {
  1502. width: 100%;
  1503. font-size: 14px;
  1504. text-align: center;
  1505. }
  1506. }
  1507. .project-action-list-box {
  1508. flex-direction: column;
  1509. display: flex;
  1510. box-sizing: border-box;
  1511. padding: 0px 15px 0px 15px;
  1512. .search-box-bg {
  1513. left: 0px;
  1514. right: 0px;
  1515. padding: 15px;
  1516. box-sizing: border-box;
  1517. background-color: #ffffff;
  1518. position: absolute;
  1519. z-index: 10;
  1520. .search-box {
  1521. flex-direction: row;
  1522. display: flex;
  1523. border: 1px solid #2484F2;
  1524. background-color: #FFFFFF;
  1525. align-items: center;
  1526. box-sizing: border-box;
  1527. padding-right: 5px;
  1528. .btn {
  1529. width: 50px;
  1530. height: 28px;
  1531. font-size: 11px;
  1532. border-radius: 5px;
  1533. }
  1534. }
  1535. ::v-deep .van-search {
  1536. padding: 0;
  1537. border-radius: 15px;
  1538. }
  1539. }
  1540. .list-item {
  1541. flex-direction: column;
  1542. display: flex;
  1543. box-sizing: border-box;
  1544. border-radius: 10px;
  1545. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  1546. margin-top: 20px;
  1547. padding: 15px;
  1548. position: relative;
  1549. .img-item {
  1550. position: absolute;
  1551. bottom: 0;
  1552. right: 5px;
  1553. }
  1554. .img-checked {
  1555. width: 30px;
  1556. }
  1557. .title-item {
  1558. flex-direction: row;
  1559. display: flex;
  1560. justify-content: space-between;
  1561. align-items: center;
  1562. margin-bottom: 5px;
  1563. .title {
  1564. font-size: 15px;
  1565. font-weight: 700;
  1566. }
  1567. .status {
  1568. font-size: 14px;
  1569. color: #999999;
  1570. min-width: 45px;
  1571. margin-left: 10px;
  1572. }
  1573. }
  1574. .user-item {
  1575. margin-top: 8px;
  1576. .txt {
  1577. font-size: 14px;
  1578. color: #999999;
  1579. margin-left: 10px;
  1580. }
  1581. }
  1582. }
  1583. .btn-box {
  1584. position: absolute;
  1585. bottom: 0px;
  1586. left: 0px;
  1587. right: 0px;
  1588. box-sizing: border-box;
  1589. padding: 15px;
  1590. background-color: #ffffff;
  1591. z-index: 10;
  1592. .btn-item {
  1593. position: relative;
  1594. flex-direction: row;
  1595. display: flex;
  1596. justify-content: flex-end;
  1597. align-items: center;
  1598. border-radius: 8px;
  1599. box-sizing: border-box;
  1600. margin-left: 20px;
  1601. background-color: rgba(134, 144, 156, 1);
  1602. .img-left-icon {
  1603. width: 66px;
  1604. height: 53px;
  1605. position: absolute;
  1606. left: -20px;
  1607. bottom: -3px;
  1608. }
  1609. .btn {
  1610. width: 133px;
  1611. height: 38px;
  1612. line-height: 38px;
  1613. opacity: 1;
  1614. border-radius: 8px;
  1615. text-align: center;
  1616. font-size: 14px;
  1617. color: #FFFFFF;
  1618. background: rgba(36, 132, 242, 1);
  1619. }
  1620. }
  1621. }
  1622. }
  1623. .list-item-checked {
  1624. width: 100%;
  1625. flex-direction: column;
  1626. display: flex;
  1627. box-sizing: border-box;
  1628. border-radius: 10px;
  1629. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  1630. padding: 15px;
  1631. margin-bottom: 20px;
  1632. position: relative;
  1633. .img-item {
  1634. position: absolute;
  1635. bottom: 0;
  1636. right: 5px;
  1637. }
  1638. .img-checked {
  1639. width: 30px;
  1640. }
  1641. .title-item {
  1642. flex-direction: row;
  1643. display: flex;
  1644. justify-content: space-between;
  1645. align-items: center;
  1646. margin-bottom: 5px;
  1647. .title {
  1648. font-size: 15px;
  1649. font-weight: 700;
  1650. }
  1651. .status {
  1652. font-size: 14px;
  1653. color: #999999;
  1654. min-width: 45px;
  1655. margin-left: 10px;
  1656. }
  1657. }
  1658. .user-item {
  1659. flex-direction: row;
  1660. display: flex;
  1661. justify-content: flex-start;
  1662. align-items: center;
  1663. margin-top: 8px;
  1664. .txt {
  1665. font-size: 14px;
  1666. color: #999999;
  1667. margin-left: 10px;
  1668. }
  1669. }
  1670. }
  1671. .selected-image-preview {
  1672. width: 100%;
  1673. height: 100%;
  1674. display: flex;
  1675. justify-content: center;
  1676. align-items: center;
  1677. }
  1678. .preview-image {
  1679. max-width: 100%;
  1680. max-height: 100%;
  1681. object-fit: contain;
  1682. }
  1683. .placeholder-text {
  1684. color: #999;
  1685. font-size: 15px;
  1686. text-align: center;
  1687. margin-bottom: 20px;
  1688. margin-top: 10px;
  1689. }
  1690. .placeholder-text-tit {
  1691. color: #999;
  1692. font-size: 15px;
  1693. text-align: center;
  1694. margin-bottom: 20px;
  1695. margin-top: -10px;
  1696. }
  1697. .image-buttons {
  1698. position: absolute;
  1699. right: 10px;
  1700. bottom: 10px;
  1701. display: flex;
  1702. gap: 16px;
  1703. width: 100%;
  1704. justify-content: flex-end;
  1705. }
  1706. .image-btn {
  1707. padding: 8px 16px;
  1708. border: none;
  1709. border-radius: 8px;
  1710. /* background-color: #666; */
  1711. background-color: #07c160;
  1712. color: white;
  1713. font-size: 12px;
  1714. cursor: pointer;
  1715. display: flex;
  1716. align-items: center;
  1717. gap: 8px;
  1718. transition: all 0.2s ease;
  1719. }
  1720. /* .image-btn:hover {
  1721. background-color: #555;
  1722. } */
  1723. .design-option {
  1724. margin: 20px 0;
  1725. position: relative;
  1726. }
  1727. .rightArrows {
  1728. position: absolute;
  1729. right: -10px;
  1730. top: calc(50% - 10px);
  1731. img {
  1732. height: auto;
  1733. }
  1734. }
  1735. .option-title {
  1736. font-size: 15px;
  1737. font-weight: 600;
  1738. color: #333;
  1739. margin-bottom: 12px;
  1740. }
  1741. .option-title-tit {
  1742. display: flex;
  1743. align-items: center;
  1744. span {
  1745. display: inline-block;
  1746. font-size: 11px;
  1747. color: #959fab;
  1748. line-height: 20px;
  1749. }
  1750. i {
  1751. display: block;
  1752. margin: 0 2px 0 5px;
  1753. line-height: 20px;
  1754. font-weight: bold;
  1755. }
  1756. }
  1757. /* 修改为grid布局,实现2x2排列 */
  1758. .option-grid {
  1759. display: grid;
  1760. grid-template-columns: repeat(2, 1fr);
  1761. gap: 10px;
  1762. }
  1763. .option-item {
  1764. position: relative;
  1765. padding: 10px;
  1766. border: 1px solid #ddd;
  1767. border-radius: 8px;
  1768. background-color: white;
  1769. text-align: center;
  1770. cursor: pointer;
  1771. transition: all 0.2s ease;
  1772. }
  1773. .option-item:hover {
  1774. transform: translateY(-2px);
  1775. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  1776. }
  1777. .option-item.active {
  1778. border-color: #E96337;
  1779. /* background-color: #fff8e6; */
  1780. }
  1781. .style-name {
  1782. font-size: 12px;
  1783. color: #666;
  1784. }
  1785. .design-colors-grid {
  1786. display: flex;
  1787. overflow-x: auto;
  1788. gap: 12px;
  1789. padding: 4px;
  1790. scroll-behavior: smooth;
  1791. cursor: grab;
  1792. user-select: none;
  1793. /* 防止拖拽时选中文本 */
  1794. }
  1795. .design-colors-grid::-webkit-scrollbar {
  1796. display: none;
  1797. /* 隐藏滚动条 */
  1798. }
  1799. .design-colors-grid .option-item {
  1800. padding: 10px 5px;
  1801. // width: 160px;
  1802. // flex: 0 0 auto; /* 防止压缩 */
  1803. }
  1804. .style-image {
  1805. // width: 141px;
  1806. // height: 100px;
  1807. width: 50px;
  1808. height: 50px;
  1809. object-fit: cover;
  1810. border-radius: 4px;
  1811. margin-bottom: 4px;
  1812. }
  1813. .magnifyingGlassBox {
  1814. position: absolute;
  1815. top: 4px;
  1816. right: 4px;
  1817. width: 18px;
  1818. height: 18px;
  1819. border-radius: 50%;
  1820. background-color: rgba(0, 0, 0, 0.5);
  1821. display: flex;
  1822. justify-content: center;
  1823. align-items: center;
  1824. img {
  1825. width: 14px;
  1826. height: auto;
  1827. }
  1828. }
  1829. /* 仿石漆电子色卡特殊样式 - 横向滚动 */
  1830. .stone-colors-grid {
  1831. display: flex;
  1832. overflow-x: auto;
  1833. gap: 12px;
  1834. padding: 4px;
  1835. scroll-behavior: smooth;
  1836. cursor: grab;
  1837. user-select: none;
  1838. /* 防止拖拽时选中文本 */
  1839. }
  1840. .stone-colors-grid::-webkit-scrollbar {
  1841. display: none;
  1842. /* 隐藏滚动条 */
  1843. }
  1844. .stone-colors-grid .option-item {
  1845. width: 50px;
  1846. height: 80px;
  1847. flex: 0 0 auto;
  1848. /* 防止压缩 */
  1849. }
  1850. .color-sample {
  1851. width: 50px;
  1852. height: 50px;
  1853. background-size: cover;
  1854. background-position: center;
  1855. border-radius: 4px;
  1856. margin-bottom: 8px;
  1857. }
  1858. .color-code {
  1859. font-size: 12px;
  1860. color: #666;
  1861. }
  1862. .process-icon,
  1863. .split-icon,
  1864. .railing-icon,
  1865. .tile-icon {
  1866. width: 50px;
  1867. height: 50px;
  1868. display: flex;
  1869. align-items: center;
  1870. justify-content: center;
  1871. margin-bottom: 8px;
  1872. font-size: 15px;
  1873. }
  1874. .split-icon,
  1875. .railing-icon,
  1876. .tile-icon {
  1877. background-size: contain;
  1878. background-repeat: no-repeat;
  1879. background-position: center;
  1880. }
  1881. .frame-icon {
  1882. width: 50px;
  1883. height: 50px;
  1884. border-radius: 4px;
  1885. margin-bottom: 8px;
  1886. }
  1887. .tile-color {
  1888. width: 50px;
  1889. height: 50px;
  1890. border-radius: 4px;
  1891. margin-bottom: 8px;
  1892. }
  1893. .process-name,
  1894. .split-name,
  1895. .frame-name,
  1896. .railing-name,
  1897. .tile-name {
  1898. font-size: 12px;
  1899. color: #666;
  1900. line-height: 13px;
  1901. padding-top: 2px;
  1902. display: inline-block;
  1903. }
  1904. .generate-section {
  1905. display: flex;
  1906. flex-direction: column;
  1907. align-items: center;
  1908. gap: 8px;
  1909. /* 按钮和文字说明之间的间距 */
  1910. margin-bottom: 20px;
  1911. }
  1912. .generate-btn {
  1913. padding: 16px;
  1914. background-color: #E96337;
  1915. border: none;
  1916. border-radius: 12px;
  1917. color: white;
  1918. font-weight: 600;
  1919. cursor: pointer;
  1920. transition: all 0.2s ease;
  1921. text-align: center;
  1922. min-width: 90%;
  1923. }
  1924. /* .generate-btn:hover {
  1925. background-color: #e68a00;
  1926. } */
  1927. .btn-text {
  1928. font-size: 16px;
  1929. font-weight: bold;
  1930. }
  1931. .btn-note {
  1932. font-size: 12px;
  1933. color: #999;
  1934. text-align: center;
  1935. line-height: 1.2;
  1936. }
  1937. .header {
  1938. /*height: 50px;*/
  1939. /*line-height: 50px;*/
  1940. /*text-align: center;*/
  1941. /*background: #fff;*/
  1942. border-bottom: 1px solid #f8f8f8;
  1943. .van-nav-bar__title {
  1944. font-size: 20px;
  1945. color: #333;
  1946. }
  1947. .van-icon {
  1948. font-size: 20px;
  1949. color: #333 !important;
  1950. }
  1951. }
  1952. .dialog-point-box{
  1953. flex-direction: column;
  1954. display: flex;
  1955. box-sizing: border-box;
  1956. position: relative;
  1957. padding: 20px 15px;
  1958. position: relative;
  1959. .title{
  1960. font-size: 22px;
  1961. }
  1962. .content{
  1963. font-size: 14px;
  1964. margin-top: 10px;
  1965. color: #999;
  1966. }
  1967. .txt-color1{
  1968. color: #E55B2A;
  1969. }
  1970. .txt-color2{
  1971. color: #000;
  1972. }
  1973. .dialog-btn-point1{
  1974. background-color: #E55B2A;
  1975. border-radius: 10px;
  1976. font-size: 18px;
  1977. color:#fff;
  1978. margin-top: 20px;
  1979. padding: 6px 0;
  1980. box-sizing: border-box;
  1981. text-align: center;
  1982. }
  1983. .dialog-btn-point2{
  1984. border-radius: 10px;
  1985. font-size: 16px;
  1986. margin-top: 10px;
  1987. padding: 6px 0;
  1988. box-sizing: border-box;
  1989. text-align: center;
  1990. }
  1991. .point-icon{
  1992. width: 120px;
  1993. position: absolute;
  1994. top: -55px;
  1995. right: -10px;
  1996. }
  1997. }
  1998. .dialog-box {
  1999. flex-direction: column;
  2000. display: flex;
  2001. box-sizing: border-box;
  2002. position: relative;
  2003. .dialog-content {
  2004. padding: 20px 20px 10px 20px;
  2005. }
  2006. .dialog-btn {
  2007. height: 44px;
  2008. line-height: 44px;
  2009. text-align: center;
  2010. margin: 20px;
  2011. font-size: 16px;
  2012. color: #FFFFFF;
  2013. background-color: #2484F2;
  2014. border-radius: 10px;
  2015. }
  2016. }
  2017. ::v-deep .van-button__loading+.van-button__text {
  2018. margin-left: 10px;
  2019. }
  2020. /* 样式调整:隐藏原生 input,按钮样式保持不变 */
  2021. .upload-container {
  2022. position: relative;
  2023. display: inline-block;
  2024. .native-upload-input {
  2025. position: absolute;
  2026. top: 0;
  2027. left: 0;
  2028. width: 100%;
  2029. height: 100%;
  2030. opacity: 0;
  2031. cursor: pointer;
  2032. z-index: 1;
  2033. }
  2034. .image-btn {
  2035. padding: 8px 16px;
  2036. border: none;
  2037. border-radius: 8px;
  2038. background-color: #2484F2;
  2039. color: white;
  2040. font-size: 12px;
  2041. cursor: pointer;
  2042. display: flex;
  2043. align-items: center;
  2044. gap: 8px;
  2045. transition: all 0.2s ease;
  2046. }
  2047. }
  2048. .radio-group-container1 {
  2049. padding: 16px 0;
  2050. position: relative;
  2051. .color-plus {
  2052. width: 100%;
  2053. height: 90px;
  2054. margin: 10px auto;
  2055. position: relative;
  2056. margin: 0px auto 10px;
  2057. .cardImg {
  2058. width: 100%;
  2059. height: 100%;
  2060. img {
  2061. width: 100%;
  2062. height: auto;
  2063. }
  2064. }
  2065. .color-plus-info {
  2066. position: absolute;
  2067. width: calc(100% - 20px);
  2068. height: 100%;
  2069. top: 0;
  2070. left: 20px;
  2071. display: flex;
  2072. flex-direction: column;
  2073. justify-content: center;
  2074. .color-plus-tit {
  2075. font-size: 16px;
  2076. font-weight: 500;
  2077. line-height: 26px;
  2078. width: 100%;
  2079. color: #000;
  2080. }
  2081. p {
  2082. font-size: 11px;
  2083. line-height: 15px;
  2084. color: rgba(56, 56, 56, 1);
  2085. }
  2086. .color-plus-subheading {
  2087. font-size: 11px;
  2088. line-height: 15px;
  2089. width: 100%;
  2090. color: #86909C;
  2091. }
  2092. }
  2093. }
  2094. // 上图下文字
  2095. .custom-radio-group4 {
  2096. display: flex;
  2097. flex-wrap: wrap;
  2098. // column-gap: 2px;
  2099. // row-gap: 16px;
  2100. }
  2101. .custom-radio4 {
  2102. width: calc(25% - 2px);
  2103. margin: 0 1px 16px;
  2104. }
  2105. .custom-radio4:nth-child(4n) {
  2106. margin-right: 0;
  2107. }
  2108. .radio-content-text {
  2109. padding: 12px 0;
  2110. text-align: center;
  2111. border: 1px solid #E5E5E5;
  2112. border-radius: 4px;
  2113. box-sizing: border-box;
  2114. transition: all 0.2s;
  2115. font-size: 12px;
  2116. }
  2117. /* 选中指示器(橙色三角形背景) */
  2118. .check-indicator {
  2119. position: absolute;
  2120. width: 20px;
  2121. height: 20px;
  2122. background-color: #F0A43A;
  2123. /* 三角形效果 */
  2124. clip-path: polygon(0 0, 0 100%, 100% 0);
  2125. .van-icon {
  2126. position: relative;
  2127. }
  2128. }
  2129. /* 选项内容容器 */
  2130. .radio-content {
  2131. position: relative;
  2132. width: 100%;
  2133. }
  2134. .custom-radio-text {
  2135. font-size: 12px;
  2136. text-align: center;
  2137. line-height: 14px;
  2138. width: 100%;
  2139. margin: 0 auto;
  2140. position: absolute;
  2141. z-index: 2;
  2142. color: #000;
  2143. bottom: 4px;
  2144. left: 0;
  2145. }
  2146. .radio-content-color {
  2147. font-size: 12px;
  2148. width: 60px;
  2149. height: 60px;
  2150. position: relative;
  2151. border: 1px solid #E5E5E5;
  2152. margin: 0 auto;
  2153. .cardImg {
  2154. width: 100%;
  2155. height: 100%;
  2156. }
  2157. .check-indicator {
  2158. left: 0;
  2159. top: 0;
  2160. .van-icon {
  2161. top: -5px;
  2162. left: 0px;
  2163. }
  2164. }
  2165. }
  2166. .radio-content-text {
  2167. border-radius: 4px;
  2168. .check-indicator {
  2169. border-radius: 2px 0 0 0;
  2170. top: 0;
  2171. left: 0;
  2172. .van-icon {
  2173. top: -5px;
  2174. left: -3px;
  2175. }
  2176. }
  2177. }
  2178. /* 隐藏Vant默认的选中样式 */
  2179. .custom-radio ::v-deep .van-radio__icon {
  2180. display: none;
  2181. }
  2182. .custom-radio ::v-deep .van-radio__label {
  2183. width: 100%;
  2184. margin-left: 0;
  2185. border-radius: inherit;
  2186. flex: 1;
  2187. }
  2188. /* 单个选项样式 */
  2189. .custom-radio {
  2190. flex-shrink: 0;
  2191. align-items: flex-start;
  2192. justify-content: center;
  2193. }
  2194. /* 选中状态的边框样式 */
  2195. ::v-deep .van-radio__icon--checked+.van-radio__label>.radio-content-text {
  2196. border-color: #F0A43A;
  2197. }
  2198. ::v-deep .van-radio__icon--checked+.van-radio__label>.radio-content-color {
  2199. border-color: #F0A43A;
  2200. }
  2201. ::v-deep .van-button--normal {
  2202. font-size: 16px;
  2203. border-radius: 10px;
  2204. }
  2205. }
  2206. </style>