index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736
  1. <template>
  2. <view class="work-container">
  3. <view style="work-banner">
  4. <image :src="loadImgSrc('work-banner.png')" style="width: 100%;height:43vh"></image>
  5. </view>
  6. <view class="grid-body">
  7. <view class="Grid">
  8. <view class="Grid-Item" v-for="item in List" :key="item.id" @click="navClick(item.id)"
  9. hover-class="click-hover" hover-start-time="50" hover-stay-time="50">
  10. <image class="icon-item" :src="loadImgSrc('mygc.png')" v-if="item.title == '民用工程'"></image>
  11. <image class="icon-item" :src="loadImgSrc('gygc.png')" v-if="item.title == '工业工程'"></image>
  12. <image class="icon-item" :src="loadImgSrc('szgc.png')" v-if="item.title == '市政工程'"></image>
  13. <image class="icon-item" :src="loadImgSrc('wxzy.png')" v-if="item.title == '危险作业工程'"></image>
  14. <image class="icon-item" :src="loadImgSrc('dggc.png')" v-if="item.title == '顶管工程'"></image>
  15. <image class="icon-item" :src="loadImgSrc('jjgc.png')" v-if="item.title == '基建工程'"></image>
  16. <view class="GStitle">{{ item.title }}
  17. </view>
  18. </view>
  19. </view>
  20. <view v-if="showPopup" class="popup">
  21. <view class="content">
  22. <view class="line1 top40">
  23. <view style="width: 61rpx;
  24. color: #CEB98D;
  25. height: 61rpx;
  26. display: flex;
  27. justify-content: center;
  28. align-items: center;
  29. border: 3px solid #CEB98D;
  30. border-radius: 50%; margin-right: 20rpx;">旧</view>
  31. <view>旧改工程</view>
  32. </view>
  33. <view class="line2 btn-grp">
  34. <view class="btn-grp-item" v-for="(item, index) in OldProjectList" :key="index"
  35. @click="OldProject(item.dictValue)">
  36. <image :src="loadImgSrc('sn.png')" class="line2-btn-big" v-if="item.dictLabel == '室内工程'">
  37. </image>
  38. <image :src="loadImgSrc('ty.png')" class="line2-btn-big" v-if="item.dictLabel == '庭院工程'">
  39. </image>
  40. <image :src="loadImgSrc('jk.png')" class="line2-btn-big" v-if="item.dictLabel == '架空'">
  41. </image>
  42. {{item.dictLabel}}
  43. </view>
  44. </view>
  45. <view class="line1">
  46. <view style="width: 61rpx;
  47. color: #85c9c2;
  48. height: 61rpx;
  49. display: flex;
  50. justify-content: center;
  51. align-items: center;
  52. border: 3px solid #85c9c2;
  53. border-radius: 50%; margin-right: 20rpx;">新</view>
  54. <view>新建工程</view>
  55. </view>
  56. <view class="line2 btn-grp">
  57. <view class="btn-grp-item" v-for="(item, index) in NewProjectList" :key="index"
  58. @click="NewProject(item.dictValue)">
  59. <image :src="loadImgSrc('sn2.png')" class="line2-btn-big" v-if="item.dictLabel == '室内工程'">
  60. </image>
  61. <image :src="loadImgSrc('ty2.png')" class="line2-btn-big" v-if="item.dictLabel == '庭院工程'">
  62. </image>
  63. <image :src="loadImgSrc('jk2.png')" class="line2-btn-big" v-if="item.dictLabel == '架空'">
  64. </image>
  65. {{item.dictLabel}}
  66. </view>
  67. </view>
  68. </view>
  69. <!-- <view class="btn-group">
  70. <view class="btn_position">
  71. <view class="cancel" @click="showMinYong">取消</view>
  72. </view>
  73. </view> -->
  74. </view>
  75. <view v-if="showPopup" class="mask" @click="showMinYong"></view>
  76. </view>
  77. <view class="share">
  78. <view :class="{'share-box': shareState}" @click="handleHiddenShare">
  79. </view>
  80. <view class="share-item" :class="{'share-show': shareState}">
  81. <view class="share-to">
  82. <text>请选择</text>
  83. </view>
  84. <scroll-view scroll-y="true" class="scroll-Y">
  85. <view class="content">
  86. <view class="block" v-for="(item, index) in typeList" :key="index" @click="showTypeSheet(item)">
  87. <!-- <image :src="item.image" mode="aspectFill"></image> -->
  88. <text>{{item.dictLabel}}</text>
  89. </view>
  90. </view>
  91. </scroll-view>
  92. <view class="cancel" @click.stop="handleHiddenShare">
  93. <text>取消</text>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. </template>
  100. <script>
  101. import {
  102. getDicts
  103. } from "@/api/system/dict/data";
  104. export default {
  105. data() {
  106. return {
  107. showPopup: false,
  108. shareState: false,
  109. array: [],
  110. projectType: '', //工程类型
  111. OldProjectList: '', //旧改工程
  112. NewProjectList: '', //民用工程
  113. typeList: '', //二次弹窗数据
  114. enginType: '',
  115. enginClassification: '', // 旧改节点 数据字典
  116. enginClassValue: '', //二次节点 数据字典
  117. current: 0,
  118. swiperDotIndex: 0,
  119. List: [{
  120. id: 1,
  121. img: '/static/logo.png',
  122. title: '民用工程'
  123. },
  124. {
  125. id: 2,
  126. img: '/static/logo.png',
  127. title: '工业工程'
  128. },
  129. {
  130. id: 3,
  131. img: '/static/logo.png',
  132. title: '市政工程'
  133. },
  134. {
  135. id: 4,
  136. img: '/static/logo.png',
  137. title: '危险作业工程'
  138. },
  139. {
  140. id: 5,
  141. img: '/static/logo.png',
  142. title: '顶管工程'
  143. },
  144. {
  145. id: 6,
  146. img: '/static/logo.png',
  147. title: '基建工程'
  148. },
  149. ]
  150. }
  151. },
  152. methods: {
  153. navClick(newId) {
  154. if (newId == 1) {
  155. this.showMinYong()
  156. } else if (newId == 2) {
  157. this.showGongYe();
  158. } else if (newId == 3) {
  159. this.municipalProjectClick();
  160. } else if (newId == 4) {
  161. this.showDangerous();
  162. } else if (newId == 5) {
  163. this.showTopPipe();
  164. } else if (newId == 6) {
  165. this.showInfrastructureDialog();
  166. }
  167. },
  168. // 显示二次弹窗
  169. handleShowSheet() {
  170. this.shareState = true;
  171. },
  172. // 隐藏二次弹窗
  173. handleHiddenShare() {
  174. this.shareState = false;
  175. },
  176. showMinYong() {
  177. this.projectType = 'MinYong';
  178. getDicts("old_renovation").then(response => {
  179. this.OldProjectList = response.data;
  180. });
  181. getDicts("new_built").then(response => {
  182. this.NewProjectList = response.data;
  183. });
  184. this.showPopup = !this.showPopup;
  185. },
  186. //市政工程-首页-点击事件
  187. municipalProjectClick() {
  188. let obj = {
  189. value: '市政工程'
  190. };
  191. uni.navigateTo({
  192. url: '/pages/municipal/municipal?params=' + encodeURIComponent(JSON
  193. .stringify(obj))
  194. });
  195. },
  196. NewProject(e) {
  197. this.enginType = 'new_built'; //写死
  198. this.enginClassification = e;
  199. this.typeList = ''; //置空
  200. console.log("新建", e)
  201. if (e == 'indoor_engin') {
  202. //新建室内
  203. getDicts("new_built_indoor_engin").then(response => {
  204. this.typeList = response.data;
  205. });
  206. } else if (e == 'courtyard') {
  207. //新建庭院
  208. getDicts("new_built_courtyard").then(response => {
  209. console.log("庭院", response.data)
  210. this.typeList = response.data;
  211. });
  212. } else if (e == 'overhead') {
  213. //新建架空
  214. getDicts("new_built_courtyard").then(response => {
  215. console.log("架空", response.data)
  216. this.typeList = response.data;
  217. });
  218. }
  219. this.handleShowSheet();
  220. },
  221. OldProject(e) {
  222. this.enginType = 'old_renovation'; //写死
  223. this.enginClassification = e;
  224. console.log("旧改", e)
  225. this.typeList = ''; //置空
  226. if (e == 'indoor_engin') {
  227. //旧改室内
  228. getDicts("old_renovation_indoor_engin").then(response => {
  229. this.typeList = response.data;
  230. });
  231. } else if (e == 'courtyard') {
  232. //旧改庭院
  233. getDicts("old_renovation_courtyard").then(response => {
  234. console.log("庭院", response.data)
  235. this.typeList = response.data;
  236. });
  237. } else if (e == 'overhead') {
  238. //旧改架空
  239. getDicts("old_renovation_overhead").then(response => {
  240. console.log("架空", response.data)
  241. this.typeList = response.data;
  242. });
  243. }
  244. this.handleShowSheet();
  245. },
  246. //二次弹窗 选择类型
  247. showTypeSheet(item) {
  248. if (this.projectType == 'MinYong') {
  249. //this.showPopup = !this.showPopup; //隐藏第一次弹窗
  250. this.enginClassValue = item.dictValue; //二次节点赋值
  251. const obj = {
  252. enginClassValue: this.enginClassValue, //(拆旧管等 字典值)
  253. enginType: this.enginType, //旧改 还是新建 写死
  254. enginClassification: this.enginClassification //室内 庭院 架空
  255. };
  256. console.log(obj)
  257. //this.handleHiddenShare();
  258. // 室内
  259. if (this.enginClassification == 'indoor_engin') {
  260. uni.navigateTo({
  261. url: '/pages/oldrenovation/indoor/indoor?params=' + encodeURIComponent(JSON.stringify(
  262. obj))
  263. })
  264. }
  265. // 庭院
  266. else if (this.enginClassification == 'courtyard') {
  267. if (this.enginClassValue == '下沟') {
  268. uni.navigateTo({
  269. url: '/pages/oldrenovation/courtyard/courtyard?params=' + encodeURIComponent(
  270. JSON
  271. .stringify(
  272. obj))
  273. })
  274. } else {
  275. uni.navigateTo({
  276. url: '/pages/oldrenovation/courtyard/newcourtyard?params=' + encodeURIComponent(
  277. JSON
  278. .stringify(
  279. obj))
  280. })
  281. }
  282. } else if (this.enginClassification == 'overhead') { //架空
  283. if (this.enginClassValue == '全貌照片') {
  284. uni.navigateTo({
  285. url: '/pages/oldrenovation/overhead/newoverhead?params=' + encodeURIComponent(JSON
  286. .stringify(
  287. obj))
  288. })
  289. } else {
  290. uni.navigateTo({
  291. url: '/pages/oldrenovation/overhead/overhead?params=' + encodeURIComponent(JSON
  292. .stringify(
  293. obj))
  294. })
  295. }
  296. }
  297. } else if (this.projectType == 'GongYe') {
  298. console.log("工业", item)
  299. let obj = {
  300. value: item.dictValue
  301. };
  302. //this.handleHiddenShare();
  303. uni.navigateTo({
  304. url: '/pages/enginproject/enginproject?params=' + encodeURIComponent(JSON
  305. .stringify(
  306. obj))
  307. })
  308. } else if (this.projectType == 'JiJian') {
  309. console.log("基建", item)
  310. let obj = {
  311. value: item.dictValue
  312. };
  313. //this.handleHiddenShare();
  314. uni.navigateTo({
  315. url: '/pages/infrastructure/infrastructure?params=' + encodeURIComponent(JSON
  316. .stringify(
  317. obj))
  318. })
  319. } else if (this.projectType == 'DingGuan') {
  320. console.log("顶管", item)
  321. let obj = {
  322. value: item.dictValue
  323. };
  324. //this.handleHiddenShare();
  325. uni.navigateTo({
  326. url: '/pages/TopPipeWork/TopPipeWork?params=' + encodeURIComponent(JSON
  327. .stringify(
  328. obj))
  329. })
  330. }
  331. },
  332. showGongYe() {
  333. this.projectType = 'GongYe';
  334. //工业工程
  335. getDicts("engin_classification").then(response => {
  336. console.log("工业工程", response.data)
  337. this.typeList = response.data;
  338. console.log("工业工程", response.data)
  339. });
  340. this.handleShowSheet();
  341. },
  342. showTopPipe() {
  343. this.projectType = 'DingGuan';
  344. getDicts("pipe_jack").then(response => {
  345. console.log("顶管工程", response.data)
  346. this.typeList = response.data;
  347. });
  348. this.handleShowSheet();
  349. },
  350. showInfrastructureDialog() {
  351. this.projectType = 'JiJian';
  352. //基建工程
  353. getDicts("engineering_infrastructure").then(response => {
  354. console.log("基建工程", response.data)
  355. this.typeList = response.data;
  356. console.log("基建工程", response.data)
  357. });
  358. this.handleShowSheet();
  359. },
  360. showDangerous() {
  361. console.log("危险作业工程")
  362. uni.navigateTo({
  363. url: '/pages/dangerous/dangerous'
  364. })
  365. },
  366. }
  367. }
  368. </script>
  369. <style lang="scss">
  370. /* #ifndef APP-NVUE */
  371. page {
  372. display: flex;
  373. flex-direction: column;
  374. box-sizing: border-box;
  375. background-color: #fff;
  376. min-height: 100%;
  377. height: auto;
  378. }
  379. view {
  380. font-size: 14px;
  381. line-height: inherit;
  382. }
  383. .work-container {
  384. display: flex;
  385. flex-direction: column;
  386. }
  387. /* #endif */
  388. .text {
  389. text-align: center;
  390. font-size: 26rpx;
  391. margin-top: 10rpx;
  392. }
  393. .grid-item-box {
  394. flex: 1;
  395. /* #ifndef APP-NVUE */
  396. display: flex;
  397. /* #endif */
  398. flex-direction: column;
  399. align-items: center;
  400. justify-content: center;
  401. padding: 15px 0;
  402. }
  403. .uni-margin-wrap {
  404. width: 690rpx;
  405. width: 100%;
  406. ;
  407. }
  408. .swiper {
  409. height: 300rpx;
  410. }
  411. .swiper-box {
  412. height: 150px;
  413. }
  414. .swiper-item {
  415. /* #ifndef APP-NVUE */
  416. display: flex;
  417. /* #endif */
  418. flex-direction: column;
  419. justify-content: center;
  420. align-items: center;
  421. color: #fff;
  422. height: 300rpx;
  423. line-height: 300rpx;
  424. }
  425. @media screen and (min-width: 500px) {
  426. .uni-swiper-dot-box {
  427. width: 400px;
  428. /* #ifndef APP-NVUE */
  429. margin: 0 auto;
  430. /* #endif */
  431. margin-top: 8px;
  432. }
  433. .image {
  434. width: 100%;
  435. }
  436. }
  437. // 弹窗效果
  438. .popup {
  439. position: fixed;
  440. bottom: 0;
  441. left: 0;
  442. width: 100%;
  443. background-color: #fff;
  444. // padding: 20rpx;
  445. box-sizing: border-box;
  446. z-index: 999;
  447. border-top-left-radius: 40rpx;
  448. border-top-right-radius: 40rpx;
  449. }
  450. // 遮罩层
  451. .mask {
  452. position: fixed;
  453. top: 0;
  454. left: 0;
  455. width: 100%;
  456. height: 100%;
  457. background-color: rgba(0, 0, 0, 0.5);
  458. z-index: 888;
  459. }
  460. // 弹窗内容
  461. .content {
  462. .top40 {
  463. margin-top: 30rpx;
  464. }
  465. .line1 {
  466. text-align: center;
  467. display: flex;
  468. justify-content: start;
  469. align-items: center;
  470. padding: 20rpx;
  471. }
  472. .btn-grp {
  473. display: flex;
  474. .btn-grp-item {
  475. width: 33%;
  476. display: flex;
  477. flex-direction: column;
  478. align-items: center;
  479. .line2-btn-big {
  480. width: 128rpx;
  481. height: 128rpx;
  482. margin-bottom: 10rpx;
  483. }
  484. }
  485. }
  486. .line2 {
  487. padding: 20rpx;
  488. // border-bottom: 1px solid black;
  489. view {
  490. margin-bottom: 10rpx;
  491. }
  492. }
  493. }
  494. // 按钮样式
  495. .btn-group {
  496. box-shadow: 0px -2px 6px rgba(0, 0, 0, 0.5);
  497. /* 示例阴影参数,根据需要进行调整 */
  498. .btn_position {
  499. display: flex;
  500. width: 100%;
  501. .cancel {
  502. width: 50%;
  503. text-align: center;
  504. padding: 20rpx 0;
  505. color: #519fe7;
  506. }
  507. .submit {
  508. width: 50%;
  509. background-color: #519fe7;
  510. text-align: center;
  511. padding: 20rpx 0;
  512. color: #fff;
  513. }
  514. }
  515. }
  516. .share {
  517. width: 100%;
  518. height: 100%;
  519. }
  520. .share-box {
  521. width: 100%;
  522. height: 100%;
  523. position: fixed;
  524. top: 0rpx;
  525. left: 0rpx;
  526. bottom: 0rpx;
  527. right: 0rpx;
  528. background-color: rgba(0, 0, 0, 0.4);
  529. transition: .3s;
  530. z-index: 999;
  531. }
  532. // 进入分享动画
  533. .share-show {
  534. transition: all 0.3s ease;
  535. transform: translateY(0%) !important;
  536. }
  537. .scroll-Y {
  538. height: 350rpx;
  539. }
  540. // 离开分享动画
  541. .share-item {
  542. position: fixed;
  543. left: 0;
  544. bottom: 0;
  545. width: 100%;
  546. height: auto;
  547. background-color: #FFFFFF;
  548. transition: all 0.3s ease;
  549. transform: translateY(100%);
  550. z-index: 1999;
  551. border-top-left-radius: 40rpx;
  552. border-top-right-radius: 40rpx;
  553. .share-to {
  554. width: 100%;
  555. height: 3rem;
  556. display: flex;
  557. justify-content: center;
  558. align-items: center;
  559. &::after {
  560. content: '';
  561. width: 240rpx;
  562. height: 0rpx;
  563. border-top: 1px solid #E4E7ED;
  564. -webkit-transform: scaleY(0.5);
  565. transform: scaleY(0.5);
  566. margin-left: 30rpx;
  567. }
  568. &::before {
  569. content: '';
  570. width: 240rpx;
  571. height: 0rpx;
  572. border-top: 1px solid #E4E7ED;
  573. -webkit-transform: scaleY(0.5);
  574. transform: scaleY(0.5);
  575. margin-right: 30rpx;
  576. }
  577. }
  578. .content {
  579. width: 100%;
  580. height: 50%;
  581. display: flex;
  582. flex-wrap: wrap;
  583. .block {
  584. width: 100%;
  585. display: flex;
  586. flex-direction: column;
  587. justify-content: center;
  588. align-items: center;
  589. height: 80rpx;
  590. text {
  591. margin-top: 16rpx;
  592. font-size: 28rpx;
  593. color: #606266;
  594. }
  595. }
  596. }
  597. .cancel {
  598. width: 100%;
  599. height: 3rem;
  600. display: flex;
  601. justify-content: center;
  602. align-items: center;
  603. border-top: 1rpx solid #E4E7ED;
  604. }
  605. }
  606. /*********************九宫格********************* */
  607. .Grid {
  608. display: flex;
  609. flex-wrap: wrap;
  610. justify-content: space-between;
  611. align-content: space-between;
  612. // background: #f7f7f7;
  613. padding: 10rpx 0;
  614. .Grid-Item {
  615. width: 50%;
  616. // height: 100px;
  617. text-align: center;
  618. // border: 1rpx solid #ff0000;
  619. box-sizing: border-box;
  620. .icon-item {
  621. width: 220rpx;
  622. height: 220rpx;
  623. }
  624. .GSimg {
  625. width: 96rpx;
  626. height: 96rpx;
  627. margin-top: 42rpx;
  628. margin-left: 75rpx;
  629. .Image {
  630. width: 96rpx;
  631. height: 96rpx;
  632. }
  633. }
  634. .GStitle {
  635. width: 100%;
  636. color: #516d97;
  637. font-size: 28rpx;
  638. text-align: center;
  639. margin-top: -30rpx;
  640. margin-bottom: 30rpx;
  641. }
  642. }
  643. }
  644. .click-hover {
  645. background-color: #d0d0d0;
  646. }
  647. </style>